Skip to content

ci(release): publish through the npm CLI, not pnpm - #45

Merged
msalvatti merged 3 commits into
mainfrom
ci/publish-via-npm-cli
Aug 2, 2026
Merged

ci(release): publish through the npm CLI, not pnpm#45
msalvatti merged 3 commits into
mainfrom
ci/publish-via-npm-cli

Conversation

@msalvatti

@msalvatti msalvatti commented Aug 2, 2026

Copy link
Copy Markdown
Member

Preventive: this library's README is on npm today only because it still publishes under pnpm 10.

The registry's readme field is populated from the publish request, and pnpm 11 does not send it. Across the five published @bymax-one/* libraries the split is exact — every package released under pnpm 11 landed with an empty readme and no _npmVersion, every one released under pnpm 10 (which delegated to the npm CLI) carries both. nest-realtime@1.0.1 confirmed it by changing only the publish command and restoring both fields in one release; nest-queue@1.0.6 is doing the same for the one that regressed.

This repository is on pnpm 10, so nothing is broken yet. But the workflow still calls pnpm publish, so the first release after a pnpm 11 bump would silently ship with no documentation on the npm page — and Dependabot proposes that bump on its own schedule.

release.yml now calls npm publish --provenance --access public. The --no-git-checks flag was pnpm's; npm runs no git checks, so the detached HEAD the runner sits on at the tag SHA needs nothing of its own.

No version bump. The published metadata for this package is already correct, and .github/ is outside package.jsonfiles, so dist/ and the tarball are untouched. Verified: nothing this PR changes is in files.


Correction to the "no version bump" note above. It said the tarball is untouched. That was true when the PR only changed .github/, but the branch now also aligns package.jsonscripts.release with the CI command (that script is how a manual publish runs, and it would have reproduced the empty registry readme under pnpm 11).

package.json does ship, and npm keeps scripts in the published manifest — confirmed: npm view @bymax-one/nest-cache@1.0.3 scripts.release returns pnpm publish --provenance. So the tarball will differ by that one informational field.

It still does not warrant a release of its own: no consumer resolves or executes a dependency's scripts, dist/ is unchanged, and the corrected value ships with whatever release this library cuts next. nest-queue carries it in 1.0.6.

The registry's readme field is populated from the publish request and pnpm 11
does not send it: every @BYMAX-ONE package released under pnpm 11 landed with
an empty readme and no _npmVersion, while every one released under pnpm 10 —
which delegated to the npm CLI — carries both. Confirmed on nest-realtime,
where 1.0.1 changed only the command and restored both fields.

This repository is still on pnpm 10, so nothing is broken yet. The first
release after a pnpm 11 bump would ship with no documentation on the npm page,
and Dependabot proposes that bump on its own schedule.

--no-git-checks was a pnpm flag; npm runs no git checks, so the detached HEAD
at the tag SHA needs nothing of its own.
Copilot AI review requested due to automatic review settings August 2, 2026 15:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the tag-driven release workflow to publish via the npm CLI instead of pnpm publish, to avoid npm registry metadata regressions (notably missing readme) observed when publishing under pnpm 11—while keeping the existing OIDC trusted publishing flow.

Changes:

  • Switch release publishing command from pnpm publish to npm publish --provenance --access public.
  • Expand inline workflow documentation explaining why npm CLI is used (readme field population) and why no git-check flag is needed.

npm runs prepublishOnly on publish and this job already runs it as its own
step, so it executes twice. The second run starts with clean, deleting and
rebuilding the dist/ that size and check:exports had just validated — the
tarball shipped is not the artifact the gates checked. Observed in the
nest-realtime 1.0.1 release log.

--ignore-scripts packs what is already on disk and verified. The duplication
predates the switch to npm publish: pnpm publish ran prepublishOnly the same
way.
Copilot AI review requested due to automatic review settings August 2, 2026 15:16
@msalvatti

Copy link
Copy Markdown
Member Author

Pushed 49dbed0 — a finding the review raised on the sibling PRs, confirmed in the nest-realtime@1.0.1 release log.

npm publish runs prepublishOnly, and this job already runs it as its own step, so it executed twice. The second run starts with clean, deleting and rebuilding the dist/ that size and check:exports had just validated — meaning the tarball shipped was packed from a build made after the gates, not the one they checked.

--ignore-scripts packs what is already on disk and already verified. Provenance is unaffected: npm generates the attestation itself, not a lifecycle script. The duplication predates the switch to npm publishpnpm publish ran prepublishOnly the same way.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

The workflow publishes through npm now, but the package script still ran
pnpm publish — and that script is exactly what a manual publish uses, which
is how every first release here happens. It would reproduce the empty
registry readme under pnpm 11.

No --ignore-scripts here, unlike CI: a manual publish has no preceding gate
step, so prepublishOnly running is the point.
Copilot AI review requested due to automatic review settings August 2, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.

@msalvatti
msalvatti merged commit fb29dd5 into main Aug 2, 2026
16 checks passed
@msalvatti
msalvatti deleted the ci/publish-via-npm-cli branch August 2, 2026 15:22
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.

2 participants