Skip to content

fix: preserve CLI binary in npm publish#6

Merged
devanchohan merged 1 commit into
mainfrom
codex/fix-npm-bin-metadata
Jul 13, 2026
Merged

fix: preserve CLI binary in npm publish#6
devanchohan merged 1 commit into
mainfrom
codex/fix-npm-bin-metadata

Conversation

@devanchohan

Copy link
Copy Markdown
Contributor

What changed

  • Use npm’s canonical dist/package/cli.js binary path.
  • Enforce that canonical path in the release preflight.

Why

npm 11 normalizes the previous ./dist/package/cli.js value during publish and removes the CLI mapping from the published manifest. This would leave consumers without the contextfence command.

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 public
  • node scripts/release-check.mjs --allow-dirty (lint, types, 53 tests, build, CLI checks, tarball preview)

@devanchohan
devanchohan marked this pull request as ready for review July 13, 2026 07:18
Copilot AI review requested due to automatic review settings July 13, 2026 07:18
@devanchohan
devanchohan merged commit 4ca2ff0 into main Jul 13, 2026
7 checks passed
@devanchohan
devanchohan deleted the codex/fix-npm-bin-metadata branch July 13, 2026 07:18

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

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.json to set bin.contextfence to dist/package/cli.js (no leading ./).
  • Tighten scripts/release-check.mjs to 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 thread scripts/release-check.mjs
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')
}
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