diff --git a/package.json b/package.json index 8dfe39d4..e0e22c2a 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,11 @@ "prepublish": "npm run build", "prettier:rc": "prettier --write", "prettier": "prettier --write .", + "release:major:nc": "node scripts.js prepare_release major --no-commit", "release:major": "node scripts.js prepare_release major", + "release:minor:nc": "node scripts.js prepare_release minor --no-commit", "release:minor": "node scripts.js prepare_release minor", + "release:patch:nc": "node scripts.js prepare_release patch --no-commit", "release:patch": "node scripts.js prepare_release patch", "test:e2e": "concurrently 'npm run test:serve' 'wait-on http://localhost:3000/esm.html && npm run cypress' --kill-others --success first", "test:serve": "node tests/esm.server.js", diff --git a/scripts.js b/scripts.js index 36a681bf..8bd16c5b 100644 --- a/scripts.js +++ b/scripts.js @@ -63,13 +63,15 @@ ${commits} ${changelog}`; await fs.writeFile('CHANGELOG.md', changelog, { encoding: 'utf8' }); - await exec('git add CHANGELOG.md'); - await exec( - `git commit -m "[RELEASE] update changelog for v${newVersion}" --no-verify` - ); - await exec( - `npm version --no-commit-hooks ${newVersion} -m '[RELEASE] v${newVersion}'` - ); + if (!process.argv.includes('--no-commit')) { + await exec('git add CHANGELOG.md'); + await exec( + `git commit -m "[RELEASE] update changelog for v${newVersion}" --no-verify` + ); + await exec( + `npm version --no-commit-hooks ${newVersion} -m '[RELEASE] v${newVersion}'` + ); + } } runScript().catch((err) => {