Skip to content

fix: publish releases with pnpm to resolve workspace and catalog protocols - #3309

Merged
eduardoformiga merged 1 commit into
mainfrom
fix/release-publish-with-pnpm
May 11, 2026
Merged

eduardoformiga merged 1 commit into
mainfrom
fix/release-publish-with-pnpm

Conversation

@eduardoformiga

@eduardoformiga eduardoformiga commented May 11, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replaces lerna publish from-git with pnpm -r publish in the release scripts so pnpm rewrites workspace:* and catalog: specifiers to concrete versions before uploading the tarballs to npm. lerna version is kept for bump, tag and changelog generation.
  • Adds pnpm release:verify, a smoke test that packs every public packages/* with pnpm pack and inspects each tarball's package.json for unresolved workspace: or catalog: literals. Wired into release.yml before any publish step.

Closes #3307.

Why

@faststore/{cli,core,api,ui,components}@4.0.0 were published with literal workspace:* and catalog: in their dependencies, breaking installs outside the monorepo. Confirmed against the registry:

Root cause: lerna publish (regardless of npmClient: "pnpm" in lerna.json, which only affects install) delegates the actual upload to npm publish. npm publish does not know about pnpm's catalog: protocol and only rewrites workspace:* when the monorepo is declared via workspaces in the root package.json (which this repo does not — it uses pnpm-workspace.yaml). The regression was introduced in #3302 (v4) when the catalog migration landed without updating the publish pipeline.

Changes

package.json

-"release": "lerna version --conventional-commits --conventional-graduate --yes && lerna publish from-git --yes",
-"release:dev": "lerna version --conventional-commits --conventional-prerelease --preid=dev --force-publish --yes && lerna publish from-git --dist-tag=dev --yes",
-"release:v3": "lerna version --conventional-commits --yes && lerna publish from-git --dist-tag=v3-latest --yes",
+"release": "lerna version --conventional-commits --conventional-graduate --yes && pnpm -r publish --access public --no-git-checks",
+"release:dev": "lerna version --conventional-commits --conventional-prerelease --preid=dev --force-publish --yes && pnpm -r publish --access public --tag dev --no-git-checks",
+"release:v3": "lerna version --conventional-commits --yes && pnpm -r publish --access public --tag v3-latest --no-git-checks",
+"release:verify": "node ./scripts/verify-publish-manifests.mjs",

pnpm -r publish walks packages/*, skips private packages, runs the same prepack lifecycle that the previous flow did (so oclif readme etc. still execute), and rewrites workspace:* / catalog: while building each tarball. --no-git-checks is needed because lerna version already created the tag commit.

scripts/verify-publish-manifests.mjs

Standalone Node script (no extra deps) that:

  1. Iterates every non-private packages/*/package.json.
  2. Runs pnpm pack per package into a temp dir.
  3. Extracts package/package.json from each .tgz and walks dependencies, devDependencies, peerDependencies, optionalDependencies.
  4. Fails with a clear, per-package report if any value starts with workspace: or catalog:.

.github/workflows/release.yml

Added a Verify publish manifests step (running pnpm release:verify) right before the per-branch publish steps, so a regression to a non-resolving publish tool is caught before anything reaches npm.

Test plan

  • pnpm lint — clean.
  • pnpm release:verify locally — passes for all 8 public packages on this branch.
  • Synthetic negative test of findUnresolvedProtocols: detects workspace:* and catalog: (named or bare) across all four dep fields.
  • CD pipeline runs Verify publish manifests before publish on a future release.
  • Once merged, cut a 4.0.1 (or 4.1.0-dev.x) and confirm via npm view @faststore/cli@<new> dependencies that no workspace: / catalog: strings appear.

…ocols

