From f8406c04b17db12897fcb37f5298cb95384c7cd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Fri, 29 Sep 2023 13:26:06 +0200 Subject: [PATCH] ci: Fix typescript incremental builds (no-changelog) (#7275) `tsBuildInfoFile` is supposed to be relative to `tsconfig` like `outDir` is. Because of this, we are currently saving the TS incremental build cache for all packages in the same file. This is likely causing issues where the built backend code sometimes does not accurately map to the current source code. This PR changes the incremental build setup to keep the cache in individual `dist` folders, like it used to be up until a 2 months ago, before https://github.com/n8n-io/n8n/pull/6816. --- packages/@n8n/client-oauth2/tsconfig.build.json | 3 ++- packages/cli/tsconfig.build.json | 3 ++- packages/cli/tsconfig.json | 1 + packages/core/tsconfig.build.json | 3 ++- packages/core/tsconfig.json | 1 + packages/node-dev/tsconfig.json | 1 + packages/nodes-base/tsconfig.build.json | 3 ++- packages/nodes-base/tsconfig.json | 1 + packages/workflow/tsconfig.build.json | 3 ++- packages/workflow/tsconfig.json | 1 + tsconfig.backend.json | 3 +-- tsconfig.build.json | 3 +-- 12 files changed, 17 insertions(+), 9 deletions(-) diff --git a/packages/@n8n/client-oauth2/tsconfig.build.json b/packages/@n8n/client-oauth2/tsconfig.build.json index 0e85ac05d..30910a3bf 100644 --- a/packages/@n8n/client-oauth2/tsconfig.build.json +++ b/packages/@n8n/client-oauth2/tsconfig.build.json @@ -2,7 +2,8 @@ "extends": ["./tsconfig.json", "../../../tsconfig.build.json"], "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "tsBuildInfoFile": "dist/build.tsbuildinfo" }, "include": ["src/**/*.ts"], "exclude": ["test/**"] diff --git a/packages/cli/tsconfig.build.json b/packages/cli/tsconfig.build.json index a3e52c5ff..1e8a2ff7f 100644 --- a/packages/cli/tsconfig.build.json +++ b/packages/cli/tsconfig.build.json @@ -2,7 +2,8 @@ "extends": ["./tsconfig.json", "../../tsconfig.build.json"], "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "tsBuildInfoFile": "dist/build.tsbuildinfo" }, "include": ["src/**/*.ts"], "exclude": ["test/**"] diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 5ecbe401a..37e5dcbef 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -10,6 +10,7 @@ "@/*": ["./*"], "@db/*": ["./databases/*"] }, + "tsBuildInfoFile": "dist/typecheck.tsbuildinfo", // TODO: remove all options below this line "strict": false, "noUnusedLocals": false, diff --git a/packages/core/tsconfig.build.json b/packages/core/tsconfig.build.json index a3e52c5ff..1e8a2ff7f 100644 --- a/packages/core/tsconfig.build.json +++ b/packages/core/tsconfig.build.json @@ -2,7 +2,8 @@ "extends": ["./tsconfig.json", "../../tsconfig.build.json"], "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "tsBuildInfoFile": "dist/build.tsbuildinfo" }, "include": ["src/**/*.ts"], "exclude": ["test/**"] diff --git a/packages/core/tsconfig.json b/packages/core/tsconfig.json index 23a5a4a19..cf60622e2 100644 --- a/packages/core/tsconfig.json +++ b/packages/core/tsconfig.json @@ -7,6 +7,7 @@ "paths": { "@/*": ["./*"] }, + "tsBuildInfoFile": "dist/typecheck.tsbuildinfo", "emitDecoratorMetadata": true, "experimentalDecorators": true, // TODO: remove all options below this line diff --git a/packages/node-dev/tsconfig.json b/packages/node-dev/tsconfig.json index fa967bf21..bb21c4d96 100644 --- a/packages/node-dev/tsconfig.json +++ b/packages/node-dev/tsconfig.json @@ -3,6 +3,7 @@ "compilerOptions": { "outDir": "dist", "preserveSymlinks": true, + "tsBuildInfoFile": "dist/build.tsbuildinfo", // TODO: remove all options below this line "noUnusedLocals": false, "useUnknownInCatchVariables": false diff --git a/packages/nodes-base/tsconfig.build.json b/packages/nodes-base/tsconfig.build.json index 301f652cd..499160a1e 100644 --- a/packages/nodes-base/tsconfig.build.json +++ b/packages/nodes-base/tsconfig.build.json @@ -1,7 +1,8 @@ { "extends": ["./tsconfig.json", "../../tsconfig.build.json"], "compilerOptions": { - "outDir": "dist" + "outDir": "dist", + "tsBuildInfoFile": "dist/build.tsbuildinfo" }, "include": [ "credentials/**/*.ts", diff --git a/packages/nodes-base/tsconfig.json b/packages/nodes-base/tsconfig.json index 80d4ebd3b..661039980 100644 --- a/packages/nodes-base/tsconfig.json +++ b/packages/nodes-base/tsconfig.json @@ -6,6 +6,7 @@ "@test/*": ["./test/*"], "@utils/*": ["./utils/*"] }, + "tsBuildInfoFile": "dist/typecheck.tsbuildinfo", // TODO: remove all options below this line "noImplicitReturns": false, "useUnknownInCatchVariables": false diff --git a/packages/workflow/tsconfig.build.json b/packages/workflow/tsconfig.build.json index a3e52c5ff..1e8a2ff7f 100644 --- a/packages/workflow/tsconfig.build.json +++ b/packages/workflow/tsconfig.build.json @@ -2,7 +2,8 @@ "extends": ["./tsconfig.json", "../../tsconfig.build.json"], "compilerOptions": { "rootDir": "src", - "outDir": "dist" + "outDir": "dist", + "tsBuildInfoFile": "dist/build.tsbuildinfo" }, "include": ["src/**/*.ts"], "exclude": ["test/**"] diff --git a/packages/workflow/tsconfig.json b/packages/workflow/tsconfig.json index c813c072a..8f0294705 100644 --- a/packages/workflow/tsconfig.json +++ b/packages/workflow/tsconfig.json @@ -7,6 +7,7 @@ "paths": { "@/*": ["./*"] }, + "tsBuildInfoFile": "dist/typecheck.tsbuildinfo", // TODO: remove all options below this line "useUnknownInCatchVariables": false }, diff --git a/tsconfig.backend.json b/tsconfig.backend.json index b6212e58c..438fc8851 100644 --- a/tsconfig.backend.json +++ b/tsconfig.backend.json @@ -1,7 +1,6 @@ { "compilerOptions": { "types": ["node", "jest"], - "noEmit": true, - "tsBuildInfoFile": "dist/typecheck.tsbuildinfo" + "noEmit": true } } diff --git a/tsconfig.build.json b/tsconfig.build.json index 5da6e15df..11866f14e 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -2,8 +2,7 @@ "compilerOptions": { "types": ["node"], "noEmit": false, - "declaration": true, - "tsBuildInfoFile": "dist/build.tsbuildinfo" + "declaration": true }, "tsc-alias": { "replacers": {