GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(migrate): migrate transpile-only ts-node scripts and preloads by fengmk2 · Pull Request #3210 · voidzero-dev/vite-plus

feat(migrate): migrate transpile-only ts-node scripts and preloads #3210

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
fengmk2 merged 10 commits into feat/migrate-oxnode-to-vpx from feat/migrate-ts-node-to-vpx
Nov 3, 2026
+4,057 −51
Merged

feat(migrate): migrate transpile-only ts-node scripts and preloads #3210

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
10 commits
Select commit Hold shift + click to select a range
cd98441
feat(migrate): migrate transpile-only ts-node scripts to vpx
fengmk2 Oct 23, 2026
afa0a11
test(migrate): expect portable tsconfig paths on Windows
fengmk2 Oct 23, 2026
d29dc15
feat(migrate): preserve Node.js for ts-node register hooks
fengmk2 Oct 23, 2026
4369ebb
fix(migrate): validate all inherited ts-node launcher targets
fengmk2 Oct 23, 2026
73619fe
test(migrate): snapshot ts-node register migration
fengmk2 Oct 23, 2026
0e3ff5d
fix(migrate): retain ts-node hooks with different entrypoint config
fengmk2 Oct 23, 2026
f3ab15f
refactor(migrate): clarify ts-node configuration selection
fengmk2 Oct 28, 2026
88d4b1f
test(migrate): compare real ts-node behavior before and after migration
fengmk2 Oct 28, 2026
f58f268
fix(migrate): preserve ts-node runtime semantics
fengmk2 Nov 2, 2026
23903a4
fix(migrate): retain unsupported CommonJS bindings
fengmk2 Nov 2, 2026
File filter
Filter by extension


Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view

There are no files selected for viewing

4 changes: 4 additions & 0 deletions 4 ...li_snapshots/tests/cli_snapshots/fixtures/migration_ts_node/.fixture/ts-node/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "ts-node",
"version": "10.9.2"
}
4 changes: 4 additions & 0 deletions 4 ...snapshots/tests/cli_snapshots/fixtures/migration_ts_node/.fixture/typescript/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "typescript",
"version": "5.9.3"
}
15 changes: 15 additions & 0 deletions 15 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "migration-ts-node",
"type": "module",
"scripts": {
"seed": "ts-node --transpileOnly ./scripts/seed.ts",
"loader": "node --loader ts-node/esm/transpile-only ./scripts/seed.ts",
"register": "node --require=ts-node/register/transpile-only ./scripts/seed.ts",
"env-loader": "NODE_OPTIONS='--require ts-node/register/transpile-only' node ./scripts/seed.ts"
},
"devDependencies": {
"ts-node": "file:.fixture/ts-node",
"typescript": "file:.fixture/typescript",
"vite": "^7.0.0"
}
}
3 changes: 3 additions & 0 deletions 3 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node/scripts/release.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env -S ts-node --transpileOnly
const version: string = '1.0.0';
console.log(version);
4 changes: 4 additions & 0 deletions 4 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node/scripts/seed.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
enum State {
Ready = 'ready',
}
console.log(State.Ready);
44 changes: 44 additions & 0 deletions 44 crates/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node/snapshots.toml
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[[case]]
name = "migration_ts_node_scripts"
vp = "local"
comment = "Local stub dependencies keep the runner migration independent of npm packages."
steps = [
{ argv = ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], comment = "transpile-only commands and shebangs use vpx; preloads keep Node.js" },
["vpt", "print-file", "package.json"],
["vpt", "print-file", "scripts/release.ts"],
{ argv = ["vp", "run", "seed"], comment = "the migrated script runs TypeScript without ts-node" },
["vp", "run", "loader"],
{ argv = ["vp", "run", "register"], comment = "the CommonJS registration option becomes the public ESM preload" },
]

[[case]]
name = "migration_ts_node_kept"
vp = "local"
steps = [
{ argv = ["vpt", "json-edit", "package.json", "scripts.checked", "ts-node ./scripts/seed.ts"], snapshot = false },
{ argv = ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], comment = "commands that type-check keep ts-node and explain the difference" },
["vpt", "print-file", "package.json"],
]

