mirror of
https://github.com/n8n-io/n8n
synced 2026-04-21 07:37:20 +00:00
fix(core): Ensure single zod instance across workspace packages (#28604)
This commit is contained in:
parent
1b13d325f1
commit
107c48f65c
5 changed files with 37 additions and 24 deletions
|
|
@ -27,12 +27,15 @@
|
|||
"@n8n/vitest-config": "workspace:*",
|
||||
"@vitest/coverage-v8": "catalog:",
|
||||
"vitest": "catalog:",
|
||||
"vitest-mock-extended": "catalog:"
|
||||
"vitest-mock-extended": "catalog:",
|
||||
"zod": "catalog:"
|
||||
},
|
||||
"dependencies": {
|
||||
"n8n-workflow": "workspace:*",
|
||||
"xss": "catalog:",
|
||||
"zod": "catalog:",
|
||||
"@n8n/permissions": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"zod": "catalog:"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,11 +96,20 @@ export class ModuleRegistry {
|
|||
for (const moduleName of modules ?? this.eligibleModules) {
|
||||
try {
|
||||
await import(`${modulesDir}/${moduleName}/${moduleName}.module`);
|
||||
} catch {
|
||||
} catch (primaryError) {
|
||||
try {
|
||||
await import(`${modulesDir}/${moduleName}.ee/${moduleName}.module`);
|
||||
} catch (error) {
|
||||
throw new MissingModuleError(moduleName, error instanceof Error ? error.message : '');
|
||||
const loggedError =
|
||||
primaryError instanceof Error &&
|
||||
'code' in primaryError &&
|
||||
primaryError.code !== 'MODULE_NOT_FOUND'
|
||||
? primaryError
|
||||
: error;
|
||||
throw new MissingModuleError(
|
||||
moduleName,
|
||||
loggedError instanceof Error ? loggedError.message : '',
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,11 @@
|
|||
"@types/mime-types": "catalog:",
|
||||
"@types/proxy-from-env": "^1.0.4",
|
||||
"@types/uuid": "catalog:",
|
||||
"@types/xml2js": "catalog:"
|
||||
"@types/xml2js": "catalog:",
|
||||
"zod": "catalog:"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"zod": "catalog:"
|
||||
},
|
||||
"dependencies": {
|
||||
"@aws-sdk/client-s3": "3.808.0",
|
||||
|
|
@ -78,7 +82,6 @@
|
|||
"ssh2": "1.15.0",
|
||||
"uuid": "catalog:",
|
||||
"winston": "3.14.2",
|
||||
"xml2js": "catalog:",
|
||||
"zod": "catalog:"
|
||||
"xml2js": "catalog:"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,7 +48,8 @@
|
|||
"@types/md5": "^2.3.5",
|
||||
"@types/xml2js": "catalog:",
|
||||
"vitest": "catalog:",
|
||||
"vitest-mock-extended": "catalog:"
|
||||
"vitest-mock-extended": "catalog:",
|
||||
"zod": "catalog:"
|
||||
},
|
||||
"dependencies": {
|
||||
"@n8n/errors": "workspace:*",
|
||||
|
|
@ -69,7 +70,9 @@
|
|||
"transliteration": "2.3.5",
|
||||
"uuid": "catalog:",
|
||||
"xml2js": "catalog:",
|
||||
"zod": "catalog:",
|
||||
"jsonrepair": "catalog:"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"zod": "catalog:"
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -793,9 +793,6 @@ importers:
|
|||
xss:
|
||||
specifier: 'catalog:'
|
||||
version: 1.0.15
|
||||
zod:
|
||||
specifier: 3.25.67
|
||||
version: 3.25.67
|
||||
devDependencies:
|
||||
'@n8n/config':
|
||||
specifier: workspace:*
|
||||
|
|
@ -815,6 +812,9 @@ importers:
|
|||
vitest-mock-extended:
|
||||
specifier: 'catalog:'
|
||||
version: 3.1.0(typescript@6.0.2)(vitest@4.1.1(@opentelemetry/api@1.9.0)(@types/node@20.19.21)(jsdom@23.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(vite@8.0.2(@types/node@20.19.21)(esbuild@0.25.10)(jiti@2.6.1)(sass-embedded@1.98.0)(sass@1.98.0)(terser@5.16.1)(tsx@4.19.3)(yaml@2.8.3)))
|
||||
zod:
|
||||
specifier: 3.25.67
|
||||
version: 3.25.67
|
||||
|
||||
packages/@n8n/backend-common:
|
||||
dependencies:
|
||||
|
|
@ -2968,9 +2968,6 @@ importers:
|
|||
xml2js:
|
||||
specifier: 'catalog:'
|
||||
version: 0.6.2
|
||||
zod:
|
||||
specifier: 3.25.67
|
||||
version: 3.25.67
|
||||
devDependencies:
|
||||
'@n8n/errors':
|
||||
specifier: workspace:*
|
||||
|
|
@ -2999,6 +2996,9 @@ importers:
|
|||
'@types/xml2js':
|
||||
specifier: 'catalog:'
|
||||
version: 0.4.14
|
||||
zod:
|
||||
specifier: 3.25.67
|
||||
version: 3.25.67
|
||||
|
||||
packages/extensions/insights:
|
||||
dependencies:
|
||||
|
|
@ -4555,9 +4555,6 @@ importers:
|
|||
xml2js:
|
||||
specifier: 'catalog:'
|
||||
version: 0.6.2
|
||||
zod:
|
||||
specifier: 3.25.67
|
||||
version: 3.25.67
|
||||
devDependencies:
|
||||
'@langchain/core':
|
||||
specifier: 'catalog:'
|
||||
|
|
@ -4595,6 +4592,9 @@ importers:
|
|||
vitest-mock-extended:
|
||||
specifier: 'catalog:'
|
||||
version: 3.1.0(typescript@6.0.2)(vitest@4.1.1(@opentelemetry/api@1.9.0)(@types/node@20.19.21)(jsdom@23.0.1(bufferutil@4.0.9)(utf-8-validate@5.0.10))(vite@8.0.2(@types/node@20.19.21)(esbuild@0.25.10)(jiti@2.6.1)(sass-embedded@1.98.0)(sass@1.98.0)(terser@5.16.1)(tsx@4.19.3)(yaml@2.8.3)))
|
||||
zod:
|
||||
specifier: 3.25.67
|
||||
version: 3.25.67
|
||||
|
||||
packages:
|
||||
|
||||
|
|
@ -25564,7 +25564,7 @@ snapshots:
|
|||
'@currents/commit-info': 1.0.1-beta.0
|
||||
async-retry: 1.3.3
|
||||
axios: 1.15.0(debug@4.4.3)
|
||||
axios-retry: 4.5.0(axios@1.15.0(debug@4.4.3))
|
||||
axios-retry: 4.5.0(axios@1.15.0)
|
||||
c12: 1.11.2(magicast@0.3.5)
|
||||
chalk: 4.1.2
|
||||
commander: 12.1.0
|
||||
|
|
@ -32968,11 +32968,6 @@ snapshots:
|
|||
|
||||
axe-core@4.7.2: {}
|
||||
|
||||
axios-retry@4.5.0(axios@1.15.0(debug@4.4.3)):
|
||||
dependencies:
|
||||
axios: 1.15.0(debug@4.4.3)
|
||||
is-retry-allowed: 2.2.0
|
||||
|
||||
axios-retry@4.5.0(axios@1.15.0):
|
||||
dependencies:
|
||||
axios: 1.15.0
|
||||
|
|
|
|||
Loading…
Reference in a new issue