Relentless push for automation

Package. json implements the one-line command NPM version major/minor/patch to be published to NPM through the hook.

  "scripts": {
    "test": "jest --coverage",
    "build": "tsc --declaration"
+ "preversion": "npm test && npm run build",
+ "postversion": "npm publish && git push && git push --tags",
Copy the code

Publishing is just executing

npm version major
Copy the code

Tests and builds are automatically completed before release, and releases and releases are not updated if they fail. And automatically push the code and tag to the remote 👍 after publishing.