@antheo/morph 0.0.0-stage → 0.3.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 (464) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +266 -2
  3. package/SKILL.md +61 -0
  4. package/dist/ai/cli-provider.d.ts +80 -0
  5. package/dist/ai/cli-provider.js +250 -0
  6. package/dist/ai/gate.d.ts +39 -0
  7. package/dist/ai/gate.js +124 -0
  8. package/dist/ai/provider.d.ts +36 -0
  9. package/dist/ai/provider.js +168 -0
  10. package/dist/ai/repair.d.ts +90 -0
  11. package/dist/ai/repair.js +172 -0
  12. package/dist/analyzer/deps.d.ts +30 -0
  13. package/dist/analyzer/deps.js +265 -0
  14. package/dist/analyzer/manifest.d.ts +5 -0
  15. package/dist/analyzer/manifest.js +119 -0
  16. package/dist/analyzer/parse.d.ts +21 -0
  17. package/dist/analyzer/parse.js +29 -0
  18. package/dist/batch-worker.d.ts +16 -0
  19. package/dist/batch-worker.js +10 -0
  20. package/dist/batch.d.ts +26 -0
  21. package/dist/batch.js +227 -0
  22. package/dist/bridge/index.d.ts +26 -0
  23. package/dist/bridge/index.js +138 -0
  24. package/dist/bridge/props.d.ts +56 -0
  25. package/dist/bridge/props.js +191 -0
  26. package/dist/bridge/wrappers.d.ts +24 -0
  27. package/dist/bridge/wrappers.js +276 -0
  28. package/dist/cli/format.d.ts +7 -0
  29. package/dist/cli/format.js +30 -0
  30. package/dist/cli.d.ts +2 -0
  31. package/dist/cli.js +492 -0
  32. package/dist/fonts/carry.d.ts +34 -0
  33. package/dist/fonts/carry.js +113 -0
  34. package/dist/fonts/fallback.d.ts +11 -0
  35. package/dist/fonts/fallback.js +21 -0
  36. package/dist/fonts/google.d.ts +65 -0
  37. package/dist/fonts/google.js +343 -0
  38. package/dist/fonts/index.d.ts +27 -0
  39. package/dist/fonts/index.js +48 -0
  40. package/dist/fonts/local.d.ts +46 -0
  41. package/dist/fonts/local.js +150 -0
  42. package/dist/fonts/sfnt.d.ts +19 -0
  43. package/dist/fonts/sfnt.js +174 -0
  44. package/dist/fonts/shim.d.ts +14 -0
  45. package/dist/fonts/shim.js +96 -0
  46. package/dist/gate.d.ts +105 -0
  47. package/dist/gate.js +157 -0
  48. package/dist/index.d.ts +55 -0
  49. package/dist/index.js +74 -0
  50. package/dist/ir/annotate.d.ts +16 -0
  51. package/dist/ir/annotate.js +145 -0
  52. package/dist/ir/as-child.d.ts +18 -0
  53. package/dist/ir/as-child.js +239 -0
  54. package/dist/ir/compounds.d.ts +27 -0
  55. package/dist/ir/compounds.js +183 -0
  56. package/dist/ir/contexts.d.ts +26 -0
  57. package/dist/ir/contexts.js +185 -0
  58. package/dist/ir/dom.d.ts +11 -0
  59. package/dist/ir/dom.js +60 -0
  60. package/dist/ir/effect-returns.d.ts +10 -0
  61. package/dist/ir/effect-returns.js +25 -0
  62. package/dist/ir/extract-ui-types.d.ts +33 -0
  63. package/dist/ir/extract-ui-types.js +224 -0
  64. package/dist/ir/extract-ui.d.ts +34 -0
  65. package/dist/ir/extract-ui.js +567 -0
  66. package/dist/ir/falsy.d.ts +13 -0
  67. package/dist/ir/falsy.js +66 -0
  68. package/dist/ir/forward-refs.d.ts +11 -0
  69. package/dist/ir/forward-refs.js +155 -0
  70. package/dist/ir/fragment-source.d.ts +4 -0
  71. package/dist/ir/fragment-source.js +13 -0
  72. package/dist/ir/fragments.d.ts +32 -0
  73. package/dist/ir/fragments.js +192 -0
  74. package/dist/ir/helper-snippets.d.ts +30 -0
  75. package/dist/ir/helper-snippets.js +550 -0
  76. package/dist/ir/latest-refs.d.ts +11 -0
  77. package/dist/ir/latest-refs.js +187 -0
  78. package/dist/ir/live-args.d.ts +26 -0
  79. package/dist/ir/live-args.js +335 -0
  80. package/dist/ir/lower.d.ts +83 -0
  81. package/dist/ir/lower.js +6016 -0
  82. package/dist/ir/markup-values.d.ts +16 -0
  83. package/dist/ir/markup-values.js +188 -0
  84. package/dist/ir/model.d.ts +605 -0
  85. package/dist/ir/model.js +1 -0
  86. package/dist/ir/oracle.d.ts +91 -0
  87. package/dist/ir/oracle.js +610 -0
  88. package/dist/ir/radix.d.ts +122 -0
  89. package/dist/ir/radix.js +344 -0
  90. package/dist/ir/rename.d.ts +15 -0
  91. package/dist/ir/rename.js +151 -0
  92. package/dist/ir/render-props.d.ts +31 -0
  93. package/dist/ir/render-props.js +67 -0
  94. package/dist/ir/rewrite.d.ts +44 -0
  95. package/dist/ir/rewrite.js +381 -0
  96. package/dist/ir/running-index.d.ts +11 -0
  97. package/dist/ir/running-index.js +217 -0
  98. package/dist/ir/snapshots.d.ts +12 -0
  99. package/dist/ir/snapshots.js +140 -0
  100. package/dist/ir/style.d.ts +19 -0
  101. package/dist/ir/style.js +76 -0
  102. package/dist/ir/types.d.ts +42 -0
  103. package/dist/ir/types.js +271 -0
  104. package/dist/ir/walk.d.ts +11 -0
  105. package/dist/ir/walk.js +18 -0
  106. package/dist/mcp/server.d.ts +81 -0
  107. package/dist/mcp/server.js +518 -0
  108. package/dist/pipeline.d.ts +26 -0
  109. package/dist/pipeline.js +750 -0
  110. package/dist/registry/add.d.ts +91 -0
  111. package/dist/registry/add.js +273 -0
  112. package/dist/registry/fetch.d.ts +40 -0
  113. package/dist/registry/fetch.js +186 -0
  114. package/dist/registry/ip.d.ts +18 -0
  115. package/dist/registry/ip.js +153 -0
  116. package/dist/registry/item.d.ts +39 -0
  117. package/dist/registry/item.js +131 -0
  118. package/dist/registry/load.d.ts +35 -0
  119. package/dist/registry/load.js +106 -0
  120. package/dist/registry/paths.d.ts +8 -0
  121. package/dist/registry/paths.js +43 -0
  122. package/dist/registry/publish.d.ts +119 -0
  123. package/dist/registry/publish.js +439 -0
  124. package/dist/targets/angular/bank/bank.d.ts +39 -0
  125. package/dist/targets/angular/bank/bank.js +61 -0
  126. package/dist/targets/angular/bank/helpers.d.ts +64 -0
  127. package/dist/targets/angular/bank/helpers.js +246 -0
  128. package/dist/targets/angular/bank/kept.d.ts +98 -0
  129. package/dist/targets/angular/bank/kept.js +791 -0
  130. package/dist/targets/angular/bank/plan-helpers.d.ts +17 -0
  131. package/dist/targets/angular/bank/plan-helpers.js +286 -0
  132. package/dist/targets/angular/bank/plan.d.ts +22 -0
  133. package/dist/targets/angular/bank/plan.js +152 -0
  134. package/dist/targets/angular/bank/receivers.d.ts +66 -0
  135. package/dist/targets/angular/bank/receivers.js +293 -0
  136. package/dist/targets/angular/bank/runtime.d.ts +14 -0
  137. package/dist/targets/angular/bank/runtime.js +152 -0
  138. package/dist/targets/angular/controlled.d.ts +7 -0
  139. package/dist/targets/angular/controlled.js +37 -0
  140. package/dist/targets/angular/dynamic-tags.d.ts +34 -0
  141. package/dist/targets/angular/dynamic-tags.js +192 -0
  142. package/dist/targets/angular/emit.d.ts +41 -0
  143. package/dist/targets/angular/emit.js +5970 -0
  144. package/dist/targets/angular/exports.d.ts +48 -0
  145. package/dist/targets/angular/exports.js +243 -0
  146. package/dist/targets/angular/helpers.d.ts +15 -0
  147. package/dist/targets/angular/helpers.js +33 -0
  148. package/dist/targets/angular/host-boundary.d.ts +5 -0
  149. package/dist/targets/angular/host-boundary.js +166 -0
  150. package/dist/targets/angular/host-form.d.ts +150 -0
  151. package/dist/targets/angular/host-form.js +727 -0
  152. package/dist/targets/angular/markup-values.d.ts +58 -0
  153. package/dist/targets/angular/markup-values.js +661 -0
  154. package/dist/targets/angular/motion-directive.d.ts +12 -0
  155. package/dist/targets/angular/motion-directive.js +257 -0
  156. package/dist/targets/angular/motion-hooks.d.ts +73 -0
  157. package/dist/targets/angular/motion-hooks.js +293 -0
  158. package/dist/targets/angular/motion-layout.d.ts +14 -0
  159. package/dist/targets/angular/motion-layout.js +74 -0
  160. package/dist/targets/angular/motion-templates.d.ts +10 -0
  161. package/dist/targets/angular/motion-templates.js +65 -0
  162. package/dist/targets/angular/motion.d.ts +57 -0
  163. package/dist/targets/angular/motion.js +202 -0
  164. package/dist/targets/angular/narrowing.d.ts +24 -0
  165. package/dist/targets/angular/narrowing.js +205 -0
  166. package/dist/targets/angular/ngc.d.ts +23 -0
  167. package/dist/targets/angular/ngc.js +134 -0
  168. package/dist/targets/angular/passed-handle.d.ts +39 -0
  169. package/dist/targets/angular/passed-handle.js +154 -0
  170. package/dist/targets/angular/projected.d.ts +9 -0
  171. package/dist/targets/angular/projected.js +63 -0
  172. package/dist/targets/angular/radix/cores/alert-dialog.d.ts +13 -0
  173. package/dist/targets/angular/radix/cores/alert-dialog.js +388 -0
  174. package/dist/targets/angular/radix/cores/index.d.ts +17 -0
  175. package/dist/targets/angular/radix/cores/index.js +50 -0
  176. package/dist/targets/angular/radix/cores/slider.d.ts +8 -0
  177. package/dist/targets/angular/radix/cores/slider.js +202 -0
  178. package/dist/targets/angular/radix/index.d.ts +21 -0
  179. package/dist/targets/angular/radix/index.js +35 -0
  180. package/dist/targets/angular/radix/packages.d.ts +3 -0
  181. package/dist/targets/angular/radix/packages.js +558 -0
  182. package/dist/targets/angular/radix/part.d.ts +236 -0
  183. package/dist/targets/angular/radix/part.js +71 -0
  184. package/dist/targets/angular/radix/prepare.d.ts +66 -0
  185. package/dist/targets/angular/radix/prepare.js +548 -0
  186. package/dist/targets/angular/radix/template.d.ts +43 -0
  187. package/dist/targets/angular/radix/template.js +172 -0
  188. package/dist/targets/angular/refs.d.ts +68 -0
  189. package/dist/targets/angular/refs.js +443 -0
  190. package/dist/targets/angular/slots.d.ts +22 -0
  191. package/dist/targets/angular/slots.js +60 -0
  192. package/dist/targets/angular/source-types.d.ts +10 -0
  193. package/dist/targets/angular/source-types.js +45 -0
  194. package/dist/targets/angular/spread-forward.d.ts +24 -0
  195. package/dist/targets/angular/spread-forward.js +72 -0
  196. package/dist/targets/angular/spread.d.ts +32 -0
  197. package/dist/targets/angular/spread.js +182 -0
  198. package/dist/targets/angular/svg-hosts.d.ts +25 -0
  199. package/dist/targets/angular/svg-hosts.js +107 -0
  200. package/dist/targets/angular/template-expr.d.ts +36 -0
  201. package/dist/targets/angular/template-expr.js +287 -0
  202. package/dist/targets/angular/types.d.ts +9 -0
  203. package/dist/targets/angular/types.js +63 -0
  204. package/dist/targets/angular/walk.d.ts +11 -0
  205. package/dist/targets/angular/walk.js +26 -0
  206. package/dist/targets/react-native/emit.d.ts +14 -0
  207. package/dist/targets/react-native/emit.js +585 -0
  208. package/dist/targets/react-native/fidelity.d.ts +5 -0
  209. package/dist/targets/react-native/fidelity.js +43 -0
  210. package/dist/targets/react-native/motion.d.ts +10 -0
  211. package/dist/targets/react-native/motion.js +290 -0
  212. package/dist/targets/react-native/skia.d.ts +30 -0
  213. package/dist/targets/react-native/skia.js +358 -0
  214. package/dist/targets/shared/context.d.ts +47 -0
  215. package/dist/targets/shared/context.js +195 -0
  216. package/dist/targets/shared/foreign.d.ts +10 -0
  217. package/dist/targets/shared/foreign.js +72 -0
  218. package/dist/targets/shared/fragments.d.ts +21 -0
  219. package/dist/targets/shared/fragments.js +309 -0
  220. package/dist/targets/shared/handles.d.ts +65 -0
  221. package/dist/targets/shared/handles.js +299 -0
  222. package/dist/targets/shared/inline.d.ts +53 -0
  223. package/dist/targets/shared/inline.js +524 -0
  224. package/dist/targets/shared/layout.d.ts +70 -0
  225. package/dist/targets/shared/layout.js +224 -0
  226. package/dist/targets/shared/markup.d.ts +26 -0
  227. package/dist/targets/shared/markup.js +65 -0
  228. package/dist/targets/shared/module.d.ts +84 -0
  229. package/dist/targets/shared/module.js +468 -0
  230. package/dist/targets/shared/motion-hooks.d.ts +37 -0
  231. package/dist/targets/shared/motion-hooks.js +87 -0
  232. package/dist/targets/shared/motion-layout.d.ts +70 -0
  233. package/dist/targets/shared/motion-layout.js +392 -0
  234. package/dist/targets/shared/portal.d.ts +10 -0
  235. package/dist/targets/shared/portal.js +23 -0
  236. package/dist/targets/shared/prop-writes.d.ts +11 -0
  237. package/dist/targets/shared/prop-writes.js +32 -0
  238. package/dist/targets/shared/prune.d.ts +54 -0
  239. package/dist/targets/shared/prune.js +405 -0
  240. package/dist/targets/shared/react-libs.d.ts +25 -0
  241. package/dist/targets/shared/react-libs.js +142 -0
  242. package/dist/targets/shared/react-types.d.ts +16 -0
  243. package/dist/targets/shared/react-types.js +374 -0
  244. package/dist/targets/shared/react-values.d.ts +20 -0
  245. package/dist/targets/shared/react-values.js +145 -0
  246. package/dist/targets/shared/ref-callback.d.ts +16 -0
  247. package/dist/targets/shared/ref-callback.js +114 -0
  248. package/dist/targets/shared/script.d.ts +65 -0
  249. package/dist/targets/shared/script.js +406 -0
  250. package/dist/targets/shared/unused.d.ts +12 -0
  251. package/dist/targets/shared/unused.js +146 -0
  252. package/dist/targets/svelte/dom-spread.d.ts +27 -0
  253. package/dist/targets/svelte/dom-spread.js +146 -0
  254. package/dist/targets/svelte/emit.d.ts +15 -0
  255. package/dist/targets/svelte/emit.js +3784 -0
  256. package/dist/targets/svelte/handle-branches.d.ts +22 -0
  257. package/dist/targets/svelte/handle-branches.js +146 -0
  258. package/dist/targets/svelte/html-keys.d.ts +9 -0
  259. package/dist/targets/svelte/html-keys.js +40 -0
  260. package/dist/targets/svelte/markup-data/data.d.ts +51 -0
  261. package/dist/targets/svelte/markup-data/data.js +305 -0
  262. package/dist/targets/svelte/markup-data/helper.d.ts +12 -0
  263. package/dist/targets/svelte/markup-data/helper.js +81 -0
  264. package/dist/targets/svelte/markup-data/module-data.d.ts +21 -0
  265. package/dist/targets/svelte/markup-data/module-data.js +473 -0
  266. package/dist/targets/svelte/markup-data/sites.d.ts +52 -0
  267. package/dist/targets/svelte/markup-data/sites.js +303 -0
  268. package/dist/targets/svelte/motion-layout.d.ts +13 -0
  269. package/dist/targets/svelte/motion-layout.js +70 -0
  270. package/dist/targets/svelte/motion-table.d.ts +14 -0
  271. package/dist/targets/svelte/motion-table.js +308 -0
  272. package/dist/targets/svelte/motion.d.ts +46 -0
  273. package/dist/targets/svelte/motion.js +405 -0
  274. package/dist/targets/svelte/presence.d.ts +71 -0
  275. package/dist/targets/svelte/presence.js +318 -0
  276. package/dist/targets/svelte/radix/accordion.d.ts +9 -0
  277. package/dist/targets/svelte/radix/accordion.js +24 -0
  278. package/dist/targets/svelte/radix/aspect-ratio.d.ts +6 -0
  279. package/dist/targets/svelte/radix/aspect-ratio.js +8 -0
  280. package/dist/targets/svelte/radix/avatar.d.ts +6 -0
  281. package/dist/targets/svelte/radix/avatar.js +10 -0
  282. package/dist/targets/svelte/radix/checkbox.d.ts +10 -0
  283. package/dist/targets/svelte/radix/checkbox.js +24 -0
  284. package/dist/targets/svelte/radix/collapsible.d.ts +7 -0
  285. package/dist/targets/svelte/radix/collapsible.js +16 -0
  286. package/dist/targets/svelte/radix/context-menu.d.ts +8 -0
  287. package/dist/targets/svelte/radix/context-menu.js +49 -0
  288. package/dist/targets/svelte/radix/cores/alert-dialog.d.ts +17 -0
  289. package/dist/targets/svelte/radix/cores/alert-dialog.js +449 -0
  290. package/dist/targets/svelte/radix/cores/collapsible.d.ts +12 -0
  291. package/dist/targets/svelte/radix/cores/collapsible.js +214 -0
  292. package/dist/targets/svelte/radix/cores/core.d.ts +32 -0
  293. package/dist/targets/svelte/radix/cores/core.js +80 -0
  294. package/dist/targets/svelte/radix/cores/direction.d.ts +10 -0
  295. package/dist/targets/svelte/radix/cores/direction.js +64 -0
  296. package/dist/targets/svelte/radix/cores/index.d.ts +19 -0
  297. package/dist/targets/svelte/radix/cores/index.js +85 -0
  298. package/dist/targets/svelte/radix/cores/modal-layer.d.ts +11 -0
  299. package/dist/targets/svelte/radix/cores/modal-layer.js +244 -0
  300. package/dist/targets/svelte/radix/cores/presence.d.ts +12 -0
  301. package/dist/targets/svelte/radix/cores/presence.js +129 -0
  302. package/dist/targets/svelte/radix/cores/slider-logic.d.ts +10 -0
  303. package/dist/targets/svelte/radix/cores/slider-logic.js +287 -0
  304. package/dist/targets/svelte/radix/cores/slider.d.ts +13 -0
  305. package/dist/targets/svelte/radix/cores/slider.js +267 -0
  306. package/dist/targets/svelte/radix/dialog.d.ts +8 -0
  307. package/dist/targets/svelte/radix/dialog.js +20 -0
  308. package/dist/targets/svelte/radix/dropdown-menu.d.ts +9 -0
  309. package/dist/targets/svelte/radix/dropdown-menu.js +38 -0
  310. package/dist/targets/svelte/radix/emit.d.ts +12 -0
  311. package/dist/targets/svelte/radix/emit.js +1339 -0
  312. package/dist/targets/svelte/radix/hover-card.d.ts +7 -0
  313. package/dist/targets/svelte/radix/hover-card.js +22 -0
  314. package/dist/targets/svelte/radix/index.d.ts +12 -0
  315. package/dist/targets/svelte/radix/index.js +28 -0
  316. package/dist/targets/svelte/radix/label.d.ts +3 -0
  317. package/dist/targets/svelte/radix/label.js +5 -0
  318. package/dist/targets/svelte/radix/menubar.d.ts +7 -0
  319. package/dist/targets/svelte/radix/menubar.js +34 -0
  320. package/dist/targets/svelte/radix/navigation-menu.d.ts +8 -0
  321. package/dist/targets/svelte/radix/navigation-menu.js +25 -0
  322. package/dist/targets/svelte/radix/packages.d.ts +34 -0
  323. package/dist/targets/svelte/radix/packages.js +100 -0
  324. package/dist/targets/svelte/radix/part.d.ts +161 -0
  325. package/dist/targets/svelte/radix/part.js +85 -0
  326. package/dist/targets/svelte/radix/popover.d.ts +7 -0
  327. package/dist/targets/svelte/radix/popover.js +15 -0
  328. package/dist/targets/svelte/radix/progress.d.ts +11 -0
  329. package/dist/targets/svelte/radix/progress.js +27 -0
  330. package/dist/targets/svelte/radix/radio-group.d.ts +9 -0
  331. package/dist/targets/svelte/radix/radio-group.js +26 -0
  332. package/dist/targets/svelte/radix/scroll-area.d.ts +7 -0
  333. package/dist/targets/svelte/radix/scroll-area.js +19 -0
  334. package/dist/targets/svelte/radix/select.d.ts +13 -0
  335. package/dist/targets/svelte/radix/select.js +81 -0
  336. package/dist/targets/svelte/radix/separator.d.ts +3 -0
  337. package/dist/targets/svelte/radix/separator.js +5 -0
  338. package/dist/targets/svelte/radix/slider.d.ts +6 -0
  339. package/dist/targets/svelte/radix/slider.js +8 -0
  340. package/dist/targets/svelte/radix/switch.d.ts +6 -0
  341. package/dist/targets/svelte/radix/switch.js +10 -0
  342. package/dist/targets/svelte/radix/tabs.d.ts +8 -0
  343. package/dist/targets/svelte/radix/tabs.js +15 -0
  344. package/dist/targets/svelte/radix/toggle-group.d.ts +9 -0
  345. package/dist/targets/svelte/radix/toggle-group.js +17 -0
  346. package/dist/targets/svelte/radix/toggle.d.ts +6 -0
  347. package/dist/targets/svelte/radix/toggle.js +9 -0
  348. package/dist/targets/svelte/radix/tooltip.d.ts +6 -0
  349. package/dist/targets/svelte/radix/tooltip.js +24 -0
  350. package/dist/targets/svelte/strip.d.ts +2 -0
  351. package/dist/targets/svelte/strip.js +5 -0
  352. package/dist/targets/vue/emit.d.ts +15 -0
  353. package/dist/targets/vue/emit.js +4092 -0
  354. package/dist/targets/vue/events.d.ts +11 -0
  355. package/dist/targets/vue/events.js +13 -0
  356. package/dist/targets/vue/module-builders.d.ts +28 -0
  357. package/dist/targets/vue/module-builders.js +258 -0
  358. package/dist/targets/vue/motion-layout.d.ts +19 -0
  359. package/dist/targets/vue/motion-layout.js +79 -0
  360. package/dist/targets/vue/motion.d.ts +12 -0
  361. package/dist/targets/vue/motion.js +46 -0
  362. package/dist/targets/vue/radix/accordion.d.ts +3 -0
  363. package/dist/targets/vue/radix/accordion.js +12 -0
  364. package/dist/targets/vue/radix/alert-dialog.d.ts +6 -0
  365. package/dist/targets/vue/radix/alert-dialog.js +18 -0
  366. package/dist/targets/vue/radix/aspect-ratio.d.ts +6 -0
  367. package/dist/targets/vue/radix/aspect-ratio.js +8 -0
  368. package/dist/targets/vue/radix/avatar.d.ts +3 -0
  369. package/dist/targets/vue/radix/avatar.js +7 -0
  370. package/dist/targets/vue/radix/checkbox.d.ts +3 -0
  371. package/dist/targets/vue/radix/checkbox.js +9 -0
  372. package/dist/targets/vue/radix/collapsible.d.ts +7 -0
  373. package/dist/targets/vue/radix/collapsible.js +11 -0
  374. package/dist/targets/vue/radix/context-menu.d.ts +3 -0
  375. package/dist/targets/vue/radix/context-menu.js +30 -0
  376. package/dist/targets/vue/radix/dialog.d.ts +3 -0
  377. package/dist/targets/vue/radix/dialog.js +12 -0
  378. package/dist/targets/vue/radix/direction.d.ts +7 -0
  379. package/dist/targets/vue/radix/direction.js +9 -0
  380. package/dist/targets/vue/radix/dropdown-menu.d.ts +3 -0
  381. package/dist/targets/vue/radix/dropdown-menu.js +29 -0
  382. package/dist/targets/vue/radix/hover-card.d.ts +3 -0
  383. package/dist/targets/vue/radix/hover-card.js +11 -0
  384. package/dist/targets/vue/radix/index.d.ts +65 -0
  385. package/dist/targets/vue/radix/index.js +225 -0
  386. package/dist/targets/vue/radix/label.d.ts +3 -0
  387. package/dist/targets/vue/radix/label.js +5 -0
  388. package/dist/targets/vue/radix/menubar.d.ts +6 -0
  389. package/dist/targets/vue/radix/menubar.js +29 -0
  390. package/dist/targets/vue/radix/navigation-menu.d.ts +6 -0
  391. package/dist/targets/vue/radix/navigation-menu.js +21 -0
  392. package/dist/targets/vue/radix/part.d.ts +41 -0
  393. package/dist/targets/vue/radix/part.js +46 -0
  394. package/dist/targets/vue/radix/popover.d.ts +3 -0
  395. package/dist/targets/vue/radix/popover.js +11 -0
  396. package/dist/targets/vue/radix/progress.d.ts +3 -0
  397. package/dist/targets/vue/radix/progress.js +6 -0
  398. package/dist/targets/vue/radix/radio-group.d.ts +3 -0
  399. package/dist/targets/vue/radix/radio-group.js +10 -0
  400. package/dist/targets/vue/radix/scroll-area.d.ts +3 -0
  401. package/dist/targets/vue/radix/scroll-area.js +11 -0
  402. package/dist/targets/vue/radix/select.d.ts +3 -0
  403. package/dist/targets/vue/radix/select.js +29 -0
  404. package/dist/targets/vue/radix/separator.d.ts +3 -0
  405. package/dist/targets/vue/radix/separator.js +5 -0
  406. package/dist/targets/vue/radix/slider.d.ts +3 -0
  407. package/dist/targets/vue/radix/slider.js +13 -0
  408. package/dist/targets/vue/radix/switch.d.ts +3 -0
  409. package/dist/targets/vue/radix/switch.js +9 -0
  410. package/dist/targets/vue/radix/tabs.d.ts +3 -0
  411. package/dist/targets/vue/radix/tabs.js +12 -0
  412. package/dist/targets/vue/radix/toggle-group.d.ts +3 -0
  413. package/dist/targets/vue/radix/toggle-group.js +10 -0
  414. package/dist/targets/vue/radix/toggle.d.ts +3 -0
  415. package/dist/targets/vue/radix/toggle.js +8 -0
  416. package/dist/targets/vue/radix/tooltip.d.ts +3 -0
  417. package/dist/targets/vue/radix/tooltip.js +14 -0
  418. package/dist/targets/vue/render-fn/h.d.ts +52 -0
  419. package/dist/targets/vue/render-fn/h.js +442 -0
  420. package/dist/targets/vue/render-fn.d.ts +21 -0
  421. package/dist/targets/vue/render-fn.js +357 -0
  422. package/dist/targets/vue/slot.d.ts +9 -0
  423. package/dist/targets/vue/slot.js +57 -0
  424. package/dist/typecheck/host.d.ts +45 -0
  425. package/dist/typecheck/host.js +309 -0
  426. package/dist/typecheck/index.d.ts +16 -0
  427. package/dist/typecheck/index.js +17 -0
  428. package/dist/typecheck/lucide.d.ts +8 -0
  429. package/dist/typecheck/lucide.js +45 -0
  430. package/dist/typecheck/sourcemap.d.ts +9 -0
  431. package/dist/typecheck/sourcemap.js +54 -0
  432. package/dist/typecheck/svelte.d.ts +9 -0
  433. package/dist/typecheck/svelte.js +116 -0
  434. package/dist/typecheck/vue.d.ts +8 -0
  435. package/dist/typecheck/vue.js +78 -0
  436. package/dist/types.d.ts +446 -0
  437. package/dist/types.js +11 -0
  438. package/dist/utils/cleanup.d.ts +32 -0
  439. package/dist/utils/cleanup.js +119 -0
  440. package/dist/utils/errors.d.ts +7 -0
  441. package/dist/utils/errors.js +15 -0
  442. package/dist/utils/fs-safe.d.ts +14 -0
  443. package/dist/utils/fs-safe.js +64 -0
  444. package/dist/validate.d.ts +16 -0
  445. package/dist/validate.js +204 -0
  446. package/dist/verify/auto-steps.d.ts +107 -0
  447. package/dist/verify/auto-steps.js +471 -0
  448. package/dist/verify/bundle.d.ts +68 -0
  449. package/dist/verify/bundle.js +548 -0
  450. package/dist/verify/diff.d.ts +31 -0
  451. package/dist/verify/diff.js +133 -0
  452. package/dist/verify/leaks.d.ts +25 -0
  453. package/dist/verify/leaks.js +261 -0
  454. package/dist/verify/link-worker.d.ts +1 -0
  455. package/dist/verify/link-worker.js +27 -0
  456. package/dist/verify/runner.d.ts +57 -0
  457. package/dist/verify/runner.js +867 -0
  458. package/dist/verify/sandbox.d.ts +40 -0
  459. package/dist/verify/sandbox.js +496 -0
  460. package/dist/verify/steps.d.ts +42 -0
  461. package/dist/verify/steps.js +475 -0
  462. package/dist/verify/verdict.d.ts +15 -0
  463. package/dist/verify/verdict.js +19 -0
  464. package/package.json +118 -4
