@wireweave/core 4.0.0-beta.0 → 4.0.0-beta.12

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.
Files changed (52) hide show
  1. package/README.md +17 -462
  2. package/dist/app.cjs +31 -0
  3. package/dist/app.d.cts +488 -0
  4. package/dist/app.d.ts +488 -0
  5. package/dist/app.js +31 -0
  6. package/dist/chunk-3RWGG5EC.js +18088 -0
  7. package/dist/chunk-4TMDPWPR.cjs +196 -0
  8. package/dist/chunk-5DGRIQDU.cjs +842 -0
  9. package/dist/chunk-7VTK6LHL.cjs +4374 -0
  10. package/dist/chunk-ETV4XYOV.cjs +7 -0
  11. package/dist/chunk-IMUVIIJR.cjs +18088 -0
  12. package/dist/chunk-JJWAFHSV.js +842 -0
  13. package/dist/chunk-MD6MNOEQ.cjs +2905 -0
  14. package/dist/chunk-PKBMQBKP.js +7 -0
  15. package/dist/chunk-QOS4IC75.js +4374 -0
  16. package/dist/chunk-R5WBZWBC.js +196 -0
  17. package/dist/chunk-V3HVWC7C.js +2905 -0
  18. package/dist/chunk-WV724EAW.js +0 -0
  19. package/dist/chunk-XENFKHRC.cjs +1 -0
  20. package/dist/chunk-XYACLXXF.js +51612 -0
  21. package/dist/chunk-ZPHNXJRY.cjs +51612 -0
  22. package/dist/index-Br7pNaf3.d.cts +240 -0
  23. package/dist/index-CghCKUPx.d.ts +337 -0
  24. package/dist/index-Da_B3eoM.d.ts +240 -0
  25. package/dist/index-G906GEtg.d.cts +337 -0
  26. package/dist/index.cjs +1522 -58235
  27. package/dist/index.d.cts +556 -102
  28. package/dist/index.d.ts +556 -102
  29. package/dist/index.js +1414 -57982
  30. package/dist/interaction.cjs +17 -0
  31. package/dist/interaction.d.cts +3 -0
  32. package/dist/interaction.d.ts +3 -0
  33. package/dist/interaction.js +17 -0
  34. package/dist/parser.cjs +18 -6612
  35. package/dist/parser.d.cts +11 -2
  36. package/dist/parser.d.ts +11 -2
  37. package/dist/parser.js +16 -6580
  38. package/dist/renderer.cjs +7 -50481
  39. package/dist/renderer.d.cts +358 -133
  40. package/dist/renderer.d.ts +358 -133
  41. package/dist/renderer.js +49 -50480
  42. package/dist/spec.cjs +49 -0
  43. package/dist/spec.d.cts +301 -0
  44. package/dist/spec.d.ts +301 -0
  45. package/dist/spec.js +49 -0
  46. package/dist/types-Dkgr0Wyc.d.cts +75 -0
  47. package/dist/types-Dkgr0Wyc.d.ts +75 -0
  48. package/dist/{types-hEr_afgw.d.cts → types-vhPCZpAW.d.cts} +307 -27
  49. package/dist/{types-hEr_afgw.d.ts → types-vhPCZpAW.d.ts} +307 -27
  50. package/dist/v4-types-Baz9yqAS.d.cts +137 -0
  51. package/dist/v4-types-Baz9yqAS.d.ts +137 -0
  52. package/package.json +103 -24
