@openfn/cli 1.18.1 → 1.18.2
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/index.js +8 -14
- package/dist/process/runner.js +19 -19
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -356,10 +356,10 @@ var getBaseDir = (opts2) => {
|
|
|
356
356
|
}
|
|
357
357
|
return basePath;
|
|
358
358
|
};
|
|
359
|
-
var
|
|
360
|
-
name: "project-
|
|
359
|
+
var projectId = {
|
|
360
|
+
name: "project-id",
|
|
361
361
|
yargs: {
|
|
362
|
-
description: "The
|
|
362
|
+
description: "The id or UUID of an openfn project",
|
|
363
363
|
string: true
|
|
364
364
|
},
|
|
365
365
|
ensure: (opts2) => {
|
|
@@ -1120,9 +1120,9 @@ var projectsCommand = {
|
|
|
1120
1120
|
var command_default11 = projectsCommand;
|
|
1121
1121
|
|
|
1122
1122
|
// src/checkout/command.ts
|
|
1123
|
-
var options10 = [
|
|
1123
|
+
var options10 = [projectId, projectPath, log];
|
|
1124
1124
|
var checkoutCommand = {
|
|
1125
|
-
command: "checkout <project-
|
|
1125
|
+
command: "checkout <project-id>",
|
|
1126
1126
|
describe: "Switch to a different openfn project in the same workspace",
|
|
1127
1127
|
handler: ensure("checkout", options10),
|
|
1128
1128
|
builder: (yargs2) => build(options10, yargs2)
|
|
@@ -1131,7 +1131,7 @@ var command_default12 = checkoutCommand;
|
|
|
1131
1131
|
|
|
1132
1132
|
// src/merge/command.ts
|
|
1133
1133
|
var options11 = [
|
|
1134
|
-
|
|
1134
|
+
projectId,
|
|
1135
1135
|
projectPath,
|
|
1136
1136
|
removeUnmapped,
|
|
1137
1137
|
workflowMappings,
|
|
@@ -1141,7 +1141,7 @@ var options11 = [
|
|
|
1141
1141
|
})
|
|
1142
1142
|
];
|
|
1143
1143
|
var mergeCommand = {
|
|
1144
|
-
command: "merge
|
|
1144
|
+
command: "merge <project-id>",
|
|
1145
1145
|
describe: "Merges the specified project into the checked out project",
|
|
1146
1146
|
handler: ensure("merge", options11),
|
|
1147
1147
|
builder: (yargs2) => build(options11, yargs2)
|
|
@@ -1149,13 +1149,7 @@ var mergeCommand = {
|
|
|
1149
1149
|
var command_default13 = mergeCommand;
|
|
1150
1150
|
|
|
1151
1151
|
// src/version/command.ts
|
|
1152
|
-
var options12 = [
|
|
1153
|
-
workflow,
|
|
1154
|
-
projectName,
|
|
1155
|
-
projectPath,
|
|
1156
|
-
workflowMappings,
|
|
1157
|
-
json
|
|
1158
|
-
];
|
|
1152
|
+
var options12 = [workflow, projectPath, workflowMappings, json];
|
|
1159
1153
|
var workflowVersionCommand = {
|
|
1160
1154
|
command: "project version [workflow]",
|
|
1161
1155
|
describe: "Returns the version has of a workflow",
|
package/dist/process/runner.js
CHANGED
|
@@ -2285,15 +2285,15 @@ var projectsHandler = async (options, logger) => {
|
|
|
2285
2285
|
}
|
|
2286
2286
|
logger.success(`Available openfn projects
|
|
2287
2287
|
|
|
2288
|
-
${workspace.list().map((p) => describeProject(p, p.
|
|
2288
|
+
${workspace.list().map((p) => describeProject(p, p.id === workspace.activeProjectId)).join("\n\n")}
|
|
2289
2289
|
`);
|
|
2290
2290
|
};
|
|
2291
2291
|
function describeProject(project, active = false) {
|
|
2292
|
-
const
|
|
2293
|
-
return `${project.
|
|
2294
|
-
${
|
|
2292
|
+
const uuid = project.openfn?.uuid;
|
|
2293
|
+
return `${project.id} ${active ? "(active)" : ""}
|
|
2294
|
+
${uuid || "<project-id>"}
|
|
2295
2295
|
workflows:
|
|
2296
|
-
${project.workflows.map((w) => " - " + w.
|
|
2296
|
+
${project.workflows.map((w) => " - " + w.id).join("\n")}`;
|
|
2297
2297
|
}
|
|
2298
2298
|
var handler_default11 = projectsHandler;
|
|
2299
2299
|
|
|
@@ -2351,18 +2351,18 @@ var checkoutHandler = async (options, logger) => {
|
|
|
2351
2351
|
}
|
|
2352
2352
|
const { project: _, ...config } = workspace.getConfig();
|
|
2353
2353
|
let switchProject;
|
|
2354
|
-
if (/\.(yaml|json)$/.test(options.
|
|
2355
|
-
const filePath = path13.join(commandPath, options.
|
|
2354
|
+
if (/\.(yaml|json)$/.test(options.projectId)) {
|
|
2355
|
+
const filePath = path13.join(commandPath, options.projectId);
|
|
2356
2356
|
logger.debug("Loading project from path ", filePath);
|
|
2357
2357
|
switchProject = await Project5.from("path", filePath, {
|
|
2358
2358
|
config
|
|
2359
2359
|
});
|
|
2360
2360
|
} else {
|
|
2361
|
-
switchProject = workspace.get(options.
|
|
2361
|
+
switchProject = workspace.get(options.projectId);
|
|
2362
2362
|
}
|
|
2363
2363
|
if (!switchProject) {
|
|
2364
2364
|
logger.error(
|
|
2365
|
-
`Project with id/name ${options.
|
|
2365
|
+
`Project with id/name ${options.projectId} not found in the workspace`
|
|
2366
2366
|
);
|
|
2367
2367
|
return;
|
|
2368
2368
|
}
|
|
@@ -2399,26 +2399,26 @@ var mergeHandler = async (options, logger) => {
|
|
|
2399
2399
|
return;
|
|
2400
2400
|
}
|
|
2401
2401
|
let sourceProject;
|
|
2402
|
-
if (/\.(yaml|json)$/.test(options.
|
|
2403
|
-
const filePath = path14.join(commandPath, options.
|
|
2402
|
+
if (/\.(yaml|json)$/.test(options.projectId)) {
|
|
2403
|
+
const filePath = path14.join(commandPath, options.projectId);
|
|
2404
2404
|
logger.debug("Loading source project from path ", filePath);
|
|
2405
2405
|
sourceProject = await Project6.from("path", filePath);
|
|
2406
2406
|
} else {
|
|
2407
|
-
sourceProject = workspace.get(options.
|
|
2407
|
+
sourceProject = workspace.get(options.projectId);
|
|
2408
2408
|
}
|
|
2409
2409
|
if (!sourceProject) {
|
|
2410
|
-
logger.error(`Project "${options.
|
|
2410
|
+
logger.error(`Project "${options.projectId}" not found in the workspace`);
|
|
2411
2411
|
return;
|
|
2412
2412
|
}
|
|
2413
|
-
if (targetProject.
|
|
2413
|
+
if (targetProject.id === sourceProject.id) {
|
|
2414
2414
|
logger.error("Merging into the same project not allowed");
|
|
2415
2415
|
return;
|
|
2416
2416
|
}
|
|
2417
|
-
if (!targetProject.
|
|
2418
|
-
logger.error("The checked out project has no
|
|
2417
|
+
if (!targetProject.id) {
|
|
2418
|
+
logger.error("The checked out project has no id");
|
|
2419
2419
|
return;
|
|
2420
2420
|
}
|
|
2421
|
-
const finalPath = workspace.getProjectPath(targetProject.
|
|
2421
|
+
const finalPath = workspace.getProjectPath(targetProject.id);
|
|
2422
2422
|
if (!finalPath) {
|
|
2423
2423
|
logger.error("Path to checked out project not found.");
|
|
2424
2424
|
return;
|
|
@@ -2434,13 +2434,13 @@ var mergeHandler = async (options, logger) => {
|
|
|
2434
2434
|
{
|
|
2435
2435
|
command: "checkout",
|
|
2436
2436
|
projectPath: commandPath,
|
|
2437
|
-
|
|
2437
|
+
projectId: final.id,
|
|
2438
2438
|
log: options.log
|
|
2439
2439
|
},
|
|
2440
2440
|
logger
|
|
2441
2441
|
);
|
|
2442
2442
|
logger.success(
|
|
2443
|
-
`Project ${sourceProject.
|
|
2443
|
+
`Project ${sourceProject.id} has been merged into Project ${targetProject.id} successfully`
|
|
2444
2444
|
);
|
|
2445
2445
|
};
|
|
2446
2446
|
var handler_default14 = mergeHandler;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openfn/cli",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.2",
|
|
4
4
|
"description": "CLI devtools for the OpenFn toolchain",
|
|
5
5
|
"engines": {
|
|
6
6
|
"node": ">=18",
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@openfn/compiler": "1.1.5",
|
|
51
51
|
"@openfn/deploy": "0.11.3",
|
|
52
52
|
"@openfn/describe-package": "0.1.5",
|
|
53
|
-
"@openfn/logger": "1.0.6",
|
|
54
|
-
"@openfn/project": "^0.7.0",
|
|
55
53
|
"@openfn/lexicon": "^1.2.5",
|
|
56
|
-
"@openfn/runtime": "1.7.
|
|
54
|
+
"@openfn/runtime": "1.7.5",
|
|
55
|
+
"@openfn/logger": "1.0.6",
|
|
56
|
+
"@openfn/project": "^0.7.1"
|
|
57
57
|
},
|
|
58
58
|
"files": [
|
|
59
59
|
"dist",
|