[[case]]
name = "migration_ts_node_config"
vp = "local"
steps = [
{ argv = ["vpt", "rm", "scripts/release.ts"], snapshot = false },
{ argv = ["vpt", "write-file", "tsconfig.json", "{\"compilerOptions\":{\"useDefineForClassFields\":false},\"ts-node\":{\"transpileOnly\":true}}\n"], snapshot = false },
{ argv = ["vpt", "json-edit", "package.json", "scripts.seed", "ts-node ./scripts/seed.ts"], snapshot = false },
{ argv = ["vp", "migrate", "--no-interactive", "--no-hooks", "--no-agent", "--no-editor"], comment = "the runner pins its config; Node preloads keep ts-node until TS_NODE_PROJECT names that file" },
["vpt", "print-file", "package.json"],
["vp", "run", "seed"],
]

[[case]]
name = "migration_ts_node_already_vite_plus"
vp = "local"
steps = [
{ argv = ["vpt", "json-edit", "package.json", "devDependencies.vite-plus", "latest"], snapshot = false },
{ argv = ["vp", "migrate", "--no-interactive"], comment = "a plain upgrade leaves ts-node migration to --full" },
{ argv = ["vp", "migrate", "--no-interactive", "--full", "--no-hooks", "--no-agent", "--no-editor"], comment = "--full migrates transpile-only scripts on an existing Vite+ project" },
["vpt", "print-file", "package.json"],
["vp", "run", "seed"],
]
63 changes: 63 additions & 0 deletions 63 ...ots/fixtures/migration_ts_node/snapshots/migration_ts_node_already_vite_plus.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# migration_ts_node_already_vite_plus

## `vpt json-edit package.json devDependencies.vite-plus latest`


## `vp migrate --no-interactive`

a plain upgrade leaves ts-node migration to --full

```
VITE+ - The Unified Toolchain for the Web

◇ Updated . to Vite+ <version>
• Node <version> pnpm <version>
• Dependencies:
vite-plus latest → <version>
vite → <version>
• Package manager settings configured
• Skipped editor, hooks, and lint setup. Run `vp migrate --full` to apply them.
```

## `vp migrate --no-interactive --full --no-hooks --no-agent --no-editor`

--full migrates transpile-only scripts on an existing Vite+ project

```
VITE+ - The Unified Toolchain for the Web

▲ No package manager is declared in package.json; using pnpm for this migration without adding a pin. Run `vp env pin` to declare it explicitly.
● ts-node scripts detected. Auto-migrating supported commands to Vite+...
◇ Updated . to Vite+ <version>
• Node <version> pnpm <version>
• Dependencies:
vite → <version>
• ts-node scripts migrated to Vite+
```

## `vpt print-file package.json`

```
{
"devDependencies": {
"typescript": "file:.fixture/typescript",
"vite": "catalog:",
"vite-plus": "catalog:"
},
"name": "migration-ts-node",
"scripts": {
"env-loader": "NODE_OPTIONS='--import vite-plus/register' node ./scripts/seed.ts",
"loader": "node --import vite-plus/register ./scripts/seed.ts",
"register": "node --import=vite-plus/register ./scripts/seed.ts",
"seed": "vpx ./scripts/seed.ts"
},
"type": "module"
}
```

## `vp run seed`

```
$ vpx ./scripts/seed.ts ⊘ cache disabled
ready
```
58 changes: 58 additions & 0 deletions 58 .../cli_snapshots/fixtures/migration_ts_node/snapshots/migration_ts_node_config.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# migration_ts_node_config

## `vpt rm scripts/release.ts`


## `vpt write-file tsconfig.json '{"compilerOptions":{"useDefineForClassFields":false},"ts-node":{"transpileOnly":true}}
'`


## `vpt json-edit package.json scripts.seed 'ts-node ./scripts/seed.ts'`


## `vp migrate --no-interactive --no-hooks --no-agent --no-editor`

