fix(cli): silence Node v26 DEP0205 via tsx/esm/api register#1196
Conversation
Switch the tsx loader registration in `cli/index.ts` and `cli/lib.ts`
from a direct `module.register("tsx", …)` call to tsx's own
programmatic `register()` from `tsx/esm/api`, and bump tsx from 4.21.0
to 4.21.1 so the new entry point routes through `module.registerHooks`
on Node ≥ 24.11.1 / 25.1 / 26 instead of the deprecated
`module.register` worker-thread path.
🦋 Changeset detectedLatest commit: 2aabef8 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
⚡ pkg.pr.new@tailor-platform/sdk@tailor-platform/create-sdk
|
This comment has been minimized.
This comment has been minimized.
📖 Docs Consistency Check✅ No inconsistencies found between documentation and implementation. Checked areas:
Analysis:
No user-facing APIs, CLI commands, configuration options, or documented patterns were changed. The changeset correctly classifies this as a |
oxfmt had folded the "Node ≥ 24.11.1 / 25.1 / 26" phrase across a line break, leaving a leading "/ 26" that read like a typo. Joining the range onto one line and rewrapping the trailing clause keeps the comment within reasonable width without the visual stutter.
This comment has been minimized.
This comment has been minimized.
…le-register-warning # Conflicts: # example/package.json # package.json # pnpm-lock.yaml
This comment has been minimized.
This comment has been minimized.
…le-register-warning # Conflicts: # pnpm-lock.yaml
There was a problem hiding this comment.
Pull request overview
This PR updates the SDK CLI’s tsx loader registration to avoid emitting Node v26’s DEP0205 deprecation warning by routing through tsx’s programmatic API (which uses module.registerHooks() when available).
Changes:
- Switch CLI
tsxregistration fromnode:module.register("tsx", …)toregister()fromtsx/esm/api(CLI entrypoint + programmatic CLI API). - Bump
tsxfrom4.21.0to4.21.1across the monorepo (including lockfile). - Add a changeset documenting the warning elimination and version bump.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/sdk/src/cli/index.ts |
Use tsx/esm/api’s register() to register tsx on Node, avoiding DEP0205 on Node v26. |
packages/sdk/src/cli/lib.ts |
Same tsx registration approach for programmatic CLI API usage. |
packages/sdk/package.json |
Bump tsx dependency to 4.21.1. |
package.json |
Bump root tsx dev dependency to 4.21.1. |
example/package.json |
Bump example tsx dev dependency to 4.21.1. |
pnpm-lock.yaml |
Lockfile updates for tsx@4.21.1 and related dependency graph changes. |
.changeset/silence-node-module-register-tsx-warning.md |
Release note describing the loader registration change and tsx bump. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "@tailor-platform/sdk": patch | ||
| --- | ||
|
|
||
| Eliminate the Node.js `DEP0205` `DeprecationWarning` (`` `module.register()` is deprecated. Use `module.registerHooks()` instead. ``) printed by every `tailor-sdk` CLI invocation on Node v26. The CLI now registers `tsx` through its own programmatic API (`tsx/esm/api`) instead of calling `node:module`'s `register("tsx", …)` directly, which on tsx 4.21.1+ routes through `module.registerHooks()` on Node ≥ 24.11.1 / 25.1 / 26 and falls back to `module.register()` on older runtimes. Bumps the bundled `tsx` from 4.21.0 to 4.21.1. |
Code Metrics Report (packages/sdk)
Details | | main (d6c4959) | #1196 (278fc15) | +/- |
|--------------------|----------------|-----------------|------|
| Coverage | 62.6% | 62.6% | 0.0% |
| Files | 365 | 365 | 0 |
| Lines | 12812 | 12812 | 0 |
| Covered | 8033 | 8033 | 0 |
| Code to Test Ratio | 1:0.4 | 1:0.4 | 0.0 |
| Code | 84491 | 84491 | 0 |
| Test | 35612 | 35612 | 0 |Code coverage of files in pull request scope (33.3% → 33.3%)
SDK Configure Bundle Size
Runtime Performance
Type Performance (instantiations)
Reported by octocov |
Summary
Every
tailor-sdkCLI invocation on Node v26 emitsDEP0205 DeprecationWarning: ``module.register()`` is deprecated. Use ``module.registerHooks()`` instead.. Switch the tsx loader registration to tsx's own programmatic API, which routes throughmodule.registerHookson capable Node versions and falls back tomodule.registeron older ones.Main changes
module.register("tsx", import.meta.url, { data: {} })calls inpackages/sdk/src/cli/index.tsandpackages/sdk/src/cli/lib.tswithregister()fromtsx/esm/api.tsxfrom 4.21.0 to 4.21.1 across the root,example, andpackages/sdkpackage.jsonfiles (andpnpm-lock.yaml). 4.21.1 is the first release whose programmatic register picksmodule.registerHookson Node ≥ 24.11.1 / 25.1 / 26.Why both changes are needed
module.register("tsx", …)call,node packages/sdk/dist/cli/index.mjs --helpon Node v26.1.0 still printsDEP0205.tsx/esm/api'sregister()is what triggers tsx's internalmodule.registerHooksbranch and removes the warning. Verified locally with the same Node v26.1.0 binary by toggling only the call site between both forms.