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"],
"compilerOptions": {
"outDir": "dist",
"composite": true,
"tsBuildInfoFile": "dist/build.tsbuildinfo"
},
"include": [

View File

@@ -21,7 +21,8 @@
"utils/**/*.ts"
],
"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,
bundle: false,
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"],
"references": [
{ "path": "../workflow/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/client-oauth2/tsconfig.build.json" },
{ "path": "../@n8n/config/tsconfig.build.json" },
{ "path": "../@n8n/di/tsconfig.build.json" },
{ "path": "../@n8n/nodes-langchain/tsconfig.build.json" },
{ "path": "../@n8n/permissions/tsconfig.build.json" }
]
}

View File

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

View File

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