davaux 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (333) hide show
  1. package/BASELINE.md +169 -0
  2. package/CLAUDE.md +518 -0
  3. package/LICENSE +21 -0
  4. package/README.md +36 -0
  5. package/ROADMAP.md +198 -0
  6. package/build.mjs +101 -0
  7. package/client/control.ts +247 -0
  8. package/client/hydrate.ts +37 -0
  9. package/client/index.ts +19 -0
  10. package/client/jsx-runtime.ts +209 -0
  11. package/client/resource.ts +122 -0
  12. package/client/signal.ts +211 -0
  13. package/client/store.ts +110 -0
  14. package/client/useHead.ts +63 -0
  15. package/dist/build/config.d.ts +3 -0
  16. package/dist/build/config.d.ts.map +1 -0
  17. package/dist/build/config.js +38 -0
  18. package/dist/build/config.js.map +7 -0
  19. package/dist/build/index.d.ts +2 -0
  20. package/dist/build/index.d.ts.map +1 -0
  21. package/dist/build/index.js +13 -0
  22. package/dist/build/index.js.map +7 -0
  23. package/dist/build/plugins.d.ts +7 -0
  24. package/dist/build/plugins.d.ts.map +1 -0
  25. package/dist/build/plugins.js +85 -0
  26. package/dist/build/plugins.js.map +7 -0
  27. package/dist/cli.d.ts +2 -0
  28. package/dist/cli.d.ts.map +1 -0
  29. package/dist/cli.js +427 -0
  30. package/dist/cli.js.map +7 -0
  31. package/dist/client/control.d.ts +49 -0
  32. package/dist/client/control.d.ts.map +1 -0
  33. package/dist/client/control.js +154 -0
  34. package/dist/client/control.js.map +7 -0
  35. package/dist/client/hydrate.d.ts +7 -0
  36. package/dist/client/hydrate.d.ts.map +1 -0
  37. package/dist/client/hydrate.js +23 -0
  38. package/dist/client/hydrate.js.map +7 -0
  39. package/dist/client/index.d.ts +12 -0
  40. package/dist/client/index.d.ts.map +1 -0
  41. package/dist/client/index.js +32 -0
  42. package/dist/client/index.js.map +7 -0
  43. package/dist/client/jsx-runtime.d.ts +40 -0
  44. package/dist/client/jsx-runtime.d.ts.map +1 -0
  45. package/dist/client/jsx-runtime.js +139 -0
  46. package/dist/client/jsx-runtime.js.map +7 -0
  47. package/dist/client/resource.d.ts +31 -0
  48. package/dist/client/resource.d.ts.map +1 -0
  49. package/dist/client/resource.js +64 -0
  50. package/dist/client/resource.js.map +7 -0
  51. package/dist/client/signal.d.ts +90 -0
  52. package/dist/client/signal.d.ts.map +1 -0
  53. package/dist/client/signal.js +115 -0
  54. package/dist/client/signal.js.map +7 -0
  55. package/dist/client/store.d.ts +26 -0
  56. package/dist/client/store.d.ts.map +1 -0
  57. package/dist/client/store.js +63 -0
  58. package/dist/client/store.js.map +7 -0
  59. package/dist/client/useHead.d.ts +28 -0
  60. package/dist/client/useHead.d.ts.map +1 -0
  61. package/dist/client/useHead.js +33 -0
  62. package/dist/client/useHead.js.map +7 -0
  63. package/dist/config.d.ts +182 -0
  64. package/dist/config.d.ts.map +1 -0
  65. package/dist/config.js +21 -0
  66. package/dist/config.js.map +7 -0
  67. package/dist/create-multisite.d.ts +2 -0
  68. package/dist/create-multisite.d.ts.map +1 -0
  69. package/dist/create-multisite.js +291 -0
  70. package/dist/create-multisite.js.map +7 -0
  71. package/dist/create.d.ts +2 -0
  72. package/dist/create.d.ts.map +1 -0
  73. package/dist/create.js +179 -0
  74. package/dist/create.js.map +7 -0
  75. package/dist/dev/blueprints.d.ts +11 -0
  76. package/dist/dev/blueprints.d.ts.map +1 -0
  77. package/dist/dev/blueprints.js +65 -0
  78. package/dist/dev/blueprints.js.map +7 -0
  79. package/dist/dev/components.d.ts +19 -0
  80. package/dist/dev/components.d.ts.map +1 -0
  81. package/dist/dev/components.js +87 -0
  82. package/dist/dev/components.js.map +7 -0
  83. package/dist/dev/insert.d.ts +11 -0
  84. package/dist/dev/insert.d.ts.map +1 -0
  85. package/dist/dev/insert.js +160 -0
  86. package/dist/dev/insert.js.map +7 -0
  87. package/dist/dev/remove.d.ts +53 -0
  88. package/dist/dev/remove.d.ts.map +1 -0
  89. package/dist/dev/remove.js +518 -0
  90. package/dist/dev/remove.js.map +7 -0
  91. package/dist/dev/watch.d.ts +26 -0
  92. package/dist/dev/watch.d.ts.map +1 -0
  93. package/dist/dev/watch.js +2905 -0
  94. package/dist/dev/watch.js.map +7 -0
  95. package/dist/errors.d.ts +6 -0
  96. package/dist/errors.d.ts.map +1 -0
  97. package/dist/errors.js +63 -0
  98. package/dist/errors.js.map +7 -0
  99. package/dist/generate.d.ts +2 -0
  100. package/dist/generate.d.ts.map +1 -0
  101. package/dist/generate.js +191 -0
  102. package/dist/generate.js.map +7 -0
  103. package/dist/index.d.ts +9 -0
  104. package/dist/index.d.ts.map +1 -0
  105. package/dist/index.js +57 -0
  106. package/dist/index.js.map +7 -0
  107. package/dist/island.d.ts +24 -0
  108. package/dist/island.d.ts.map +1 -0
  109. package/dist/island.js +15 -0
  110. package/dist/island.js.map +7 -0
  111. package/dist/jsx-runtime.d.ts +406 -0
  112. package/dist/jsx-runtime.d.ts.map +1 -0
  113. package/dist/jsx-runtime.js +90 -0
  114. package/dist/jsx-runtime.js.map +7 -0
  115. package/dist/link.d.ts +27 -0
  116. package/dist/link.d.ts.map +1 -0
  117. package/dist/link.js +29 -0
  118. package/dist/link.js.map +7 -0
  119. package/dist/oml/fragment.d.ts +16 -0
  120. package/dist/oml/fragment.d.ts.map +1 -0
  121. package/dist/oml/fragment.js +26 -0
  122. package/dist/oml/fragment.js.map +7 -0
  123. package/dist/oml/index.d.ts +11 -0
  124. package/dist/oml/index.d.ts.map +1 -0
  125. package/dist/oml/index.js +21 -0
  126. package/dist/oml/index.js.map +7 -0
  127. package/dist/oml/jsx-runtime.d.ts +34 -0
  128. package/dist/oml/jsx-runtime.d.ts.map +1 -0
  129. package/dist/oml/jsx-runtime.js +59 -0
  130. package/dist/oml/jsx-runtime.js.map +7 -0
  131. package/dist/oml/jsx.d.ts +14 -0
  132. package/dist/oml/jsx.d.ts.map +1 -0
  133. package/dist/oml/jsx.js +96 -0
  134. package/dist/oml/jsx.js.map +7 -0
  135. package/dist/oml/page.d.ts +7 -0
  136. package/dist/oml/page.d.ts.map +1 -0
  137. package/dist/oml/page.js +6 -0
  138. package/dist/oml/page.js.map +7 -0
  139. package/dist/oml/render.d.ts +13 -0
  140. package/dist/oml/render.d.ts.map +1 -0
  141. package/dist/oml/render.js +117 -0
  142. package/dist/oml/render.js.map +7 -0
  143. package/dist/oml/types.d.ts +79 -0
  144. package/dist/oml/types.d.ts.map +1 -0
  145. package/dist/oml/types.js +64 -0
  146. package/dist/oml/types.js.map +7 -0
  147. package/dist/router/handler.d.ts +53 -0
  148. package/dist/router/handler.d.ts.map +1 -0
  149. package/dist/router/handler.js +342 -0
  150. package/dist/router/handler.js.map +7 -0
  151. package/dist/router/matcher.d.ts +21 -0
  152. package/dist/router/matcher.d.ts.map +1 -0
  153. package/dist/router/matcher.js +28 -0
  154. package/dist/router/matcher.js.map +7 -0
  155. package/dist/router/scanner.d.ts +17 -0
  156. package/dist/router/scanner.d.ts.map +1 -0
  157. package/dist/router/scanner.js +197 -0
  158. package/dist/router/scanner.js.map +7 -0
  159. package/dist/server/index.d.ts +23 -0
  160. package/dist/server/index.d.ts.map +1 -0
  161. package/dist/server/index.js +29 -0
  162. package/dist/server/index.js.map +7 -0
  163. package/dist/signal.d.ts +15 -0
  164. package/dist/signal.d.ts.map +1 -0
  165. package/dist/signal.js +29 -0
  166. package/dist/signal.js.map +7 -0
  167. package/dist/ssg.d.ts +45 -0
  168. package/dist/ssg.d.ts.map +1 -0
  169. package/dist/ssg.js +175 -0
  170. package/dist/ssg.js.map +7 -0
  171. package/dist/test/actions.test.d.ts +2 -0
  172. package/dist/test/actions.test.d.ts.map +1 -0
  173. package/dist/test/body-limits.test.d.ts +2 -0
  174. package/dist/test/body-limits.test.d.ts.map +1 -0
  175. package/dist/test/errors.test.d.ts +2 -0
  176. package/dist/test/errors.test.d.ts.map +1 -0
  177. package/dist/test/fixtures/routes/[id].page.d.ts +4 -0
  178. package/dist/test/fixtures/routes/[id].page.d.ts.map +1 -0
  179. package/dist/test/fixtures/routes/_error.d.ts +3 -0
  180. package/dist/test/fixtures/routes/_error.d.ts.map +1 -0
  181. package/dist/test/fixtures/routes/_global.d.ts +3 -0
  182. package/dist/test/fixtures/routes/_global.d.ts.map +1 -0
  183. package/dist/test/fixtures/routes/_layout-template.d.ts +3 -0
  184. package/dist/test/fixtures/routes/_layout-template.d.ts.map +1 -0
  185. package/dist/test/fixtures/routes/_layout.d.ts +3 -0
  186. package/dist/test/fixtures/routes/_layout.d.ts.map +1 -0
  187. package/dist/test/fixtures/routes/_layout_scripts.d.ts +3 -0
  188. package/dist/test/fixtures/routes/_layout_scripts.d.ts.map +1 -0
  189. package/dist/test/fixtures/routes/_middleware.d.ts +3 -0
  190. package/dist/test/fixtures/routes/_middleware.d.ts.map +1 -0
  191. package/dist/test/fixtures/routes/_redirect301_mw.d.ts +3 -0
  192. package/dist/test/fixtures/routes/_redirect301_mw.d.ts.map +1 -0
  193. package/dist/test/fixtures/routes/_redirect_mw.d.ts +3 -0
  194. package/dist/test/fixtures/routes/_redirect_mw.d.ts.map +1 -0
  195. package/dist/test/fixtures/routes/about.page.d.ts +3 -0
  196. package/dist/test/fixtures/routes/about.page.d.ts.map +1 -0
  197. package/dist/test/fixtures/routes/action.page.d.ts +6 -0
  198. package/dist/test/fixtures/routes/action.page.d.ts.map +1 -0
  199. package/dist/test/fixtures/routes/api/form-all.post.d.ts +3 -0
  200. package/dist/test/fixtures/routes/api/form-all.post.d.ts.map +1 -0
  201. package/dist/test/fixtures/routes/api/form-limited.post.d.ts +6 -0
  202. package/dist/test/fixtures/routes/api/form-limited.post.d.ts.map +1 -0
  203. package/dist/test/fixtures/routes/api/response-obj.get.d.ts +3 -0
  204. package/dist/test/fixtures/routes/api/response-obj.get.d.ts.map +1 -0
  205. package/dist/test/fixtures/routes/api/upload.post.d.ts +12 -0
  206. package/dist/test/fixtures/routes/api/upload.post.d.ts.map +1 -0
  207. package/dist/test/fixtures/routes/api/users.get.d.ts +6 -0
  208. package/dist/test/fixtures/routes/api/users.get.d.ts.map +1 -0
  209. package/dist/test/fixtures/routes/api/xml.get.d.ts +3 -0
  210. package/dist/test/fixtures/routes/api/xml.get.d.ts.map +1 -0
  211. package/dist/test/fixtures/routes/auth/_middleware.d.ts +3 -0
  212. package/dist/test/fixtures/routes/auth/_middleware.d.ts.map +1 -0
  213. package/dist/test/fixtures/routes/auth/protected.page.d.ts +3 -0
  214. package/dist/test/fixtures/routes/auth/protected.page.d.ts.map +1 -0
  215. package/dist/test/fixtures/routes/index.page.d.ts +3 -0
  216. package/dist/test/fixtures/routes/index.page.d.ts.map +1 -0
  217. package/dist/test/fixtures/routes/oml.page.d.ts +3 -0
  218. package/dist/test/fixtures/routes/oml.page.d.ts.map +1 -0
  219. package/dist/test/fixtures/routes/redirect.page.d.ts +3 -0
  220. package/dist/test/fixtures/routes/redirect.page.d.ts.map +1 -0
  221. package/dist/test/fixtures/routes/ssg/[slug].page.d.ts +5 -0
  222. package/dist/test/fixtures/routes/ssg/[slug].page.d.ts.map +1 -0
  223. package/dist/test/fixtures/routes/ssg/server.page.d.ts +4 -0
  224. package/dist/test/fixtures/routes/ssg/server.page.d.ts.map +1 -0
  225. package/dist/test/fixtures/routes/state.page.d.ts +3 -0
  226. package/dist/test/fixtures/routes/state.page.d.ts.map +1 -0
  227. package/dist/test/fixtures/routes/throw.page.d.ts +3 -0
  228. package/dist/test/fixtures/routes/throw.page.d.ts.map +1 -0
  229. package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts +3 -0
  230. package/dist/test/fixtures/routes/wiki/[...slug].page.d.ts.map +1 -0
  231. package/dist/test/helpers.d.ts +37 -0
  232. package/dist/test/helpers.d.ts.map +1 -0
  233. package/dist/test/layouts.test.d.ts +2 -0
  234. package/dist/test/layouts.test.d.ts.map +1 -0
  235. package/dist/test/middleware.test.d.ts +2 -0
  236. package/dist/test/middleware.test.d.ts.map +1 -0
  237. package/dist/test/multipart.test.d.ts +2 -0
  238. package/dist/test/multipart.test.d.ts.map +1 -0
  239. package/dist/test/oml-routing.test.d.ts +2 -0
  240. package/dist/test/oml-routing.test.d.ts.map +1 -0
  241. package/dist/test/oml.test.d.ts +2 -0
  242. package/dist/test/oml.test.d.ts.map +1 -0
  243. package/dist/test/redirects.test.d.ts +2 -0
  244. package/dist/test/redirects.test.d.ts.map +1 -0
  245. package/dist/test/routing.test.d.ts +2 -0
  246. package/dist/test/routing.test.d.ts.map +1 -0
  247. package/dist/test/ssg.test.d.ts +2 -0
  248. package/dist/test/ssg.test.d.ts.map +1 -0
  249. package/dist/test/web-response.test.d.ts +2 -0
  250. package/dist/test/web-response.test.d.ts.map +1 -0
  251. package/dist/types.d.ts +314 -0
  252. package/dist/types.d.ts.map +1 -0
  253. package/dist/types.js +292 -0
  254. package/dist/types.js.map +7 -0
  255. package/package.json +103 -0
  256. package/pka.config.json +32 -0
  257. package/src/build/config.ts +42 -0
  258. package/src/build/index.ts +6 -0
  259. package/src/build/plugins.ts +118 -0
  260. package/src/cli.ts +502 -0
  261. package/src/config.ts +197 -0
  262. package/src/create-multisite.ts +310 -0
  263. package/src/create.ts +194 -0
  264. package/src/dev/blueprints.ts +75 -0
  265. package/src/dev/components.ts +108 -0
  266. package/src/dev/insert.ts +221 -0
  267. package/src/dev/remove.ts +677 -0
  268. package/src/dev/watch.ts +3098 -0
  269. package/src/env.d.ts +5 -0
  270. package/src/errors.ts +64 -0
  271. package/src/generate.ts +228 -0
  272. package/src/index.ts +67 -0
  273. package/src/island.ts +47 -0
  274. package/src/jsx-runtime.d.ts +408 -0
  275. package/src/jsx-runtime.d.ts.map +1 -0
  276. package/src/jsx-runtime.ts +536 -0
  277. package/src/link.ts +49 -0
  278. package/src/oml/fragment.ts +54 -0
  279. package/src/oml/index.ts +21 -0
  280. package/src/oml/jsx-runtime.ts +121 -0
  281. package/src/oml/jsx.ts +151 -0
  282. package/src/oml/page.ts +13 -0
  283. package/src/oml/render.ts +181 -0
  284. package/src/oml/types.ts +159 -0
  285. package/src/router/handler.ts +515 -0
  286. package/src/router/matcher.ts +52 -0
  287. package/src/router/scanner.ts +272 -0
  288. package/src/server/index.ts +49 -0
  289. package/src/signal.ts +39 -0
  290. package/src/ssg.ts +253 -0
  291. package/src/test/actions.test.ts +40 -0
  292. package/src/test/body-limits.test.ts +83 -0
  293. package/src/test/errors.test.ts +53 -0
  294. package/src/test/fixtures/routes/[id].page.ts +3 -0
  295. package/src/test/fixtures/routes/_error.ts +6 -0
  296. package/src/test/fixtures/routes/_global.ts +8 -0
  297. package/src/test/fixtures/routes/_layout-template.ts +7 -0
  298. package/src/test/fixtures/routes/_layout.ts +7 -0
  299. package/src/test/fixtures/routes/_layout_scripts.ts +8 -0
  300. package/src/test/fixtures/routes/_middleware.ts +8 -0
  301. package/src/test/fixtures/routes/_redirect301_mw.ts +5 -0
  302. package/src/test/fixtures/routes/_redirect_mw.ts +5 -0
  303. package/src/test/fixtures/routes/about.page.ts +6 -0
  304. package/src/test/fixtures/routes/action.page.ts +11 -0
  305. package/src/test/fixtures/routes/api/form-all.post.ts +5 -0
  306. package/src/test/fixtures/routes/api/form-limited.post.ts +6 -0
  307. package/src/test/fixtures/routes/api/response-obj.get.ts +17 -0
  308. package/src/test/fixtures/routes/api/upload.post.ts +14 -0
  309. package/src/test/fixtures/routes/api/users.get.ts +3 -0
  310. package/src/test/fixtures/routes/api/xml.get.ts +5 -0
  311. package/src/test/fixtures/routes/auth/_middleware.ts +11 -0
  312. package/src/test/fixtures/routes/auth/protected.page.ts +3 -0
  313. package/src/test/fixtures/routes/index.page.ts +3 -0
  314. package/src/test/fixtures/routes/oml.page.ts +7 -0
  315. package/src/test/fixtures/routes/redirect.page.ts +3 -0
  316. package/src/test/fixtures/routes/ssg/[slug].page.ts +8 -0
  317. package/src/test/fixtures/routes/ssg/server.page.ts +5 -0
  318. package/src/test/fixtures/routes/state.page.ts +4 -0
  319. package/src/test/fixtures/routes/throw.page.ts +5 -0
  320. package/src/test/fixtures/routes/wiki/[...slug].page.ts +3 -0
  321. package/src/test/helpers.ts +132 -0
  322. package/src/test/layouts.test.ts +76 -0
  323. package/src/test/middleware.test.ts +69 -0
  324. package/src/test/multipart.test.ts +91 -0
  325. package/src/test/oml-routing.test.ts +59 -0
  326. package/src/test/oml.test.ts +429 -0
  327. package/src/test/redirects.test.ts +32 -0
  328. package/src/test/routing.test.ts +118 -0
  329. package/src/test/ssg.test.ts +273 -0
  330. package/src/test/web-response.test.ts +33 -0
  331. package/src/types.ts +670 -0
  332. package/tsconfig.client.json +17 -0
  333. package/tsconfig.json +20 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dev/blueprints.ts"],
4
+ "sourcesContent": ["import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs'\nimport { extname, join } from 'node:path'\nimport { renderToHtml } from '../oml/render.js'\nimport type { OmlBlueprint, OmlPropSchema, OmlPropType } from '../oml/types.js'\nimport { parseOmlBlueprint } from '../oml/types.js'\n\nexport type BlueprintEntry = {\n id: string\n name: string\n props: Record<string, OmlPropSchema>\n previewHtml: string\n jsxSnippet: string\n imports: Record<string, string>\n}\n\nfunction collectJsonFiles(dir: string, out: string[]): void {\n if (!existsSync(dir)) return\n for (const entry of readdirSync(dir)) {\n const full = join(dir, entry)\n if (statSync(full).isDirectory()) {\n collectJsonFiles(full, out)\n } else if (extname(entry) === '.json') {\n out.push(full)\n }\n }\n}\n\nfunction propPlaceholder(schema: OmlPropSchema): string {\n if (schema.default !== undefined) {\n const d = schema.default\n if (typeof d === 'string') return `\"${d}\"`\n return `{${JSON.stringify(d)}}`\n }\n const placeholders: Record<OmlPropType, string> = {\n string: '\"example\"',\n number: '{0}',\n boolean: '{false}',\n function: '{() => {}}',\n node: '\"content\"',\n array: '{[]}',\n }\n return placeholders[schema.type] ?? '\"example\"'\n}\n\nfunction toUsageJsx(bp: OmlBlueprint): string {\n const entries = Object.entries(bp.props)\n if (entries.length === 0) return `<${bp.name} />`\n const lines = entries.map(([name, schema]) => ` ${name}=${propPlaceholder(schema)}`)\n return `<${bp.name}\\n${lines.join('\\n')}\\n/>`\n}\n\nexport function scanBlueprints(cwd: string): BlueprintEntry[] {\n const files: string[] = []\n collectJsonFiles(join(cwd, 'src', 'blueprints'), files)\n collectJsonFiles(join(cwd, 'src', 'components'), files)\n\n const results: BlueprintEntry[] = []\n for (const filePath of files) {\n try {\n const raw = JSON.parse(readFileSync(filePath, 'utf-8'))\n const bp = parseOmlBlueprint(raw)\n results.push({\n id: bp.id,\n name: bp.name,\n props: bp.props,\n previewHtml: bp.output ? renderToHtml(bp.output) : '',\n jsxSnippet: toUsageJsx(bp),\n imports: bp.imports ?? {},\n })\n } catch {\n // Skip files that aren't valid blueprints\n }\n }\n return results\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAY,aAAa,cAAc,gBAAgB;AAChE,SAAS,SAAS,YAAY;AAC9B,SAAS,oBAAoB;AAE7B,SAAS,yBAAyB;AAWlC,SAAS,iBAAiB,KAAa,KAAqB;AAC1D,MAAI,CAAC,WAAW,GAAG,EAAG;AACtB,aAAW,SAAS,YAAY,GAAG,GAAG;AACpC,UAAM,OAAO,KAAK,KAAK,KAAK;AAC5B,QAAI,SAAS,IAAI,EAAE,YAAY,GAAG;AAChC,uBAAiB,MAAM,GAAG;AAAA,IAC5B,WAAW,QAAQ,KAAK,MAAM,SAAS;AACrC,UAAI,KAAK,IAAI;AAAA,IACf;AAAA,EACF;AACF;AAEA,SAAS,gBAAgB,QAA+B;AACtD,MAAI,OAAO,YAAY,QAAW;AAChC,UAAM,IAAI,OAAO;AACjB,QAAI,OAAO,MAAM,SAAU,QAAO,IAAI,CAAC;AACvC,WAAO,IAAI,KAAK,UAAU,CAAC,CAAC;AAAA,EAC9B;AACA,QAAM,eAA4C;AAAA,IAChD,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,UAAU;AAAA,IACV,MAAM;AAAA,IACN,OAAO;AAAA,EACT;AACA,SAAO,aAAa,OAAO,IAAI,KAAK;AACtC;AAEA,SAAS,WAAW,IAA0B;AAC5C,QAAM,UAAU,OAAO,QAAQ,GAAG,KAAK;AACvC,MAAI,QAAQ,WAAW,EAAG,QAAO,IAAI,GAAG,IAAI;AAC5C,QAAM,QAAQ,QAAQ,IAAI,CAAC,CAAC,MAAM,MAAM,MAAM,KAAK,IAAI,IAAI,gBAAgB,MAAM,CAAC,EAAE;AACpF,SAAO,IAAI,GAAG,IAAI;AAAA,EAAK,MAAM,KAAK,IAAI,CAAC;AAAA;AACzC;AAEO,SAAS,eAAe,KAA+B;AAC5D,QAAM,QAAkB,CAAC;AACzB,mBAAiB,KAAK,KAAK,OAAO,YAAY,GAAG,KAAK;AACtD,mBAAiB,KAAK,KAAK,OAAO,YAAY,GAAG,KAAK;AAEtD,QAAM,UAA4B,CAAC;AACnC,aAAW,YAAY,OAAO;AAC5B,QAAI;AACF,YAAM,MAAM,KAAK,MAAM,aAAa,UAAU,OAAO,CAAC;AACtD,YAAM,KAAK,kBAAkB,GAAG;AAChC,cAAQ,KAAK;AAAA,QACX,IAAI,GAAG;AAAA,QACP,MAAM,GAAG;AAAA,QACT,OAAO,GAAG;AAAA,QACV,aAAa,GAAG,SAAS,aAAa,GAAG,MAAM,IAAI;AAAA,QACnD,YAAY,WAAW,EAAE;AAAA,QACzB,SAAS,GAAG,WAAW,CAAC;AAAA,MAC1B,CAAC;AAAA,IACH,QAAQ;AAAA,IAER;AAAA,EACF;AACA,SAAO;AACT;",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import type { OmlPropSchema } from '../oml/types.js';
2
+ export type ComponentEntry = {
3
+ name: string;
4
+ file: string;
5
+ importPath: string;
6
+ props: Record<string, OmlPropSchema>;
7
+ hasBlueprintAlready: boolean;
8
+ };
9
+ export declare function scanComponents(dir: string, cwd: string, blueprintsDir: string): ComponentEntry[];
10
+ export declare function updateBlueprint(id: string, name: string, props: Record<string, OmlPropSchema>, blueprintsDir: string): {
11
+ saved: boolean;
12
+ error?: string;
13
+ };
14
+ export declare function saveBlueprint(name: string, props: Record<string, OmlPropSchema>, imports: Record<string, string>, blueprintsDir: string): {
15
+ saved: boolean;
16
+ file?: string;
17
+ error?: string;
18
+ };
19
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/dev/components.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,iBAAiB,CAAA;AAEjE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAA;IACpC,mBAAmB,EAAE,OAAO,CAAA;CAC7B,CAAA;AA0CD,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,GAAG,cAAc,EAAE,CAqBhG;AAED,wBAAgB,eAAe,CAC7B,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACpC,aAAa,EAAE,MAAM,GACpB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAUpC;AAED,wBAAgB,aAAa,CAC3B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,EACpC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,aAAa,EAAE,MAAM,GACpB;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,CAUnD"}
@@ -0,0 +1,87 @@
1
+ import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from "node:fs";
2
+ import { basename, extname, join, relative } from "node:path";
3
+ function mapTsType(rawType) {
4
+ const t = rawType.trim().replace(/\s*[|&]\s*(undefined|null)$/g, "").trim();
5
+ if (t === "string") return "string";
6
+ if (t === "number") return "number";
7
+ if (t === "boolean") return "boolean";
8
+ if (/ReactNode|JSX\.Element|React\.ReactNode|OmlNode|OmlChild|VNode/.test(t)) return "node";
9
+ if (/Array<|[[\]]/.test(t)) return "array";
10
+ if (/=>/.test(t) || t === "Function" || t.startsWith("(")) return "function";
11
+ return "string";
12
+ }
13
+ function extractProps(source) {
14
+ const props = {};
15
+ const m = source.match(/(?:interface\s+Props|type\s+Props\s*=)\s*\{([\s\S]*?)\}/);
16
+ if (!m) return props;
17
+ for (const line of m[1].split("\n")) {
18
+ const pm = line.match(/^\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\?)?\s*:\s*([^;,\n]+)/);
19
+ if (!pm) continue;
20
+ const name = pm[1];
21
+ if (name === "children") continue;
22
+ props[name] = { type: mapTsType(pm[3].trim()), required: pm[2] !== "?" };
23
+ }
24
+ return props;
25
+ }
26
+ function collectComponentFiles(dir, out) {
27
+ if (!existsSync(dir)) return;
28
+ for (const entry of readdirSync(dir)) {
29
+ const full = join(dir, entry);
30
+ if (statSync(full).isDirectory()) {
31
+ collectComponentFiles(full, out);
32
+ } else if ([".tsx", ".ts", ".jsx", ".js"].includes(extname(entry)) && /^[A-Z]/.test(entry)) {
33
+ out.push(full);
34
+ }
35
+ }
36
+ }
37
+ function scanComponents(dir, cwd, blueprintsDir) {
38
+ const files = [];
39
+ collectComponentFiles(dir, files);
40
+ const routesDir = join(cwd, "src", "routes");
41
+ return files.map((filePath) => {
42
+ const name = basename(filePath, extname(filePath));
43
+ let props = {};
44
+ try {
45
+ props = extractProps(readFileSync(filePath, "utf-8"));
46
+ } catch {
47
+ }
48
+ const noExt = filePath.replace(/\.(tsx?|jsx?)$/, "");
49
+ const rel = relative(routesDir, noExt);
50
+ const importPath = rel.startsWith(".") ? rel : `../${rel}`;
51
+ return {
52
+ name,
53
+ file: relative(cwd, filePath),
54
+ importPath,
55
+ props,
56
+ hasBlueprintAlready: existsSync(join(blueprintsDir, `${name}.oml.json`))
57
+ };
58
+ });
59
+ }
60
+ function updateBlueprint(id, name, props, blueprintsDir) {
61
+ const filePath = join(blueprintsDir, `${id}.oml.json`);
62
+ try {
63
+ let existing = {};
64
+ if (existsSync(filePath)) existing = JSON.parse(readFileSync(filePath, "utf-8"));
65
+ writeFileSync(filePath, JSON.stringify({ ...existing, id, name, props }, null, 2), "utf-8");
66
+ return { saved: true };
67
+ } catch (e) {
68
+ return { saved: false, error: String(e) };
69
+ }
70
+ }
71
+ function saveBlueprint(name, props, imports, blueprintsDir) {
72
+ try {
73
+ if (!existsSync(blueprintsDir)) mkdirSync(blueprintsDir, { recursive: true });
74
+ const bp = { id: name, name, props, return: null, imports };
75
+ const filePath = join(blueprintsDir, `${name}.oml.json`);
76
+ writeFileSync(filePath, JSON.stringify(bp, null, 2), "utf-8");
77
+ return { saved: true, file: filePath };
78
+ } catch (e) {
79
+ return { saved: false, error: String(e) };
80
+ }
81
+ }
82
+ export {
83
+ saveBlueprint,
84
+ scanComponents,
85
+ updateBlueprint
86
+ };
87
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dev/components.ts"],
4
+ "sourcesContent": ["import { existsSync, mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'\nimport { basename, extname, join, relative } from 'node:path'\nimport type { OmlPropSchema, OmlPropType } from '../oml/types.js'\n\nexport type ComponentEntry = {\n name: string\n file: string\n importPath: string\n props: Record<string, OmlPropSchema>\n hasBlueprintAlready: boolean\n}\n\nfunction mapTsType(rawType: string): OmlPropType {\n const t = rawType\n .trim()\n .replace(/\\s*[|&]\\s*(undefined|null)$/g, '')\n .trim()\n if (t === 'string') return 'string'\n if (t === 'number') return 'number'\n if (t === 'boolean') return 'boolean'\n if (/ReactNode|JSX\\.Element|React\\.ReactNode|OmlNode|OmlChild|VNode/.test(t)) return 'node'\n if (/Array<|[[\\]]/.test(t)) return 'array'\n if (/=>/.test(t) || t === 'Function' || t.startsWith('(')) return 'function'\n return 'string'\n}\n\nfunction extractProps(source: string): Record<string, OmlPropSchema> {\n const props: Record<string, OmlPropSchema> = {}\n const m = source.match(/(?:interface\\s+Props|type\\s+Props\\s*=)\\s*\\{([\\s\\S]*?)\\}/)\n if (!m) return props\n for (const line of m[1].split('\\n')) {\n const pm = line.match(/^\\s*([a-zA-Z_$][a-zA-Z0-9_$]*)(\\?)?\\s*:\\s*([^;,\\n]+)/)\n if (!pm) continue\n const name = pm[1]\n if (name === 'children') continue\n props[name] = { type: mapTsType(pm[3].trim()), required: pm[2] !== '?' }\n }\n return props\n}\n\nfunction collectComponentFiles(dir: string, out: string[]): void {\n if (!existsSync(dir)) return\n for (const entry of readdirSync(dir)) {\n const full = join(dir, entry)\n if (statSync(full).isDirectory()) {\n collectComponentFiles(full, out)\n } else if (['.tsx', '.ts', '.jsx', '.js'].includes(extname(entry)) && /^[A-Z]/.test(entry)) {\n out.push(full)\n }\n }\n}\n\nexport function scanComponents(dir: string, cwd: string, blueprintsDir: string): ComponentEntry[] {\n const files: string[] = []\n collectComponentFiles(dir, files)\n const routesDir = join(cwd, 'src', 'routes')\n return files.map((filePath) => {\n const name = basename(filePath, extname(filePath))\n let props: Record<string, OmlPropSchema> = {}\n try {\n props = extractProps(readFileSync(filePath, 'utf-8'))\n } catch {}\n const noExt = filePath.replace(/\\.(tsx?|jsx?)$/, '')\n const rel = relative(routesDir, noExt)\n const importPath = rel.startsWith('.') ? rel : `../${rel}`\n return {\n name,\n file: relative(cwd, filePath),\n importPath,\n props,\n hasBlueprintAlready: existsSync(join(blueprintsDir, `${name}.oml.json`)),\n }\n })\n}\n\nexport function updateBlueprint(\n id: string,\n name: string,\n props: Record<string, OmlPropSchema>,\n blueprintsDir: string,\n): { saved: boolean; error?: string } {\n const filePath = join(blueprintsDir, `${id}.oml.json`)\n try {\n let existing: Record<string, unknown> = {}\n if (existsSync(filePath)) existing = JSON.parse(readFileSync(filePath, 'utf-8'))\n writeFileSync(filePath, JSON.stringify({ ...existing, id, name, props }, null, 2), 'utf-8')\n return { saved: true }\n } catch (e) {\n return { saved: false, error: String(e) }\n }\n}\n\nexport function saveBlueprint(\n name: string,\n props: Record<string, OmlPropSchema>,\n imports: Record<string, string>,\n blueprintsDir: string,\n): { saved: boolean; file?: string; error?: string } {\n try {\n if (!existsSync(blueprintsDir)) mkdirSync(blueprintsDir, { recursive: true })\n const bp = { id: name, name, props, return: null, imports }\n const filePath = join(blueprintsDir, `${name}.oml.json`)\n writeFileSync(filePath, JSON.stringify(bp, null, 2), 'utf-8')\n return { saved: true, file: filePath }\n } catch (e) {\n return { saved: false, error: String(e) }\n }\n}\n"],
5
+ "mappings": "AAAA,SAAS,YAAY,WAAW,aAAa,cAAc,UAAU,qBAAqB;AAC1F,SAAS,UAAU,SAAS,MAAM,gBAAgB;AAWlD,SAAS,UAAU,SAA8B;AAC/C,QAAM,IAAI,QACP,KAAK,EACL,QAAQ,gCAAgC,EAAE,EAC1C,KAAK;AACR,MAAI,MAAM,SAAU,QAAO;AAC3B,MAAI,MAAM,SAAU,QAAO;AAC3B,MAAI,MAAM,UAAW,QAAO;AAC5B,MAAI,iEAAiE,KAAK,CAAC,EAAG,QAAO;AACrF,MAAI,eAAe,KAAK,CAAC,EAAG,QAAO;AACnC,MAAI,KAAK,KAAK,CAAC,KAAK,MAAM,cAAc,EAAE,WAAW,GAAG,EAAG,QAAO;AAClE,SAAO;AACT;AAEA,SAAS,aAAa,QAA+C;AACnE,QAAM,QAAuC,CAAC;AAC9C,QAAM,IAAI,OAAO,MAAM,yDAAyD;AAChF,MAAI,CAAC,EAAG,QAAO;AACf,aAAW,QAAQ,EAAE,CAAC,EAAE,MAAM,IAAI,GAAG;AACnC,UAAM,KAAK,KAAK,MAAM,sDAAsD;AAC5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C;AACH;AAEO,SAAS,gBACd,IACA,MACA,OACA,eACoC;AACpC,QAAM,WAAW,KAAK,eAAe,GAAG,EAAE,WAAW;AACrD,MAAI;AACF,QAAI,WAAoC,CAAC;AACzC,QAAI,WAAW,QAAQ,EAAG,YAAW,KAAK,MAAM,aAAa,UAAU,OAAO,CAAC;AAC/E,kBAAc,UAAU,KAAK,UAAU,EAAE,GAAG,UAAU,IAAI,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,OAAO;AAC1F,WAAO,EAAE,OAAO,KAAK;AAAA,EACvB,SAAS,GAAG;AACV,WAAO,EAAE,OAAO,OAAO,OAAO,OAAO,CAAC,EAAE;AAAA,EAC1C;AACF;AAEO,SAAS,cACd,MACA,OACA,SACA,eACmD;AACnD,MAAI;AACF,QAAI,CAAC,WAAW,aAAa,EAAG,WAAU,eAAe,EAAE,WAAW,KAAK,CAAC;AAC5E,UAAM,KAAK,EAAE,IAAI,MAAM,MAAM,OAAO,QAAQ,MAAM,QAAQ;AAC1D,UAAM,WAAW,KAAK,eAAe,GAAG,IAAI,WAAW;AACvD,kBAAc,UAAU,KAAK,UAAU,IAAI,MAAM,CAAC,GAAG,OAAO;AAC5D,WAAO,EAAE,OAAO,MAAM,MAAM,SAAS;AAAA,EACvC,SAAS,GAAG;AACV,WAAO,EAAE,OAAO,OAAO,OAAO,OAAO,CAAC,EAAE;AAAA,EAC1C;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,11 @@
1
+ export type InsertResult = {
2
+ inserted: true;
3
+ file: string;
4
+ warning?: string;
5
+ } | {
6
+ inserted: false;
7
+ error: string;
8
+ };
9
+ export declare function insertAfterElement(filePath: string, tagName: string, instanceIndex: number, newJsx: string, componentImports?: Record<string, string>): InsertResult;
10
+ export declare function insertJsx(filePath: string, jsxSnippet: string, componentImports: Record<string, string>): InsertResult;
11
+ //# sourceMappingURL=insert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"insert.d.ts","sourceRoot":"","sources":["../../src/dev/insert.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CAAE,GAClD;IAAE,QAAQ,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAkItC,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,EACrB,MAAM,EAAE,MAAM,EACd,gBAAgB,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAM,GAC5C,YAAY,CA8Bd;AAED,wBAAgB,SAAS,CACvB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,YAAY,CA4Cd"}
@@ -0,0 +1,160 @@
1
+ import { readFileSync, writeFileSync } from "node:fs";
2
+ function leadingWs(line) {
3
+ return line.match(/^(\s*)/)?.[1] ?? "";
4
+ }
5
+ function findInsertPoint(lines) {
6
+ for (let i = 0; i < lines.length; i++) {
7
+ if (lines[i].includes("@davaux-insert")) {
8
+ return { idx: i, indent: leadingWs(lines[i]) };
9
+ }
10
+ }
11
+ let returnIdx = -1;
12
+ for (let i = 0; i < lines.length; i++) {
13
+ if (/return\s*\(/.test(lines[i])) {
14
+ returnIdx = i;
15
+ break;
16
+ }
17
+ }
18
+ if (returnIdx === -1) return null;
19
+ const returnIndentLen = leadingWs(lines[returnIdx]).length;
20
+ let returnCloseIdx = -1;
21
+ for (let i = returnIdx + 1; i < lines.length; i++) {
22
+ const t = lines[i].trim();
23
+ const indLen = leadingWs(lines[i]).length;
24
+ if ((t === ")" || t === ");") && indLen <= returnIndentLen + 2) {
25
+ returnCloseIdx = i;
26
+ break;
27
+ }
28
+ }
29
+ if (returnCloseIdx === -1) return null;
30
+ let wrapperIdx = -1;
31
+ let wrapperTag = "";
32
+ let wrapperIndent = "";
33
+ for (let i = returnIdx + 1; i < returnCloseIdx; i++) {
34
+ const t = lines[i].trim();
35
+ if (!t) continue;
36
+ if (t === "<>") {
37
+ wrapperIdx = i;
38
+ wrapperTag = "";
39
+ wrapperIndent = leadingWs(lines[i]);
40
+ break;
41
+ }
42
+ const m = t.match(/^<([A-Za-z][A-Za-z0-9.]*)(?:\s[^>]*)?>$/);
43
+ if (m) {
44
+ wrapperIdx = i;
45
+ wrapperTag = m[1];
46
+ wrapperIndent = leadingWs(lines[i]);
47
+ break;
48
+ }
49
+ }
50
+ if (wrapperIdx === -1) return null;
51
+ const closeTag = wrapperTag ? `</${wrapperTag}>` : "</>";
52
+ let closingIdx = -1;
53
+ for (let i = wrapperIdx + 1; i < returnCloseIdx; i++) {
54
+ if (leadingWs(lines[i]) === wrapperIndent && lines[i].trim() === closeTag) {
55
+ closingIdx = i;
56
+ break;
57
+ }
58
+ }
59
+ if (closingIdx === -1) return null;
60
+ const useTabs = wrapperIndent.includes(" ");
61
+ const childIndent = wrapperIndent + (useTabs ? " " : " ");
62
+ return { idx: closingIdx, indent: childIndent };
63
+ }
64
+ function addMissingImports(lines, imports) {
65
+ let lastImportIdx = -1;
66
+ for (let i = 0; i < lines.length; i++) {
67
+ if (lines[i].trimStart().startsWith("import ")) lastImportIdx = i;
68
+ }
69
+ let added = 0;
70
+ for (const [name, path] of Object.entries(imports)) {
71
+ const already = lines.some(
72
+ (l) => l.includes(`import ${name}`) || l.includes(`{ ${name} }`) || new RegExp(`\\b${name}\\b`).test(l.replace(/^import\s+/, ""))
73
+ );
74
+ if (!already) {
75
+ lines.splice(lastImportIdx + 1 + added, 0, `import ${name} from '${path}'`);
76
+ added++;
77
+ }
78
+ }
79
+ return added;
80
+ }
81
+ function findElemSpan(lines, tagName, instanceIndex) {
82
+ const isPascal = /^[A-Z]/.test(tagName);
83
+ const openRe = isPascal ? new RegExp(`^\\s*<${tagName}(\\s|/>|>|$)`) : new RegExp(`<${tagName}(\\s|>|\\/)`);
84
+ let count = 0;
85
+ for (let i = 0; i < lines.length; i++) {
86
+ if (openRe.test(lines[i])) {
87
+ if (count === instanceIndex) {
88
+ const tagPos = lines[i].search(openRe);
89
+ const openIndent = lines[i].match(/^(\s*)/)?.[1] ?? "";
90
+ const rest = lines[i].slice(tagPos);
91
+ if (/\/>/.test(rest) || new RegExp(`</${tagName}>`).test(rest)) return [i, i];
92
+ for (let j = i + 1; j < lines.length; j++) {
93
+ const t = lines[j].trim();
94
+ const ind = lines[j].match(/^(\s*)/)?.[1] ?? "";
95
+ if (t.startsWith(`</${tagName}>`) && ind.length <= openIndent.length) return [i, j];
96
+ if (t && ind.length < openIndent.length) break;
97
+ }
98
+ return [i, i];
99
+ }
100
+ count++;
101
+ }
102
+ }
103
+ return null;
104
+ }
105
+ function insertAfterElement(filePath, tagName, instanceIndex, newJsx, componentImports = {}) {
106
+ let source;
107
+ try {
108
+ source = readFileSync(filePath, "utf-8");
109
+ } catch {
110
+ return { inserted: false, error: `Cannot read file: ${filePath}` };
111
+ }
112
+ const lines = source.split("\n");
113
+ const span = findElemSpan(lines, tagName, instanceIndex);
114
+ if (!span) return { inserted: false, error: `No <${tagName}> found at index ${instanceIndex}` };
115
+ const importCount = addMissingImports(lines, componentImports);
116
+ const adjustedEnd = span[1] + importCount;
117
+ const indent = leadingWs(lines[span[0] + importCount]);
118
+ const formatted = newJsx.split("\n").map((l) => l ? indent + l : l).join("\n");
119
+ lines.splice(adjustedEnd + 1, 0, formatted);
120
+ try {
121
+ writeFileSync(filePath, lines.join("\n"), "utf-8");
122
+ } catch {
123
+ return { inserted: false, error: `Cannot write file: ${filePath}` };
124
+ }
125
+ return { inserted: true, file: filePath };
126
+ }
127
+ function insertJsx(filePath, jsxSnippet, componentImports) {
128
+ let source;
129
+ try {
130
+ source = readFileSync(filePath, "utf-8");
131
+ } catch {
132
+ return { inserted: false, error: `Cannot read file: ${filePath}` };
133
+ }
134
+ const lines = source.split("\n");
135
+ const point = findInsertPoint(lines);
136
+ if (!point) {
137
+ return {
138
+ inserted: false,
139
+ error: "Cannot find insertion point. Add {/* @davaux-insert */} in your JSX where you want components to be inserted."
140
+ };
141
+ }
142
+ const importCount = addMissingImports(lines, componentImports);
143
+ const insertIdx = point.idx + importCount;
144
+ const formatted = jsxSnippet.split("\n").map((l) => l ? point.indent + l : l).join("\n");
145
+ lines.splice(insertIdx, 0, formatted);
146
+ try {
147
+ writeFileSync(filePath, lines.join("\n"), "utf-8");
148
+ } catch {
149
+ return { inserted: false, error: `Cannot write file: ${filePath}` };
150
+ }
151
+ const componentName = jsxSnippet.match(/^<([A-Z][A-Za-z0-9.]*)/)?.[1];
152
+ const hasImport = !componentName || lines.some((l) => l.trimStart().startsWith("import") && l.includes(componentName));
153
+ const warning = hasImport ? void 0 : `No import found for ${componentName}. Add an import manually, or set the "imports" field in the blueprint JSON to automate it.`;
154
+ return { inserted: true, file: filePath, warning };
155
+ }
156
+ export {
157
+ insertAfterElement,
158
+ insertJsx
159
+ };
160
+ //# sourceMappingURL=insert.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/dev/insert.ts"],
4
+ "sourcesContent": ["import { readFileSync, writeFileSync } from 'node:fs'\n\nexport type InsertResult =\n | { inserted: true; file: string; warning?: string }\n | { inserted: false; error: string }\n\nfunction leadingWs(line: string): string {\n return line.match(/^(\\s*)/)?.[1] ?? ''\n}\n\nfunction findInsertPoint(lines: string[]): { idx: number; indent: string } | null {\n // Explicit marker takes priority\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].includes('@davaux-insert')) {\n return { idx: i, indent: leadingWs(lines[i]) }\n }\n }\n\n // Find `return (` line\n let returnIdx = -1\n for (let i = 0; i < lines.length; i++) {\n if (/return\\s*\\(/.test(lines[i])) {\n returnIdx = i\n break\n }\n }\n if (returnIdx === -1) return null\n\n // Find the closing `)` of the return at the same or shallower indent\n const returnIndentLen = leadingWs(lines[returnIdx]).length\n let returnCloseIdx = -1\n for (let i = returnIdx + 1; i < lines.length; i++) {\n const t = lines[i].trim()\n const indLen = leadingWs(lines[i]).length\n if ((t === ')' || t === ');') && indLen <= returnIndentLen + 2) {\n returnCloseIdx = i\n break\n }\n }\n if (returnCloseIdx === -1) return null\n\n // Find the outermost JSX wrapper element\n let wrapperIdx = -1\n let wrapperTag = ''\n let wrapperIndent = ''\n for (let i = returnIdx + 1; i < returnCloseIdx; i++) {\n const t = lines[i].trim()\n if (!t) continue\n // Fragment\n if (t === '<>') {\n wrapperIdx = i\n wrapperTag = ''\n wrapperIndent = leadingWs(lines[i])\n break\n }\n // Single-line opening tag: <Tag> or <Tag attr=\"x\">\n const m = t.match(/^<([A-Za-z][A-Za-z0-9.]*)(?:\\s[^>]*)?>$/)\n if (m) {\n wrapperIdx = i\n wrapperTag = m[1]\n wrapperIndent = leadingWs(lines[i])\n break\n }\n }\n if (wrapperIdx === -1) return null\n\n // Find the closing tag at the same indent level\n const closeTag = wrapperTag ? `</${wrapperTag}>` : '</>'\n let closingIdx = -1\n for (let i = wrapperIdx + 1; i < returnCloseIdx; i++) {\n if (leadingWs(lines[i]) === wrapperIndent && lines[i].trim() === closeTag) {\n closingIdx = i\n break\n }\n }\n if (closingIdx === -1) return null\n\n const useTabs = wrapperIndent.includes('\\t')\n const childIndent = wrapperIndent + (useTabs ? '\\t' : ' ')\n return { idx: closingIdx, indent: childIndent }\n}\n\nfunction addMissingImports(lines: string[], imports: Record<string, string>): number {\n let lastImportIdx = -1\n for (let i = 0; i < lines.length; i++) {\n if (lines[i].trimStart().startsWith('import ')) lastImportIdx = i\n }\n let added = 0\n for (const [name, path] of Object.entries(imports)) {\n const already = lines.some(\n (l) =>\n l.includes(`import ${name}`) ||\n l.includes(`{ ${name} }`) ||\n new RegExp(`\\\\b${name}\\\\b`).test(l.replace(/^import\\s+/, '')),\n )\n if (!already) {\n lines.splice(lastImportIdx + 1 + added, 0, `import ${name} from '${path}'`)\n added++\n }\n }\n return added\n}\n\n// Find the full span of the Nth element (opening through matching closing tag).\n// Mirrors findFullElementSpan in remove.ts \u2014 kept local to avoid a circular dep.\nfunction findElemSpan(lines: string[], tagName: string, instanceIndex: number): [number, number] | null {\n // PascalCase components: anchor to start-of-line so inline prop occurrences are not counted.\n // This keeps the index consistent with the OML tree traversal in countNameBefore.\n const isPascal = /^[A-Z]/.test(tagName)\n const openRe = isPascal\n ? new RegExp(`^\\\\s*<${tagName}(\\\\s|/>|>|$)`)\n : new RegExp(`<${tagName}(\\\\s|>|\\\\/)`)\n let count = 0\n for (let i = 0; i < lines.length; i++) {\n if (openRe.test(lines[i])) {\n if (count === instanceIndex) {\n const tagPos = lines[i].search(openRe)\n const openIndent = lines[i].match(/^(\\s*)/)?.[1] ?? ''\n const rest = lines[i].slice(tagPos)\n if (/\\/>/.test(rest) || new RegExp(`</${tagName}>`).test(rest)) return [i, i]\n for (let j = i + 1; j < lines.length; j++) {\n const t = lines[j].trim()\n const ind = lines[j].match(/^(\\s*)/)?.[1] ?? ''\n if (t.startsWith(`</${tagName}>`) && ind.length <= openIndent.length) return [i, j]\n if (t && ind.length < openIndent.length) break\n }\n return [i, i]\n }\n count++\n }\n }\n return null\n}\n\nexport function insertAfterElement(\n filePath: string,\n tagName: string,\n instanceIndex: number,\n newJsx: string,\n componentImports: Record<string, string> = {},\n): InsertResult {\n let source: string\n try {\n source = readFileSync(filePath, 'utf-8')\n } catch {\n return { inserted: false, error: `Cannot read file: ${filePath}` }\n }\n\n const lines = source.split('\\n')\n const span = findElemSpan(lines, tagName, instanceIndex)\n if (!span) return { inserted: false, error: `No <${tagName}> found at index ${instanceIndex}` }\n\n const importCount = addMissingImports(lines, componentImports)\n const adjustedEnd = span[1] + importCount\n\n const indent = leadingWs(lines[span[0] + importCount])\n const formatted = newJsx\n .split('\\n')\n .map((l) => (l ? indent + l : l))\n .join('\\n')\n\n lines.splice(adjustedEnd + 1, 0, formatted)\n\n try {\n writeFileSync(filePath, lines.join('\\n'), 'utf-8')\n } catch {\n return { inserted: false, error: `Cannot write file: ${filePath}` }\n }\n\n return { inserted: true, file: filePath }\n}\n\nexport function insertJsx(\n filePath: string,\n jsxSnippet: string,\n componentImports: Record<string, string>,\n): InsertResult {\n let source: string\n try {\n source = readFileSync(filePath, 'utf-8')\n } catch {\n return { inserted: false, error: `Cannot read file: ${filePath}` }\n }\n\n const lines = source.split('\\n')\n const point = findInsertPoint(lines)\n if (!point) {\n return {\n inserted: false,\n error:\n 'Cannot find insertion point. Add {/* @davaux-insert */} in your JSX where you want components to be inserted.',\n }\n }\n\n const importCount = addMissingImports(lines, componentImports)\n const insertIdx = point.idx + importCount\n\n const formatted = jsxSnippet\n .split('\\n')\n .map((l) => (l ? point.indent + l : l))\n .join('\\n')\n\n lines.splice(insertIdx, 0, formatted)\n\n try {\n writeFileSync(filePath, lines.join('\\n'), 'utf-8')\n } catch {\n return { inserted: false, error: `Cannot write file: ${filePath}` }\n }\n\n // Warn if an uppercase component was inserted without a matching import in the file\n const componentName = jsxSnippet.match(/^<([A-Z][A-Za-z0-9.]*)/)?.[1]\n const hasImport =\n !componentName ||\n lines.some((l) => l.trimStart().startsWith('import') && l.includes(componentName))\n const warning = hasImport\n ? undefined\n : `No import found for ${componentName}. Add an import manually, or set the \"imports\" field in the blueprint JSON to automate it.`\n\n return { inserted: true, file: filePath, warning }\n}\n"],
5
+ "mappings": "AAAA,SAAS,cAAc,qBAAqB;AAM5C,SAAS,UAAU,MAAsB;AACvC,SAAO,KAAK,MAAM,QAAQ,IAAI,CAAC,KAAK;AACtC;AAEA,SAAS,gBAAgB,OAAyD;AAEhF,WAAS,IAAI,GAAG,IAAI,MAAM,QAAQ,KAAK;AACrC,QAAI,MAAM,CAAC,EAAE,SAAS,gBAAgB,GAAG;AACvC,aAAO,EAAE,KAAK,GAAG,QAAQ,UAAU,MAAM,CAAC,CAAC,EAAE;AAAA,IAC/C;AAAA,EACF;AAGA,MAAI,YAAY;AAChB,WAAS,IAAI,GAAG,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,EAAE,UAAU,OAAO,OAAO,sBAAsB,QAAQ,GAAG;AAAA,EACpE;AAEA,SAAO,EAAE,UAAU,MAAM,MAAM,SAAS;AAC1C;AAEO,SAAS,UACd,UACA,YACA,kBACc;AACd,MAAI;AACJ,MAAI;AACF,aAAS,aAAa,UAAU,OAAO;AAAA,EACzC,QAAQ;AACN,WAAO,EAAE,UAAU,OAAO,OAAO,qBAAqB,QAAQ,GAAG;AAAA,EACnE;AAEA,QAAM,QAAQ,OAAO,MAAM,IAAI;AAC/B,QAAM,QAAQ,gBAAgB,KAAK;AACnC,MAAI,CAAC,OAAO;AACV,WAAO;AAAA,MACL,UAAU;AAAA,MACV,OACE;AAAA,IACJ;AAAA,EACF;AAEA,QAAM,cAAc,kBAAkB,OAAO,gBAAgB;AAC7D,QAAM,YAAY,MAAM,MAAM;AAE9B,QAAM,YAAY,WACf,MAAM,IAAI,EACV,IAAI,CAAC,MAAO,IAAI,MAAM,SAAS,IAAI,CAAE,EACrC,KAAK,IAAI;AAEZ,QAAM,OAAO,WAAW,GAAG,SAAS;AAEpC,MAAI;AACF,kBAAc,UAAU,MAAM,KAAK,IAAI,GAAG,OAAO;AAAA,EACnD,QAAQ;AACN,WAAO,EAAE,UAAU,OAAO,OAAO,sBAAsB,QAAQ,GAAG;AAAA,EACpE;AAGA,QAAM,gBAAgB,WAAW,MAAM,wBAAwB,IAAI,CAAC;AACpE,QAAM,YACJ,CAAC,iBACD,MAAM,KAAK,CAAC,MAAM,EAAE,UAAU,EAAE,WAAW,QAAQ,KAAK,EAAE,SAAS,aAAa,CAAC;AACnF,QAAM,UAAU,YACZ,SACA,uBAAuB,aAAa;AAExC,SAAO,EAAE,UAAU,MAAM,MAAM,UAAU,QAAQ;AACnD;",
6
+ "names": []
7
+ }
@@ -0,0 +1,53 @@
1
+ export type RemoveResult = {
2
+ removed: true;
3
+ file: string;
4
+ } | {
5
+ removed: false;
6
+ error: string;
7
+ };
8
+ export declare function removeJsx(filePath: string, componentName: string, instanceIndex?: number): RemoveResult;
9
+ export declare function removeElement(filePath: string, tagName: string, instanceIndex: number): RemoveResult;
10
+ export type ReplaceResult = {
11
+ replaced: true;
12
+ file: string;
13
+ } | {
14
+ replaced: false;
15
+ error: string;
16
+ };
17
+ export type ReplaceElemResult = {
18
+ replaced: true;
19
+ file: string;
20
+ } | {
21
+ replaced: false;
22
+ error: string;
23
+ };
24
+ export declare function replaceElementAttrs(filePath: string, tagName: string, newProps: Record<string, unknown>, instanceIndex?: number): ReplaceElemResult;
25
+ export declare function replaceTextContent(filePath: string, tagName: string, newText: string, instanceIndex?: number): ReplaceElemResult;
26
+ export declare function replaceJsx(filePath: string, componentName: string, newJsx: string, instanceIndex?: number): ReplaceResult;
27
+ export type FragmentResult = {
28
+ found: true;
29
+ content: string;
30
+ file: string;
31
+ name: string;
32
+ instanceIndex: number;
33
+ } | {
34
+ found: false;
35
+ error: string;
36
+ };
37
+ /** Finds the content between a component's opening > and closing </Name>. */
38
+ export declare function getComponentFragment(filePath: string, name: string, instanceIndex: number): FragmentResult;
39
+ /** Replaces the children content of a component, preserving its opening and closing tags. */
40
+ export declare function replaceComponentFragment(filePath: string, name: string, instanceIndex: number, newContent: string): ReplaceResult;
41
+ /** Finds the content between an HTML element's opening > and closing </tag>. */
42
+ export declare function getElementFragment(filePath: string, tagName: string, instanceIndex: number): FragmentResult;
43
+ /** Replaces the children content of an HTML element, preserving its opening and closing tags. */
44
+ export declare function replaceElementFragment(filePath: string, tagName: string, instanceIndex: number, newContent: string): ReplaceResult;
45
+ export type MoveResult = {
46
+ moved: true;
47
+ file: string;
48
+ } | {
49
+ moved: false;
50
+ error: string;
51
+ };
52
+ export declare function moveNode(filePath: string, name: string, isComponent: boolean, instanceIndex: number, direction: 'up' | 'down'): MoveResult;
53
+ //# sourceMappingURL=remove.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"remove.d.ts","sourceRoot":"","sources":["../../src/dev/remove.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,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