👷 replace lerna publish with yarn npm publish#4276
Draft
BenoitZugmeyer wants to merge 4 commits intomainfrom
Draft
👷 replace lerna publish with yarn npm publish#4276BenoitZugmeyer wants to merge 4 commits intomainfrom
BenoitZugmeyer wants to merge 4 commits intomainfrom
Conversation
2bc8233 to
ce5cfa2
Compare
Bundles Sizes Evolution
🚀 CPU Performance
🧠 Memory Performance
|
|
✅ Tests 🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: 8851870 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback! |
aca9fd3 to
abc9601
Compare
abc9601 to
c9b94d1
Compare
Uses YARN_NPM_AUTH_TOKEN instead of writing to .npmrc, and adds a --dry-run option. The legacy lerna-based script is kept as publish-npm-legacy.ts with a corresponding manual CI job as a fallback.
Contrary to lerna, yarn does not include LICENSE files in packages out of the box.
.npmignore re-exclusion after negation didn't work with yarn pack, causing spec files to be included in published packages.
c9b94d1 to
8851870
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a follow-up of #4275
Motivation
Second step toward removing lerna from the project. This PR replaces
lerna publishwithyarn workspaces foreach npm publish, and switches package file inclusion from.npmignoreto the
filesfield inpackage.jsonfor reliable yarn-compatible packaging.Changes
The publish script now uses
yarn workspaces foreach npm publishwithYARN_NPM_AUTH_TOKENfor authentication, and gains a
--dry-runoption. The old lerna-based script is preservedas
publish-npm-legacy.tsas a fallback. Thecheck-packages.tsscript is updated to useyarn packfor dry-run validation, and now also verifies that packed files match thefilesfield. All public packages gain a
filesfield (replacing.npmignore) and aLICENSEsymlink so the license is included in published tarballs.
Test instructions
node scripts/deploy/publish-npm.ts --dry-run— should list files that would be published without actually publishingnode scripts/check-packages.ts— should pass without errorsChecklist