visigraph 0.0.3 → 0.0.6

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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "visigraph",
3
- "version": "0.0.3",
4
- "description": "VisiGraph CLI \u2014 validate architecture models and play journeys through them",
3
+ "version": "0.0.6",
4
+ "description": "VisiGraph \u2014 validate architecture models and build playable journey sites",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "bin": {
@@ -18,10 +18,6 @@
18
18
  "directory": "packages/cli"
19
19
  },
20
20
  "homepage": "https://github.com/textologylabs/visigraph",
21
- "dependencies": {
22
- "@visigraph/core": "0.0.3",
23
- "commander": "^13.1.0"
24
- },
25
21
  "bugs": {
26
22
  "url": "https://github.com/textologylabs/visigraph/issues"
27
23
  },
@@ -38,5 +34,14 @@
38
34
  },
39
35
  "publishConfig": {
40
36
  "access": "public"
37
+ },
38
+ "devDependencies": {
39
+ "@visigraph/core": "0.0.6",
40
+ "commander": "^13.1.0",
41
+ "tsup": "^8.5.1",
42
+ "yaml": "^2.9.1"
43
+ },
44
+ "scripts": {
45
+ "build": "tsup"
41
46
  }
42
47
  }
@@ -1,3 +0,0 @@
1
- import type { Command } from "commander";
2
- export declare function registerValidate(program: Command): void;
3
- export declare function validate(file: string): Promise<number>;
@@ -1,34 +0,0 @@
1
- import { loadModel, resolve } from "@visigraph/core";
2
- import { EXIT } from "../exit.js";
3
- export function registerValidate(program) {
4
- program
5
- .command("validate")
6
- .argument("<model>", "path to a model file (YAML)")
7
- .description("check a model and every model it links or requires; every identifier must resolve")
8
- .addHelpText("after", `
9
- Exit codes:
10
- 0 the model is valid
11
- 1 the model has problems; each is printed as file:path: message
12
- 2 the file could not be read`)
13
- .action(async (file) => {
14
- process.exitCode = await validate(file);
15
- });
16
- }
17
- export async function validate(file) {
18
- const parsed = await loadModel(file);
19
- let diagnostics = parsed.diagnostics;
20
- if (parsed.model) {
21
- diagnostics = diagnostics.concat(resolve(parsed.model, { file }).diagnostics);
22
- }
23
- for (const d of diagnostics) {
24
- const where = d.path ? `${d.file ?? file}:${d.path}` : (d.file ?? file);
25
- console.error(`${d.severity}: ${where}: ${d.message}`);
26
- }
27
- if (diagnostics.length > 0) {
28
- console.error(`${diagnostics.length} error${diagnostics.length === 1 ? "" : "s"}`);
29
- return parsed.model ? EXIT.invalid : EXIT.usage;
30
- }
31
- console.log(`${file}: ok`);
32
- return EXIT.ok;
33
- }
34
- //# sourceMappingURL=validate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../src/commands/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAmB,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,UAAU,gBAAgB,CAAC,OAAgB;IAC/C,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,QAAQ,CAAC,SAAS,EAAE,6BAA6B,CAAC;SAClD,WAAW,CAAC,mFAAmF,CAAC;SAChG,WAAW,CACV,OAAO,EACP;;;;gCAI0B,CAC3B;SACA,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,EAAE;QAC7B,OAAO,CAAC,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAY;IACzC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,WAAW,GAAiB,MAAM,CAAC,WAAW,CAAC;IACnD,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,WAAW,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,MAAM,CAAC,IAAI,WAAW,EAAE,CAAC;QAC5B,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,IAAI,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,CAAC;QACxE,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,QAAQ,KAAK,KAAK,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,KAAK,CAAC,GAAG,WAAW,CAAC,MAAM,SAAS,WAAW,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;QACnF,OAAO,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC;IAClD,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,MAAM,CAAC,CAAC;IAC3B,OAAO,IAAI,CAAC,EAAE,CAAC;AACjB,CAAC"}
package/dist/exit.d.ts DELETED
@@ -1,8 +0,0 @@
1
- /** Exit codes shared by every command. */
2
- export declare const EXIT: {
3
- readonly ok: 0;
4
- /** The model has problems (dangling references, bad shape). */
5
- readonly invalid: 1;
6
- /** Bad usage, unreadable file, or an unexpected failure. */
7
- readonly usage: 2;
8
- };
package/dist/exit.js DELETED
@@ -1,9 +0,0 @@
1
- /** Exit codes shared by every command. */
2
- export const EXIT = {
3
- ok: 0,
4
- /** The model has problems (dangling references, bad shape). */
5
- invalid: 1,
6
- /** Bad usage, unreadable file, or an unexpected failure. */
7
- usage: 2,
8
- };
9
- //# sourceMappingURL=exit.js.map
package/dist/exit.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"exit.js","sourceRoot":"","sources":["../src/exit.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,MAAM,CAAC,MAAM,IAAI,GAAG;IAClB,EAAE,EAAE,CAAC;IACL,+DAA+D;IAC/D,OAAO,EAAE,CAAC;IACV,4DAA4D;IAC5D,KAAK,EAAE,CAAC;CACA,CAAC"}
package/dist/main.d.ts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- export {};
package/dist/version.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export declare const VERSION: string;
2
- export declare const DESCRIPTION: string;
package/dist/version.js DELETED
@@ -1,6 +0,0 @@
1
- import { createRequire } from "node:module";
2
- const require = createRequire(import.meta.url);
3
- const pkg = require("../package.json");
4
- export const VERSION = pkg.version;
5
- export const DESCRIPTION = pkg.description;
6
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC/C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAA6C,CAAC;AAEnF,MAAM,CAAC,MAAM,OAAO,GAAW,GAAG,CAAC,OAAO,CAAC;AAC3C,MAAM,CAAC,MAAM,WAAW,GAAW,GAAG,CAAC,WAAW,CAAC"}