fluid-common
Fluid frontend and API commons
Contribution
- Branch out of an up-to-date
main (branch name: the Shortcut story number).
- Make your change in
src/.
- Bump
version in package.json (see Versions), then run npm i to update package-lock.json.
- Commit
src/, package.json and package-lock.json.
- Push:
git push --set-upstream origin HEAD.
- Publish (see Publishing).
- In each consumer, install the exact version:
npm install @soltech/fluid-common@<version> --save-exact.
Push before you publish, so npm never holds a package whose commit is missing from GitHub.
Do not use npm run pub: it publishes first and pushes after, and it cannot pass the tag a prerelease needs.
Versions
While a story is in progress, publish a prerelease named after it:
<next version>-sc<story>.<n> e.g. 1.17.0-sc24475.0
<next version> must be higher than anything already on npm, including versions from parallel branches
that are not on main yet. Check with npm view @soltech/fluid-common versions.
A prerelease counts as older than the release it is named after, so 1.16.0-sc24475.0 comes before 1.16.0.
<n> starts at 0 and goes up each time you publish a change for the same story.
A published version can never be republished.
- Once the PR is approved and merged, publish the plain version (
1.17.0) from main
and point the consumers at it.
Consumers pin an exact version ("1.17.0-sc24475.0"), never a caret range.
Publishing
A prerelease needs a dist-tag, otherwise npm refuses it
(You must specify a tag using --tag when publishing a prerelease version).
Use the story number as the tag, so npm install @soltech/fluid-common keeps resolving to the latest release:
npm publish --tag sc24475
A release from main takes no tag and becomes latest:
npm publish
prepublishOnly rebuilds lib/ before every publish, so there is no separate build step.