feat: Upgrade nodes-base package to use modern tsconfig.json (no-changelog) (#16884)

This commit is contained in:
Alex Grozav
2025-07-04 14:55:39 +03:00
committed by GitHub
parent 5733999de5
commit d754ce922d
37 changed files with 165 additions and 143 deletions

View File

@@ -116,6 +116,8 @@
"vue-tsc@2.2.8": "patches/vue-tsc@2.2.8.patch", "vue-tsc@2.2.8": "patches/vue-tsc@2.2.8.patch",
"element-plus@2.4.3": "patches/element-plus@2.4.3.patch", "element-plus@2.4.3": "patches/element-plus@2.4.3.patch",
"js-base64": "patches/js-base64.patch", "js-base64": "patches/js-base64.patch",
"ics": "patches/ics.patch",
"minifaker": "patches/minifaker.patch",
"z-vue-scan": "patches/z-vue-scan.patch" "z-vue-scan": "patches/z-vue-scan.patch"
} }
} }

View File

@@ -25,7 +25,7 @@
], ],
"references": [ "references": [
{ "path": "../../core/tsconfig.build.json" }, { "path": "../../core/tsconfig.build.json" },
{ "path": "../../nodes-base/tsconfig.build.json" }, { "path": "../../nodes-base/tsconfig.build.cjs.json" },
{ "path": "../../workflow/tsconfig.build.esm.json" } { "path": "../../workflow/tsconfig.build.esm.json" }
] ]
} }

View File

@@ -8,6 +8,7 @@
"moduleDetection": "force", "moduleDetection": "force",
"isolatedModules": true, "isolatedModules": true,
"verbatimModuleSyntax": true, "verbatimModuleSyntax": true,
"incremental": true,
"strict": true, "strict": true,
"noUncheckedIndexedAccess": true, "noUncheckedIndexedAccess": true,

View File

@@ -21,7 +21,7 @@
"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": "../core/tsconfig.build.json" }, { "path": "../core/tsconfig.build.json" },
{ "path": "../nodes-base/tsconfig.build.json" }, { "path": "../nodes-base/tsconfig.build.cjs.json" },
{ "path": "../workflow/tsconfig.build.esm.json" }, { "path": "../workflow/tsconfig.build.esm.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" },

View File