@@ -0,0 +1,137 @@
1
+ /** Canonical parser values for the Wireweave 4.0.0 language contract. */
2
+ type JsonValue = null | boolean | number | string | JsonValue[] | JsonObject;
3
+ interface JsonObject {
4
+ [key: string]: JsonValue;
5
+ }
6
+ interface V4ParseOptions {
7
+ languageVersion: string;
8
+ sourceId?: string;
9
+ }
10
+ interface V4SourceSpan {
11
+ sourceId: string;
12
+ /** Original UTF-16 code-unit offsets; end is exclusive. */
13
+ start: number;
14
+ end: number;
15
+ startLine: number;
16
+ startColumn: number;
17
+ endLine: number;
18
+ endColumn: number;
19
+ /** False identifies a fragment inspection ID, not an authored durable ID. */
20
+ authoredId?: boolean;
21
+ }
22
+ interface V4Diagnostic {
23
+ severity: 'error';
24
+ code: string;
25
+ phase: 'parse' | 'schema';
26
+ sourceId: string;
27
+ start: number;
28
+ end: number;
29
+ path: string;
30
+ messageKey: string;
31
+ details: JsonObject;
32
+ related: {
33
+ sourceId: string;
34
+ start: number;
35
+ end: number;
36
+ }[];
37
+ }
38
+ declare class V4ParseError extends Error {
39
+ readonly diagnostics: readonly V4Diagnostic[];
40
+ name: string;
41
+ constructor(diagnostics: readonly V4Diagnostic[]);
42
+ }
43
+ type V4ParseResult = {
44
+ ok: true;
45
+ value: ParsedDocument;
46
+ diagnostics: [];
47
+ } | {
48
+ ok: false;
49
+ value: null;
50
+ diagnostics: readonly V4Diagnostic[];
51
+ };
52
+ interface CanonicalParameter {
53
+ id: string;
54
+ type: 'string' | 'number' | 'boolean' | 'record' | 'list';
55
+ default?: JsonValue;
56
+ }
57
+ type PrimitiveKind = 'page' | 'header' | 'main' | 'footer' | 'sidebar' | 'section' | 'row' | 'col' | 'stack' | 'relative' | 'card' | 'modal' | 'drawer' | 'accordion' | 'text' | 'title' | 'link' | 'input' | 'textarea' | 'select' | 'checkbox' | 'radio' | 'switch' | 'slider' | 'button' | 'image' | 'placeholder' | 'avatar' | 'badge' | 'icon' | 'table' | 'list' | 'alert' | 'toast' | 'progress' | 'spinner' | 'tooltip' | 'popover' | 'dropdown' | 'nav' | 'tabs' | 'breadcrumb' | 'divider' | 'marker' | 'annotations' | 'form' | 'nav-item' | 'nav-group' | 'dropdown-item' | 'list-item' | 'tab' | 'option' | 'annotation-item';
58
+ interface CanonicalPrimitive {
59
+ kind: PrimitiveKind;
60
+ id?: string;
61
+ label?: string;
62
+ number?: number;
63
+ items?: JsonValue[];
64
+ attributes: JsonObject;
65
+ children: CanonicalNode[];
66
+ }
67
+ interface CanonicalDefinition {
68
+ kind: 'layout' | 'component';
69
+ id: string;
70
+ parameters: CanonicalParameter[];
71
+ attributes: JsonObject;
72
+ children: CanonicalNode[];
73
+ }
74
+ interface CanonicalUse {
75
+ kind: 'use';
76
+ id: string;
77
+ name: string;
78
+ namespace?: string;
79
+ inputs: Record<string, {
80
+ literal: JsonValue;
81
+ } | {
82
+ param: string;
83
+ }>;
84
+ fills: {
85
+ name: string;
86
+ children: CanonicalNode[];
87
+ }[];
88
+ }
89
+ type CanonicalNode = CanonicalPrimitive | CanonicalDefinition | CanonicalUse | {
90
+ kind: 'slot';
91
+ name?: string;
92
+ } | {
93
+ kind: 'repeat';
94
+ count: number;
95
+ id?: string;
96
+ children: CanonicalNode[];
97
+ };
98
+ interface CanonicalSymbol {
99
+ kind: 'page' | 'layout' | 'component';
100
+ id: string;
101
+ }
102
+ interface CanonicalModule {
103
+ id: string;
104
+ namespace: string;
105
+ sourceDigest: string;
106
+ imports: {
107
+ namespace: string;
108
+ moduleId: string;
109
+ digest: string;
110
+ symbols: CanonicalSymbol[];
111
+ }[];
112
+ exports: CanonicalSymbol[];
113
+ definitions: (CanonicalPrimitive | CanonicalDefinition)[];
114
+ }
115
+ interface ParsedDocument {
116
+ schemaVersion: '1.0.0';
117
+ languageVersion: '4.0.0';
118
+ modules: CanonicalModule[];
119
+ states: JsonObject[];
120
+ registry: {
121
+ schemaVersion: '1.0.0';
122
+ entries: JsonObject[];
123
+ digest: string;
124
+ };
125
+ fixtures: JsonObject[];
126
+ app: {
127
+ id: string;
128
+ entry?: {
129
+ namespace: string;
130
+ id: string;
131
+ variant?: string;
132
+ };
133
+ profile: JsonObject;
134
+ };
135
+ }
136
+
137
+ export { type CanonicalDefinition as C, type JsonObject as J, type ParsedDocument as P, type V4Diagnostic as V, type CanonicalModule as a, type CanonicalNode as b, type CanonicalParameter as c, type CanonicalPrimitive as d, type CanonicalSymbol as e, type CanonicalUse as f, type JsonValue as g, V4ParseError as h, type V4ParseOptions as i, type V4ParseResult as j, type V4SourceSpan as k };
package/package.json CHANGED
@@ -1,54 +1,104 @@
1
1
  {
2
2
  "name": "@wireweave/core",
3
- "version": "4.0.0-beta.0",
3
+ "version": "4.0.0-beta.12",
4
4
  "description": "Core parser and renderer for wireweave",
5
5
  "type": "module",
6
- "main": "dist/index.js",
7
- "module": "dist/index.mjs",
6
+ "sideEffects": false,
7
+ "main": "dist/index.cjs",
8
+ "module": "dist/index.js",
8
9
  "types": "dist/index.d.ts",
9
10
  "exports": {
10
11
  ".": {
11
- "types": "./dist/index.d.ts",
12
- "import": "./dist/index.js",
13
- "require": "./dist/index.cjs"
12
+ "import": {
13
+ "types": "./dist/index.d.ts",
14
+ "default": "./dist/index.js"
15
+ },
16
+ "require": {
17
+ "types": "./dist/index.d.cts",
18
+ "default": "./dist/index.cjs"
19
+ }
14
20
  },
15
21
  "./parser": {
16
- "types": "./dist/parser.d.ts",
17
- "import": "./dist/parser.js",
18
- "require": "./dist/parser.cjs"
22
+ "import": {
23
+ "types": "./dist/parser.d.ts",
24
+ "default": "./dist/parser.js"
25
+ },
26
+ "require": {
27
+ "types": "./dist/parser.d.cts",
28
+ "default": "./dist/parser.cjs"
29
+ }
19
30
  },
20
31
  "./renderer": {
21
- "types": "./dist/renderer.d.ts",
22
- "import": "./dist/renderer.js",
23
- "require": "./dist/renderer.cjs"
32
+ "import": {
33
+ "types": "./dist/renderer.d.ts",
34
+ "default": "./dist/renderer.js"
35
+ },
36
+ "require": {
37
+ "types": "./dist/renderer.d.cts",
38
+ "default": "./dist/renderer.cjs"
39
+ }
40
+ },
41
+ "./spec": {
42
+ "import": {
43
+ "types": "./dist/spec.d.ts",
44
+ "default": "./dist/spec.js"
45
+ },
46
+ "require": {
47
+ "types": "./dist/spec.d.cts",
48
+ "default": "./dist/spec.cjs"
49
+ }
50
+ },
51
+ "./app": {
52
+ "import": {
53
+ "types": "./dist/app.d.ts",
54
+ "default": "./dist/app.js"
55
+ },
56
+ "require": {
57
+ "types": "./dist/app.d.cts",
58
+ "default": "./dist/app.cjs"
59
+ }
60
+ },
61
+ "./interaction": {
62
+ "import": {
63
+ "types": "./dist/interaction.d.ts",
64
+ "default": "./dist/interaction.js"
65
+ },
66
+ "require": {
67
+ "types": "./dist/interaction.d.cts",
68
+ "default": "./dist/interaction.cjs"
69
+ }
24
70
  }
25
71
  },
26
72
  "files": [
27
73
  "dist"
28
74
  ],
29
- "scripts": {
30
- "build:grammar": "peggy --format es -o src/parser/generated-parser.js src/grammar/wireframe.peggy",
31
- "build:ts": "tsup",
32
- "build": "pnpm build:grammar && pnpm build:ts",
33
- "test": "vitest run",
34
- "test:watch": "vitest",
35
- "storybook": "storybook dev -p 6006",
36
- "build-storybook": "storybook build",
37
- "clean": "rm -rf dist",
38
- "release": "release-it"
75
+ "engines": {
76
+ "node": ">=22.13.0"
39
77
  },
40
78
  "devDependencies": {
79
+ "@commitlint/cli": "^21.0.1",
80
+ "@commitlint/config-conventional": "^21.0.1",
81
+ "@eslint/js": "^10.0.1",
41
82
  "@release-it/conventional-changelog": "^10.0.4",
42
83
  "@storybook/html": "^10.2.18",
43
84
  "@storybook/html-vite": "^10.2.18",
85
+ "@types/jsdom": "^28.0.3",
44
86
  "@types/node": "^25.0.8",
45
87
  "@vitest/coverage-v8": "^3.2.4",
88
+ "eslint": "^10.3.0",
89
+ "husky": "^9.1.7",
90
+ "jsdom": "^30.0.1",
91
+ "knip": "^6.13.1",
92
+ "lint-staged": "^17.0.4",
46
93
  "lucide": "^0.562.0",
47
94
  "peggy": "^5.0.0",
95
+ "prettier": "^3.8.3",
96
+ "publint": "^0.3.21",
48
97
  "release-it": "^19.2.3",
49
98
  "storybook": "^10.2.18",
50
99
  "tsup": "^8.3.5",
51
100
  "typescript": "^5.7.2",
101
+ "typescript-eslint": "^8.59.3",
52
102
  "vitest": "^3.1.1"
53
103
  },
54
104
  "keywords": [
@@ -63,6 +113,35 @@
63
113
  "license": "MIT",
64
114
  "repository": {
65
115
  "type": "git",
66
- "url": "https://github.com/wireweave/core.git"
116
+ "url": "git+https://github.com/wireweave/wireweave.git",
117
+ "directory": "packages/core"
118
+ },
119
+ "scripts": {
120
+ "build:grammar": "peggy --format es -o src/parser/generated-parser.js src/grammar/wireframe.peggy",
121
+ "postbuild:grammar": "node scripts/format-generated.mjs src/parser/generated-parser.js",
122
+ "build:spec": "node scripts/extract-grammar-elements.mjs",
123
+ "build:icons": "node scripts/generate-icons.mjs",
124
+ "build:icon-names": "node scripts/extract-icon-names.mjs",
125
+ "build:ts": "tsup",
126
+ "build": "pnpm build:grammar && pnpm build:spec && pnpm build:icons && pnpm build:icon-names && pnpm build:ts",
127
+ "postbuild": "node ../../scripts/dist-freshness-gate.mjs --write .",
128
+ "check:parser-sync": "node scripts/check-generated-parser.mjs",
129
+ "check:spec-sync": "node scripts/extract-grammar-elements.mjs --check",
130
+ "check:icons-sync": "node scripts/generate-icons.mjs --check",
131
+ "check:icon-names-sync": "node scripts/extract-icon-names.mjs --check",
132
+ "pretest": "pnpm run check:parser-sync && pnpm run check:spec-sync && pnpm run check:icons-sync && pnpm run check:icon-names-sync",
133
+ "test": "vitest run",
134
+ "test:watch": "vitest",
135
+ "storybook": "storybook dev -p 6006",
136
+ "build-storybook": "storybook build",
137
+ "clean": "rm -rf dist",
138
+ "typecheck": "tsc --noEmit",
139
+ "lint": "eslint .",
140
+ "lint:fix": "eslint . --fix",
141
+ "format": "prettier --write .",
142
+ "format:check": "prettier --check .",
143
+ "knip": "knip",
144
+ "publint": "publint --strict",
145
+ "release": "release-it"
67
146
  }
68
- }
147
+ }