1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-12-25 05:02:21 +03:00

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
run: pnpm build
- name: Run typecheck
run: pnpm typecheck
- name: Cache build artifacts
uses: actions/cache/save@v4.0.0
with:

View File

@ -13,7 +13,7 @@
"build": "turbo run 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",
"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:ai": "turbo run dev --parallel --filter=@n8n/nodes-langchain --filter=n8n --filter=n8n-core",
"clean": "turbo run clean --parallel",
@ -26,7 +26,7 @@
"start:tunnel": "./packages/cli/bin/n8n start --tunnel",
"start:windows": "cd packages/cli/bin && n8n",
"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:frontend": "pnpm --filter=@n8n/chat --filter=@n8n/codemirror-lang --filter=n8n-design-system --filter=n8n-editor-ui test",
"watch": "turbo run watch --parallel",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,24 +1,14 @@
{
"extends": ["../../../tsconfig.json", "../../../tsconfig.backend.json"],
"compilerOptions": {
"strict": true,
"module": "commonjs",
"moduleResolution": "node",
"target": "es2019",
"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/"
"lib": ["es2020", "es2022.error"],
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
// TODO: remove all options below this line
"useUnknownInCatchVariables": false
},
"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": {
"clean": "rimraf dist .turbo",
"dev": "pnpm watch",
"typecheck": "tsc",
"typecheck": "tsc --noEmit",
"build": "tsc -p tsconfig.build.json",
"format": "prettier --write . --ignore-path ../../../.prettierignore",
"lint": "eslint . --quiet",

View File

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

View File

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

View File

@ -21,7 +21,7 @@
},
"scripts": {
"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",
"buildAndDev": "pnpm run build && pnpm run dev",
"dev": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon\"",

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,5 +1,5 @@
/* 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 { executeWorkflow } from '@test/nodes/ExecuteWorkflow';
import * as Helpers from '@test/nodes/Helpers';
@ -49,12 +49,12 @@ describe('Execute Stop and Error Node', () => {
[
{
node: 'Stop and Error1',
type: 'main',
type: NodeConnectionType.Main,
index: 0,
},
{
node: 'Stop and Error',
type: 'main',
type: NodeConnectionType.Main,
index: 0,
},
],

View File

@ -16,7 +16,7 @@
"scripts": {
"clean": "rimraf dist .turbo",
"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:metadata": "pnpm n8n-generate-known && pnpm n8n-generate-ui-types",
"format": "prettier --write . --ignore-path ../../.prettierignore",

View File

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

View File

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

View File

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

View File

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

View File

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