@origostudio/origo-design 0.0.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.
Files changed (209) hide show
  1. package/.editorconfig +13 -0
  2. package/.gitattributes +22 -0
  3. package/.perf-baseline.json +12 -0
  4. package/.prettierignore +13 -0
  5. package/.prettierrc +10 -0
  6. package/.vscode/extensions.json +3 -0
  7. package/BRANCH-PROTECTION.md +25 -0
  8. package/CHANGELOG.md +292 -0
  9. package/LICENSE +21 -0
  10. package/README.md +11 -0
  11. package/commitlint.config.js +6 -0
  12. package/dist/packages/cli/CHANGELOG.md +92 -0
  13. package/dist/packages/cli/README.md +11 -0
  14. package/dist/packages/cli/package.json +16 -0
  15. package/dist/packages/cli/package.json.bak +16 -0
  16. package/dist/packages/cli/src/commands/generate/entity.d.ts +2 -0
  17. package/dist/packages/cli/src/commands/generate/entity.js +24 -0
  18. package/dist/packages/cli/src/commands/generate/entity.js.map +1 -0
  19. package/dist/packages/cli/src/commands/generate/index.d.ts +2 -0
  20. package/dist/packages/cli/src/commands/generate/index.js +30 -0
  21. package/dist/packages/cli/src/commands/generate/index.js.map +1 -0
  22. package/dist/packages/cli/src/commands/init.d.ts +5 -0
  23. package/dist/packages/cli/src/commands/init.js +27 -0
  24. package/dist/packages/cli/src/commands/init.js.map +1 -0
  25. package/dist/packages/cli/src/commands/new.d.ts +2 -0
  26. package/dist/packages/cli/src/commands/new.js +24 -0
  27. package/dist/packages/cli/src/commands/new.js.map +1 -0
  28. package/dist/packages/cli/src/commands/validate.d.ts +2 -0
  29. package/dist/packages/cli/src/commands/validate.js +50 -0
  30. package/dist/packages/cli/src/commands/validate.js.map +1 -0
  31. package/dist/packages/cli/src/index.d.ts +11 -0
  32. package/dist/packages/cli/src/index.js +15 -0
  33. package/dist/packages/cli/src/index.js.map +1 -0
  34. package/dist/packages/cli/src/lib/cli.d.ts +1 -0
  35. package/dist/packages/cli/src/lib/cli.js +7 -0
  36. package/dist/packages/cli/src/lib/cli.js.map +1 -0
  37. package/dist/packages/cli/src/lib/generator.d.ts +16 -0
  38. package/dist/packages/cli/src/lib/generator.js +165 -0
  39. package/dist/packages/cli/src/lib/generator.js.map +1 -0
  40. package/dist/packages/cli/src/lib/scaffolding.d.ts +5 -0
  41. package/dist/packages/cli/src/lib/scaffolding.js +87 -0
  42. package/dist/packages/cli/src/lib/scaffolding.js.map +1 -0
  43. package/dist/packages/cli/src/lib/validation.d.ts +4 -0
  44. package/dist/packages/cli/src/lib/validation.js +191 -0
  45. package/dist/packages/cli/src/lib/validation.js.map +1 -0
  46. package/dist/packages/cli/src/main.d.ts +4 -0
  47. package/dist/packages/cli/src/main.js +38 -0
  48. package/dist/packages/cli/src/main.js.map +1 -0
  49. package/dist/packages/cli/src/templates/entity.json +6 -0
  50. package/dist/packages/cli/src/templates/extension.json +8 -0
  51. package/dist/packages/cli/src/templates/index.d.ts +29 -0
  52. package/dist/packages/cli/src/templates/index.js +61 -0
  53. package/dist/packages/cli/src/templates/index.js.map +1 -0
  54. package/dist/packages/cli/src/templates/origo.json +16 -0
  55. package/dist/packages/cli/src/utils/errors.d.ts +15 -0
  56. package/dist/packages/cli/src/utils/errors.js +58 -0
  57. package/dist/packages/cli/src/utils/errors.js.map +1 -0
  58. package/dist/packages/core/CHANGELOG.md +275 -0
  59. package/dist/packages/core/README.md +11 -0
  60. package/dist/packages/core/package.json +21 -0
  61. package/dist/packages/core/package.json.bak +21 -0
  62. package/dist/packages/core/src/extension-api/extension-manager.d.ts +35 -0
  63. package/dist/packages/core/src/extension-api/extension-manager.js +300 -0
  64. package/dist/packages/core/src/extension-api/extension-manager.js.map +1 -0
  65. package/dist/packages/core/src/extension-api/index.d.ts +2 -0
  66. package/dist/packages/core/src/extension-api/index.js +6 -0
  67. package/dist/packages/core/src/extension-api/index.js.map +1 -0
  68. package/dist/packages/core/src/extension-api/types.d.ts +34 -0
  69. package/dist/packages/core/src/extension-api/types.js +3 -0
  70. package/dist/packages/core/src/extension-api/types.js.map +1 -0
  71. package/dist/packages/core/src/index.d.ts +3 -0
  72. package/dist/packages/core/src/index.js +7 -0
  73. package/dist/packages/core/src/index.js.map +1 -0
  74. package/dist/packages/core/src/schemas/capability.schema.json +104 -0
  75. package/dist/packages/core/src/schemas/contract.schema.json +52 -0
  76. package/dist/packages/core/src/schemas/domain.schema.json +47 -0
  77. package/dist/packages/core/src/schemas/entity.schema.json +72 -0
  78. package/dist/packages/core/src/schemas/extension.schema.json +39 -0
  79. package/dist/packages/core/src/schemas/permission.schema.json +21 -0
  80. package/dist/packages/core/src/types/ast.d.ts +17 -0
  81. package/dist/packages/core/src/types/ast.js +3 -0
  82. package/dist/packages/core/src/types/ast.js.map +1 -0
  83. package/dist/packages/core/src/types/domain.d.ts +101 -0
  84. package/dist/packages/core/src/types/domain.js +8 -0
  85. package/dist/packages/core/src/types/domain.js.map +1 -0
  86. package/dist/packages/core/src/types/validation.d.ts +12 -0
  87. package/dist/packages/core/src/types/validation.js +16 -0
  88. package/dist/packages/core/src/types/validation.js.map +1 -0
  89. package/dist/packages/core/src/validator/ast-validator.d.ts +11 -0
  90. package/dist/packages/core/src/validator/ast-validator.js +388 -0
  91. package/dist/packages/core/src/validator/ast-validator.js.map +1 -0
  92. package/dist/packages/core/src/validator/index.d.ts +23 -0
  93. package/dist/packages/core/src/validator/index.js +143 -0
  94. package/dist/packages/core/src/validator/index.js.map +1 -0
  95. package/dist/packages/core/src/validator/serializer.d.ts +11 -0
  96. package/dist/packages/core/src/validator/serializer.js +99 -0
  97. package/dist/packages/core/src/validator/serializer.js.map +1 -0
  98. package/eslint.config.js +114 -0
  99. package/generate_prompts.js +19 -0
  100. package/jest.config.ts +5 -0
  101. package/jest.preset.js +3 -0
  102. package/nx.json +169 -0
  103. package/package.json +115 -0
  104. package/packages/angular-renderer/CHANGELOG.md +274 -0
  105. package/packages/angular-renderer/README.md +11 -0
  106. package/packages/angular-renderer/package.json +20 -0
  107. package/packages/angular-renderer/playwright-ct.config.ts +23 -0
  108. package/packages/angular-renderer/src/adapters/web/adapter.ts +145 -0
  109. package/packages/angular-renderer/src/adapters/web/experience-adapter.service.ts +21 -0
  110. package/packages/angular-renderer/src/components/primitives/button/button.component.html +9 -0
  111. package/packages/angular-renderer/src/components/primitives/button/button.component.pw.ts +19 -0
  112. package/packages/angular-renderer/src/components/primitives/button/button.component.scss +31 -0
  113. package/packages/angular-renderer/src/components/primitives/button/button.component.ts +67 -0
  114. package/packages/angular-renderer/src/components/primitives/primitives.a11y.pw.ts +33 -0
  115. package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.html +10 -0
  116. package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.pw.ts +29 -0
  117. package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.scss +42 -0
  118. package/packages/angular-renderer/src/components/primitives/text-input/text-input.component.ts +84 -0
  119. package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.html +2 -0
  120. package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.pw.ts +19 -0
  121. package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.scss +5 -0
  122. package/packages/angular-renderer/src/components/primitives/vbox/vbox.component.ts +74 -0
  123. package/packages/angular-renderer/src/index.ts +7 -0
  124. package/packages/angular-renderer/src/lib/renderer.component.ts +118 -0
  125. package/packages/angular-renderer/src/lib/renderer.tokens.ts +9 -0
  126. package/packages/angular-renderer/src/lib/test-utils.ts +26 -0
  127. package/packages/angular-renderer/src/lib/theme.provider.ts +83 -0
  128. package/packages/angular-renderer/src/test-setup.ts +8 -0
  129. package/packages/cli/CHANGELOG.md +92 -0
  130. package/packages/cli/README.md +11 -0
  131. package/packages/cli/package.json +16 -0
  132. package/packages/cli/src/commands/generate/entity.ts +20 -0
  133. package/packages/cli/src/commands/generate/index.ts +28 -0
  134. package/packages/cli/src/commands/init.ts +28 -0
  135. package/packages/cli/src/commands/new.ts +22 -0
  136. package/packages/cli/src/commands/validate.ts +47 -0
  137. package/packages/cli/src/index.ts +11 -0
  138. package/packages/cli/src/lib/cli.ts +3 -0
  139. package/packages/cli/src/lib/generator.ts +181 -0
  140. package/packages/cli/src/lib/scaffolding.ts +104 -0
  141. package/packages/cli/src/lib/validation.ts +218 -0
  142. package/packages/cli/src/main.ts +38 -0
  143. package/packages/cli/src/templates/entity.json +6 -0
  144. package/packages/cli/src/templates/extension.json +8 -0
  145. package/packages/cli/src/templates/index.ts +94 -0
  146. package/packages/cli/src/templates/origo.json +16 -0
  147. package/packages/cli/src/utils/errors.ts +80 -0
  148. package/packages/core/CHANGELOG.md +275 -0
  149. package/packages/core/README.md +11 -0
  150. package/packages/core/package-lock.json +1035 -0
  151. package/packages/core/package.json +21 -0
  152. package/packages/core/scripts/generate-types.ts +23 -0
  153. package/packages/core/src/extension-api/extension-manager.ts +378 -0
  154. package/packages/core/src/extension-api/index.ts +2 -0
  155. package/packages/core/src/extension-api/types.ts +37 -0
  156. package/packages/core/src/index.ts +3 -0
  157. package/packages/core/src/schemas/__fixtures__/target-page.json +222 -0
  158. package/packages/core/src/schemas/capability.schema.json +104 -0
  159. package/packages/core/src/schemas/contract.schema.json +52 -0
  160. package/packages/core/src/schemas/domain.schema.json +47 -0
  161. package/packages/core/src/schemas/entity.schema.json +72 -0
  162. package/packages/core/src/schemas/extension.schema.json +39 -0
  163. package/packages/core/src/schemas/permission.schema.json +21 -0
  164. package/packages/core/src/types/ast.ts +20 -0
  165. package/packages/core/src/types/domain.ts +105 -0
  166. package/packages/core/src/types/validation.ts +29 -0
  167. package/packages/core/src/validator/ast-validator.ts +406 -0
  168. package/packages/core/src/validator/index.ts +207 -0
  169. package/packages/core/src/validator/serializer.ts +120 -0
  170. package/packages/core/test/fixtures/target-page.json +87 -0
  171. package/packages/design-tokens/CHANGELOG.md +273 -0
  172. package/packages/design-tokens/README.md +11 -0
  173. package/packages/design-tokens/package.json +25 -0
  174. package/packages/design-tokens/src/build.ts +97 -0
  175. package/packages/design-tokens/src/compile.ts +60 -0
  176. package/packages/design-tokens/src/index.ts +7 -0
  177. package/packages/design-tokens/src/runtime/index.ts +2 -0
  178. package/packages/design-tokens/src/runtime/theme-fetcher.ts +90 -0
  179. package/packages/design-tokens/src/runtime/theme-injector.ts +149 -0
  180. package/packages/design-tokens/src/schemas/base-tokens.schema.json +127 -0
  181. package/packages/design-tokens/src/schemas/semantic-tokens.schema.json +52 -0
  182. package/packages/design-tokens/src/tokens/base.json +46 -0
  183. package/packages/design-tokens/src/tokens/semantic.json +33 -0
  184. package/packages/playground/CHANGELOG.md +12 -0
  185. package/packages/playground/package.json +10 -0
  186. package/packages/playground/public/favicon.ico +0 -0
  187. package/packages/playground/src/app/app.component.html +1 -0
  188. package/packages/playground/src/app/app.component.scss +4 -0
  189. package/packages/playground/src/app/app.component.ts +13 -0
  190. package/packages/playground/src/app/app.config.ts +9 -0
  191. package/packages/playground/src/editor/badl-editor.component.html +1 -0
  192. package/packages/playground/src/editor/badl-editor.component.scss +10 -0
  193. package/packages/playground/src/editor/badl-editor.component.ts +57 -0
  194. package/packages/playground/src/editor/editor.worker.ts +1 -0
  195. package/packages/playground/src/editor/json.worker.ts +1 -0
  196. package/packages/playground/src/editor/monaco-environment.ts +11 -0
  197. package/packages/playground/src/editor/schema-registry.ts +30 -0
  198. package/packages/playground/src/index.html +13 -0
  199. package/packages/playground/src/main.ts +5 -0
  200. package/packages/playground/src/schemas/capability.schema.json +104 -0
  201. package/packages/playground/src/schemas/contract.schema.json +52 -0
  202. package/packages/playground/src/schemas/domain.schema.json +47 -0
  203. package/packages/playground/src/schemas/entity.schema.json +72 -0
  204. package/packages/playground/src/schemas/extension.schema.json +39 -0
  205. package/packages/playground/src/schemas/permission.schema.json +21 -0
  206. package/packages/playground/src/styles.scss +8 -0
  207. package/packages/playground/src/test-setup.ts +146 -0
  208. package/packages/playground/vite.config.ts +12 -0
  209. package/packages/playground/vitest.config.mjs +24 -0