the runner pins its config; Node preloads keep ts-node until TS_NODE_PROJECT names that file

```
VITE+ - The Unified Toolchain for the Web

● ts-node scripts detected. Auto-migrating supported commands to Vite+...
◇ Migrated . to Vite+ <version>
• Node <version> pnpm <version>
• 1 config update applied
• ts-node scripts migrated to Vite+
! Warnings:
- Kept ts-node in package.json scripts "env-loader": the Node.js preload needs the ts-node config pinned explicitly; set TS_NODE_PROJECT to its file path before migrating.
- Kept ts-node in package.json scripts "loader": the Node.js preload needs the ts-node config pinned explicitly; set TS_NODE_PROJECT to its file path before migrating.
- Kept ts-node in package.json scripts "register": the Node.js preload needs the ts-node config pinned explicitly; set TS_NODE_PROJECT to its file path before migrating.
- Kept the ts-node devDependency in package.json: `scripts` in package.json still uses ts-node.
```

## `vpt print-file package.json`

```
{
"devDependencies": {
"ts-node": "file:.fixture/ts-node",
"typescript": "file:.fixture/typescript",
"vite": "catalog:",
"vite-plus": "catalog:"
},
"name": "migration-ts-node",
"scripts": {
"env-loader": "NODE_OPTIONS='--require ts-node/register/transpile-only' node ./scripts/seed.ts",
"loader": "node --loader ts-node/esm/transpile-only ./scripts/seed.ts",
"register": "node --require=ts-node/register/transpile-only ./scripts/seed.ts",
"seed": "vpx --tsconfig=tsconfig.json ./scripts/seed.ts"
},
"type": "module"
}
```

## `vp run seed`

```
$ vpx --tsconfig=tsconfig.json ./scripts/seed.ts ⊘ cache disabled
ready
```
43 changes: 43 additions & 0 deletions 43 ...ts/cli_snapshots/fixtures/migration_ts_node/snapshots/migration_ts_node_kept.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# migration_ts_node_kept

## `vpt json-edit package.json scripts.checked 'ts-node ./scripts/seed.ts'`


## `vp migrate --no-interactive --no-hooks --no-agent --no-editor`

commands that type-check keep ts-node and explain the difference

```
VITE+ - The Unified Toolchain for the Web

● ts-node scripts detected. Auto-migrating supported commands to Vite+...
◇ Migrated . to Vite+ <version>
• Node <version> pnpm <version>
• 1 config update applied
• ts-node scripts migrated to Vite+
! Warnings:
- Kept ts-node in package.json scripts "checked": this ts-node command type-checks before execution; `vpx` does not type-check. Keep a separate type-check command before changing this script.
- Kept the ts-node devDependency in package.json: `scripts` in package.json still uses ts-node.
```

## `vpt print-file package.json`

```
{
"devDependencies": {
"ts-node": "file:.fixture/ts-node",
"typescript": "file:.fixture/typescript",
"vite": "catalog:",
"vite-plus": "catalog:"
},
"name": "migration-ts-node",
"scripts": {
"checked": "ts-node ./scripts/seed.ts",
"env-loader": "NODE_OPTIONS='--import vite-plus/register' node ./scripts/seed.ts",
"loader": "node --import vite-plus/register ./scripts/seed.ts",
"register": "node --import=vite-plus/register ./scripts/seed.ts",
"seed": "vpx ./scripts/seed.ts"
},
"type": "module"
}
```
70 changes: 70 additions & 0 deletions 70 ...cli_snapshots/fixtures/migration_ts_node/snapshots/migration_ts_node_scripts.md
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# migration_ts_node_scripts

Local stub dependencies keep the runner migration independent of npm packages.

## `vp migrate --no-interactive --no-hooks --no-agent --no-editor`

transpile-only commands and shebangs use vpx; preloads keep Node.js

```
VITE+ - The Unified Toolchain for the Web

● ts-node scripts detected. Auto-migrating supported commands to Vite+...
◇ Migrated . to Vite+ <version>
• Node <version> pnpm <version>
• 1 config update applied
• ts-node scripts migrated to Vite+
```

