@ucdjs/cli 0.3.1-beta.5 → 0.3.1-beta.7

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.
@@ -1,5 +1,5 @@
1
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";
2
+ import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-DhHjI4vY.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.5";
6
+ var version = "0.3.1-beta.7";
7
7
 
8
8
  //#endregion
9
9
  //#region src/output.ts
@@ -333,27 +333,27 @@ async function runCommand(cmd, flags) {
333
333
  console.log(` ${bgGreen(black(` ucd `))} ${green(`v${version ?? "x.y.z"}`)}`);
334
334
  break;
335
335
  case "codegen": {
336
- const { runCodegenRoot } = await import("./root-DZc4MAVa.mjs");
336
+ const { runCodegenRoot } = await import("./root-DSMkGzua.mjs");
337
337
  await runCodegenRoot(flags._[1]?.toString() ?? "", { flags });
338
338
  break;
339
339
  }
340
340
  case "store": {
341
- const { runStoreRoot } = await import("./root-BKcQ4oE0.mjs");
341
+ const { runStoreRoot } = await import("./root-SQ6EpjOS.mjs");
342
342
  await runStoreRoot(flags._[1]?.toString() ?? "", { flags });
343
343
  break;
344
344
  }
345
345
  case "files": {
346
- const { runFilesRoot } = await import("./root-C7yGLANV.mjs");
346
+ const { runFilesRoot } = await import("./root-DK4LMwjq.mjs");
347
347
  await runFilesRoot(flags._[1]?.toString() ?? "", { flags });
348
348
  break;
349
349
  }
350
350
  case "lockfile": {
351
- const { runLockfileRoot } = await import("./root-CUVELIkx.mjs");
351
+ const { runLockfileRoot } = await import("./root-Chwzg0O3.mjs");
352
352
  await runLockfileRoot(flags._[1]?.toString() ?? "", { flags });
353
353
  break;
354
354
  }
355
355
  case "pipelines": {
356
- const { runPipelinesRoot } = await import("./root-Cn7uU7-P.mjs");
356
+ const { runPipelinesRoot } = await import("./root-DMKVJUHe.mjs");
357
357
  await runPipelinesRoot(flags._[1]?.toString() ?? "", { flags });
358
358
  break;
359
359
  }
@@ -1,5 +1,5 @@
1
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";
2
+ import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, s as runVersionPrompt, t as LOCAL_STORE_FLAGS } from "./_shared-DhHjI4vY.mjs";
3
3
  import { tryOr } from "@ucdjs-internal/shared";
4
4
 
5
5
  //#region src/cmd/store/init.ts
@@ -0,0 +1,113 @@
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, loadPipelinesFromPaths } 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
+ let source;
25
+ let label;
26
+ if (flags?.github) {
27
+ const { owner, repo } = parseRepoString(flags.github);
28
+ const ref = flags.ref || "HEAD";
29
+ source = {
30
+ type: "github",
31
+ owner,
32
+ repo,
33
+ ref,
34
+ path: flags.path || void 0
35
+ };
36
+ label = `${owner}/${repo}${ref !== "HEAD" ? `@${ref}` : ""}`;
37
+ } else if (flags?.gitlab) {
38
+ const { owner, repo } = parseRepoString(flags.gitlab);
39
+ const ref = flags.ref || "HEAD";
40
+ source = {
41
+ type: "gitlab",
42
+ owner,
43
+ repo,
44
+ ref,
45
+ path: flags.path || void 0
46
+ };
47
+ label = `${owner}/${repo}${ref !== "HEAD" ? `@${ref}` : ""}`;
48
+ } else {
49
+ const cwd = flags.cwd || process.cwd();
50
+ source = {
51
+ type: "local",
52
+ cwd
53
+ };
54
+ label = cwd;
55
+ }
56
+ const pattern = flags.path ? `${flags.path}/**/*.ucd-pipeline.ts` : "**/*.ucd-pipeline.ts";
57
+ const result = await loadPipelinesFromPaths(await findPipelineFiles({
58
+ source,
59
+ patterns: pattern
60
+ }));
61
+ const allPipelines = result.files.map((file) => ({
62
+ filePath: file.filePath,
63
+ exportNames: file.exportNames,
64
+ pipelines: file.pipelines.map((p) => ({
65
+ name: p.name ?? p.id,
66
+ id: p.id,
67
+ description: p.description,
68
+ routes: p.routes.length,
69
+ sources: p.inputs.length
70
+ }))
71
+ }));
72
+ const totalPipelines = allPipelines.reduce((sum, f) => sum + f.pipelines.length, 0);
73
+ header("Pipelines");
74
+ keyValue("Files", String(allPipelines.length));
75
+ keyValue("Pipelines", String(totalPipelines));
76
+ blankLine();
77
+ output.info(`${cyan(source.type)} ${dim("·")} ${label}`);
78
+ blankLine();
79
+ for (const f of allPipelines) {
80
+ if (source.type === "local") {
81
+ const rel = path.relative(source.cwd, f.filePath);
82
+ output.info(`${dim("•")} ${cyan(rel)}`);
83
+ } else output.info(`${dim("•")} ${cyan(f.filePath)}`);
84
+ if (f.exportNames.length === 0) {
85
+ output.info(` ${dim("(no pipeline exports found)")}`);
86
+ continue;
87
+ }
88
+ const items = f.pipelines.map((p, i) => {
89
+ const displayName = p.name ?? f.exportNames[i] ?? "default";
90
+ const idLabel = p.id && p.id !== displayName ? ` ${dim(`[${p.id}]`)}` : "";
91
+ const routesCount = p.routes ?? 0;
92
+ const sourcesCount = p.sources ?? 0;
93
+ const details = ` ${dim("·")} ${routesCount} route(s) ${dim("·")} ${sourcesCount} source(s)`;
94
+ const description = p.description ? ` ${dim("·")} ${p.description}` : "";
95
+ return `${bold(displayName)}${idLabel}${details}${description}`;
96
+ });
97
+ items.forEach((item, index) => {
98
+ const prefix = index === items.length - 1 ? "└" : "├";
99
+ output.info(` ${dim(prefix)} ${item}`);
100
+ });
101
+ }
102
+ blankLine();
103
+ if (result.errors.length > 0) {
104
+ header("Errors");
105
+ for (const err of result.errors) {
106
+ const sourceLabel = source.type === "local" ? "[local] " : `[${source.type}] `;
107
+ output.error(` ${yellow("•")} ${sourceLabel}${err.filePath}: ${err.error.message}`);
108
+ }
109
+ }
110
+ }
111
+
112
+ //#endregion
113
+ export { runListPipelines };
@@ -1,5 +1,5 @@
1
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";
2
+ import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, t as LOCAL_STORE_FLAGS } from "./_shared-DhHjI4vY.mjs";
3
3
 
