We use a Webpack configuration for building the contents of the NPM package ready for publishing. To build the package, run:
npm run build
This will install dependencies, lint JS files, and then build the package content in the ./dist/
directory.
To perform the package build process above and then run front-end JS tests using Jasmine and Jasmine Browser Runner against the processed files:
npm run test
These steps assume you have logged into the NPM CLI and are apart of the @mozmeao organization on NPM
Mozilla Cookie Helper is published to NPM under the @mozmeao/cookie-helper
namespace/package name. To publish a release to NPM, use the following steps:
- Before you start make sure the project's CHANGELOG.md is up to date.
- Update the package
version
number in package.json (use [Semantic Versioning][semver] to determine what the new version number should be). - Update the package README README.md.
- Run
npm install
to update the package-lock.json file. - Submit a pull request with your against the
main
branch. Once the changes have been approved and merged to main: - Run
npm test
to run the build script and front-end tests. The package contents will be located in./dist/
. - Tag a new release. You can do this either using Git tag, or directly on the GitHub website. (Example:
git tag -a v1.1.0
). If you used Git tag, push your tags to the repo usinggit push --tags
- If the build is successful and all tests pass, publish to NPM using
npm publish ./dist/
.