ci: Update project references for backend and nodes packages (no-changelog) (#14308)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2025-04-01 12:24:45 +02:00
committed by GitHub
parent 4bc1c1a547
commit 58b1cee153
6 changed files with 29 additions and 14 deletions

View File

@@ -2,6 +2,7 @@
"extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"], "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist",
"composite": true,
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"
}, },
"include": [ "include": [

View File

@@ -21,7 +21,8 @@
"utils/**/*.ts" "utils/**/*.ts"
], ],
"references": [ "references": [
{ "path": "../../workflow/tsconfig.build.json" }, { "path": "../../core/tsconfig.build.json" },
{ "path": "../../core/tsconfig.build.json" } { "path": "../../nodes-base/tsconfig.build.json" },
{ "path": "../../workflow/tsconfig.build.json" }
] ]
} }

View File

@@ -7,4 +7,5 @@ export default defineConfig({
dts: false, dts: false,
bundle: false, bundle: false,
sourcemap: true, sourcemap: true,
silent: true,
}); });

View File

@@ -20,12 +20,14 @@
}, },
"include": ["src/**/*.ts", "test/**/*.ts", "src/sso.ee/saml/saml-schema-metadata-2.0.xsd"], "include": ["src/**/*.ts", "test/**/*.ts", "src/sso.ee/saml/saml-schema-metadata-2.0.xsd"],
"references": [ "references": [
{ "path": "../workflow/tsconfig.build.json" },
{ "path": "../core/tsconfig.build.json" }, { "path": "../core/tsconfig.build.json" },
{ "path": "../nodes-base/tsconfig.build.json" },
{ "path": "../workflow/tsconfig.build.json" },
{ "path": "../@n8n/api-types/tsconfig.build.json" }, { "path": "../@n8n/api-types/tsconfig.build.json" },
{ "path": "../@n8n/client-oauth2/tsconfig.build.json" }, { "path": "../@n8n/client-oauth2/tsconfig.build.json" },
{ "path": "../@n8n/config/tsconfig.build.json" }, { "path": "../@n8n/config/tsconfig.build.json" },
{ "path": "../@n8n/di/tsconfig.build.json" }, { "path": "../@n8n/di/tsconfig.build.json" },
{ "path": "../@n8n/nodes-langchain/tsconfig.build.json" },
{ "path": "../@n8n/permissions/tsconfig.build.json" } { "path": "../@n8n/permissions/tsconfig.build.json" }
] ]
} }

View File

@@ -2,6 +2,7 @@
"extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"], "extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"],
"compilerOptions": { "compilerOptions": {
"outDir": "dist", "outDir": "dist",
"composite": true,
"tsBuildInfoFile": "dist/build.tsbuildinfo" "tsBuildInfoFile": "dist/build.tsbuildinfo"
}, },
"include": [ "include": [

View File

@@ -5,14 +5,17 @@ import { readFile } from 'fs/promises';
const packagesDir = resolve(__dirname, '..'); const packagesDir = resolve(__dirname, '..');
const aiNodesDir = resolve(packagesDir, '@n8n', 'nodes-langchain'); const aiNodesDir = resolve(packagesDir, '@n8n', 'nodes-langchain');
const cliDir = resolve(packagesDir, 'cli');
const aiNodesFiles = await glob('nodes/**/*.ts', { cwd: aiNodesDir }); const externalFiles = [
const aiNodesFilesContents = aiNodesFiles.map((filePath) => ...(await glob('nodes/**/*.ts', { cwd: aiNodesDir, absolute: true })),
readFile(resolve(aiNodesDir, filePath), 'utf-8'), ...(await glob('test/integration/**/*.ts', { cwd: cliDir, absolute: true })),
); ];
// Files used in @n8n/nodes-langchain package const externalFilesContents = externalFiles.map((filePath) => readFile(filePath, 'utf-8'));
const aiNodesPackageImports = (await Promise.all(aiNodesFilesContents)).reduce(
// Files used in other packages
const externalPackageImports = (await Promise.all(externalFilesContents)).reduce(
(acc, fileContents) => { (acc, fileContents) => {
const regex = /from\s+['"](n8n-nodes-base[^'"]+)['"]/g; const regex = /from\s+['"](n8n-nodes-base[^'"]+)['"]/g;
let match; let match;
@@ -25,8 +28,8 @@ const aiNodesPackageImports = (await Promise.all(aiNodesFilesContents)).reduce(
new Set<string>(), new Set<string>(),
); );
const aiNodesPackageDependencies = Array.from(aiNodesPackageImports).map( const externalPackageDependencies = Array.from(externalPackageImports).map(
(i) => i.replace('n8n-nodes-base/dist/', '') + '.ts', (i) => i.replace(/^n8n-nodes-base\/(dist\/)?/, '') + '.ts',
); );
const commonIgnoredFiles = ['!**/*.d.ts', '!**/*.test.ts']; const commonIgnoredFiles = ['!**/*.d.ts', '!**/*.test.ts'];
@@ -36,18 +39,24 @@ export default defineConfig([
entry: [ entry: [
'{credentials,nodes,test,types,utils}/**/*.ts', '{credentials,nodes,test,types,utils}/**/*.ts',
...commonIgnoredFiles, ...commonIgnoredFiles,
...aiNodesPackageDependencies.map((path) => `!${path}`), ...externalPackageDependencies.map((path) => `!${path}`),
], ],
format: ['cjs'], format: ['cjs'],
dts: false, dts: false,
bundle: false, bundle: false,
sourcemap: true, sourcemap: true,
silent: true,
}, },
{ {
entry: [...aiNodesPackageDependencies, ...commonIgnoredFiles], entry: [...externalPackageDependencies, ...commonIgnoredFiles],
format: ['cjs'], format: ['cjs'],
dts: true, dts: {
compilerOptions: {
composite: false,
},
},
bundle: false, bundle: false,
sourcemap: true, sourcemap: true,
silent: true,
}, },
]); ]);