chore(deps): pin @types/node to the supported runtime floor major - #528
Conversation
@types/node ^25 resolved typings for APIs that do not exist on the engines floor (>=18.17 runtime, Node 20 dev floor), so new code using a Node 22+/25-only API would typecheck cleanly and fail at runtime. Pinning to ^20 makes the compiler enforce the floor. Typecheck passes unchanged, confirming no over-floor APIs are in use today. Resolves audit finding M9 (docs/audits/AUDIT_2026-06-10.md). https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
📝 WalkthroughWalkthroughpackage.json's Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
observations:
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
✨ Simplify code
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 |
Review follow-up: npm install rewrote 13 optional rollup native entries without their libc variant selectors (glibc/musl), which would risk the wrong binary on Alpine. Entries are restored byte-identical to main; the lockfile diff is now strictly the @types/node pin. https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
Summary
Resolves audit finding M9 (
docs/audits/AUDIT_2026-06-10.md§3, PR #522):@types/node ^25resolved typings for APIs that don't exist on the supported floor (engines.node >=18.17runtime, Node 20 development floor per CONTRIBUTING.md). Any new code calling a Node 22+/25-only API (fs.glob, newerAbortSignaladditions, etc.) would typecheck cleanly and fail at runtime for floor consumers.This pins
@types/nodeto^20so the compiler enforces the floor. This is the conservative half of the M9 decision (the alternative — raisingengines— is a breaking change); raising the floor later just means bumping this pin alongsideenginesdeliberately.Changes
package.json:@types/node^25.x→^20.19.42(+ lockfile)Validation
npm run typecheckpasses unchanged — confirming no over-floor Node APIs are in use today (this was the risk M9 flagged; it had not yet materialized)fs-retry,config): passRelated
Risk / Rollback
Dev-dependency-only; no runtime or published-artifact change. Revert the commit to restore
^25types.https://claude.ai/code/session_01XNtnkLbBiXZxfQQYLMpucB
Generated by Claude Code
note: greptile review for oc-chatgpt-multi-auth. cite files like
lib/foo.ts:123. confirm regression tests + windows concurrency/token redaction coverage.Greptile Summary
pins
@types/nodefrom^25.3.0to^20.19.42so the typescript compiler enforces the node 20 development floor rather than allowing node 22+/25-only apis to typecheck cleanly and silently fail on older runtimes. dev-dependency-only change; no runtime or published-artifact effect.package.json:@types/noderange narrowed to^20.19.42;engines.noderemains>=18.0.0(raising the floor is deferred as a deliberate breaking-change decision per the audit finding).package-lock.json: resolves@types/[email protected]and transitively downgradesundici-typesfrom7.18.2→6.21.0to match; all integrity hashes are structurally valid sha512 values.Confidence Score: 5/5
dev-dependency-only pin with no runtime or published-artifact change; safe to merge
the change narrows @types/node to ^20.19.42, adds no new code paths, and the pr description confirms typecheck passes against the existing codebase. the only lockfile side-effect (undici-types downgrade, libc field removal) is cosmetic or already tracked in a previous thread.
no files require special attention
Important Files Changed
@types/nodefrom^25.3.0to^20.19.42; no runtime or published artifact change, only tightens compile-time enforcement to match the Node 20 dev floor@types/[email protected]and[email protected]; all integrity hashes are valid sha512 values;libcfield removal from optional native entries already flagged in a previous threadFlowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[developer writes code using Node API] --> B{API exists in\ntypes-node-20?} B -- yes --> C[typechecks clean\nworks on Node 20+ runtime] B -- no --> D[compiler error\ncaught at build time] D --> E[dev updates to compatible API] E --> A subgraph before["before this PR - types-node-25"] F[Node 25-only APIs typecheck silently] F --> G[fails at runtime for\nengines.node ge 18.0.0 consumers] end subgraph after["after this PR - types-node-20"] H[compile-time guard aligned\nwith CONTRIBUTING.md Node 20 floor] endComments Outside Diff (1)
package.json, line 154-156 (link)engines.node >=18.0.0and@types/node@^20@types/node@20includes APIs added in Node 20 (e.g.fs.glob,stream.composeadditions) that don't exist on Node 18.x. any code calling those APIs will typecheck cleanly and fail at runtime for consumers running Node 18. the PR description acknowledges this as the deliberate conservative split (raisingenginesis a breaking change), so this is just a tracker note — butenginesstill reads>=18.0.0, which overpromises compatibility relative to what the types enforce. no vitest coverage exists to smoke-test the package against a Node 18 runtime outside of the CI job referenced in ci: add Node 18.x runtime-smoke job to validate the engines floor #523.Prompt To Fix With AI
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Reviews (2): Last reviewed commit: "chore(deps): restore libc fields the loc..." | Re-trigger Greptile