PNPM workspace: protocol is not removed before publish
See original GitHub issueDescribe the bug
As titled. This broke currently our release process 😱
lerna publish --conventional-commits --create-release github --allow-branch main --yes --message="chore(release): Publish [skip ci]"
Reproduction
- Create PNPM workspace
- Use a dependency with workspace: protocol
- Publish with lerna.
- workspace: is still in the manifest.
Lerna config and logs
lerna.json
<!-- Please paste your `lerna.json` here -->
lerna-debug.log
<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->
Environment Info
| Executable | Version |
| ----------------- | ------- |
| `lerna --version` | v1.4.0 |
| `npm --version` | VERSION |
| `yarn --version` | VERSION |
| `node --version` | VERSION |
---
OR simply run `npx lerna info` command
Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the docs.
- Check that there isn’t already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion.
- The provided reproduction is a minimal reproducible example of the bug.
Issue Analytics
- State:
- Created a year ago
- Comments:22 (22 by maintainers)
Top Results From Across the Web
Allow to use pnpm as a publish utility · Issue #280 - GitHub
The issue is that semantic release uses npm cli tool for publishing which does not remove workspace: protocol and eventually the package is...
Read more >Workspace | pnpm
Luckily, pnpm supports the workspace: protocol. When this protocol is used, pnpm will refuse to resolve to anything other than a local workspace...
Read more >Setup a Monorepo with PNPM workspaces and speed it up ...
I also removed the version property since it is not used. As the technology stack I've chosen to go with React (so we...
Read more >Advanced package manager features for npm, Yarn, and pnpm
npm workspaces; Yarn Berry workspaces; pnpm workspaces ... and no installation step is required before you start the application.
Read more >Setup a monorepo with PNPM workspaces and add Nx for ...
Deep dive session where @juristr walks you through setting up a new monorepo with PNPM workspaces, adds a Remix app and a shared...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I gave this a try after merging the other 2 PRs and I can’t seem to reproduce, at least not in dry-run mode. The last PR helps a lot by providing more helpful details about the tarball and what versions are being published, I tried with this simple demo
and ran the command you provided, in my use case I needed to turn off the new flags because npm isn’t too happy with
workspace:
protocol but once I turn off the lockfile-only thing, it seems to be working as expectedhere’s the command I ran locally
and here’s the tarball and publish details (again thanks to last PR you’ll see a lot more useful info in
git-dry-run
mode)as you can see,
workspace:
is completely removed and so I can’t seem to replicate the issue from my side. Some things to note are that I’m ingit-dry-run
mode and I merged the last 2 PRS, however I don’t think any of these 2 points have any impact on the repro. Nonetheless, I would still suggest to use the 2 commands split that arelerna version
and then laterlerna publish
, it’s easier to follow and probably more predictable.I’m considering migrating the repo to a pnpm workspace to help with the support of
workspace:
protocol which is non-existent in npm. At the beginning I used npm so that anyone could contribute and also wanted to try npm workspaces but I’m not so impressed with it and now that I support workspace protocol it’s even harder to support. If we do migrate to pnpm then we could use breakpoint directly in the code