Skip to content

Use NPM for publishing packages instead of Lerna - #1581

Merged
adamziel merged 10 commits into
trunkfrom
explore-changesets-instead-of-lerna
Jul 8, 2024
Merged

Use NPM for publishing packages instead of Lerna #1581
adamziel merged 10 commits into
trunkfrom
explore-changesets-instead-of-lerna

Conversation

@adamziel

@adamziel adamziel commented Jul 8, 2024

Copy link
Copy Markdown
Collaborator

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.

@adamziel
adamziel requested a review from a team as a code owner July 8, 2024 10:14
@adamziel
adamziel merged commit 83c86cd into trunk Jul 8, 2024
@adamziel
adamziel deleted the explore-changesets-instead-of-lerna branch July 8, 2024 10:19
adamziel added a commit that referenced this pull request Jul 8, 2024
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant