[ef-37] fix: build + ship dist/index.js to fix custom policy loading + bump to 0.0.1-beta.11#37
Conversation
…ailproofai' + bump to 0.0.1-beta.11 `findDistIndex()` always returned null for global installs because `dist/index.js` was never built or included in the published package. This caused the ESM shim to be skipped, leaving `from 'failproofai'` unrewritten in user custom policy temp files → "Cannot find package 'failproofai'" at runtime. Fixes: prepend a `bun build` CJS step to the build script so `dist/index.js` is produced before publish, and add `dist/` to the `files` array so it ships in the npm tarball. Verified: Docker clean-install (oven/bun image) confirms dist/index.js present and `failproofai p -i -c` succeeds end-to-end. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 0 minutes and 21 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📝 WalkthroughWalkthroughVersion bumped to Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. Comment |
…w rules Documents the full agent workflow: Docker clean-install test recipe, regression checklist, one-PR-per-branch rule, CI-must-be-green rule, and unit-test requirements for new behaviour. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e pushing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
dist/index.jswas never built or included in the published npm package.findDistIndex()always returnednullfor global installs, so the ESM shim was never created andfrom 'failproofai'imports in user custom policy files were left unrewritten →Cannot find package 'failproofai'bun build --target=node --format=cjs --outfile=dist/index.js src/index.tsto thebuildscript, and adddist/to thefilesarray inpackage.json0.0.1-beta.10→0.0.1-beta.11Test plan
dist/index.jslocally — valid CJS output confirmedFAILPROOFAI_DIST_PATH=./dist failproofai p -i -c ~/failproofai/examples/policies-notification.js— "Validated 1 custom hook(s): slack-on-idle-notification" ✅npm pack --dry-run --ignore-scripts—dist/index.js(2.1kB) appears in tarball ✅oven/bunimage, install from local.tgz,failproofai p -i -c /tmp/test-policy.mjs) — exits 0, "Validated 1 custom hook(s): test-policy" ✅🤖 Generated with Claude Code
Summary by CodeRabbit
Chores
0.0.1-beta.11.Documentation