@topogram/cli 0.3.61 → 0.3.63
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/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -210,7 +210,7 @@ function printUsage(options = {}) {
|
|
|
210
210
|
console.log(" or: topogram widget check [path] [--projection <id>] [--widget <id>] [--json]");
|
|
211
211
|
console.log(" or: topogram widget behavior [path] [--projection <id>] [--widget <id>] [--json]");
|
|
212
212
|
console.log(" or: topogram generate [path] [--out <path>]");
|
|
213
|
-
console.log(" or: topogram
|
|
213
|
+
console.log(" or: topogram emit <target> [path] [--json|--write --out-dir <path>]");
|
|
214
214
|
console.log(" or: topogram query list [--json]");
|
|
215
215
|
console.log(" or: topogram query show <name> [--json]");
|
|
216
216
|
console.log(" or: topogram trust template [path]");
|
|
@@ -270,6 +270,8 @@ function printUsage(options = {}) {
|
|
|
270
270
|
console.log(" topogram query list");
|
|
271
271
|
console.log(" topogram query show widget-behavior");
|
|
272
272
|
console.log(" topogram query widget-behavior ./topogram --projection proj_web_surface --json");
|
|
273
|
+
console.log(" topogram emit ui-widget-contract --widget widget_data_grid --json");
|
|
274
|
+
console.log(" topogram emit widget-conformance-report ./topogram --projection proj_web_surface --json");
|
|
273
275
|
console.log(" topogram generator list");
|
|
274
276
|
console.log(" topogram generator show @topogram/generator-react-web");
|
|
275
277
|
console.log(" topogram generator check ./generator-package");
|
|
@@ -338,7 +340,8 @@ function printUsage(options = {}) {
|
|
|
338
340
|
console.log(" or: topogram template show <id> [--json] [--catalog <path-or-source>]");
|
|
339
341
|
console.log(" or: topogram import app <path> [--from <track[,track]>] [--write]");
|
|
340
342
|
console.log(" or: topogram validate <path>");
|
|
341
|
-
console.log(" or: node ./src/cli.js <path> [--json] [--validate] [--resolve] [--
|
|
343
|
+
console.log(" or: node ./src/cli.js <path> [--json] [--validate] [--resolve] [--workflow <name>] [--mode <id>] [--from <track[,track]>] [--adopt <selector>] [--refresh-adopted] [--shape <id>] [--capability <id>] [--widget <id>] [--projection <id>] [--entity <id>] [--journey <id>] [--surface <id>] [--task <id>] [--profile <id>] [--from-snapshot <path>] [--from-topogram <path>] [--write] [--out-dir <path>]");
|
|
344
|
+
console.log(" or: node ./src/cli.js emit <target> [path] [--json] [--write] [--out-dir <path>]");
|
|
342
345
|
console.log(" or: node ./src/cli.js import app <path> [--from <track[,track]>] [--write]");
|
|
343
346
|
console.log(" or: node ./src/cli.js import docs <path> [--write]");
|
|
344
347
|
console.log(" or: node ./src/cli.js generate journeys <path> [--write]");
|
|
@@ -411,11 +414,23 @@ function printNewHelp() {
|
|
|
411
414
|
function printGenerateHelp() {
|
|
412
415
|
console.log("Usage: topogram generate [path] [--out <path>]");
|
|
413
416
|
console.log(" or: topogram generate app [path] [--out <path>]");
|
|
414
|
-
console.log(" or: topogram generate [path] --generate <target> [--json]");
|
|
415
|
-
console.log(" or: topogram generate [path] --generate <target> --write [--out-dir <path>]");
|
|
416
417
|
console.log("");
|
|
417
418
|
console.log("Defaults: path is ./topogram and app generation writes ./app.");
|
|
418
|
-
console.log("
|
|
419
|
+
console.log("Use `topogram emit <target>` for contracts, reports, snapshots, migration plans, and other artifacts.");
|
|
420
|
+
console.log("");
|
|
421
|
+
console.log("Examples:");
|
|
422
|
+
console.log(" topogram generate");
|
|
423
|
+
console.log(" topogram generate ./topogram --out ./app");
|
|
424
|
+
console.log(" topogram generate app ./topogram --out ./app");
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function printEmitHelp() {
|
|
428
|
+
console.log("Usage: topogram emit <target> [path] [--json]");
|
|
429
|
+
console.log(" or: topogram emit <target> [path] --write [--out-dir <path>]");
|
|
430
|
+
console.log("");
|
|
431
|
+
console.log("Emits named contracts, reports, snapshots, migration plans, and other artifacts.");
|
|
432
|
+
console.log("");
|
|
433
|
+
console.log("Defaults: path is ./topogram. Emit prints to stdout unless --write is passed. --write writes ./artifacts unless --out-dir is supplied.");
|
|
419
434
|
console.log("");
|
|
420
435
|
console.log("Common artifact targets:");
|
|
421
436
|
console.log(" ui-widget-contract");
|
|
@@ -433,13 +448,12 @@ function printGenerateHelp() {
|
|
|
433
448
|
console.log(" --journey <id>");
|
|
434
449
|
console.log("");
|
|
435
450
|
console.log("Examples:");
|
|
436
|
-
console.log(" topogram
|
|
437
|
-
console.log(" topogram
|
|
438
|
-
console.log(" topogram
|
|
439
|
-
console.log(" topogram
|
|
440
|
-
console.log(" topogram
|
|
441
|
-
console.log(" topogram
|
|
442
|
-
console.log(" topogram generate ./topogram --generate ui-widget-contract --write --out-dir ./contracts");
|
|
451
|
+
console.log(" topogram emit ui-widget-contract --widget widget_data_grid --json");
|
|
452
|
+
console.log(" topogram emit widget-conformance-report ./topogram --projection proj_web_surface --json");
|
|
453
|
+
console.log(" topogram emit widget-behavior-report ./topogram --projection proj_web_surface --json");
|
|
454
|
+
console.log(" topogram emit db-schema-snapshot ./topogram --projection proj_db_postgres --json");
|
|
455
|
+
console.log(" topogram emit sql-migration ./topogram --projection proj_db_postgres --from-snapshot ./state/current.json");
|
|
456
|
+
console.log(" topogram emit ui-widget-contract --write --out-dir ./contracts");
|
|
443
457
|
}
|
|
444
458
|
|
|
445
459
|
function printWidgetHelp() {
|
|
@@ -869,6 +883,10 @@ function printCommandHelp(command) {
|
|
|
869
883
|
printGenerateHelp();
|
|
870
884
|
return true;
|
|
871
885
|
}
|
|
886
|
+
if (command === "emit") {
|
|
887
|
+
printEmitHelp();
|
|
888
|
+
return true;
|
|
889
|
+
}
|
|
872
890
|
if (command === "widget") {
|
|
873
891
|
printWidgetHelp();
|
|
874
892
|
return true;
|
|
@@ -8525,6 +8543,17 @@ function commandPath(index, fallback = "./topogram") {
|
|
|
8525
8543
|
return value && !value.startsWith("-") ? value : fallback;
|
|
8526
8544
|
}
|
|
8527
8545
|
|
|
8546
|
+
const removedGenerateIndex = args.indexOf("--generate");
|
|
8547
|
+
if (removedGenerateIndex >= 0) {
|
|
8548
|
+
const target = args[removedGenerateIndex + 1];
|
|
8549
|
+
const input = args[0] === "generate" ? commandPath(1) : commandPath(0);
|
|
8550
|
+
const replacement = target && !target.startsWith("-")
|
|
8551
|
+
? `topogram emit ${target} ${input}`
|
|
8552
|
+
: "topogram emit <target> <path>";
|
|
8553
|
+
console.error(`The artifact flag '--generate' was removed. Use '${replacement}' instead.`);
|
|
8554
|
+
process.exit(1);
|
|
8555
|
+
}
|
|
8556
|
+
|
|
8528
8557
|
function commandOperandFrom(index, fallback = ".") {
|
|
8529
8558
|
const valueFlags = new Set([
|
|
8530
8559
|
"--accept-current",
|
|
@@ -8594,12 +8623,16 @@ if (args[0] === "version" || args[0] === "--version") {
|
|
|
8594
8623
|
} else if (args[0] === "generator") {
|
|
8595
8624
|
printGeneratorHelp();
|
|
8596
8625
|
process.exit(args[1] ? 1 : 0);
|
|
8626
|
+
} else if (args[0] === "emit") {
|
|
8627
|
+
if (!args[1] || args[1].startsWith("-")) {
|
|
8628
|
+
printEmitHelp();
|
|
8629
|
+
process.exit(1);
|
|
8630
|
+
}
|
|
8631
|
+
commandArgs = { generateTarget: args[1], inputPath: commandPath(2), emitArtifact: true };
|
|
8597
8632
|
} else if (args[0] === "validate") {
|
|
8598
8633
|
commandArgs = { validate: true, inputPath: args[1] };
|
|
8599
8634
|
} else if (args[0] === "generate" && args[1] === "app") {
|
|
8600
8635
|
commandArgs = { generateTarget: "app-bundle", write: true, inputPath: commandPath(2), defaultOutDir: "./app" };
|
|
8601
|
-
} else if (args[0] === "generate" && args.indexOf("--generate") >= 0) {
|
|
8602
|
-
commandArgs = { inputPath: commandPath(1) };
|
|
8603
8636
|
} else if (args[0] === "generate" && args[1] !== "journeys") {
|
|
8604
8637
|
commandArgs = { generateTarget: "app-bundle", write: true, inputPath: commandPath(1), defaultOutDir: "./app" };
|
|
8605
8638
|
} else if (args[0] === "trust" && args[1] === "template") {
|
|
@@ -8837,10 +8870,9 @@ const shouldImportStatus = Boolean(commandArgs?.importStatus);
|
|
|
8837
8870
|
const shouldImportHistory = Boolean(commandArgs?.importHistory);
|
|
8838
8871
|
const shouldValidate = Boolean(commandArgs?.validate) || args.includes("--validate");
|
|
8839
8872
|
const shouldResolve = args.includes("--resolve");
|
|
8840
|
-
const
|
|
8841
|
-
const generateTarget = commandArgs?.generateTarget || (generateIndex >= 0 ? args[generateIndex + 1] : null);
|
|
8873
|
+
const generateTarget = commandArgs?.generateTarget || null;
|
|
8842
8874
|
if (RENAMED_GENERATE_TARGETS.has(generateTarget)) {
|
|
8843
|
-
console.error(`
|
|
8875
|
+
console.error(`Artifact target '${generateTarget}' was renamed to '${RENAMED_GENERATE_TARGETS.get(generateTarget)}'.`);
|
|
8844
8876
|
process.exit(1);
|
|
8845
8877
|
}
|
|
8846
8878
|
const workflowIndex = args.indexOf("--workflow");
|
|
@@ -352,17 +352,17 @@ infer_current_snapshot_from_live_tables() {
|
|
|
352
352
|
}
|
|
353
353
|
|
|
354
354
|
generate_desired_snapshot() {
|
|
355
|
-
"$TOPOGRAM_BIN"
|
|
355
|
+
"$TOPOGRAM_BIN" emit db-schema-snapshot "$INPUT_PATH" --projection "$PROJECTION_ID" > "$DESIRED_SNAPSHOT"
|
|
356
356
|
}
|
|
357
357
|
|
|
358
358
|
generate_migration_plan() {
|
|
359
359
|
local from_snapshot="$1"
|
|
360
|
-
"$TOPOGRAM_BIN"
|
|
360
|
+
"$TOPOGRAM_BIN" emit db-migration-plan "$INPUT_PATH" --projection "$PROJECTION_ID" --from-snapshot "$from_snapshot" > "$PLAN_JSON"
|
|
361
361
|
}
|
|
362
362
|
|
|
363
363
|
generate_sql_migration() {
|
|
364
364
|
local from_snapshot="$1"
|
|
365
|
-
"$TOPOGRAM_BIN" "$INPUT_PATH" --
|
|
365
|
+
"$TOPOGRAM_BIN" emit sql-migration "$INPUT_PATH" --projection "$PROJECTION_ID" --from-snapshot "$from_snapshot" > "$MIGRATION_SQL"
|
|
366
366
|
}
|
|
367
367
|
|
|
368
368
|
ensure_supported_plan() {
|
|
@@ -22,5 +22,5 @@ Configure the API base URL and optional auth token via scheme environment variab
|
|
|
22
22
|
From `engine/`:
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
topogram
|
|
25
|
+
topogram emit swiftui-app ./topogram --projection proj_ios_surface__swiftui --write --out-dir ./app/ios-swiftui
|
|
26
26
|
```
|
package/src/new-project.js
CHANGED
|
@@ -2046,6 +2046,8 @@ Or run self-contained local runtime verification:
|
|
|
2046
2046
|
|
|
2047
2047
|
Useful inspection:
|
|
2048
2048
|
npm run check:json
|
|
2049
|
+
topogram emit ui-widget-contract ./topogram --json
|
|
2050
|
+
topogram emit widget-conformance-report ./topogram --json
|
|
2049
2051
|
npm run doctor
|
|
2050
2052
|
npm run source:status
|
|
2051
2053
|
npm run source:status:remote
|
|
@@ -2123,6 +2125,7 @@ ${workflowCommands.join("\n")}
|
|
|
2123
2125
|
|
|
2124
2126
|
Edit \`topogram/\` and \`topogram.project.json\`, then regenerate with \`npm run generate\`.
|
|
2125
2127
|
Generated app code is written to \`app/\`.
|
|
2128
|
+
Use \`topogram emit <target>\` to inspect contracts, reports, snapshots, and other artifacts without regenerating the app.
|
|
2126
2129
|
${template.includesExecutableImplementation ? "\nThis template copied `implementation/` code. `topogram new` did not execute it; review `implementation/`, `topogram.template-policy.json`, and `.topogram-template-trust.json` before regenerating after edits.\n" : ""}
|
|
2127
2130
|
`;
|
|
2128
2131
|
fs.writeFileSync(path.join(projectRoot, "README.md"), readme, "utf8");
|