Skip to content

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

Contents

Building the NPM package

We use a Webpackwebpack 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.

Running tests

To perform the package build process above and then run front-end JS tests using Jasminejasmine and Jasmine Browser Runnerjasmine-browser-runner against the processed files:

npm run test

Publishing to NPM

These steps assume you have logged into the NPM CLI and are apart of the @mozmeao organization on NPM

TrafficCop is published to NPM under the @mozmeao/trafficcop namespace/package name. To publish a release to NPM, use the following steps:

  1. Before you start make sure the project's CHANGELOG.md is up to date.
  2. Update the package version number in package.json (use [Semantic Versioning][semver] to determine what the new version number should be).
  3. Update the package README README.md.
  4. Run npm install to update the package-lock.json file.
  5. Submit a pull request with your against the main branch. Once the changes have been approved and merged to main:
  6. Run npm test to run the build script and front-end tests. The package contents will be located in ./dist/.
  7. 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 using git push --tags
  8. If the build is successful and all tests pass, publish to NPM using npm publish ./dist/.