4
4
  //#region src/cmd/store/mirror.ts
5
5
  async function runMirrorStore({ flags, versions }) {
@@ -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-_AmIqjiO.mjs");
35
+ const { runLockfileInfo } = await import("./info-ClcpQTyw.mjs");
36
36
  await runLockfileInfo({ flags });
37
37
  return;
38
38
  }
39
39
  if (subcommand === "hash") {
40
- const { runLockfileHash } = await import("./hash-CwyYmh-r.mjs");
40
+ const { runLockfileHash } = await import("./hash-CI8TCvtN.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-DNRIlkqr.mjs");
49
+ const { runLockfileValidate } = await import("./validate-yKAPyzxw.mjs");
50
50
  await runLockfileValidate({ flags });
51
51
  return;
52
52
  }
@@ -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-yfguN-x6.mjs");
31
+ const { runFilesList } = await import("./list-XEA7_Mis.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-ougMDNWx.mjs");
40
+ const { runFilesGet } = await import("./get-Ca6s2YBy.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-BHbsKKim.mjs");
49
+ const { runFilesInfo } = await import("./info-CkhA4aep.mjs");
50
50
  const pathParts = flags._.slice(2);
51
51
  await runFilesInfo({
52
52
  path: pathParts.length > 0 ? pathParts.join(" ") : "",
@@ -28,12 +28,12 @@ async function runPipelinesRoot(subcommand, { flags }) {
28
28
  return;
29
29
  }
30
30
  if (subcommand === "run") {
31
- const { runPipelinesRun } = await import("./run-owMQvC61.mjs");
31
+ const { runPipelinesRun } = await import("./run-DBJYifsf.mjs");
32
32
  await runPipelinesRun({ flags });
33
33
  return;
34
34
  }
35
35
  if (subcommand === "list") {
36
- const { runListPipelines } = await import("./list-BIMDvs6N.mjs");
36
+ const { runListPipelines } = await import("./list-mx4THslV.mjs");
37
37
  await runListPipelines({ flags });
38
38
  return;
39
39
  }
@@ -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-DCfH4KZf.mjs");
40
+ const { runInitStore } = await import("./init-CeYIwAYY.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-shQohnWg.mjs");
48
+ const { runSyncStore } = await import("./sync-Dzb-Gy8n.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-D4LONBbC.mjs");
56
+ const { runMirrorStore } = await import("./mirror-BqzA6LAl.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-BlwZ51gb.mjs");
64
+ const { runVerifyStore } = await import("./verify-CduK8yIj.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-D3QrGXc3.mjs");
72
+ const { runAnalyzeStore } = await import("./analyze-CYNioqJm.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-BILtMFrZ.mjs");
80
+ const { runStatusStore } = await import("./status-DCcfDeIQ.mjs");
81
81
  await runStatusStore({ flags });
82
82
  return;
83
83
  }
@@ -0,0 +1,129 @@
1
+ import { n as printHelp, r as CLIError, t as parseRepoString, v as output } from "./cli.mjs";
2
+ import process from "node:process";
3
+ import { findPipelineFiles, loadPipelineFile } from "@ucdjs/pipelines-loader";
4
+ import { createPipelineExecutor } from "@ucdjs/pipelines-executor";
5
+
6
+ //#region src/cmd/pipelines/run.ts
7
+ async function runPipelinesRun({ flags }) {
8
+ if (flags?.help || flags?.h) {
9
+ printHelp({
10
+ headline: "Run Pipelines",
11
+ commandName: "ucd pipelines run",
12
+ usage: "[...pipelines] [...flags]",
13
+ tables: { Flags: [
14
+ ["--ui", "Run the pipeline with a UI."],
15
+ ["--port <number>", "Port for the UI server (default: 3030)."],
16
+ ["--cwd <path>", "Search for pipeline files from this directory."],
17
+ ["--github <owner/repo>", "Load pipelines from a GitHub repository."],
18
+ ["--gitlab <owner/repo>", "Load pipelines from a GitLab repository."],
19
+ ["--ref <ref>", "Git reference (branch/tag) for remote repositories."],
20
+ ["--path <path>", "Subdirectory path within the repository."],
21
+ ["--help (-h)", "See all available flags."]
22
+ ] }
23
+ });
24
+ return;
25
+ }
26
+ const sources = [];
27
+ const sourceLabels = [];
28
+ if (flags?.github) {
29
+ const { owner, repo } = parseRepoString(flags.github);
30
+ const ref = flags.ref || "HEAD";
31
+ const subPath = flags.path || void 0;
32
+ const sourceId = `github-${owner}-${repo}`;
33
+ sources.push({
34
+ type: "github",
35
+ id: sourceId,
36
+ owner,
37
+ repo,
38
+ ref,
39
+ path: subPath
40
+ });
41
+ sourceLabels.push(`[github] ${owner}/${repo}${ref !== "HEAD" ? `@${ref}` : ""}`);
42
+ }
43
+ if (flags?.gitlab) {
44
+ const { owner, repo } = parseRepoString(flags.gitlab);
45
+ const ref = flags.ref || "HEAD";
46
+ const subPath = flags.path || void 0;
47
+ const sourceId = `gitlab-${owner}-${repo}`;
48
+ sources.push({
49
+ type: "gitlab",
50
+ id: sourceId,
51
+ owner,
52
+ repo,
53
+ ref,
54
+ path: subPath
55
+ });
56
+ sourceLabels.push(`[gitlab] ${owner}/${repo}${ref !== "HEAD" ? `@${ref}` : ""}`);
57
+ }
58
+ if (sources.length === 0 || flags?.cwd) {
59
+ const cwd = flags?.cwd || process.cwd();
60
+ sources.push({
61
+ type: "local",
62
+ id: "local",
63
+ cwd
64
+ });
65
+ sourceLabels.push(`[local] ${cwd}`);
66
+ }
67
+ if (flags?.ui) {
68
+ const { startServer } = await import("@ucdjs/pipelines-server");
69
+ const port = flags?.port ?? 3030;
70
+ output.info(`Starting Pipeline UI on port ${port}...`);
71
+ for (const label of sourceLabels) output.info(` ${label}`);
72
+ await startServer({
73
+ port,
74
+ sources
75
+ });
76
+ return;
77
+ }
78
+ const selectors = (flags._ ?? []).slice(2).map(String).filter(Boolean);
79
+ output.info("Running pipelines...");
80
+ for (const label of sourceLabels) output.info(` ${label}`);
81
+ const pipelinePaths = [];
82
+ for (const source of sources) {
83
+ const files = await findPipelineFiles({
84
+ source: source.type === "local" ? {
85
+ type: "local",
86
+ cwd: source.cwd
87
+ } : {
88
+ type: source.type,
89
+ owner: source.owner,
90
+ repo: source.repo,
91
+ ref: source.ref,
92
+ path: source.path
93
+ },
94
+ patterns: source.type === "local" ? "**/*.ucd-pipeline.ts" : source.path ? `${source.path}/**/*.ucd-pipeline.ts` : "**/*.ucd-pipeline.ts"
95
+ });
96
+ pipelinePaths.push(...files);
97
+ }
98
+ const allPipelines = [];
99
+ const loadErrors = [];
100
+ for (const filePath of pipelinePaths) try {
101
+ const result = await loadPipelineFile(filePath);
102
+ allPipelines.push(...result.pipelines);
103
+ } catch (error) {
104
+ loadErrors.push(`${filePath}: ${error instanceof Error ? error.message : String(error)}`);
105
+ }
106
+ if (allPipelines.length === 0) throw new CLIError("No pipelines found to run.", { details: loadErrors.length > 0 ? loadErrors : void 0 });
107
+ const selectedPipelines = selectors.length > 0 ? allPipelines.filter((pipeline) => selectors.includes(pipeline.id) || !!pipeline.name && selectors.includes(pipeline.name)) : allPipelines;
108
+ if (selectors.length > 0) {
109
+ const matched = new Set(selectedPipelines.flatMap((p) => [p.id, p.name].filter(Boolean)));
110
+ const missing = selectors.filter((selector) => !matched.has(selector));
111
+ if (missing.length > 0) output.warning(`Unknown pipeline selector(s): ${missing.join(", ")}`);
112
+ }
113
+ if (selectedPipelines.length === 0) throw new CLIError("No pipelines matched the provided selectors.");
114
+ output.info(`Executing ${selectedPipelines.length} pipeline(s)...`);
115
+ const results = await createPipelineExecutor({}).run(selectedPipelines);
116
+ let failed = 0;
117
+ for (const result of results) {
118
+ if (result.status === "failed" || result.errors.length > 0) {
119
+ failed += 1;
120
+ output.error(`✗ ${result.id} failed (${result.errors.length} error(s))`);
121
+ continue;
122
+ }
123
+ output.success(`✓ ${result.id} completed in ${result.summary.durationMs}ms (${result.summary.totalOutputs} output(s))`);
124
+ }
125
+ if (failed > 0) throw new CLIError(`${failed} pipeline(s) failed.`);
126
+ }
127
+
128
+ //#endregion
129
+ export { runPipelinesRun };
@@ -1,5 +1,5 @@
1
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";
2
+ import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-DhHjI4vY.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
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";
2
+ import { i as assertLocalStore, o as createStoreFromFlags, r as SHARED_FLAGS, t as LOCAL_STORE_FLAGS } from "./_shared-DhHjI4vY.mjs";
3
3
 
4
4
  //#region src/cmd/store/sync.ts
5
5
  async function runSyncStore({ flags, versions }) {
@@ -1,5 +1,5 @@
1
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";
2
+ import { a as assertRemoteOrStoreDir, n as REMOTE_CAPABLE_FLAGS, o as createStoreFromFlags, r as SHARED_FLAGS } from "./_shared-DhHjI4vY.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.5",
3
+ "version": "0.3.1-beta.7",
4
4
  "type": "module",
5
5
  "author": {
6
6
  "name": "Lucas Nørgård",
@@ -30,29 +30,30 @@
30
30
  "dist"
31
31
  ],
32
32
  "engines": {
33
- "node": ">=22.18"
33
+ "node": ">=24.13"
34
34
  },
35
35
  "dependencies": {
36
- "@clack/prompts": "1.0.0",
36
+ "@clack/prompts": "1.0.1",
37
37
  "@luxass/utils": "2.7.3",
38
- "@unicode-utils/core": "0.12.0-beta.19",
38
+ "@unicode-utils/core": "0.12.0-beta.23",
39
39
  "farver": "0.4.2",
40
40
  "yargs-parser": "22.0.0",
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"
41
+ "@ucdjs-internal/shared": "0.1.1-beta.7",
42
+ "@ucdjs/client": "0.1.1-beta.7",
43
+ "@ucdjs/env": "0.1.1-beta.8",
44
+ "@ucdjs/fs-bridge": "0.1.1-beta.7",
45
+ "@ucdjs/lockfile": "0.1.1-beta.7",
46
+ "@ucdjs/pipelines-executor": "0.0.1-beta.7",
47
+ "@ucdjs/pipelines-loader": "0.0.1-beta.7",
48
+ "@ucdjs/pipelines-server": "0.0.1-beta.7",
49
+ "@ucdjs/schemas": "0.1.1-beta.7",
50
+ "@ucdjs/ucd-store": "1.0.1-beta.7",
51
+ "@ucdjs/schema-gen": "0.2.3-beta.7"
51
52
  },
52
53
  "devDependencies": {
53
- "@luxass/eslint-config": "7.2.0",
54
+ "@luxass/eslint-config": "7.2.1",
54
55
  "@types/yargs-parser": "21.0.3",
55
- "eslint": "10.0.0",
56
+ "eslint": "10.0.2",
56
57
  "publint": "0.3.17",
57
58
  "tsdown": "0.20.3",
58
59
  "typescript": "5.9.3",
@@ -1,146 +0,0 @@
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,74 +0,0 @@
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 };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes