Skip to content

Commit

Permalink
ci: Fix typescript incremental builds (no-changelog) (n8n-io#7275)
Browse files Browse the repository at this point in the history
`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 n8n-io#6816.
  • Loading branch information
netroy authored Sep 29, 2023
1 parent 763d451 commit f8406c0
Show file tree
Hide file tree
Showing 12 changed files with 17 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/@n8n/client-oauth2/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/**"]
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/**"]
Expand Down
1 change: 1 addition & 0 deletions packages/cli/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"@/*": ["./*"],
"@db/*": ["./databases/*"]
},
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
// TODO: remove all options below this line
"strict": false,
"noUnusedLocals": false,
Expand Down
3 changes: 2 additions & 1 deletion packages/core/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/**"]
Expand Down
1 change: 1 addition & 0 deletions packages/core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"paths": {
"@/*": ["./*"]
},
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
// TODO: remove all options below this line
Expand Down
1 change: 1 addition & 0 deletions packages/node-dev/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"compilerOptions": {
"outDir": "dist",
"preserveSymlinks": true,
"tsBuildInfoFile": "dist/build.tsbuildinfo",
// TODO: remove all options below this line
"noUnusedLocals": false,
"useUnknownInCatchVariables": false
Expand Down
3 changes: 2 additions & 1 deletion packages/nodes-base/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"extends": ["./tsconfig.json", "../../tsconfig.build.json"],
"compilerOptions": {
"outDir": "dist"
"outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo"
},
"include": [
"credentials/**/*.ts",
Expand Down
1 change: 1 addition & 0 deletions packages/nodes-base/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"@test/*": ["./test/*"],
"@utils/*": ["./utils/*"]
},
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
// TODO: remove all options below this line
"noImplicitReturns": false,
"useUnknownInCatchVariables": false
Expand Down
3 changes: 2 additions & 1 deletion packages/workflow/tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/**"]
Expand Down
1 change: 1 addition & 0 deletions packages/workflow/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"paths": {
"@/*": ["./*"]
},
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
// TODO: remove all options below this line
"useUnknownInCatchVariables": false
},
Expand Down
3 changes: 1 addition & 2 deletions tsconfig.backend.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"compilerOptions": {
"types": ["node", "jest"],
"noEmit": true,
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
"noEmit": true
}
}
3 changes: 1 addition & 2 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
"compilerOptions": {
"types": ["node"],
"noEmit": false,
"declaration": true,
"tsBuildInfoFile": "dist/build.tsbuildinfo"
"declaration": true
},
"tsc-alias": {
"replacers": {
Expand Down

0 comments on commit f8406c0

Please sign in to comment.