@@ -0,0 +1,224 @@
1
+ import { posix } from 'node:path';
2
+ import * as t from '@babel/types';
3
+ import { inlinedComponents } from './inline.js';
4
+ import { inCompound } from '../../ir/compounds.js';
5
+ const COMPONENT_EXT = { vue: '.vue', svelte: '.svelte', angular: '.ts', 'react-native': '.tsx' };
6
+ function stripExt(p) {
7
+ return p.replace(/\.(tsx|ts|jsx|js|mts)$/, '');
8
+ }
9
+ function pascal(stem) {
10
+ return stem.replace(/(^|[-_.\s]+)([a-zA-Z0-9])/g, (_, __, c) => c.toUpperCase());
11
+ }
12
+ /** `CrmTable` → `crm-table`, `shader-background` stays as it is. */
13
+ export function angularFileName(stem) {
14
+ return stem
15
+ .replace(/([a-z0-9])([A-Z])/g, '$1-$2')
16
+ .replace(/([A-Z]+)([A-Z][a-z])/g, '$1-$2')
17
+ .replace(/[_\s]+/g, '-')
18
+ .toLowerCase();
19
+ }
20
+ /** A component that gets a file (Angular: a class) of its own even when private: exported, or part of a compound. */
21
+ function standsAlone(mod, c) {
22
+ return isExportedComponent(mod, c) || inCompound(mod, c.name);
23
+ }
24
+ export function isExportedComponent(mod, c) {
25
+ return c.exported || mod.exportedNames.has(c.name) || mod.defaultExport === c.name || [...mod.aliases].some(([alias, name]) => name === c.name && mod.exportedNames.has(alias));
26
+ }
27
+ /** The component a file is named after: its default export, the one named like the file, or the first exported. */
28
+ function mainComponentOf(mod, sourceRel) {
29
+ const stem = pascal(posix.basename(stripExt(sourceRel))).toLowerCase();
30
+ return (mod.components.find((c) => c.name === mod.defaultExport) ??
31
+ mod.components.find((c) => isExportedComponent(mod, c) && c.name.toLowerCase() === stem) ??
32
+ mod.components.find((c) => isExportedComponent(mod, c)) ??
33
+ mod.components[0]);
34
+ }
35
+ export function emptyLayout(source, sourceRel, kind) {
36
+ return { source, sourceRel, kind, modulePath: sourceRel, mainComponent: null, components: new Map(), inlined: new Set(), defaultComponent: null, defaultValue: null, styles: [], runes: false };
37
+ }
38
+ /** Another name for a component (`export const PrismSpillCard = PrismSpill`) reaches the component's own file. */
39
+ function addAliases(mod, components) {
40
+ for (const [alias, name] of mod.aliases) {
41
+ const file = components.get(name);
42
+ if (file)
43
+ components.set(alias, file);
44
+ }
45
+ }
46
+ /** The file a private component of a component file gets: named after the main component, so it never meets another file's. */
47
+ function privateComponentFile(mod, c, sourceRel, target, main) {
48
+ const noExt = stripExt(sourceRel);
49
+ if (target === 'angular')
50
+ return posix.join(posix.dirname(sourceRel), angularFileName(posix.basename(noExt)) + '.ts');
51
+ const mainName = main?.name ?? pascal(posix.basename(noExt));
52
+ const name = c === main || isExportedComponent(mod, c) || c.name.startsWith(mainName) ? c.name : mainName + c.name;
53
+ return posix.join(posix.dirname(sourceRel), name + COMPONENT_EXT[target]);
54
+ }
55
+ /**
56
+ * A component written in place must not provide a context: it would provide from its caller's instance, for everything
57
+ * the caller renders. The layout knows the contexts the file declares; once the emitter has linked every provider to
58
+ * its declaration (imported contexts, React 19's `<Theme value>` form), a private component that provides one gets its
59
+ * own file after all.
60
+ */
61
+ export function keepProvidersFiled(mod, layout, target) {
62
+ const main = mod.components.find((c) => c.name === layout.mainComponent);
63
+ for (const c of mod.components) {
64
+ if (!layout.inlined.has(c.name) || !c.provides.length)
65
+ continue;
66
+ layout.inlined.delete(c.name);
67
+ layout.components.set(c.name, privateComponentFile(mod, c, layout.sourceRel, target, main));
68
+ }
69
+ }
70
+ /**
71
+ * Lays out a lowered module for a target. React Native keeps the source layout. `contextNamed` says whether a name the
72
+ * module reads is a context (its own or an imported one): a private component that provides one keeps a file.
73
+ */
74
+ export function layoutFor(mod, sourceRel, target, absSource, contextNamed) {
75
+ const base = { ...emptyLayout(absSource, sourceRel, 'module'), defaultComponent: mod.defaultExport };
76
+ if (sourceRel.endsWith('.css'))
77
+ return { ...base, kind: 'copy' };
78
+ const noExt = stripExt(sourceRel);
79
+ if (target === 'react-native') {
80
+ for (const c of mod.components)
81
+ base.components.set(c.name, sourceRel.replace(/\.(ts|js)$/, '.tsx'));
82
+ return { ...base, modulePath: /\.(tsx|jsx)$/.test(sourceRel) ? sourceRel : noExt + '.ts' };
83
+ }
84
+ const ext = COMPONENT_EXT[target];
85
+ if (target === 'angular') {
86
+ // every component of the file in one .ts file, named the Angular way (crm-table.ts); plain modules keep their name
87
+ if (!mod.components.length)
88
+ return { ...base, modulePath: noExt + '.ts' };
89
+ const file = posix.join(posix.dirname(sourceRel), angularFileName(posix.basename(noExt)) + '.ts');
90
+ const main = mainComponentOf(mod, sourceRel);
91
+ const inlined = inlinedComponents(mod, 'vue', (c) => c !== main && !standsAlone(mod, c), contextNamed);
92
+ for (const c of mod.components)
93
+ if (!inlined.has(c.name))
94
+ base.components.set(c.name, file);
95
+ addAliases(mod, base.components);
96
+ const defaultIsComponent = mod.components.some((c) => c.name === mod.defaultExport);
97
+ return { ...base, modulePath: file, mainComponent: main?.name ?? null, inlined, defaultValue: mod.defaultExport && !defaultIsComponent ? mod.defaultExport : null };
98
+ }
99
+ if (mod.components.length === 0) {
100
+ const runes = target === 'svelte' && mod.hooks.length > 0;
101
+ return { ...base, modulePath: noExt + (runes ? '.svelte.ts' : '.ts'), runes };
102
+ }
103
+ const dir = posix.dirname(sourceRel);
104
+ const main = mainComponentOf(mod, sourceRel);
105
+ const mainName = main?.name ?? pascal(posix.basename(noExt));
106
+ const inlined = inlinedComponents(mod, target === 'vue' ? 'vue' : 'svelte', (c) => c !== main && !standsAlone(mod, c), contextNamed);
107
+ for (const c of mod.components)
108
+ if (!inlined.has(c.name))
109
+ base.components.set(c.name, privateComponentFile(mod, c, sourceRel, target, main));
110
+ addAliases(mod, base.components);
111
+ const defaultIsComponent = mod.components.some((c) => c.name === mod.defaultExport);
112
+ return {
113
+ ...base,
114
+ kind: 'sfc',
115
+ modulePath: posix.join(dir, mainName + ext),
116
+ mainComponent: main?.name ?? null,
117
+ inlined,
118
+ defaultValue: mod.defaultExport && !defaultIsComponent ? mod.defaultExport : null,
119
+ };
120
+ }
121
+ /** The import specifier that reaches `to` from a file at `from` (both output paths). */
122
+ export function importPath(from, to) {
123
+ let target = to;
124
+ // a folder's index from outside the folder is the folder; from inside it, `./index` (`./` names no file)
125
+ if (target.endsWith('/index.ts') && posix.dirname(from) !== posix.dirname(target))
126
+ target = target.slice(0, -'/index.ts'.length);
127
+ else if (target.endsWith('.svelte.ts'))
128
+ target = target.slice(0, -3) + '.js';
129
+ else if (/\.(ts|tsx)$/.test(target) && !target.endsWith('.d.ts'))
130
+ target = stripExt(target);
131
+ let rel = posix.relative(posix.dirname(from), target);
132
+ if (!rel.startsWith('.'))
133
+ rel = './' + rel;
134
+ return rel;
135
+ }
136
+ /** Collects imports for one output file and prints them once each, in a stable order. */
137
+ export class ImportSet {
138
+ entries = new Map();
139
+ entry(source) {
140
+ let e = this.entries.get(source);
141
+ if (!e) {
142
+ e = { defaultName: null, namespace: null, named: new Map(), types: new Map(), side: false };
143
+ this.entries.set(source, e);
144
+ }
145
+ return e;
146
+ }
147
+ named(source, imported, local = imported) {
148
+ this.entry(source).named.set(local, imported);
149
+ }
150
+ type(source, imported, local = imported) {
151
+ const e = this.entry(source);
152
+ if (!e.named.has(local))
153
+ e.types.set(local, imported);
154
+ }
155
+ defaultImport(source, local) {
156
+ this.entry(source).defaultName = local;
157
+ }
158
+ namespace(source, local) {
159
+ this.entry(source).namespace = local;
160
+ }
161
+ side(source) {
162
+ this.entry(source).side = true;
163
+ }
164
+ get size() {
165
+ return this.entries.size;
166
+ }
167
+ /** Every local name these imports bind. */
168
+ locals() {
169
+ const out = new Set();
170
+ for (const e of this.entries.values()) {
171
+ if (e.defaultName)
172
+ out.add(e.defaultName);
173
+ if (e.namespace)
174
+ out.add(e.namespace);
175
+ for (const k of e.named.keys())
176
+ out.add(k);
177
+ for (const k of e.types.keys())
178
+ out.add(k);
179
+ }
180
+ return out;
181
+ }
182
+ /** Import declarations, keeping only names in `used` (when given); side-effect imports always stay. */
183
+ declarations(used) {
184
+ const keep = (n) => !used || used.has(n);
185
+ const rank = (s) => (s.startsWith('.') ? 2 : s.endsWith('.css') ? 3 : /^(vue|svelte)/.test(s) ? 0 : 1);
186
+ const sources = [...this.entries.keys()].sort((a, b) => rank(a) - rank(b) || a.localeCompare(b));
187
+ const out = [];
188
+ for (const source of sources) {
189
+ const e = this.entries.get(source);
190
+ if (!e)
191
+ continue;
192
+ const specifiers = [];
193
+ if (e.defaultName && keep(e.defaultName))
194
+ specifiers.push(t.importDefaultSpecifier(t.identifier(e.defaultName)));
195
+ for (const [local, imported] of [...e.named.entries()].sort(([a], [b]) => a.localeCompare(b))) {
196
+ if (keep(local))
197
+ specifiers.push(t.importSpecifier(t.identifier(local), t.identifier(imported)));
198
+ }
199
+ // `import * as x` sits with a default import, never with named ones: then it is a declaration of its own
200
+ if (e.namespace && keep(e.namespace)) {
201
+ const namespace = t.importNamespaceSpecifier(t.identifier(e.namespace));
202
+ if (specifiers.some((sp) => t.isImportSpecifier(sp)))
203
+ out.push(t.importDeclaration([namespace], t.stringLiteral(source)));
204
+ else
205
+ specifiers.push(namespace);
206
+ }
207
+ const typeSpecs = [];
208
+ for (const [local, imported] of [...e.types.entries()].sort(([a], [b]) => a.localeCompare(b))) {
209
+ if (keep(local) && !e.named.has(local))
210
+ typeSpecs.push(t.importSpecifier(t.identifier(local), t.identifier(imported)));
211
+ }
212
+ if (specifiers.length)
213
+ out.push(t.importDeclaration(specifiers, t.stringLiteral(source)));
214
+ if (typeSpecs.length) {
215
+ const decl = t.importDeclaration(typeSpecs, t.stringLiteral(source));
216
+ decl.importKind = 'type';
217
+ out.push(decl);
218
+ }
219
+ if (e.side && !specifiers.length && !typeSpecs.length)
220
+ out.push(t.importDeclaration([], t.stringLiteral(source)));
221
+ }
222
+ return out;
223
+ }
224
+ }
@@ -0,0 +1,26 @@
1
+ import * as t from '@babel/types';
2
+ export declare const VOID_TAGS: Set<string>;
3
+ export declare const SVG_TAGS: Set<string>;
4
+ /** A stylesheet's rules as a component's own `<style>`: Svelte wraps them in `:global { }` so nothing is scoped. */
5
+ export declare function componentStyle(target: 'vue' | 'svelte', sheets: {
6
+ file: string;
7
+ code: string;
8
+ }[]): string;
9
+ export declare function escapeText(s: string, svelte: boolean): string;
10
+ /** Escapes a double-quoted attribute value; `&` only where it could start an entity, so `a && b` stays readable. */
11
+ export declare function escapeAttr(s: string): string;
12
+ /** One expression as compact single-quoted source, for templates. */
13
+ export declare function printExpr(node: t.Node): string;
14
+ /** A component's type parameters as the `generic` / `generics` attribute takes them: `T extends string, K`. */
15
+ export declare function genericsAttr(params: t.TSTypeParameterDeclaration | null): string;
16
+ /** An expression, pattern or type on one line (`{ label, size = 16 }`), for markup that reads as a call. */
17
+ export declare function printInline(node: t.Node): string;
18
+ /**
19
+ * Statements as one program, so a comment Babel attached to two neighbours prints once; top-level trailing comments
20
+ * are dropped because the next statement carries the same comment as its leading one.
21
+ */
22
+ export declare function printProgram(stmts: t.Statement[], options?: {
23
+ decoratorsBeforeExport?: boolean;
24
+ }): string;
25
+ /** The security warning for `dangerouslySetInnerHTML`, naming the element, its line and the target's construct. */
26
+ export declare function innerHtmlWarning(tag: string, value: t.Expression, construct: string): string;
@@ -0,0 +1,65 @@
1
+ import * as t from '@babel/types';
2
+ import { generate } from '../../analyzer/parse.js';
3
+ export const VOID_TAGS = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'source', 'track', 'wbr']);
4
+ /** SVG containers: whitespace between their children never renders, so they can be printed one child per line. */
5
+ const SVG_CONTAINERS = new Set(['svg', 'g', 'defs', 'linearGradient', 'radialGradient', 'mask', 'clipPath', 'pattern', 'filter', 'symbol', 'marker']);
6
+ export const SVG_TAGS = new Set([
7
+ ...SVG_CONTAINERS, 'path', 'circle', 'rect', 'line', 'polyline', 'polygon', 'ellipse', 'stop', 'use', 'text', 'tspan', 'image', 'foreignObject',
8
+ 'feGaussianBlur', 'feOffset', 'feBlend', 'feColorMatrix', 'feComposite', 'feFlood', 'feMerge', 'feMergeNode', 'feTurbulence', 'feDisplacementMap',
9
+ 'feMorphology', 'feComponentTransfer', 'feFuncA', 'feFuncR', 'feFuncG', 'feFuncB', 'feDropShadow', 'feSpecularLighting', 'fePointLight',
10
+ 'feDiffuseLighting', 'feDistantLight', 'feSpotLight', 'feImage', 'feTile', 'feConvolveMatrix', 'animate', 'animateTransform', 'animateMotion', 'set', 'title', 'desc',
11
+ ]);
12
+ /** A stylesheet's rules as a component's own `<style>`: Svelte wraps them in `:global { }` so nothing is scoped. */
13
+ export function componentStyle(target, sheets) {
14
+ if (!sheets.length)
15
+ return '';
16
+ const body = sheets.map((s) => s.code.trim()).join('\n\n');
17
+ if (target === 'vue')
18
+ return `<style>\n${body}\n</style>\n`;
19
+ const indented = body
20
+ .split('\n')
21
+ .map((line) => (line ? ` ${line}` : line))
22
+ .join('\n');
23
+ return `<style>\n :global {\n${indented}\n }\n</style>\n`;
24
+ }
25
+ export function escapeText(s, svelte) {
26
+ let out = s.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
27
+ if (svelte)
28
+ out = out.replace(/\{/g, '&#123;').replace(/\}/g, '&#125;');
29
+ else
30
+ out = out.replace(/\{\{/g, '&#123;&#123;').replace(/\}\}/g, '&#125;&#125;');
31
+ return out;
32
+ }
33
+ /** Escapes a double-quoted attribute value; `&` only where it could start an entity, so `a && b` stays readable. */
34
+ export function escapeAttr(s) {
35
+ return s.replace(/&(?=[a-zA-Z#])/g, '&amp;').replace(/"/g, '&quot;');
36
+ }
37
+ /** One expression as compact single-quoted source, for templates. */
38
+ export function printExpr(node) {
39
+ return generate(node, { jsescOption: { quotes: 'single', minimal: true }, compact: false, retainLines: false, comments: false }).code;
40
+ }
41
+ /** A component's type parameters as the `generic` / `generics` attribute takes them: `T extends string, K`. */
42
+ export function genericsAttr(params) {
43
+ if (!params?.params.length)
44
+ return '';
45
+ // each parameter on its own: Babel's printer cannot print the `<…>` list without a parent node
46
+ return params.params.map((p) => printInline(p)).join(', ').replace(/"/g, "'");
47
+ }
48
+ /** An expression, pattern or type on one line (`{ label, size = 16 }`), for markup that reads as a call. */
49
+ export function printInline(node) {
50
+ return generate(node, { jsescOption: { quotes: 'single', minimal: true }, concise: true, comments: false }).code;
51
+ }
52
+ /**
53
+ * Statements as one program, so a comment Babel attached to two neighbours prints once; top-level trailing comments
54
+ * are dropped because the next statement carries the same comment as its leading one.
55
+ */
56
+ export function printProgram(stmts, options = {}) {
57
+ for (const s of stmts)
58
+ s.trailingComments = null;
59
+ return generate(t.program(stmts), { jsescOption: { minimal: true, quotes: 'single' }, ...options }).code;
60
+ }
61
+ /** The security warning for `dangerouslySetInnerHTML`, naming the element, its line and the target's construct. */
62
+ export function innerHtmlWarning(tag, value, construct) {
63
+ const line = value.loc?.start.line;
64
+ return `<${tag}>${line ? ` at line ${line}` : ''} renders an HTML string unescaped (dangerouslySetInnerHTML, written as ${construct}): untrusted input there is an XSS injection point, so sanitize it first.`;
65
+ }
@@ -0,0 +1,84 @@
1
+ import * as t from '@babel/types';
2
+ import type { Diagnostic, WebTarget } from '../../types.js';
3
+ import { type Project } from '../../analyzer/deps.js';
4
+ import type { ModuleIR } from '../../ir/model.js';
5
+ import { type ImportSet, type ModuleLayout } from './layout.js';
6
+ import type { TypeResolver } from '../../ir/types.js';
7
+ import type { TypeOracle } from '../../ir/oracle.js';
8
+ import { type TypeImport } from './react-types.js';
9
+ /** Everything an emitter needs to place imports: the project, the layouts of every compiled file, diagnostics. */
10
+ export interface WebContext {
11
+ target: WebTarget;
12
+ project: Project;
13
+ /** absolute source path of the module being emitted */
14
+ sourceFile: string;
15
+ sourceRel: string;
16
+ layoutOf: (absSource: string) => ModuleLayout | null;
17
+ diagnostics: Diagnostic[];
18
+ /** sees through imported props types (Vue needs a props type it can resolve on its own) */
19
+ types: TypeResolver;
20
+ /** types the React code leaves to inference, from TypeScript's checker on the source */
21
+ oracle?: TypeOracle;
22
+ /** the lowered module of another file of the graph (Angular reads its children's props) */
23
+ moduleOf?: (absSource: string) => ModuleIR | null;
24
+ /** where a helper file written once per conversion goes (`motion-action.ts`): its name, unless a file of the output has it */
25
+ helperPath?: (name: string) => string;
26
+ }
27
+ /** Per-module facts the emitters share: names imported from react, next/font loaders, next/image and next/link. */
28
+ export interface ModuleFacts {
29
+ reactNames: Set<string>;
30
+ nextFonts: Map<string, string>;
31
+ nextImage: string | null;
32
+ nextLink: string | null;
33
+ /** types the file declares or imports from its own project: the converted file has them under the same names */
34
+ ownTypes?: Set<string>;
35
+ /** Svelte: why each render helper kept as code is not a snippet (ModuleIR.snippetRefusals) */
36
+ snippetRefusals?: Map<string, string>;
37
+ /**
38
+ * Angular: a module statement that builds markup, written without it (its elements as template-bank values, see
39
+ * targets/angular/bank/helpers.ts), given the statement as the module holds it; null leaves it to the JSX refusal.
40
+ * The statement returned is converted as any other (React types, imports) and must hold no JSX.
41
+ */
42
+ moduleMarkup?: (stmt: t.Statement) => t.Statement | null;
43
+ /** Angular: why a render helper kept as code is not written as template-bank values, by name (said in its module-jsx error) */
44
+ markupRefusals?: Map<string, string>;
45
+ }
46
+ export declare function moduleFacts(mod: ModuleIR): ModuleFacts;
47
+ /**
48
+ * What a next/font loader call becomes outside Next: an object with the same shape whose class sets the family through
49
+ * a Tailwind arbitrary value, with the generic family as fallback. The font file itself is not loaded.
50
+ */
51
+ export declare function nextFontObject(loaderName: string): {
52
+ className: string;
53
+ family: string;
54
+ };
55
+ /** Svelte names for Framer Motion's hooks, from the framework-free `motion` package. */
56
+ export declare const SVELTE_MOTION_HOOKS: Record<string, string>;
57
+ /**
58
+ * Adds one original import to the set for a file at `outPath`, mapping packages to the target's and local files to
59
+ * their output layout. React imports vanish (React types are mapped where they are used).
60
+ */
61
+ /**
62
+ * M3: imports of a file the conversion writes itself (the Svelte Radix cores' barrel), by that file's path in the output:
63
+ * each component file imports it by its own relative path (an emitter adds such an import to a module's imports).
64
+ */
65
+ export declare const OUTPUT_IMPORTS: WeakMap<t.ImportDeclaration, string>;
66
+ export declare function addOriginalImport(decl: t.ImportDeclaration, set: ImportSet, outPath: string, ctx: WebContext): void;
67
+ /** Rewrites `export { X } from './y'` and `export * from './y'` to the target's layout. */
68
+ export declare function rewriteReexport(stmt: t.ExportNamedDeclaration | t.ExportAllDeclaration, outPath: string, ctx: WebContext): t.Statement[];
69
+ /**
70
+ * `export { a } from` and `export type { T } from` for one source. A type re-exported as a value breaks any tool that
71
+ * compiles a file on its own (Vite, esbuild per file, isolatedModules): the browser then asks for an export that is not there.
72
+ */
73
+ export declare function exportsFrom(values: [string, string][], types: [string, string][], source: string): t.Statement[];
74
+ /**
75
+ * Module-level statements for a web target: next/font loaders become plain objects, React types become the target's,
76
+ * and anything still tied to React is reported.
77
+ */
78
+ export declare function transformModuleBody(stmts: t.Statement[], ctx: WebContext, facts: ModuleFacts, typeImports: TypeImport[]): t.Statement[];
79
+ /** `import('@/x/types').Size` in a type: the path to that file's output, as for any import. */
80
+ export declare function rewriteImportTypes<T extends t.Node>(node: T, ctx: WebContext): T;
81
+ /** Names an AST uses as identifiers (over-approximate: property keys count), for trimming unused imports. */
82
+ export declare function namesIn(nodes: t.Node[], into?: Set<string>): Set<string>;
83
+ /** Whether a type names only the file's own types, keywords and literals (`SortKey`, `'a' | 'b'`, `Item[]`). */
84
+ export declare function ownTypeOnly(type: t.TSType, own: Set<string> | undefined): boolean;