@@ -498,7 +498,7 @@ export class Aws implements ICredentialType {
path, path,
body: bodyContent, body: bodyContent,
region, region,
} as Request; } as unknown as Request;
const securityHeaders = { const securityHeaders = {
accessKeyId: `${credentials.accessKeyId}`.trim(), accessKeyId: `${credentials.accessKeyId}`.trim(),

View File

@@ -37,7 +37,7 @@ export class JsTaskRunnerSandbox {
return executionResult.ok return executionResult.ok
? executionResult.result ? executionResult.result
: this.throwExecutionError(executionResult.error); : this.throwExecutionError('error' in executionResult ? executionResult.error : {});
} }
async runCodeForEachItem(numInputItems: number): Promise<INodeExecutionData[]> { async runCodeForEachItem(numInputItems: number): Promise<INodeExecutionData[]> {
@@ -64,7 +64,7 @@ export class JsTaskRunnerSandbox {
); );
if (!executionResult.ok) { if (!executionResult.ok) {
return this.throwExecutionError(executionResult.error); return this.throwExecutionError('error' in executionResult ? executionResult.error : {});
} }
executionResults = executionResults.concat(executionResult.result); executionResults = executionResults.concat(executionResult.result);

View File

@@ -4,6 +4,7 @@ import {
type AssignmentCollectionValue, type AssignmentCollectionValue,
type IExecuteFunctions, type IExecuteFunctions,
type INodeTypes, type INodeTypes,
type NodeParameterValueType,
} from 'n8n-workflow'; } from 'n8n-workflow';
import { GoogleSheet } from '../../Google/Sheet/v2/helpers/GoogleSheet'; import { GoogleSheet } from '../../Google/Sheet/v2/helpers/GoogleSheet';
@@ -62,7 +63,7 @@ describe('Test Evaluation', () => {
sheetMode: 'id', sheetMode: 'id',
operation: 'setOutputs', operation: 'setOutputs',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -88,7 +89,7 @@ describe('Test Evaluation', () => {
sheetMode: 'id', sheetMode: 'id',
operation: 'setOutputs', operation: 'setOutputs',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -125,7 +126,7 @@ describe('Test Evaluation', () => {
sheetMode: 'id', sheetMode: 'id',
operation: 'setOutputs', operation: 'setOutputs',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
mockExecuteFunctions.getParentNodes.mockReturnValue([]); mockExecuteFunctions.getParentNodes.mockReturnValue([]);
@@ -152,7 +153,7 @@ describe('Test Evaluation', () => {
sheetMode: 'id', sheetMode: 'id',
operation: 'setOutputs', operation: 'setOutputs',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -299,7 +300,7 @@ describe('Test Evaluation', () => {
const mockParams: { [key: string]: unknown } = { const mockParams: { [key: string]: unknown } = {
operation: 'checkIfEvaluating', operation: 'checkIfEvaluating',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
}); });

View File

@@ -1,5 +1,5 @@
import { mock } from 'jest-mock-extended'; import { mock } from 'jest-mock-extended';
import type { IExecuteFunctions } from 'n8n-workflow'; import type { IExecuteFunctions, NodeParameterValueType } from 'n8n-workflow';
import { GoogleSheet } from '../../Google/Sheet/v2/helpers/GoogleSheet'; import { GoogleSheet } from '../../Google/Sheet/v2/helpers/GoogleSheet';
import { EvaluationTrigger } from '../EvaluationTrigger/EvaluationTrigger.node.ee'; import { EvaluationTrigger } from '../EvaluationTrigger/EvaluationTrigger.node.ee';
@@ -72,7 +72,7 @@ describe('Evaluation Trigger Node', () => {
sheetName, sheetName,
sheetMode: 'id', sheetMode: 'id',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -123,7 +123,7 @@ describe('Evaluation Trigger Node', () => {
sheetName, sheetName,
sheetMode: 'id', sheetMode: 'id',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -174,7 +174,7 @@ describe('Evaluation Trigger Node', () => {
sheetName, sheetName,
sheetMode: 'id', sheetMode: 'id',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -213,7 +213,7 @@ describe('Evaluation Trigger Node', () => {
limitRows: true, limitRows: true,
maxRows: 1, maxRows: 1,
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -282,7 +282,7 @@ describe('Evaluation Trigger Node', () => {
sheetName, sheetName,
sheetMode: 'id', sheetMode: 'id',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -364,7 +364,7 @@ describe('Evaluation Trigger Node', () => {
limitRows: true, limitRows: true,
maxRows: 2, maxRows: 2,
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );
@@ -431,7 +431,7 @@ describe('Evaluation Trigger Node', () => {
sheetName, sheetName,
sheetMode: 'id', sheetMode: 'id',
}; };
return mockParams[key] ?? fallbackValue; return (mockParams[key] ?? fallbackValue) as NodeParameterValueType;
}, },
); );

View File

@@ -13,6 +13,7 @@ import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import type { import type {
AddressFixedCollection, AddressFixedCollection,
FreshserviceCredentials, FreshserviceCredentials,
LoadedResource,
LoadedUser, LoadedUser,
RolesParameter, RolesParameter,
} from './types'; } from './types';

View File

@@ -12,6 +12,7 @@ import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import type { import type {
FreshworksConfigResponse, FreshworksConfigResponse,
FreshworksCrmApiCredentials, FreshworksCrmApiCredentials,
LoadedResource,
SalesAccounts, SalesAccounts,
ViewsResponse, ViewsResponse,
} from './types'; } from './types';

View File

@@ -7,6 +7,11 @@ export type FreshworksConfigResponse<T> = {
[key: string]: T[]; [key: string]: T[];
}; };
export type LoadedResource = {
id: string;
name: string;
};
export type LoadOption = { export type LoadOption = {
name: string; name: string;
value: string; value: string;

View File

@@ -56,7 +56,7 @@ export async function readSheet(
data, data,
headerRow: keyRowIndex, headerRow: keyRowIndex,
firstDataRow: dataStartRowIndex, firstDataRow: dataStartRowIndex,
} = prepareSheetData(sheetData, dataLocationOnSheetOptions); } = prepareSheetData(sheetData, dataLocationOnSheetOptions as RangeDetectionOptions);
let responseData = []; let responseData = [];

View File

@@ -154,7 +154,7 @@ export async function execute(
} }
if (typeof entityToSplit !== 'object' || entityToSplit === null) { if (typeof entityToSplit !== 'object' || entityToSplit === null) {
entityToSplit = [entityToSplit]; entityToSplit = [entityToSplit] as unknown as IDataObject[];
} }
if (!Array.isArray(entityToSplit)) { if (!Array.isArray(entityToSplit)) {

View File

@@ -193,7 +193,9 @@ export function getAddressesUi(): INodeProperties {
}; };
} }
export function adjustAddresses(addresses: [{ street: string; [key: string]: string }]): Address[] { export function adjustAddresses(
addresses: Array<{ street: string; [key: string]: string }>,
): Address[] {
const _addresses: Address[] = []; const _addresses: Address[] = [];
for (let i = 0; i < addresses.length; i++) { for (let i = 0; i < addresses.length; i++) {
if (addresses[i]?.region === '') { if (addresses[i]?.region === '') {

View File

@@ -169,6 +169,7 @@ export class Magento2 implements INodeType {
)) as CustomerAttributeMetadata[]; )) as CustomerAttributeMetadata[];
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
for (const attribute of attributes) { for (const attribute of attributes) {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
if (attribute.system === false && attribute.frontend_label !== '') { if (attribute.system === false && attribute.frontend_label !== '') {
returnData.push({ returnData.push({
name: attribute.frontend_label as string, name: attribute.frontend_label as string,
@@ -189,6 +190,7 @@ export class Magento2 implements INodeType {
)) as CustomerAttributeMetadata[]; )) as CustomerAttributeMetadata[];
const returnData: INodePropertyOptions[] = []; const returnData: INodePropertyOptions[] = [];
for (const attribute of attributes) { for (const attribute of attributes) {
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
if (attribute.system === true && attribute.frontend_label !== null) { if (attribute.system === true && attribute.frontend_label !== null) {
returnData.push({ returnData.push({
name: attribute.frontend_label as string, name: attribute.frontend_label as string,
@@ -346,7 +348,7 @@ export class Magento2 implements INodeType {
body.customer!.addresses = adjustAddresses(addresses?.address || []); body.customer!.addresses = adjustAddresses(addresses?.address || []);
body.customer!.custom_attributes = customAttributes?.customAttribute || {}; body.customer!.custom_attributes = customAttributes?.customAttribute || [];
body.customer!.extension_attributes = [ body.customer!.extension_attributes = [
'amazon_id', 'amazon_id',
@@ -490,7 +492,7 @@ export class Magento2 implements INodeType {
body.customer!.addresses = adjustAddresses(addresses?.address || []); body.customer!.addresses = adjustAddresses(addresses?.address || []);
body.customer!.custom_attributes = customAttributes?.customAttribute || {}; body.customer!.custom_attributes = customAttributes?.customAttribute || [];
body.customer!.extension_attributes = [ body.customer!.extension_attributes = [
'amazon_id', 'amazon_id',
@@ -661,7 +663,7 @@ export class Magento2 implements INodeType {
}, },
}; };
body.product!.custom_attributes = customAttributes?.customAttribute || {}; body.product!.custom_attributes = customAttributes?.customAttribute || [];
Object.assign(body.product!, rest); Object.assign(body.product!, rest);
@@ -776,7 +778,7 @@ export class Magento2 implements INodeType {
}, },
}; };
body.product!.custom_attributes = customAttributes?.customAttribute || {}; body.product!.custom_attributes = customAttributes?.customAttribute || [];
Object.assign(body.product!, rest); Object.assign(body.product!, rest);

View File

@@ -91,8 +91,8 @@ export async function execute(
const mergeIntoSingleObject = selectMergeMethod(clashHandling); const mergeIntoSingleObject = selectMergeMethod(clashHandling);
for (let i = 0; i < numEntries; i++) { for (let i = 0; i < numEntries; i++) {
const preferredEntry = preferred[i] ?? {}; const preferredEntry = preferred[i] ?? ({} as INodeExecutionData);
const restEntries = inputsData.map((input) => input[i] ?? {}); const restEntries = inputsData.map((input) => input[i] ?? ({} as INodeExecutionData));
const json = { const json = {
...mergeIntoSingleObject( ...mergeIntoSingleObject(

View File

@@ -207,7 +207,7 @@ export async function handleErrorPostReceive(
if (resource === 'file' && operation === 'download' && Buffer.isBuffer(response.body)) { if (resource === 'file' && operation === 'download' && Buffer.isBuffer(response.body)) {
response.body = jsonParse((response.body as Buffer).toString()); response.body = jsonParse((response.body as Buffer).toString());
} }
const error = (response.body as IErrorResponse)?.error ?? {}; const error = (response.body as IErrorResponse)?.error ?? ({} as IErrorResponse['error']);
if (resource === 'file') { if (resource === 'file') {
if (operation === 'download') { if (operation === 'download') {

View File

@@ -8,6 +8,7 @@ import type {
IDataObject, IDataObject,
ILoadOptionsFunctions, ILoadOptionsFunctions,
JsonObject, JsonObject,
INodeExecutionData,
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError, NodeConnectionTypes } from 'n8n-workflow'; import { NodeApiError, NodeConnectionTypes } from 'n8n-workflow';
@@ -388,7 +389,7 @@ export class MicrosoftTeamsTrigger implements INodeType {
workflowData: eventNotifications.map((event) => [ workflowData: eventNotifications.map((event) => [
{ {
json: (event.resourceData as IDataObject) ?? event, json: (event.resourceData as IDataObject) ?? event,
}, } as INodeExecutionData,
]), ]),
}; };

View File

@@ -271,8 +271,7 @@ function getTexts(texts: TextData[]) {
type: 'mention', type: 'mention',
mention: { mention: {
type: text.mentionType, type: text.mentionType,
//@ts-expect-error any [text.mentionType]: { id: text[text.mentionType as keyof TextData] as string },
[text.mentionType]: { id: text[text.mentionType] as string },
}, },
annotations: text.annotationUi, annotations: text.annotationUi,
}); });

View File

@@ -184,10 +184,10 @@ export const parseMessage = async (
}; };
} else { } else {
let content: IDataObject | string = message.content.toString(); let content: IDataObject | string = message.content.toString();
if (options.jsonParseBody) { if ('jsonParseBody' in options && options.jsonParseBody) {
content = jsonParse(content); content = jsonParse(content);
} }
if (options.onlyContent) { if ('onlyContent' in options && options.onlyContent) {
return { json: content as IDataObject }; return { json: content as IDataObject };
} else { } else {
message.content = content as unknown as Buffer; message.content = content as unknown as Buffer;

View File

@@ -208,7 +208,10 @@ export class SeaTableTriggerV2 implements INodeType {
const newRows: any = []; const newRows: any = [];
for (const row of rows) { for (const row of rows) {
if (assetColumnType === 'digital-sign') { if (assetColumnType === 'digital-sign') {
const signature = (row[assetColumn] as IColumnDigitalSignature) || []; const signature = (row[assetColumn] as IColumnDigitalSignature) || {
sign_time: undefined,
};
if (signature.sign_time) { if (signature.sign_time) {
if (new Date(signature.sign_time) > new Date(startDate)) { if (new Date(signature.sign_time) > new Date(startDate)) {
newRows.push(signature); newRows.push(signature);

View File

@@ -206,7 +206,7 @@ export const validateEntry = (
if (ignoreErrors) { if (ignoreErrors) {
return { name, value: value ?? null }; return { name, value: value ?? null };
} else { } else {
const message = `${validationResult.errorMessage} [item ${itemIndex}]`; const message = `${'errorMessage' in validationResult ? validationResult.errorMessage : 'Error'} [item ${itemIndex}]`;
throw new NodeOperationError(node, message, { throw new NodeOperationError(node, message, {
itemIndex, itemIndex,
description, description,

View File

@@ -11,6 +11,7 @@ import type {
IRequestOptions, IRequestOptions,
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeApiError, NodeOperationError } from 'n8n-workflow'; import { NodeApiError, NodeOperationError } from 'n8n-workflow';
import type { LoadedResource, Resource } from './types';
export async function getAuthorization( export async function getAuthorization(
this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions,

View File

@@ -26,6 +26,15 @@ import {
throwOnEmptyUpdate, throwOnEmptyUpdate,
toOptions, toOptions,
} from './GenericFunctions'; } from './GenericFunctions';
import type {
LoadedEpic,
LoadedResource,
LoadedTags,
LoadedUser,
LoadedUserStory,
Operation,
Resource,
} from './types';
export class Taiga implements INodeType { export class Taiga implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {

View File

@@ -11,6 +11,7 @@ import {
} from 'n8n-workflow'; } from 'n8n-workflow';
import { getAutomaticSecret, taigaApiRequest } from './GenericFunctions'; import { getAutomaticSecret, taigaApiRequest } from './GenericFunctions';
import type { Operations, Resources, WebhookPayload } from './types';
// import { // import {
// createHmac, // createHmac,

View File

@@ -1,38 +1,38 @@
type Resource = 'epic' | 'issue' | 'task' | 'userStory'; export type Resource = 'epic' | 'issue' | 'task' | 'userStory';
type Operation = 'create' | 'delete' | 'update' | 'get' | 'getAll'; export type Operation = 'create' | 'delete' | 'update' | 'get' | 'getAll';
type LoadedResource = { export type LoadedResource = {
id: string; id: string;
name: string; name: string;
}; };
type LoadOption = { export type LoadOption = {
value: string; value: string;
name: string; name: string;
}; };
type LoadedUser = { export type LoadedUser = {
id: string; id: string;
full_name_display: string; full_name_display: string;
}; };
type LoadedUserStory = { export type LoadedUserStory = {
id: string; id: string;
subject: string; subject: string;
}; };
type LoadedEpic = LoadedUserStory; export type LoadedEpic = LoadedUserStory;
type LoadedTags = { export type LoadedTags = {
[tagName: string]: string | null; // hex color [tagName: string]: string | null; // hex color
}; };
type Operations = 'all' | 'create' | 'delete' | 'change'; export type Operations = 'all' | 'create' | 'delete' | 'change';
type Resources = 'all' | 'issue' | 'milestone' | 'task' | 'userstory' | 'wikipage'; export type Resources = 'all' | 'issue' | 'milestone' | 'task' | 'userstory' | 'wikipage';
type WebhookPayload = { export type WebhookPayload = {
action: Operations; action: Operations;
type: Resources; type: Resources;
by: Record<string, string | number>; by: Record<string, string | number>;

View File

@@ -5,7 +5,7 @@ import type {
INodeTypeDescription, INodeTypeDescription,
} from 'n8n-workflow'; } from 'n8n-workflow';
import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow'; import { NodeConnectionTypes, NodeOperationError } from 'n8n-workflow';
import OTPAuth from 'otpauth'; import * as OTPAuth from 'otpauth';
export class Totp implements INodeType { export class Totp implements INodeType {
description: INodeTypeDescription = { description: INodeTypeDescription = {

View File

@@ -173,7 +173,7 @@ export class SplitOut implements INodeType {
} }
if (typeof entityToSplit !== 'object' || entityToSplit === null) { if (typeof entityToSplit !== 'object' || entityToSplit === null) {
entityToSplit = [entityToSplit]; entityToSplit = [entityToSplit] as unknown as IDataObject[];
} }
if (!Array.isArray(entityToSplit)) { if (!Array.isArray(entityToSplit)) {

View File

@@ -8,12 +8,12 @@
"copy-nodes-json": "node scripts/copy-nodes-json.js .", "copy-nodes-json": "node scripts/copy-nodes-json.js .",
"dev": "pnpm watch", "dev": "pnpm watch",
"typecheck": "tsc --noEmit", "typecheck": "tsc --noEmit",
"build": "tsup --tsconfig tsconfig.build.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata", "build": "tsc --build tsconfig.build.cjs.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.cjs.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata",
"format": "biome format --write .", "format": "biome format --write .",
"format:check": "biome ci .", "format:check": "biome ci .",
"lint": "eslint nodes credentials utils test --quiet && node ./scripts/validate-load-options-methods.js", "lint": "eslint nodes credentials utils test --quiet && node ./scripts/validate-load-options-methods.js",
"lintfix": "eslint nodes credentials utils test --fix", "lintfix": "eslint nodes credentials utils test --fix",
"watch": "tsup --watch --tsconfig tsconfig.build.json --onSuccess \"pnpm copy-nodes-json && tsc-alias -p tsconfig.build.json && pnpm n8n-generate-metadata\"", "watch": "tsc-watch -p tsconfig.build.cjs.json --onCompilationComplete \"pnpm copy-nodes-json && tsc-alias -p tsconfig.build.cjs.json\" --onSuccess \"pnpm n8n-generate-metadata\"",
"test": "jest", "test": "jest",
"test:dev": "jest --watch" "test:dev": "jest --watch"
}, },

1
packages/nodes-base/shims.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module 'minifaker';

View File

@@ -0,0 +1,24 @@
{
"extends": ["./tsconfig.json", "@n8n/typescript-config/modern/tsconfig.cjs.json"],
"compilerOptions": {
"outDir": "dist",
"module": "commonjs",
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo"
},
"include": [
"credentials/**/*.ts",
"credentials/translations/**/*.json",
"nodes/**/*.ts",
"nodes/**/*.json",
"types/**/*.ts",
"utils/**/*.ts"
],
"exclude": [
"node_modules",
"nodes/**/*.test.ts",
"credentials/**/*.test.ts",
"utils/**/*.test.ts",
"test/**",
"../core/nodes-testing"
]
}

View File

@@ -1,17 +0,0 @@
{
"extends": ["./tsconfig.json", "@n8n/typescript-config/tsconfig.build.json"],
"compilerOptions": {
"outDir": "dist",
"composite": true,
"tsBuildInfoFile": "dist/build.tsbuildinfo"
},
"include": [
"credentials/**/*.ts",
"credentials/translations/**/*.json",
"nodes/**/*.ts",
"nodes/**/*.json",
"types/**/*.ts",
"utils/**/*.ts"
],
"exclude": ["nodes/**/*.test.ts", "credentials/**/*.test.ts", "utils/**/*.test.ts", "test/**"]
}

View File

@@ -1,8 +1,5 @@
{ {
"extends": [ "extends": ["@n8n/typescript-config/modern/tsconfig.json"],
"@n8n/typescript-config/tsconfig.common.json",
"@n8n/typescript-config/tsconfig.backend.json"
],
"compilerOptions": { "compilerOptions": {
"paths": { "paths": {
"@credentials/*": ["./credentials/*"], "@credentials/*": ["./credentials/*"],
@@ -11,19 +8,39 @@
"@nodes-testing/*": ["../core/nodes-testing/*"] "@nodes-testing/*": ["../core/nodes-testing/*"]
}, },
"tsBuildInfoFile": "dist/typecheck.tsbuildinfo", "tsBuildInfoFile": "dist/typecheck.tsbuildinfo",
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"experimentalDecorators": true, "experimentalDecorators": true,
// TODO: remove all options below this line
// TODO: remove all options below this line to align with the modern config
// TODO: "module" to be removed when we migrate to vitest
"module": "commonjs",
// TODO: "moduleResolution" to be removed when we migrate to vitest
"moduleResolution": "node",
"noImplicitReturns": false, "noImplicitReturns": false,
"useUnknownInCatchVariables": false "useUnknownInCatchVariables": false,
"isolatedModules": false,
"verbatimModuleSyntax": false,
"noUncheckedIndexedAccess": false,
"noImplicitOverride": false,
"noImplicitAny": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"strictNullChecks": true,
"preserveConstEnums": true
}, },
"include": [ "include": [
"shims.d.ts",
"credentials/**/*.ts", "credentials/**/*.ts",
"nodes/**/*.ts", "nodes/**/*.ts",
"nodes/**/*.json", "nodes/**/*.json",
"test/**/*.ts", "test/**/*.ts",
"types/**/*.ts", "types/**/*.ts",
"utils/**/*.ts" "utils/**/*.ts",
"types/**/*.ts",
"../core/nodes-testing/**/*.ts",
"../../node_modules/jest-expect-message/types/index.d.ts"
], ],
"references": [ "references": [
{ "path": "../@n8n/imap/tsconfig.build.json" }, { "path": "../@n8n/imap/tsconfig.build.json" },

View File

@@ -1,62 +0,0 @@
import { defineConfig } from 'tsup';
import glob from 'fast-glob';
import { resolve } from 'path';
import { readFile } from 'fs/promises';
const packagesDir = resolve(__dirname, '..');
const aiNodesDir = resolve(packagesDir, '@n8n', 'nodes-langchain');
const cliDir = resolve(packagesDir, 'cli');
const externalFiles = [
...(await glob('nodes/**/*.ts', { cwd: aiNodesDir, absolute: true })),
...(await glob('test/integration/**/*.ts', { cwd: cliDir, absolute: true })),
];
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;
while ((match = regex.exec(fileContents)) !== null) {
acc.add(match[1]);
}
return acc;
},
new Set<string>(),
);
const externalPackageDependencies = Array.from(externalPackageImports).map(
(i) => i.replace(/^n8n-nodes-base\/(dist\/)?/, '') + '.ts',
);
const commonIgnoredFiles = ['!**/*.d.ts', '!**/*.test.ts'];
export default defineConfig([
{
entry: [
'{credentials,nodes,test,types,utils}/**/*.ts',
...commonIgnoredFiles,
...externalPackageDependencies.map((path) => `!${path}`),
],
format: ['cjs'],
dts: false,
bundle: false,
sourcemap: true,
silent: true,
},
{
entry: [...externalPackageDependencies, ...commonIgnoredFiles],
format: ['cjs'],
dts: {
compilerOptions: {
composite: false,
},
},
bundle: false,
sourcemap: true,
silent: true,
},
]);

12
patches/ics.patch Normal file
View File

@@ -0,0 +1,12 @@
diff --git a/package.json b/package.json
index c69d9542b6f211d7dd3da0d11eb62002ed480457..a85c007d243ff0323c6ee271768147a848737241 100644
--- a/package.json
+++ b/package.json
@@ -3,6 +3,7 @@
"version": "2.40.0",
"description": "iCal (ics) file generator",
"exports": {
+ "types": "./index.d.ts",
"require": "./index.js",
"default": "./dist/index.js"
},

12
patches/minifaker.patch Normal file
View File

@@ -0,0 +1,12 @@
diff --git a/package.json b/package.json
index 6ee7fa8ca1fc6daf7322b5278becb4e38c55eef8..7ebf0a67338ae7635a13d73952e7b4fa9c6c0f6b 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
"module": "./dist/esm/index.js",
"exports": {
".": {
+ "types": "./dist/types/index.d.ts",
"import": "./dist/esm/index.js",
"require": "./dist/cjs/index.js"
},

20
pnpm-lock.yaml generated
View File

@@ -219,9 +219,15 @@ patchedDependencies:
element-plus@2.4.3: element-plus@2.4.3:
hash: 3bc4ea0a42ad52c6bbc3d06c12c2963d55b57d6b5b8d436e46e7fd8ff8c10661 hash: 3bc4ea0a42ad52c6bbc3d06c12c2963d55b57d6b5b8d436e46e7fd8ff8c10661
path: patches/element-plus@2.4.3.patch path: patches/element-plus@2.4.3.patch
ics:
hash: 163587ad2fa9bc787ed09cd5e958eace08b4aa8aaca651869e9434ba674e158d
path: patches/ics.patch
js-base64: js-base64:
hash: bb02fdf69495c7b0768791b60ab6e1a002053b8decd19a174f5755691e5c9500 hash: bb02fdf69495c7b0768791b60ab6e1a002053b8decd19a174f5755691e5c9500
path: patches/js-base64.patch path: patches/js-base64.patch
minifaker:
hash: bc707e2c34a2464da2c9c93ead33e80fd9883a00434ef64907ddc45208a08b33
path: patches/minifaker.patch
pdfjs-dist@5.3.31: pdfjs-dist@5.3.31:
hash: 421253c8e411cdaef58ba96d2bb44ae0784e1b3e446f5caca50710daa1fa5dcd hash: 421253c8e411cdaef58ba96d2bb44ae0784e1b3e446f5caca50710daa1fa5dcd
path: patches/pdfjs-dist@5.3.31.patch path: patches/pdfjs-dist@5.3.31.patch
@@ -2665,7 +2671,7 @@ importers:
version: 0.6.3 version: 0.6.3
ics: ics:
specifier: 2.40.0 specifier: 2.40.0
version: 2.40.0 version: 2.40.0(patch_hash=163587ad2fa9bc787ed09cd5e958eace08b4aa8aaca651869e9434ba674e158d)
isbot: isbot:
specifier: 3.6.13 specifier: 3.6.13
version: 3.6.13 version: 3.6.13
@@ -2701,7 +2707,7 @@ importers:
version: 3.6.7 version: 3.6.7
minifaker: minifaker:
specifier: 1.34.1 specifier: 1.34.1
version: 1.34.1 version: 1.34.1(patch_hash=bc707e2c34a2464da2c9c93ead33e80fd9883a00434ef64907ddc45208a08b33)
moment-timezone: moment-timezone:
specifier: 0.5.37 specifier: 0.5.37
version: 0.5.37 version: 0.5.37
@@ -21141,7 +21147,7 @@ snapshots:
'@types/serve-static@1.15.0': '@types/serve-static@1.15.0':
dependencies: dependencies:
'@types/mime': 3.0.1 '@types/mime': 3.0.1
'@types/node': 20.17.57 '@types/node': 20.19.1
'@types/shelljs@0.8.11': '@types/shelljs@0.8.11':
dependencies: dependencies:
@@ -21162,11 +21168,11 @@ snapshots:
'@types/ssh2-streams@0.1.12': '@types/ssh2-streams@0.1.12':
dependencies: dependencies:
'@types/node': 20.17.57 '@types/node': 20.19.1
'@types/ssh2@0.5.52': '@types/ssh2@0.5.52':
dependencies: dependencies:
'@types/node': 20.17.57 '@types/node': 20.19.1
'@types/ssh2-streams': 0.1.12 '@types/ssh2-streams': 0.1.12
'@types/ssh2@1.11.6': '@types/ssh2@1.11.6':
@@ -25392,7 +25398,7 @@ snapshots:
dependencies: dependencies:
safer-buffer: 2.1.2 safer-buffer: 2.1.2
ics@2.40.0: ics@2.40.0(patch_hash=163587ad2fa9bc787ed09cd5e958eace08b4aa8aaca651869e9434ba674e158d):
dependencies: dependencies:
nanoid: 3.3.11 nanoid: 3.3.11
yup: 0.32.11 yup: 0.32.11
@@ -27070,7 +27076,7 @@ snapshots:
min-indent@1.0.1: {} min-indent@1.0.1: {}
minifaker@1.34.1: minifaker@1.34.1(patch_hash=bc707e2c34a2464da2c9c93ead33e80fd9883a00434ef64907ddc45208a08b33):
dependencies: dependencies:
'@types/uuid': 8.3.4 '@types/uuid': 8.3.4
nanoid: 3.3.11 nanoid: 3.3.11