This library will be published as a npm package on npmjs.com. It should be available here.
The following validations can be done at any time. They may be included automatically as part of the publishing process.
Run lint and tests:
npm run lint && npm test
There are several hooks: at git level and at npm "scripts" lifecycle level.
** using husky
, runs linting and tests.
prepare will run both BEFORE the package is packed and published, and on local npm install.
We use this to generate the multiple JavaScript flavours of this library and also the types for TypeScript.
prepublishOnly will run BEFORE prepare and ONLY on npm publish.
We use this to run linting and the tests.
preversion will run BEFORE a new version has been bumped using npm version ...
.
We use this to run linting.
version will run AFTER a new version has been bumped using npm version ...
.
We use this to prettify the code and add the source code to git.
-
Edit the version on package.json to something like
"version": "x.y.z-beta.1"
. Increase the last digits if another beta needs to be released -
Publish using the
beta
tag, using:npm publish --tag beta
Due to theprepublishOnly
configuration onpackage.json
, this will implicity:
- run the tests, using
npm test
- run linting, using
npm run int
Bump the version in package.json file:
npm version [patch|minor|major|<version_no>]
This will automatically run the scripts defined in package.json for preversion
, version
, and postversion
.
Generate coverage badges:
npm run test:badges
Commit badges:
git status
git add coverage
git commit -m "update coverage badges"
git push
Publish it to npmjs.com:
npm publish --access public
npm unpublish @xray-app/xray-automation@x.y.z