@velarscript/web 0.31.0 → 0.32.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 (385) hide show
  1. package/README.md +1 -1
  2. package/dist/analysis/calls/intrinsics/config.d.ts +10 -0
  3. package/dist/analysis/calls/intrinsics/config.d.ts.map +1 -0
  4. package/dist/analysis/calls/intrinsics/config.js +19 -0
  5. package/dist/analysis/calls/intrinsics/config.js.map +1 -0
  6. package/dist/analysis/calls/intrinsics/forms.d.ts +10 -0
  7. package/dist/analysis/calls/intrinsics/forms.d.ts.map +1 -0
  8. package/dist/analysis/calls/intrinsics/forms.js +38 -0
  9. package/dist/analysis/calls/intrinsics/forms.js.map +1 -0
  10. package/dist/analysis/calls/intrinsics/http.d.ts +10 -0
  11. package/dist/analysis/calls/intrinsics/http.d.ts.map +1 -0
  12. package/dist/analysis/calls/intrinsics/http.js +37 -0
  13. package/dist/analysis/calls/intrinsics/http.js.map +1 -0
  14. package/dist/analysis/calls/intrinsics/reactive.d.ts +10 -0
  15. package/dist/analysis/calls/intrinsics/reactive.d.ts.map +1 -0
  16. package/dist/analysis/calls/intrinsics/reactive.js +30 -0
  17. package/dist/analysis/calls/intrinsics/reactive.js.map +1 -0
  18. package/dist/analysis/calls/intrinsics/storage.d.ts +12 -0
  19. package/dist/analysis/calls/intrinsics/storage.d.ts.map +1 -0
  20. package/dist/analysis/calls/intrinsics/storage.js +86 -0
  21. package/dist/analysis/calls/intrinsics/storage.js.map +1 -0
  22. package/dist/analysis/calls/intrinsics/web.d.ts +10 -0
  23. package/dist/analysis/calls/intrinsics/web.d.ts.map +1 -0
  24. package/dist/analysis/calls/intrinsics/web.js +100 -0
  25. package/dist/analysis/calls/intrinsics/web.js.map +1 -0
  26. package/dist/analysis/calls/intrinsics.d.ts +13 -0
  27. package/dist/analysis/calls/intrinsics.d.ts.map +1 -0
  28. package/dist/analysis/calls/intrinsics.js +31 -0
  29. package/dist/analysis/calls/intrinsics.js.map +1 -0
  30. package/dist/analysis/components/contracts.d.ts +19 -0
  31. package/dist/analysis/components/contracts.d.ts.map +1 -0
  32. package/dist/analysis/components/contracts.js +83 -0
  33. package/dist/analysis/components/contracts.js.map +1 -0
  34. package/dist/analysis/components/declaration.d.ts +4 -0
  35. package/dist/analysis/components/declaration.d.ts.map +1 -0
  36. package/dist/analysis/components/declaration.js +163 -0
  37. package/dist/analysis/components/declaration.js.map +1 -0
  38. package/dist/analysis/components/host.d.ts +61 -0
  39. package/dist/analysis/components/host.d.ts.map +1 -0
  40. package/dist/analysis/components/host.js +22 -0
  41. package/dist/analysis/components/host.js.map +1 -0
  42. package/dist/analysis/components/lifecycle.d.ts +22 -0
  43. package/dist/analysis/components/lifecycle.d.ts.map +1 -0
  44. package/dist/analysis/components/lifecycle.js +33 -0
  45. package/dist/analysis/components/lifecycle.js.map +1 -0
  46. package/dist/analysis/components/ownership.d.ts +74 -0
  47. package/dist/analysis/components/ownership.d.ts.map +1 -0
  48. package/dist/analysis/components/ownership.js +106 -0
  49. package/dist/analysis/components/ownership.js.map +1 -0
  50. package/dist/analysis/declarations.d.ts +99 -0
  51. package/dist/analysis/declarations.d.ts.map +1 -0
  52. package/dist/analysis/declarations.js +176 -0
  53. package/dist/analysis/declarations.js.map +1 -0
  54. package/dist/analysis/inference.d.ts +67 -0
  55. package/dist/analysis/inference.d.ts.map +1 -0
  56. package/dist/analysis/inference.js +236 -0
  57. package/dist/analysis/inference.js.map +1 -0
  58. package/dist/analysis/jsx/attributes.d.ts +103 -0
  59. package/dist/analysis/jsx/attributes.d.ts.map +1 -0
  60. package/dist/analysis/jsx/attributes.js +601 -0
  61. package/dist/analysis/jsx/attributes.js.map +1 -0
  62. package/dist/analysis/jsx/elements.d.ts +17 -0
  63. package/dist/analysis/jsx/elements.d.ts.map +1 -0
  64. package/dist/analysis/jsx/elements.js +213 -0
  65. package/dist/analysis/jsx/elements.js.map +1 -0
  66. package/dist/analysis/jsx/host.d.ts +61 -0
  67. package/dist/analysis/jsx/host.d.ts.map +1 -0
  68. package/dist/analysis/jsx/host.js +15 -0
  69. package/dist/analysis/jsx/host.js.map +1 -0
  70. package/dist/analysis/jsx/keys.d.ts +15 -0
  71. package/dist/analysis/jsx/keys.d.ts.map +1 -0
  72. package/dist/analysis/jsx/keys.js +67 -0
  73. package/dist/analysis/jsx/keys.js.map +1 -0
  74. package/dist/analysis/jsx/security.d.ts +29 -0
  75. package/dist/analysis/jsx/security.d.ts.map +1 -0
  76. package/dist/analysis/jsx/security.js +61 -0
  77. package/dist/analysis/jsx/security.js.map +1 -0
  78. package/dist/analysis/jsx-detection.d.ts +49 -0
  79. package/dist/analysis/jsx-detection.d.ts.map +1 -0
  80. package/dist/analysis/jsx-detection.js +196 -0
  81. package/dist/analysis/jsx-detection.js.map +1 -0
  82. package/dist/analysis/keyed-rebuild.d.ts +148 -0
  83. package/dist/analysis/keyed-rebuild.d.ts.map +1 -0
  84. package/dist/analysis/keyed-rebuild.js +299 -0
  85. package/dist/analysis/keyed-rebuild.js.map +1 -0
  86. package/dist/analysis/keyframes-analysis.d.ts +6 -0
  87. package/dist/analysis/keyframes-analysis.d.ts.map +1 -0
  88. package/dist/analysis/keyframes-analysis.js +79 -0
  89. package/dist/analysis/keyframes-analysis.js.map +1 -0
  90. package/dist/analysis/look/builders.d.ts +29 -0
  91. package/dist/analysis/look/builders.d.ts.map +1 -0
  92. package/dist/analysis/look/builders.js +168 -0
  93. package/dist/analysis/look/builders.js.map +1 -0
  94. package/dist/analysis/look/conditions.d.ts +13 -0
  95. package/dist/analysis/look/conditions.d.ts.map +1 -0
  96. package/dist/analysis/look/conditions.js +84 -0
  97. package/dist/analysis/look/conditions.js.map +1 -0
  98. package/dist/analysis/look/edits.d.ts +25 -0
  99. package/dist/analysis/look/edits.d.ts.map +1 -0
  100. package/dist/analysis/look/edits.js +57 -0
  101. package/dist/analysis/look/edits.js.map +1 -0
  102. package/dist/analysis/look/entries.d.ts +56 -0
  103. package/dist/analysis/look/entries.d.ts.map +1 -0
  104. package/dist/analysis/look/entries.js +223 -0
  105. package/dist/analysis/look/entries.js.map +1 -0
  106. package/dist/analysis/look/host.d.ts +47 -0
  107. package/dist/analysis/look/host.d.ts.map +1 -0
  108. package/dist/analysis/look/host.js +16 -0
  109. package/dist/analysis/look/host.js.map +1 -0
  110. package/dist/analysis/look/tokens.d.ts +75 -0
  111. package/dist/analysis/look/tokens.d.ts.map +1 -0
  112. package/dist/analysis/look/tokens.js +151 -0
  113. package/dist/analysis/look/tokens.js.map +1 -0
  114. package/dist/analysis/look/values.d.ts +45 -0
  115. package/dist/analysis/look/values.d.ts.map +1 -0
  116. package/dist/analysis/look/values.js +148 -0
  117. package/dist/analysis/look/values.js.map +1 -0
  118. package/dist/analysis/look-conditions.d.ts +47 -0
  119. package/dist/analysis/look-conditions.d.ts.map +1 -0
  120. package/dist/analysis/look-conditions.js +157 -0
  121. package/dist/analysis/look-conditions.js.map +1 -0
  122. package/dist/analysis/look-sites.d.ts +54 -0
  123. package/dist/analysis/look-sites.d.ts.map +1 -0
  124. package/dist/analysis/look-sites.js +104 -0
  125. package/dist/analysis/look-sites.js.map +1 -0
  126. package/dist/analysis/look-vocabulary-guidance.d.ts +76 -0
  127. package/dist/analysis/look-vocabulary-guidance.d.ts.map +1 -0
  128. package/dist/analysis/look-vocabulary-guidance.js +338 -0
  129. package/dist/analysis/look-vocabulary-guidance.js.map +1 -0
  130. package/dist/analysis/media-conditions.d.ts +33 -0
  131. package/dist/analysis/media-conditions.d.ts.map +1 -0
  132. package/dist/analysis/media-conditions.js +92 -0
  133. package/dist/analysis/media-conditions.js.map +1 -0
  134. package/dist/analysis/program-passes.d.ts +106 -0
  135. package/dist/analysis/program-passes.d.ts.map +1 -0
  136. package/dist/analysis/program-passes.js +149 -0
  137. package/dist/analysis/program-passes.js.map +1 -0
  138. package/dist/analysis/reactivity/bindings.d.ts +37 -0
  139. package/dist/analysis/reactivity/bindings.d.ts.map +1 -0
  140. package/dist/analysis/reactivity/bindings.js +88 -0
  141. package/dist/analysis/reactivity/bindings.js.map +1 -0
  142. package/dist/analysis/reactivity/derived.d.ts +39 -0
  143. package/dist/analysis/reactivity/derived.d.ts.map +1 -0
  144. package/dist/analysis/reactivity/derived.js +80 -0
  145. package/dist/analysis/reactivity/derived.js.map +1 -0
  146. package/dist/analysis/reactivity/host.d.ts +38 -0
  147. package/dist/analysis/reactivity/host.d.ts.map +1 -0
  148. package/dist/analysis/reactivity/host.js +14 -0
  149. package/dist/analysis/reactivity/host.js.map +1 -0
  150. package/dist/analysis/reactivity/retired-accessors.d.ts +82 -0
  151. package/dist/analysis/reactivity/retired-accessors.d.ts.map +1 -0
  152. package/dist/analysis/reactivity/retired-accessors.js +118 -0
  153. package/dist/analysis/reactivity/retired-accessors.js.map +1 -0
  154. package/dist/analysis/renderable.d.ts +47 -0
  155. package/dist/analysis/renderable.d.ts.map +1 -0
  156. package/dist/analysis/renderable.js +105 -0
  157. package/dist/analysis/renderable.js.map +1 -0
  158. package/dist/analysis/routes.d.ts +64 -0
  159. package/dist/analysis/routes.d.ts.map +1 -0
  160. package/dist/analysis/routes.js +182 -0
  161. package/dist/analysis/routes.js.map +1 -0
  162. package/dist/analysis/url-attributes.d.ts +12 -0
  163. package/dist/analysis/url-attributes.d.ts.map +1 -0
  164. package/dist/analysis/url-attributes.js +48 -0
  165. package/dist/analysis/url-attributes.js.map +1 -0
  166. package/dist/analysis/watch-cycles.d.ts +102 -0
  167. package/dist/analysis/watch-cycles.d.ts.map +1 -1
  168. package/dist/analysis/watch-cycles.js +240 -1
  169. package/dist/analysis/watch-cycles.js.map +1 -1
  170. package/dist/analysis/watch-subject.d.ts +45 -0
  171. package/dist/analysis/watch-subject.d.ts.map +1 -0
  172. package/dist/analysis/watch-subject.js +272 -0
  173. package/dist/analysis/watch-subject.js.map +1 -0
  174. package/dist/analysis/web-types.d.ts +27 -0
  175. package/dist/analysis/web-types.d.ts.map +1 -0
  176. package/dist/analysis/web-types.js +170 -0
  177. package/dist/analysis/web-types.js.map +1 -0
  178. package/dist/analyzer.d.ts +18 -617
  179. package/dist/analyzer.d.ts.map +1 -1
  180. package/dist/analyzer.js +208 -4853
  181. package/dist/analyzer.js.map +1 -1
  182. package/dist/compiler.d.ts +20 -0
  183. package/dist/compiler.d.ts.map +1 -1
  184. package/dist/compiler.js +29 -864
  185. package/dist/compiler.js.map +1 -1
  186. package/dist/documentation.d.ts +28 -0
  187. package/dist/documentation.d.ts.map +1 -0
  188. package/dist/documentation.js +67 -0
  189. package/dist/documentation.js.map +1 -0
  190. package/dist/editor/completions.d.ts +12 -0
  191. package/dist/editor/completions.d.ts.map +1 -0
  192. package/dist/editor/completions.js +6 -0
  193. package/dist/editor/completions.js.map +1 -0
  194. package/dist/editor/jsx-completion.d.ts +12 -0
  195. package/dist/editor/jsx-completion.d.ts.map +1 -0
  196. package/dist/editor/jsx-completion.js +137 -0
  197. package/dist/editor/jsx-completion.js.map +1 -0
  198. package/dist/editor/look-completion.d.ts +29 -0
  199. package/dist/editor/look-completion.d.ts.map +1 -0
  200. package/dist/editor/look-completion.js +159 -0
  201. package/dist/editor/look-completion.js.map +1 -0
  202. package/dist/editor.d.ts.map +1 -1
  203. package/dist/editor.js +12 -288
  204. package/dist/editor.js.map +1 -1
  205. package/dist/emit/components.d.ts +33 -0
  206. package/dist/emit/components.d.ts.map +1 -0
  207. package/dist/emit/components.js +135 -0
  208. package/dist/emit/components.js.map +1 -0
  209. package/dist/emit/jsx.d.ts +57 -0
  210. package/dist/emit/jsx.d.ts.map +1 -0
  211. package/dist/emit/jsx.js +384 -0
  212. package/dist/emit/jsx.js.map +1 -0
  213. package/dist/emit/look-css.d.ts +44 -0
  214. package/dist/emit/look-css.d.ts.map +1 -0
  215. package/dist/emit/look-css.js +177 -0
  216. package/dist/emit/look-css.js.map +1 -0
  217. package/dist/emit/look.d.ts +39 -0
  218. package/dist/emit/look.d.ts.map +1 -0
  219. package/dist/emit/look.js +218 -0
  220. package/dist/emit/look.js.map +1 -0
  221. package/dist/emit/runtime-imports.d.ts +40 -0
  222. package/dist/emit/runtime-imports.d.ts.map +1 -0
  223. package/dist/emit/runtime-imports.js +184 -0
  224. package/dist/emit/runtime-imports.js.map +1 -0
  225. package/dist/emitter.d.ts +15 -68
  226. package/dist/emitter.d.ts.map +1 -1
  227. package/dist/emitter.js +79 -1008
  228. package/dist/emitter.js.map +1 -1
  229. package/dist/look/animation.d.ts +7 -0
  230. package/dist/look/animation.d.ts.map +1 -0
  231. package/dist/look/animation.js +13 -0
  232. package/dist/look/animation.js.map +1 -0
  233. package/dist/look/builders.d.ts +35 -0
  234. package/dist/look/builders.d.ts.map +1 -0
  235. package/dist/look/builders.js +74 -0
  236. package/dist/look/builders.js.map +1 -0
  237. package/dist/look/css-functions.d.ts +28 -0
  238. package/dist/look/css-functions.d.ts.map +1 -0
  239. package/dist/look/css-functions.js +54 -0
  240. package/dist/look/css-functions.js.map +1 -0
  241. package/dist/look/keyword-sets.d.ts +41 -0
  242. package/dist/look/keyword-sets.d.ts.map +1 -0
  243. package/dist/look/keyword-sets.js +117 -0
  244. package/dist/look/keyword-sets.js.map +1 -0
  245. package/dist/look/keywords.d.ts +55 -0
  246. package/dist/look/keywords.d.ts.map +1 -0
  247. package/dist/look/keywords.js +387 -0
  248. package/dist/look/keywords.js.map +1 -0
  249. package/dist/look/media.d.ts +19 -0
  250. package/dist/look/media.d.ts.map +1 -0
  251. package/dist/look/media.js +27 -0
  252. package/dist/look/media.js.map +1 -0
  253. package/dist/look/naming.d.ts +9 -0
  254. package/dist/look/naming.d.ts.map +1 -0
  255. package/dist/look/naming.js +45 -0
  256. package/dist/look/naming.js.map +1 -0
  257. package/dist/look/properties.d.ts +16 -0
  258. package/dist/look/properties.d.ts.map +1 -0
  259. package/dist/look/properties.js +52 -0
  260. package/dist/look/properties.js.map +1 -0
  261. package/dist/look/shorthands.d.ts +25 -0
  262. package/dist/look/shorthands.d.ts.map +1 -0
  263. package/dist/look/shorthands.js +130 -0
  264. package/dist/look/shorthands.js.map +1 -0
  265. package/dist/look/tokens.d.ts +38 -0
  266. package/dist/look/tokens.d.ts.map +1 -0
  267. package/dist/look/tokens.js +59 -0
  268. package/dist/look/tokens.js.map +1 -0
  269. package/dist/look/units.d.ts +24 -0
  270. package/dist/look/units.d.ts.map +1 -0
  271. package/dist/look/units.js +33 -0
  272. package/dist/look/units.js.map +1 -0
  273. package/dist/look.d.ts +32 -227
  274. package/dist/look.d.ts.map +1 -1
  275. package/dist/look.js +28 -933
  276. package/dist/look.js.map +1 -1
  277. package/dist/module-roster.d.ts +16 -0
  278. package/dist/module-roster.d.ts.map +1 -0
  279. package/dist/module-roster.js +28 -0
  280. package/dist/module-roster.js.map +1 -0
  281. package/dist/modules/app.d.ts +9 -0
  282. package/dist/modules/app.d.ts.map +1 -0
  283. package/dist/modules/app.js +20 -0
  284. package/dist/modules/app.js.map +1 -0
  285. package/dist/modules/browser-test.d.ts +9 -0
  286. package/dist/modules/browser-test.d.ts.map +1 -0
  287. package/dist/modules/browser-test.js +67 -0
  288. package/dist/modules/browser-test.js.map +1 -0
  289. package/dist/modules/browser.d.ts +10 -0
  290. package/dist/modules/browser.d.ts.map +1 -0
  291. package/dist/modules/browser.js +89 -0
  292. package/dist/modules/browser.js.map +1 -0
  293. package/dist/modules/config.d.ts +9 -0
  294. package/dist/modules/config.d.ts.map +1 -0
  295. package/dist/modules/config.js +14 -0
  296. package/dist/modules/config.js.map +1 -0
  297. package/dist/modules/files.d.ts +9 -0
  298. package/dist/modules/files.d.ts.map +1 -0
  299. package/dist/modules/files.js +16 -0
  300. package/dist/modules/files.js.map +1 -0
  301. package/dist/modules/forms.d.ts +9 -0
  302. package/dist/modules/forms.d.ts.map +1 -0
  303. package/dist/modules/forms.js +26 -0
  304. package/dist/modules/forms.js.map +1 -0
  305. package/dist/modules/http.d.ts +9 -0
  306. package/dist/modules/http.d.ts.map +1 -0
  307. package/dist/modules/http.js +127 -0
  308. package/dist/modules/http.js.map +1 -0
  309. package/dist/modules/look.d.ts +9 -0
  310. package/dist/modules/look.d.ts.map +1 -0
  311. package/dist/modules/look.js +58 -0
  312. package/dist/modules/look.js.map +1 -0
  313. package/dist/modules/realtime.d.ts +9 -0
  314. package/dist/modules/realtime.d.ts.map +1 -0
  315. package/dist/modules/realtime.js +163 -0
  316. package/dist/modules/realtime.js.map +1 -0
  317. package/dist/modules/storage.d.ts +9 -0
  318. package/dist/modules/storage.d.ts.map +1 -0
  319. package/dist/modules/storage.js +59 -0
  320. package/dist/modules/storage.js.map +1 -0
  321. package/dist/modules/types.d.ts +78 -0
  322. package/dist/modules/types.d.ts.map +1 -0
  323. package/dist/modules/types.js +154 -0
  324. package/dist/modules/types.js.map +1 -0
  325. package/dist/modules/web.d.ts +9 -0
  326. package/dist/modules/web.d.ts.map +1 -0
  327. package/dist/modules/web.js +63 -0
  328. package/dist/modules/web.js.map +1 -0
  329. package/dist/modules/websocket.d.ts +11 -0
  330. package/dist/modules/websocket.d.ts.map +1 -0
  331. package/dist/modules/websocket.js +75 -0
  332. package/dist/modules/websocket.js.map +1 -0
  333. package/dist/parser/expressions/jsx.d.ts +17 -0
  334. package/dist/parser/expressions/jsx.d.ts.map +1 -0
  335. package/dist/parser/expressions/jsx.js +43 -0
  336. package/dist/parser/expressions/jsx.js.map +1 -0
  337. package/dist/parser/expressions/keyframes.d.ts +15 -0
  338. package/dist/parser/expressions/keyframes.d.ts.map +1 -0
  339. package/dist/parser/expressions/keyframes.js +33 -0
  340. package/dist/parser/expressions/keyframes.js.map +1 -0
  341. package/dist/parser/expressions/look.d.ts +16 -0
  342. package/dist/parser/expressions/look.d.ts.map +1 -0
  343. package/dist/parser/expressions/look.js +37 -0
  344. package/dist/parser/expressions/look.js.map +1 -0
  345. package/dist/parser/expressions/visual-block.d.ts +17 -0
  346. package/dist/parser/expressions/visual-block.d.ts.map +1 -0
  347. package/dist/parser/expressions/visual-block.js +21 -0
  348. package/dist/parser/expressions/visual-block.js.map +1 -0
  349. package/dist/parser/keyframes-source.d.ts +24 -0
  350. package/dist/parser/keyframes-source.d.ts.map +1 -0
  351. package/dist/parser/keyframes-source.js +133 -0
  352. package/dist/parser/keyframes-source.js.map +1 -0
  353. package/dist/parser/look-source.d.ts +25 -0
  354. package/dist/parser/look-source.d.ts.map +1 -0
  355. package/dist/parser/look-source.js +189 -0
  356. package/dist/parser/look-source.js.map +1 -0
  357. package/dist/parser/spans.d.ts +24 -0
  358. package/dist/parser/spans.d.ts.map +1 -0
  359. package/dist/parser/spans.js +113 -0
  360. package/dist/parser/spans.js.map +1 -0
  361. package/dist/parser/statements/components.d.ts +37 -0
  362. package/dist/parser/statements/components.d.ts.map +1 -0
  363. package/dist/parser/statements/components.js +185 -0
  364. package/dist/parser/statements/components.js.map +1 -0
  365. package/dist/parser/statements/heads.d.ts +38 -0
  366. package/dist/parser/statements/heads.d.ts.map +1 -0
  367. package/dist/parser/statements/heads.js +55 -0
  368. package/dist/parser/statements/heads.js.map +1 -0
  369. package/dist/parser/statements/imports.d.ts +9 -0
  370. package/dist/parser/statements/imports.d.ts.map +1 -0
  371. package/dist/parser/statements/imports.js +31 -0
  372. package/dist/parser/statements/imports.js.map +1 -0
  373. package/dist/parser/statements/reactive.d.ts +31 -0
  374. package/dist/parser/statements/reactive.d.ts.map +1 -0
  375. package/dist/parser/statements/reactive.js +68 -0
  376. package/dist/parser/statements/reactive.js.map +1 -0
  377. package/dist/parser/statements/unsafe-css.d.ts +21 -0
  378. package/dist/parser/statements/unsafe-css.d.ts.map +1 -0
  379. package/dist/parser/statements/unsafe-css.js +42 -0
  380. package/dist/parser/statements/unsafe-css.js.map +1 -0
  381. package/dist/parser.d.ts +37 -50
  382. package/dist/parser.d.ts.map +1 -1
  383. package/dist/parser.js +98 -882
  384. package/dist/parser.js.map +1 -1
  385. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../../src/analysis/components/contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH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 import { type ComponentAnalysisHost } from "./host.ts";
