@specverse/engines 4.1.30 → 4.2.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.
Files changed (285) hide show
  1. package/assets/examples/manifests/frontend-only.yaml +3 -6
  2. package/assets/examples/manifests/fullstack-app.yaml +5 -7
  3. package/assets/examples/manifests/fullstack-monorepo.yaml +3 -6
  4. package/assets/templates/default/specs/main.specly +65 -0
  5. package/dist/inference/comprehensive-engine.d.ts.map +1 -1
  6. package/dist/inference/comprehensive-engine.js +3 -19
  7. package/dist/inference/comprehensive-engine.js.map +1 -1
  8. package/dist/inference/core/rule-engine.d.ts +31 -0
  9. package/dist/inference/core/rule-engine.d.ts.map +1 -1
  10. package/dist/inference/core/rule-engine.js +117 -33
  11. package/dist/inference/core/rule-engine.js.map +1 -1
  12. package/dist/inference/core/rule-file-types.d.ts +0 -2
  13. package/dist/inference/core/rule-file-types.d.ts.map +1 -1
  14. package/dist/inference/core/rule-file-types.js +3 -6
  15. package/dist/inference/core/rule-file-types.js.map +1 -1
  16. package/dist/inference/core/rule-loader.d.ts +5 -15
  17. package/dist/inference/core/rule-loader.d.ts.map +1 -1
  18. package/dist/inference/core/rule-loader.js +43 -132
  19. package/dist/inference/core/rule-loader.js.map +1 -1
  20. package/dist/inference/core/types.d.ts +0 -6
  21. package/dist/inference/core/types.d.ts.map +1 -1
  22. package/dist/inference/core/types.js +0 -4
  23. package/dist/inference/core/types.js.map +1 -1
  24. package/dist/inference/logical/generators/component-type-resolver.d.ts +0 -26
  25. package/dist/inference/logical/generators/component-type-resolver.d.ts.map +1 -1
  26. package/dist/inference/logical/generators/component-type-resolver.js +0 -19
  27. package/dist/inference/logical/generators/component-type-resolver.js.map +1 -1
  28. package/dist/inference/logical/generators/specialist-view-expander.d.ts +1 -17
  29. package/dist/inference/logical/generators/specialist-view-expander.d.ts.map +1 -1
  30. package/dist/inference/logical/generators/specialist-view-expander.js +0 -15
  31. package/dist/inference/logical/generators/specialist-view-expander.js.map +1 -1
  32. package/dist/inference/logical/generators/view-generator.d.ts +4 -14
  33. package/dist/inference/logical/generators/view-generator.d.ts.map +1 -1
  34. package/dist/inference/logical/generators/view-generator.js +6 -26
  35. package/dist/inference/logical/generators/view-generator.js.map +1 -1
  36. package/dist/inference/logical/index.d.ts +2 -2
  37. package/dist/inference/logical/index.d.ts.map +1 -1
  38. package/dist/inference/logical/logical-engine.d.ts.map +1 -1
  39. package/dist/inference/logical/logical-engine.js +17 -80
  40. package/dist/inference/logical/logical-engine.js.map +1 -1
  41. package/dist/inference/quint-transpiler.d.ts +5 -3
  42. package/dist/inference/quint-transpiler.d.ts.map +1 -1
  43. package/dist/inference/quint-transpiler.js +11 -6
  44. package/dist/inference/quint-transpiler.js.map +1 -1
  45. package/dist/libs/instance-factories/CURVED-INTERFACE.md +278 -0
  46. package/dist/libs/instance-factories/README.md +73 -0
  47. package/dist/libs/instance-factories/applications/README.md +51 -0
  48. package/dist/libs/instance-factories/applications/generic-app.yaml +52 -0
  49. package/{libs/instance-factories/applications/react-app.yaml → dist/libs/instance-factories/applications/react-app-runtime.yaml} +30 -77
  50. package/dist/libs/instance-factories/applications/react-app-starter.yaml +143 -0
  51. package/dist/libs/instance-factories/applications/templates/react/env-example-generator.js +24 -2
  52. package/dist/libs/instance-factories/applications/templates/react/vite-config-generator.js +54 -33
  53. package/dist/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
  54. package/dist/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.js +69 -0
  55. package/dist/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.js +110 -0
  56. package/dist/libs/instance-factories/applications/templates/react-starter/belongs-to.js +40 -0
  57. package/dist/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.js +129 -0
  58. package/dist/libs/instance-factories/applications/templates/react-starter/detail-body-composer.js +80 -0
  59. package/dist/libs/instance-factories/applications/templates/react-starter/form-body-composer.js +217 -0
  60. package/dist/libs/instance-factories/applications/templates/react-starter/helpers-emitter.js +51 -0
  61. package/dist/libs/instance-factories/applications/templates/react-starter/html-to-jsx.js +192 -0
  62. package/dist/libs/instance-factories/applications/templates/react-starter/list-body-composer.js +56 -0
  63. package/dist/libs/instance-factories/applications/templates/react-starter/orchestrator.js +41 -0
  64. package/dist/libs/instance-factories/applications/templates/react-starter/package-json-generator.js +38 -0
  65. package/dist/libs/instance-factories/applications/templates/react-starter/regen-safety.js +89 -0
  66. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
  67. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
  68. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
  69. package/dist/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
  70. package/dist/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.js +95 -0
  71. package/dist/libs/instance-factories/applications/templates/react-starter/view-emitter.js +81 -0
  72. package/dist/libs/instance-factories/applications/templates/react-starter/views-generator.js +66 -0
  73. package/dist/libs/instance-factories/archived/fastify-prisma.yaml +104 -0
  74. package/dist/libs/instance-factories/cli/README.md +43 -0
  75. package/dist/libs/instance-factories/cli/commander-js.yaml +55 -0
  76. package/dist/libs/instance-factories/cli/templates/commander/command-generator.js +63 -12
  77. package/dist/libs/instance-factories/communication/README.md +47 -0
  78. package/dist/libs/instance-factories/communication/event-emitter.yaml +60 -0
  79. package/dist/libs/instance-factories/communication/rabbitmq-events.yaml +87 -0
  80. package/dist/libs/instance-factories/controllers/README.md +42 -0
  81. package/dist/libs/instance-factories/controllers/fastify.yaml +139 -0
  82. package/dist/libs/instance-factories/controllers/templates/fastify/server-generator.js +29 -2
  83. package/dist/libs/instance-factories/infrastructure/README.md +29 -0
  84. package/dist/libs/instance-factories/infrastructure/docker-k8s.yaml +61 -0
  85. package/dist/libs/instance-factories/orms/README.md +54 -0
  86. package/dist/libs/instance-factories/orms/prisma.yaml +89 -0
  87. package/dist/libs/instance-factories/orms/templates/prisma/schema-generator.js +2 -2
  88. package/dist/libs/instance-factories/scaffolding/README.md +49 -0
  89. package/dist/libs/instance-factories/scaffolding/generic-scaffold.yaml +65 -0
  90. package/dist/libs/instance-factories/sdks/README.md +28 -0
  91. package/dist/libs/instance-factories/sdks/python-sdk.yaml +66 -0
  92. package/dist/libs/instance-factories/sdks/typescript-sdk.yaml +59 -0
  93. package/dist/libs/instance-factories/services/README.md +55 -0
  94. package/dist/libs/instance-factories/services/prisma-services.yaml +71 -0
  95. package/dist/libs/instance-factories/storage/README.md +34 -0
  96. package/dist/libs/instance-factories/storage/mongodb.yaml +79 -0
  97. package/dist/libs/instance-factories/storage/postgresql.yaml +75 -0
  98. package/dist/libs/instance-factories/storage/redis.yaml +79 -0
  99. package/dist/libs/instance-factories/testing/README.md +40 -0
  100. package/dist/libs/instance-factories/testing/vitest-tests.yaml +63 -0
  101. package/dist/libs/instance-factories/tools/README.md +70 -0
  102. package/dist/libs/instance-factories/tools/mcp.yaml +36 -0
  103. package/dist/libs/instance-factories/tools/vscode.yaml +35 -0
  104. package/dist/libs/instance-factories/validation/README.md +38 -0
  105. package/dist/libs/instance-factories/validation/zod.yaml +56 -0
  106. package/dist/realize/engines/code-generator.d.ts.map +1 -1
  107. package/dist/realize/engines/code-generator.js +3 -0
  108. package/dist/realize/engines/code-generator.js.map +1 -1
  109. package/dist/realize/index.d.ts.map +1 -1
  110. package/dist/realize/index.js +15 -22
  111. package/dist/realize/index.js.map +1 -1
  112. package/dist/registry/utils/manifest-adapter.d.ts +8 -1
  113. package/dist/registry/utils/manifest-adapter.d.ts.map +1 -1
  114. package/dist/registry/utils/manifest-adapter.js +8 -1
  115. package/dist/registry/utils/manifest-adapter.js.map +1 -1
  116. package/libs/instance-factories/applications/react-app-starter.yaml +143 -0
  117. package/libs/instance-factories/applications/templates/react/env-example-generator.ts +24 -2
  118. package/libs/instance-factories/applications/templates/react/vite-config-generator.ts +54 -33
  119. package/libs/instance-factories/applications/templates/react-starter/README.md +211 -0
  120. package/libs/instance-factories/applications/templates/react-starter/__tests__/dashboard-body-composer.test.ts +153 -0
  121. package/libs/instance-factories/applications/templates/react-starter/__tests__/detail-body-composer.test.ts +146 -0
  122. package/libs/instance-factories/applications/templates/react-starter/__tests__/form-body-composer.test.ts +188 -0
  123. package/libs/instance-factories/applications/templates/react-starter/__tests__/helpers-emitter.test.ts +55 -0
  124. package/libs/instance-factories/applications/templates/react-starter/__tests__/html-to-jsx.test.ts +140 -0
  125. package/libs/instance-factories/applications/templates/react-starter/__tests__/list-body-composer.test.ts +146 -0
  126. package/libs/instance-factories/applications/templates/react-starter/__tests__/orchestrator.test.ts +184 -0
  127. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p2-factory-imports.test.ts +116 -0
  128. package/libs/instance-factories/applications/templates/react-starter/__tests__/parity-p3-rendered-output.test.ts +183 -0
  129. package/libs/instance-factories/applications/templates/react-starter/__tests__/regen-safety.test.ts +144 -0
  130. package/libs/instance-factories/applications/templates/react-starter/__tests__/starter-generators.test.ts +114 -0
  131. package/libs/instance-factories/applications/templates/react-starter/__tests__/view-emitter.test.ts +107 -0
  132. package/libs/instance-factories/applications/templates/react-starter/__tests__/views-generator.test.ts +139 -0
  133. package/libs/instance-factories/applications/templates/react-starter/api-types-starter-generator.ts +98 -0
  134. package/libs/instance-factories/applications/templates/react-starter/app-tsx-generator.ts +141 -0
  135. package/libs/instance-factories/applications/templates/react-starter/belongs-to.ts +82 -0
  136. package/libs/instance-factories/applications/templates/react-starter/dashboard-body-composer.ts +189 -0
  137. package/libs/instance-factories/applications/templates/react-starter/detail-body-composer.ts +135 -0
  138. package/libs/instance-factories/applications/templates/react-starter/form-body-composer.ts +383 -0
  139. package/libs/instance-factories/applications/templates/react-starter/helpers-emitter.ts +66 -0
  140. package/libs/instance-factories/applications/templates/react-starter/html-to-jsx.ts +334 -0
  141. package/libs/instance-factories/applications/templates/react-starter/list-body-composer.ts +146 -0
  142. package/libs/instance-factories/applications/templates/react-starter/orchestrator.ts +95 -0
  143. package/libs/instance-factories/applications/templates/react-starter/package-json-generator.ts +57 -0
  144. package/libs/instance-factories/applications/templates/react-starter/regen-safety.ts +157 -0
  145. package/libs/instance-factories/applications/templates/react-starter/skeletons/dashboard.tsx.template +49 -0
  146. package/libs/instance-factories/applications/templates/react-starter/skeletons/detail.tsx.template +96 -0
  147. package/libs/instance-factories/applications/templates/react-starter/skeletons/form.tsx.template +116 -0
  148. package/libs/instance-factories/applications/templates/react-starter/skeletons/list.tsx.template +74 -0
  149. package/libs/instance-factories/applications/templates/react-starter/use-api-hooks-starter-generator.ts +124 -0
  150. package/libs/instance-factories/applications/templates/react-starter/view-emitter.ts +209 -0
  151. package/libs/instance-factories/applications/templates/react-starter/views-generator.ts +137 -0
  152. package/libs/instance-factories/cli/templates/commander/command-generator.ts +63 -12
  153. package/libs/instance-factories/controllers/fastify.yaml +7 -0
  154. package/libs/instance-factories/controllers/templates/fastify/server-generator.ts +36 -2
  155. package/libs/instance-factories/orms/templates/prisma/schema-generator.ts +11 -4
  156. package/package.json +3 -3
  157. package/dist/libs/instance-factories/applications/templates/react/_view-components-source.js +0 -530
  158. package/dist/libs/instance-factories/applications/templates/react/app-tsx-generator.js +0 -73
  159. package/dist/libs/instance-factories/applications/templates/react/field-helpers-generator.js +0 -99
  160. package/dist/libs/instance-factories/applications/templates/react/package-json-generator.js +0 -49
  161. package/dist/libs/instance-factories/applications/templates/react/pattern-adapter-generator.js +0 -156
  162. package/dist/libs/instance-factories/applications/templates/react/react-pattern-adapter.js +0 -935
  163. package/dist/libs/instance-factories/applications/templates/react/relationship-field-generator.js +0 -143
  164. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.js +0 -646
  165. package/dist/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.js +0 -65
  166. package/dist/libs/instance-factories/applications/templates/react/view-dashboard-generator.js +0 -143
  167. package/dist/libs/instance-factories/applications/templates/react/view-detail-generator.js +0 -143
  168. package/dist/libs/instance-factories/applications/templates/react/view-form-generator.js +0 -355
  169. package/dist/libs/instance-factories/applications/templates/react/view-list-generator.js +0 -91
  170. package/dist/libs/instance-factories/applications/templates/react/view-router-generator.js +0 -79
  171. package/dist/libs/instance-factories/views/index.js +0 -48
  172. package/dist/libs/instance-factories/views/templates/react/adapters/antd-adapter.js +0 -742
  173. package/dist/libs/instance-factories/views/templates/react/adapters/mui-adapter.js +0 -824
  174. package/dist/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.js +0 -719
  175. package/dist/libs/instance-factories/views/templates/react/app-generator.js +0 -45
  176. package/dist/libs/instance-factories/views/templates/react/components-generator.js +0 -820
  177. package/dist/libs/instance-factories/views/templates/react/forms-generator.js +0 -275
  178. package/dist/libs/instance-factories/views/templates/react/frontend-package-json-generator.js +0 -46
  179. package/dist/libs/instance-factories/views/templates/react/hooks-generator.js +0 -81
  180. package/dist/libs/instance-factories/views/templates/react/index-css-generator.js +0 -9
  181. package/dist/libs/instance-factories/views/templates/react/index-html-generator.js +0 -23
  182. package/dist/libs/instance-factories/views/templates/react/main-tsx-generator.js +0 -21
  183. package/dist/libs/instance-factories/views/templates/react/react-component-generator.js +0 -299
  184. package/dist/libs/instance-factories/views/templates/react/router-generator.js +0 -136
  185. package/dist/libs/instance-factories/views/templates/react/router-generic-generator.js +0 -107
  186. package/dist/libs/instance-factories/views/templates/react/shared-utils-generator.js +0 -187
  187. package/dist/libs/instance-factories/views/templates/react/spec-json-generator.js +0 -7
  188. package/dist/libs/instance-factories/views/templates/react/types-generator.js +0 -56
  189. package/dist/libs/instance-factories/views/templates/react/views-metadata-generator.js +0 -27
  190. package/dist/libs/instance-factories/views/templates/react/vite-config-generator.js +0 -29
  191. package/dist/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js +0 -261
  192. package/dist/libs/instance-factories/views/templates/shared/adapter-types.js +0 -34
  193. package/dist/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -800
  194. package/dist/libs/instance-factories/views/templates/shared/base-generator.js +0 -305
  195. package/dist/libs/instance-factories/views/templates/shared/component-metadata.js +0 -517
  196. package/dist/libs/instance-factories/views/templates/shared/composite-pattern-types.js +0 -0
  197. package/dist/libs/instance-factories/views/templates/shared/composite-patterns.js +0 -445
  198. package/dist/libs/instance-factories/views/templates/shared/index.js +0 -80
  199. package/dist/libs/instance-factories/views/templates/shared/pattern-validator.js +0 -210
  200. package/dist/libs/instance-factories/views/templates/shared/property-mapper.js +0 -492
  201. package/dist/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -321
  202. package/dist/realize/index.js.bak +0 -758
  203. package/libs/instance-factories/applications/templates/react/_view-components-source.ts +0 -555
  204. package/libs/instance-factories/applications/templates/react/app-tsx-generator.ts +0 -94
  205. package/libs/instance-factories/applications/templates/react/field-helpers-generator.ts +0 -106
  206. package/libs/instance-factories/applications/templates/react/package-json-generator.ts +0 -57
  207. package/libs/instance-factories/applications/templates/react/pattern-adapter-generator.ts +0 -179
  208. package/libs/instance-factories/applications/templates/react/react-pattern-adapter.tsx +0 -1347
  209. package/libs/instance-factories/applications/templates/react/relationship-field-generator.ts +0 -150
  210. package/libs/instance-factories/applications/templates/react/tailwind-adapter-generator.ts +0 -704
  211. package/libs/instance-factories/applications/templates/react/tailwind-adapter-wrapper-generator.ts +0 -84
  212. package/libs/instance-factories/applications/templates/react/view-dashboard-generator.ts +0 -150
  213. package/libs/instance-factories/applications/templates/react/view-detail-generator.ts +0 -150
  214. package/libs/instance-factories/applications/templates/react/view-form-generator.ts +0 -362
  215. package/libs/instance-factories/applications/templates/react/view-list-generator.ts +0 -98
  216. package/libs/instance-factories/applications/templates/react/view-router-generator.ts +0 -89
  217. package/libs/instance-factories/views/README.md +0 -62
  218. package/libs/instance-factories/views/index.d.ts +0 -13
  219. package/libs/instance-factories/views/index.d.ts.map +0 -1
  220. package/libs/instance-factories/views/index.js +0 -18
  221. package/libs/instance-factories/views/index.js.map +0 -1
  222. package/libs/instance-factories/views/index.ts +0 -45
  223. package/libs/instance-factories/views/react-components.yaml +0 -129
  224. package/libs/instance-factories/views/templates/ARCHITECTURE.md +0 -198
  225. package/libs/instance-factories/views/templates/react/adapters/antd-adapter.ts +0 -869
  226. package/libs/instance-factories/views/templates/react/adapters/mui-adapter.ts +0 -953
  227. package/libs/instance-factories/views/templates/react/adapters/shadcn-adapter.ts +0 -806
  228. package/libs/instance-factories/views/templates/react/app-generator.ts +0 -55
  229. package/libs/instance-factories/views/templates/react/components-generator.ts +0 -938
  230. package/libs/instance-factories/views/templates/react/forms-generator.ts +0 -325
  231. package/libs/instance-factories/views/templates/react/frontend-package-json-generator.ts +0 -57
  232. package/libs/instance-factories/views/templates/react/hooks-generator.ts +0 -106
  233. package/libs/instance-factories/views/templates/react/index-css-generator.ts +0 -14
  234. package/libs/instance-factories/views/templates/react/index-html-generator.ts +0 -34
  235. package/libs/instance-factories/views/templates/react/main-tsx-generator.ts +0 -29
  236. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts +0 -152
  237. package/libs/instance-factories/views/templates/react/react-component-generator.d.ts.map +0 -1
  238. package/libs/instance-factories/views/templates/react/react-component-generator.js +0 -398
  239. package/libs/instance-factories/views/templates/react/react-component-generator.js.map +0 -1
  240. package/libs/instance-factories/views/templates/react/react-component-generator.ts +0 -533
  241. package/libs/instance-factories/views/templates/react/router-generator.ts +0 -197
  242. package/libs/instance-factories/views/templates/react/router-generic-generator.ts +0 -132
  243. package/libs/instance-factories/views/templates/react/shared-utils-generator.ts +0 -196
  244. package/libs/instance-factories/views/templates/react/spec-json-generator.ts +0 -17
  245. package/libs/instance-factories/views/templates/react/types-generator.ts +0 -76
  246. package/libs/instance-factories/views/templates/react/views-metadata-generator.ts +0 -42
  247. package/libs/instance-factories/views/templates/react/vite-config-generator.ts +0 -38
  248. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.d.ts.map +0 -1
  249. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.js.map +0 -1
  250. package/libs/instance-factories/views/templates/runtime/runtime-view-renderer.ts +0 -474
  251. package/libs/instance-factories/views/templates/shared/__tests__/composite-patterns.test.ts +0 -242
  252. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts +0 -77
  253. package/libs/instance-factories/views/templates/shared/adapter-types.d.ts.map +0 -1
  254. package/libs/instance-factories/views/templates/shared/adapter-types.js +0 -47
  255. package/libs/instance-factories/views/templates/shared/adapter-types.js.map +0 -1
  256. package/libs/instance-factories/views/templates/shared/adapter-types.ts +0 -142
  257. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts +0 -63
  258. package/libs/instance-factories/views/templates/shared/atomic-components-registry.d.ts.map +0 -1
  259. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js +0 -822
  260. package/libs/instance-factories/views/templates/shared/atomic-components-registry.js.map +0 -1
  261. package/libs/instance-factories/views/templates/shared/atomic-components-registry.ts +0 -908
  262. package/libs/instance-factories/views/templates/shared/base-generator.d.ts +0 -247
  263. package/libs/instance-factories/views/templates/shared/base-generator.d.ts.map +0 -1
  264. package/libs/instance-factories/views/templates/shared/base-generator.js +0 -363
  265. package/libs/instance-factories/views/templates/shared/base-generator.js.map +0 -1
  266. package/libs/instance-factories/views/templates/shared/base-generator.ts +0 -608
  267. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts +0 -254
  268. package/libs/instance-factories/views/templates/shared/component-metadata.d.ts.map +0 -1
  269. package/libs/instance-factories/views/templates/shared/component-metadata.js +0 -602
  270. package/libs/instance-factories/views/templates/shared/component-metadata.js.map +0 -1
  271. package/libs/instance-factories/views/templates/shared/component-metadata.ts +0 -803
  272. package/libs/instance-factories/views/templates/shared/composite-pattern-types.ts +0 -250
  273. package/libs/instance-factories/views/templates/shared/composite-patterns.ts +0 -535
  274. package/libs/instance-factories/views/templates/shared/index.ts +0 -68
  275. package/libs/instance-factories/views/templates/shared/pattern-validator.ts +0 -279
  276. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts +0 -149
  277. package/libs/instance-factories/views/templates/shared/property-mapper.d.ts.map +0 -1
  278. package/libs/instance-factories/views/templates/shared/property-mapper.js +0 -580
  279. package/libs/instance-factories/views/templates/shared/property-mapper.js.map +0 -1
  280. package/libs/instance-factories/views/templates/shared/property-mapper.ts +0 -700
  281. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts +0 -143
  282. package/libs/instance-factories/views/templates/shared/syntax-mapper.d.ts.map +0 -1
  283. package/libs/instance-factories/views/templates/shared/syntax-mapper.js +0 -420
  284. package/libs/instance-factories/views/templates/shared/syntax-mapper.js.map +0 -1
  285. package/libs/instance-factories/views/templates/shared/syntax-mapper.ts +0 -539
