Skip to content

Package @openspec-ui/cli for npm distribution - #89

Merged
VeryComplexAndLongName merged 1 commit into
mainfrom
feat/publish-cli-to-npm
Aug 26, 2026
Merged

Package @openspec-ui/cli for npm distribution#89
VeryComplexAndLongName merged 1 commit into
mainfrom
feat/publish-cli-to-npm

Conversation

@VeryComplexAndLongName

Copy link
Copy Markdown
Owner

Summary

  • Bundle @openspec-ui/cli via esbuild: core's own source is inlined (it's "private": true, not published), but cross-spawn/simple-git are kept external and declared as real dependencies — bundling cross-spawn broke at runtime ("Dynamic require of 'child_process' is not supported").
  • Add a bin entry (openspec-ui-cli), files, publishConfig.access: "public", and remove "private": true. Scope stays exactly what ADR-0007 already decided: validate only.
  • Add docs/adr/0009-publish-cli-to-npm.md, packages/cli/README.md, packages/cli/LICENSE.
  • Does not perform an actual npm publish — this environment has no registry credentials (npm whoamiENEEDAUTH). Verified instead via npm run build, running dist/cli.js directly (output byte-identical to the tsx dev entry point, including from outside this repo), and a full npm pack + npm install <tarball> + run-the-installed-bin round trip in a scratch directory.
  • Versioned via a changeset: @openspec-ui/cli 0.1.0 -> 0.1.1 (patch).

Test plan

  • npm run typecheck and npm run lint (including lint:english) workspace-wide
  • npm run build --workspace @openspec-ui/cli
  • node packages/cli/dist/cli.js validate --cwd . output matches the tsx dev entry point exactly
  • npm pack --dry-run tarball contents: LICENSE, README.md, dist/cli.js(.map), package.json only
  • npm pack + npm install <tarball> into a scratch dir + run the installed openspec-ui-cli bin against this repo — confirms the real external-consumer path
  • npm run test workspace-wide
  • openspec change validate --strict prepare-cli-npm-publish

🤖 Generated with Claude Code

Bundles the CLI via esbuild (core's own source inlined, cross-spawn/
simple-git kept as real dependencies after bundling cross-spawn broke
at runtime), adds a bin entry, and removes "private": true. Addresses
the friction demonstrated by the Gitea Actions parity work: reusing
the validate merge gate outside this repo's own CI currently requires
cloning the whole monorepo. See docs/adr/0009-publish-cli-to-npm.md.

The actual npm publish is not performed here — this environment has no
registry credentials (npm whoami fails with ENEEDAUTH). Verified via
npm run build, running the bundled dist/cli.js directly, and a full
npm pack + npm install <tarball> + run-the-installed-bin round trip in
a scratch directory outside this repository.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@VeryComplexAndLongName
VeryComplexAndLongName merged commit 644b04d into main Aug 26, 2026
6 checks 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