This page contains relevant information about how to update packages in the
From 0.72 onwards, all packages versions should be updated and aligned by using
bump-all-updated-packages script, both in
Practically, this means that the secondary command
align-package-versions is only present in the 0.71 branch - and neither are present in versions lower than that.
Finding all packages that have unpublished changes
- You want to identify each package with unpublished (on npm) changes and update its version. This can be used in release cycle if you have merged some fixes to
- You want to force-bump each public package to the next minor version. This happens usually before release branch cutoff. In this case, please specify
release-branch-cutoffargument before executing the script.
How to execute
yarn bump-all-updated-packages or
yarn bump-all-updated-packages --release-branch-cutoff
check that no git changes are present
for each package:
if package is private -> skip
if release-branch-cutoff argument is provided:
bump package version to the next minor
grep id of the last commit that changed package
grep id of the last commit that changed version of the package
if these ids are different:
bump package version (minor or patch)
align packages versions across whole monorepo
commit changes if required
At the final step you will be asked if you want to commit all these changes. Always confirm committing if you want these packages to be published then on CircleCI, because the workflow that does this will check that commit has a tag inside its message.
Updated versions will also be updated in packages consumers. This means if
@react-native/y as a dependency and we bump version of
@react-native/x will have updated version of
Publishing an updated package to npm
We have a CircleCI workflow, which runs only on main or stable-* branches.
for each package:
if last commit contains version change:
if this commit has specific message:
publish package to npm
If you want to bump package version and publish it to npm registry, your version change should be exactly in the last commit. This is because of two things:
- If multiple commits are merged to
mainbranch at the same time, CircleCI will execute workflows only once on top of the latest commit.
- To determine that version was changed we evaluate the difference between HEAD and HEAD~1.
Example script output, where no package versions were changed: