From 2fc48bdfd5c1ebaac70f00472cc22a113dab9232 Mon Sep 17 00:00:00 2001 From: Matsu Date: Tue, 14 Jul 2026 13:01:47 +0300 Subject: [PATCH] chore: Migrate part of backend packages to Typescript 7 (#34131) --- packages/@n8n/api-types/package.json | 2 +- .../schemas/__tests__/password.schema.test.ts | 2 +- packages/@n8n/api-types/tsconfig.build.json | 2 +- packages/@n8n/api-types/tsconfig.json | 2 +- packages/@n8n/backend-common/package.json | 2 +- .../src/modules/module-registry.ts | 4 +- .../@n8n/backend-common/tsconfig.build.json | 2 +- packages/@n8n/backend-common/tsconfig.json | 2 +- .../http/axios/__tests__/user-agent.test.ts | 2 +- .../backend-network/src/http/axios/legacy.ts | 4 +- packages/@n8n/backend-test-utils/package.json | 2 +- .../backend-test-utils/tsconfig.build.json | 2 +- .../@n8n/backend-test-utils/tsconfig.json | 2 +- packages/@n8n/typeorm/package.json | 2 +- .../@n8n/typeorm/src/driver/DriverFactory.ts | 6 +- .../src/query-builder/QueryPartialEntity.ts | 36 +++--- packages/@n8n/typeorm/tsconfig.json | 5 +- pnpm-lock.yaml | 114 +++++++++++++----- scripts/typescript-migration/SUMMARY.md | 67 +++++++++- .../results/_n8n_api-types.json | 61 ++++++++++ .../results/_n8n_backend-common.json | 61 ++++++++++ .../results/_n8n_backend-network.json | 61 ++++++++++ .../results/_n8n_backend-test-utils.json | 61 ++++++++++ .../results/_n8n_typeorm.json | 61 ++++++++++ 24 files changed, 497 insertions(+), 68 deletions(-) create mode 100644 scripts/typescript-migration/results/_n8n_api-types.json create mode 100644 scripts/typescript-migration/results/_n8n_backend-common.json create mode 100644 scripts/typescript-migration/results/_n8n_backend-network.json create mode 100644 scripts/typescript-migration/results/_n8n_backend-test-utils.json create mode 100644 scripts/typescript-migration/results/_n8n_typeorm.json diff --git a/packages/@n8n/api-types/package.json b/packages/@n8n/api-types/package.json index 70826e24314..bf0c5fec6c5 100644 --- a/packages/@n8n/api-types/package.json +++ b/packages/@n8n/api-types/package.json @@ -27,7 +27,7 @@ "@n8n/config": "workspace:*", "@n8n/vitest-config": "workspace:*", "@vitest/coverage-v8": "catalog:", - "typescript": "catalog:", + "typescript": "catalog:typescript", "vite": "catalog:", "vitest": "catalog:", "vitest-mock-extended": "catalog:", diff --git a/packages/@n8n/api-types/src/schemas/__tests__/password.schema.test.ts b/packages/@n8n/api-types/src/schemas/__tests__/password.schema.test.ts index 49c21fcc710..31655f8a653 100644 --- a/packages/@n8n/api-types/src/schemas/__tests__/password.schema.test.ts +++ b/packages/@n8n/api-types/src/schemas/__tests__/password.schema.test.ts @@ -71,7 +71,7 @@ describe('passwordSchema with N8N_PASSWORD_MIN_LENGTH', () => { const importFreshSchema = async () => { vi.resetModules(); - return await import('../password.schema'); + return await import('../password.schema.js'); }; test('should use custom min length from env var', async () => { diff --git a/packages/@n8n/api-types/tsconfig.build.json b/packages/@n8n/api-types/tsconfig.build.json index e08cb937d03..1e88f16fb0e 100644 --- a/packages/@n8n/api-types/tsconfig.build.json +++ b/packages/@n8n/api-types/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"], + "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.go.json"], "compilerOptions": { "composite": true, "rootDir": "src", diff --git a/packages/@n8n/api-types/tsconfig.json b/packages/@n8n/api-types/tsconfig.json index f729e4443c3..f693c746bb6 100644 --- a/packages/@n8n/api-types/tsconfig.json +++ b/packages/@n8n/api-types/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@n8n/typescript-config/tsconfig.common.json", + "extends": "@n8n/typescript-config/tsconfig.common.go.json", "compilerOptions": { "types": ["node", "vitest/globals", "vite/client"] }, diff --git a/packages/@n8n/backend-common/package.json b/packages/@n8n/backend-common/package.json index c8cb1bad166..16e700c3a75 100644 --- a/packages/@n8n/backend-common/package.json +++ b/packages/@n8n/backend-common/package.json @@ -44,7 +44,7 @@ "@types/yargs-parser": "21.0.0", "@n8n/vitest-config": "workspace:*", "@vitest/coverage-v8": "catalog:", - "typescript": "catalog:", + "typescript": "catalog:typescript", "vitest": "catalog:", "vitest-mock-extended": "catalog:", "zod": "catalog:" diff --git a/packages/@n8n/backend-common/src/modules/module-registry.ts b/packages/@n8n/backend-common/src/modules/module-registry.ts index 386eb4ba701..30fa4047d1c 100644 --- a/packages/@n8n/backend-common/src/modules/module-registry.ts +++ b/packages/@n8n/backend-common/src/modules/module-registry.ts @@ -103,10 +103,10 @@ export class ModuleRegistry { for (const moduleName of modules ?? this.eligibleModules) { try { - await import(`${modulesDir}/${moduleName}/${moduleName}.module`); + await import(`${modulesDir}/${moduleName}/${moduleName}.module.js`); } catch (primaryError) { try { - await import(`${modulesDir}/${moduleName}.ee/${moduleName}.module`); + await import(`${modulesDir}/${moduleName}.ee/${moduleName}.module.js`); } catch (error) { const loggedError = primaryError instanceof Error && diff --git a/packages/@n8n/backend-common/tsconfig.build.json b/packages/@n8n/backend-common/tsconfig.build.json index e08cb937d03..1e88f16fb0e 100644 --- a/packages/@n8n/backend-common/tsconfig.build.json +++ b/packages/@n8n/backend-common/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"], + "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.go.json"], "compilerOptions": { "composite": true, "rootDir": "src", diff --git a/packages/@n8n/backend-common/tsconfig.json b/packages/@n8n/backend-common/tsconfig.json index 6d2eeded716..6345b4855da 100644 --- a/packages/@n8n/backend-common/tsconfig.json +++ b/packages/@n8n/backend-common/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@n8n/typescript-config/tsconfig.common.json", + "extends": "@n8n/typescript-config/tsconfig.common.go.json", "compilerOptions": { "types": ["node", "vitest/globals"], "experimentalDecorators": true, diff --git a/packages/@n8n/backend-network/src/http/axios/__tests__/user-agent.test.ts b/packages/@n8n/backend-network/src/http/axios/__tests__/user-agent.test.ts index 79b53f1396e..5f35e27e85a 100644 --- a/packages/@n8n/backend-network/src/http/axios/__tests__/user-agent.test.ts +++ b/packages/@n8n/backend-network/src/http/axios/__tests__/user-agent.test.ts @@ -73,7 +73,7 @@ describe('outbound-user-agent', () => { const di = await import('@n8n/di'); const config = await import('@n8n/config'); - const mod = await import('../user-agent'); + const mod = await import('../user-agent.js'); di.Container.set(config.HttpRequestConfig, { enforceGlobalUserAgent: true, diff --git a/packages/@n8n/backend-network/src/http/axios/legacy.ts b/packages/@n8n/backend-network/src/http/axios/legacy.ts index c9a41d73a93..6e387bdb7fc 100644 --- a/packages/@n8n/backend-network/src/http/axios/legacy.ts +++ b/packages/@n8n/backend-network/src/http/axios/legacy.ts @@ -4,7 +4,7 @@ /* eslint-disable @typescript-eslint/no-unsafe-return */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import type { AxiosHeaders, AxiosRequestConfig } from 'axios'; +import type { AxiosRequestConfig, AxiosRequestHeaders } from 'axios'; import crypto from 'crypto'; import type FormData from 'form-data'; import { type AgentOptions } from 'https'; @@ -57,7 +57,7 @@ export async function buildAxiosConfigFromLegacyRequest( const axiosConfig: AxiosRequestConfig = {}; if (requestObject.headers !== undefined) { - axiosConfig.headers = requestObject.headers as AxiosHeaders; + axiosConfig.headers = requestObject.headers as AxiosRequestHeaders; } // Let's start parsing the hardest part, which is the request body. diff --git a/packages/@n8n/backend-test-utils/package.json b/packages/@n8n/backend-test-utils/package.json index 45210a1bfd5..74df4cf7a63 100644 --- a/packages/@n8n/backend-test-utils/package.json +++ b/packages/@n8n/backend-test-utils/package.json @@ -37,7 +37,7 @@ }, "devDependencies": { "@n8n/typescript-config": "workspace:*", - "typescript": "catalog:" + "typescript": "catalog:typescript" }, "license": "LicenseRef-n8n-sustainable-use" } diff --git a/packages/@n8n/backend-test-utils/tsconfig.build.json b/packages/@n8n/backend-test-utils/tsconfig.build.json index e08cb937d03..1e88f16fb0e 100644 --- a/packages/@n8n/backend-test-utils/tsconfig.build.json +++ b/packages/@n8n/backend-test-utils/tsconfig.build.json @@ -1,5 +1,5 @@ { - "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"], + "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.go.json"], "compilerOptions": { "composite": true, "rootDir": "src", diff --git a/packages/@n8n/backend-test-utils/tsconfig.json b/packages/@n8n/backend-test-utils/tsconfig.json index 919d86d3724..e0f15873ec8 100644 --- a/packages/@n8n/backend-test-utils/tsconfig.json +++ b/packages/@n8n/backend-test-utils/tsconfig.json @@ -1,5 +1,5 @@ { - "extends": "@n8n/typescript-config/tsconfig.common.json", + "extends": "@n8n/typescript-config/tsconfig.common.go.json", "compilerOptions": { "types": ["node", "vitest/globals"], "tsBuildInfoFile": "dist/typecheck.tsbuildinfo", diff --git a/packages/@n8n/typeorm/package.json b/packages/@n8n/typeorm/package.json index 035336caae6..db506f6845f 100644 --- a/packages/@n8n/typeorm/package.json +++ b/packages/@n8n/typeorm/package.json @@ -84,7 +84,7 @@ "source-map-support": "^0.5.21", "sqlite3": "5.1.7", "ts-node": "^10.9.1", - "typescript": "catalog:" + "typescript": "catalog:typescript" }, "peerDependencies": { "pg": "^8.17.0", diff --git a/packages/@n8n/typeorm/src/driver/DriverFactory.ts b/packages/@n8n/typeorm/src/driver/DriverFactory.ts index 15f29c7c7ce..525b95ae9f7 100644 --- a/packages/@n8n/typeorm/src/driver/DriverFactory.ts +++ b/packages/@n8n/typeorm/src/driver/DriverFactory.ts @@ -5,11 +5,11 @@ import { MissingDriverError } from '../error/MissingDriverError'; const getDriver = async (type: DataSource['options']['type']): Promise => { switch (type) { case 'postgres': - return (await import('./postgres/PostgresDriver')).PostgresDriver; + return (await import('./postgres/PostgresDriver.js')).PostgresDriver; case 'sqlite': - return (await import('./sqlite/SqliteDriver')).SqliteDriver; + return (await import('./sqlite/SqliteDriver.js')).SqliteDriver; case 'sqlite-pooled': - return (await import('./sqlite-pooled/SqliteReadWriteDriver')).SqliteReadWriteDriver; + return (await import('./sqlite-pooled/SqliteReadWriteDriver.js')).SqliteReadWriteDriver; default: throw new MissingDriverError(type, ['postgres', 'sqlite', 'sqlite-pooled']); } diff --git a/packages/@n8n/typeorm/src/query-builder/QueryPartialEntity.ts b/packages/@n8n/typeorm/src/query-builder/QueryPartialEntity.ts index a5324d67735..cc796e2ed68 100644 --- a/packages/@n8n/typeorm/src/query-builder/QueryPartialEntity.ts +++ b/packages/@n8n/typeorm/src/query-builder/QueryPartialEntity.ts @@ -1,4 +1,4 @@ -import { ObjectLiteral } from '../common/ObjectLiteral'; +import type { ObjectLiteral } from '../common/ObjectLiteral'; /** * Make all properties in T optional @@ -7,22 +7,28 @@ export type QueryPartialEntity = { [P in keyof T]?: T[P] | (() => string); }; +type _QueryDeepPartialEntityDecr = [never, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; + +type _QueryDeepPartialEntity = [Depth] extends [never] + ? T + : { + [P in keyof T]?: + | (T[P] extends Array + ? Array<_QueryDeepPartialEntity> + : T[P] extends ReadonlyArray + ? ReadonlyArray<_QueryDeepPartialEntity> + : _QueryDeepPartialEntity) + | (() => string); + }; + /** * Make all properties in T optional. Deep version. + * + * Recursion is bounded by a fixed depth budget instead of a growing `Seen` + * union (expensive for the checker) or unbounded recursion (trips the + * compiler's own depth limiter with TS2589 on deep payloads such as INode[]). + * At the depth floor the full `T` is returned so deep writes stay assignable. */ export type QueryDeepPartialEntity = _QueryDeepPartialEntity< - ObjectLiteral extends T ? unknown : T, - never + ObjectLiteral extends T ? unknown : T >; - -type _QueryDeepPartialEntity = { - [Property in keyof Entity]?: - | (Entity[Property] extends Seen - ? Entity[Property] // break cycle - : Entity[Property] extends Array - ? Array<_QueryDeepPartialEntity> - : Entity[Property] extends ReadonlyArray - ? ReadonlyArray<_QueryDeepPartialEntity> - : _QueryDeepPartialEntity) - | (() => string); -}; diff --git a/packages/@n8n/typeorm/tsconfig.json b/packages/@n8n/typeorm/tsconfig.json index 76b121a2dab..cb7001cfd5f 100644 --- a/packages/@n8n/typeorm/tsconfig.json +++ b/packages/@n8n/typeorm/tsconfig.json @@ -5,12 +5,11 @@ "lib": ["ES2022.Error"], "allowSyntheticDefaultImports": true, "declaration": true, - "downlevelIteration": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "importHelpers": true, - "module": "commonjs", - "moduleResolution": "node", + "module": "NodeNext", + "moduleResolution": "NodeNext", "noFallthroughCasesInSwitch": true, "noImplicitAny": true, "noImplicitReturns": true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1185fbf89d1..97d900a8c5d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1331,8 +1331,8 @@ importers: specifier: 1.34.1 version: 1.34.1(patch_hash=bc707e2c34a2464da2c9c93ead33e80fd9883a00434ef64907ddc45208a08b33) typescript: - specifier: 'catalog:' - version: 6.0.2 + specifier: catalog:typescript + version: 7.0.2 vite: specifier: 'catalog:' version: 8.0.2(@types/node@20.19.41)(esbuild@0.28.1)(jiti@2.6.1)(sass-embedded@1.98.0)(sass@1.98.0)(terser@5.16.1)(tsx@4.19.3)(yaml@2.8.3) @@ -1341,7 +1341,7 @@ importers: version: 4.1.9(@opentelemetry/api@1.9.0)(@types/node@20.19.41)(@vitest/browser-playwright@4.1.9)(@vitest/coverage-v8@4.1.9)(jsdom@23.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(vite@8.0.2(@types/node@20.19.41)(esbuild@0.28.1)(jiti@2.6.1)(sass-embedded@1.98.0)(sass@1.98.0)(terser@5.16.1)(tsx@4.19.3)(yaml@2.8.3)) vitest-mock-extended: specifier: 'catalog:' - version: 3.1.0(typescript@6.0.2)(vitest@4.1.9) + version: 3.1.0(typescript@7.0.2)(vitest@4.1.9) zod: specifier: 3.25.67 version: 3.25.67 @@ -1407,14 +1407,14 @@ importers: specifier: 'catalog:' version: 4.1.9(@vitest/browser@4.1.9)(vitest@4.1.9) typescript: - specifier: 'catalog:' - version: 6.0.2 + specifier: catalog:typescript + version: 7.0.2 vitest: specifier: 'catalog:' version: 4.1.9(@opentelemetry/api@1.9.0)(@types/node@20.19.41)(@vitest/browser-playwright@4.1.9)(@vitest/coverage-v8@4.1.9)(jsdom@23.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(vite@8.0.2(@types/node@20.19.41)(esbuild@0.28.1)(jiti@2.6.1)(sass-embedded@1.98.0)(sass@1.98.0)(terser@5.16.1)(tsx@4.19.3)(yaml@2.8.3)) vitest-mock-extended: specifier: 'catalog:' - version: 3.1.0(typescript@6.0.2)(vitest@4.1.9) + version: 3.1.0(typescript@7.0.2)(vitest@4.1.9) zod: specifier: 3.25.67 version: 3.25.67 @@ -1538,14 +1538,14 @@ importers: version: 4.1.9(@opentelemetry/api@1.9.0)(@types/node@20.19.41)(@vitest/browser-playwright@4.1.9)(@vitest/coverage-v8@4.1.9)(jsdom@23.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(vite@8.0.2(@types/node@20.19.41)(esbuild@0.28.1)(jiti@2.6.1)(sass-embedded@1.98.0)(sass@1.98.0)(terser@5.16.1)(tsx@4.19.3)(yaml@2.8.3)) vitest-mock-extended: specifier: 'catalog:' - version: 3.1.0(typescript@6.0.2)(vitest@4.1.9) + version: 3.1.0(typescript@7.0.2)(vitest@4.1.9) devDependencies: '@n8n/typescript-config': specifier: workspace:* version: link:../typescript-config typescript: - specifier: 'catalog:' - version: 6.0.2 + specifier: catalog:typescript + version: 7.0.2 packages/@n8n/benchmark: dependencies: @@ -3654,7 +3654,7 @@ importers: version: 9.0.8 '@typescript-eslint/eslint-plugin': specifier: ^8.35.0 - version: 8.35.0(@typescript-eslint/parser@8.35.0(eslint@8.57.1)(typescript@6.0.2))(eslint@8.57.1)(typescript@6.0.2) + version: 8.35.0(@typescript-eslint/parser@8.35.0(eslint@8.57.1)(typescript@7.0.2))(eslint@8.57.1)(typescript@7.0.2) chai: specifier: ^4.3.7 version: 4.5.0 @@ -3693,10 +3693,10 @@ importers: version: 5.1.7 ts-node: specifier: ^10.9.1 - version: 10.9.2(@swc/core@1.15.8(@swc/helpers@0.5.17))(@types/node@20.19.41)(typescript@6.0.2) + version: 10.9.2(@swc/core@1.15.8(@swc/helpers@0.5.17))(@types/node@20.19.41)(typescript@7.0.2) typescript: - specifier: 'catalog:' - version: 6.0.2 + specifier: catalog:typescript + version: 7.0.2 packages/@n8n/typescript-config: {} @@ -29631,20 +29631,20 @@ snapshots: '@types/node': 20.19.41 optional: true - '@typescript-eslint/eslint-plugin@8.35.0(@typescript-eslint/parser@8.35.0(eslint@8.57.1)(typescript@6.0.2))(eslint@8.57.1)(typescript@6.0.2)': + '@typescript-eslint/eslint-plugin@8.35.0(@typescript-eslint/parser@8.35.0(eslint@8.57.1)(typescript@7.0.2))(eslint@8.57.1)(typescript@7.0.2)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.35.0(eslint@8.57.1)(typescript@6.0.2) + '@typescript-eslint/parser': 8.35.0(eslint@8.57.1)(typescript@7.0.2) '@typescript-eslint/scope-manager': 8.35.0 - '@typescript-eslint/type-utils': 8.35.0(eslint@8.57.1)(typescript@6.0.2) - '@typescript-eslint/utils': 8.35.0(eslint@8.57.1)(typescript@6.0.2) + '@typescript-eslint/type-utils': 8.35.0(eslint@8.57.1)(typescript@7.0.2) + '@typescript-eslint/utils': 8.35.0(eslint@8.57.1)(typescript@7.0.2) '@typescript-eslint/visitor-keys': 8.35.0 eslint: 8.57.1 graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 - ts-api-utils: 2.1.0(typescript@6.0.2) - typescript: 6.0.2 + ts-api-utils: 2.1.0(typescript@7.0.2) + typescript: 7.0.2 transitivePeerDependencies: - supports-color @@ -29665,15 +29665,15 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.35.0(eslint@8.57.1)(typescript@6.0.2)': + '@typescript-eslint/parser@8.35.0(eslint@8.57.1)(typescript@7.0.2)': dependencies: '@typescript-eslint/scope-manager': 8.35.0 '@typescript-eslint/types': 8.35.0 - '@typescript-eslint/typescript-estree': 8.35.0(typescript@6.0.2) + '@typescript-eslint/typescript-estree': 8.35.0(typescript@7.0.2) '@typescript-eslint/visitor-keys': 8.35.0 debug: 4.4.3(supports-color@8.1.1) eslint: 8.57.1 - typescript: 6.0.2 + typescript: 7.0.2 transitivePeerDependencies: - supports-color @@ -29707,6 +29707,15 @@ snapshots: transitivePeerDependencies: - supports-color + '@typescript-eslint/project-service@8.35.0(typescript@7.0.2)': + dependencies: + '@typescript-eslint/tsconfig-utils': 8.35.0(typescript@7.0.2) + '@typescript-eslint/types': 8.35.0 + debug: 4.4.3(supports-color@8.1.1) + typescript: 7.0.2 + transitivePeerDependencies: + - supports-color + '@typescript-eslint/rule-tester@8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@6.0.2)': dependencies: '@typescript-eslint/parser': 8.35.0(eslint@9.29.0(jiti@2.6.1))(typescript@6.0.2) @@ -29734,14 +29743,18 @@ snapshots: dependencies: typescript: 6.0.2 - '@typescript-eslint/type-utils@8.35.0(eslint@8.57.1)(typescript@6.0.2)': + '@typescript-eslint/tsconfig-utils@8.35.0(typescript@7.0.2)': dependencies: - '@typescript-eslint/typescript-estree': 8.35.0(typescript@6.0.2) - '@typescript-eslint/utils': 8.35.0(eslint@8.57.1)(typescript@6.0.2) + typescript: 7.0.2 + + '@typescript-eslint/type-utils@8.35.0(eslint@8.57.1)(typescript@7.0.2)': + dependencies: + '@typescript-eslint/typescript-estree': 8.35.0(typescript@7.0.2) + '@typescript-eslint/utils': 8.35.0(eslint@8.57.1)(typescript@7.0.2) debug: 4.4.3(supports-color@8.1.1) eslint: 8.57.1 - ts-api-utils: 2.1.0(typescript@6.0.2) - typescript: 6.0.2 + ts-api-utils: 2.1.0(typescript@7.0.2) + typescript: 7.0.2 transitivePeerDependencies: - supports-color @@ -29790,14 +29803,30 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.35.0(eslint@8.57.1)(typescript@6.0.2)': + '@typescript-eslint/typescript-estree@8.35.0(typescript@7.0.2)': + dependencies: + '@typescript-eslint/project-service': 8.35.0(typescript@7.0.2) + '@typescript-eslint/tsconfig-utils': 8.35.0(typescript@7.0.2) + '@typescript-eslint/types': 8.35.0 + '@typescript-eslint/visitor-keys': 8.35.0 + debug: 4.4.3(supports-color@8.1.1) + fast-glob: 3.3.3 + is-glob: 4.0.3 + minimatch: 9.0.9 + semver: 7.7.3 + ts-api-utils: 2.1.0(typescript@7.0.2) + typescript: 7.0.2 + transitivePeerDependencies: + - supports-color + + '@typescript-eslint/utils@8.35.0(eslint@8.57.1)(typescript@7.0.2)': dependencies: '@eslint-community/eslint-utils': 4.7.0(eslint@8.57.1) '@typescript-eslint/scope-manager': 8.35.0 '@typescript-eslint/types': 8.35.0 - '@typescript-eslint/typescript-estree': 8.35.0(typescript@6.0.2) + '@typescript-eslint/typescript-estree': 8.35.0(typescript@7.0.2) eslint: 8.57.1 - typescript: 6.0.2 + typescript: 7.0.2 transitivePeerDependencies: - supports-color @@ -39970,6 +39999,10 @@ snapshots: dependencies: typescript: 6.0.2 + ts-api-utils@2.1.0(typescript@7.0.2): + dependencies: + typescript: 7.0.2 + ts-dedent@2.2.0: {} ts-error@1.0.6: {} @@ -40028,6 +40061,27 @@ snapshots: yn: 3.1.1 optionalDependencies: '@swc/core': 1.15.8(@swc/helpers@0.5.17) + optional: true + + ts-node@10.9.2(@swc/core@1.15.8(@swc/helpers@0.5.17))(@types/node@20.19.41)(typescript@7.0.2): + dependencies: + '@cspotcode/source-map-support': 0.8.1 + '@tsconfig/node10': 1.0.11 + '@tsconfig/node12': 1.0.11 + '@tsconfig/node14': 1.0.3 + '@tsconfig/node16': 1.0.4 + '@types/node': 20.19.41 + acorn: 8.14.0 + acorn-walk: 8.3.4 + arg: 4.1.3 + create-require: 1.1.1 + diff: 8.0.3 + make-error: 1.3.6 + typescript: 7.0.2 + v8-compile-cache-lib: 3.0.1 + yn: 3.1.1 + optionalDependencies: + '@swc/core': 1.15.8(@swc/helpers@0.5.17) ts-pattern@5.8.0: {} diff --git a/scripts/typescript-migration/SUMMARY.md b/scripts/typescript-migration/SUMMARY.md index c3a09331480..26b69fdc119 100644 --- a/scripts/typescript-migration/SUMMARY.md +++ b/scripts/typescript-migration/SUMMARY.md @@ -1,6 +1,6 @@ # TypeScript 6 → 7 migration benchmarks -Generated 2026-07-09T13:19:07.559Z from `scripts/typescript-migration/results/`. +Generated 2026-07-14T09:31:26.831Z from `scripts/typescript-migration/results/`. | Package | typecheck Δ | build Δ | | --- | --- | --- | @@ -8,10 +8,15 @@ Generated 2026-07-09T13:19:07.559Z from `scripts/typescript-migration/results/`. | `@n8n/ai-node-sdk` | -53.1% | -54.3% | | `@n8n/ai-utilities` | -66.9% | -63.2% | | `@n8n/ai-workflow-builder` | -69.3% | -33.1% | +| `@n8n/api-types` | -64.6% | -66.6% | +| `@n8n/backend-common` | -57.0% | -54.5% | +| `@n8n/backend-network` | -57.0% | -54.9% | +| `@n8n/backend-test-utils` | -51.4% | -53.1% | | `@n8n/codemirror-lang` | -36.3% | -31.4% | | `@n8n/codemirror-lang-html` | — | -17.0% | | `@n8n/codemirror-lang-sql` | -42.7% | -39.2% | | `@n8n/instance-ai` | -70.0% | -40.3% | +| `@n8n/typeorm` | -37.9% | -68.7% | ``` === @n8n/agents — median times (Δ vs "before") === @@ -61,6 +66,54 @@ build: after 2.17s -1078ms (-33.1%) ``` +``` +=== @n8n/api-types — median times (Δ vs "before") === + +typecheck: + before 2.55s + after 903ms -1651ms (-64.6%) + +build: + before 2.64s + after 882ms -1757ms (-66.6%) +``` + +``` +=== @n8n/backend-common — median times (Δ vs "before") === + +typecheck: + before 1.34s + after 576ms -765ms (-57.0%) + +build: + before 1.19s + after 541ms -649ms (-54.5%) +``` + +``` +=== @n8n/backend-network — median times (Δ vs "before") === + +typecheck: + before 1.52s + after 656ms -868ms (-57.0%) + +build: + before 1.28s + after 576ms -701ms (-54.9%) +``` + +``` +=== @n8n/backend-test-utils — median times (Δ vs "before") === + +typecheck: + before 1.54s + after 748ms -792ms (-51.4%) + +build: + before 1.60s + after 751ms -850ms (-53.1%) +``` + ``` === @n8n/codemirror-lang — median times (Δ vs "before") === @@ -105,3 +158,15 @@ build: after 1.91s -1293ms (-40.3%) ``` +``` +=== @n8n/typeorm — median times (Δ vs "before") === + +typecheck: + before 1.45s + after 898ms -547ms (-37.9%) + +build: + before 2.84s + after 890ms -1949ms (-68.7%) +``` + diff --git a/scripts/typescript-migration/results/_n8n_api-types.json b/scripts/typescript-migration/results/_n8n_api-types.json new file mode 100644 index 00000000000..b382f57c624 --- /dev/null +++ b/scripts/typescript-migration/results/_n8n_api-types.json @@ -0,0 +1,61 @@ +{ + "package": "@n8n/api-types", + "runs": { + "before": { + "label": "before", + "tsVersion": "6.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T08:13:33.024Z", + "tasks": { + "typecheck": { + "runsMs": [ + 2731, + 2554, + 2526 + ], + "min": 2526, + "median": 2554, + "mean": 2604 + }, + "build": { + "runsMs": [ + 2513, + 3418, + 2639 + ], + "min": 2513, + "median": 2639, + "mean": 2857 + } + } + }, + "after": { + "label": "after", + "tsVersion": "7.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T08:14:34.864Z", + "tasks": { + "typecheck": { + "runsMs": [ + 903, + 857, + 1156 + ], + "min": 857, + "median": 903, + "mean": 972 + }, + "build": { + "runsMs": [ + 826, + 927, + 882 + ], + "min": 826, + "median": 882, + "mean": 878 + } + } + } + } +} diff --git a/scripts/typescript-migration/results/_n8n_backend-common.json b/scripts/typescript-migration/results/_n8n_backend-common.json new file mode 100644 index 00000000000..7aeea5eec89 --- /dev/null +++ b/scripts/typescript-migration/results/_n8n_backend-common.json @@ -0,0 +1,61 @@ +{ + "package": "@n8n/backend-common", + "runs": { + "before": { + "label": "before", + "tsVersion": "6.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T08:15:35.193Z", + "tasks": { + "typecheck": { + "runsMs": [ + 1352, + 1323, + 1341 + ], + "min": 1323, + "median": 1341, + "mean": 1338 + }, + "build": { + "runsMs": [ + 1190, + 1227, + 1190 + ], + "min": 1190, + "median": 1190, + "mean": 1202 + } + } + }, + "after": { + "label": "after", + "tsVersion": "7.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T08:16:31.011Z", + "tasks": { + "typecheck": { + "runsMs": [ + 629, + 562, + 576 + ], + "min": 562, + "median": 576, + "mean": 589 + }, + "build": { + "runsMs": [ + 572, + 541, + 519 + ], + "min": 519, + "median": 541, + "mean": 544 + } + } + } + } +} diff --git a/scripts/typescript-migration/results/_n8n_backend-network.json b/scripts/typescript-migration/results/_n8n_backend-network.json new file mode 100644 index 00000000000..47293482b79 --- /dev/null +++ b/scripts/typescript-migration/results/_n8n_backend-network.json @@ -0,0 +1,61 @@ +{ + "package": "@n8n/backend-network", + "runs": { + "before": { + "label": "before", + "tsVersion": "6.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T08:17:32.701Z", + "tasks": { + "typecheck": { + "runsMs": [ + 1598, + 1524, + 1514 + ], + "min": 1514, + "median": 1524, + "mean": 1545 + }, + "build": { + "runsMs": [ + 1302, + 1262, + 1277 + ], + "min": 1262, + "median": 1277, + "mean": 1281 + } + } + }, + "after": { + "label": "after", + "tsVersion": "7.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T08:42:01.850Z", + "tasks": { + "typecheck": { + "runsMs": [ + 656, + 625, + 659 + ], + "min": 625, + "median": 656, + "mean": 646 + }, + "build": { + "runsMs": [ + 582, + 576, + 575 + ], + "min": 575, + "median": 576, + "mean": 578 + } + } + } + } +} diff --git a/scripts/typescript-migration/results/_n8n_backend-test-utils.json b/scripts/typescript-migration/results/_n8n_backend-test-utils.json new file mode 100644 index 00000000000..f7852dcb557 --- /dev/null +++ b/scripts/typescript-migration/results/_n8n_backend-test-utils.json @@ -0,0 +1,61 @@ +{ + "package": "@n8n/backend-test-utils", + "runs": { + "before": { + "label": "before", + "tsVersion": "6.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T09:27:33.022Z", + "tasks": { + "typecheck": { + "runsMs": [ + 1602, + 1534, + 1540 + ], + "min": 1534, + "median": 1540, + "mean": 1558 + }, + "build": { + "runsMs": [ + 1601, + 1556, + 1617 + ], + "min": 1556, + "median": 1601, + "mean": 1592 + } + } + }, + "after": { + "label": "after", + "tsVersion": "7.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T09:28:19.744Z", + "tasks": { + "typecheck": { + "runsMs": [ + 795, + 748, + 748 + ], + "min": 748, + "median": 748, + "mean": 764 + }, + "build": { + "runsMs": [ + 758, + 751, + 737 + ], + "min": 737, + "median": 751, + "mean": 749 + } + } + } + } +} diff --git a/scripts/typescript-migration/results/_n8n_typeorm.json b/scripts/typescript-migration/results/_n8n_typeorm.json new file mode 100644 index 00000000000..771b37c4873 --- /dev/null +++ b/scripts/typescript-migration/results/_n8n_typeorm.json @@ -0,0 +1,61 @@ +{ + "package": "@n8n/typeorm", + "runs": { + "before": { + "label": "before", + "tsVersion": "6.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T09:29:28.550Z", + "tasks": { + "typecheck": { + "runsMs": [ + 1624, + 1408, + 1445 + ], + "min": 1408, + "median": 1445, + "mean": 1493 + }, + "build": { + "runsMs": [ + 1963, + 2839, + 2851 + ], + "min": 1963, + "median": 2839, + "mean": 2551 + } + } + }, + "after": { + "label": "after", + "tsVersion": "7.0.2", + "node": "v24.13.0", + "timestamp": "2026-07-14T09:31:23.564Z", + "tasks": { + "typecheck": { + "runsMs": [ + 1000, + 898, + 799 + ], + "min": 799, + "median": 898, + "mean": 899 + }, + "build": { + "runsMs": [ + 808, + 890, + 1087 + ], + "min": 808, + "median": 890, + "mean": 928 + } + } + } + } +}