3
+ export declare function analyzeComponent(host: ComponentAnalysisHost, statement: ComponentDeclaration): void;
4
+ //# sourceMappingURL=declaration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaration.d.ts","sourceRoot":"","sources":["../../../src/analysis/components/declaration.ts"],"names":[],"mappings":"AAYA,OAAO,EAAY,KAAK,uBAAuB,IAAI,oBAAoB,EAAyB,MAAM,cAAc,CAAC;AAarH,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAoBvD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,oBAAoB,GAAG,IAAI,CAKnG"}
@@ -0,0 +1,163 @@
1
+ /**
2
+ * One `component` declaration analyzed: the prologue that opens the body's
3
+ * scope and declares its props, the per-section dispatch over the items a body
4
+ * may hold, and the epilogue that counts the sections and closes everything the
5
+ * prologue opened.
6
+ *
7
+ * D115 P4 R3c. The three are named rather than one 122-line method because they
8
+ * are three different things: the prologue and the epilogue are a matched pair
9
+ * that has to stay balanced, and the loop between them is a dispatch whose arms
10
+ * are the reactive declarations `analysis/declarations.ts` already owns.
11
+ */
12
+ import { nullType, unknownType } from "@velarscript/compiler/extension";
13
+ import { isWebJsx } from "../../ast.js";
14
+ import { isWebNodeType } from "../../types.js";
15
+ import { componentSectionCountDiagnostics } from "../component-guidance.js";
16
+ import { analyzeActionDeclaration, analyzeComputedDeclaration, analyzeResourceDeclaration, analyzeStateDeclaration, componentType, } from "../declarations.js";
17
+ import { rejectFrozenWatchSubject, rejectWatchCycle } from "../watch-cycles.js";
18
+ import { diagnostic } from "../web-types.js";
19
+ import { containsReadonlyView, validateComponentHandleType, validateComponentHost } from "./contracts.js";
20
+ import {} from "./host.js";
21
+ export function analyzeComponent(host, statement) {
22
+ const frame = beginComponentBody(host, statement);
23
+ const sections = { cleanup: 0, exposes: 0, mounted: 0, renders: 0, renderValue: null };
24
+ for (const item of statement.body)
25
+ analyzeComponentItem(host, statement, item, frame, sections);
26
+ endComponentBody(host, statement, frame, sections);
27
+ }
28
+ function beginComponentBody(host, statement) {
29
+ const outerConstructorDepth = host.constructorDepth;
30
+ if (!host.isPredeclared(statement))
31
+ host.declareBinding(statement.name, false, componentType(host, statement), statement.span);
32
+ // VEL5075: a `def` written from here to the matching decrement lowers
33
+ // through this component's scope, so its component elements are children.
34
+ host.componentBodyDepth += 1;
35
+ host.enterScope();
36
+ host.flowFrameDepth += 1;
37
+ const previousStates = host.componentStates;
38
+ host.componentStates = new Set(statement.body.filter((item) => item.kind === "ExtensionStatement:web:state").map((item) => item.name));
39
+ const previousExplicitReadonlyProps = host.explicitReadonlyPropBindings;
40
+ const explicitReadonlyProps = new Map();
41
+ // Component items are analyzed one by one rather than through
42
+ // analyzeStatements, so the shadow prescan runs here — before the
43
+ // parameters, whose defaults are emitted as closures inside the component
44
+ // body where a later item's shadow would capture them.
45
+ host.prescanScopeDeclarations(statement.body.filter((item) => item.kind !== "ExtensionStatement:web:mounted" && item.kind !== "ExtensionStatement:web:cleanup" && item.kind !== "ExtensionStatement:web:expose"));
46
+ for (const parameter of statement.parameters) {
47
+ const type = host.resolveAnnotation(parameter.type);
48
+ const valid = parameter.type ? host.validateTypeReference(parameter.type) : true;
49
+ if (parameter.defaultValue && valid)
50
+ host.requireAssignable(host.inferParameterDefault(parameter.defaultValue, type), type, parameter.defaultValue.span);
51
+ const declared = valid ? type : host.resolveValidatedAnnotation(parameter.type);
52
+ host.declareBinding(parameter.name, false, declared, parameter.span);
53
+ if (valid && containsReadonlyView(host, declared))
54
+ explicitReadonlyProps.set(parameter.name, parameter.span.start);
55
+ host.markDeclaredBindingReactive(parameter.name, "prop");
56
+ if (parameter.name === "ref")
57
+ host.diagnostics.push(diagnostic("VEL5056", "'ref' is a compiler-owned JSX directive and cannot be declared as a component prop", parameter.span));
58
+ }
59
+ host.explicitReadonlyPropBindings = explicitReadonlyProps;
60
+ const handleType = statement.handleType ? host.resolveAnnotation(statement.handleType) : null;
61
+ const handleTypeValid = statement.handleType ? host.validateTypeReference(statement.handleType) : true;
62
+ if (handleType && handleTypeValid)
63
+ validateComponentHandleType(host, handleType, statement.handleType.span);
64
+ host.constructorDepth = 0;
65
+ return { handleType, handleTypeValid, outerConstructorDepth, previousExplicitReadonlyProps, previousStates };
66
+ }
67
+ function analyzeComponentItem(host, statement, item, frame, sections) {
68
+ const { handleType, handleTypeValid } = frame;
69
+ if (item.kind === "ExtensionStatement:web:state") {
70
+ analyzeStateDeclaration(host, item);
71
+ }
72
+ else if (item.kind === "ExtensionStatement:web:computed") {
73
+ host.flowFrameDepth += 1;
74
+ analyzeComputedDeclaration(host, item);
75
+ host.flowFrameDepth -= 1;
76
+ }
77
+ else if (item.kind === "ExtensionStatement:web:resource") {
78
+ host.flowFrameDepth += 1;
79
+ analyzeResourceDeclaration(host, item);
80
+ host.flowFrameDepth -= 1;
81
+ }
82
+ else if (item.kind === "ExtensionStatement:web:action") {
83
+ analyzeActionDeclaration(host, item);
84
+ }
85
+ else if (item.kind === "ExtensionStatement:web:watch") {
86
+ host.flowFrameDepth += 1;
87
+ host.synchronousReactiveDepth += 1;
88
+ const watched = host.inferExpression(item.expression);
89
+ if (rejectFrozenWatchSubject(host, item.expression, watched, item.currentName, item.previousName)) {
90
+ rejectWatchCycle(host, item.expression, watched, item.body);
91
+ }
92
+ host.enterScope();
93
+ if (item.currentName)
94
+ host.declareBinding(item.currentName, false, watched, item.span);
95
+ if (item.previousName)
96
+ host.declareBinding(item.previousName, false, watched, item.span);
97
+ host.watchBodyDepth += 1;
98
+ host.analyzeStatements(item.body);
99
+ host.watchBodyDepth -= 1;
100
+ host.exitScope();
101
+ host.synchronousReactiveDepth -= 1;
102
+ host.flowFrameDepth -= 1;
103
+ }
104
+ else if (item.kind === "ExtensionStatement:web:expose") {
105
+ sections.exposes += 1;
106
+ host.flowFrameDepth += 1;
107
+ const actual = host.inferExpression(item.value, handleType ?? unknownType);
108
+ host.flowFrameDepth -= 1;
109
+ if (!handleType)
110
+ host.diagnostics.push(diagnostic("VEL5056", `Component '${statement.name}' uses 'expose' without declaring 'exposes HandleType'`, item.span));
111
+ else if (handleTypeValid)
112
+ host.requireAssignable(actual, handleType, item.value.span);
113
+ }
114
+ else if (item.kind === "ExtensionStatement:web:mounted") {
115
+ sections.mounted += 1;
116
+ host.mountedDepth += 1;
117
+ host.flowFrameDepth += 1;
118
+ host.analyzeBlock(item.body);
119
+ host.flowFrameDepth -= 1;
120
+ host.mountedDepth -= 1;
121
+ }
122
+ else if (item.kind === "ExtensionStatement:web:cleanup") {
123
+ sections.cleanup += 1;
124
+ // D51 (audit 12): a cleanup hook runs once and ends, so it is an
125
+ // ordinary scope with an exit. It used to be counted as component
126
+ // setup, and the rejection then named `@cleanup` as its own fix.
127
+ host.cleanupDepth += 1;
128
+ host.flowFrameDepth += 1;
129
+ host.analyzeBlock(item.body);
130
+ host.flowFrameDepth -= 1;
131
+ host.cleanupDepth -= 1;
132
+ }
133
+ else if (item.kind === "ReturnStatement") {
134
+ sections.renders += 1;
135
+ sections.renderValue = item.value;
136
+ host.flowFrameDepth += 1;
137
+ const rendered = item.value ? host.inferExpression(item.value) : nullType;
138
+ host.flowFrameDepth -= 1;
139
+ // WEB-U15: `return null` is the React habit for "render nothing". A
140
+ // component always has one root, so the decision belongs to the caller.
141
+ if (rendered.kind === "null") {
142
+ host.typeError("A component always returns one JSX root; decide at the call site with '{show ? <Card /> : null}', or return an empty element such as <span />", item.span);
143
+ }
144
+ else if (!isWebNodeType(rendered) && rendered.kind !== "any")
145
+ host.typeError("A component must return JSX", item.span);
146
+ }
147
+ else {
148
+ host.analyzeStatement(item);
149
+ }
150
+ }
151
+ function endComponentBody(host, statement, frame, sections) {
152
+ const { cleanup, exposes, mounted, renders, renderValue } = sections;
153
+ host.diagnostics.push(...componentSectionCountDiagnostics(statement.name, { renders, mounted, cleanup, exposes }, statement.span, statement.handleType?.span ?? null));
154
+ if (renderValue && isWebJsx(renderValue))
155
+ validateComponentHost(host, renderValue, statement);
156
+ host.componentStates = frame.previousStates;
157
+ host.explicitReadonlyPropBindings = frame.previousExplicitReadonlyProps;
158
+ host.flowFrameDepth -= 1;
159
+ host.exitScope();
160
+ host.componentBodyDepth -= 1;
161
+ host.constructorDepth = frame.outerConstructorDepth;
162
+ }
163
+ //# sourceMappingURL=declaration.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"declaration.js","sourceRoot":"","sources":["../../../src/analysis/components/declaration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAmD,MAAM,iCAAiC,CAAC;AACzH,OAAO,EAAE,QAAQ,EAA+E,MAAM,cAAc,CAAC;AACrH,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,gCAAgC,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EACL,wBAAwB,EACxB,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,EACvB,aAAa,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAC1G,OAAO,EAA8B,MAAM,WAAW,CAAC;AAoBvD,MAAM,UAAU,gBAAgB,CAAC,IAA2B,EAAE,SAA+B;IAC3F,MAAM,KAAK,GAAG,kBAAkB,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;IAClD,MAAM,QAAQ,GAAsB,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE,CAAC;IAC1G,KAAK,MAAM,IAAI,IAAI,SAA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E,IAAI,IAAI,IAAI,CAAC,CAAC,CAAC;IACvK,IAAI,WAAW,IAAI,QAAQ,CAAC,WAAW,CAAC;QAAE,qBAAqB,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,CAAC,CAAC;IAC9F,IAAI,CAAC,eAAe,GAAG,KAAK,CAAC,cAAc,CAAC;IAC5C,IAAI,CAAC,4BAA4B,GAAG,KAAK,CAAC,6BAA6B,CAAC;IACxE,IAAI,CAAC,cAAc,IAAI,CAAC,CAAC;IACzB,IAAI,CAAC,SAAS,EAAE,CAAC;IACjB,IAAI,CAAC,kBAAkB,IAAI,CAAC,CAAC;IAC7B,IAAI,CAAC,gBAAgB,GAAG,KAAK,CAAC,qBAAqB,CAAC;AACtD,CAAC"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * What the component rules ask of the analyzer that hosts them: the six depths
3
+ * that say where in a component body the walk stands, the set of states the
4
+ * body declares, and the base-analyzer operations a body's sections perform.
5
+ *
6
+ * D115 P4 R3c. `ComponentAnalysisHost` is an intersection rather than an
7
+ * `extends` chain because a component body *runs* the declaration analyzers and
8
+ * the watch refusals: it needs everything those two groups need, and the two
9
+ * declare some of the same tables at different widths — `computedBindingSpans`
10
+ * is written by a `computed` declaration and only read by the name rules. An
11
+ * intersection lets each face keep saying exactly what its own group does with
12
+ * a table.
13
+ *
14
+ * Every depth is an accessor pair, so the moved bodies keep their original
15
+ * `host.flowFrameDepth += 1` / `-= 1` text and the analyzer's own field is what
16
+ * moves.
17
+ */
18
+ import { type Diagnostic, type Span } from "@velarscript/compiler";
19
+ import { type Expression, type Statement, type TypeReference, type ValueType } from "@velarscript/compiler/extension";
20
+ import { type DeclarationAnalysisHost } from "../declarations.ts";
21
+ import { type WatchCycleHost } from "../watch-cycles.ts";
22
+ export interface ComponentBodyHost {
23
+ /** D51 (audit 12): how many `@cleanup` hooks enclose the walk — an ordinary scope with an exit. */
24
+ cleanupDepth: number;
25
+ /** VEL5075: how many component bodies enclose the declaration being analyzed. */
26
+ componentBodyDepth: number;
27
+ /** The `state` names this component body declares, or null outside every component. */
28
+ componentStates: Set<string> | null;
29
+ /** The base analyzer's constructor depth, saved and restored around a component body. */
30
+ constructorDepth: number;
31
+ /** D74: the props of this component whose authors wrote a readonly contract. Replaced per component. */
32
+ explicitReadonlyPropBindings: ReadonlyMap<string, number>;
33
+ flowFrameDepth: number;
34
+ /** How deep the walk stands inside JSX; an `await` there has no synchronous position to run in. */
35
+ jsxDepth: number;
36
+ mountedDepth: number;
37
+ /** D51 (audit 12): a component `watch` body runs on a change and ends, exactly as a module `watch` body does. */
38
+ watchBodyDepth: number;
39
+ readonly diagnostics: Diagnostic[];
40
+ analyzeBlock(statements: readonly Statement[]): void;
41
+ analyzeStatement(statement: Statement): void;
42
+ analyzeStatements(statements: readonly Statement[]): void;
43
+ enterScope(): void;
44
+ exitScope(): void;
45
+ expandAliases(type: ValueType): ValueType;
46
+ fieldsOf(identity: string): ReadonlyMap<string, ValueType> | null;
47
+ inComponentSetupPosition(): boolean;
48
+ inferExpression(expression: Expression, contextualType?: ValueType): ValueType;
49
+ inferParameterDefault(expression: Expression, contextualType: ValueType): ValueType;
50
+ isPredeclared(statement: object): boolean;
51
+ prescanScopeDeclarations(statements: readonly Statement[]): void;
52
+ resolveAnnotation(reference: TypeReference | null): ValueType;
53
+ typeError(message: string, errorSpan: Span): void;
54
+ }
55
+ /**
56
+ * The one face the `analysis/components/` collaborators read: what a component
57
+ * body itself needs, plus the declaration analyzers its sections run and the
58
+ * watch refusals its `watch` section asks.
59
+ */
60
+ export type ComponentAnalysisHost = ComponentBodyHost & DeclarationAnalysisHost & WatchCycleHost;
61
+ //# sourceMappingURL=host.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../src/analysis/components/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,IAAI,EAAE,MAAM,uBAAuB,C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E,cAAc,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/E,qBAAqB,CAAC,UAAU,EAAE,UAAU,EAAE,cAAc,EAAE,SAAS,GAAG,SAAS,CAAC;IACpF,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C,wBAAwB,CAAC,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CAAC;IACjE,iBAAiB,CAAC,SAAS,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,CAAC;IAC9D,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,IAAI,CAAC;CACnD;AAED;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,GAAG,iBAAiB,GAAG,uBAAuB,GAAG,cAAc,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * What the component rules ask of the analyzer that hosts them: the six depths
3
+ * that say where in a component body the walk stands, the set of states the
4
+ * body declares, and the base-analyzer operations a body's sections perform.
5
+ *
6
+ * D115 P4 R3c. `ComponentAnalysisHost` is an intersection rather than an
7
+ * `extends` chain because a component body *runs* the declaration analyzers and
8
+ * the watch refusals: it needs everything those two groups need, and the two
9
+ * declare some of the same tables at different widths — `computedBindingSpans`
10
+ * is written by a `computed` declaration and only read by the name rules. An
11
+ * intersection lets each face keep saying exactly what its own group does with
12
+ * a table.
13
+ *
14
+ * Every depth is an accessor pair, so the moved bodies keep their original
15
+ * `host.flowFrameDepth += 1` / `-= 1` text and the analyzer's own field is what
16
+ * moves.
17
+ */
18
+ import {} from "@velarscript/compiler";
19
+ import {} from "@velarscript/compiler/extension";
20
+ import {} from "../declarations.js";
21
+ import {} from "../watch-cycles.js";
22
+ //# sourceMappingURL=host.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../../../src/analysis/components/host.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAA8B,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAuE,MAAM,iCAAiC,CAAC;AACtH,OAAO,EAAgC,MAAM,oBAAoB,CAAC;AAClE,OAAO,EAAuB,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Where inside a component the walk stands, and what that position refuses: a
3
+ * `return` nested in a body that has no function frame, and an `await` in one of
4
+ * the three synchronous positions.
5
+ *
6
+ * D115 P4 R3c. All three are readings of the depths and of nothing else, which
7
+ * is why they are one module: a change to what counts as "inside the body" has
8
+ * to move all three together or the three answers stop agreeing.
9
+ */
10
+ import { type ComponentAnalysisHost } from "./host.ts";
11
+ /**
12
+ * D114 0.29.0 JX-I2: a component body has no function frame, so a `return` nested
13
+ * inside it — in a `match` arm, an `if`, a `for` — used to earn VEL3003 next to
14
+ * VEL5008 ("exactly one top-level return"), two rules its author can only read as
15
+ * contradicting each other. A lifecycle hook and a watch body are inside the same
16
+ * component and are *not* it: neither returns anything, so a `return` there keeps
17
+ * VEL3003.
18
+ */
19
+ export declare function extensionOwnsFunctionlessReturn(host: ComponentAnalysisHost): boolean;
20
+ export declare function invalidExtensionAwaitContext(host: ComponentAnalysisHost): boolean;
21
+ export declare function invalidExtensionAwaitMessage(host: ComponentAnalysisHost): string | null;
22
+ //# sourceMappingURL=lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../src/analysis/components/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;;;;;GAOG;AACH,wBAAgB,+BAA+B,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAEpF;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAGjF;AAED,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAIvF"}
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Where inside a component the walk stands, and what that position refuses: a
3
+ * `return` nested in a body that has no function frame, and an `await` in one of
4
+ * the three synchronous positions.
5
+ *
6
+ * D115 P4 R3c. All three are readings of the depths and of nothing else, which
7
+ * is why they are one module: a change to what counts as "inside the body" has
8
+ * to move all three together or the three answers stop agreeing.
9
+ */
10
+ import {} from "./host.js";
11
+ /**
12
+ * D114 0.29.0 JX-I2: a component body has no function frame, so a `return` nested
13
+ * inside it — in a `match` arm, an `if`, a `for` — used to earn VEL3003 next to
14
+ * VEL5008 ("exactly one top-level return"), two rules its author can only read as
15
+ * contradicting each other. A lifecycle hook and a watch body are inside the same
16
+ * component and are *not* it: neither returns anything, so a `return` there keeps
17
+ * VEL3003.
18
+ */
19
+ export function extensionOwnsFunctionlessReturn(host) {
20
+ return host.componentBodyDepth > 0 && host.mountedDepth === 0 && host.cleanupDepth === 0 && host.watchBodyDepth === 0;
21
+ }
22
+ export function invalidExtensionAwaitContext(host) {
23
+ return host.synchronousReactiveDepth > 0 || host.jsxDepth > 0
24
+ || (host.componentStates !== null && host.mountedDepth === 0);
25
+ }
26
+ export function invalidExtensionAwaitMessage(host) {
27
+ if (host.jsxDepth > 0)
28
+ return "JSX rendering is synchronous; load async component data with a resource or await before constructing JSX";
29
+ if (host.synchronousReactiveDepth > 0)
30
+ return "Computed callbacks and watch blocks are synchronous; use resource, action, or mounted for async work";
31
+ return "Component setup and cleanup are synchronous; use resource, action, or mounted for async work";
32
+ }
33
+ //# sourceMappingURL=lifecycle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle.js","sourceRoot":"","sources":["../../../src/analysis/components/lifecycle.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAA8B,MAAM,WAAW,CAAC;AAEvD;;;;;;;GAOG;AACH,MAAM,UAAU,+BAA+B,CAAC,IAA2B;IACzE,OAAO,IAAI,CAAC,kBAAkB,GAAG,CAAC,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,IAAI,CAAC,cAAc,KAAK,CAAC,CAAC;AACxH,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,IAA2B;IACtE,OAAO,IAAI,CAAC,wBAAwB,GAAG,CAAC,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC;WACxD,CAAC,IAAI,CAAC,eAAe,KAAK,IAAI,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC;AAClE,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,IAA2B;IACtE,IAAI,IAAI,CAAC,QAAQ,GAAG,CAAC;QAAE,OAAO,0GAA0G,CAAC;IACzI,IAAI,IAAI,CAAC,wBAAwB,GAAG,CAAC;QAAE,OAAO,sGAAsG,CAAC;IACrJ,OAAO,8FAA8F,CAAC;AACxG,CAAC"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * What a component owns and what a plain `def` may not: the `using` a
3
+ * construction section has no scope to release at, the component element a
4
+ * helper answers with but cannot build, and the reactive declaration that makes
5
+ * a markup helper a component in a function's clothes.
6
+ *
7
+ * D115 P4 R3c. The three are one module because each of them is the same
8
+ * question asked from a different side — who owns the value this position
9
+ * produces — and each answers it from the component depths.
10
+ */
11
+ import { type Statement } from "@velarscript/compiler/extension";
12
+ import { type ComponentAnalysisHost } from "./host.ts";
13
+ type FunctionDeclaration = Extract<Statement, {
14
+ readonly kind: "FunctionDeclaration";
15
+ }>;
16
+ /**
17
+ * D43 item 69: a component body is a construction section, not a scope with
18
+ * an exit — its resources live until unmount. Ownership belongs to the
19
+ * lifecycle hook or to a function inside the component, so the setup section
20
+ * says so instead of releasing at the wrong moment.
21
+ *
22
+ * Null means this position has nothing of its own to say, and the base
23
+ * analyzer's own answer stands.
24
+ */
25
+ export declare function ownershipScopeRejection(host: ComponentAnalysisHost): string | null;
26
+ /**
27
+ * P2b-5: a `def` that answers markup and answers it with a component element.
28
+ *
29
+ * Everything about the shape is legal one step out. A component element is a
30
+ * legal module-level expression — `const root = <App />` is the instantiation
31
+ * site D90 R4-b rules on, and `mount` takes exactly the instance it evaluates
32
+ * to. A `def` answering markup is a legal markup helper — dispatch over a
33
+ * closed vocabulary is what the P2b wave was writing. The defect is only
34
+ * where the two meet, and it is a representation split the type does not
35
+ * carry: a component element in a *child* position lowers to `__velarChild`,
36
+ * which owns a scope and answers a DOM node, while the same element standing
37
+ * alone lowers to `__velarInstantiate`, which answers an instance. Both are
38
+ * typed `WebNode`; only one is one. Returned from a helper and handed to a
39
+ * render, the instance reaches `__velarAppend` and takes the whole subtree
40
+ * down with "JSX can render only text, finite numbers, bool, enums, WebNode
41
+ * values, and Lists of those values" — the check-green, runtime-dead shape.
42
+ *
43
+ * The walk stops at every JSX element, which is exactly where the emitter
44
+ * stops: inside one, every position is a child position and every component
45
+ * element there is already correct — `return <div><Badge /></div>` and an
46
+ * interpolated `{cond ? <Badge /> : ...}` both work today and must keep
47
+ * working. Only a component element the returned markup *starts* with is the
48
+ * defect, including one reached through a `.map(...)` answering a row per
49
+ * item, which fails the same way for the same reason.
50
+ */
51
+ export declare function rejectUnownedComponentElement(host: ComponentAnalysisHost, statement: FunctionDeclaration): void;
52
+ /**
53
+ * The audit's seventh root cause: a `def` that declares reactive state and
54
+ * answers `WebNode` is a component wearing a function's clothes, and calling
55
+ * it bypasses exactly what the charter already refuses `View(...)` for. Two
56
+ * things follow from the call, both reproduced: every call runs the `state`
57
+ * declaration again, so the value resets on every re-render; and the
58
+ * observers the returned markup registers bind to whatever scope the call
59
+ * site was building — at module scope the global one, which is never
60
+ * destroyed, so they are never cleaned up.
61
+ *
62
+ * Only DECLARATION is refused. A `def -> WebNode` that merely reads state or a
63
+ * prop is a legitimate markup helper — examples/app has two — and a `def`
64
+ * nested inside a component binds its observers to that component's scope, so
65
+ * nothing about reading is defective.
66
+ *
67
+ * What answers "this `def` returns markup" is the sink, not one spelling of
68
+ * it: `-> WebNode?` and `-> List<WebNode>` are the shapes markup travels in,
69
+ * and a `def` may carry no return type at all — all three reached the same
70
+ * defect with the same body while only the bare annotation was read.
71
+ */
72
+ export declare function rejectStatefulWebNodeFunction(host: ComponentAnalysisHost, statement: FunctionDeclaration): void;
73
+ export {};
74
+ //# sourceMappingURL=ownership.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownership.d.ts","sourceRoot":"","sources":["../../../src/analysis/components/ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD,KAAK,mBAAmB,GAAG,OAAO,CAAC,SAAS,EAAE;IAAE,QAAQ,CAAC,IAAI,EAAE,qBAAqB,CAAA;CAAE,CAAC,CAAC;AAExF;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,MAAM,GAAG,IAAI,CAMlF;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAkB/G;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,qBAAqB,EAAE,SAAS,EAAE,mBAAmB,GAAG,IAAI,CAa/G"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * What a component owns and what a plain `def` may not: the `using` a
3
+ * construction section has no scope to release at, the component element a
4
+ * helper answers with but cannot build, and the reactive declaration that makes
5
+ * a markup helper a component in a function's clothes.
6
+ *
7
+ * D115 P4 R3c. The three are one module because each of them is the same
8
+ * question asked from a different side — who owns the value this position
9
+ * produces — and each answers it from the component depths.
10
+ */
11
+ import {} from "@velarscript/compiler/extension";
12
+ import { bodyReturnsJsx, carriesWebNode, componentSpelling, firstReactiveDeclaration, returnedMarkupRoots } from "../jsx-detection.js";
13
+ import { diagnostic } from "../web-types.js";
14
+ import {} from "./host.js";
15
+ /**
16
+ * D43 item 69: a component body is a construction section, not a scope with
17
+ * an exit — its resources live until unmount. Ownership belongs to the
18
+ * lifecycle hook or to a function inside the component, so the setup section
19
+ * says so instead of releasing at the wrong moment.
20
+ *
21
+ * Null means this position has nothing of its own to say, and the base
22
+ * analyzer's own answer stands.
23
+ */
24
+ export function ownershipScopeRejection(host) {
25
+ if (host.componentStates !== null && host.mountedDepth === 0 && host.cleanupDepth === 0 && host.watchBodyDepth === 0
26
+ && host.inComponentSetupPosition()) {
27
+ return "A component body builds the component and does not end, so a 'using' here has no scope to release at; own the resource inside an action, a method, or the cleanup hook";
28
+ }
29
+ return null;
30
+ }
31
+ /**
32
+ * P2b-5: a `def` that answers markup and answers it with a component element.
33
+ *
34
+ * Everything about the shape is legal one step out. A component element is a
35
+ * legal module-level expression — `const root = <App />` is the instantiation
36
+ * site D90 R4-b rules on, and `mount` takes exactly the instance it evaluates
37
+ * to. A `def` answering markup is a legal markup helper — dispatch over a
38
+ * closed vocabulary is what the P2b wave was writing. The defect is only
39
+ * where the two meet, and it is a representation split the type does not
40
+ * carry: a component element in a *child* position lowers to `__velarChild`,
41
+ * which owns a scope and answers a DOM node, while the same element standing
42
+ * alone lowers to `__velarInstantiate`, which answers an instance. Both are
43
+ * typed `WebNode`; only one is one. Returned from a helper and handed to a
44
+ * render, the instance reaches `__velarAppend` and takes the whole subtree
45
+ * down with "JSX can render only text, finite numbers, bool, enums, WebNode
46
+ * values, and Lists of those values" — the check-green, runtime-dead shape.
47
+ *
48
+ * The walk stops at every JSX element, which is exactly where the emitter
49
+ * stops: inside one, every position is a child position and every component
50
+ * element there is already correct — `return <div><Badge /></div>` and an
51
+ * interpolated `{cond ? <Badge /> : ...}` both work today and must keep
52
+ * working. Only a component element the returned markup *starts* with is the
53
+ * defect, including one reached through a `.map(...)` answering a row per
54
+ * item, which fails the same way for the same reason.
55
+ */
56
+ export function rejectUnownedComponentElement(host, statement) {
57
+ // A helper nested in a component body is emitted with that component's
58
+ // scope in hand, so its component elements are `__velarChild` and answer
59
+ // nodes. Only a helper standing outside every component body has nowhere
60
+ // for the emitter to put them.
61
+ if (host.componentBodyDepth > 0)
62
+ return;
63
+ const answersMarkup = statement.returnType
64
+ ? carriesWebNode(host.resolveAnnotation(statement.returnType))
65
+ : bodyReturnsJsx(statement.body);
66
+ if (!answersMarkup)
67
+ return;
68
+ for (const element of returnedMarkupRoots(statement.body)) {
69
+ if (!/^[A-Z]/u.test(element.tag))
70
+ continue;
71
+ host.diagnostics.push(diagnostic("VEL5075", `'${statement.name}' answers markup with the component element '<${element.tag} />', and a component element standing on its own is an instance rather than a node: it is built by the position that shows it, and a 'def' is not one, so what this returns fails the moment JSX tries to render it. Write '<${element.tag} />' where it is rendered — a component's own body, or a child position inside markup this returns such as '<div><${element.tag} ... /></div>' — and keep the helper for the native elements it builds.`, element.span));
72
+ }
73
+ }
74
+ /**
75
+ * The audit's seventh root cause: a `def` that declares reactive state and
76
+ * answers `WebNode` is a component wearing a function's clothes, and calling
77
+ * it bypasses exactly what the charter already refuses `View(...)` for. Two
78
+ * things follow from the call, both reproduced: every call runs the `state`
79
+ * declaration again, so the value resets on every re-render; and the
80
+ * observers the returned markup registers bind to whatever scope the call
81
+ * site was building — at module scope the global one, which is never
82
+ * destroyed, so they are never cleaned up.
83
+ *
84
+ * Only DECLARATION is refused. A `def -> WebNode` that merely reads state or a
85
+ * prop is a legitimate markup helper — examples/app has two — and a `def`
86
+ * nested inside a component binds its observers to that component's scope, so
87
+ * nothing about reading is defective.
88
+ *
89
+ * What answers "this `def` returns markup" is the sink, not one spelling of
90
+ * it: `-> WebNode?` and `-> List<WebNode>` are the shapes markup travels in,
91
+ * and a `def` may carry no return type at all — all three reached the same
92
+ * defect with the same body while only the bare annotation was read.
93
+ */
94
+ export function rejectStatefulWebNodeFunction(host, statement) {
95
+ const answersMarkup = statement.returnType
96
+ ? carriesWebNode(host.resolveAnnotation(statement.returnType))
97
+ : bodyReturnsJsx(statement.body);
98
+ if (!answersMarkup)
99
+ return;
100
+ const declaration = firstReactiveDeclaration(statement.body);
101
+ if (!declaration)
102
+ return;
103
+ const component = componentSpelling(statement.name);
104
+ host.diagnostics.push(diagnostic("VEL5074", `'${statement.name}' declares ${declaration.label} and returns WebNode, so calling it bypasses JSX ownership, prop cells, and lifecycle: every call declares the value again, so it resets on each render, and the observers its markup registers belong to whatever scope the call site was building rather than to this value. Write it as a component — 'component ${component}(...)' rendered as '<${component} />'; a 'def' that returns WebNode is a markup helper and may only read.`, declaration.span));
105
+ }
106
+ //# sourceMappingURL=ownership.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ownership.js","sourceRoot":"","sources":["../../../src/analysis/components/ownership.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAkB,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AACvI,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAA8B,MAAM,WAAW,CAAC;AAIvD;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAA2B;IACjE,IAAI,IAAI,CAAC,eAAe,KAAK,IAAI,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,IAAI,CAAC,YAAY,KAAK,CAAC,IAAI,IAAI,CAAC,cAAc,KAAK,CAAC;WAC/G,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC;QACrC,OAAO,wKAAwK,CAAC;IAClL,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,6BAA6B,CAAC,IAA2B,EAAE,SAA8B;IACvG,uEAAuE;IACvE,yEAAyE;IACzE,yEAAyE;IACzE,+BAA+B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