chore: reconcile package metadata and declare only un-bundlable runner deps#145
Conversation
…dk deps and extension version Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Review limit reached
Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThis PR updates Node.js engine requirements to >=20 across package.json files, removes the consola dependency from core, reclassifies runtime dependencies into devDependencies in the CLI and MCP runner packages, and bumps the extension manifest version to 0.9.0. ChangesEngine and Dependency Updates
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 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 |
The cli, mcp, and sdk runners each ship a self-contained bundle (esbuild/tsup with only node:* external), so every third-party lib is inlined into dist/. Declaring those inlined libs as runtime dependencies made consumers install packages they never load. Move inlined libs to devDependencies; keep in dependencies only what the bundle cannot inline and resolves from node_modules at runtime: - mcp/sdk: @modelcontextprotocol/sdk — its ajv/ajv-formats validators are require()d by path at runtime and can't be bundled - cli: @anthropic-ai/claude-agent-sdk — spawns a native platform binary shipped via optionalDependencies — plus @modelcontextprotocol/sdk sdk was already correct (no change). This supersedes the earlier addition of @ai-sdk/azure and @ai-sdk/deepseek to mcp dependencies. Verified: build + typecheck for all three; ajv and the native binary resolve at runtime; mcp server boots; sdk bundle loads clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
extra-files listed runners/extension/package.json but not manifest.json, so release-please would bump the package version and leave manifest.json behind — reintroducing the exact drift this PR just corrected by hand. Add manifest.json as a json extra-file (jsonpath $.version) so both stay in lockstep on every release. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What
Pre-release package-metadata hygiene across the workspace, in two parts.
1. Metadata reconciliation
>=20(root was>=18.0.0while all runners already require>=20; CI runs Node 22). Added an explicitenginesfield tocore.consoladependency fromcoreandmcp— it's only imported by the CLI (verified via grep).manifest.jsonversion0.0.2 → 0.9.0to match the package version.2. Runner dependencies: declare only what can't be bundled
The
cli,mcp, andsdkrunners each ship a self-contained bundle (esbuild/tsup with onlynode:*external), so every third-party library is inlined intodist/. Declaring those inlined libraries as runtimedependenciesmade consumersnpm installpackages they never load at runtime.Rule applied (matches how bundled packages like Prettier,
@vercel/ncc, and Wrangler declare deps): keep independenciesonly what the bundle genuinely cannot inline and resolves fromnode_modulesat runtime; move everything inlined todevDependencies.Verified against the actual build output — the only un-inlinable runtime references are:
ajv/ajv-formats— the MCP SDK's validatorsrequire()these by path at runtime; no bundler can inline them. Provided transitively by@modelcontextprotocol/sdk.@anthropic-ai/claude-agent-sdk(cli only) — spawns a native platform binary shipped via itsoptionalDependencies(8 platform variants); resolved fromnode_modulesat runtime.supports-color(cli) — required inside atry {}(thedebuglibrary's optional color probe), so its absence is handled gracefully — left undeclared.dependenciesbefore → after@modelcontextprotocol/sdk→ unchanged@modelcontextprotocol/sdk)ajv/ajv-formats@anthropic-ai/claude-agent-sdk,@modelcontextprotocol/sdk)ajvEverything else (
@ai-sdk/*,ai,@anthropic-ai/sdk,express,commander,@inquirer/prompts,dotenv,yaml,zod) moved todevDependencies(or dropped where already transitive viacore).Why
Pre-release metadata consistency: an accurate engine floor, no phantom dependencies, a coherent extension version, and published packages that install only the code they actually load at runtime instead of dragging in the entire (already-bundled) dependency tree.
Verified
npm run typecheck,npm run lint,npm run format:checkpass (full pre-commit hook incl. gitleaks, no--no-verify).core,mcp,sdk, and thecliesbuild bundle.ajv/ajv-formatsreach all three runners via the MCP SDK;@anthropic-ai/claude-agent-sdk+ itslinux-x64native binary resolve forcli.sdkbundle imports clean in Node (noMODULE_NOT_FOUND);mcpserver binary boots without crashing.npm install --package-lock-only(no package downloads).Note for reviewers
The
clichange preserves@anthropic-ai/claude-agent-sdkexactly as it ships today (still a runtimedependency, still bundled the same way), so there is no behavioral change toopfor hunt. A clean-installopfor huntsmoke test is nonetheless the recommended final gate before release, since that's the path that spawns the native binary.