@openfn/engine-multi
Advanced tools
Comparing version 1.3.0 to 1.4.0
# engine-multi | ||
## 1.4.0 | ||
### Minor Changes | ||
- 7245bf7: Support multiple adaptors in job structures | ||
### Patch Changes | ||
- Engine: don't try to autoinstall adaptor versions with @local | ||
- Updated dependencies [3463ff9] | ||
- Updated dependencies [7a85894] | ||
- Updated dependencies [b6de2c4] | ||
- @openfn/runtime@1.5.0 | ||
- @openfn/compiler@0.4.0 | ||
## 1.3.0 | ||
@@ -4,0 +19,0 @@ |
@@ -423,3 +423,3 @@ // src/api.ts | ||
const adaptorsToLoad = []; | ||
for (let a of adaptors) { | ||
for (const a of adaptors) { | ||
if (whitelist && !whitelist.find((r) => r.exec(a))) { | ||
@@ -443,2 +443,6 @@ logger.warn("WARNING: autoinstall skipping blacklisted module ", a); | ||
} | ||
if (v === "local") { | ||
logger.info("Using local version of ", a); | ||
continue; | ||
} | ||
paths[a] = { | ||
@@ -454,7 +458,8 @@ path: `${repoDir}/node_modules/${alias}`, | ||
const job = step; | ||
if (paths[job.adaptor]) { | ||
const { name } = getNameAndVersion(job.adaptor); | ||
job.linker = { | ||
[name]: paths[job.adaptor] | ||
}; | ||
for (const adaptor of job.adaptors ?? []) { | ||
if (paths[adaptor]) { | ||
const { name } = getNameAndVersion(adaptor); | ||
job.linker ??= {}; | ||
job.linker[name] = paths[adaptor]; | ||
} | ||
} | ||
@@ -493,3 +498,3 @@ } | ||
const adaptors = /* @__PURE__ */ new Set(); | ||
plan.workflow.steps.filter((job) => job.adaptor).forEach((job) => adaptors.add(job.adaptor)); | ||
plan.workflow.steps.filter((job) => job.adaptors).map((job) => job.adaptors).flat().forEach((adaptor) => adaptors.add(adaptor)); | ||
return adaptors; | ||
@@ -500,3 +505,3 @@ }; | ||
import compile, { preloadAdaptorExports } from "@openfn/compiler"; | ||
import { getModulePath } from "@openfn/runtime"; | ||
import { getModulePath, getNameAndVersion as getNameAndVersion2 } from "@openfn/runtime"; | ||
var compile_default = async (context) => { | ||
@@ -510,9 +515,3 @@ const { logger, state, options } = context; | ||
try { | ||
job.expression = await compileJob( | ||
job.expression, | ||
logger, | ||
repoDir, | ||
job.adaptor | ||
// TODO need to expand this. Or do I? | ||
); | ||
job.expression = await compileJob(job, logger, repoDir); | ||
} catch (e) { | ||
@@ -532,18 +531,24 @@ throw new CompileError(e, job.id); | ||
}; | ||
var compileJob = async (job, logger, repoDir, adaptor) => { | ||
var compileJob = async (job, logger, repoDir) => { | ||
const { expression, adaptors, linker } = job; | ||
const compilerOptions = { | ||
logger | ||
}; | ||
if (adaptor && repoDir) { | ||
const pathToAdaptor = await getModulePath(adaptor, repoDir, logger); | ||
const exports = await preloadAdaptorExports(pathToAdaptor, false, logger); | ||
compilerOptions["add-imports"] = { | ||
adaptor: { | ||
if (adaptors && repoDir) { | ||
const adaptorConfig = []; | ||
for (const adaptor of adaptors) { | ||
const { name } = getNameAndVersion2(adaptor); | ||
const pathToAdaptor = linker && linker[name] ? linker[name].path : await getModulePath(adaptor, repoDir, logger); | ||
const exports = await preloadAdaptorExports(pathToAdaptor, logger); | ||
adaptorConfig.push({ | ||
name: stripVersionSpecifier(adaptor), | ||
exports, | ||
exportAll: true | ||
} | ||
}); | ||
} | ||
compilerOptions["add-imports"] = { | ||
adaptors: adaptorConfig | ||
}; | ||
} | ||
return compile(job, compilerOptions); | ||
return compile(expression, compilerOptions); | ||
}; | ||
@@ -797,3 +802,3 @@ | ||
name: "@openfn/engine-multi", | ||
version: "1.3.0", | ||
version: "1.4.0", | ||
description: "Multi-process runtime engine", | ||
@@ -800,0 +805,0 @@ main: "dist/index.js", |
{ | ||
"name": "@openfn/engine-multi", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Multi-process runtime engine", | ||
@@ -12,6 +12,6 @@ "main": "dist/index.js", | ||
"fast-safe-stringify": "^2.1.1", | ||
"@openfn/compiler": "0.3.3", | ||
"@openfn/lexicon": "^1.1.0", | ||
"@openfn/runtime": "1.4.2", | ||
"@openfn/logger": "1.0.2" | ||
"@openfn/logger": "1.0.2", | ||
"@openfn/compiler": "0.4.0", | ||
"@openfn/runtime": "1.5.0", | ||
"@openfn/lexicon": "^1.1.0" | ||
}, | ||
@@ -18,0 +18,0 @@ "devDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
50187
1337
+ Added@openfn/compiler@0.4.0(transitive)
+ Added@openfn/runtime@1.5.0(transitive)
- Removed@openfn/compiler@0.3.3(transitive)
- Removed@openfn/runtime@1.4.2(transitive)
Updated@openfn/compiler@0.4.0
Updated@openfn/runtime@1.5.0