-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support specifying dist-tags for monorepo package bumps #42146
Conversation
@lunaleaps has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@lunaleaps has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Base commit: 0c37f8c |
…ease branch matching latest stable
@lunaleaps has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@lunaleaps has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
@lunaleaps merged this pull request in fe0306d. |
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: facebook#42146 Test Plan: `yarn test scripts/` Reviewed By: NickGerleman Differential Revision: D52551769 Pulled By: lunaleaps fbshipit-source-id: 52f923464387cffdc6ca22c6f0a45425965a3680
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: facebook#42146 Test Plan: `yarn test scripts/` Reviewed By: NickGerleman Differential Revision: D52551769 Pulled By: lunaleaps fbshipit-source-id: 52f923464387cffdc6ca22c6f0a45425965a3680
This reverts commit 7d06cd8.
Summary:
Currently our CI will auto-tag any
npm publish
aslatest
for the monorepo packages. This is because we do not specify a tag, so npm will default tolatest
. We encountered a similar issue forreact-native
awhile ago and fixed that with always specifying a tag, with the explicit opt-in forlatest
.yarn and npm will resolve
*
dependencies usinglatest
. 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
Changelog:
[INTERNAL] [CHANGED] - Support dist-tags in publishing monorepo packages to avoid default "latest" tag.
Test Plan:
yarn test scripts/