@openfn/cli 1.9.0 → 1.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/process/runner.d.ts +1 -1
- package/dist/process/runner.js +16 -9
- package/package.json +7 -8
package/dist/process/runner.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
|
|
2
|
-
export {
|
|
2
|
+
export { }
|
package/dist/process/runner.js
CHANGED
|
@@ -428,16 +428,20 @@ var throwAbortableError = (message, help) => {
|
|
|
428
428
|
};
|
|
429
429
|
|
|
430
430
|
// src/compile/compile.ts
|
|
431
|
-
|
|
431
|
+
async function compile_default(planOrPath, opts, log) {
|
|
432
432
|
if (typeof planOrPath === "string") {
|
|
433
433
|
const result = await compileJob(planOrPath, opts, log);
|
|
434
434
|
log.success(`Compiled expression from ${opts.expressionPath}`);
|
|
435
435
|
return result;
|
|
436
436
|
}
|
|
437
|
-
const compiledPlan = compileWorkflow(
|
|
437
|
+
const compiledPlan = await compileWorkflow(
|
|
438
|
+
planOrPath,
|
|
439
|
+
opts,
|
|
440
|
+
log
|
|
441
|
+
);
|
|
438
442
|
log.success("Compiled all expressions in workflow");
|
|
439
443
|
return compiledPlan;
|
|
440
|
-
}
|
|
444
|
+
}
|
|
441
445
|
var compileJob = async (job, opts, log, jobName) => {
|
|
442
446
|
try {
|
|
443
447
|
const compilerOptions = await loadTransformOptions(opts, log);
|
|
@@ -449,7 +453,7 @@ var compileJob = async (job, opts, log, jobName) => {
|
|
|
449
453
|
e,
|
|
450
454
|
"Check the syntax of the job expression:\n\n" + job
|
|
451
455
|
);
|
|
452
|
-
return
|
|
456
|
+
return { code: job };
|
|
453
457
|
}
|
|
454
458
|
};
|
|
455
459
|
var compileWorkflow = async (plan, opts, log) => {
|
|
@@ -460,12 +464,14 @@ var compileWorkflow = async (plan, opts, log) => {
|
|
|
460
464
|
adaptors: job.adaptors ?? opts.adaptors
|
|
461
465
|
};
|
|
462
466
|
if (job.expression) {
|
|
463
|
-
|
|
467
|
+
const { code, map } = await compileJob(
|
|
464
468
|
job.expression,
|
|
465
469
|
jobOpts,
|
|
466
470
|
log,
|
|
467
471
|
job.id
|
|
468
472
|
);
|
|
473
|
+
job.expression = code;
|
|
474
|
+
job.sourceMap = map;
|
|
469
475
|
}
|
|
470
476
|
}
|
|
471
477
|
return plan;
|
|
@@ -533,7 +539,7 @@ var getUpstreamStepId = (plan, stepId) => {
|
|
|
533
539
|
if (typeof step.next === "string") {
|
|
534
540
|
return step.next === stepId;
|
|
535
541
|
}
|
|
536
|
-
return stepId in step.next;
|
|
542
|
+
return stepId in step.next || null;
|
|
537
543
|
}
|
|
538
544
|
});
|
|
539
545
|
if (upstreamStep) {
|
|
@@ -1112,11 +1118,12 @@ var compileHandler = async (options, logger) => {
|
|
|
1112
1118
|
assert_path_default(options.path);
|
|
1113
1119
|
let result;
|
|
1114
1120
|
if (options.expressionPath) {
|
|
1115
|
-
|
|
1121
|
+
const { code } = await compile_default(options.expressionPath, options, logger);
|
|
1122
|
+
result = code;
|
|
1116
1123
|
} else {
|
|
1117
1124
|
const plan = await load_plan_default(options, logger);
|
|
1118
|
-
|
|
1119
|
-
result = JSON.stringify(
|
|
1125
|
+
const compiledPlan = await compile_default(plan, options, logger);
|
|
1126
|
+
result = JSON.stringify(compiledPlan, null, 2);
|
|
1120
1127
|
}
|
|
1121
1128
|
if (options.outputStdout) {
|
|
1122
1129
|
logger.success("Result:\n\n" + result);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.10.0",
|
|
4
4
|
"description": "CLI devtools for the openfn toolchain.",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18",
|
|
@@ -33,8 +33,7 @@
|
|
|
33
33
|
"@types/ws": "^8.5.10",
|
|
34
34
|
"@types/yargs": "^17.0.24",
|
|
35
35
|
"ava": "5.3.1",
|
|
36
|
-
"mock-fs": "^5.1
|
|
37
|
-
"ts-node": "^10.9.1",
|
|
36
|
+
"mock-fs": "^5.4.1",
|
|
38
37
|
"tslib": "^2.4.0",
|
|
39
38
|
"tsup": "^7.2.0",
|
|
40
39
|
"typescript": "^5.1.6",
|
|
@@ -49,11 +48,11 @@
|
|
|
49
48
|
"undici": "^7.1.0",
|
|
50
49
|
"ws": "^8.18.0",
|
|
51
50
|
"yargs": "^17.7.2",
|
|
52
|
-
"@openfn/compiler": "0.
|
|
53
|
-
"@openfn/
|
|
54
|
-
"@openfn/
|
|
55
|
-
"@openfn/
|
|
56
|
-
"@openfn/
|
|
51
|
+
"@openfn/compiler": "1.0.0",
|
|
52
|
+
"@openfn/describe-package": "0.1.4",
|
|
53
|
+
"@openfn/logger": "1.0.4",
|
|
54
|
+
"@openfn/deploy": "0.8.2",
|
|
55
|
+
"@openfn/runtime": "1.6.0"
|
|
57
56
|
},
|
|
58
57
|
"files": [
|
|
59
58
|
"dist",
|