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/README.md +29 -1
- package/dist/main.js +11404 -27
- package/dist/main.js.map +1 -1
- package/package.json +11 -6
- package/dist/commands/validate.d.ts +0 -3
- package/dist/commands/validate.js +0 -34
- package/dist/commands/validate.js.map +0 -1
- package/dist/exit.d.ts +0 -8
- package/dist/exit.js +0 -9
- package/dist/exit.js.map +0 -1
- package/dist/main.d.ts +0 -2
- package/dist/version.d.ts +0 -2
- package/dist/version.js +0 -6
- package/dist/version.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "visigraph",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "VisiGraph
|
|
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,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,IAA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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
package/dist/version.d.ts
DELETED
package/dist/version.js
DELETED
package/dist/version.js.map
DELETED
|
@@ -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"}
|