visigraph 0.0.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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Textology Labs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # visigraph
2
+
3
+ Command line for [VisiGraph](https://github.com/textologylabs/visigraph):
4
+ architecture models you can play through.
5
+
6
+ Early, pre-1.0. Today it validates a model; the journey player follows.
7
+
8
+ ```sh
9
+ npx visigraph validate model.yaml
10
+ ```
11
+
12
+ Resolves every identifier in the model and exits 1 on any dangling
13
+ reference, with a path to each one:
14
+
15
+ ```
16
+ error: model.yaml:journeys[0].steps[2].endpoint: container 'auth-service' has no endpoint 'token'
17
+ ```
package/dist/main.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/main.js ADDED
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from "node:util";
3
+ import { loadModel, resolve } from "@visigraph/core";
4
+ const USAGE = `usage: visigraph validate <model.yaml>
5
+
6
+ Resolves every identifier in the model. Exits 1 on any dangling reference.`;
7
+ async function main(argv) {
8
+ const { positionals } = parseArgs({ args: argv, allowPositionals: true, strict: true });
9
+ const [command, file] = positionals;
10
+ if (command !== "validate" || !file) {
11
+ console.error(USAGE);
12
+ return 2;
13
+ }
14
+ const parsed = await loadModel(file);
15
+ let diagnostics = parsed.diagnostics;
16
+ if (parsed.model) {
17
+ diagnostics = diagnostics.concat(resolve(parsed.model).diagnostics);
18
+ }
19
+ for (const d of diagnostics) {
20
+ const where = d.path ? `${file}:${d.path}` : file;
21
+ console.error(`${d.severity}: ${where}: ${d.message}`);
22
+ }
23
+ if (diagnostics.length > 0) {
24
+ console.error(`${diagnostics.length} error${diagnostics.length === 1 ? "" : "s"}`);
25
+ return 1;
26
+ }
27
+ console.log(`${file}: ok`);
28
+ return 0;
29
+ }
30
+ main(process.argv.slice(2)).then((code) => process.exit(code), (e) => {
31
+ console.error(`error: ${e instanceof Error ? e.message : String(e)}`);
32
+ process.exit(2);
33
+ });
34
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAmB,MAAM,iBAAiB,CAAC;AAEtE,MAAM,KAAK,GAAG;;2EAE6D,CAAC;AAE5E,KAAK,UAAU,IAAI,CAAC,IAAc;IAChC,MAAM,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IACxF,MAAM,CAAC,OAAO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,IAAI,CAAC,EAC5B,CAAC,CAAU,EAAE,EAAE;IACb,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CACF,CAAC"}
package/package.json ADDED
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "visigraph",
3
+ "version": "0.0.1",
4
+ "description": "VisiGraph CLI \u2014 validate architecture models and play journeys through them",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "bin": {
8
+ "visigraph": "./dist/main.js"
9
+ },
10
+ "files": [
11
+ "dist",
12
+ "README.md",
13
+ "LICENSE"
14
+ ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/textologylabs/visigraph.git",
18
+ "directory": "packages/cli"
19
+ },
20
+ "homepage": "https://github.com/textologylabs/visigraph",
21
+ "dependencies": {
22
+ "@visigraph/core": "0.0.1"
23
+ },
24
+ "bugs": {
25
+ "url": "https://github.com/textologylabs/visigraph/issues"
26
+ },
27
+ "keywords": [
28
+ "architecture",
29
+ "c4",
30
+ "journeys",
31
+ "diagram",
32
+ "model",
33
+ "visigraph"
34
+ ],
35
+ "engines": {
36
+ "node": ">=22"
37
+ },
38
+ "publishConfig": {
39
+ "access": "public"
40
+ }
41
+ }