lerna-lite: PNPM workspace: protocol is not removed before publish
Describe 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.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (22 by maintainers)
Commits related to this issue
- fix(version): remove `workspace:` prefix on external deps, fixes #200 — committed to lerna-lite/lerna-lite by ghiscoding 2 years ago
- Merge pull request #219 from ghiscoding/bugfix/workspace-protocol-external-dependencies fix(version): remove `workspace:` prefix on external deps, fixes #200 — committed to lerna-lite/lerna-lite by ghiscoding 2 years ago
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