Developer workflow
- Create a feature branch, e.g. ARC-9000
- Create a Pull Request (PR) with your feature branch into
dev
- When your branch is ready for production, PR your feature branch into
master
- When your branch is in
master
, publish a new version to NPM - Point the
tgam-patterns
dependency in your consuming project’spackage.json
back to the NPM registry once again.
Referencing a Git branch instead of an NPM package version
During development, you may find it useful to import the pattern library files from a Git feature branch instead of from the NPM registry. This enables you to push changes to Git, then immediately pull the code into your project without having to publish a new version of the NPM package first. This speeds up development by eliminating an extra step and is ideal because it’s best practice to wait until your code is production-ready before publishing it to NPM.
Example of referencing a Git branch (which you should do during development):
"dependencies": { "tgam-patterns": "github:globeandmail/ux-pattern-library#branch-name" }
Example of referencing an NPM module version (which you should do in production):
"dependencies": { "tgam-patterns": "2.0.0" }
Note: If you experience caching issues when switching between a Git reference and an NPM module version (i.e. it doesn’t seem to be pulling in the correct code after switching sources), manually deleting your node_modules/tgam-patterns
directory then running npm install tgam-patterns
should solve the problem.