[ef-46] fix: bundle CLI for Node.js — support npm install -g without bun#46
Conversation
…l -g The CLI entry point used #!/usr/bin/env bun shebang and imported TypeScript files directly, making it incompatible with npm install -g on systems without bun. Bundle the CLI into dist/cli.mjs via bun build with #!/usr/bin/env node shebang so it works with both node and bun runtimes. - Add build:cli script that bundles bin/failproofai.mjs into dist/cli.mjs - Change bin entry from bin/failproofai.mjs to dist/cli.mjs - Bump version to 0.0.2-beta.1 - Fix error message: "server binary" -> "server.js" - Add postinstall validation: fail install if server.js is missing - Update docs to show both npm and bun install commands - Mark Bun as optional (only needed for development) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughDocumentation updated to mark Bun as optional for development, alternative Bun-based installation commands added across multiple docs. Package version bumped to 0.0.2-beta.1, CLI entrypoint changed to built dist file, build process restructured with new CLI building step, and postinstall script enhanced with server.js validation check. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
bin/failproofai.mjs) used#!/usr/bin/env bunshebang and imported TypeScript files directly, makingnpm install -g failproofaifail on systems without bun (/usr/bin/env: 'bun': No such file or directory)dist/cli.mjsusing bun's bundler with#!/usr/bin/env nodeshebang, so it runs natively on Node.js without requiring bun0.0.2-beta.1server.jsexists and fails early if missingnpm install -gandbun add -ginstall commandsTest plan
bun run test:run— 723 unit tests passbun run test:e2e— 124 E2E tests passbun run lint+tsc --noEmit— cleannode:20(no bun):npm install -g→failproofai --version→ dashboard launchesoven/bun:latest+ npm:npm install -g→failproofai --version→ dashboard launchesnode dist/cli.mjs --version, dashboard launch, hook handling, policies list — all work🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores