@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,555 +0,0 @@
1
- /**
2
- * View Components Generator
3
- *
4
- * Generates local versions of view components (FormView, ListView, DetailView, DashboardView)
5
- * that use locally generated hooks and utilities (no external dependencies).
6
- *
7
- * All view components are self-contained within the generated project with instance-factory-specific
8
- * endpoints (e.g., REST for Fastify, GraphQL for Apollo, etc.).
9
- */
10
-
11
- export interface ViewComponentsGeneratorContext {
12
- spec: any;
13
- manifest: any;
14
- }
15
-
16
- export async function generate(context: ViewComponentsGeneratorContext): Promise<{ [filename: string]: string }> {
17
- const files: { [filename: string]: string } = {};
18
-
19
- // Generate FormView.tsx
20
- files['FormView.tsx'] = generateFormView();
21
-
22
- // Generate ListView.tsx
23
- files['ListView.tsx'] = generateListView();
24
-
25
- // Generate DetailView.tsx
26
- files['DetailView.tsx'] = generateDetailView();
27
-
28
- // Generate DashboardView.tsx
29
- files['DashboardView.tsx'] = generateDashboardView();
30
-
31
- return files;
32
- }
33
-
34
- function generateFormView(): string {
35
- return `/**
36
- * StandardFormView - Controller-Based Form View Component
37
- *
38
- * LOCAL VERSION - Uses local hooks with instance-factory-specific API client
39
- *
40
- * Supports both Create and Edit modes with:
41
- * - Controller-driven form generation
42
- * - Smart input types (text, number, boolean, relationship selectors)
43
- * - Auto-generated field detection
44
- * - Validation and error handling
45
- * - Lifecycle management (Edit/Evolve tabs)
46
- * - Foreign key relationship fields
47
- * - Two-panel layout (form + entity list)
48
- */
49
-
50
- import { useState, useEffect, useMemo } from 'react';
51
- import { useAppStore } from '../../stores/appStore';
52
- import { useEntitiesQuery, useModelSchemaQuery, useExecuteOperationMutation, useAvailableTransitionsQuery, useTransitionStateMutation } from '../../hooks/useApi';
53
- import { isAutoGeneratedField, isFieldRequired, initializeFormData } from '../../utils/field-helpers';
54
- import { RelationshipField } from '../../components/RelationshipField';
55
- import type { View, Entity } from '../../types/api';
56
-
57
- type FormMode = 'create' | 'update';
58
- type ActiveTab = 'edit' | 'evolve';
59
-
60
- interface StandardFormViewProps {
61
- view: View;
62
- spec?: any; // Full spec for controller access
63
- }
64
-
65
- export function FormView({ view, spec }: StandardFormViewProps) {
66
- // Determine controller and model
67
- let controllerName: string;
68
- let modelName: string;
69
-
70
- if (view.controller && spec) {
71
- // New: Controller-based
72
- controllerName = view.controller;
73
- const controller = spec.controllers[view.controller];
74
- modelName = controller.model;
75
- } else {
76
- // Legacy: Model-based
77
- modelName = view.model as string;
78
- controllerName = \`\${modelName}Controller\`;
79
- }
80
-
81
- const [selectedEntity, setSelectedEntity] = useState<Entity | null>(null);
82
- const [formMode, setFormMode] = useState<FormMode>('create');
83
- const [activeTab, setActiveTab] = useState<ActiveTab>('edit');
84
- const [formData, setFormData] = useState<Record<string, any>>({});
85
- const [errors, setErrors] = useState<Record<string, string>>({});
86
- const [selectedLifecycleStates, setSelectedLifecycleStates] = useState<Record<string, string>>({});
87
-
88
- // Fetch entities and schema - USES LOCAL HOOKS
89
- const { data: entities = [], isLoading: entitiesLoading } = useEntitiesQuery(controllerName, modelName);
90
- const { data: schema } = useModelSchemaQuery(modelName);
91
- const { mutate: executeOperation, isPending } = useExecuteOperationMutation();
92
- const { mutate: transitionState, isPending: isTransitioning } = useTransitionStateMutation();
93
-
94
- const attributes = schema?.attributes || {};
95
- const relationships = schema?.relationships || {};
96
- const lifecycles = schema?.lifecycles || {};
97
-
98
- // Get entities store for relationship resolution
99
- const entitiesStore = useAppStore((state) => state.entities);
100
-
101
- // Sync selected entity with updated entities list
102
- useEffect(() => {
103
- if (selectedEntity && entities.length > 0) {
104
- const updatedEntity = entities.find((e) => e.id === selectedEntity.id);
105
- if (updatedEntity) {
106
- const oldStates = JSON.stringify(selectedEntity.metadata?.lifecycleStates || {});
107
- const newStates = JSON.stringify(updatedEntity.metadata?.lifecycleStates || {});
108
-
109
- if (oldStates !== newStates) {
110
- setSelectedEntity(updatedEntity);
111
- setSelectedLifecycleStates({ ...(updatedEntity.metadata?.lifecycleStates || {}) });
112
- }
113
- }
114
- }
115
- }, [entities, selectedEntity?.id]);
116
-
117
- // Initialize form data when schema changes or when switching modes
118
- useEffect(() => {
119
- if (selectedEntity && formMode === 'update') {
120
- setFormData({ ...selectedEntity.data });
121
- const currentStates = selectedEntity.metadata?.lifecycleStates || {};
122
- setSelectedLifecycleStates({ ...currentStates });
123
- } else if (schema?.attributes) {
124
- setFormData(initializeFormData(schema.attributes, { includeAutoGenerated: false }));
125
- setSelectedLifecycleStates({});
126
- }
127
- }, [selectedEntity, formMode, schema]);
128
-
129
- // Check if field should be shown
130
- const shouldShowField = (attrName: string, attrDef: any): boolean => {
131
- const isAuto = isAutoGeneratedField(attrName, attrDef);
132
- // In create mode, hide auto-generated fields
133
- if (formMode === 'create' && isAuto) {
134
- return false;
135
- }
136
- // In update mode, show all fields
137
- return true;
138
- };
139
-
140
- // Handle form submission
141
- const handleSubmit = async (e: React.FormEvent) => {
142
- e.preventDefault();
143
- setErrors({});
144
-
145
- const operation = formMode === 'create' ? 'create' : 'update';
146
- const params = formMode === 'update' && selectedEntity
147
- ? { ...formData, id: selectedEntity.id }
148
- : formData;
149
-
150
- executeOperation(
151
- { controllerName, operationName: operation, params },
152
- {
153
- onSuccess: () => {
154
- if (formMode === 'create') {
155
- setFormData(initializeFormData(schema.attributes, { includeAutoGenerated: false }));
156
- }
157
- setFormMode('create');
158
- setSelectedEntity(null);
159
- },
160
- onError: (error: any) => {
161
- setErrors({ _form: error.message || 'Operation failed' });
162
- }
163
- }
164
- );
165
- };
166
-
167
- // Handle entity selection for editing
168
- const handleEntitySelect = (entity: Entity) => {
169
- setSelectedEntity(entity);
170
- setFormMode('update');
171
- setActiveTab('edit');
172
- };
173
-
174
- // Handle lifecycle state transition
175
- const handleLifecycleTransition = (lifecycleName: string, toState: string) => {
176
- if (!selectedEntity) return;
177
-
178
- transitionState(
179
- { modelName, entityId: selectedEntity.id, toState, lifecycleName },
180
- {
181
- onSuccess: () => {
182
- setSelectedLifecycleStates((prev) => ({ ...prev, [lifecycleName]: toState }));
183
- },
184
- onError: (error: any) => {
185
- setErrors({ _lifecycle: error.message || 'Transition failed' });
186
- }
187
- }
188
- );
189
- };
190
-
191
- // Render field input
192
- const renderFieldInput = (attrName: string, attrDef: any) => {
193
- const value = formData[attrName] ?? '';
194
- const isRequired = isFieldRequired(attrDef);
195
-
196
- const handleChange = (newValue: any) => {
197
- setFormData((prev) => ({ ...prev, [attrName]: newValue }));
198
- };
199
-
200
- // Boolean field
201
- if (attrDef.type === 'Boolean') {
202
- return (
203
- <input
204
- type="checkbox"
205
- checked={!!value}
206
- onChange={(e) => handleChange(e.target.checked)}
207
- className="h-4 w-4 rounded border-gray-300"
208
- />
209
- );
210
- }
211
-
212
- // Number field
213
- if (attrDef.type === 'Integer' || attrDef.type === 'Float' || attrDef.type === 'Decimal') {
214
- return (
215
- <input
216
- type="number"
217
- value={value}
218
- onChange={(e) => handleChange(e.target.value ? Number(e.target.value) : '')}
219
- required={isRequired}
220
- className="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"
221
- />
222
- );
223
- }
224
-
225
- // Text field (default)
226
- return (
227
- <input
228
- type="text"
229
- value={value}
230
- onChange={(e) => handleChange(e.target.value)}
231
- required={isRequired}
232
- className="block w-full rounded-md border-gray-300 shadow-sm focus:border-blue-500 focus:ring-blue-500"
233
- />
234
- );
235
- };
236
-
237
- return (
238
- <div className="flex gap-4 h-full">
239
- {/* Form Panel */}
240
- <div className="flex-1 bg-white dark:bg-gray-800 rounded-lg shadow p-6">
241
- <h2 className="text-2xl font-bold mb-4 text-gray-800 dark:text-white">
242
- {formMode === 'create' ? \`Create \${modelName}\` : \`Edit \${modelName}\`}
243
- </h2>
244
-
245
- {/* Tabs for Edit/Evolve modes */}
246
- {formMode === 'update' && Object.keys(lifecycles).length > 0 && (
247
- <div className="flex gap-2 mb-4 border-b border-gray-200">
248
- <button
249
- onClick={() => setActiveTab('edit')}
250
- className={\`px-4 py-2 font-medium \${activeTab === 'edit' ? 'border-b-2 border-blue-500 text-blue-600' : 'text-gray-500'}\`}
251
- >
252
- Edit Data
253
- </button>
254
- <button
255
- onClick={() => setActiveTab('evolve')}
256
- className={\`px-4 py-2 font-medium \${activeTab === 'evolve' ? 'border-b-2 border-blue-500 text-blue-600' : 'text-gray-500'}\`}
257
- >
258
- Lifecycle
259
- </button>
260
- </div>
261
- )}
262
-
263
- {activeTab === 'edit' ? (
264
- <form onSubmit={handleSubmit} className="space-y-4">
265
- {errors._form && (
266
- <div className="p-3 bg-red-100 text-red-700 rounded-md">{errors._form}</div>
267
- )}
268
-
269
- {/* Attributes */}
270
- {Object.entries(attributes).map(([attrName, attrDef]: [string, any]) => {
271
- if (!shouldShowField(attrName, attrDef)) return null;
272
-
273
- return (
274
- <div key={attrName}>
275
- <label className="block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1">
276
- {attrName}
277
- {isFieldRequired(attrDef) && <span className="text-red-500">*</span>}
278
- </label>
279
- {renderFieldInput(attrName, attrDef)}
280
- </div>
281
- );
282
- })}
283
-
284
- {/* Relationships */}
285
- {Object.entries(relationships).map(([relName, relDef]: [string, any]) => (
286
- <RelationshipField
287
- key={relName}
288
- name={relName}
289
- definition={relDef}
290
- value={formData[relName]}
291
- onChange={(value) => setFormData((prev) => ({ ...prev, [relName]: value }))}
292
- entities={entitiesStore}
293
- />
294
- ))}
295
-
296
- <div className="flex gap-2 pt-4">
297
- <button
298
- type="submit"
299
- disabled={isPending}
300
- className="px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 disabled:opacity-50"
301
- >
302
- {isPending ? 'Saving...' : formMode === 'create' ? 'Create' : 'Update'}
303
- </button>
304
- {formMode === 'update' && (
305
- <button
306
- type="button"
307
- onClick={() => {
308
- setFormMode('create');
309
- setSelectedEntity(null);
310
- setFormData(initializeFormData(schema.attributes, { includeAutoGenerated: false }));
311
- }}
312
- className="px-4 py-2 bg-gray-500 text-white rounded-md hover:bg-gray-600"
313
- >
314
- Cancel
315
- </button>
316
- )}
317
- </div>
318
- </form>
319
- ) : (
320
- /* Lifecycle Tab */
321
- <div className="space-y-4">
322
- {errors._lifecycle && (
323
- <div className="p-3 bg-red-100 text-red-700 rounded-md">{errors._lifecycle}</div>
324
- )}
325
-
326
- {Object.entries(lifecycles).map(([lifecycleName, lifecycle]: [string, any]) => {
327
- const currentState = selectedLifecycleStates[lifecycleName] || lifecycle.initial;
328
-
329
- return (
330
- <div key={lifecycleName} className="border border-gray-200 rounded-lg p-4">
331
- <h3 className="font-semibold text-lg mb-2">{lifecycleName}</h3>
332
- <p className="text-sm text-gray-600 mb-3">Current: {currentState}</p>
333
-
334
- <div className="flex flex-wrap gap-2">
335
- {Object.keys(lifecycle.states || {}).map((state) => (
336
- <button
337
- key={state}
338
- onClick={() => handleLifecycleTransition(lifecycleName, state)}
339
- disabled={isTransitioning || state === currentState}
340
- className={\`px-3 py-1 rounded-md \${state === currentState ? 'bg-blue-600 text-white' : 'bg-gray-200 text-gray-700 hover:bg-gray-300'} disabled:opacity-50\`}
341
- >
342
- {state}
343
- </button>
344
- ))}
345
- </div>
346
- </div>
347
- );
348
- })}
349
- </div>
350
- )}
351
- </div>
352
-
353
- {/* Entity List Panel */}
354
- <div className="w-80 bg-white dark:bg-gray-800 rounded-lg shadow p-4">
355
- <h3 className="text-lg font-semibold mb-3 text-gray-800 dark:text-white">
356
- {modelName} List
357
- </h3>
358
-
359
- {entitiesLoading ? (
360
- <p className="text-gray-500">Loading...</p>
361
- ) : entities.length === 0 ? (
362
- <p className="text-gray-500 italic">No entities yet</p>
363
- ) : (
364
- <div className="space-y-2">
365
- {entities.map((entity) => (
366
- <div
367
- key={entity.id}
368
- onClick={() => handleEntitySelect(entity)}
369
- className={\`p-3 rounded-md cursor-pointer \${selectedEntity?.id === entity.id ? 'bg-blue-100 border-blue-500' : 'bg-gray-50 hover:bg-gray-100'} border\`}
370
- >
371
- <p className="font-medium text-sm">{entity.id}</p>
372
- {Object.entries(entity.data).slice(0, 2).map(([key, value]) => (
373
- <p key={key} className="text-xs text-gray-600">
374
- {key}: {String(value)}
375
- </p>
376
- ))}
377
- </div>
378
- ))}
379
- </div>
380
- )}
381
- </div>
382
- </div>
383
- );
384
- }
385
-
386
- export default FormView;
387
- `;
388
- }
389
-
390
- function generateListView(): string {
391
- return `/**
392
- * StandardListView - Controller-Based List View Component
393
- *
394
- * LOCAL VERSION - Uses local hooks with instance-factory-specific API client
395
- */
396
-
397
- import { useEntitiesQuery, useModelSchemaQuery } from '../../hooks/useApi';
398
- import type { View } from '../../types/api';
399
-
400
- interface StandardListViewProps {
401
- view: View;
402
- spec?: any;
403
- }
404
-
405
- export function ListView({ view, spec }: StandardListViewProps) {
406
- let controllerName: string;
407
- let modelName: string;
408
-
409
- if (view.controller && spec) {
410
- controllerName = view.controller;
411
- const controller = spec.controllers[view.controller];
412
- modelName = controller.model;
413
- } else {
414
- modelName = view.model as string;
415
- controllerName = \`\${modelName}Controller\`;
416
- }
417
-
418
- const { data: entities = [], isLoading } = useEntitiesQuery(controllerName, modelName);
419
- const { data: schema } = useModelSchemaQuery(modelName);
420
-
421
- if (isLoading) {
422
- return <div className="p-4">Loading...</div>;
423
- }
424
-
425
- return (
426
- <div className="p-6">
427
- <h2 className="text-2xl font-bold mb-4">{modelName} List</h2>
428
- <div className="overflow-x-auto">
429
- <table className="min-w-full bg-white border border-gray-200">
430
- <thead className="bg-gray-50">
431
- <tr>
432
- <th className="px-4 py-2 border-b">ID</th>
433
- {schema && Object.keys(schema.attributes || {}).map((attr) => (
434
- <th key={attr} className="px-4 py-2 border-b">{attr}</th>
435
- ))}
436
- </tr>
437
- </thead>
438
- <tbody>
439
- {entities.map((entity) => (
440
- <tr key={entity.id} className="hover:bg-gray-50">
441
- <td className="px-4 py-2 border-b">{entity.id}</td>
442
- {schema && Object.keys(schema.attributes || {}).map((attr) => (
443
- <td key={attr} className="px-4 py-2 border-b">
444
- {String(entity.data[attr] ?? '')}
445
- </td>
446
- ))}
447
- </tr>
448
- ))}
449
- </tbody>
450
- </table>
451
- </div>
452
- </div>
453
- );
454
- }
455
-
456
- export default ListView;
457
- `;
458
- }
459
-
460
- function generateDetailView(): string {
461
- return `/**
462
- * StandardDetailView - Controller-Based Detail View Component
463
- *
464
- * LOCAL VERSION - Uses local hooks with instance-factory-specific API client
465
- */
466
-
467
- import { useEntitiesQuery, useModelSchemaQuery } from '../../hooks/useApi';
468
- import type { View } from '../../types/api';
469
-
470
- interface StandardDetailViewProps {
471
- view: View;
472
- spec?: any;
473
- }
474
-
475
- export function DetailView({ view, spec }: StandardDetailViewProps) {
476
- let controllerName: string;
477
- let modelName: string;
478
-
479
- if (view.controller && spec) {
480
- controllerName = view.controller;
481
- const controller = spec.controllers[view.controller];
482
- modelName = controller.model;
483
- } else {
484
- modelName = view.model as string;
485
- controllerName = \`\${modelName}Controller\`;
486
- }
487
-
488
- const { data: entities = [] } = useEntitiesQuery(controllerName, modelName);
489
- const { data: schema } = useModelSchemaQuery(modelName);
490
- const entity = entities[0];
491
-
492
- if (!entity) {
493
- return <div className="p-4">No entity selected</div>;
494
- }
495
-
496
- return (
497
- <div className="p-6">
498
- <h2 className="text-2xl font-bold mb-4">{modelName} Detail</h2>
499
- <div className="space-y-2">
500
- <div>
501
- <span className="font-semibold">ID:</span> {entity.id}
502
- </div>
503
- {schema && Object.entries(schema.attributes || {}).map(([attr, def]: [string, any]) => (
504
- <div key={attr}>
505
- <span className="font-semibold">{attr}:</span> {String(entity.data[attr] ?? '')}
506
- </div>
507
- ))}
508
- </div>
509
- </div>
510
- );
511
- }
512
-
513
- export default DetailView;
514
- `;
515
- }
516
-
517
- function generateDashboardView(): string {
518
- return `/**
519
- * StandardDashboardView - Controller-Based Dashboard View Component
520
- *
521
- * LOCAL VERSION - Uses local hooks with instance-factory-specific API client
522
- */
523
-
524
- import type { View } from '../../types/api';
525
-
526
- interface StandardDashboardViewProps {
527
- view: View;
528
- spec?: any;
529
- }
530
-
531
- export function DashboardView({ view, spec }: StandardDashboardViewProps) {
532
- return (
533
- <div className="p-6">
534
- <h2 className="text-2xl font-bold mb-4">Dashboard</h2>
535
- <div className="grid grid-cols-3 gap-4">
536
- <div className="bg-white p-4 rounded-lg shadow">
537
- <h3 className="text-lg font-semibold">Card 1</h3>
538
- <p>Content here</p>
539
- </div>
540
- <div className="bg-white p-4 rounded-lg shadow">
541
- <h3 className="text-lg font-semibold">Card 2</h3>
542
- <p>Content here</p>
543
- </div>
544
- <div className="bg-white p-4 rounded-lg shadow">
545
- <h3 className="text-lg font-semibold">Card 3</h3>
546
- <p>Content here</p>
547
- </div>
548
- </div>
549
- </div>
550
- );
551
- }
552
-
553
- export default DashboardView;
554
- `;
555
- }
@@ -1,94 +0,0 @@
1
- /**
2
- * App.tsx Generator for React App
3
- *
4
- * Generates root App component with sidebar navigation grouped by model.
5
- * Only List and +New are in the nav — Detail is accessed via list row clicks.
6
- */
7
-
8
- import type { TemplateContext } from '@specverse/types';
9
-
10
- export default function generateAppTsx(context: TemplateContext): string {
11
- const { spec } = context;
12
-
13
- // Get views — handle both array and object formats
14
- let viewList: any[] = [];
15
- if (spec.views) {
16
- viewList = Array.isArray(spec.views) ? spec.views
17
- : Object.entries(spec.views).map(([name, def]: [string, any]) => ({ name, ...def }));
18
- }
19
-
20
- // Group views by model
21
- const modelViews = new Map<string, { list?: string; detail?: string; form?: string; other: string[] }>();
22
- const dashboardView: string | null = viewList.find((v: any) => v.type === 'dashboard')?.name || null;
23
-
24
- for (const view of viewList) {
25
- const model = Array.isArray(view.model) ? view.model[0] : (view.model || view.primaryModel);
26
- if (!model) continue;
27
- if (!modelViews.has(model)) modelViews.set(model, { other: [] });
28
- const entry = modelViews.get(model)!;
29
- const type = view.type || 'list';
30
- if (type === 'list') entry.list = view.name;
31
- else if (type === 'detail') entry.detail = view.name;
32
- else if (type === 'form') entry.form = view.name;
33
- else if (type !== 'dashboard') entry.other.push(view.name);
34
- }
35
-
36
- // Generate imports
37
- const imports = viewList.map((v: any) => `import ${v.name} from './components/${v.name}';`).join('\n');
38
-
39
- // Generate routes
40
- const routes = viewList.map((v: any) => {
41
- const path = `/${v.name.toLowerCase().replace('view', '')}`;
42
- return ` <Route path="${path}" element={<${v.name} />} />`;
43
- }).join('\n');
44
-
45
- // Default route
46
- const defaultView = dashboardView || viewList[0]?.name || 'div';
47
- const defaultElement = defaultView === 'div' ? '<div className="p-8">Welcome</div>' : `<${defaultView} />`;
48
-
49
- // Sidebar nav items grouped by model
50
- const navGroups = Array.from(modelViews.entries()).map(([model, views]) => {
51
- const lower = model.charAt(0).toLowerCase() + model.slice(1);
52
- const listPath = views.list ? `/${views.list.toLowerCase().replace('view', '')}` : '';
53
- const formPath = views.form ? `/${views.form.toLowerCase().replace('view', '')}` : '';
54
- return ` <div>
55
- <h3 className="px-3 text-xs font-semibold text-gray-400 uppercase tracking-wider mb-1">${model}s</h3>
56
- ${listPath ? ` <a href="${listPath}" className="block px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 rounded">Browse</a>` : ''}
57
- ${formPath ? ` <a href="${formPath}" className="block px-3 py-1.5 text-sm text-gray-700 hover:bg-gray-100 rounded">+ New</a>` : ''}
58
- </div>`;
59
- }).join('\n');
60
-
61
- return `import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
62
- ${imports}
63
-
64
- function App() {
65
- return (
66
- <Router>
67
- <div className="flex min-h-screen bg-gray-50">
68
- {/* Sidebar */}
69
- <aside className="w-56 bg-white border-r border-gray-200 p-4 space-y-5">
70
- <div>
71
- <h1 className="text-lg font-bold text-gray-900">SpecVerse App</h1>
72
- <p className="text-xs text-gray-400">Generated from specification</p>
73
- </div>
74
- ${dashboardView ? ` <a href="/dashboard" className="block px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-100 rounded">Dashboard</a>` : ''}
75
- ${navGroups}
76
- </aside>
77
-
78
- {/* Main content */}
79
- <main className="flex-1 overflow-auto">
80
- <Routes>
81
- <Route path="/" element={${defaultElement}} />
82
- ${dashboardView ? ` <Route path="/dashboard" element={<${dashboardView} />} />` : ''}
83
- ${routes}
84
- <Route path="*" element={<div className="p-8"><h1 className="text-2xl">404 - Not Found</h1></div>} />
85
- </Routes>
86
- </main>
87
- </div>
88
- </Router>
89
- );
90
- }
91
-
92
- export default App;
93
- `;
94
- }