chore: bump Node target to 22#183
Conversation
📝 WalkthroughWalkthroughThis PR increments the minimum Node.js version from 20 to 22 across the project's package manifest and build configuration. Both the ChangesNode.js version upgrade
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tsup.config.ts`:
- Line 10: The tsup config currently sets target: "node22", which tsup@8.0.0 may
not accept because its esbuild lacks Node 22 support; either change the target
string in tsup.config.ts from "node22" to a supported runtime (e.g., "node20" or
"node18") or upgrade the tsup dependency to a newer release that bundles an
esbuild with Node 22 support, then run a reinstall and rebuild to verify; look
for the target property in tsup.config.ts and adjust or bump the tsup version in
package.json accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: be8e1e49-a8df-421b-bb50-4291e4c2a079
⛔ Files ignored due to path filters (5)
dist/cli.jsis excluded by!**/dist/**dist/cli.js.mapis excluded by!**/dist/**,!**/*.mapdist/index.jsis excluded by!**/dist/**dist/index.js.mapis excluded by!**/dist/**,!**/*.mappackage-lock.jsonis excluded by!**/package-lock.json
📒 Files selected for processing (2)
package.jsontsup.config.ts
| clean: true, | ||
| sourcemap: true, | ||
| target: "node20", | ||
| target: "node22", |
There was a problem hiding this comment.
🧩 Analysis chain
🌐 Web query:
Does tsup version 8.0.0 support "node22" as a target value?
💡 Result:
Tsup version 8.0.0 does not explicitly support "node22" as a target value [1][2]. Support for specific Node.js targets in tsup is inherited from esbuild, and at the time of the 8.0.0 release (November 2023), Node.js 22 had not yet been released. While you can specify strings for the target option, tsup relies on the underlying esbuild version to validate and process these targets [1][3]. Node.js 22 was released in April 2024, several months after the 8.0.0 release of tsup [2]. Therefore, version 8.0.0 is not designed to recognize "node22" as a valid target [2]. To use "node22" as a target, you would need to use a later version of tsup that includes an updated version of esbuild capable of recognizing it [4][3].
Citations:
- 1: https://tsup.egoist.dev/
- 2: Bump tsup from 7.3.0 to 8.0.0 RobinTail/express-zod-api#1320
- 3: https://github.com/egoist/tsup?search=1
- 4: https://www.npmjs.com/package/tsup
Update tsup target for Node 22 compatibility
In tsup.config.ts, target: "node22", may not be accepted by tsup@8.0.0 because tsup’s target validation is delegated to the underlying esbuild, and Node.js 22 support wasn’t available at tsup 8.0.0 release time. Use a target value supported by your current tsup/esbuild, or upgrade tsup to a version with an updated esbuild.
target: "node22",🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tsup.config.ts` at line 10, The tsup config currently sets target: "node22",
which tsup@8.0.0 may not accept because its esbuild lacks Node 22 support;
either change the target string in tsup.config.ts from "node22" to a supported
runtime (e.g., "node20" or "node18") or upgrade the tsup dependency to a newer
release that bundles an esbuild with Node 22 support, then run a reinstall and
rebuild to verify; look for the target property in tsup.config.ts and adjust or
bump the tsup version in package.json accordingly.
Summary
Validation
Summary by CodeRabbit