Package @openspec-ui/cli for npm distribution - #89
Merged
Conversation
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>
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.
Summary
@openspec-ui/clivia esbuild: core's own source is inlined (it's"private": true, not published), butcross-spawn/simple-gitare kept external and declared as realdependencies— bundlingcross-spawnbroke at runtime ("Dynamic require of 'child_process' is not supported").binentry (openspec-ui-cli),files,publishConfig.access: "public", and remove"private": true. Scope stays exactly what ADR-0007 already decided:validateonly.docs/adr/0009-publish-cli-to-npm.md,packages/cli/README.md,packages/cli/LICENSE.npm publish— this environment has no registry credentials (npm whoami→ENEEDAUTH). Verified instead vianpm run build, runningdist/cli.jsdirectly (output byte-identical to thetsxdev entry point, including from outside this repo), and a fullnpm pack+npm install <tarball>+ run-the-installed-binround trip in a scratch directory.@openspec-ui/cli0.1.0->0.1.1(patch).Test plan
npm run typecheckandnpm run lint(includinglint:english) workspace-widenpm run build --workspace @openspec-ui/clinode packages/cli/dist/cli.js validate --cwd .output matches thetsxdev entry point exactlynpm pack --dry-runtarball contents:LICENSE,README.md,dist/cli.js(.map),package.jsononlynpm pack+npm install <tarball>into a scratch dir + run the installedopenspec-ui-clibin against this repo — confirms the real external-consumer pathnpm run testworkspace-wideopenspec change validate --strict prepare-cli-npm-publish🤖 Generated with Claude Code