From 8bc7ef332757cbd5ad0a4186842d267d09902b05 Mon Sep 17 00:00:00 2001 From: 32teeth Date: Sat, 28 Sep 2024 22:02:11 -0400 Subject: [PATCH] build: 0.1.5 --- CHANGELOG.md | 6 ++++++ README.md | 2 +- bin/cli.mjs | 2 +- package-lock.json | 6 +++--- package.json | 19 +++++++++++-------- release.sh | 37 +++++++++++++++++++++---------------- 6 files changed, 43 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 009abbf..dca345c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +### 0.1.5 + +Changes in this version: + +* feature: sockets + ### 0.1.4 What changed in this version? diff --git a/README.md b/README.md index 9e92242..ae01726 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/bin/cli.mjs b/bin/cli.mjs index f4c006f..1fbb4c6 100755 --- a/bin/cli.mjs +++ b/bin/cli.mjs @@ -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)) { diff --git a/package-lock.json b/package-lock.json index 59cab2f..548afdf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@32teeth/generic-nodejs-express-api", + "name": "@npm-packages-collection/generic-nodejs-express-api", "version": "0.1.3", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@32teeth/generic-nodejs-express-api", + "name": "@npm-packages-collection/generic-nodejs-express-api", "version": "0.1.3", "license": "CC-BY-SA-4.0", "dependencies": { @@ -3648,4 +3648,4 @@ } } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index cfabed6..349e1ff 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "generic-nodejs-express-api", + "name": "@npm-packages-collection/generic-nodejs-express-api", "description": "Generic NodeJs Express API", "author": "Eugene Yevhen Andruszczenko ", "contributors": [ @@ -7,10 +7,10 @@ ], "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", @@ -20,7 +20,7 @@ "web" ], "publishConfig": { - "registry": "https://registry.npmjs.com/" + "registry": "https://npm.pkg.github.com/" }, "engines": { "node": "20.x", @@ -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" @@ -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" } -} \ No newline at end of file +} diff --git a/release.sh b/release.sh index a15c596..0ea9326 100755 --- a/release.sh +++ b/release.sh @@ -5,8 +5,6 @@ github() { local version="$1" local reset="$2" - npm run hook - if [ "$reset" == "--reset" ]; then git checkout --orphan orphan fi @@ -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 < "$file" # Changelog @@ -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") @@ -86,8 +93,6 @@ update_version() { update() { update_version changelog "$version" - npm run sass:build - github "$version" "$1" }