-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support specifying dist-tags for monorepo package bumps (#42146)
Summary: Currently our CI will auto-tag any `npm publish` as `latest` for the monorepo packages. This is because [we do not specify a tag](https://github.com/facebook/react-native/blob/main/scripts/monorepo/find-and-publish-all-bumped-packages.js#L104), so npm will [default to `latest`](https://docs.npmjs.com/cli/v10/commands/npm-dist-tag#description). We encountered a similar issue for `react-native` awhile ago and fixed that with [always specifying a tag](https://github.com/facebook/react-native/blob/main/scripts/npm-utils.js#L84), with the explicit opt-in for `latest`. yarn and npm will resolve `*` dependencies using `latest`. This will be a problem for any React Native version that uses `*` deps. We have actively tried to remove these `*` versions but older patches may still contain them. When we do a monorepo package bump, it may be for 0.71 and for a user who is initializing a 0.72 version project (that still has * deps), they will receive monorepo packages of version `0.71.x`, which is not compatible. (React Native monorepo packages do not faithfully follow semver) This change allows us to specify what tags to use and suggest tags based on what branch you are on and asks for confirmation ``` > branch 0.73-stable ? Select suggested npm tags. (Press <space> to select, <a> to toggle all, <i> to invert selection) ❯◉ "0.73-stable" ◉ "latest" ? Confirm these tags for *ALL* packages being bumped: "0.73-stable","latest" (Y/n) > branch 0.72-stable ? Select suggested npm tags. (Press <space> to select, <a> to toggle all, <i> to invert selection) ❯◉ "0.72-stable" ◯ "latest" ? Confirm these tags for *ALL* packages being bumped: "0.72-stable" (Y/n) > branch main ? Select suggested npm tags. (Press <space> to select, <a> to toggle all, <i> to invert selection) ❯◉ "nightly" ? Confirm these tags for *ALL* packages being bumped: "nightly" (Y/n) ``` ## Changelog: [INTERNAL] [CHANGED] - Support dist-tags in publishing monorepo packages to avoid default "latest" tag. Pull Request resolved: #42146 Test Plan: `yarn test scripts/` Reviewed By: NickGerleman Differential Revision: D52551769 Pulled By: lunaleaps fbshipit-source-id: 52f923464387cffdc6ca22c6f0a45425965a3680
- Loading branch information
1 parent
8c14997
commit fe0306d
Showing
8 changed files
with
116 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters