Skip to content

fix(cli): silence Node v26 DEP0205 via tsx/esm/api register#1196

Merged
toiroakr merged 4 commits into
mainfrom
fix/silence-node-module-register-warning
May 21, 2026
Merged

fix(cli): silence Node v26 DEP0205 via tsx/esm/api register#1196
toiroakr merged 4 commits into
mainfrom
fix/silence-node-module-register-warning

Conversation

@dqn
Copy link
Copy Markdown
Contributor

@dqn dqn commented May 20, 2026

Summary

Every tailor-sdk CLI invocation on Node v26 emits DEP0205 DeprecationWarning: ``module.register()`` is deprecated. Use ``module.registerHooks()`` instead.. Switch the tsx loader registration to tsx's own programmatic API, which routes through module.registerHooks on capable Node versions and falls back to module.register on older ones.

Main changes

  • Replace the direct module.register("tsx", import.meta.url, { data: {} }) calls in packages/sdk/src/cli/index.ts and packages/sdk/src/cli/lib.ts with register() from tsx/esm/api.
  • Bump tsx from 4.21.0 to 4.21.1 across the root, example, and packages/sdk package.json files (and pnpm-lock.yaml). 4.21.1 is the first release whose programmatic register picks module.registerHooks on Node ≥ 24.11.1 / 25.1 / 26.

Why both changes are needed

  • The tsx bump alone does not silence the warning: with tsx 4.21.1 installed but the original direct module.register("tsx", …) call, node packages/sdk/dist/cli/index.mjs --help on Node v26.1.0 still prints DEP0205.
  • Routing through tsx/esm/api's register() is what triggers tsx's internal module.registerHooks branch and removes the warning. Verified locally with the same Node v26.1.0 binary by toggling only the call site between both forms.

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-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 20, 2026

🦋 Changeset detected

Latest commit: 2aabef8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@tailor-platform/sdk Patch
@tailor-platform/create-sdk Patch

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

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 20, 2026

⚡ pkg.pr.new

@tailor-platform/sdk

pnpm add https://pkg.pr.new/@tailor-platform/sdk@2aabef8
pnpm dlx https://pkg.pr.new/@tailor-platform/sdk@2aabef8 --help

@tailor-platform/create-sdk

pnpm add https://pkg.pr.new/@tailor-platform/create-sdk@2aabef8
pnpm dlx https://pkg.pr.new/@tailor-platform/create-sdk@2aabef8 my-app

commit: 2aabef8

@dqn dqn marked this pull request as ready for review May 20, 2026 00:13
@dqn dqn requested review from remiposo and toiroakr as code owners May 20, 2026 00:13
@github-actions

This comment has been minimized.

@claude
Copy link
Copy Markdown

claude Bot commented May 20, 2026

📖 Docs Consistency Check

✅ No inconsistencies found between documentation and implementation.

Checked areas:

  • ✅ CLI reference documentation (packages/sdk/docs/cli-reference.md, cli/*.md) - No CLI command changes
  • ✅ Service documentation (packages/sdk/docs/services/*.md) - No API changes
  • ✅ Configuration documentation (packages/sdk/docs/configuration.md) - No config schema changes
  • ✅ Code patterns and examples (example/, CLAUDE.md) - Only tsx version bump in package.json, no code pattern changes
  • ✅ Node.js version requirements (packages/sdk/README.md, docs/getting-started.md) - Compatible with documented minimum (Node.js 22+)
  • ✅ Developer guides (docs/*.md) - No architectural or testing changes

Analysis:
This PR is a purely internal implementation change that:

  • Switches from direct module.register("tsx", ...) to tsx's own programmatic API (tsx/esm/api)
  • Bumps tsx from 4.21.0 to 4.21.1
  • Fixes Node v26 DEP0205 deprecation warning
  • Maintains backward compatibility (tsx gracefully falls back to module.register on Node < 24.11.1, including the documented minimum Node 22.x)

No user-facing APIs, CLI commands, configuration options, or documented patterns were changed. The changeset correctly classifies this as a patch level change.


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.
@github-actions

This comment has been minimized.

…le-register-warning

# Conflicts:
#	example/package.json
#	package.json
#	pnpm-lock.yaml
@github-actions

This comment has been minimized.

Copy link
Copy Markdown
Contributor

@toiroakr toiroakr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

…le-register-warning

# Conflicts:
#	pnpm-lock.yaml
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 tsx registration from node:module.register("tsx", …) to register() from tsx/esm/api (CLI entrypoint + programmatic CLI API).
  • Bump tsx from 4.21.0 to 4.21.1 across 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.
@github-actions
Copy link
Copy Markdown

Code Metrics Report (packages/sdk)

main (d6c4959) #1196 (278fc15) +/-
Coverage 62.6% 62.6% 0.0%
Code to Test Ratio 1:0.4 1:0.4 0.0
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%)

Files Coverage +/- Status
packages/sdk/src/cli/index.ts 33.3% 0.0% modified

SDK Configure Bundle Size

main (d6c4959) #1196 (278fc15) +/-
configure-index-size 18KB 18KB 0KB
dependency-chunks-size 33.52KB 33.52KB 0KB
total-bundle-size 51.51KB 51.51KB 0KB

Runtime Performance

main (d6c4959) #1196 (278fc15) +/-
Generate Median 2,398ms 2,745ms 347ms
Generate Max 2,511ms 2,770ms 259ms
Apply Build Median 2,403ms 2,787ms 384ms
Apply Build Max 2,460ms 2,810ms 350ms

Type Performance (instantiations)

main (d6c4959) #1196 (278fc15) +/-
tailordb-basic 35,130 35,130 0
tailordb-optional 3,841 3,841 0
tailordb-relation 7,428 7,428 0
tailordb-validate 2,566 2,566 0
tailordb-hooks 5,767 5,767 0
tailordb-object 12,136 12,136 0
tailordb-enum 2,462 2,462 0
resolver-basic 9,424 9,424 0
resolver-nested 26,111 26,111 0
resolver-array 18,187 18,187 0
executor-schedule 4,234 4,234 0
executor-webhook 873 873 0
executor-record 8,166 8,166 0
executor-resolver 4,369 4,369 0
executor-operation-function 869 869 0
executor-operation-gql 869 869 0
executor-operation-webhook 888 888 0
executor-operation-workflow 1,714 1,714 0

Reported by octocov

@toiroakr toiroakr merged commit c800629 into main May 21, 2026
58 checks passed
@toiroakr toiroakr deleted the fix/silence-node-module-register-warning branch May 21, 2026 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants