fix: preserve CLI binary in npm publish#6
Merged
Conversation
devanchohan
marked this pull request as ready for review
July 13, 2026 07:18
There was a problem hiding this comment.
Pull request overview
This PR updates the published npm CLI metadata to use npm’s canonical bin target path so npm publish (npm 11+) preserves the contextfence executable mapping, and it adds a release preflight assertion to prevent regressions.
Changes:
- Update
package.jsonto setbin.contextfencetodist/package/cli.js(no leading./). - Tighten
scripts/release-check.mjsto enforce the canonical CLI path during release preflight.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| scripts/release-check.mjs | Enforces the canonical bin mapping for the CLI during release checks. |
| package.json | Updates the bin entry to the npm-canonical path to preserve the published CLI executable. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+77
to
+79
| if (packageJson.bin.contextfence !== 'dist/package/cli.js') { | ||
| fail('package.json must expose contextfence through the npm-canonical dist/package/cli.js path') | ||
| } |
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.
What changed
dist/package/cli.jsbinary path.Why
npm 11 normalizes the previous
./dist/package/cli.jsvalue during publish and removes the CLI mapping from the published manifest. This would leave consumers without thecontextfencecommand.Impact
The released package retains its executable CLI, and future release candidates fail early if the metadata regresses.
Validation
npm publish --dry-run --ignore-scripts --access publicnode scripts/release-check.mjs --allow-dirty(lint, types, 53 tests, build, CLI checks, tarball preview)