ci: Consistent tsconfig setup for backend packages and fix pnpm typecheck for composite packages (no-changelog) (#9604)

Co-authored-by: Iván Ovejero <ivov.src@gmail.com>
This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2024-06-05 09:50:48 +02:00 committed by GitHub
parent 84f091d3e5
commit 044607e2a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
29 changed files with 39 additions and 55 deletions

View file

@ -24,6 +24,9 @@ jobs:
- name: Build - name: Build
run: pnpm build run: pnpm build
- name: Run typecheck
run: pnpm typecheck
- name: Cache build artifacts - name: Cache build artifacts
uses: actions/cache/save@v4.0.0 uses: actions/cache/save@v4.0.0
with: with:

View file

@ -13,7 +13,7 @@
"build": "turbo run build", "build": "turbo run build",
"build:backend": "pnpm --filter=!@n8n/chat --filter=!@n8n/codemirror-lang --filter=!n8n-design-system --filter=!n8n-editor-ui build", "build:backend": "pnpm --filter=!@n8n/chat --filter=!@n8n/codemirror-lang --filter=!n8n-design-system --filter=!n8n-editor-ui build",
"build:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui build", "build:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui build",
"typecheck": "turbo run typecheck", "typecheck": "pnpm --filter=!@n8n/chat --filter=!@n8n/storybook --filter=!n8n-core --filter=!n8n-editor-ui --filter=!n8n-workflow --filter=!n8n typecheck",
"dev": "turbo run dev --parallel --filter=!n8n-design-system --filter=!@n8n/chat", "dev": "turbo run dev --parallel --filter=!n8n-design-system --filter=!@n8n/chat",
"dev:ai": "turbo run dev --parallel --filter=@n8n/nodes-langchain --filter=n8n --filter=n8n-core", "dev:ai": "turbo run dev --parallel --filter=@n8n/nodes-langchain --filter=n8n --filter=n8n-core",
"clean": "turbo run clean --parallel", "clean": "turbo run clean --parallel",
@ -26,7 +26,7 @@
"start:tunnel": "./packages/cli/bin/n8n start --tunnel", "start:tunnel": "./packages/cli/bin/n8n start --tunnel",
"start:windows": "cd packages/cli/bin && n8n", "start:windows": "cd packages/cli/bin && n8n",
"test": "turbo run test", "test": "turbo run test",
"test:backend": "pnpm --filter=!@n8n/chat --filter=!@n8n/codemirror-lang --filter=!n8n-design-system --filter=!n8n-editor-ui --filter=!n8n-nodes-base test --filter=!@n8n/n8n-nodes-langchain test", "test:backend": "pnpm --filter=!@n8n/chat --filter=!@n8n/codemirror-lang --filter=!n8n-design-system --filter=!n8n-editor-ui --filter=!n8n-nodes-base --filter=!@n8n/n8n-nodes-langchain test",
"test:nodes": "pnpm --filter=n8n-nodes-base --filter=@n8n/n8n-nodes-langchain test", "test:nodes": "pnpm --filter=n8n-nodes-base --filter=@n8n/n8n-nodes-langchain test",
"test:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui test", "test:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui test",
"watch": "turbo run watch --parallel", "watch": "turbo run watch --parallel",

View file

@ -4,7 +4,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"dev": "pnpm watch", "dev": "pnpm watch",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"format": "prettier --write . --ignore-path ../../../.prettierignore", "format": "prettier --write . --ignore-path ../../../.prettierignore",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",

View file

@ -1,6 +1,7 @@
{ {
"extends": ["./tsconfig.json", "../../../tsconfig.build.json"], "extends": ["./tsconfig.json", "../../../tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"composite": true,
"rootDir": "src", "rootDir": "src",
"outDir": "dist", "outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"

View file

@ -3,8 +3,6 @@
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"types": ["node", "jest"], "types": ["node", "jest"],
"composite": true,
"noEmit": true,
"baseUrl": "src", "baseUrl": "src",
"paths": { "paths": {
"@/*": ["./*"] "@/*": ["./*"]

View file

@ -2,8 +2,7 @@
"extends": "../../../tsconfig.json", "extends": "../../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo", "tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
"strict": true
}, },
"include": ["src/**/*.ts", "test/**/*.ts"] "include": ["src/**/*.ts", "test/**/*.ts"]
} }

View file

@ -4,7 +4,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"dev": "pnpm watch", "dev": "pnpm watch",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"format": "prettier --write . --ignore-path ../../../.prettierignore", "format": "prettier --write . --ignore-path ../../../.prettierignore",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",

View file

@ -1,6 +1,7 @@
{ {
"extends": ["./tsconfig.json", "../../../tsconfig.build.json"], "extends": ["./tsconfig.json", "../../../tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"composite": true,
"rootDir": "src", "rootDir": "src",
"outDir": "dist", "outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"

View file

@ -3,8 +3,6 @@
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"types": ["node", "jest"], "types": ["node", "jest"],
"composite": true,
"noEmit": true,
"baseUrl": "src", "baseUrl": "src",
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo" "tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
}, },

View file

@ -12,7 +12,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"dev": "pnpm run watch", "dev": "pnpm run watch",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json && pnpm n8n-copy-icons && pnpm build:metadata", "build": "tsc -p tsconfig.build.json && pnpm n8n-copy-icons && pnpm build:metadata",
"build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types", "build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types",
"format": "prettier nodes credentials --write", "format": "prettier nodes credentials --write",

View file

@ -1,9 +1,6 @@
{ {
"extends": ["./tsconfig.json"], "extends": ["./tsconfig.json", "../../../tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"types": ["node"],
"noEmit": false,
"declaration": true,
"outDir": "dist", "outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"
}, },

View file

@ -1,24 +1,14 @@
{ {
"extends": ["../../../tsconfig.json", "../../../tsconfig.backend.json"],
"compilerOptions": { "compilerOptions": {
"strict": true, "lib": ["es2020", "es2022.error"],
"module": "commonjs", "tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
"moduleResolution": "node", // TODO: remove all options below this line
"target": "es2019", "useUnknownInCatchVariables": false
"lib": ["es2019", "es2020", "es2022.error"],
"removeComments": true,
"useUnknownInCatchVariables": false,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"noImplicitReturns": true,
"strictNullChecks": true,
"preserveConstEnums": true,
"esModuleInterop": true,
"resolveJsonModule": true,
"incremental": true,
"declaration": true,
"sourceMap": true,
"skipLibCheck": true,
"outDir": "./dist/"
}, },
"include": ["credentials/**/*", "nodes/**/*", "utils/**/*.ts", "nodes/**/*.json", "types/*.ts"] "include": ["credentials/**/*", "nodes/**/*", "utils/**/*.ts", "nodes/**/*.json", "types/*.ts"],
"references": [
{ "path": "../../workflow/tsconfig.build.json" },
{ "path": "../../core/tsconfig.build.json" }
]
} }

View file

@ -4,7 +4,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"dev": "pnpm watch", "dev": "pnpm watch",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"format": "prettier --write . --ignore-path ../../../.prettierignore", "format": "prettier --write . --ignore-path ../../../.prettierignore",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",

View file

@ -1,6 +1,7 @@
{ {
"extends": ["./tsconfig.json", "../../../tsconfig.build.json"], "extends": ["./tsconfig.json", "../../../tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"composite": true,
"rootDir": "src", "rootDir": "src",
"outDir": "dist", "outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"

View file

@ -3,8 +3,6 @@
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"types": ["node", "jest"], "types": ["node", "jest"],
"composite": true,
"noEmit": true,
"baseUrl": "src", "baseUrl": "src",
"paths": { "paths": {
"@/*": ["./*"] "@/*": ["./*"]

View file

@ -21,7 +21,7 @@
}, },
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node scripts/build.mjs", "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node scripts/build.mjs",
"buildAndDev": "pnpm run build && pnpm run dev", "buildAndDev": "pnpm run build && pnpm run dev",
"dev": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon\"", "dev": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon\"",

View file

@ -22,7 +22,7 @@
}, },
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"dev": "pnpm watch", "dev": "pnpm watch",
"format": "prettier --write . --ignore-path ../../.prettierignore", "format": "prettier --write . --ignore-path ../../.prettierignore",

View file

@ -1,6 +1,7 @@
{ {
"extends": ["./tsconfig.json", "../../tsconfig.build.json"], "extends": ["./tsconfig.json", "../../tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"composite": true,
"rootDir": "src", "rootDir": "src",
"outDir": "dist", "outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"

View file

@ -2,7 +2,6 @@
"extends": ["../../tsconfig.json", "../../tsconfig.backend.json"], "extends": ["../../tsconfig.json", "../../tsconfig.backend.json"],
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"composite": true,
"baseUrl": "src", "baseUrl": "src",
"paths": { "paths": {
"@/*": ["./*"] "@/*": ["./*"]

View file

@ -2,8 +2,8 @@ import { t } from '../locale';
export default { export default {
methods: { methods: {
t(path: string, ...args: string[]) { t(path: string, options: object) {
return t.call(this, path, ...args); return t.call(this, path, options);
}, },
}, },
}; };

View file

@ -17,7 +17,6 @@
}, },
"lib": ["esnext", "dom", "dom.iterable", "scripthost"], "lib": ["esnext", "dom", "dom.iterable", "scripthost"],
// TODO: remove all options below this line // TODO: remove all options below this line
"strict": false,
"noImplicitAny": false, "noImplicitAny": false,
"noImplicitReturns": false "noImplicitReturns": false
}, },

View file

@ -2,6 +2,7 @@ import { apiUrl } from '../Peekalink.node';
import type { WorkflowTestData } from '@test/nodes/types'; import type { WorkflowTestData } from '@test/nodes/types';
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
import * as Helpers from '@test/nodes/Helpers'; import * as Helpers from '@test/nodes/Helpers';
import { NodeConnectionType } from 'n8n-workflow';
describe('Peekalink Node', () => { describe('Peekalink Node', () => {
const exampleComPreview = { const exampleComPreview = {
@ -57,7 +58,7 @@ describe('Peekalink Node', () => {
[ [
{ {
node: 'Peekalink', node: 'Peekalink',
type: 'main', type: NodeConnectionType.Main,
index: 0, index: 0,
}, },
], ],
@ -129,7 +130,7 @@ describe('Peekalink Node', () => {
[ [
{ {
node: 'Peekalink', node: 'Peekalink',
type: 'main', type: NodeConnectionType.Main,
index: 0, index: 0,
}, },
], ],

View file

@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/no-loop-func */ /* eslint-disable @typescript-eslint/no-loop-func */
import type { IDataObject } from 'n8n-workflow'; import { NodeConnectionType, type IDataObject } from 'n8n-workflow';
import type { WorkflowTestData } from '@test/nodes/types'; import type { WorkflowTestData } from '@test/nodes/types';
import { executeWorkflow } from '@test/nodes/ExecuteWorkflow'; import { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
import * as Helpers from '@test/nodes/Helpers'; import * as Helpers from '@test/nodes/Helpers';
@ -49,12 +49,12 @@ describe('Execute Stop and Error Node', () => {
[ [
{ {
node: 'Stop and Error1', node: 'Stop and Error1',
type: 'main', type: NodeConnectionType.Main,
index: 0, index: 0,
}, },
{ {
node: 'Stop and Error', node: 'Stop and Error',
type: 'main', type: NodeConnectionType.Main,
index: 0, index: 0,
}, },
], ],

View file

@ -16,7 +16,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"dev": "pnpm watch", "dev": "pnpm watch",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && pnpm n8n-copy-icons && pnpm n8n-generate-translations && pnpm build:metadata", "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && pnpm n8n-copy-icons && pnpm n8n-generate-translations && pnpm build:metadata",
"build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types", "build:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types",
"format": "prettier --write . --ignore-path ../../.prettierignore", "format": "prettier --write . --ignore-path ../../.prettierignore",

View file

@ -26,7 +26,7 @@
"scripts": { "scripts": {
"clean": "rimraf dist .turbo", "clean": "rimraf dist .turbo",
"dev": "pnpm watch", "dev": "pnpm watch",
"typecheck": "tsc", "typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json", "build": "tsc -p tsconfig.build.json",
"format": "prettier --write . --ignore-path ../../.prettierignore", "format": "prettier --write . --ignore-path ../../.prettierignore",
"lint": "eslint . --quiet", "lint": "eslint . --quiet",

View file

@ -1,6 +1,7 @@
{ {
"extends": ["./tsconfig.json", "../../tsconfig.build.json"], "extends": ["./tsconfig.json", "../../tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"composite": true,
"rootDir": "src", "rootDir": "src",
"outDir": "dist", "outDir": "dist",
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"

View file

@ -2,7 +2,6 @@
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": ".", "rootDir": ".",
"composite": true,
"baseUrl": "src", "baseUrl": "src",
"paths": { "paths": {
"@/*": ["./*"] "@/*": ["./*"]

View file

@ -1,6 +1,5 @@
{ {
"compilerOptions": { "compilerOptions": {
"types": ["node", "jest"], "types": ["node", "jest"]
"noEmit": true
} }
} }

View file

@ -1,7 +1,6 @@
{ {
"compilerOptions": { "compilerOptions": {
"types": ["node"], "types": ["node"],
"noEmit": false,
"noUnusedLocals": false, "noUnusedLocals": false,
"noUnusedParameters": false, "noUnusedParameters": false,
"declaration": true "declaration": true