Skip to content

Commit

Permalink
build: 0.1.5
Browse files Browse the repository at this point in the history
  • Loading branch information
32teeth committed Sep 29, 2024
1 parent b068371 commit 8bc7ef3
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 29 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

### 0.1.5

Changes in this version:

* feature: sockets

### 0.1.4

What changed in this version?
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ To set up the Generic Node.js Express API, follow these steps:

1. Clone this repository to your local machine:
```bash
git clone git@github.com:32teeth/generic-nodejs-express-api.git
git clone git@github.com:npm-packages-collection/generic-nodejs-express-api.git
```
2. Navigate into the project directory:
```bash
Expand Down
2 changes: 1 addition & 1 deletion bin/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if (process.argv.length < 3) {
const projectName = process.argv[2];
const currentPath = process.cwd();
const projectPath = path.join(currentPath, projectName);
const gitRepo = "https://github.com/32teeth/generic-nodejs-express-api.git";
const gitRepo = "https://github.com/npm-packages-collection/generic-nodejs-express-api.git";

// create project directory
if (fs.existsSync(projectPath)) {
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 11 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"name": "generic-nodejs-express-api",
"name": "@npm-packages-collection/generic-nodejs-express-api",
"description": "Generic NodeJs Express API",
"author": "Eugene Yevhen Andruszczenko <eugene.andruszczenko@gmail.com>",
"contributors": [
"32teeth <eugene.andruszczenko@gmail.com> (https://github.com/32teeth)"
],
"repository": {
"type": "git",
"url": "git+https://github.com/32teeth/generic-nodejs-express-api.git"
"url": "git+https://github.com/npm-packages-collection/generic-nodejs-express-api.git"
},
"license": "CC-BY-SA-4.0",
"version": "0.1.4",
"version": "0.1.5",
"keywords": [
"nodejs",
"express",
Expand All @@ -20,7 +20,7 @@
"web"
],
"publishConfig": {
"registry": "https://registry.npmjs.com/"
"registry": "https://npm.pkg.github.com/"
},
"engines": {
"node": "20.x",
Expand Down Expand Up @@ -60,7 +60,10 @@
"heroku-prebuild": "echo This runs before Heroku installs dependencies.",
"heroku-postbuild": "echo This runs after Heroku installs dependencies, but before Heroku prunes and caches dependencies.",
"heroku-cleanup": "echo This runs after Heroku prunes and caches dependencies.",
"test": "mocha"
"test": "mocha",
"publish:npm": "npm publish --registry https://registry.npmjs.org/",
"publish:github": "npm publish --registry https://npm.pkg.github.com/",
"publish": "npm run publish:npm && npm run publish:github"
},
"pre-commit": {
"run": "hook"
Expand All @@ -84,10 +87,10 @@
"sass": "^1.77.8"
},
"bugs": {
"url": "https://github.com/32teeth/generic-nodejs-express-api/issues"
"url": "https://github.com/npm-packages-collection/generic-nodejs-express-api/issues"
},
"homepage": "https://github.com/32teeth/generic-nodejs-express-api#readme",
"homepage": "https://github.com/npm-packages-collection/generic-nodejs-express-api#readme",
"directories": {
"test": "test"
}
}
}
37 changes: 21 additions & 16 deletions release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ github() {
local version="$1"
local reset="$2"

npm run hook

if [ "$reset" == "--reset" ]; then
git checkout --orphan orphan
fi
Expand All @@ -26,26 +24,33 @@ github() {

gh release create "$version" --generate-notes --title "$version" --notes "Release $version"

#echo "Running npm publish"
#npm publish
#if [ $? -ne 0 ]; then
# echo "npm publish failed"
# exit 1
#else
# echo "npm publish succeeded"
#fi
echo "Running npm publish"
npm run publish
if [ $? -ne 0 ]; then
echo "npm publish failed"
exit 1
else
echo "npm publish succeeded"
fi
}

changelog() {
local file="CHANGELOG.md"
local version="$1"
local changes="What changed in this version?"
local list="* Change 1
* Change 2
* Change 3"
local previous_version=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null)
local changes="Changes in this version:"

# Generate a list of changes between the previous and current version
if [ -n "$previous_version" ]; then
local list=$(git log --pretty=format:"* %s" "$previous_version"..HEAD)
else
local list=$(git log --pretty=format:"* %s")
fi

# Remove the first two lines of the changelog file
sed '1,2d' "$file" > temp_changelog.mdx

# Write the new version's changelog entry
cat <<EOF > "$file"
# Changelog
Expand All @@ -58,9 +63,11 @@ $list
$(cat temp_changelog.mdx)
EOF

# Remove the temporary file
rm temp_changelog.mdx
}


update_version() {
local package="package.json"
version=$(jq -r '.version' "$package")
Expand All @@ -86,8 +93,6 @@ update_version() {
update() {
update_version
changelog "$version"
npm run sass:build

github "$version" "$1"
}

Expand Down

0 comments on commit 8bc7ef3

Please sign in to comment.