Created
July 21, 2015 19:26
-
-
Save klamping/a4298ea2632378650e0e to your computer and use it in GitHub Desktop.
Example NPM Version Scripts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "npm-module", | |
"version": "1.0.2", | |
"repository": { | |
"type": "git", | |
"url": "https://github.com/myuser/myrepo" | |
}, | |
"scripts": { | |
"test": "eslint --env node ./", | |
"preversion": "npm test", | |
"version": "conventional-changelog -i CHANGELOG.md -p eslint -w && git add -u", | |
"postversion": "git push && git push --tags && npm publish" | |
}, | |
"devDependencies": { | |
"conventional-changelog": "~0.1.1" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Run via
npm version patch
(orminor
,major
, etc).This tests my code (just linting since it's just a shared ESLint config), updates the version, then updates my CHANGELOG.md file with my updates, then adds, commits, pushes and publishes the code.