[AI] DX: replace ts-node with Node native TypeScript execution (#8304)

* [AI] Replace ts-node with Node native TypeScript execution

Node 22.18+ runs TypeScript files directly via type stripping, so the
ts-node dependency is no longer needed for the repo's helper scripts.

- Run bin/ and loot-core pack-hook scripts with `node` instead of `ts-node`
- Rename bin/*.ts scripts to .mts (unambiguous ESM, runs warning-free)
- ESM-ify validate-publish-imports: __dirname / require.main via import.meta
- Drop ts-node devDependency and the tsconfig ts-node override block
- Bump engines.node to >=22.18.0 (first release with stable type stripping)

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_019d6S7BWQdmtAcYg89WuAVd

* [AI] Use .mts import specifier and simplify release note

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_019d6S7BWQdmtAcYg89WuAVd

* [AI] Bump .nvmrc to v22.18.0 to match engines floor

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Claude-Session: https://claude.ai/code/session_019d6S7BWQdmtAcYg89WuAVd

---------

Co-authored-by: Claude <[email protected]>
This commit is contained in:
Matiss Janis Aboltins
2026-06-22 21:41:00 +00:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 2825f52138
commit 60c5d9b993
11 changed files with 25 additions and 146 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"packages/*/{package.json,tsconfig.json}": [
"ts-node ./bin/validate-publish-imports.ts --fix",
"node ./bin/validate-publish-imports.mts --fix",
"yarn sync:tsconfig-references"
],
"**/*.{js,mjs,jsx,ts,tsx,md,json,yml,yaml}": "oxfmt --no-error-on-unmatched-pattern",
+1 -1
View File
@@ -1 +1 @@
v22/*
v22.18.0
@@ -7,7 +7,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
import {
derivePublishImports,
validatePackage,
} from '../validate-publish-imports.js';
} from '../validate-publish-imports.mts';
describe('derivePublishImports', () => {
it('prepends ./build/ to .js paths', () => {
@@ -1,5 +1,8 @@
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __dirname = path.dirname(fileURLToPath(import.meta.url));
/**
* Derives publishConfig.imports from imports by:
@@ -211,6 +214,6 @@ function main() {
}
}
if (require.main === module) {
if (process.argv[1] === fileURLToPath(import.meta.url)) {
main();
}
+2 -3
View File
@@ -44,7 +44,7 @@
"build:storybook": "yarn workspace @actual-app/components build:storybook",
"deploy:docs": "yarn workspace docs deploy",
"generate:i18n": "yarn workspace @actual-app/web generate:i18n",
"generate:release-notes": "ts-node ./bin/release-note-generator.ts",
"generate:release-notes": "node ./bin/release-note-generator.mts",
"test": "lage test --continue",
"test:debug": "lage test --no-cache --continue",
"e2e": "yarn workspace @actual-app/web run e2e",
@@ -83,7 +83,6 @@
"oxlint-tsgolint": "^0.23.0",
"p-limit": "^7.3.0",
"prompts": "^2.4.2",
"ts-node": "^10.9.2",
"typescript": "^6.0.3",
"vitest": "^4.1.8"
},
@@ -119,7 +118,7 @@
"defaults"
],
"engines": {
"node": ">=22",
"node": ">=22.18.0",
"yarn": "^4.9.1"
},
"packageManager": "[email protected]"
+2 -3
View File
@@ -181,8 +181,8 @@
"test:web": "ENV=web vitest --run -c vitest.web.config.ts",
"typecheck": "tsgo -b && tsc-strict",
"build": "tsgo -b",
"prepack": "yarn build && ts-node scripts/add-types-conditions.mts",
"postpack": "ts-node scripts/restore-package-json.mts"
"prepack": "yarn build && node scripts/add-types-conditions.mts",
"postpack": "node scripts/restore-package-json.mts"
},
"dependencies": {
"@jlongster/sql.js": "^1.6.7",
@@ -225,7 +225,6 @@
"rollup-plugin-visualizer": "^7.0.1",
"stream-browserify": "^3.0.0",
"timers-browserify": "^2.0.12",
"ts-node": "^10.9.2",
"typescript-strict-plugin": "^2.4.4",
"util": "^0.12.5",
"vite": "^8.0.16",
+2 -8
View File
@@ -34,7 +34,7 @@
// Until/if we build using tsc
"noEmit": true
},
"include": ["bin/*.ts"],
"include": ["bin/*.mts"],
"exclude": [
"**/.*/",
"node_modules",
@@ -49,11 +49,5 @@
"**/playwright-report/*",
"**/service-worker/*",
"packages/docs/**/*"
],
"ts-node": {
"compilerOptions": {
"module": "CommonJS",
"types": ["node"]
}
}
]
}
+1 -1
View File
@@ -1,5 +1,5 @@
{
"extends": "./tsconfig.json",
"include": ["bin/*.ts"],
"include": ["bin/*.mts"],
"exclude": ["node_modules"]
}
@@ -0,0 +1,6 @@
---
category: Maintenance
authors: [MatissJanis]
---
Replace `ts-node` with Node's native TypeScript support for internal scripts.
+5 -127
View File
@@ -134,7 +134,6 @@ __metadata:
rollup-plugin-visualizer: "npm:^7.0.1"
stream-browserify: "npm:^3.0.0"
timers-browserify: "npm:^2.0.12"
ts-node: "npm:^10.9.2"
typescript-strict-plugin: "npm:^2.4.4"
util: "npm:^0.12.5"
uuid: "npm:^14.0.1"
@@ -2033,15 +2032,6 @@ __metadata:
languageName: node
linkType: hard
"@cspotcode/source-map-support@npm:^0.8.0":
version: 0.8.1
resolution: "@cspotcode/source-map-support@npm:0.8.1"
dependencies:
"@jridgewell/trace-mapping": "npm:0.3.9"
checksum: 10/b6e38a1712fab242c86a241c229cf562195aad985d0564bd352ac404be583029e89e93028ffd2c251d2c407ecac5fb0cbdca94a2d5c10f29ac806ede0508b3ff
languageName: node
linkType: hard
"@csstools/cascade-layer-name-parser@npm:^2.0.5":
version: 2.0.5
resolution: "@csstools/cascade-layer-name-parser@npm:2.0.5"
@@ -4428,7 +4418,7 @@ __metadata:
languageName: node
linkType: hard
"@jridgewell/resolve-uri@npm:^3.0.3, @jridgewell/resolve-uri@npm:^3.1.0":
"@jridgewell/resolve-uri@npm:^3.1.0":
version: 3.1.2
resolution: "@jridgewell/resolve-uri@npm:3.1.2"
checksum: 10/97106439d750a409c22c8bff822d648f6a71f3aa9bc8e5129efdc36343cd3096ddc4eeb1c62d2fe48e9bdd4db37b05d4646a17114ecebd3bbcacfa2de51c3c1d
@@ -4445,23 +4435,13 @@ __metadata:
languageName: node
linkType: hard
"@jridgewell/sourcemap-codec@npm:^1.4.10, @jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0, @jridgewell/sourcemap-codec@npm:^1.5.5":
"@jridgewell/sourcemap-codec@npm:^1.4.14, @jridgewell/sourcemap-codec@npm:^1.5.0, @jridgewell/sourcemap-codec@npm:^1.5.5":
version: 1.5.5
resolution: "@jridgewell/sourcemap-codec@npm:1.5.5"
checksum: 10/5d9d207b462c11e322d71911e55e21a4e2772f71ffe8d6f1221b8eb5ae6774458c1d242f897fb0814e8714ca9a6b498abfa74dfe4f434493342902b1a48b33a5
languageName: node
linkType: hard
"@jridgewell/trace-mapping@npm:0.3.9":
version: 0.3.9
resolution: "@jridgewell/trace-mapping@npm:0.3.9"
dependencies:
"@jridgewell/resolve-uri": "npm:^3.0.3"
"@jridgewell/sourcemap-codec": "npm:^1.4.10"
checksum: 10/83deafb8e7a5ca98993c2c6eeaa93c270f6f647a4c0dc00deb38c9cf9b2d3b7bf15e8839540155247ef034a052c0ec4466f980bf0c9e2ab63b97d16c0cedd3ff
languageName: node
linkType: hard
"@jridgewell/trace-mapping@npm:^0.3.18, @jridgewell/trace-mapping@npm:^0.3.24, @jridgewell/trace-mapping@npm:^0.3.25, @jridgewell/trace-mapping@npm:^0.3.28":
version: 0.3.31
resolution: "@jridgewell/trace-mapping@npm:0.3.31"
@@ -7613,34 +7593,6 @@ __metadata:
languageName: node
linkType: hard
"@tsconfig/node10@npm:^1.0.7":
version: 1.0.11
resolution: "@tsconfig/node10@npm:1.0.11"
checksum: 10/51fe47d55fe1b80ec35e6e5ed30a13665fd3a531945350aa74a14a1e82875fb60b350c2f2a5e72a64831b1b6bc02acb6760c30b3738b54954ec2dea82db7a267
languageName: node
linkType: hard
"@tsconfig/node12@npm:^1.0.7":
version: 1.0.11
resolution: "@tsconfig/node12@npm:1.0.11"
checksum: 10/5ce29a41b13e7897a58b8e2df11269c5395999e588b9a467386f99d1d26f6c77d1af2719e407621412520ea30517d718d5192a32403b8dfcc163bf33e40a338a
languageName: node
linkType: hard
"@tsconfig/node14@npm:^1.0.0":
version: 1.0.3
resolution: "@tsconfig/node14@npm:1.0.3"
checksum: 10/19275fe80c4c8d0ad0abed6a96dbf00642e88b220b090418609c4376e1cef81bf16237bf170ad1b341452feddb8115d8dd2e5acdfdea1b27422071163dc9ba9d
languageName: node
linkType: hard
"@tsconfig/node16@npm:^1.0.2":
version: 1.0.4
resolution: "@tsconfig/node16@npm:1.0.4"
checksum: 10/202319785901f942a6e1e476b872d421baec20cf09f4b266a1854060efbf78cde16a4d256e8bc949d31e6cd9a90f1e8ef8fb06af96a65e98338a2b6b0de0a0ff
languageName: node
linkType: hard
"@tybys/wasm-util@npm:^0.10.0, @tybys/wasm-util@npm:^0.10.2":
version: 0.10.2
resolution: "@tybys/wasm-util@npm:0.10.2"
@@ -9387,7 +9339,7 @@ __metadata:
languageName: node
linkType: hard
"acorn-walk@npm:^8.0.0, acorn-walk@npm:^8.1.1":
"acorn-walk@npm:^8.0.0":
version: 8.3.4
resolution: "acorn-walk@npm:8.3.4"
dependencies:
@@ -9396,7 +9348,7 @@ __metadata:
languageName: node
linkType: hard
"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.0, acorn@npm:^8.15.0, acorn@npm:^8.16.0, acorn@npm:^8.4.1":
"acorn@npm:^8.0.0, acorn@npm:^8.0.4, acorn@npm:^8.11.0, acorn@npm:^8.15.0, acorn@npm:^8.16.0":
version: 8.16.0
resolution: "acorn@npm:8.16.0"
bin:
@@ -9429,7 +9381,6 @@ __metadata:
oxlint-tsgolint: "npm:^0.23.0"
p-limit: "npm:^7.3.0"
prompts: "npm:^2.4.2"
ts-node: "npm:^10.9.2"
typescript: "npm:^6.0.3"
vitest: "npm:^4.1.8"
dependenciesMeta:
@@ -9731,13 +9682,6 @@ __metadata:
languageName: node
linkType: hard
"arg@npm:^4.1.0":
version: 4.1.3
resolution: "arg@npm:4.1.3"
checksum: 10/969b491082f20cad166649fa4d2073ea9e974a4e5ac36247ca23d2e5a8b3cb12d60e9ff70a8acfe26d76566c71fd351ee5e6a9a6595157eb36f92b1fd64e1599
languageName: node
linkType: hard
"arg@npm:^5.0.0":
version: 5.0.2
resolution: "arg@npm:5.0.2"
@@ -11940,7 +11884,7 @@ __metadata:
languageName: node
linkType: hard
"create-require@npm:^1.1.0, create-require@npm:^1.1.1":
"create-require@npm:^1.1.1":
version: 1.1.1
resolution: "create-require@npm:1.1.1"
checksum: 10/a9a1503d4390d8b59ad86f4607de7870b39cad43d929813599a23714831e81c520bddf61bcdd1f8e30f05fd3a2b71ae8538e946eb2786dc65c2bbc520f692eff
@@ -13090,13 +13034,6 @@ __metadata:
languageName: node
linkType: hard
"diff@npm:^4.0.1":
version: 4.0.2
resolution: "diff@npm:4.0.2"
checksum: 10/ec09ec2101934ca5966355a229d77afcad5911c92e2a77413efda5455636c4cf2ce84057e2d7715227a2eeeda04255b849bd3ae3a4dd22eb22e86e76456df069
languageName: node
linkType: hard
"diffie-hellman@npm:^5.0.3":
version: 5.0.3
resolution: "diffie-hellman@npm:5.0.3"
@@ -18222,13 +18159,6 @@ __metadata:
languageName: node
linkType: hard
"make-error@npm:^1.1.1":
version: 1.3.6
resolution: "make-error@npm:1.3.6"
checksum: 10/b86e5e0e25f7f777b77fabd8e2cbf15737972869d852a22b7e73c17623928fccb826d8e46b9951501d3f20e51ad74ba8c59ed584f610526a48f8ccf88aaec402
languageName: node
linkType: hard
"make-fetch-happen@npm:^14.0.3":
version: 14.0.3
resolution: "make-fetch-happen@npm:14.0.3"
@@ -25879,44 +25809,6 @@ __metadata:
languageName: node
linkType: hard
"ts-node@npm:^10.9.2":
version: 10.9.2
resolution: "ts-node@npm:10.9.2"
dependencies:
"@cspotcode/source-map-support": "npm:^0.8.0"
"@tsconfig/node10": "npm:^1.0.7"
"@tsconfig/node12": "npm:^1.0.7"
"@tsconfig/node14": "npm:^1.0.0"
"@tsconfig/node16": "npm:^1.0.2"
acorn: "npm:^8.4.1"
acorn-walk: "npm:^8.1.1"
arg: "npm:^4.1.0"
create-require: "npm:^1.1.0"
diff: "npm:^4.0.1"
make-error: "npm:^1.1.1"
v8-compile-cache-lib: "npm:^3.0.1"
yn: "npm:3.1.1"
peerDependencies:
"@swc/core": ">=1.2.50"
"@swc/wasm": ">=1.2.50"
"@types/node": "*"
typescript: ">=2.7"
peerDependenciesMeta:
"@swc/core":
optional: true
"@swc/wasm":
optional: true
bin:
ts-node: dist/bin.js
ts-node-cwd: dist/bin-cwd.js
ts-node-esm: dist/bin-esm.js
ts-node-script: dist/bin-script.js
ts-node-transpile-only: dist/bin-transpile.js
ts-script: dist/bin-script-deprecated.js
checksum: 10/a91a15b3c9f76ac462f006fa88b6bfa528130dcfb849dd7ef7f9d640832ab681e235b8a2bc58ecde42f72851cc1d5d4e22c901b0c11aa51001ea1d395074b794
languageName: node
linkType: hard
"tsconfig-paths@npm:^4.2.0":
version: 4.2.0
resolution: "tsconfig-paths@npm:4.2.0"
@@ -26648,13 +26540,6 @@ __metadata:
languageName: node
linkType: hard
"v8-compile-cache-lib@npm:^3.0.1":
version: 3.0.1
resolution: "v8-compile-cache-lib@npm:3.0.1"
checksum: 10/88d3423a52b6aaf1836be779cab12f7016d47ad8430dffba6edf766695e6d90ad4adaa3d8eeb512cc05924f3e246c4a4ca51e089dccf4402caa536b5e5be8961
languageName: node
linkType: hard
"validate-npm-package-license@npm:^3.0.1":
version: 3.0.4
resolution: "validate-npm-package-license@npm:3.0.4"
@@ -27946,13 +27831,6 @@ __metadata:
languageName: node
linkType: hard
"yn@npm:3.1.1":
version: 3.1.1
resolution: "yn@npm:3.1.1"
checksum: 10/2c487b0e149e746ef48cda9f8bad10fc83693cd69d7f9dcd8be4214e985de33a29c9e24f3c0d6bcf2288427040a8947406ab27f7af67ee9456e6b84854f02dd6
languageName: node
linkType: hard
"yocto-queue@npm:^0.1.0":
version: 0.1.0
resolution: "yocto-queue@npm:0.1.0"