@@ -1,187 +0,0 @@
1
- function generateSharedUtils(context) {
2
- const files = [
3
- { path: "field-helpers.ts", content: generateFieldHelpers() },
4
- { path: "view-helpers.tsx", content: generateViewHelpers() }
5
- ];
6
- return { files };
7
- }
8
- function generateFieldHelpers() {
9
- return `/**
10
- * Field Helpers \u2014 shared utilities for field classification and display
11
- * Generated by SpecVerse React factory
12
- */
13
-
14
- const METADATA_FIELDS = new Set([
15
- 'id', 'createdAt', 'updatedAt', 'createdBy', 'updatedBy', 'deletedAt', 'version'
16
- ]);
17
-
18
- const AUTO_PATTERNS = new Set(['now', 'uuid4', 'autoincrement', 'auto']);
19
-
20
- /**
21
- * Check if a field is auto-generated (should be hidden from forms)
22
- */
23
- export function isAutoField(name: string, attr: any): boolean {
24
- if (attr?.auto && AUTO_PATTERNS.has(attr.auto)) return true;
25
- if (name === 'id') return true;
26
- if (METADATA_FIELDS.has(name) && attr?.type?.toLowerCase().includes('date')) return true;
27
- return false;
28
- }
29
-
30
- /**
31
- * Check if a field is metadata (shown last, styled muted)
32
- */
33
- export function isMetadataField(name: string): boolean {
34
- return METADATA_FIELDS.has(name);
35
- }
36
-
37
- /**
38
- * Get the best display name for an entity
39
- * Searches common name fields in priority order
40
- */
41
- export function getEntityDisplayName(entity: any): string {
42
- if (!entity) return 'Unknown';
43
- const METADATA = new Set(['id', 'createdAt', 'updatedAt', 'createdBy', 'updatedBy', 'deletedAt', 'version']);
44
- // Check common name fields first
45
- for (const field of ['name', 'title', 'displayName', 'label', 'username', 'email', 'subject', 'message', 'description']) {
46
- if (entity[field]) return String(entity[field]);
47
- }
48
- // Fall back to first non-metadata string value
49
- for (const [key, val] of Object.entries(entity)) {
50
- if (!METADATA.has(key) && val && typeof val === 'string' && !String(val).match(/^[0-9a-f-]{36}$/i)) {
51
- return String(val);
52
- }
53
- }
54
- return entity.id ? String(entity.id).slice(0, 8) + '...' : 'Unknown';
55
- }
56
-
57
- /**
58
- * Classify attributes into ordered groups for display
59
- */
60
- export function classifyFields(attributes: Array<{ name: string; type: string; auto?: string; required?: boolean }>): {
61
- business: typeof attributes;
62
- lifecycle: typeof attributes;
63
- metadata: typeof attributes;
64
- } {
65
- const business: typeof attributes = [];
66
- const lifecycle: typeof attributes = [];
67
- const metadata: typeof attributes = [];
68
-
69
- for (const attr of attributes) {
70
- if (isAutoField(attr.name, attr) || isMetadataField(attr.name)) {
71
- metadata.push(attr);
72
- } else if (attr.name === 'status' || attr.name === 'state' || attr.name === 'phase') {
73
- lifecycle.push(attr);
74
- } else {
75
- business.push(attr);
76
- }
77
- }
78
-
79
- return { business, lifecycle, metadata };
80
- }
81
- `;
82
- }
83
- function generateViewHelpers() {
84
- return `/**
85
- * View Helpers \u2014 formatting, colors, and UI utilities
86
- * Generated by SpecVerse React factory
87
- */
88
-
89
- /**
90
- * Format a value for display
91
- */
92
- export function formatValue(value: any, type?: string): string {
93
- if (value === null || value === undefined) return '\u2014';
94
- if (type?.toLowerCase().includes('date') || type?.toLowerCase().includes('timestamp')) {
95
- return formatDate(value);
96
- }
97
- if (typeof value === 'boolean') return value ? 'Yes' : 'No';
98
- return String(value);
99
- }
100
-
101
- /**
102
- * Format a date for display (relative for recent, absolute for old)
103
- */
104
- export function formatDate(value: any): string {
105
- if (!value) return '\u2014';
106
- const date = new Date(value);
107
- if (isNaN(date.getTime())) return String(value);
108
-
109
- const now = new Date();
110
- const diff = now.getTime() - date.getTime();
111
- const minutes = Math.floor(diff / 60000);
112
- const hours = Math.floor(diff / 3600000);
113
- const days = Math.floor(diff / 86400000);
114
-
115
- if (minutes < 1) return 'just now';
116
- if (minutes < 60) return \`\${minutes}m ago\`;
117
- if (hours < 24) return \`\${hours}h ago\`;
118
- if (days < 7) return \`\${days}d ago\`;
119
- return date.toLocaleDateString();
120
- }
121
-
122
- /**
123
- * Truncate text with ellipsis
124
- */
125
- export function truncate(text: string, max: number = 60): string {
126
- if (!text || text.length <= max) return text;
127
- return text.slice(0, max) + '...';
128
- }
129
-
130
- /**
131
- * Get a Tailwind color class for a lifecycle status
132
- */
133
- export function statusColor(status: string): { bg: string; text: string; dot: string } {
134
- const s = status?.toLowerCase().replace(/[_-]/g, '') || '';
135
-
136
- // Green states
137
- if (['active', 'done', 'completed', 'approved', 'published', 'resolved'].includes(s)) {
138
- return { bg: 'bg-green-50', text: 'text-green-700', dot: 'bg-green-500' };
139
- }
140
- // Blue states
141
- if (['inprogress', 'processing', 'review', 'pending'].includes(s)) {
142
- return { bg: 'bg-blue-50', text: 'text-blue-700', dot: 'bg-blue-500' };
143
- }
144
- // Yellow states
145
- if (['draft', 'todo', 'planning', 'waiting', 'scheduled'].includes(s)) {
146
- return { bg: 'bg-yellow-50', text: 'text-yellow-700', dot: 'bg-yellow-500' };
147
- }
148
- // Red states
149
- if (['cancelled', 'rejected', 'failed', 'overdue', 'blocked'].includes(s)) {
150
- return { bg: 'bg-red-50', text: 'text-red-700', dot: 'bg-red-500' };
151
- }
152
- // Gray states
153
- if (['archived', 'closed', 'deprecated', 'inactive', 'disabled'].includes(s)) {
154
- return { bg: 'bg-gray-50', text: 'text-gray-500', dot: 'bg-gray-400' };
155
- }
156
- // Default: indigo
157
- return { bg: 'bg-indigo-50', text: 'text-indigo-700', dot: 'bg-indigo-500' };
158
- }
159
-
160
- /**
161
- * StatusBadge component \u2014 matches app-demo's lifecycle badge styling
162
- */
163
- export function StatusBadge({ status, variant = 'default' }: { status: string; variant?: 'default' | 'lifecycle' }) {
164
- if (!status) return null;
165
-
166
- // Lifecycle badges use purple (matching app-demo)
167
- if (variant === 'lifecycle') {
168
- return (
169
- <span className="px-2 py-1 bg-purple-100 text-purple-700 rounded text-xs font-medium">
170
- {status.replace(/[_-]/g, ' ')}
171
- </span>
172
- );
173
- }
174
-
175
- const colors = statusColor(status);
176
- return (
177
- <span className={\`inline-flex items-center gap-1.5 px-2 py-1 rounded text-xs font-medium \${colors.bg} \${colors.text}\`}>
178
- <span className={\`w-1.5 h-1.5 rounded-full \${colors.dot}\`}></span>
179
- {status.replace(/[_-]/g, ' ')}
180
- </span>
181
- );
182
- }
183
- `;
184
- }
185
- export {
186
- generateSharedUtils as default
187
- };
@@ -1,7 +0,0 @@
1
- function generateSpecJson(context) {
2
- const { spec } = context;
3
- return JSON.stringify(spec, null, 2);
4
- }
5
- export {
6
- generateSpecJson as default
7
- };
@@ -1,56 +0,0 @@
1
- function generateModelTypes(context) {
2
- const { model } = context;
3
- if (!model) {
4
- throw new Error("Model is required in template context");
5
- }
6
- const modelName = model.name;
7
- let attributes = model.attributes || {};
8
- if (Array.isArray(attributes)) {
9
- const obj = {};
10
- attributes.forEach((attr) => {
11
- if (attr && typeof attr === "object" && attr.name) {
12
- obj[attr.name] = attr;
13
- } else if (Array.isArray(attr) && attr.length >= 2) {
14
- obj[attr[0]] = attr[1];
15
- }
16
- });
17
- attributes = obj;
18
- }
19
- const properties = Object.entries(attributes).map(([name, attr]) => {
20
- const tsType = mapToTypeScript(attr.type);
21
- const optional = !attr.constraints?.required ? "?" : "";
22
- return ` ${name}${optional}: ${tsType};`;
23
- }).join("\n");
24
- return `/**
25
- * ${modelName} Type Definition
26
- * Auto-generated from SpecVerse model
27
- */
28
-
29
- export interface ${modelName} {
30
- ${properties}
31
- }
32
-
33
- export type Create${modelName}Input = Omit<${modelName}, 'id' | 'createdAt' | 'updatedAt'>;
34
- export type Update${modelName}Input = Partial<Create${modelName}Input>;
35
- `;
36
- }
37
- function mapToTypeScript(type) {
38
- const typeMap = {
39
- "String": "string",
40
- "Integer": "number",
41
- "Float": "number",
42
- "Boolean": "boolean",
43
- "Date": "string",
44
- "DateTime": "string",
45
- "Timestamp": "string",
46
- "UUID": "string",
47
- "Email": "string",
48
- "URL": "string",
49
- "JSON": "Record<string, any>",
50
- "Array": "any[]"
51
- };
52
- return typeMap[type] || "any";
53
- }
54
- export {
55
- generateModelTypes as default
56
- };
@@ -1,27 +0,0 @@
1
- function generateViewsMetadata(context) {
2
- const { spec, views = [] } = context;
3
- const specViews = views.length > 0 ? views : spec?.views || [];
4
- const viewsArray = Array.isArray(specViews) ? specViews : Object.values(specViews);
5
- const metadata = {};
6
- viewsArray.forEach((viewDef) => {
7
- const viewName = viewDef.name;
8
- metadata[viewName] = {
9
- name: viewName,
10
- type: viewDef.type || "list",
11
- ...viewDef.description && { description: viewDef.description },
12
- model: viewDef.model,
13
- // Keep as-is (string or array for multi-model views)
14
- ...viewDef.uiComponents && { uiComponents: viewDef.uiComponents },
15
- ...viewDef.subscriptions && viewDef.subscriptions.length > 0 && {
16
- subscriptions: viewDef.subscriptions
17
- },
18
- routing: viewDef.routing || {
19
- path: `/${viewName.toLowerCase().replace(/view$/, "")}`
20
- }
21
- };
22
- });
23
- return JSON.stringify(metadata, null, 2);
24
- }
25
- export {
26
- generateViewsMetadata as default
27
- };
@@ -1,29 +0,0 @@
1
- function generateViteConfig(context) {
2
- const { backendPort = 3e3 } = context;
3
- return `import { defineConfig } from 'vite';
4
- import react from '@vitejs/plugin-react';
5
-
6
- // https://vitejs.dev/config/
7
- export default defineConfig({
8
- plugins: [react()],
9
- server: {
10
- port: 5173,
11
- host: true,
12
- proxy: {
13
- '/api': {
14
- target: 'http://localhost:${backendPort}',
15
- changeOrigin: true,
16
- rewrite: (path) => path
17
- }
18
- }
19
- },
20
- build: {
21
- outDir: 'dist',
22
- sourcemap: true
23
- }
24
- });
25
- `;
26
- }
27
- export {
28
- generateViteConfig as default
29
- };
@@ -1,261 +0,0 @@
1
- import React, { createElement, useState, useMemo } from "react";
2
- import {
3
- BaseComponentGenerator
4
- } from "../shared/base-generator.js";
5
- import { mapProperties } from "../shared/property-mapper.js";
6
- import { getComponentMetadata } from "../shared/component-metadata.js";
7
- class RuntimeViewRenderer extends BaseComponentGenerator {
8
- runtimeConfig;
9
- viewContext;
10
- constructor(adapter, config) {
11
- super(adapter, config);
12
- this.runtimeConfig = config;
13
- }
14
- // ============================================================================
15
- // Public API - Runtime Rendering
16
- // ============================================================================
17
- /**
18
- * Render view as React element (runtime)
19
- *
20
- * @param viewSpec - View specification
21
- * @param context - Runtime context (state, data, handlers)
22
- * @returns React element
23
- */
24
- renderRuntime(viewSpec, context) {
25
- this.viewContext = this.initializeContext(viewSpec, context);
26
- const components = this.renderComponentsRuntime(viewSpec.components);
27
- return createElement(
28
- "div",
29
- { className: "specverse-runtime-view", "data-view": viewSpec.name },
30
- components
31
- );
32
- }
33
- /**
34
- * Create a React component from view spec
35
- *
36
- * Returns a React component function that can be used directly
37
- *
38
- * @param viewSpec - View specification
39
- * @returns React component function
40
- */
41
- createRuntimeComponent(viewSpec) {
42
- const renderer = this;
43
- return function RuntimeViewComponent(props) {
44
- const [state, setState] = useState(
45
- () => renderer.initializeState(viewSpec.state)
46
- );
47
- const handlers = useMemo(
48
- () => renderer.createEventHandlers(viewSpec.events, state, setState),
49
- [state]
50
- );
51
- const context = {
52
- state,
53
- setState: (updates) => setState((prev) => ({ ...prev, ...updates })),
54
- handlers,
55
- data: props.data || {}
56
- };
57
- return renderer.renderRuntime(viewSpec, context);
58
- };
59
- }
60
- // ============================================================================
61
- // Abstract Method Implementations (Not Used in Runtime)
62
- // ============================================================================
63
- generateImports(viewSpec) {
64
- return "";
65
- }
66
- generateComponent(parts) {
67
- return "";
68
- }
69
- generateState(state) {
70
- return "";
71
- }
72
- generateEvents(events) {
73
- return "";
74
- }
75
- getFileExtension() {
76
- return "";
77
- }
78
- getAdditionalFiles(viewSpec) {
79
- return {};
80
- }
81
- // ============================================================================
82
- // Runtime-Specific Methods
83
- // ============================================================================
84
- /**
85
- * Initialize runtime context
86
- */
87
- initializeContext(viewSpec, context) {
88
- return {
89
- state: context?.state || this.initializeState(viewSpec.state),
90
- setState: context?.setState || (() => {
91
- }),
92
- handlers: context?.handlers || this.createEventHandlers(viewSpec.events),
93
- data: context?.data || {}
94
- };
95
- }
96
- /**
97
- * Initialize state from view spec
98
- */
99
- initializeState(state) {
100
- if (!state) return {};
101
- const initialState = {};
102
- for (const [name, def] of Object.entries(state)) {
103
- initialState[name] = def.initial;
104
- }
105
- return initialState;
106
- }
107
- /**
108
- * Create event handlers from view spec
109
- */
110
- createEventHandlers(events, state, setState) {
111
- if (!events) return {};
112
- const handlers = {};
113
- for (const [name, def] of Object.entries(events)) {
114
- handlers[`handle${this.capitalize(name)}`] = (...args) => {
115
- if (this.runtimeConfig.debug) {
116
- console.log(`[RuntimeView] Event: ${name}`, args);
117
- }
118
- try {
119
- const fn = new Function("state", "setState", "args", def.body);
120
- fn(state, setState, args);
121
- } catch (error) {
122
- console.error(`[RuntimeView] Event handler error (${name}):`, error);
123
- }
124
- };
125
- }
126
- return handlers;
127
- }
128
- /**
129
- * Render components as React elements
130
- */
131
- renderComponentsRuntime(components) {
132
- return Object.entries(components).map(
133
- ([name, component]) => this.renderComponentRuntime(component, {
134
- depth: 0,
135
- path: [name]
136
- })
137
- );
138
- }
139
- /**
140
- * Render single component as React element
141
- */
142
- renderComponentRuntime(component, context) {
143
- if (context.depth > this.MAX_DEPTH) {
144
- if (this.runtimeConfig.debug) {
145
- console.warn(`[RuntimeView] Max depth exceeded at ${context.path.join(".")}`);
146
- }
147
- return null;
148
- }
149
- const metadata = getComponentMetadata(component.type);
150
- if (!metadata) {
151
- console.warn(`[RuntimeView] Unknown component type: ${component.type}`);
152
- return null;
153
- }
154
- const mappedProps = component.properties ? mapProperties(component.type, component.properties, "runtime") : {};
155
- const props = {
156
- ...mappedProps,
157
- key: context.path.join("-")
158
- };
159
- if (component.condition && this.viewContext) {
160
- const condition = this.evaluateCondition(component.condition, this.viewContext);
161
- if (!condition) return null;
162
- }
163
- if (component.dataSource && this.viewContext) {
164
- return this.renderListRuntime(component, props, context);
165
- }
166
- let children = null;
167
- if (component.children && component.children.length > 0) {
168
- children = component.children.map(
169
- (child, index) => this.renderComponentRuntime(child, {
170
- ...context,
171
- depth: context.depth + 1,
172
- path: [...context.path, `child_${index}`]
173
- })
174
- );
175
- }
176
- const adapterComponent = this.adapter.components[component.type];
177
- if (!adapterComponent) {
178
- console.warn(`[RuntimeView] No adapter for component: ${component.type}`);
179
- return null;
180
- }
181
- return this.createElementFromAdapter(component.type, props, children);
182
- }
183
- /**
184
- * Render list of items
185
- */
186
- renderListRuntime(component, props, context) {
187
- if (!this.viewContext) return null;
188
- const dataArray = this.viewContext.data[component.dataSource];
189
- if (!Array.isArray(dataArray)) {
190
- console.warn(`[RuntimeView] Data source not found: ${component.dataSource}`);
191
- return null;
192
- }
193
- const items = dataArray.map((item, index) => {
194
- const itemProps = {
195
- ...props,
196
- ...item,
197
- key: `${context.path.join("-")}-${index}`
198
- };
199
- return this.createElementFromAdapter(component.type, itemProps, null);
200
- });
201
- return createElement(React.Fragment, null, ...items);
202
- }
203
- /**
204
- * Create React element from adapter component
205
- */
206
- createElementFromAdapter(type, props, children) {
207
- return createElement(
208
- "div",
209
- {
210
- ...props,
211
- className: `specverse-runtime-${type} ${props.className || ""}`.trim(),
212
- "data-component": type
213
- },
214
- children
215
- );
216
- }
217
- /**
218
- * Evaluate condition expression
219
- */
220
- evaluateCondition(condition, context) {
221
- try {
222
- const fn = new Function("state", "data", `return ${condition}`);
223
- return fn(context.state, context.data);
224
- } catch (error) {
225
- console.error(`[RuntimeView] Condition evaluation error:`, error);
226
- return false;
227
- }
228
- }
229
- /**
230
- * Capitalize first letter
231
- */
232
- capitalize(str) {
233
- return str.charAt(0).toUpperCase() + str.slice(1);
234
- }
235
- }
236
- function createRuntimeRenderer(adapter, config) {
237
- const defaultConfig = {
238
- framework: "runtime",
239
- target: "runtime",
240
- liveReload: false,
241
- debug: false,
242
- maxDepth: 3,
243
- enableWarnings: true
244
- };
245
- const finalConfig = { ...defaultConfig, ...config };
246
- return new RuntimeViewRenderer(adapter, finalConfig);
247
- }
248
- function renderView(viewSpec, adapter, context) {
249
- const renderer = createRuntimeRenderer(adapter);
250
- return renderer.renderRuntime(viewSpec, context);
251
- }
252
- function createViewComponent(viewSpec, adapter) {
253
- const renderer = createRuntimeRenderer(adapter);
254
- return renderer.createRuntimeComponent(viewSpec);
255
- }
256
- export {
257
- RuntimeViewRenderer,
258
- createRuntimeRenderer,
259
- createViewComponent,
260
- renderView
261
- };
@@ -1,34 +0,0 @@
1
- function renderProps(props) {
2
- return Object.entries(props).filter(([_, value]) => value !== void 0 && value !== null).map(([key, value]) => {
3
- if (typeof value === "boolean") {
4
- return value ? key : "";
5
- }
6
- if (typeof value === "string") {
7
- return `${key}="${value}"`;
8
- }
9
- if (typeof value === "number") {
10
- return `${key}={${value}}`;
11
- }
12
- if (Array.isArray(value)) {
13
- return `${key}={${JSON.stringify(value)}}`;
14
- }
15
- if (typeof value === "object") {
16
- return `${key}={${JSON.stringify(value)}}`;
17
- }
18
- return `${key}={${value}}`;
19
- }).filter(Boolean).join(" ");
20
- }
21
- function indent(code, level = 0) {
22
- const spaces = " ".repeat(level);
23
- return code.split("\n").map((line) => line ? spaces + line : line).join("\n");
24
- }
25
- function wrapWithChildren(openTag, children, closeTag, indentLevel = 0) {
26
- return `${openTag}
27
- ${indent(children, indentLevel + 1)}
28
- ${indent(closeTag, indentLevel)}`;
29
- }
30
- export {
31
- indent,
32
- renderProps,
33
- wrapWithChildren
34
- };