Use NPM for publishing packages instead of Lerna - #1581
Merged
Merged
Conversation
adamziel
added a commit
that referenced
this pull request
Jul 8, 2024
Reverts #1581 The error reported by Lerna wasn't the most descriptive but it seems like NPM's fault, not Lerna. The error yielded by npm gave me more details to work with: ``` npm notice Publishing to https://registry.npmjs.org/ with tag latest and default access npm error code E404 npm error 404 Not Found - PUT https://registry.npmjs.org/@wp-playground%2fwordpress-builds - Not found npm error 404 npm error 404 '@wp-playground/wordpress-builds@0.9.9' is not in this registry. npm error 404 npm error 404 Note that you can also install from a npm error 404 tarball, folder, http url, or git url. ``` As it turned out, npmjs.org returns 404 when it rejects an access token, making debugging a lot more difficult 🤦 Let's try rotating the access token and re-publishing with Lerna.
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.
Motivation for the change, related issues
Every few months there's a problem with publishing packages via Lerna, e.g. here's the latest one:
#1572
Debugging those issues takes a lot of time and typically there are no useful resources out there.
This PR limits the use of Lerna to bumping the packages version in the repo and tagging the updated code.
Implementation details
Instead of using
lerna publish, we run a simple, custom bash script.Testing Instructions (or ideally a Blueprint)
Merge and run. It seems to be working locally and I don't see any other way of testing it in GitHub.