diagram-contracts 0.1.0

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 ADDED
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "diagram-contracts",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Rule Catalog driven layout runtime — compile diagrams to deterministic SVG from Draw TSX, Draw Text, or Layout IR",
6
+ "keywords": [
7
+ "diagram",
8
+ "layout",
9
+ "svg",
10
+ "mermaid",
11
+ "flowchart",
12
+ "constraint-graph",
13
+ "draw-tsx"
14
+ ],
15
+ "author": "foo-log-inc",
16
+ "license": "MIT",
17
+ "repository": {
18
+ "type": "git",
19
+ "url": "git+https://github.com/foo-log-inc/diagram-contracts.git"
20
+ },
21
+ "homepage": "https://github.com/foo-log-inc/diagram-contracts#readme",
22
+ "bugs": {
23
+ "url": "https://github.com/foo-log-inc/diagram-contracts/issues"
24
+ },
25
+ "bin": {
26
+ "diagram-contracts": "dist/cli.mjs"
27
+ },
28
+ "exports": {
29
+ ".": {
30
+ "import": "./dist/index.mjs",
31
+ "types": "./dist/index.d.ts"
32
+ },
33
+ "./browser": {
34
+ "import": "./dist/diagram-contracts.browser.mjs"
35
+ }
36
+ },
37
+ "files": [
38
+ "dist",
39
+ "tokens",
40
+ "LICENSE",
41
+ "README.md"
42
+ ],
43
+ "engines": {
44
+ "node": ">=22"
45
+ },
46
+ "scripts": {
47
+ "build": "tsup",
48
+ "build:browser": "node esbuild.browser.mjs",
49
+ "build:publish": "npm run build && npm run build:browser",
50
+ "prepublishOnly": "npm run build:publish && npm run test:ci",
51
+ "test": "vitest run",
52
+ "test:ci": "vitest run",
53
+ "test:watch": "vitest",
54
+ "lint": "tsc --noEmit",
55
+ "generate": "cli-contracts generate",
56
+ "clean": "rm -rf dist",
57
+ "embedoc:build": "embedoc build",
58
+ "embedoc:watch": "embedoc watch",
59
+ "embedoc:generate": "embedoc generate --all"
60
+ },
61
+ "peerDependencies": {
62
+ "aws-icons": ">=3.0.0"
63
+ },
64
+ "peerDependenciesMeta": {
65
+ "aws-icons": {
66
+ "optional": true
67
+ }
68
+ },
69
+ "dependencies": {
70
+ "@fontsource/inter": "^5.2.8",
71
+ "commander": "^15.0.0",
72
+ "js-yaml": "^5.0.0",
73
+ "opentype.js": "^2.0.0",
74
+ "zod": "^4.4.3"
75
+ },
76
+ "devDependencies": {
77
+ "@types/js-yaml": "^4.0.9",
78
+ "@types/node": "^26.0.0",
79
+ "aws-icons": "^3.3.0",
80
+ "cli-contracts": "^0.33.14",
81
+ "embedoc": "^0.14.2",
82
+ "esbuild": "^0.28.1",
83
+ "jsdom": "^29.1.1",
84
+ "tsup": "^8.5.1",
85
+ "typescript": "^6.0.3",
86
+ "vitest": "^4.1.9"
87
+ }
88
+ }
@@ -0,0 +1,35 @@
1
+ defaults:
2
+ Box:
3
+ fill: "{draw.surface}"
4
+ stroke: "{draw.border}"
5
+ strokeWidth: 1
6
+ radius: "{draw.space.node-radius}"
7
+ padding: "{draw.space.node-padding}"
8
+ Text:
9
+ foreground: "{draw.text}"
10
+ fontSize: "{draw.space.font-node}"
11
+ Connector:
12
+ stroke: "{draw.connector-default}"
13
+ strokeWidth: "{draw.space.connector-width}"
14
+ route: orthogonal
15
+ endArrow: arrow
16
+ Label:
17
+ fontSize: "{draw.space.font-label}"
18
+ foreground: "{draw.text}"
19
+
20
+ variants:
21
+ Box:
22
+ primary:
23
+ fill: "{draw.primary}"
24
+ foreground: "{draw.on-primary}"
25
+ muted:
26
+ fill: "{draw.surface}"
27
+ stroke: "{draw.border}"
28
+ opacity: 0.6
29
+ Connector:
30
+ dashed:
31
+ strokeStyle: dashed
32
+ opacity: 0.7
33
+ highlighted:
34
+ stroke: "{draw.primary}"
35
+ strokeWidth: 2
@@ -0,0 +1,35 @@
1
+ draw:
2
+ primary:
3
+ $type: color
4
+ $value: "#2563eb"
5
+ surface:
6
+ $type: color
7
+ $value: "#ffffff"
8
+ border:
9
+ $type: color
10
+ $value: "#e5e7eb"
11
+ text:
12
+ $type: color
13
+ $value: "#111827"
14
+ on-primary:
15
+ $type: color
16
+ $value: "#ffffff"
17
+ connector-default:
18
+ $type: color
19
+ $value: "#6b7280"
20
+ space:
21
+ node-padding:
22
+ $type: dimension
23
+ $value: "12px"
24
+ node-radius:
25
+ $type: dimension
26
+ $value: "8px"
27
+ connector-width:
28
+ $type: dimension
29
+ $value: "1.5px"
30
+ font-label:
31
+ $type: dimension
32
+ $value: "12px"
33
+ font-node:
34
+ $type: dimension
35
+ $value: "14px"