## `vpt print-file package.json`

```
{
"name": "migration-ts-node",
"type": "module",
"scripts": {
"seed": "vpx ./scripts/seed.ts",
"loader": "node --import vite-plus/register ./scripts/seed.ts",
"register": "node --import=vite-plus/register ./scripts/seed.ts",
"env-loader": "NODE_OPTIONS='--import vite-plus/register' node ./scripts/seed.ts"
},
"devDependencies": {
"typescript": "file:.fixture/typescript",
"vite": "catalog:",
"vite-plus": "catalog:"
}
}
```

## `vpt print-file scripts/release.ts`

```
#!/usr/bin/env -S vpx
const version: string = '1.0.0';
console.log(version);
```

## `vp run seed`

the migrated script runs TypeScript without ts-node

```
$ vpx ./scripts/seed.ts ⊘ cache disabled
ready
```

## `vp run loader`

```
$ node --import vite-plus/register ./scripts/seed.ts ⊘ cache disabled
ready
```

## `vp run register`

the CommonJS registration option becomes the public ESM preload

```
$ node --import=vite-plus/register ./scripts/seed.ts ⊘ cache disabled
ready
```
1 change: 1 addition & 0 deletions 1 ...cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/default.cjs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports.default = 42;
2 changes: 2 additions & 0 deletions 2 ..._cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/default.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import value from './default.cjs';
console.log(value);
1 change: 1 addition & 0 deletions 1 .../vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/dep.cjs
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Object.assign({}, { value: 42 });
1 change: 1 addition & 0 deletions 1 ...s/vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/dep.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = Object.assign({}, { value: 42 });
2 changes: 2 additions & 0 deletions 2 ..._cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/esm/dep.js
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const value = 42;
export default value;
3 changes: 3 additions & 0 deletions 3 ...napshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/esm/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
2 changes: 2 additions & 0 deletions 2 ...cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/named-js.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import { value } from './dep.js';
console.log(value);
2 changes: 2 additions & 0 deletions 2 ...li_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/namespace.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import * as dependency from './dep.cjs';
console.log(dependency.value);
23 changes: 23 additions & 0 deletions 23 ...li_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/package.json
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"name": "migration-ts-node-commonjs-interop",
"private": true,
"packageManager": "[email protected]",
"scripts": {
"reexport": "ts-node -T reexport.ts",
"reexport-register": "TS_NODE_PROJECT=tsconfig.json node --require ts-node/register/transpile-only reexport.ts",
"namespace": "ts-node -T namespace.ts",
"namespace-register": "TS_NODE_PROJECT=tsconfig.json node --require ts-node/register/transpile-only namespace.ts",
"js": "ts-node -T named-js.ts",
"js-register": "TS_NODE_PROJECT=tsconfig.json node --require ts-node/register/transpile-only named-js.ts",
"default": "ts-node -T default.ts",
"default-register": "TS_NODE_PROJECT=tsconfig.json node --require ts-node/register/transpile-only default.ts",
"safe": "ts-node -T safe.ts",
"safe-register": "TS_NODE_PROJECT=tsconfig.json node --require ts-node/register/transpile-only safe.ts"
},
"devDependencies": {
"@types/node": "22.18.6",
"ts-node": "10.9.2",
"typescript": "5.9.3",
"vite-plus": "latest"
}
}
2 changes: 2 additions & 0 deletions 2 ...cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/reexport.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export { value } from './dep.cjs';
console.log('loaded');
6 changes: 6 additions & 0 deletions 6 .../vp_cli_snapshots/tests/cli_snapshots/fixtures/migration_ts_node_commonjs_interop/safe.ts
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import value, { value as named } from './esm/dep.js';
import * as dependency from './esm/dep.js';
export { value } from './esm/dep.js';
export * as namespace from './esm/dep.js';
export * from './esm/dep.js';
console.log(value, named, dependency.value);
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.