@archdoc/cli 0.0.0-stage → 0.1.1
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/LICENSE +21 -0
- package/dist/bin.d.ts +3 -0
- package/dist/bin.d.ts.map +1 -0
- package/dist/bin.js +6 -0
- package/dist/bin.js.map +1 -0
- package/dist/commands/check.d.ts +23 -0
- package/dist/commands/check.d.ts.map +1 -0
- package/dist/commands/check.js +58 -0
- package/dist/commands/check.js.map +1 -0
- package/dist/commands/code.d.ts +24 -0
- package/dist/commands/code.d.ts.map +1 -0
- package/dist/commands/code.js +92 -0
- package/dist/commands/code.js.map +1 -0
- package/dist/commands/context.d.ts +26 -0
- package/dist/commands/context.d.ts.map +1 -0
- package/dist/commands/context.js +117 -0
- package/dist/commands/context.js.map +1 -0
- package/dist/commands/diff.d.ts +17 -0
- package/dist/commands/diff.d.ts.map +1 -0
- package/dist/commands/diff.js +79 -0
- package/dist/commands/diff.js.map +1 -0
- package/dist/commands/federation.d.ts +20 -0
- package/dist/commands/federation.d.ts.map +1 -0
- package/dist/commands/federation.js +96 -0
- package/dist/commands/federation.js.map +1 -0
- package/dist/commands/init.d.ts +13 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +24 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/landscape.d.ts +14 -0
- package/dist/commands/landscape.d.ts.map +1 -0
- package/dist/commands/landscape.js +52 -0
- package/dist/commands/landscape.js.map +1 -0
- package/dist/commands/migrate.d.ts +8 -0
- package/dist/commands/migrate.d.ts.map +1 -0
- package/dist/commands/migrate.js +38 -0
- package/dist/commands/migrate.js.map +1 -0
- package/dist/commands/report.d.ts +16 -0
- package/dist/commands/report.d.ts.map +1 -0
- package/dist/commands/report.js +77 -0
- package/dist/commands/report.js.map +1 -0
- package/dist/commands/schema.d.ts +5 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +15 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/seal.d.ts +25 -0
- package/dist/commands/seal.d.ts.map +1 -0
- package/dist/commands/seal.js +64 -0
- package/dist/commands/seal.js.map +1 -0
- package/dist/commands/site.d.ts +14 -0
- package/dist/commands/site.d.ts.map +1 -0
- package/dist/commands/site.js +42 -0
- package/dist/commands/site.js.map +1 -0
- package/dist/commands/trace.d.ts +5 -0
- package/dist/commands/trace.d.ts.map +1 -0
- package/dist/commands/trace.js +39 -0
- package/dist/commands/trace.js.map +1 -0
- package/dist/commands/validate.d.ts +8 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +49 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/commands/view.d.ts +17 -0
- package/dist/commands/view.d.ts.map +1 -0
- package/dist/commands/view.js +50 -0
- package/dist/commands/view.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/io.d.ts +7 -0
- package/dist/io.d.ts.map +1 -0
- package/dist/io.js +6 -0
- package/dist/io.js.map +1 -0
- package/dist/landscape.d.ts +28 -0
- package/dist/landscape.d.ts.map +1 -0
- package/dist/landscape.js +34 -0
- package/dist/landscape.js.map +1 -0
- package/dist/model-path.d.ts +7 -0
- package/dist/model-path.d.ts.map +1 -0
- package/dist/model-path.js +17 -0
- package/dist/model-path.js.map +1 -0
- package/dist/program.d.ts +7 -0
- package/dist/program.d.ts.map +1 -0
- package/dist/program.js +197 -0
- package/dist/program.js.map +1 -0
- package/dist/server.d.ts +297 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +348 -0
- package/dist/server.js.map +1 -0
- package/package.json +38 -3
- package/web/assets/index-CDAgYSBW.js +210 -0
- package/web/assets/index-k7lSjazl.css +1 -0
- package/web/favicon.svg +1 -0
- package/web/index.html +14 -0
- package/README.md +0 -3
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
2
|
+
import { relative, resolve } from "node:path";
|
|
3
|
+
import { formatTraceList, loadTraces, readTraceSources, } from "@archdoc/core";
|
|
4
|
+
import { load } from "./code.js";
|
|
5
|
+
/** The repository's traces, or the files named. */
|
|
6
|
+
async function readTraces(files, options, io) {
|
|
7
|
+
const sources = files.length
|
|
8
|
+
? await Promise.all(files.map(async (f) => ({
|
|
9
|
+
path: relative(io.cwd, resolve(io.cwd, f)) || f,
|
|
10
|
+
text: await readFile(resolve(io.cwd, f), "utf8"),
|
|
11
|
+
})))
|
|
12
|
+
: await readTraceSources(options.model ?? ".", { cwd: io.cwd });
|
|
13
|
+
const { traces, diagnostics } = loadTraces(sources);
|
|
14
|
+
return { traces, problems: diagnostics };
|
|
15
|
+
}
|
|
16
|
+
export async function traceList(options, io) {
|
|
17
|
+
const model = await load(options, io);
|
|
18
|
+
if (!model)
|
|
19
|
+
return 2;
|
|
20
|
+
const { traces, problems } = await readTraces([], options, io);
|
|
21
|
+
for (const d of problems)
|
|
22
|
+
io.err(`${d.severity} ${d.code} ${d.message}`);
|
|
23
|
+
io.out(options.json
|
|
24
|
+
? JSON.stringify(traces.map((t) => ({
|
|
25
|
+
id: t.id,
|
|
26
|
+
title: t.spec.title,
|
|
27
|
+
expands: t.spec.expands,
|
|
28
|
+
file: t.file,
|
|
29
|
+
})), null, 2)
|
|
30
|
+
: formatTraceList(traces));
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
export async function readStdin() {
|
|
34
|
+
const chunks = [];
|
|
35
|
+
for await (const chunk of process.stdin)
|
|
36
|
+
chunks.push(chunk);
|
|
37
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=trace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trace.js","sourceRoot":"","sources":["../../src/commands/trace.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,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AC/D,KAAK,MAAM,CAAC,IAAI,QAAQ;QAAE,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzE,EAAE,CAAC,GAAG,CACJ,OAAO,CAAC,IAAI;QACV,CAAC,CAAC,IAAI,CAAC,SAAS,CACZ,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YACjB,EAAE,EAAE,CAAC,CAAC,EAAE;YACR,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK;YACnB,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO;YACvB,IAAI,EAAE,CAAC,CAAC,IAAI;SACb,CAAC,CAAC,EACH,IAAI,EACJ,CAAC,CACF;QACH,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAC5B,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS;IAC7B,MAAM,MAAM,GAAa,EAAE,CAAC;IAC5B,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,OAAO,CAAC,KAAK;QAAE,MAAM,CAAC,IAAI,CAAC,KAAe,CAAC,CAAC;IACtE,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Io } from "../io.js";
|
|
2
|
+
export interface ValidateOptions {
|
|
3
|
+
json?: boolean;
|
|
4
|
+
/** Treat warnings as failures. */
|
|
5
|
+
strict?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare function validate(target: string, options: ValidateOptions, io: Io): Promise<number>;
|
|
8
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AAEnC,MAAM,WAAW,eAAe;IAC9B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,kCAAkC;IAClC,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,QAAQ,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,EAAE,EAAE,EAAE,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAqDhG"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { formatDiagnostic, hasErrors, loadModel } from "@archdoc/core";
|
|
2
|
+
export async function validate(target, options, io) {
|
|
3
|
+
const model = await loadModel(target, { cwd: io.cwd });
|
|
4
|
+
const failed = hasErrors(model.diagnostics) ||
|
|
5
|
+
(options.strict === true && model.diagnostics.some((d) => d.severity === "warning"));
|
|
6
|
+
if (options.json) {
|
|
7
|
+
io.out(JSON.stringify({
|
|
8
|
+
ok: !failed,
|
|
9
|
+
namespace: model.namespace,
|
|
10
|
+
files: model.files,
|
|
11
|
+
counts: {
|
|
12
|
+
actors: model.actors.size,
|
|
13
|
+
elements: model.elements.size,
|
|
14
|
+
relationships: model.relationships.length,
|
|
15
|
+
journeys: model.journeys.size,
|
|
16
|
+
},
|
|
17
|
+
diagnostics: model.diagnostics,
|
|
18
|
+
}, null, 2));
|
|
19
|
+
return failed ? 1 : 0;
|
|
20
|
+
}
|
|
21
|
+
for (const d of model.diagnostics)
|
|
22
|
+
io.err(formatDiagnostic(d));
|
|
23
|
+
const count = (s) => model.diagnostics.filter((d) => d.severity === s).length;
|
|
24
|
+
const errors = count("error");
|
|
25
|
+
const warnings = count("warning");
|
|
26
|
+
const problems = [
|
|
27
|
+
errors ? `${errors} error${errors === 1 ? "" : "s"}` : "",
|
|
28
|
+
warnings ? `${warnings} warning${warnings === 1 ? "" : "s"}` : "",
|
|
29
|
+
]
|
|
30
|
+
.filter(Boolean)
|
|
31
|
+
.join(", ");
|
|
32
|
+
if (failed) {
|
|
33
|
+
io.err(`\n✗ ${problems || "failed"}`);
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
const summary = [
|
|
37
|
+
plural(model.actors.size, "actor"),
|
|
38
|
+
plural(model.elements.size, "element"),
|
|
39
|
+
plural(model.relationships.length, "relationship"),
|
|
40
|
+
plural(model.journeys.size, "journey"),
|
|
41
|
+
].join(", ");
|
|
42
|
+
io.out(`${model.diagnostics.length ? "\n" : ""}✓ ${model.namespace}: ${summary} in ${plural(model.files.length, "file")}${problems ? ` (${problems})` : ""}`);
|
|
43
|
+
}
|
|
44
|
+
return failed ? 1 : 0;
|
|
45
|
+
}
|
|
46
|
+
function plural(n, word) {
|
|
47
|
+
return `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AASvE,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,MAAc,EAAE,OAAwB,EAAE,EAAM;IAC7E,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC;IACvD,MAAM,MAAM,GACV,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC;QAC5B,CAAC,OAAO,CAAC,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,CAAC,CAAC;IAEvF,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,EAAE,CAAC,GAAG,CACJ,IAAI,CAAC,SAAS,CACZ;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|
+
/** Show changes since this ref. */
|
|
6
|
+
base?: string;
|
|
7
|
+
/** Show the composed landscape. */
|
|
8
|
+
landscape?: boolean;
|
|
9
|
+
port?: string;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Starts the explorer. Resolves once the server is listening; it runs until the process ends. */
|
|
13
|
+
export declare function view(target: string, options: ViewOptions, io: Io): Promise<{
|
|
14
|
+
code: number;
|
|
15
|
+
server?: ViewServer;
|
|
16
|
+
}>;
|
|
17
|
+
//# sourceMappingURL=view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"view.d.ts","sourceRoot":"","sources":["../../src/commands/view.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,UAAU,CAAC;AACnC,OAAO,EAAmB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAEhE,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,mCAAmC;IACnC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,kGAAkG;AAClG,wBAAsB,IAAI,CACxB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,EAAE,GACL,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,UAAU,CAAA;CAAE,CAAC,CAuChD"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { spawn } from "node:child_process";
|
|
2
|
+
import { relative } from "node:path";
|
|
3
|
+
import { startViewServer } from "../server.js";
|
|
4
|
+
/** Starts the explorer. Resolves once the server is listening; it runs until the process ends. */
|
|
5
|
+
export async function view(target, options, io) {
|
|
6
|
+
const port = options.port === undefined ? 0 : Number(options.port);
|
|
7
|
+
if (!Number.isInteger(port) || port < 0 || port > 65535) {
|
|
8
|
+
io.err(`--port must be a number from 0 to 65535 (0 picks a free port).`);
|
|
9
|
+
return { code: 1 };
|
|
10
|
+
}
|
|
11
|
+
let server;
|
|
12
|
+
try {
|
|
13
|
+
server = await startViewServer({
|
|
14
|
+
target,
|
|
15
|
+
cwd: io.cwd,
|
|
16
|
+
port,
|
|
17
|
+
watch: options.watch,
|
|
18
|
+
base: options.base,
|
|
19
|
+
landscape: options.landscape,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
catch (err) {
|
|
23
|
+
io.err(`Couldn't start the explorer: ${err instanceof Error ? err.message : String(err)}`);
|
|
24
|
+
return { code: 1 };
|
|
25
|
+
}
|
|
26
|
+
if (!server.source) {
|
|
27
|
+
io.err(`No ArchDoc model at ${target}. Expected .archdoc/archdoc.yaml. Run archdoc init to start one.`);
|
|
28
|
+
await server.close();
|
|
29
|
+
return { code: 1 };
|
|
30
|
+
}
|
|
31
|
+
const what = relative(io.cwd, server.source) || ".";
|
|
32
|
+
io.out(`ArchDoc explorer: ${server.url}${options.landscape ? " (the landscape)" : ""}${options.base ? ` (showing changes since ${options.base})` : ""}`);
|
|
33
|
+
io.out(options.watch
|
|
34
|
+
? `Watching ${what} for changes. Press Ctrl+C to stop.`
|
|
35
|
+
: `Serving ${what}. Press Ctrl+C to stop.`);
|
|
36
|
+
if (options.open)
|
|
37
|
+
openBrowser(server.url);
|
|
38
|
+
return { code: 0, server };
|
|
39
|
+
}
|
|
40
|
+
function openBrowser(url) {
|
|
41
|
+
const [cmd, args] = process.platform === "darwin"
|
|
42
|
+
? ["open", [url]]
|
|
43
|
+
: process.platform === "win32"
|
|
44
|
+
? ["cmd", ["/c", "start", "", url]]
|
|
45
|
+
: ["xdg-open", [url]];
|
|
46
|
+
spawn(cmd, args, { stdio: "ignore", detached: true })
|
|
47
|
+
.on("error", () => { })
|
|
48
|
+
.unref();
|
|
49
|
+
}
|
|
50
|
+
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C,CAAC;IAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;SAClD,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC,CAAC;SACrB,KAAK,EAAE,CAAC;AACb,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,SAAS,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,eAAe,EAA2C,MAAM,aAAa,CAAC"}
|
package/dist/io.d.ts
ADDED
package/dist/io.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.d.ts","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,EAAE;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,eAAO,MAAM,SAAS,EAAE,EAIvB,CAAC"}
|
package/dist/io.js
ADDED
package/dist/io.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"io.js","sourceRoot":"","sources":["../src/io.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,SAAS,GAAO;IAC3B,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;IAClB,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;IAChD,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,IAAI,IAAI,CAAC;CACjD,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { type ComposedLandscape, type LoadedModel } from "@archdoc/core";
|
|
2
|
+
/** What the explorer loads for a landscape: the composed model, as one source. */
|
|
3
|
+
export interface LandscapePayload {
|
|
4
|
+
root: string;
|
|
5
|
+
sources: {
|
|
6
|
+
path: string;
|
|
7
|
+
text: string;
|
|
8
|
+
}[];
|
|
9
|
+
watch: boolean;
|
|
10
|
+
files: string[];
|
|
11
|
+
repo: Record<string, unknown>;
|
|
12
|
+
landscape: {
|
|
13
|
+
namespace: string;
|
|
14
|
+
name?: string | undefined;
|
|
15
|
+
repos: ComposedLandscape["repos"];
|
|
16
|
+
domains: ComposedLandscape["domains"];
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Loads a landscape repo's model and composes it with the models it imports.
|
|
21
|
+
* Fails when the imports aren't synced, since then there's nothing to compose.
|
|
22
|
+
*/
|
|
23
|
+
export declare function loadLandscape(target: string, cwd: string): Promise<{
|
|
24
|
+
model: LoadedModel;
|
|
25
|
+
composed: ComposedLandscape;
|
|
26
|
+
}>;
|
|
27
|
+
export declare function landscapePayload(model: LoadedModel, composed: ComposedLandscape, watch: boolean): Promise<LandscapePayload>;
|
|
28
|
+
//# sourceMappingURL=landscape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landscape.d.ts","sourceRoot":"","sources":["../src/landscape.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EAEtB,KAAK,WAAW,EAGjB,MAAM,eAAe,CAAC;AAEvB,kFAAkF;AAClF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC1C,KAAK,EAAE,OAAO,CAAC;IACf,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC9B,SAAS,EAAE;QACT,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAC1B,KAAK,EAAE,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAClC,OAAO,EAAE,iBAAiB,CAAC,SAAS,CAAC,CAAC;KACvC,CAAC;CACH;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,GACV,OAAO,CAAC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,iBAAiB,CAAA;CAAE,CAAC,CAc9D;AAED,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,WAAW,EAClB,QAAQ,EAAE,iBAAiB,EAC3B,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,gBAAgB,CAAC,CAc3B"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { composeLandscape, loadModel, repoInfo, } from "@archdoc/core";
|
|
2
|
+
/**
|
|
3
|
+
* Loads a landscape repo's model and composes it with the models it imports.
|
|
4
|
+
* Fails when the imports aren't synced, since then there's nothing to compose.
|
|
5
|
+
*/
|
|
6
|
+
export async function loadLandscape(target, cwd) {
|
|
7
|
+
const model = await loadModel(target, { cwd });
|
|
8
|
+
if (model.diagnostics.some((d) => d.code === "model/not-found")) {
|
|
9
|
+
throw new Error(model.diagnostics[0]?.message ?? "No ArchDoc model found.");
|
|
10
|
+
}
|
|
11
|
+
if (Object.keys(model.imports).length === 0) {
|
|
12
|
+
throw new Error("This model imports no other repos, so there's no landscape to compose. List them under imports.");
|
|
13
|
+
}
|
|
14
|
+
if (!model.imported?.size) {
|
|
15
|
+
throw new Error("The landscape's imports aren't synced. Run archdoc sync first.");
|
|
16
|
+
}
|
|
17
|
+
return { model, composed: composeLandscape(model) };
|
|
18
|
+
}
|
|
19
|
+
export async function landscapePayload(model, composed, watch) {
|
|
20
|
+
return {
|
|
21
|
+
root: composed.root,
|
|
22
|
+
sources: composed.sources,
|
|
23
|
+
watch,
|
|
24
|
+
files: [],
|
|
25
|
+
repo: { ...(await repoInfo(model.baseDir)) },
|
|
26
|
+
landscape: {
|
|
27
|
+
namespace: model.namespace,
|
|
28
|
+
name: model.name,
|
|
29
|
+
repos: composed.repos,
|
|
30
|
+
domains: composed.domains,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=landscape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"landscape.js","sourceRoot":"","sources":["../src/landscape.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,gBAAgB,EAEhB,SAAS,EACT,QAAQ,GACT,MAAM,eAAe,CAAC;AAiBvB;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,GAAW;IAEX,MAAM,KAAK,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IAC/C,IAAI,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,iBAAiB,CAAC,EAAE,CAAC;QAChE,MAAM,IAAI,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,yBAAyB,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAC;IACpF,CAAC;IACD,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,KAAkB,EAClB,QAA2B,EAC3B,KAAc;IAEd,OAAO;QACL,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,KAAK;QACL,KAAK,EAAE,EAAE;QACT,IAAI,EAAE,EAAE,GAAG,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,EAAE;QAC5C,SAAS,EAAE;YACT,SAAS,EAAE,KAAK,CAAC,SAAS;YAC1B,IAAI,EAAE,KAAK,CAAC,IAAI;YAChB,KAAK,EAAE,QAAQ,CAAC,KAAK;YACrB,OAAO,EAAE,QAAQ,CAAC,OAAO;SAC1B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a base given on the command line names a model on disk (a model
|
|
3
|
+
* file, or a directory with one) rather than a git ref, so two versions of
|
|
4
|
+
* a model can be compared without a repository: `archdoc diff a.yaml b.yaml`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isModelPath(cwd: string, arg: string): boolean;
|
|
7
|
+
//# sourceMappingURL=model-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-path.d.ts","sourceRoot":"","sources":["../src/model-path.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAM7D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { existsSync, statSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
/**
|
|
4
|
+
* Whether a base given on the command line names a model on disk (a model
|
|
5
|
+
* file, or a directory with one) rather than a git ref, so two versions of
|
|
6
|
+
* a model can be compared without a repository: `archdoc diff a.yaml b.yaml`.
|
|
7
|
+
*/
|
|
8
|
+
export function isModelPath(cwd, arg) {
|
|
9
|
+
const path = resolve(cwd, arg);
|
|
10
|
+
if (!existsSync(path))
|
|
11
|
+
return false;
|
|
12
|
+
const stat = statSync(path);
|
|
13
|
+
if (stat.isFile())
|
|
14
|
+
return /\.(ya?ml|json)$/i.test(path);
|
|
15
|
+
return stat.isDirectory() && existsSync(resolve(path, ".archdoc"));
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=model-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-path.js","sourceRoot":"","sources":["../src/model-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,GAAW,EAAE,GAAW;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;IAC/B,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,KAAK,CAAC;IACpC,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC5B,IAAI,IAAI,CAAC,MAAM,EAAE;QAAE,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACxD,OAAO,IAAI,CAAC,WAAW,EAAE,IAAI,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Command } from "commander";
|
|
2
|
+
import { type Io } from "./io.js";
|
|
3
|
+
/** Builds the `archdoc` program. Each action sets `exitCode` instead of exiting. */
|
|
4
|
+
export declare function createProgram(io?: Io): Command & {
|
|
5
|
+
exitCode?: number;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=program.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.d.ts","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAgBpC,OAAO,EAAE,KAAK,EAAE,EAAa,MAAM,SAAS,CAAC;AAM7C,oFAAoF;AACpF,wBAAgB,aAAa,CAAC,EAAE,GAAE,EAAc,GAAG,OAAO,GAAG;IAAE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAuTjF"}
|
package/dist/program.js
ADDED
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { SPEC_VERSION } from "@archdoc/spec";
|
|
3
|
+
import { Command } from "commander";
|
|
4
|
+
import { check } from "./commands/check.js";
|
|
5
|
+
import { map, show } from "./commands/code.js";
|
|
6
|
+
import { context, evalCommand } from "./commands/context.js";
|
|
7
|
+
import { diff } from "./commands/diff.js";
|
|
8
|
+
import { publish, sync } from "./commands/federation.js";
|
|
9
|
+
import { init } from "./commands/init.js";
|
|
10
|
+
import { landscapeBuild } from "./commands/landscape.js";
|
|
11
|
+
import { migrate } from "./commands/migrate.js";
|
|
12
|
+
import { report } from "./commands/report.js";
|
|
13
|
+
import { schema } from "./commands/schema.js";
|
|
14
|
+
import { seal } from "./commands/seal.js";
|
|
15
|
+
import { site } from "./commands/site.js";
|
|
16
|
+
import { traceList } from "./commands/trace.js";
|
|
17
|
+
import { validate } from "./commands/validate.js";
|
|
18
|
+
import { view } from "./commands/view.js";
|
|
19
|
+
import { processIo } from "./io.js";
|
|
20
|
+
const { version } = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
|
|
21
|
+
/** Builds the `archdoc` program. Each action sets `exitCode` instead of exiting. */
|
|
22
|
+
export function createProgram(io = processIo) {
|
|
23
|
+
const program = new Command("archdoc");
|
|
24
|
+
const run = (code) => code.then((c) => {
|
|
25
|
+
program.exitCode = c;
|
|
26
|
+
});
|
|
27
|
+
program
|
|
28
|
+
.description("An architecture control plane for AI-assisted development.")
|
|
29
|
+
.version(`${version} (spec ${SPEC_VERSION})`)
|
|
30
|
+
.configureOutput({
|
|
31
|
+
writeOut: (s) => io.out(s.trimEnd()),
|
|
32
|
+
writeErr: (s) => io.err(s.trimEnd()),
|
|
33
|
+
});
|
|
34
|
+
program
|
|
35
|
+
.command("init")
|
|
36
|
+
.description("Start a model from what the repository declares: packages, compose services, imports, and schema files, all marked inferred")
|
|
37
|
+
.argument("[path]", "the repository", ".")
|
|
38
|
+
.option("--name <namespace>", "the model's namespace (default: the root package or directory)")
|
|
39
|
+
.option("--dry-run", "print the model without writing it")
|
|
40
|
+
.option("--json", "print the result as JSON")
|
|
41
|
+
.action((path, opts) => run(init(path, opts, io)));
|
|
42
|
+
program
|
|
43
|
+
.command("validate")
|
|
44
|
+
.description("Check the model: schema, references, and journeys")
|
|
45
|
+
.argument("[path]", "repository, .archdoc directory, or model file", ".")
|
|
46
|
+
.option("--json", "print the result as JSON")
|
|
47
|
+
.option("--strict", "fail on warnings too")
|
|
48
|
+
.action((path, opts) => run(validate(path, opts, io)));
|
|
49
|
+
program
|
|
50
|
+
.command("view")
|
|
51
|
+
.description("Open the explorer in your browser")
|
|
52
|
+
.argument("[path]", "repository, .archdoc directory, or model file", ".")
|
|
53
|
+
.option("-w, --watch", "reload the explorer when model files change")
|
|
54
|
+
.option("-b, --base <ref>", "show what changed in the model since this branch or commit, or since another model file")
|
|
55
|
+
.option("-l, --landscape", "show the landscape: this model composed with every model it imports")
|
|
56
|
+
.option("-p, --port <port>", "port to listen on (default: a free port)")
|
|
57
|
+
.option("--open", "open the explorer in your default browser")
|
|
58
|
+
.action(async (path, opts) => {
|
|
59
|
+
const result = await view(path, opts, io);
|
|
60
|
+
program.exitCode = result.code;
|
|
61
|
+
});
|
|
62
|
+
program
|
|
63
|
+
.command("site")
|
|
64
|
+
.description("Write the explorer as a static site; with --base, opened on a change, for a pull request to link to")
|
|
65
|
+
.argument("[path]", "repository, .archdoc directory, or model file", ".")
|
|
66
|
+
.option("-o, --out <dir>", "directory to write the site to", "site")
|
|
67
|
+
.option("-b, --base <ref>", "show the change since this branch or commit")
|
|
68
|
+
.action((path, opts) => run(site(path, opts, io)));
|
|
69
|
+
program
|
|
70
|
+
.command("context")
|
|
71
|
+
.description("Where to start: files and symbols to open first, other code that does the same job, data, rules, journeys, tests, owners, and who uses it. With --error, where an error showed up; with nothing, an overview")
|
|
72
|
+
.argument("[words-or-paths...]", "the task in a few words, files you plan to change, or both")
|
|
73
|
+
.option("-e, --error <file>", "an error, log, or stack trace to place, from a file or - (stdin)")
|
|
74
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
75
|
+
.option("-f, --format <format>", "text or json", "text")
|
|
76
|
+
.option("--json", "print the result as JSON")
|
|
77
|
+
.action((args, opts) => run(context(args, opts, io)));
|
|
78
|
+
program
|
|
79
|
+
.command("eval", { hidden: true })
|
|
80
|
+
.description("Replay recent commits through archdoc context: how many of the files each changed the brief pointed at")
|
|
81
|
+
.argument("[ref]", "the branch or commit whose history to replay", "HEAD")
|
|
82
|
+
.option("-n, --commits <n>", "how many non-merge commits to replay", "50")
|
|
83
|
+
.option("--min-recall <ratio>", "exit 1 when recall is below this, from 0 to 1")
|
|
84
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
85
|
+
.option("-f, --format <format>", "text or json", "text")
|
|
86
|
+
.option("-v, --verbose", "list the changed files each brief missed")
|
|
87
|
+
.action((ref, opts) => run(evalCommand(ref, opts, io)));
|
|
88
|
+
program
|
|
89
|
+
.command("show")
|
|
90
|
+
.description("One thing in the model: an element, actor, journey, data entry, Entry.field (its lineage), trace, or sealed fact")
|
|
91
|
+
.argument("<id>", "such as payments.charges, Refund.amount_cents, or step:refund#2")
|
|
92
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
93
|
+
.option("--code", "print the code snippets an element points at")
|
|
94
|
+
.option("-s, --sample <file>", "run a journey on JSON or YAML records that exist when it starts, by data entry")
|
|
95
|
+
.action((id, opts) => run(show(id, opts, io)));
|
|
96
|
+
program
|
|
97
|
+
.command("map")
|
|
98
|
+
.description("How the repository's files map onto the model: coverage, unmapped files, stale paths")
|
|
99
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
100
|
+
.option("--unmapped", "list every unmapped file")
|
|
101
|
+
.option("--json", "print the result as JSON")
|
|
102
|
+
.action((opts) => run(map(opts, io)));
|
|
103
|
+
program
|
|
104
|
+
.command("mcp")
|
|
105
|
+
.description("Start the MCP server on stdio, for coding agents")
|
|
106
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
107
|
+
.action(async (opts) => {
|
|
108
|
+
const { runStdio } = await import("@archdoc/mcp");
|
|
109
|
+
await runStdio({ model: opts.model, cwd: io.cwd, version });
|
|
110
|
+
});
|
|
111
|
+
const trace = program
|
|
112
|
+
.command("trace")
|
|
113
|
+
.description("Traces: the path a failing request took, attached to the journey step where the error showed up (.archdoc/traces/)");
|
|
114
|
+
trace
|
|
115
|
+
.command("list")
|
|
116
|
+
.description("List the traces in .archdoc/traces/")
|
|
117
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
118
|
+
.option("--json", "print the result as JSON")
|
|
119
|
+
.action((opts) => run(traceList(opts, io)));
|
|
120
|
+
program
|
|
121
|
+
.command("check")
|
|
122
|
+
.description("What's wrong or stale: model problems, undeclared dependencies, rules, stale paths, traces, and sealed facts whose code changed. With --base, what the change does")
|
|
123
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
124
|
+
.option("-b, --base <ref>", "mark what changed since this ref introduced, and fail only on that")
|
|
125
|
+
.option("-f, --format <format>", "text, markdown, json, or github (workflow annotations on the diff)", "text")
|
|
126
|
+
.option("--fail-on <severity>", "error, warning, or never", "error")
|
|
127
|
+
.option("--no-code", "check the model only, without analyzing code")
|
|
128
|
+
.option("--all", "list every finding, not only the change's (or the first few)")
|
|
129
|
+
.option("--seals", "only facts whose sealed code changed, in full; exits 1 while there are any")
|
|
130
|
+
.action((opts) => run(check(opts, io)));
|
|
131
|
+
program
|
|
132
|
+
.command("seal")
|
|
133
|
+
.description("Record that the model still describes the code these facts point at (archdoc.sum); without facts, seal the new ones")
|
|
134
|
+
.argument("[facts...]", "facts to seal, such as element:toolchain.cli, or an element ID")
|
|
135
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
136
|
+
.option("--all", "seal every fact, changed or not (to start, or after checking them all)")
|
|
137
|
+
.option("--by <who>", "who checked, such as agent:claude-code")
|
|
138
|
+
.option("--dry-run", "say what would be sealed without writing archdoc.sum")
|
|
139
|
+
.action((facts, opts) => run(seal(facts, opts, io)));
|
|
140
|
+
program
|
|
141
|
+
.command("report")
|
|
142
|
+
.description("The architectural impact of a change, as markdown for a pull request comment")
|
|
143
|
+
.requiredOption("-b, --base <ref>", "the branch or commit the change is compared with, such as main, or a model file")
|
|
144
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
145
|
+
.option("-f, --format <format>", "markdown or json", "markdown")
|
|
146
|
+
.option("--no-diagrams", "leave out the Mermaid diagrams of the change and its journeys")
|
|
147
|
+
.option("--explorer-url <url>", "a page that shows this change in the explorer, to link to")
|
|
148
|
+
.action((opts) => run(report(opts, io)));
|
|
149
|
+
program
|
|
150
|
+
.command("diff")
|
|
151
|
+
.description("What changed in the model: actors, elements, relationships, journeys, data, rules")
|
|
152
|
+
.argument("[range]", "HEAD (default), a ref, a..b, a...b (what a pull request shows), or a model file")
|
|
153
|
+
.argument("[after]", "with a model file as the range, the model file to compare it with")
|
|
154
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
155
|
+
.option("-f, --format <format>", "text, markdown, mermaid, or json", "text")
|
|
156
|
+
.option("--exit-code", "exit 1 when the model changed")
|
|
157
|
+
.action((range, after, opts) => run(diff(range, opts, io, after)));
|
|
158
|
+
program
|
|
159
|
+
.command("sync")
|
|
160
|
+
.description("Pin the model's imports in archdoc.lock and vendor other repos' models, then check references into them")
|
|
161
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
162
|
+
.option("-u, --update [namespaces...]", "move imports (all, or the ones named) to the newest version their range allows")
|
|
163
|
+
.option("--frozen", "change nothing; fail if archdoc.lock doesn't match imports (for CI)")
|
|
164
|
+
.action((opts) => run(sync(opts, io)));
|
|
165
|
+
program
|
|
166
|
+
.command("publish")
|
|
167
|
+
.description("Write a versioned, validated bundle of the model for other repos to import")
|
|
168
|
+
.argument("[version]", "release version, such as 5.2.0 (default: the release tag on HEAD)")
|
|
169
|
+
.option("-m, --model <path>", "repository, .archdoc directory, or model file", ".")
|
|
170
|
+
.option("-o, --out <dir>", "directory to write the bundle to, or - for stdout", "dist")
|
|
171
|
+
.action((version, opts) => run(publish({ ...opts, version }, io)));
|
|
172
|
+
const landscape = program
|
|
173
|
+
.command("landscape")
|
|
174
|
+
.description("Compose every repo's model into one landscape (run in the landscape repo)");
|
|
175
|
+
landscape
|
|
176
|
+
.command("build")
|
|
177
|
+
.description("Check the composed landscape and write a static explorer site for GitHub Pages")
|
|
178
|
+
.argument("[path]", "the landscape repo, .archdoc directory, or model file", ".")
|
|
179
|
+
.option("-o, --out <dir>", "directory to write the site to", "site")
|
|
180
|
+
.option("--force", "write the site even when the landscape has errors")
|
|
181
|
+
.action((path, opts) => run(landscapeBuild(path, opts, io)));
|
|
182
|
+
program
|
|
183
|
+
.command("migrate", { hidden: true })
|
|
184
|
+
.description("Convert a v1 model (users/components) to spec v2")
|
|
185
|
+
.argument("<file>", "v1 model file")
|
|
186
|
+
.option("-n, --namespace <namespace>", "namespace for the model (default: from the file name)")
|
|
187
|
+
.option("--name <name>", "display name for the model")
|
|
188
|
+
.option("-o, --out <file>", "write to a file instead of stdout")
|
|
189
|
+
.action((file, opts) => run(migrate(file, opts, io)));
|
|
190
|
+
program
|
|
191
|
+
.command("schema")
|
|
192
|
+
.description("Print the JSON Schema for v2 model files, for editor validation")
|
|
193
|
+
.option("-o, --out <file>", "write to a file instead of stdout")
|
|
194
|
+
.action((opts) => run(schema(opts, io)));
|
|
195
|
+
return program;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=program.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"program.js","sourceRoot":"","sources":["../src/program.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAA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