@@ -0,0 +1,120 @@
1
+ import { CanonicalAST } from '../types/ast';
2
+ import { validateAST, MAX_AST_DEPTH } from './ast-validator';
3
+ import { ValidationError } from '../types/validation';
4
+
5
+ /**
6
+ * Deep clones and canonically sorts an object/array.
7
+ * Also detects circular references and unsupported types.
8
+ */
9
+ function canonicalize(
10
+ obj: unknown,
11
+ seen = new WeakSet(),
12
+ errors: ValidationError[] = [],
13
+ depth = 1
14
+ ): unknown {
15
+ if (depth > MAX_AST_DEPTH) {
16
+ errors.push({
17
+ type: 'MAX_DEPTH_EXCEEDED',
18
+ message: `Maximum AST depth exceeded (${MAX_AST_DEPTH}) during canonicalization`,
19
+ });
20
+ return null;
21
+ }
22
+
23
+ if (obj === null || typeof obj !== 'object') {
24
+ return obj;
25
+ }
26
+
27
+ if (seen.has(obj)) {
28
+ errors.push({
29
+ type: 'CIRCULAR_REFERENCE',
30
+ message: 'Invalid AST: Circular reference detected during canonicalization',
31
+ });
32
+ return null;
33
+ }
34
+
35
+ if (Object.prototype.toString.call(obj) !== '[object Object]' && !Array.isArray(obj)) {
36
+ errors.push({
37
+ type: 'INVALID_TYPE',
38
+ message: `Invalid AST: Unsupported type ${obj.constructor?.name || typeof obj}`,
39
+ });
40
+ return null;
41
+ }
42
+
43
+ seen.add(obj);
44
+
45
+ if (Array.isArray(obj)) {
46
+ // Process children first
47
+ const mapped = obj.map(item => canonicalize(item, seen, errors, depth + 1));
48
+
49
+ // Sort deterministically
50
+ mapped.sort((a, b) => {
51
+ const aIsObj = typeof a === 'object' && a !== null;
52
+ const bIsObj = typeof b === 'object' && b !== null;
53
+
54
+ if (aIsObj && bIsObj) {
55
+ if ('id' in a && 'id' in b) {
56
+ const idA = String(a.id);
57
+ const idB = String(b.id);
58
+ return idA < idB ? -1 : idA > idB ? 1 : 0;
59
+ }
60
+ if ('name' in a && 'name' in b) {
61
+ const nameA = String(a.name);
62
+ const nameB = String(b.name);
63
+ return nameA < nameB ? -1 : nameA > nameB ? 1 : 0;
64
+ }
65
+ }
66
+
67
+ // Fallback for primitives, heterogeneous objects, or objects without id/name
68
+ const strA = JSON.stringify(a);
69
+ const strB = JSON.stringify(b);
70
+ return strA < strB ? -1 : strA > strB ? 1 : 0;
71
+ });
72
+
73
+ seen.delete(obj);
74
+ return mapped;
75
+ }
76
+
77
+ // It is an object, sort its keys
78
+ const objAsRecord = obj as Record<string, unknown>;
79
+ const sortedKeys = Object.keys(objAsRecord).sort();
80
+ const result: Record<string, unknown> = {};
81
+ for (const key of sortedKeys) {
82
+ result[key] = canonicalize(objAsRecord[key], seen, errors, depth + 1);
83
+ }
84
+
85
+ seen.delete(obj);
86
+ return result;
87
+ }
88
+
89
+ /**
90
+ * Serializes the parsed memory model into a canonical JSON AST.
91
+ * Enforces `schemaVersion`, stable key ordering, and stable array ordering.
92
+ *
93
+ * @param ast The canonical AST to serialize
94
+ * @returns Byte-for-byte deterministic JSON string
95
+ * @throws {ASTValidationError} If validation or canonicalization fails
96
+ */
97
+ export function serializeAST(ast: CanonicalAST): [string | null, ValidationError[]] {
98
+ if (!ast || !ast.schemaVersion) {
99
+ return [null, [{ type: 'INVALID_FORMAT', message: 'Invalid AST: Missing schemaVersion' }]];
100
+ }
101
+
102
+ if (!Array.isArray(ast.domains)) {
103
+ return [null, [{ type: 'INVALID_FORMAT', message: 'Invalid AST: domains must be an array' }]];
104
+ }
105
+
106
+ // Validate semantics before serializing
107
+ const errors = validateAST(ast);
108
+ if (errors.length > 0) {
109
+ return [null, errors];
110
+ }
111
+
112
+ const canonicalErrors: ValidationError[] = [];
113
+ const canonical = canonicalize(ast, new WeakSet(), canonicalErrors, 1);
114
+
115
+ if (canonicalErrors.length > 0) {
116
+ return [null, canonicalErrors];
117
+ }
118
+
119
+ return [JSON.stringify(canonical), []];
120
+ }
@@ -0,0 +1,87 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "domains": [
4
+ {
5
+ "id": "domain-core",
6
+ "name": "Core System",
7
+ "version": "1.0.0",
8
+ "domain": "core",
9
+ "contracts": [
10
+ {
11
+ "id": "contract-viewable",
12
+ "name": "Viewable",
13
+ "description": "Can be viewed",
14
+ "requiredFields": [{ "name": "title", "type": "string" }],
15
+ "requiredCapabilities": [{ "name": "read", "type": "read" }]
16
+ }
17
+ ],
18
+ "entities": [
19
+ {
20
+ "id": "entity-page",
21
+ "name": "Page",
22
+ "fields": [
23
+ {
24
+ "id": "field-title",
25
+ "name": "title",
26
+ "type": "string",
27
+ "label": "Title",
28
+ "validation": [],
29
+ "metadata_path": "page.title"
30
+ },
31
+ {
32
+ "id": "field-author",
33
+ "name": "author",
34
+ "type": "string",
35
+ "references": "entity-user",
36
+ "label": "Author",
37
+ "validation": [],
38
+ "metadata_path": "page.author"
39
+ }
40
+ ],
41
+ "implements": ["contract-viewable"]
42
+ },
43
+ {
44
+ "id": "entity-user",
45
+ "name": "User",
46
+ "fields": [
47
+ {
48
+ "id": "field-username",
49
+ "name": "username",
50
+ "type": "string",
51
+ "label": "Username",
52
+ "validation": [],
53
+ "metadata_path": "user.username"
54
+ }
55
+ ]
56
+ }
57
+ ],
58
+ "capabilities": [
59
+ {
60
+ "id": "cap-read-page",
61
+ "name": "read",
62
+ "type": "read",
63
+ "entityId": "entity-page",
64
+ "permissions": [{ "role": "viewer", "access": "grant" }]
65
+ },
66
+ {
67
+ "id": "cap-edit-page",
68
+ "name": "update",
69
+ "type": "update",
70
+ "entityId": "entity-page",
71
+ "permissions": [
72
+ { "role": "editor", "access": "grant" },
73
+ { "role": "guest", "access": "deny" }
74
+ ]
75
+ }
76
+ ],
77
+ "extensions": [
78
+ {
79
+ "id": "ext-seo-metadata",
80
+ "name": "seo-plugin",
81
+ "plugin_version_range": "^1.0.0",
82
+ "implements": ["contract-viewable"]
83
+ }
84
+ ]
85
+ }
86
+ ]
87
+ }
@@ -0,0 +1,273 @@
1
+ ## 0.0.22 (2026-09-04)
2
+
3
+ ### 🚀 Features
4
+
5
+ - scaffold playground application and e2e testing suite with initial editor component and schema registry ([f097894](https://github.com/OrigoStudio/origo-design/commit/f097894))
6
+ - add GitHub Actions workflow to automate library releases using Nx Release ([3d6651f](https://github.com/OrigoStudio/origo-design/commit/3d6651f))
7
+
8
+ ### ❤️ Thank You
9
+
10
+ - Hardik Patel @hardikpatelse
11
+
12
+ ## 0.0.21 (2026-09-02)
13
+
14
+ ### 🚀 Features
15
+
16
+ - add centralized test registry tool with validation logic, CI integration, and documentation artifacts ([384c1c7](https://github.com/OrigoStudio/origo-design/commit/384c1c7))
17
+ - implement central test registry with validation tools and CI integration ([02cf656](https://github.com/OrigoStudio/origo-design/commit/02cf656))
18
+ - initialize negative testing story and update sprint status tracking ([bbe5fdc](https://github.com/OrigoStudio/origo-design/commit/bbe5fdc))
19
+ - implement CLI framework with validation, testing, and CI/CD workflows ([ff6ce55](https://github.com/OrigoStudio/origo-design/commit/ff6ce55))
20
+ - implement validate command and schema validation logic for BADL files ([4f9e41d](https://github.com/OrigoStudio/origo-design/commit/4f9e41d))
21
+ - implement path traversal guards, remove process termination from library logic, and enable error cause preservation in @origo/cli ([0854f78](https://github.com/OrigoStudio/origo-design/commit/0854f78))
22
+ - initialize web-based editor component and track security remediation tasks in implementation artifacts ([65716bd](https://github.com/OrigoStudio/origo-design/commit/65716bd))
23
+ - document e2e npm verification plan for cli package releases ([22dab4c](https://github.com/OrigoStudio/origo-design/commit/22dab4c))
24
+ - initialize sprint status tracking and retrospective verification story for npm packaging ([c326751](https://github.com/OrigoStudio/origo-design/commit/c326751))
25
+ - add generated bundle for epic7-worker-csp spike ([16ca492](https://github.com/OrigoStudio/origo-design/commit/16ca492))
26
+ - add web worker CSP spike and associated implementation documentation ([ebf5aa4](https://github.com/OrigoStudio/origo-design/commit/ebf5aa4))
27
+ - implement web worker CSP spike with supporting documentation and harness tools ([f57b1e5](https://github.com/OrigoStudio/origo-design/commit/f57b1e5))
28
+ - add technical spike story for Epic 7 web worker CSP validation and ADR planning ([c977487](https://github.com/OrigoStudio/origo-design/commit/c977487))
29
+ - initialize sprint status tracking and create Epic 7 discovery research story ([b37b967](https://github.com/OrigoStudio/origo-design/commit/b37b967))
30
+ - implement entity generator command with template customization and ejection support ([02a3193](https://github.com/OrigoStudio/origo-design/commit/02a3193))
31
+ - implement entity generator command and template ejection logic in CLI ([d7d519a](https://github.com/OrigoStudio/origo-design/commit/d7d519a))
32
+ - implementation of 6-2-local-schema-validation ([45e67f6](https://github.com/OrigoStudio/origo-design/commit/45e67f6))
33
+
34
+ ### ❤️ Thank You
35
+
36
+ - Hardik Patel @hardikpatelse
37
+
38
+ ## 0.0.20 (2026-08-25)
39
+
40
+ ### 🚀 Features
41
+
42
+ - implementation of 6-1-cli-initialization-and-scaffolding ([f6aca9e](https://github.com/OrigoStudio/origo-design/commit/f6aca9e))
43
+
44
+ ### ❤️ Thank You
45
+
46
+ - Hardik Patel @hardikpatelse
47
+
48
+ ## 0.0.19 (2026-08-23)
49
+
50
+ ### 🚀 Features
51
+
52
+ - 5.5-5-define-secure-by-default-boilerplate-templates ([0eb6dde](https://github.com/OrigoStudio/origo-design/commit/0eb6dde))
53
+
54
+ ### ❤️ Thank You
55
+
56
+ - Hardik Patel @hardikpatelse
57
+
58
+ ## 0.0.18 (2026-08-23)
59
+
60
+ ### 🚀 Features
61
+
62
+ - 5.5-4-verify-core-compiler-source-map-preservation ([a3b0d9b](https://github.com/OrigoStudio/origo-design/commit/a3b0d9b))
63
+
64
+ ### 🩹 Fixes
65
+
66
+ - pipeline issue ([c1bbe47](https://github.com/OrigoStudio/origo-design/commit/c1bbe47))
67
+
68
+ ### ❤️ Thank You
69
+
70
+ - Hardik Patel @hardikpatelse
71
+
72
+ ## 0.0.17 (2026-08-21)
73
+
74
+ ### 🚀 Features
75
+
76
+ - 5.5-3-resolve-recursive-schema-resolution-tech-debt ([943e2e7](https://github.com/OrigoStudio/origo-design/commit/943e2e7))
77
+ - 5.5-2-establish-end-to-end-qa-protocols ([d8990ae](https://github.com/OrigoStudio/origo-design/commit/d8990ae))
78
+ - 5.5-2-establish-end-to-end-qa-protocols ([a31d97a](https://github.com/OrigoStudio/origo-design/commit/a31d97a))
79
+
80
+ ### ❤️ Thank You
81
+
82
+ - Hardik Patel @hardikpatelse
83
+
84
+ ## 0.0.16 (2026-08-21)
85
+
86
+ ### 🚀 Features
87
+
88
+ - 5.5-1-create-usability-quickstart-guide ([e740a1a](https://github.com/OrigoStudio/origo-design/commit/e740a1a))
89
+
90
+ ### ❤️ Thank You
91
+
92
+ - Hardik Patel @hardikpatelse
93
+
94
+ ## 0.0.15 (2026-08-20)
95
+
96
+ ### 🚀 Features
97
+
98
+ - code-review 5-5-reactive-state-event-binding ([b235951](https://github.com/OrigoStudio/origo-design/commit/b235951))
99
+ - implementation of 5-5-reactive-state-event-binding ([3a5948a](https://github.com/OrigoStudio/origo-design/commit/3a5948a))
100
+ - story creation 5-5-reactive-state-event-binding ([21104c6](https://github.com/OrigoStudio/origo-design/commit/21104c6))
101
+
102
+ ### ❤️ Thank You
103
+
104
+ - Hardik Patel @hardikpatelse
105
+
106
+ ## 0.0.14 (2026-08-19)
107
+
108
+ ### 🚀 Features
109
+
110
+ - 5-4-design-token-consumption ([c1f64ed](https://github.com/OrigoStudio/origo-design/commit/c1f64ed))
111
+ - add sprint status update and design token consumption story documentation ([49aec07](https://github.com/OrigoStudio/origo-design/commit/49aec07))
112
+
113
+ ### ❤️ Thank You
114
+
115
+ - Hardik Patel @hardikpatelse
116
+
117
+ ## 0.0.13 (2026-08-18)
118
+
119
+ ### 🚀 Features
120
+
121
+ - implement core primitives (Button, VBox, TextInput) with improved property coercion and accessibility support ([1be1def](https://github.com/OrigoStudio/origo-design/commit/1be1def))
122
+ - implement VBox, TextInput, and Button core primitives with accessibility testing and improved adapter coercion ([532417f](https://github.com/OrigoStudio/origo-design/commit/532417f))
123
+
124
+ ### ❤️ Thank You
125
+
126
+ - Hardik Patel @hardikpatelse
127
+
128
+ ## 0.0.12 (2026-08-17)
129
+
130
+ ### 🚀 Features
131
+
132
+ - implement InteractionContract-based OrigoAdapter and transition angular-renderer architecture to web adapter pattern ([1a8ea32](https://github.com/OrigoStudio/origo-design/commit/1a8ea32))
133
+
134
+ ### ❤️ Thank You
135
+
136
+ - Hardik Patel @hardikpatelse
137
+
138
+ ## 0.0.11 (2026-08-14)
139
+
140
+ ### 🚀 Features
141
+
142
+ - implement angular-renderer package with AST-based dynamic component instantiation and registry support ([500f396](https://github.com/OrigoStudio/origo-design/commit/500f396))
143
+
144
+ ### ❤️ Thank You
145
+
146
+ - Hardik Patel @hardikpatelse
147
+
148
+ ## 0.0.10 (2026-08-14)
149
+
150
+ ### 🚀 Features
151
+
152
+ - implement extension API scaffolding, define Angular signals patterns, and add renderer test utilities ([d2adbed](https://github.com/OrigoStudio/origo-design/commit/d2adbed))
153
+ - mark Epic 4 as complete and record its retrospective action items in sprint status ([37c2caa](https://github.com/OrigoStudio/origo-design/commit/37c2caa))
154
+
155
+ ### ❤️ Thank You
156
+
157
+ - Hardik Patel @hardikpatelse
158
+
159
+ ## 0.0.9 (2026-08-14)
160
+
161
+ ### 🚀 Features
162
+
163
+ - implement extension manager with manifest validation, permission security, and dependency resolution ([154b0d4](https://github.com/OrigoStudio/origo-design/commit/154b0d4))
164
+
165
+ ### ❤️ Thank You
166
+
167
+ - Hardik Patel @hardikpatelse
168
+
169
+ ## 0.0.8 (2026-08-14)
170
+
171
+ ### 🚀 Features
172
+
173
+ - implement formal extension manifest, capability negotiation, and lifecycle management in core extension-api ([808f113](https://github.com/OrigoStudio/origo-design/commit/808f113))
174
+
175
+ ### ❤️ Thank You
176
+
177
+ - Hardik Patel @hardikpatelse
178
+
179
+ ## 0.0.7 (2026-08-14)
180
+
181
+ ### 🚀 Features
182
+
183
+ - implement behavior validation test suite and expand AST validator test coverage ([d4c79ef](https://github.com/OrigoStudio/origo-design/commit/d4c79ef))
184
+ - register behavior validation suite story and update sprint status tracking ([798ec74](https://github.com/OrigoStudio/origo-design/commit/798ec74))
185
+
186
+ ### ❤️ Thank You
187
+
188
+ - Hardik Patel @hardikpatelse
189
+
190
+ ## 0.0.6 (2026-08-13)
191
+
192
+ ### 🚀 Features
193
+
194
+ - implement AST validation engine with support for circular dependency detection and reference integrity checks ([afd48c9](https://github.com/OrigoStudio/origo-design/commit/afd48c9))
195
+ - initialize sprint-status.yaml to track project development and retrospective action items ([66c6cdf](https://github.com/OrigoStudio/origo-design/commit/66c6cdf))
196
+
197
+ ### ❤️ Thank You
198
+
199
+ - Hardik Patel @hardikpatelse
200
+
201
+ ## 0.0.5 (2026-08-13)
202
+
203
+ ### 🚀 Features
204
+
205
+ - **core:** implement security and permissions engine ([d066d90](https://github.com/OrigoStudio/origo-design/commit/d066d90))
206
+ - add story 4.3 for security and permissions engine and update sprint status ([3eb4aae](https://github.com/OrigoStudio/origo-design/commit/3eb4aae))
207
+
208
+ ### ❤️ Thank You
209
+
210
+ - Hardik Patel @hardikpatelse
211
+
212
+ ## 0.0.4 (2026-08-13)
213
+
214
+ ### 🚀 Features
215
+
216
+ - implement semantic AST validator with domain, entity, and contract schema definitions ([e969466](https://github.com/OrigoStudio/origo-design/commit/e969466))
217
+ - update sprint status and initialize story 4-2 contracts and implementations documentation ([4b37c59](https://github.com/OrigoStudio/origo-design/commit/4b37c59))
218
+
219
+ ### ❤️ Thank You
220
+
221
+ - Hardik Patel @hardikpatelse
222
+
223
+ ## 0.0.3 (2026-08-13)
224
+
225
+ ### 🚀 Features
226
+
227
+ - 4-1-capabilities-schema-parsing ([869c872](https://github.com/OrigoStudio/origo-design/commit/869c872))
228
+
229
+ ### ❤️ Thank You
230
+
231
+ - Hardik Patel @hardikpatelse
232
+
233
+ ## 0.0.2 (2026-08-12)
234
+
235
+ ### 🚀 Features
236
+
237
+ - implement defensive AST validation with depth limiting, circular reference detection, and graceful error reporting ([d2f5f98](https://github.com/OrigoStudio/origo-design/commit/d2f5f98))
238
+ - initialize 3-5-3-defensive-ast-traversal story and update sprint status ([4f82702](https://github.com/OrigoStudio/origo-design/commit/4f82702))
239
+ - enforce JSON import standard and document AST validator ([162db09](https://github.com/OrigoStudio/origo-design/commit/162db09))
240
+ - implement automated semantic versioning with Nx release and commitlint enforcement ([5e7a25e](https://github.com/OrigoStudio/origo-design/commit/5e7a25e))
241
+ - implement AST validation engine and documentation for semantic versioning workflow ([838e472](https://github.com/OrigoStudio/origo-design/commit/838e472))
242
+ - implement AST validation engine and associated implementation artifacts ([49cbdf0](https://github.com/OrigoStudio/origo-design/commit/49cbdf0))
243
+ - implement deterministic canonical AST serialization and interfaces in @origo/core ([c35a2c9](https://github.com/OrigoStudio/origo-design/commit/c35a2c9))
244
+ - implement domain and entity schema parser with Ajv-based validation and circular dependency detection in new @origo/core package ([4165b5f](https://github.com/OrigoStudio/origo-design/commit/4165b5f))
245
+ - add design tokens documentation and update Starlight navigation configuration ([ba2404a](https://github.com/OrigoStudio/origo-design/commit/ba2404a))
246
+ - initialize Epic 3 planning and document Epic 2 retrospective findings ([4cc46f9](https://github.com/OrigoStudio/origo-design/commit/4cc46f9))
247
+ - implement runtime theme fetching, injection, and Angular renderer integration to complete the token resolution contract ([87f583e](https://github.com/OrigoStudio/origo-design/commit/87f583e))
248
+ - implement theme-fetcher runtime utility and create angular-renderer package with theme initialization provider ([1d5b7ab](https://github.com/OrigoStudio/origo-design/commit/1d5b7ab))
249
+ - implement secure theme injection with CSS token validation and scope management ([a708825](https://github.com/OrigoStudio/origo-design/commit/a708825))
250
+ - implement runtime theme injector for parsing and applying CSS variables ([969fed5](https://github.com/OrigoStudio/origo-design/commit/969fed5))
251
+ - add astro, @astrojs/starlight, and sharp dependencies to package.json ([1c40a92](https://github.com/OrigoStudio/origo-design/commit/1c40a92))
252
+ - implement design token compilation pipeline with CSS variable parsing and generation ([0ffe822](https://github.com/OrigoStudio/origo-design/commit/0ffe822))
253
+ - **nx-cloud:** setup nx cloud workspace ([ee09042](https://github.com/OrigoStudio/origo-design/commit/ee09042))
254
+ - **design-tokens:** implement css compilation pipeline ([7bd632d](https://github.com/OrigoStudio/origo-design/commit/7bd632d))
255
+ - add script to generate automated LLM review prompts from git diffs ([1ddbd39](https://github.com/OrigoStudio/origo-design/commit/1ddbd39))
256
+ - scaffold @origo/design-tokens package with JSON schema validation and Nx configuration ([ae61244](https://github.com/OrigoStudio/origo-design/commit/ae61244))
257
+ - scaffold @origo/design-tokens library with JSON schema validation and initial token definitions ([efbecc9](https://github.com/OrigoStudio/origo-design/commit/efbecc9))
258
+ - initialize Astro documentation site and relocate internal project scripts to the tools directory. ([1cd8e71](https://github.com/OrigoStudio/origo-design/commit/1cd8e71))
259
+ - add documentation story spec and update epic-1 status to done ([b612ea3](https://github.com/OrigoStudio/origo-design/commit/b612ea3))
260
+ - initialize and populate agent skill definitions, workflows, and technical knowledge resources ([8668c52](https://github.com/OrigoStudio/origo-design/commit/8668c52))
261
+ - initialize Starlight documentation site within the monorepo and add benchmark tools ([9a16b03](https://github.com/OrigoStudio/origo-design/commit/9a16b03))
262
+ - implement performance benchmark harness with regression and SLA gate logic ([350d472](https://github.com/OrigoStudio/origo-design/commit/350d472))
263
+ - implement performance benchmark harness with CI regression gating and SLA validation ([3230ac9](https://github.com/OrigoStudio/origo-design/commit/3230ac9))
264
+ - implement Husky pre-commit hooks and Nx-based lint-staged configuration ([9181885](https://github.com/OrigoStudio/origo-design/commit/9181885))
265
+ - add GitHub Actions CI workflow, Husky pre-commit hooks, and update package.json with necessary configuration ([95b8bf1](https://github.com/OrigoStudio/origo-design/commit/95b8bf1))
266
+ - configure Husky, lint-staged, and GitHub CI workflow for automated quality enforcement ([b6bf597](https://github.com/OrigoStudio/origo-design/commit/b6bf597))
267
+ - initialize Nx monorepo workspace with core configuration and tooling ([fd0665a](https://github.com/OrigoStudio/origo-design/commit/fd0665a))
268
+ - add sprint tracking artifacts and automation script for project bootstrapping ([ddc6149](https://github.com/OrigoStudio/origo-design/commit/ddc6149))
269
+ - document Origo Design functional requirements and architectural scope ([d1e0b7f](https://github.com/OrigoStudio/origo-design/commit/d1e0b7f))
270
+
271
+ ### ❤️ Thank You
272
+
273
+ - Hardik Patel @hardikpatelse
@@ -0,0 +1,11 @@
1
+ # design-tokens
2
+
3
+ This library was generated with [Nx](https://nx.dev).
4
+
5
+ ## Building
6
+
7
+ Run `nx build design-tokens` to build the library.
8
+
9
+ ## Running unit tests
10
+
11
+ Run `nx test design-tokens` to execute the unit tests via [Jest](https://jestjs.io).
@@ -0,0 +1,25 @@
1
+ {
2
+ "name": "@origo/design-tokens",
3
+ "version": "0.0.22",
4
+ "private": false,
5
+ "type": "commonjs",
6
+ "main": "./src/index.js",
7
+ "types": "./src/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./src/index.d.ts",
11
+ "default": "./src/index.js"
12
+ },
13
+ "./runtime": {
14
+ "types": "./src/runtime/index.d.ts",
15
+ "default": "./src/runtime/index.js"
16
+ },
17
+ "./tokens.css": "./tokens.css",
18
+ "./tokens.json": "./tokens.json",
19
+ "./tokens.js": "./tokens.js"
20
+ },
21
+ "dependencies": {
22
+ "ajv": "^8.20.0"
23
+ },
24
+ "devDependencies": {}
25
+ }
@@ -0,0 +1,97 @@
1
+ export function parseTokens(
2
+ tokens: Record<string, unknown>,
3
+ prefix: string
4
+ ): Record<string, string> {
5
+ const result: Record<string, string> = {};
6
+
7
+ function traverse(obj: unknown, currentPath: string[]) {
8
+ if (!obj || typeof obj !== 'object') return;
9
+ for (const [key, value] of Object.entries(obj)) {
10
+ if (value && typeof value === 'object' && !Array.isArray(value)) {
11
+ if ('$value' in value) {
12
+ const sanitizedPath = currentPath.concat(key).map(k => k.replace(/[^a-zA-Z0-9-]/g, '-'));
13
+ const varName = `--${prefix}-${sanitizedPath.join('-')}`;
14
+
15
+ const tokenObj = value as Record<string, unknown>;
16
+ const val = tokenObj['$value'];
17
+ let valStr: string;
18
+
19
+ if (Array.isArray(val)) {
20
+ valStr = val.join(', ');
21
+ } else if (typeof val === 'object' && val !== null) {
22
+ valStr = JSON.stringify(val);
23
+ } else {
24
+ valStr = String(val);
25
+ }
26
+
27
+ result[varName] = valStr;
28
+ } else {
29
+ traverse(value, currentPath.concat(key));
30
+ }
31
+ }
32
+ }
33
+ }
34
+
35
+ traverse(tokens, []);
36
+
37
+ let changed = true;
38
+ let iterations = 0;
39
+ const maxIterations = 10;
40
+
41
+ while (changed && iterations < maxIterations) {
42
+ changed = false;
43
+ iterations++;
44
+ for (const [key, val] of Object.entries(result)) {
45
+ if (typeof val === 'string' && val.includes('{')) {
46
+ const newVal = val.replace(/\{([^}]+)\}/g, (match, refPath) => {
47
+ if (!refPath.trim()) throw new Error('Empty reference in token');
48
+ const sanitizedRefPath = refPath
49
+ .split('.')
50
+ .map((k: string) => k.replace(/[^a-zA-Z0-9-]/g, '-'))
51
+ .join('-');
52
+ const refVarName = `--${prefix}-${sanitizedRefPath}`;
53
+ if (refVarName === key) throw new Error(`Circular reference detected: ${key}`);
54
+ return `var(${refVarName})`;
55
+ });
56
+ if (newVal !== val) {
57
+ result[key] = newVal;
58
+ changed = true;
59
+ }
60
+ }
61
+ }
62
+ }
63
+
64
+ return result;
65
+ }
66
+
67
+ export function generateCssVariables(
68
+ baseTokensMap: Record<string, string>,
69
+ semanticTokensMap?: Record<string, string>
70
+ ): string {
71
+ let css = ':root{';
72
+
73
+ const usedBaseTokens = new Set<string>();
74
+ if (semanticTokensMap) {
75
+ for (const val of Object.values(semanticTokensMap)) {
76
+ const matches = val.match(/var\((--[^)]+)\)/g);
77
+ if (matches) {
78
+ matches.forEach(m => usedBaseTokens.add(m.slice(4, -1)));
79
+ }
80
+ }
81
+ }
82
+
83
+ for (const [key, value] of Object.entries(baseTokensMap)) {
84
+ if (!semanticTokensMap || usedBaseTokens.has(key)) {
85
+ css += `${key}:${value};`;
86
+ }
87
+ }
88
+
89
+ if (semanticTokensMap) {
90
+ for (const [key, value] of Object.entries(semanticTokensMap)) {
91
+ css += `${key}:${value};`;
92
+ }
93
+ }
94
+
95
+ css += '}';
96
+ return css;
97
+ }
@@ -0,0 +1,60 @@
1
+ import { readFileSync, writeFileSync, mkdirSync } from 'fs';
2
+ import { join } from 'path';
3
+ import { parseTokens, generateCssVariables } from './build';
4
+ import Ajv2020 from 'ajv/dist/2020';
5
+
6
+ function loadJson(path: string): Record<string, unknown> {
7
+ try {
8
+ return JSON.parse(readFileSync(path, 'utf8'));
9
+ } catch (e: unknown) {
10
+ throw new Error(`Failed to read or parse JSON at ${path}: ${(e as Error).message}`);
11
+ }
12
+ }
13
+
14
+ function main() {
15
+ const baseJsonPath = join(__dirname, 'tokens/base.json');
16
+ const semanticJsonPath = join(__dirname, 'tokens/semantic.json');
17
+ const baseSchemaPath = join(__dirname, 'schemas/base-tokens.schema.json');
18
+ const semanticSchemaPath = join(__dirname, 'schemas/semantic-tokens.schema.json');
19
+
20
+ const baseJson = loadJson(baseJsonPath);
21
+ const semanticJson = loadJson(semanticJsonPath);
22
+ const baseSchema = loadJson(baseSchemaPath);
23
+ const semanticSchema = loadJson(semanticSchemaPath);
24
+
25
+ const ajv = new Ajv2020({ allErrors: true, strict: false });
26
+ if (!ajv.validate(baseSchema, baseJson)) {
27
+ throw new Error(`Base tokens failed validation: ${ajv.errorsText()}`);
28
+ }
29
+ if (!ajv.validate(semanticSchema, semanticJson)) {
30
+ throw new Error(`Semantic tokens failed validation: ${ajv.errorsText()}`);
31
+ }
32
+
33
+ const baseTokens = parseTokens(baseJson, 'origo');
34
+ const semanticTokens = parseTokens(semanticJson, 'origo');
35
+
36
+ const css = generateCssVariables(baseTokens, semanticTokens);
37
+
38
+ const allTokens = { ...baseTokens, ...semanticTokens };
39
+
40
+ const outDir = join(__dirname, '..');
41
+ mkdirSync(outDir, { recursive: true });
42
+
43
+ // Write CSS
44
+ writeFileSync(join(outDir, 'tokens.css'), css, 'utf8');
45
+
46
+ // Write JSON
47
+ writeFileSync(join(outDir, 'tokens.json'), JSON.stringify(allTokens, null, 2), 'utf8');
48
+
49
+ // Write JS
50
+ const jsContent = `module.exports = ${JSON.stringify(allTokens, null, 2)};`;
51
+ writeFileSync(join(outDir, 'tokens.js'), jsContent, 'utf8');
52
+
53
+ // Write TS definitions
54
+ const tsContent = `declare const tokens: Record<string, string>;\nexport default tokens;`;
55
+ writeFileSync(join(outDir, 'tokens.d.ts'), tsContent, 'utf8');
56
+
57
+ console.log(`Successfully compiled design tokens to ${outDir}`);
58
+ }
59
+
60
+ main();