Skip to content

npm/npx distribution channel - #9

Merged
anshal21 merged 1 commit into
mainfrom
polish
Jul 10, 2026
Merged

npm/npx distribution channel#9
anshal21 merged 1 commit into
mainfrom
polish

Conversation

@anshal21

Copy link
Copy Markdown
Contributor

Adds npx as an install channel alongside go install and brew, per external reviewer feedback (Claude Code users are npm users by definition).

Platform-package pattern (esbuild/biome/turborepo): meta package @firstops/whittle with a 15-line Node shim + four os/cpu-gated optionalDependencies carrying the prebuilt release binaries. No postinstall scripts, npm-native integrity. npm/prepare.sh <version> [--publish] assembles everything from a tagged GitHub release with checksum verification.

Verified end to end against v0.3.0: packed, installed clean, npx whittle version ran the real binary through the shim.

To publish (founder steps, ~5 min):

  1. Create the firstops org on npmjs.com (or pick another scope: one-line change in prepare.sh + shim)
  2. npm login
  3. sh npm/prepare.sh 0.3.0 --publish

README gets the npm install lines only after the first publish succeeds (no unshipped claims).

🤖 Generated with Claude Code

External reviewer feedback: npx is the zero-friction install for this audience
(Claude Code users are npm users by definition). Implements the platform-package
pattern (esbuild/biome/turborepo): a meta package @firstops/whittle whose bin is
a 15-line Node shim, plus four optionalDependencies (@firstops/whittle-{darwin,
linux}-{arm64,amd64}) each carrying the prebuilt Go binary with os/cpu fields so
npm installs exactly one. No postinstall scripts, npm-native integrity, works
with --ignore-scripts. Unsupported platforms (windows) get a clear error
pointing at go install and the releases page.

npm/prepare.sh assembles the five packages from a tagged GitHub release:
downloads the goreleaser assets, verifies checksums.txt, stamps the version
(npm version always mirrors a real release tag), and publishes with --publish.
Verified end to end against v0.3.0: packed, installed into a clean project, and
`npx whittle version` / `policy list` ran the real binary through the shim.

The npm name `whittle` is squatted by an abandoned 0.0.0 package (2020); using
the @firstops scope, parameterized in one place if that changes. README gains
the npm install lines only after first publish, per the no-unshipped-claims rule.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@anshal21
anshal21 merged commit 2927be5 into main Jul 10, 2026
1 check passed
@anshal21
anshal21 deleted the polish branch July 10, 2026 05:31
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