mirror of
https://github.com/n8n-io/n8n
synced 2026-04-21 07:37:20 +00:00
refactor: Upgrade to TypeScript 6.0.2 (#27673)
This commit is contained in:
parent
5fdb18b5f9
commit
df6ee78638
25 changed files with 667 additions and 618 deletions
|
|
@ -9,6 +9,7 @@ const tsJestOptions = {
|
|||
...compilerOptions,
|
||||
declaration: false,
|
||||
sourceMap: true,
|
||||
rootDir: '.',
|
||||
},
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
"extends": "@n8n/typescript-config/tsconfig.common.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["src/**/*.ts", "test/**/*.ts"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,8 @@
|
|||
"extends": "@n8n/typescript-config/tsconfig.common.json",
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
|
||||
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["src/**/*.ts", "test/**/*.ts"]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -85,7 +85,8 @@ export class WebSocketTransport implements SyncTransport {
|
|||
throw new Error('Transport not connected');
|
||||
}
|
||||
|
||||
this.ws.send(data);
|
||||
// TODO: narrow SyncTransport.send to Uint8Array<ArrayBuffer> and propagate through Y.js call sites
|
||||
this.ws.send(data as unknown as Uint8Array<ArrayBuffer>);
|
||||
}
|
||||
|
||||
onReceive(handler: ReceiveHandler): Unsubscribe {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,9 @@
|
|||
},
|
||||
{
|
||||
"path": "./tsconfig.frontend.json"
|
||||
},
|
||||
{
|
||||
"path": "./tsconfig.scripts.json"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
7
packages/@n8n/extension-sdk/tsconfig.scripts.json
Normal file
7
packages/@n8n/extension-sdk/tsconfig.scripts.json
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"extends": "@n8n/typescript-config/tsconfig.backend.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
},
|
||||
"include": ["scripts/**/*.ts"]
|
||||
}
|
||||
|
|
@ -2,6 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"target": "es2020",
|
||||
"module": "commonjs",
|
||||
"rootDir": "src",
|
||||
"outDir": "dist/cjs",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0",
|
||||
"target": "es2020",
|
||||
"module": "es2020",
|
||||
"moduleResolution": "node",
|
||||
"rootDir": "src",
|
||||
"outDir": "dist/esm",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"extends": ["@n8n/typescript-config/tsconfig.common.json"],
|
||||
"extends": ["@n8n/typescript-config/tsconfig.backend.json"],
|
||||
"compilerOptions": {
|
||||
"rootDir": ".",
|
||||
"baseUrl": "src",
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
"compilerOptions": {
|
||||
"declaration": true,
|
||||
"emitDeclarationOnly": true,
|
||||
"rootDir": "src",
|
||||
"outDir": "dist/types",
|
||||
"strict": true,
|
||||
"skipLibCheck": true,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0",
|
||||
"target": "ES2015",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
|
|
@ -11,7 +12,8 @@
|
|||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"downlevelIteration": true,
|
||||
"skipLibCheck": true
|
||||
"skipLibCheck": true,
|
||||
"types": ["node", "jest"]
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["dist", "node_modules", "**/*.test.ts"]
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0",
|
||||
"composite": true,
|
||||
"module": "umd",
|
||||
"moduleResolution": "node",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0",
|
||||
"noUncheckedSideEffectImports": false,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"target": "es2022",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"ignoreDeprecations": "6.0",
|
||||
"noUncheckedSideEffectImports": false,
|
||||
"strict": true,
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
|
|
|
|||
|
|
@ -87,7 +87,9 @@ export class EventBusController {
|
|||
);
|
||||
break;
|
||||
default:
|
||||
throw new BadRequestError(`Unknown destination type: ${body.__type}`);
|
||||
throw new BadRequestError(
|
||||
`Unknown destination type: ${(body as { __type: string }).__type}`,
|
||||
);
|
||||
}
|
||||
|
||||
return result.serialize();
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"rootDirs": [".", "../composables/src"],
|
||||
"outDir": "dist",
|
||||
"noEmit": true,
|
||||
"moduleResolution": "bundler",
|
||||
"types": ["vite/client", "unplugin-icons/types/vue", "vitest/globals"],
|
||||
"typeRoots": [
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"extends": "@n8n/typescript-config/tsconfig.frontend.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"outDir": "dist",
|
||||
"noEmit": true,
|
||||
"useUnknownInCatchVariables": false,
|
||||
"types": ["vite/client", "vitest/globals"],
|
||||
"isolatedModules": true,
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
|
||||
"baseUrl": ".",
|
||||
"rootDirs": [".", "../composables/src"],
|
||||
"outDir": "dist",
|
||||
"noEmit": true,
|
||||
"moduleResolution": "bundler",
|
||||
|
||||
"types": [
|
||||
|
|
|
|||
|
|
@ -108,6 +108,7 @@ class JsonDomPointerEvent extends MouseEvent implements PointerEvent {
|
|||
readonly altitudeAngle: number;
|
||||
|
||||
readonly azimuthAngle: number;
|
||||
readonly persistentDeviceId: number;
|
||||
|
||||
constructor(type: string, params: PointerEventInit = {}) {
|
||||
super(type, params);
|
||||
|
|
@ -123,6 +124,7 @@ class JsonDomPointerEvent extends MouseEvent implements PointerEvent {
|
|||
this.altitudeAngle = params.altitudeAngle ?? Math.PI / 2;
|
||||
this.azimuthAngle = params.azimuthAngle ?? 0;
|
||||
this.isPrimary = params.isPrimary ?? true;
|
||||
this.persistentDeviceId = 0;
|
||||
}
|
||||
|
||||
getCoalescedEvents(): PointerEvent[] {
|
||||
|
|
@ -219,6 +221,8 @@ export class IntersectionObserver {
|
|||
|
||||
rootMargin = '';
|
||||
|
||||
scrollMargin = '';
|
||||
|
||||
thresholds = [];
|
||||
|
||||
disconnect() {
|
||||
|
|
|
|||
|
|
@ -14,6 +14,8 @@ export const COMPILER_OPTIONS: ts.CompilerOptions = {
|
|||
skipDefaultLibCheck: true,
|
||||
noEmit: true,
|
||||
noImplicitAny: false,
|
||||
// Suppress TS 6.0 deprecation diagnostic for moduleResolution=node10 set by @typescript/vfs
|
||||
ignoreDeprecations: '6.0',
|
||||
};
|
||||
export const TYPESCRIPT_AUTOCOMPLETE_THRESHOLD = '15';
|
||||
export const TYPESCRIPT_FILES = {
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
"../@n8n/chat/src",
|
||||
"../@n8n/design-system/src"
|
||||
],
|
||||
"outDir": "dist",
|
||||
"noEmit": true,
|
||||
"types": [
|
||||
"vitest/globals",
|
||||
"unplugin-icons/types/vue",
|
||||
|
|
|
|||
|
|
@ -16,7 +16,9 @@
|
|||
"exclude": [
|
||||
"node_modules",
|
||||
"nodes/**/*.test.ts",
|
||||
"nodes/**/test/**",
|
||||
"credentials/**/*.test.ts",
|
||||
"credentials/**/test/**",
|
||||
"utils/**/*.test.ts",
|
||||
"test/**",
|
||||
"../core/nodes-testing"
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"lib": ["ES2022"],
|
||||
"types": ["node"],
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"target": "ES2022",
|
||||
|
|
|
|||
1227
pnpm-lock.yaml
1227
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
|
|
@ -75,7 +75,7 @@ catalog:
|
|||
ts-morph: ^27.0.2
|
||||
tsdown: ^0.16.5
|
||||
tsx: ^4.19.3
|
||||
typescript: 5.9.2
|
||||
typescript: 6.0.2
|
||||
uuid: 10.0.0
|
||||
vite: npm:rolldown-vite@latest
|
||||
vite-plugin-dts: ^4.5.4
|
||||
|
|
|
|||
Loading…
Reference in a new issue