Skip to content

chore(release): murmur installs as one npm command - #142

Merged
wine-fall merged 2 commits into
mainfrom
zachg-0824--npm-package
Aug 24, 2026
Merged

chore(release): murmur installs as one npm command#142
wine-fall merged 2 commits into
mainfrom
zachg-0824--npm-package

Conversation

@wine-fall

Copy link
Copy Markdown
Owner

Makes murmur installable as a one-command CLI: npm install -g murmur-radiomurmur. No publish performed — the tarball is verified end-to-end and the publish action is left to the maintainer (npm publish from a clean checkout).

Relates to specs/spec10/10-tui.md (the packaged TUI launch path) and specs/spec03/03-03-guide-harness.md (the setup pointer wording).

What changed

  • Name: murmur-radio. Bare murmur is taken on the registry (a murmur3 hashing lib, last touched years ago). murmur-radio is free, unscoped (no org to create), says what it is, and the bin inside it is still plain murmur. murmur-cli was the runner-up — also free, but says less.
  • Publish shape: compiled dist/, dev stays build-free. The first attempt shipped TS directly on Node's native type-stripping — Node hard-refuses to strip anything under node_modules (ERR_UNSUPPORTED_NODE_MODULES_TYPE_STRIPPING, no flag lifts it). So prepack compiles src/dist/ (tsconfig.build.json, rewriteRelativeImportExtensions) and copies the one .md prompt tsc won't. Dev and CI still run src/ directly; dist/ is gitignored and exists only inside the tarball.
  • bin: murmurdist/main.js (shebang carried over from src/main.ts by tsc).
  • files whitelist: dist, assets, the TUI client sources (tui/src, tui/assets, tui/package.json, tui/bun.lock, tui/tsconfig.json), plus src/ipc.ts + src/activity.ts — the two files the TUI imports across the package boundary (Bun runs TS fine; the engine itself uses their compiled copies in dist/). specs/scratch/test/scripts/.dev never enter the tarball (62 → 64 files total, pinned by test/package.test.ts).
  • engines: node >= 24 (already declared; now load-bearing for the compiled output's ES2024 target).
  • TUI deps on a cold install (ensureTuiDeps): a global install ships no tui/node_modules, and Bun's auto-install is disabled under a node_modules ancestor — so the engine runs bun install once at first TUI launch. A failed fetch (offline, read-only global dir) falls back to the plain host with one notice and clears the half-written install so the next boot retries.
  • External binaries stay external: ffmpeg / yt-dlp / bun are not packaged; the talking setup guide and the documented degradation ladder are untouched.
  • Setup pointers (peer review): user-facing recovery lines said make setup, which only exists in a checkout — an npm-installed user has no Makefile. They now say murmur --setup.

Acceptance (the no-publish bar)

npm pack → clean prefix npm i -g murmur-radio-0.1.0.tgzmurmur --brain stub --voice stub --max-segments 1:

  • tarball contains only dist/assets/tui/the two shared TS files/README/package.json;
  • the installed bin boots, ensureTuiDeps populated tui/node_modules via bun, the full TUI came up, the stub segment aired ("It's late, and it's just you and me on the air tonight…"), and the bounded run exited 0 on its own.

Brew formula — evaluated, not done

npm is the better first channel. A brew formula for a Node CLI must vendor every npm dep at build time (std_npm_args), pin a node dependency, and rebuild node-web-audio-api's native bindings per platform — ongoing maintenance per release, for the same audience that already has npm. If a brew channel is ever wanted, brew install node && npm i -g murmur-radio is the honest tap-less answer; a real formula only pays off once there are non-Node users to reach.

Peer review

Peer review (codex gpt-5.6-sol): 2 findings, 2 applied, 0 dismissed — (P1) failed TUI-deps install left the radio headless instead of plain (now falls back + regression tests), (P2) make setup pointers useless outside a checkout (now murmur --setup).

AI coding brief

  • Original request: Package murmur as an npm-installable CLI (npm i -gmurmur): pick a free name (bare murmur assumed taken), add bin/files/engines, decide ship-TS-vs-build, keep external binaries out, evaluate brew in the PR body, and verify via npm pack + clean-dir install + a stub bounded run — no actual publish. Why: distribution — a user should not need a checkout, pnpm, or the Makefile to start the radio.
  • Manual interventions: none — the direction was fixed in the invocation and no mid-course human input was needed.
  • Retro: the one design assumption that died on contact was "Node ≥ 24 runs the TS directly, no build step" — Node bans type-stripping under node_modules unconditionally. A prompt that asks for a npm pack + install smoke before choosing the publish shape would have saved the first round trip; the acceptance bar in the request was what caught it, so keeping "install the tarball in a clean prefix and run it" as a hard criterion is worth repeating verbatim in future packaging tasks.

🤖 Generated with Claude Code

wine-fall and others added 2 commits August 24, 2026 18:39
`npm i -g murmur-radio` (bare "murmur" is a squatted murmur3 lib) now
yields a working `murmur` bin. Node refuses to type-strip sources under
node_modules, so prepack compiles src/ to dist/ (tsc with rewritten .ts
specifiers); dev keeps running src/ directly. The tarball whitelists
dist, assets, and the tui client sources — and since a global install
ships no tui/node_modules (bun's auto-install is disabled under a
node_modules ancestor), the engine runs `bun install` once at first TUI
launch, falling back to the plain host when that fetch fails.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The recovery lines said `make setup`, which only exists in a checkout;
an npm-installed user has no Makefile. `murmur --setup` is the same
conversation and works from both worlds (peer review, codex).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wine-fall
wine-fall merged commit 6cef58c into main Aug 24, 2026
3 checks passed
@wine-fall
wine-fall deleted the zachg-0824--npm-package branch August 24, 2026 11:40
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