fix(cli): inline string-width into the CLI bundle and gate packaged module resolution - #1266
Conversation
…odule resolution The packaged ade CLI resolves tsup externals through NODE_PATH into the desktop package's production tree. cli.ts now reaches tuiClient/displayWidth at module scope, which requires string-width, a package the desktop app does not ship, so v1.2.75's release run failed its packaged `ade --help` smoke on mac and Windows. Inline string-width, and make verify-built-cli.mjs run --help with only the desktop production tree on NODE_PATH so this class fails at build time instead of after notarization. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_8cce6777-4921-441d-8de5-f88212ba6354) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: arul28/ADE/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe CJS CLI now bundles ChangesPackaged CLI resolution
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 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 |
…ee installed The runtime-binary jobs build the CLI without installing apps/desktop, so the gate saw every shipped package as not installed. Resolve names from the desktop tree first and this package's own copy second; when a shipped package is installed in neither, skip with a notice instead of failing — the packaging jobs install the desktop app and run the same check. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Problem
v1.2.75's release run (35494811333) failed all three packaging jobs: the packaged
ade --helpsmoke threwCannot find module 'string-width'on mac arm64, mac x64, and Windows.Cause
cli.tsnow importstuiClient/displayWidthat module scope for the table formatters. tsup externalizes every package dependency, and the packaged CLI resolves externals through NODE_PATH into the desktop package's production tree, which does not includestring-width. This checkout hoists a dev-only copy, so every local run passed.Change and boundary
string-width(CJS, 144 KB with deps) into the CLI bundle vianoExternal.verify-built-cli.mjsgainsassertPackagedResolutionCliHelp(): copies the bundle into an empty directory, exposes only the desktop lock file's production packages on NODE_PATH, and runs--help. It names the missing module and distinguishes an uninstalled production dependency from an unshipped one.Verification
--helpprints the banner.bare require("string-width") … not in apps/desktop's production dependency tree.Authored with Claude Fable 5.1 via ADE.
Note
Low Risk
Build-time bundling and verification only; no runtime CLI behavior or desktop dependency changes beyond preventing a known packaging smoke failure.
Overview
Fixes packaged
ade --helpfailing with Cannot find module 'string-width' by bundling that dependency instead of leaving it as an external resolved through the desktop app’s productionNODE_PATH.tsup.config.tsaddsstring-widthtonoExternalfor the main CJS CLI bundle so module-scope imports fromtuiClient/displayWidth(table formatters) are inlined rather than emitted as barerequire()calls the shipped app cannot satisfy.verify-built-cli.mjsaddsassertPackagedResolutionCliHelp(), wired into the build verifier: it runsdist/cli.cjs --helpfrom an isolated directory with only the desktop lockfile’s production packages onNODE_PATH, matching packaged resolution. Failures name the missing module and distinguish “not installed in checkout” vs “not in desktop’s production tree,” with guidance to inline vianoExternalor add a desktop dependency.Reviewed by Cursor Bugbot for commit bdd96c6. Configure here.
Summary by CodeRabbit
Bug Fixes
Tests