@netnodeag/kraftwerk 0.8.0 → 0.9.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/cli/ui.js CHANGED
@@ -46,6 +46,6 @@ export async function runUi(cwd, opts) {
46
46
  const outputDir = opts.output ? path.resolve(cwd, opts.output) : project.outputDir;
47
47
  const port = Number(opts.port ?? "1981");
48
48
  await startInspector({ outputDir, staticDir, port, projectRoot: project.root });
49
- console.log(`${chalk.green("✔")} Inspector: ${chalk.cyan(`http://localhost:${port}`)} ` +
49
+ console.log(`${chalk.green("✔")} Kraftwerk UI: ${chalk.cyan(`http://localhost:${port}`)} ` +
50
50
  chalk.dim(`(output: ${outputDir})`));
51
51
  }
@@ -1,21 +1,17 @@
1
1
  import { promises as fs } from "node:fs";
2
2
  import path from "node:path";
3
3
  import { parse as parseYaml } from "yaml";
4
+ import { resolveProject } from "../config.js";
4
5
  import { getProjectRoot } from "./context.js";
5
6
  /**
6
- * Workflow discovery + parsing for the inspector. Mirrors the kraftwerk CLI
7
- * conventions (src/workflows/ or workflows/ under the project root, folder
8
- * mode with workflow.yml or single .yml files) but parses the YAML raw, so
9
- * even a workflow the framework would reject still renders — with its error.
7
+ * Workflow discovery + parsing for the inspector. Uses the same root
8
+ * resolution as the CLI (kraftwerk.yml `workflows:` key, else src/workflows/
9
+ * or workflows/) but parses the YAML raw, so even a workflow the framework
10
+ * would reject still renders — with its error.
10
11
  */
11
12
  async function workflowsRoot() {
12
- for (const candidate of ["src/workflows", "workflows"]) {
13
- const p = path.join(getProjectRoot(), candidate);
14
- const st = await fs.stat(p).catch(() => null);
15
- if (st?.isDirectory())
16
- return p;
17
- }
18
- return undefined;
13
+ const project = await resolveProject(getProjectRoot()).catch(() => null);
14
+ return project?.workflowsRoot;
19
15
  }
20
16
  function gateLabel(g) {
21
17
  if (g == null)