Fix a bin entry npm was silently dropping, and use trusted publishing - #9
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The first publish attempt surfaced a real defect that
npm publish --dry-rundoes not catch:npm normalizes
binpaths on publish and drops the ones it dislikes rather than rewriting them. The manifest said./dist/relic-mcp.js; npm wanteddist/relic-mcp.jsand removed the entry. That ships a package which installs cleanly and whosenpx relic-mcpresolves 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-mcpis 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.0is live and confirmed end to end from outside the repo:Published
binreads{"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_TOKENis 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