Skip to content

Fix a bin entry npm was silently dropping, and use trusted publishing - #9

Merged
jwaldrip merged 1 commit into
mainfrom
publish-prep
Aug 7, 2026
Merged

Fix a bin entry npm was silently dropping, and use trusted publishing#9
jwaldrip merged 1 commit into
mainfrom
publish-prep

Conversation

@jwaldrip

@jwaldrip jwaldrip commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

The first publish attempt surfaced a real defect that npm publish --dry-run does not catch:

npm warn publish "bin[relic-mcp]" script name dist/relic-mcp.js was invalid and removed

npm normalizes bin paths on publish and drops the ones it dislikes rather than rewriting them. The manifest said ./dist/relic-mcp.js; npm wanted dist/relic-mcp.js and removed the entry. That ships a package which installs cleanly and whose npx relic-mcp resolves to nothing, discovered by the first person who tries it.

Verified the only way that proves anything

A manifest is not a tarball. So the publish workflow now packs the real tarball, installs it into a clean project, asserts node_modules/.bin/relic-mcp is a symlink, and runs the protocol through it. That check would have failed on the old manifest and passes on this one.

relic-mcp@0.1.0 is live and confirmed end to end from outside the repo:

cd /tmp && npx -y relic-mcp   # tools/list returns both tools

Published bin reads {"relic-mcp": "dist/relic-mcp.js"}, 9 files, 79 kB unpacked. A real publish through the npm package against the deployed service round-tripped successfully.

Trusted publishing

NODE_AUTH_TOKEN is gone and there should never be one. Authorization comes from the OIDC token, minted per run and scoped to this workflow, and npm attaches provenance automatically. Node pinned to 22.14 with npm upgraded, since trusted publishing requires Node >= 22.14.0 and npm >= 11.5.1, and an older client fails with an error that reads like a bad secret.

npm's own banner during the manual publish makes this the right call rather than merely the nicer one: "npm tokens that bypass 2FA are being restricted for account changes and direct publishing."

408 tests.

🤖 Generated with Claude Code

The first publish attempt surfaced a real defect:

  npm warn publish "bin[relic-mcp]" script name dist/relic-mcp.js was
  invalid and removed

npm normalizes `bin` paths on publish and drops the ones it dislikes.
The manifest said `./dist/relic-mcp.js`; npm wanted `dist/relic-mcp.js`
and removed the entry rather than rewriting it. That would have shipped
a package which installs cleanly and whose `npx relic-mcp` resolves to
nothing, discovered by the first person who tried it.

Verified the fix the only way that actually proves anything: packed the
tarball, installed it into a clean project, confirmed
node_modules/.bin/relic-mcp is a symlink, and ran the protocol through
it. The publish workflow now does exactly that on every release, because
a manifest is not a tarball and dry-run does not catch this.

Converts the workflow to trusted publishing. NODE_AUTH_TOKEN is gone and
there should never be one: authorization comes from the OIDC token,
which is minted per run and scoped to this workflow, and npm attaches
provenance automatically. Node is pinned to 22.14 and npm upgraded,
because trusted publishing requires Node >= 22.14.0 with npm >= 11.5.1
and the failure mode of an older client reads like a bad secret.

The first publish still has to happen by hand, since a trusted publisher
is configured on a package that already exists.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@jwaldrip
jwaldrip merged commit 3277978 into main Aug 7, 2026
1 check passed
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