Replaces `lerna publish from-git` with `pnpm -r publish` in the release
scripts so pnpm rewrites `workspace:*` and `catalog:` specifiers into
concrete versions before uploading the tarballs to npm. Lerna delegates
publish to `npm publish`, which has no concept of pnpm's catalog and
cannot resolve `workspace:*` outside an npm-declared workspace; this is
why @faststore/* 4.0.0 shipped with unresolved protocols (#3307).

Also adds a `release:verify` smoke test that packs every public package
with `pnpm pack` and fails if any `workspace:` or `catalog:` literal
leaks into the tarball's package.json. The check runs in CD before any
publish step, guarding against future regressions.

Closes #3307
@eduardoformiga
eduardoformiga requested a review from a team as a code owner May 11, 2026 20:38
@eduardoformiga
eduardoformiga requested review from renatamottam and renatomaurovtex and removed request for a team May 11, 2026 20:38
@coderabbitai

coderabbitai Bot commented May 11, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (3)
  • .github/workflows/release.yml is excluded by none and included by none
  • package.json is excluded by none and included by none
  • scripts/verify-publish-manifests.mjs is excluded by none and included by none

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 47d0eff7-23e1-4453-bfac-3aaad208563d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-publish-with-pnpm

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codesandbox-ci

Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@eduardoformiga
eduardoformiga requested review from hellofanny and ommeirelles and removed request for renatamottam May 11, 2026 20:43
@eduardoformiga
eduardoformiga merged commit e7cbee3 into main May 11, 2026
8 checks passed
@eduardoformiga
eduardoformiga deleted the fix/release-publish-with-pnpm branch May 11, 2026 20:45
eduardoformiga added a commit that referenced this pull request May 11, 2026
## What's the purpose of this pull request?

Bring `dev` into `main` so the next CD run on `main` cuts and publishes
`@faststore/*@4.1.0`. Includes the publish-pipeline fix from #3309, so
this is also the first release that exercises the `pnpm -r publish` flow
end-to-end (broken `4.0.0` is superseded by `4.1.0` as `latest`).

## What's included since v4.0.0

- #3308 — fix: PLP "Load more products" overwriting list instead of
appending
- #3306 — feat: user details adjusts — SFS-2950
- #3304 — fix: updates schemas vtex.faststore
- #3301 — fix: localization selector stale and reset selection for
unsaved changes
- `d1e40abe7` — fix: add repository field to diagnostics package for
OIDC provenance
- #3309 — fix: publish releases with pnpm to resolve workspace and
catalog protocols (already on `main`, kept by 3-way merge)

## How CD will behave on merge

1. `lerna version --conventional-commits --conventional-graduate --yes`
graduates `4.1.0-dev.1` → `4.1.0`, creates tag `v4.1.0`, and pushes the
`[no ci] Release: 4.1.0` commit.
2. `pnpm release:verify` packs every public package and asserts no
`workspace:` / `catalog:` literal survives the pack step.
3. `pnpm -r publish --access public --no-git-checks` uploads the 8
public packages with all `workspace:*` / `catalog:` references rewritten
to concrete versions.

## Sanity checks already performed locally

- `git merge-tree` between `origin/main` and `origin/dev`: clean, no
conflicts.
- `pnpm install --frozen-lockfile` on the merged tree: no lockfile
drift.
- `pnpm release:verify` on `release/4.1.0`: all 8 public packages clean
at `4.1.0-dev.1` (the same manifests that will be bumped to `4.1.0`).

## Follow-ups (not blocking)

- Once `4.1.0` is on `latest`, consider `npm deprecate
@faststore/<pkg>@4.0.0 "Broken release: workspace:/catalog: not
resolved. Use 4.1.0+"` for `cli`, `core`, `api`, `ui`, `components`,
`sdk`, `diagnostics`, `lighthouse`.
- Optional: add `workflow_dispatch` to `release.yml` so future hotfix
releases without `packages/*` changes can be triggered manually with
`--force-publish`.

Made with [Cursor](https://cursor.com)

---------

Co-authored-by: Larícia Mota <[email protected]>
Co-authored-by: Matheus P. Silva <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: vtexgithubbot <[email protected]>
Co-authored-by: Lucas Feijó <[email protected]>
Co-authored-by: Luiz Falcão <[email protected]>
Co-authored-by: Artur Santiago <[email protected]>
Co-authored-by: Sahan Jayawardana <[email protected]>
Co-authored-by: Mateus Pontes <[email protected]>
Co-authored-by: Matheus Martins <[email protected]>
Co-authored-by: renatomaurovtex <[email protected]>
Co-authored-by: Leandro Rodrigues <[email protected]>
Co-authored-by: Fanny Chien <[email protected]>
Co-authored-by: Arthur Andrade <[email protected]>
Co-authored-by: Cursor <[email protected]>
Co-authored-by: Thiago Pereira <[email protected]>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Giuliana Rigaud <[email protected]>
Co-authored-by: renato <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: BrunaCubos <[email protected]>
Co-authored-by: Ícaro Oliveira <[email protected]>
Co-authored-by: Bruna Santos <[email protected]>
Co-authored-by: Everton Ataide <[email protected]>
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Otavio Moreira Meirelles <[email protected]>
Co-authored-by: Marco Cardoso <[email protected]>
Co-authored-by: Gabriel Paladino <[email protected]>
Co-authored-by: CodeRabbit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant