Publishing snapshots
Occasionally you may wish to publish a snapshot release so consumers can test package changes before doing a production publish.
Snapshot releases allow you to publish pending changes with a non-semver version that can be installed manually, but won't be updated automatically when apps install or update packages.
There are two npm scripts to help you prepare and publish a snapshot version, npm run snapshot:version and npm run snapshot:publish.
Both commands accept a --tag argument which will add the specified tag onto the package version, and can be used as follows:
npm run snapshot:publish --tag=pagination-test
This is especially important for the publish command, because if no tag is supplied artifactory will add the latest tag to the snapshot release, which will cause consumers to install the snapshot version by default.
The publish script has a fallback incase no --tag param is supplied, but it hasn't been tested due to the risks involved.
- Pull the latest master branch.
- Create a branch for the snapshot change. While you won't be committing any changes it is good to be off master.
- Run npm run snapshot:version --tag=your-tag-here.
- The version script will update all updated packages to the snapshot version.
- Check the versions are all updated as expected.
- Run npm run snapshot:publish --tag=your-tag-here. Do not forget to supply the tag parameter.
- You can confirm that the package has been published by checking for the version in artifactory.
- If you wish to share updated docs with consumers, publish the master branch to staging and share the staging link.
Remember, there is no need to commit these changes, and they should never be merged to master.