gamecn
v0.0.7
Published
Source for the `gamecn` CLI. Published to npm as the unscoped `gamecn` package; the bundled artifact in `dist/` (with no workspace deps) is what ships — see `dist/package.json`.
Readme
gamecn
Source for the gamecn CLI. Published to npm as the unscoped gamecn package; the bundled artifact in dist/ (with no workspace deps) is what ships — see dist/package.json.
Run from source
bun run src/index.ts --helpBuild the published bundle
bun run build # bun build src/index.ts → dist/index.js
bun run publish:dry # build + npm pack --dry-run from dist/
bun run publish:npm # build + npm publish from dist/The published artifact is a single self-contained dist/index.js (~300 KB) with all workspace deps inlined. The user's machine never installs @gamecn/core, @gamecn/schema, etc — they're folded into the bundle at build time.
Source layout
src/
index.ts commander bootstrap; registers each subcommand
adapters.ts dispatcher that picks engine + framework adapters from gamecn.json
commands/
add/ resolve → plan → confirm → execute → adapter postInstall
init/ detect engine via package.json, prompt, write gamecn.json
view/ read-only "what would happen if I added this"
list/ registry index (M08)
create/ stub — points users at create-gamecn
registry/ stub — points users at gamecn-registryEach commands/<name>/index.ts exports a register<Name>(program) function that wires the subcommand into the top-level commander instance.
Why two package.jsons
packages/cli/package.json— workspace manifest withworkspace:*deps. Used bybun install, never published. Markedprivate: true.packages/cli/dist/package.json— publish manifest. Hand-maintained.name: "gamecn", no deps (everything bundled), hasprepublishOnlysanity check.
When you bump the published version, edit dist/package.json#version. The source package.json stays at 0.0.0 (workspace-internal placeholder).
