@ucdjs/cli 0.3.1-beta.3 → 0.3.1-beta.5
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/{_shared-CgcKJJFf.mjs → _shared-DI9HUNS7.mjs} +1 -1
- package/dist/{analyze-D8AeAGDR.mjs → analyze-D3QrGXc3.mjs} +2 -2
- package/dist/cli.mjs +23 -8
- package/dist/{fields-BvLDPLGg.mjs → fields-B79TLyh4.mjs} +1 -1
- package/dist/{get-CHw5s5Ab.mjs → get-ougMDNWx.mjs} +1 -1
- package/dist/{hash-BAViT6QD.mjs → hash-CwyYmh-r.mjs} +1 -1
- package/dist/{info-ZGysg0N_.mjs → info-BHbsKKim.mjs} +1 -1
- package/dist/{info-D2uPOmns.mjs → info-_AmIqjiO.mjs} +1 -1
- package/dist/{init-DilsO33p.mjs → init-DCfH4KZf.mjs} +2 -2
- package/dist/list-BIMDvs6N.mjs +146 -0
- package/dist/{list-C1bd3Vq4.mjs → list-yfguN-x6.mjs} +1 -1
- package/dist/{mirror-DLYQGa33.mjs → mirror-D4LONBbC.mjs} +2 -2
- package/dist/{root-C_Ycy7kI.mjs → root-BKcQ4oE0.mjs} +7 -7
- package/dist/{root-DXVHyPa6.mjs → root-C7yGLANV.mjs} +4 -4
- package/dist/{root-BnOeYqGP.mjs → root-CUVELIkx.mjs} +4 -4
- package/dist/root-Cn7uU7-P.mjs +44 -0
- package/dist/{root-CfALAyOQ.mjs → root-DZc4MAVa.mjs} +2 -2
- package/dist/run-owMQvC61.mjs +74 -0
- package/dist/{status-DI1HruH0.mjs → status-BILtMFrZ.mjs} +2 -2
- package/dist/{sync-DEtQ-jZc.mjs → sync-shQohnWg.mjs} +2 -2
- package/dist/{validate-DVr1TaHK.mjs → validate-DNRIlkqr.mjs} +1 -1
- package/dist/{verify-ME4bDNIT.mjs → verify-BlwZ51gb.mjs} +2 -2
- package/package.json +11 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as
|
|
1
|
+
import { a as RemoteNotSupportedError, i as CLIStoreError, o as StoreConfigurationError, r as CLIError, s as StoreDirIsRequiredError } from "./cli.mjs";
|
|
2
2
|
import { createUCDClient } from "@ucdjs/client";
|
|
3
3
|
import { UCDJS_API_BASE_URL } from "@ucdjs/env";
|
|
4
4
|
import { isCancel, multiselect } from "@clack/prompts";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-
|
|
1
|
+
import { m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
|
+
import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-DI9HUNS7.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/cmd/store/analyze.ts
|
|
5
5
|
async function runAnalyzeStore({ flags, versions }) {
|
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import farver, { bgGreen, black, bold, dim, green } from "farver/fast";
|
|
|
3
3
|
import yargs from "yargs-parser";
|
|
4
4
|
|
|
5
5
|
//#region package.json
|
|
6
|
-
var version = "0.3.1-beta.
|
|
6
|
+
var version = "0.3.1-beta.5";
|
|
7
7
|
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/output.ts
|
|
@@ -251,7 +251,8 @@ const SUPPORTED_COMMANDS = new Set([
|
|
|
251
251
|
"codegen",
|
|
252
252
|
"store",
|
|
253
253
|
"files",
|
|
254
|
-
"lockfile"
|
|
254
|
+
"lockfile",
|
|
255
|
+
"pipelines"
|
|
255
256
|
]);
|
|
256
257
|
/**
|
|
257
258
|
* Resolves the CLI command based on the provided arguments.
|
|
@@ -321,7 +322,8 @@ async function runCommand(cmd, flags) {
|
|
|
321
322
|
["store", "Manage UCD stores (init, mirror, sync, etc.)."],
|
|
322
323
|
["codegen", "Generate TypeScript code from UCD data."],
|
|
323
324
|
["files", "List and get files from the UCD API."],
|
|
324
|
-
["lockfile", "Inspect and validate UCD store lockfiles."]
|
|
325
|
+
["lockfile", "Inspect and validate UCD store lockfiles."],
|
|
326
|
+
["pipelines", "Run and manage UCD data processing pipelines."]
|
|
325
327
|
],
|
|
326
328
|
"Global Flags": [["--version", "Show the version number and exit."], ["--help", "Show this help message."]]
|
|
327
329
|
}
|
|
@@ -331,25 +333,30 @@ async function runCommand(cmd, flags) {
|
|
|
331
333
|
console.log(` ${bgGreen(black(` ucd `))} ${green(`v${version ?? "x.y.z"}`)}`);
|
|
332
334
|
break;
|
|
333
335
|
case "codegen": {
|
|
334
|
-
const { runCodegenRoot } = await import("./root-
|
|
336
|
+
const { runCodegenRoot } = await import("./root-DZc4MAVa.mjs");
|
|
335
337
|
await runCodegenRoot(flags._[1]?.toString() ?? "", { flags });
|
|
336
338
|
break;
|
|
337
339
|
}
|
|
338
340
|
case "store": {
|
|
339
|
-
const { runStoreRoot } = await import("./root-
|
|
341
|
+
const { runStoreRoot } = await import("./root-BKcQ4oE0.mjs");
|
|
340
342
|
await runStoreRoot(flags._[1]?.toString() ?? "", { flags });
|
|
341
343
|
break;
|
|
342
344
|
}
|
|
343
345
|
case "files": {
|
|
344
|
-
const { runFilesRoot } = await import("./root-
|
|
346
|
+
const { runFilesRoot } = await import("./root-C7yGLANV.mjs");
|
|
345
347
|
await runFilesRoot(flags._[1]?.toString() ?? "", { flags });
|
|
346
348
|
break;
|
|
347
349
|
}
|
|
348
350
|
case "lockfile": {
|
|
349
|
-
const { runLockfileRoot } = await import("./root-
|
|
351
|
+
const { runLockfileRoot } = await import("./root-CUVELIkx.mjs");
|
|
350
352
|
await runLockfileRoot(flags._[1]?.toString() ?? "", { flags });
|
|
351
353
|
break;
|
|
352
354
|
}
|
|
355
|
+
case "pipelines": {
|
|
356
|
+
const { runPipelinesRoot } = await import("./root-Cn7uU7-P.mjs");
|
|
357
|
+
await runPipelinesRoot(flags._[1]?.toString() ?? "", { flags });
|
|
358
|
+
break;
|
|
359
|
+
}
|
|
353
360
|
default: throw new Error(`Error running ${cmd} -- no command found.`);
|
|
354
361
|
}
|
|
355
362
|
}
|
|
@@ -394,10 +401,18 @@ async function runCLI(args) {
|
|
|
394
401
|
setJsonMode(false);
|
|
395
402
|
}
|
|
396
403
|
}
|
|
404
|
+
function parseRepoString(repoString) {
|
|
405
|
+
const parts = repoString.split("/");
|
|
406
|
+
if (parts.length !== 2) throw new Error(`Invalid repository format: ${repoString}. Expected: owner/repo`);
|
|
407
|
+
return {
|
|
408
|
+
owner: parts[0],
|
|
409
|
+
repo: parts[1]
|
|
410
|
+
};
|
|
411
|
+
}
|
|
397
412
|
|
|
398
413
|
//#endregion
|
|
399
414
|
//#region src/cli.ts
|
|
400
415
|
runCLI(process$1.argv.slice(2));
|
|
401
416
|
|
|
402
417
|
//#endregion
|
|
403
|
-
export {
|
|
418
|
+
export { list as _, RemoteNotSupportedError as a, yellow as b, blankLine as c, dim$1 as d, formatBytes as f, keyValue as g, header as h, CLIStoreError as i, bold$1 as l, green$1 as m, printHelp as n, StoreConfigurationError as o, formatDuration as p, CLIError as r, StoreDirIsRequiredError as s, parseRepoString as t, cyan as u, output as v, red as y };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as printHelp, r as CLIError, v as output } from "./cli.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { existsSync } from "node:fs";
|
|
4
4
|
import { mkdir, readdir, stat, writeFile } from "node:fs/promises";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
2
|
import { writeFile } from "node:fs/promises";
|
|
3
3
|
import { createUCDClient } from "@ucdjs/client";
|
|
4
4
|
import { UCDJS_API_BASE_URL } from "@ucdjs/env";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as yellow, d as dim, f as formatBytes, l as bold, m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { resolve } from "node:path";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as dim, f as formatBytes, l as bold, m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
2
|
import { UCDJS_API_BASE_URL, UCD_STAT_TYPE_HEADER } from "@ucdjs/env";
|
|
3
3
|
import { customFetch } from "@ucdjs-internal/shared";
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as yellow, d as dim, f as formatBytes, l as bold, m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { resolve } from "node:path";
|
|
4
4
|
import { getLockfilePath, readLockfile } from "@ucdjs/lockfile";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, s as runVersionPrompt, t as LOCAL_STORE_FLAGS } from "./_shared-
|
|
1
|
+
import { b as yellow, c as blankLine, g as keyValue, h as header, m as green, n as printHelp, p as formatDuration, u as cyan, v as output, y as red } from "./cli.mjs";
|
|
2
|
+
import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, s as runVersionPrompt, t as LOCAL_STORE_FLAGS } from "./_shared-DI9HUNS7.mjs";
|
|
3
3
|
import { tryOr } from "@ucdjs-internal/shared";
|
|
4
4
|
|
|
5
5
|
//#region src/cmd/store/init.ts
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { b as yellow, c as blankLine, d as dim, g as keyValue, h as header, l as bold, n as printHelp, t as parseRepoString, u as cyan, v as output } from "./cli.mjs";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import { findPipelineFiles, findRemotePipelineFiles, loadPipelinesFromPaths, loadRemotePipelines } from "@ucdjs/pipelines-loader";
|
|
5
|
+
|
|
6
|
+
//#region src/cmd/pipelines/list.ts
|
|
7
|
+
async function runListPipelines({ flags }) {
|
|
8
|
+
if (flags?.help || flags?.h) {
|
|
9
|
+
printHelp({
|
|
10
|
+
headline: "List Pipelines",
|
|
11
|
+
commandName: "ucd pipelines list",
|
|
12
|
+
usage: "[...flags]",
|
|
13
|
+
tables: { Flags: [
|
|
14
|
+
["--cwd <path>", "Search for pipeline files from this directory."],
|
|
15
|
+
["--github <owner/repo>", "Load pipelines from a GitHub repository."],
|
|
16
|
+
["--gitlab <owner/repo>", "Load pipelines from a GitLab repository."],
|
|
17
|
+
["--ref <ref>", "Git reference (branch/tag) for remote repositories."],
|
|
18
|
+
["--path <path>", "Subdirectory path within the repository."],
|
|
19
|
+
["--help (-h)", "See all available flags."]
|
|
20
|
+
] }
|
|
21
|
+
});
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const sources = [];
|
|
25
|
+
if (flags?.cwd) sources.push({
|
|
26
|
+
type: "local",
|
|
27
|
+
id: "local",
|
|
28
|
+
cwd: flags.cwd
|
|
29
|
+
});
|
|
30
|
+
if (flags?.github) {
|
|
31
|
+
const { owner, repo } = parseRepoString(flags.github);
|
|
32
|
+
sources.push({
|
|
33
|
+
type: "github",
|
|
34
|
+
id: `github-${owner}-${repo}`,
|
|
35
|
+
owner,
|
|
36
|
+
repo,
|
|
37
|
+
ref: flags.ref,
|
|
38
|
+
path: flags.path
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (flags?.gitlab) {
|
|
42
|
+
const { owner, repo } = parseRepoString(flags.gitlab);
|
|
43
|
+
sources.push({
|
|
44
|
+
type: "gitlab",
|
|
45
|
+
id: `gitlab-${owner}-${repo}`,
|
|
46
|
+
owner,
|
|
47
|
+
repo,
|
|
48
|
+
ref: flags.ref,
|
|
49
|
+
path: flags.path
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (sources.length === 0) sources.push({
|
|
53
|
+
type: "local",
|
|
54
|
+
id: "local",
|
|
55
|
+
cwd: process.cwd()
|
|
56
|
+
});
|
|
57
|
+
const allPipelines = [];
|
|
58
|
+
const allErrors = [];
|
|
59
|
+
for (const source of sources) try {
|
|
60
|
+
let result;
|
|
61
|
+
if (source.type === "local") result = await loadPipelinesFromPaths(await findPipelineFiles({ cwd: source.cwd }));
|
|
62
|
+
else result = await loadRemotePipelines(source, (await findRemotePipelineFiles(source)).files);
|
|
63
|
+
for (const file of result.files) allPipelines.push({
|
|
64
|
+
filePath: file.filePath,
|
|
65
|
+
exportNames: file.exportNames,
|
|
66
|
+
pipelines: file.pipelines.map((p) => ({
|
|
67
|
+
name: p.name ?? p.id,
|
|
68
|
+
id: p.id,
|
|
69
|
+
description: p.description,
|
|
70
|
+
routes: p.routes.length,
|
|
71
|
+
sources: p.inputs.length
|
|
72
|
+
})),
|
|
73
|
+
sourceId: source.id,
|
|
74
|
+
sourceType: source.type
|
|
75
|
+
});
|
|
76
|
+
for (const err of result.errors) allErrors.push({
|
|
77
|
+
filePath: err.filePath,
|
|
78
|
+
message: err.error.message,
|
|
79
|
+
sourceId: source.id,
|
|
80
|
+
sourceType: source.type
|
|
81
|
+
});
|
|
82
|
+
} catch (err) {
|
|
83
|
+
allErrors.push({
|
|
84
|
+
filePath: "",
|
|
85
|
+
message: err instanceof Error ? err.message : String(err),
|
|
86
|
+
sourceId: source.id,
|
|
87
|
+
sourceType: source.type
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
const totalPipelines = allPipelines.reduce((sum, f) => sum + f.pipelines.length, 0);
|
|
91
|
+
header("Pipelines");
|
|
92
|
+
keyValue("Files", String(allPipelines.length));
|
|
93
|
+
keyValue("Pipelines", String(totalPipelines));
|
|
94
|
+
keyValue("Sources", String(sources.length));
|
|
95
|
+
blankLine();
|
|
96
|
+
for (const source of sources) {
|
|
97
|
+
const sourcePipelines = allPipelines.filter((p) => p.sourceId === source.id);
|
|
98
|
+
if (sourcePipelines.length === 0) continue;
|
|
99
|
+
if (source.type === "local") output.info(`${cyan("local")} ${dim("·")} ${source.cwd}`);
|
|
100
|
+
else if (source.type === "github") {
|
|
101
|
+
const s = source;
|
|
102
|
+
output.info(`${cyan("github")} ${dim("·")} ${s.owner}/${s.repo}${s.ref ? `@${s.ref}` : ""}`);
|
|
103
|
+
} else if (source.type === "gitlab") {
|
|
104
|
+
const s = source;
|
|
105
|
+
output.info(`${cyan("gitlab")} ${dim("·")} ${s.owner}/${s.repo}${s.ref ? `@${s.ref}` : ""}`);
|
|
106
|
+
}
|
|
107
|
+
blankLine();
|
|
108
|
+
for (const f of sourcePipelines) {
|
|
109
|
+
if (source.type === "local") {
|
|
110
|
+
const rel = path.relative(source.cwd, f.filePath);
|
|
111
|
+
output.info(`${dim("•")} ${cyan(rel)}`);
|
|
112
|
+
} else output.info(`${dim("•")} ${cyan(f.filePath)}`);
|
|
113
|
+
if (f.exportNames.length === 0) {
|
|
114
|
+
output.info(` ${dim("(no pipeline exports found)")}`);
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const items = f.pipelines.map((p, i) => {
|
|
118
|
+
const displayName = p.name ?? f.exportNames[i] ?? "default";
|
|
119
|
+
const idLabel = p.id && p.id !== displayName ? ` ${dim(`[${p.id}]`)}` : "";
|
|
120
|
+
const routesCount = p.routes ?? 0;
|
|
121
|
+
const sourcesCount = p.sources ?? 0;
|
|
122
|
+
const details = ` ${dim("·")} ${routesCount} route(s) ${dim("·")} ${sourcesCount} source(s)`;
|
|
123
|
+
const description = p.description ? ` ${dim("·")} ${p.description}` : "";
|
|
124
|
+
return `${bold(displayName)}${idLabel}${details}${description}`;
|
|
125
|
+
});
|
|
126
|
+
items.forEach((item, index) => {
|
|
127
|
+
const prefix = index === items.length - 1 ? "└" : "├";
|
|
128
|
+
output.info(` ${dim(prefix)} ${item}`);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
blankLine();
|
|
132
|
+
}
|
|
133
|
+
if (allErrors.length > 0) {
|
|
134
|
+
header("Errors");
|
|
135
|
+
for (const e of allErrors) {
|
|
136
|
+
let sourceLabel = "";
|
|
137
|
+
if (e.sourceType === "local") sourceLabel = "[local] ";
|
|
138
|
+
else if (e.sourceType === "github") sourceLabel = "[github] ";
|
|
139
|
+
else if (e.sourceType === "gitlab") sourceLabel = "[gitlab] ";
|
|
140
|
+
output.error(` ${yellow("•")} ${sourceLabel}${e.filePath}: ${e.message}`);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
//#endregion
|
|
146
|
+
export { runListPipelines };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { d as dim, m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
2
|
import { createUCDClient } from "@ucdjs/client";
|
|
3
3
|
import { UCDJS_API_BASE_URL } from "@ucdjs/env";
|
|
4
4
|
import { createDebugger } from "@ucdjs-internal/shared";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, t as LOCAL_STORE_FLAGS } from "./_shared-
|
|
1
|
+
import { _ as list, b as yellow, c as blankLine, g as keyValue, h as header, m as green, n as printHelp, p as formatDuration, u as cyan, v as output, y as red } from "./cli.mjs";
|
|
2
|
+
import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, t as LOCAL_STORE_FLAGS } from "./_shared-DI9HUNS7.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/cmd/store/mirror.ts
|
|
5
5
|
async function runMirrorStore({ flags, versions }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as printHelp } from "./cli.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cmd/store/root.ts
|
|
4
4
|
const STORE_SUBCOMMANDS = [
|
|
@@ -37,7 +37,7 @@ async function runStoreRoot(subcommand, { flags }) {
|
|
|
37
37
|
}
|
|
38
38
|
const versions = flags._.slice(2);
|
|
39
39
|
if (subcommand === "init") {
|
|
40
|
-
const { runInitStore } = await import("./init-
|
|
40
|
+
const { runInitStore } = await import("./init-DCfH4KZf.mjs");
|
|
41
41
|
await runInitStore({
|
|
42
42
|
versions,
|
|
43
43
|
flags
|
|
@@ -45,7 +45,7 @@ async function runStoreRoot(subcommand, { flags }) {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
if (subcommand === "sync") {
|
|
48
|
-
const { runSyncStore } = await import("./sync-
|
|
48
|
+
const { runSyncStore } = await import("./sync-shQohnWg.mjs");
|
|
49
49
|
await runSyncStore({
|
|
50
50
|
flags,
|
|
51
51
|
versions
|
|
@@ -53,7 +53,7 @@ async function runStoreRoot(subcommand, { flags }) {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
if (subcommand === "mirror") {
|
|
56
|
-
const { runMirrorStore } = await import("./mirror-
|
|
56
|
+
const { runMirrorStore } = await import("./mirror-D4LONBbC.mjs");
|
|
57
57
|
await runMirrorStore({
|
|
58
58
|
flags,
|
|
59
59
|
versions
|
|
@@ -61,7 +61,7 @@ async function runStoreRoot(subcommand, { flags }) {
|
|
|
61
61
|
return;
|
|
62
62
|
}
|
|
63
63
|
if (subcommand === "verify") {
|
|
64
|
-
const { runVerifyStore } = await import("./verify-
|
|
64
|
+
const { runVerifyStore } = await import("./verify-BlwZ51gb.mjs");
|
|
65
65
|
await runVerifyStore({
|
|
66
66
|
flags,
|
|
67
67
|
versions
|
|
@@ -69,7 +69,7 @@ async function runStoreRoot(subcommand, { flags }) {
|
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
71
|
if (subcommand === "analyze") {
|
|
72
|
-
const { runAnalyzeStore } = await import("./analyze-
|
|
72
|
+
const { runAnalyzeStore } = await import("./analyze-D3QrGXc3.mjs");
|
|
73
73
|
await runAnalyzeStore({
|
|
74
74
|
flags,
|
|
75
75
|
versions
|
|
@@ -77,7 +77,7 @@ async function runStoreRoot(subcommand, { flags }) {
|
|
|
77
77
|
return;
|
|
78
78
|
}
|
|
79
79
|
if (subcommand === "status") {
|
|
80
|
-
const { runStatusStore } = await import("./status-
|
|
80
|
+
const { runStatusStore } = await import("./status-BILtMFrZ.mjs");
|
|
81
81
|
await runStatusStore({ flags });
|
|
82
82
|
return;
|
|
83
83
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as printHelp } from "./cli.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cmd/files/root.ts
|
|
4
4
|
const FILES_SUBCOMMANDS = [
|
|
@@ -28,7 +28,7 @@ async function runFilesRoot(subcommand, { flags }) {
|
|
|
28
28
|
return;
|
|
29
29
|
}
|
|
30
30
|
if (subcommand === "list") {
|
|
31
|
-
const { runFilesList } = await import("./list-
|
|
31
|
+
const { runFilesList } = await import("./list-yfguN-x6.mjs");
|
|
32
32
|
const pathParts = flags._.slice(2);
|
|
33
33
|
await runFilesList({
|
|
34
34
|
path: pathParts.length > 0 ? pathParts.join(" ") : "",
|
|
@@ -37,7 +37,7 @@ async function runFilesRoot(subcommand, { flags }) {
|
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
if (subcommand === "get") {
|
|
40
|
-
const { runFilesGet } = await import("./get-
|
|
40
|
+
const { runFilesGet } = await import("./get-ougMDNWx.mjs");
|
|
41
41
|
const pathParts = flags._.slice(2);
|
|
42
42
|
await runFilesGet({
|
|
43
43
|
path: pathParts.length > 0 ? pathParts.join(" ") : "",
|
|
@@ -46,7 +46,7 @@ async function runFilesRoot(subcommand, { flags }) {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
if (subcommand === "info") {
|
|
49
|
-
const { runFilesInfo } = await import("./info-
|
|
49
|
+
const { runFilesInfo } = await import("./info-BHbsKKim.mjs");
|
|
50
50
|
const pathParts = flags._.slice(2);
|
|
51
51
|
await runFilesInfo({
|
|
52
52
|
path: pathParts.length > 0 ? pathParts.join(" ") : "",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as printHelp } from "./cli.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cmd/lockfile/root.ts
|
|
4
4
|
const LOCKFILE_SUBCOMMANDS = [
|
|
@@ -32,12 +32,12 @@ async function runLockfileRoot(subcommand, { flags }) {
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
if (subcommand === "info") {
|
|
35
|
-
const { runLockfileInfo } = await import("./info-
|
|
35
|
+
const { runLockfileInfo } = await import("./info-_AmIqjiO.mjs");
|
|
36
36
|
await runLockfileInfo({ flags });
|
|
37
37
|
return;
|
|
38
38
|
}
|
|
39
39
|
if (subcommand === "hash") {
|
|
40
|
-
const { runLockfileHash } = await import("./hash-
|
|
40
|
+
const { runLockfileHash } = await import("./hash-CwyYmh-r.mjs");
|
|
41
41
|
const pathParts = flags._.slice(2);
|
|
42
42
|
await runLockfileHash({
|
|
43
43
|
filePath: pathParts.length > 0 ? pathParts.join(" ") : "",
|
|
@@ -46,7 +46,7 @@ async function runLockfileRoot(subcommand, { flags }) {
|
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
48
|
if (subcommand === "validate") {
|
|
49
|
-
const { runLockfileValidate } = await import("./validate-
|
|
49
|
+
const { runLockfileValidate } = await import("./validate-DNRIlkqr.mjs");
|
|
50
50
|
await runLockfileValidate({ flags });
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { n as printHelp } from "./cli.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/cmd/pipelines/root.ts
|
|
4
|
+
const PIPELINES_SUBCOMMANDS = [
|
|
5
|
+
"run",
|
|
6
|
+
"list",
|
|
7
|
+
"create"
|
|
8
|
+
];
|
|
9
|
+
function isValidSubcommand(subcommand) {
|
|
10
|
+
return PIPELINES_SUBCOMMANDS.includes(subcommand);
|
|
11
|
+
}
|
|
12
|
+
async function runPipelinesRoot(subcommand, { flags }) {
|
|
13
|
+
const isValidSub = isValidSubcommand(subcommand);
|
|
14
|
+
const requestsHelp = flags?.help || flags?.h;
|
|
15
|
+
if (!isValidSub || requestsHelp && !isValidSub) {
|
|
16
|
+
printHelp({
|
|
17
|
+
commandName: "ucd pipelines",
|
|
18
|
+
usage: "[command] [...flags]",
|
|
19
|
+
tables: {
|
|
20
|
+
Commands: [
|
|
21
|
+
["run", "Run a pipeline from the command line."],
|
|
22
|
+
["list", "List available pipelines."],
|
|
23
|
+
["create", "Create a new pipeline scaffold."]
|
|
24
|
+
],
|
|
25
|
+
Flags: [["--help (-h)", "See all available flags."]]
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (subcommand === "run") {
|
|
31
|
+
const { runPipelinesRun } = await import("./run-owMQvC61.mjs");
|
|
32
|
+
await runPipelinesRun({ flags });
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (subcommand === "list") {
|
|
36
|
+
const { runListPipelines } = await import("./list-BIMDvs6N.mjs");
|
|
37
|
+
await runListPipelines({ flags });
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
throw new Error(`Invalid subcommand: ${subcommand}`);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
//#endregion
|
|
44
|
+
export { runPipelinesRoot };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as printHelp } from "./cli.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/cmd/codegen/root.ts
|
|
4
4
|
const CODEGEN_SUBCOMMANDS = ["fields"];
|
|
@@ -20,7 +20,7 @@ async function runCodegenRoot(subcommand, { flags }) {
|
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
if (subcommand === "fields") {
|
|
23
|
-
const { runFieldCodegen } = await import("./fields-
|
|
23
|
+
const { runFieldCodegen } = await import("./fields-B79TLyh4.mjs");
|
|
24
24
|
await runFieldCodegen({
|
|
25
25
|
inputPath: flags._.slice(4)?.toString() ?? "",
|
|
26
26
|
flags
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { n as printHelp, t as parseRepoString, v as output } from "./cli.mjs";
|
|
2
|
+
import process from "node:process";
|
|
3
|
+
|
|
4
|
+
//#region src/cmd/pipelines/run.ts
|
|
5
|
+
async function runPipelinesRun({ flags }) {
|
|
6
|
+
if (flags?.help || flags?.h) {
|
|
7
|
+
printHelp({
|
|
8
|
+
headline: "Run Pipelines",
|
|
9
|
+
commandName: "ucd pipelines run",
|
|
10
|
+
usage: "[...pipelines] [...flags]",
|
|
11
|
+
tables: { Flags: [
|
|
12
|
+
["--ui", "Run the pipeline with a UI."],
|
|
13
|
+
["--port <number>", "Port for the UI server (default: 3030)."],
|
|
14
|
+
["--cwd <path>", "Search for pipeline files from this directory."],
|
|
15
|
+
["--github <owner/repo>", "Load pipelines from a GitHub repository."],
|
|
16
|
+
["--gitlab <owner/repo>", "Load pipelines from a GitLab repository."],
|
|
17
|
+
["--ref <ref>", "Git reference (branch/tag) for remote repositories."],
|
|
18
|
+
["--path <path>", "Subdirectory path within the repository."],
|
|
19
|
+
["--help (-h)", "See all available flags."]
|
|
20
|
+
] }
|
|
21
|
+
});
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const sources = [];
|
|
25
|
+
if (flags?.cwd) sources.push({
|
|
26
|
+
type: "local",
|
|
27
|
+
id: "local",
|
|
28
|
+
cwd: flags.cwd
|
|
29
|
+
});
|
|
30
|
+
if (flags?.github) {
|
|
31
|
+
const { owner, repo } = parseRepoString(flags.github);
|
|
32
|
+
sources.push({
|
|
33
|
+
type: "github",
|
|
34
|
+
id: `github-${owner}-${repo}`,
|
|
35
|
+
owner,
|
|
36
|
+
repo,
|
|
37
|
+
ref: flags.ref,
|
|
38
|
+
path: flags.path
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (flags?.gitlab) {
|
|
42
|
+
const { owner, repo } = parseRepoString(flags.gitlab);
|
|
43
|
+
sources.push({
|
|
44
|
+
type: "gitlab",
|
|
45
|
+
id: `gitlab-${owner}-${repo}`,
|
|
46
|
+
owner,
|
|
47
|
+
repo,
|
|
48
|
+
ref: flags.ref,
|
|
49
|
+
path: flags.path
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
if (sources.length === 0) sources.push({
|
|
53
|
+
type: "local",
|
|
54
|
+
id: "local",
|
|
55
|
+
cwd: process.cwd()
|
|
56
|
+
});
|
|
57
|
+
if (flags?.ui) {
|
|
58
|
+
const { startServer } = await import("@ucdjs/pipelines-server");
|
|
59
|
+
const port = flags?.port ?? 3030;
|
|
60
|
+
output.info(`Starting Pipeline UI on port ${port}...`);
|
|
61
|
+
for (const source of sources) if (source.type === "local") output.info(` [local] ${source.cwd}`);
|
|
62
|
+
else if (source.type === "github") output.info(` [github] ${source.owner}/${source.repo}${source.ref ? `@${source.ref}` : ""}`);
|
|
63
|
+
else if (source.type === "gitlab") output.info(` [gitlab] ${source.owner}/${source.repo}${source.ref ? `@${source.ref}` : ""}`);
|
|
64
|
+
await startServer({
|
|
65
|
+
port,
|
|
66
|
+
sources
|
|
67
|
+
});
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
output.info("Running pipelines...");
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
//#endregion
|
|
74
|
+
export { runPipelinesRun };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-
|
|
1
|
+
import { b as yellow, m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
|
+
import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-DI9HUNS7.mjs";
|
|
3
3
|
import { createUCDClient } from "@ucdjs/client";
|
|
4
4
|
import { UCDJS_API_BASE_URL } from "@ucdjs/env";
|
|
5
5
|
import { createDebugger } from "@ucdjs-internal/shared";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, t as LOCAL_STORE_FLAGS } from "./_shared-
|
|
1
|
+
import { _ as list, b as yellow, c as blankLine, g as keyValue, h as header, m as green, n as printHelp, p as formatDuration, u as cyan, v as output, y as red } from "./cli.mjs";
|
|
2
|
+
import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, t as LOCAL_STORE_FLAGS } from "./_shared-DI9HUNS7.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/cmd/store/sync.ts
|
|
5
5
|
async function runSyncStore({ flags, versions }) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as yellow, d as dim, l as bold, m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
2
|
import process from "node:process";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
import { resolve } from "node:path";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-
|
|
1
|
+
import { b as yellow, m as green, n as printHelp, v as output, y as red } from "./cli.mjs";
|
|
2
|
+
import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-DI9HUNS7.mjs";
|
|
3
3
|
import { createUCDClient } from "@ucdjs/client";
|
|
4
4
|
import { UCDJS_API_BASE_URL } from "@ucdjs/env";
|
|
5
5
|
import { createDebugger } from "@ucdjs-internal/shared";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ucdjs/cli",
|
|
3
|
-
"version": "0.3.1-beta.
|
|
3
|
+
"version": "0.3.1-beta.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Lucas Nørgård",
|
|
@@ -38,14 +38,16 @@
|
|
|
38
38
|
"@unicode-utils/core": "0.12.0-beta.19",
|
|
39
39
|
"farver": "0.4.2",
|
|
40
40
|
"yargs-parser": "22.0.0",
|
|
41
|
-
"@ucdjs-internal/shared": "0.1.1-beta.
|
|
42
|
-
"@ucdjs/client": "0.1.1-beta.
|
|
43
|
-
"@ucdjs/
|
|
44
|
-
"@ucdjs/lockfile": "0.1.1-beta.
|
|
45
|
-
"@ucdjs/
|
|
46
|
-
"@ucdjs/
|
|
47
|
-
"@ucdjs/
|
|
48
|
-
"@ucdjs/
|
|
41
|
+
"@ucdjs-internal/shared": "0.1.1-beta.5",
|
|
42
|
+
"@ucdjs/client": "0.1.1-beta.5",
|
|
43
|
+
"@ucdjs/fs-bridge": "0.1.1-beta.5",
|
|
44
|
+
"@ucdjs/lockfile": "0.1.1-beta.5",
|
|
45
|
+
"@ucdjs/pipelines-server": "0.0.1-beta.5",
|
|
46
|
+
"@ucdjs/env": "0.1.1-beta.6",
|
|
47
|
+
"@ucdjs/schema-gen": "0.2.3-beta.5",
|
|
48
|
+
"@ucdjs/schemas": "0.1.1-beta.5",
|
|
49
|
+
"@ucdjs/ucd-store": "1.0.1-beta.5",
|
|
50
|
+
"@ucdjs/pipelines-loader": "0.0.1-beta.5"
|
|
49
51
|
},
|
|
50
52
|
"devDependencies": {
|
|
51
53
|
"@luxass/eslint-config": "7.2.0",
|