resuxjs 0.4.0-beta.6 → 0.4.0-beta.7

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 (399) hide show
  1. package/README.md +55 -13
  2. package/dist/bin.d.ts +1 -1
  3. package/dist/bin.js +2 -4
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +8 -11
  6. package/dist/build/index.js +3 -4
  7. package/dist/build/index.js.map +1 -1
  8. package/dist/cli.d.ts +7 -8
  9. package/dist/cli.js +170 -135
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +5 -8
  12. package/dist/compiler/adapter.js +2 -4
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +5 -8
  15. package/dist/compiler/dev-warnings.js +7 -9
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +3 -6
  18. package/dist/compiler/directives.js +2 -4
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +22 -24
  21. package/dist/compiler/implementation.js +140 -129
  22. package/dist/compiler/index.d.ts +5 -8
  23. package/dist/compiler/index.js +2 -4
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +5 -9
  26. package/dist/core/config.js +2 -3
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +6 -9
  29. package/dist/core/hooks.js +2 -3
  30. package/dist/core/hooks.js.map +1 -1
  31. package/dist/core/index.d.ts +1 -1
  32. package/dist/core/index.js +1 -2
  33. package/dist/core/module-container.d.ts +20 -24
  34. package/dist/core/module-container.js +4 -5
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +4 -8
  37. package/dist/core/resux.js +2 -4
  38. package/dist/core/resux.js.map +1 -1
  39. package/dist/create-bin.d.ts +1 -1
  40. package/dist/create-bin.js +2 -4
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +2 -5
  43. package/dist/create.js +15 -10
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +1 -5
  46. package/dist/deploy/cloudflare.js +2 -4
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +12 -15
  49. package/dist/deploy/common.js +2 -4
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +1 -4
  52. package/dist/deploy/framework-runtime.js +2 -4
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +2 -6
  55. package/dist/deploy/index.js +7 -6
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +1 -5
  58. package/dist/deploy/netlify.js +3 -5
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +1 -5
  61. package/dist/deploy/node.js +4 -5
  62. package/dist/deploy/node.js.map +1 -1
  63. package/dist/deploy/production-report.d.ts +1 -4
  64. package/dist/deploy/production-report.js +2 -4
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +4 -7
  67. package/dist/deploy/runtime-dependencies.js +4 -5
  68. package/dist/deploy/runtime-dependencies.js.map +1 -1
  69. package/dist/deploy/static.d.ts +1 -5
  70. package/dist/deploy/static.js +2 -4
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +7 -10
  73. package/dist/deploy/types.js +1 -1
  74. package/dist/deploy/vercel.d.ts +2 -6
  75. package/dist/deploy/vercel.js +3 -5
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +60 -11
  78. package/dist/fonts/index.js +422 -46
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +1 -3
  81. package/dist/globals.js +1 -1
  82. package/dist/halal-core/ai/classifyProject.d.ts +3 -7
  83. package/dist/halal-core/ai/classifyProject.js +2 -4
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +1 -5
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +3 -5
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +1 -4
  89. package/dist/halal-core/ai/createProjectSummary.js +2 -4
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +1 -4
  92. package/dist/halal-core/ai/halalClassifierPrompt.js +2 -3
  93. package/dist/halal-core/ai/redactSensitiveData.d.ts +1 -4
  94. package/dist/halal-core/ai/redactSensitiveData.js +2 -3
  95. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  96. package/dist/halal-core/ai/validateAiResponse.d.ts +1 -5
  97. package/dist/halal-core/ai/validateAiResponse.js +4 -5
  98. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  99. package/dist/halal-core/cli/check.d.ts +1 -4
  100. package/dist/halal-core/cli/check.js +5 -6
  101. package/dist/halal-core/cli/check.js.map +1 -1
  102. package/dist/halal-core/cli/explain.d.ts +1 -4
  103. package/dist/halal-core/cli/explain.js +5 -6
  104. package/dist/halal-core/cli/explain.js.map +1 -1
  105. package/dist/halal-core/cli/report.d.ts +1 -4
  106. package/dist/halal-core/cli/report.js +5 -6
  107. package/dist/halal-core/cli/report.js.map +1 -1
  108. package/dist/halal-core/cli/submitReview.d.ts +1 -4
  109. package/dist/halal-core/cli/submitReview.js +5 -6
  110. package/dist/halal-core/cli/submitReview.js.map +1 -1
  111. package/dist/halal-core/cli/verifyReview.d.ts +1 -4
  112. package/dist/halal-core/cli/verifyReview.js +7 -7
  113. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  114. package/dist/halal-core/config.d.ts +9 -11
  115. package/dist/halal-core/config.js +46 -11
  116. package/dist/halal-core/config.js.map +1 -1
  117. package/dist/halal-core/crypto/integrity.d.ts +5 -8
  118. package/dist/halal-core/crypto/integrity.js +2 -4
  119. package/dist/halal-core/crypto/integrity.js.map +1 -1
  120. package/dist/halal-core/enforce.d.ts +5 -8
  121. package/dist/halal-core/enforce.js +17 -16
  122. package/dist/halal-core/enforce.js.map +1 -1
  123. package/dist/halal-core/index.d.ts +6 -6
  124. package/dist/halal-core/index.js +8 -9
  125. package/dist/halal-core/lifecycle.d.ts +1 -4
  126. package/dist/halal-core/lifecycle.js +2 -4
  127. package/dist/halal-core/lifecycle.js.map +1 -1
  128. package/dist/halal-core/policy.d.ts +1 -5
  129. package/dist/halal-core/policy.js +2 -4
  130. package/dist/halal-core/policy.js.map +1 -1
  131. package/dist/halal-core/report/formatBrowserOverlay.d.ts +1 -5
  132. package/dist/halal-core/report/formatBrowserOverlay.js +2 -3
  133. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  134. package/dist/halal-core/report/formatTerminalReport.d.ts +1 -5
  135. package/dist/halal-core/report/formatTerminalReport.js +2 -3
  136. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  137. package/dist/halal-core/report/generateHalalReport.d.ts +2 -6
  138. package/dist/halal-core/report/generateHalalReport.js +8 -7
  139. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  140. package/dist/halal-core/report/signReport.d.ts +2 -6
  141. package/dist/halal-core/report/signReport.js +2 -4
  142. package/dist/halal-core/report/signReport.js.map +1 -1
  143. package/dist/halal-core/report/verifyReport.d.ts +3 -7
  144. package/dist/halal-core/report/verifyReport.js +4 -6
  145. package/dist/halal-core/report/verifyReport.js.map +1 -1
  146. package/dist/halal-core/review/createReviewRequest.d.ts +1 -5
  147. package/dist/halal-core/review/createReviewRequest.js +4 -5
  148. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  149. package/dist/halal-core/review/reviewPolicy.d.ts +3 -6
  150. package/dist/halal-core/review/reviewPolicy.js +2 -3
  151. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  152. package/dist/halal-core/review/signedReviewFile.d.ts +4 -8
  153. package/dist/halal-core/review/signedReviewFile.js +2 -4
  154. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  155. package/dist/halal-core/review/verifyReviewApproval.d.ts +2 -5
  156. package/dist/halal-core/review/verifyReviewApproval.js +2 -4
  157. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  158. package/dist/halal-core/rules/adultContentRules.d.ts +2 -5
  159. package/dist/halal-core/rules/adultContentRules.js +2 -3
  160. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  161. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +2 -5
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.js +2 -3
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  164. package/dist/halal-core/rules/childSafetyRules.d.ts +2 -5
  165. package/dist/halal-core/rules/childSafetyRules.js +2 -3
  166. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  167. package/dist/halal-core/rules/coreCategories.d.ts +2 -5
  168. package/dist/halal-core/rules/coreCategories.js +2 -3
  169. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  170. package/dist/halal-core/rules/cyberAbuseRules.d.ts +2 -5
  171. package/dist/halal-core/rules/cyberAbuseRules.js +2 -3
  172. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  173. package/dist/halal-core/rules/defaultBlockedRules.d.ts +1 -5
  174. package/dist/halal-core/rules/defaultBlockedRules.js +12 -11
  175. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  176. package/dist/halal-core/rules/dependencyRules.d.ts +2 -5
  177. package/dist/halal-core/rules/dependencyRules.js +2 -3
  178. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  179. package/dist/halal-core/rules/endpointRules.d.ts +2 -5
  180. package/dist/halal-core/rules/endpointRules.js +2 -3
  181. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  182. package/dist/halal-core/rules/environmentalHarmRules.d.ts +2 -5
  183. package/dist/halal-core/rules/environmentalHarmRules.js +2 -3
  184. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  185. package/dist/halal-core/rules/financeRibaRules.d.ts +2 -5
  186. package/dist/halal-core/rules/financeRibaRules.js +2 -3
  187. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  188. package/dist/halal-core/rules/gamblingRules.d.ts +2 -5
  189. package/dist/halal-core/rules/gamblingRules.js +2 -3
  190. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  191. package/dist/halal-core/rules/generalHarmRules.d.ts +2 -5
  192. package/dist/halal-core/rules/generalHarmRules.js +2 -3
  193. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  194. package/dist/halal-core/rules/healthHarmRules.d.ts +2 -5
  195. package/dist/halal-core/rules/healthHarmRules.js +2 -3
  196. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  197. package/dist/halal-core/rules/keywordRules.d.ts +1 -4
  198. package/dist/halal-core/rules/keywordRules.js +2 -3
  199. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  200. package/dist/halal-core/rules/privacyAbuseRules.d.ts +2 -5
  201. package/dist/halal-core/rules/privacyAbuseRules.js +2 -3
  202. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  203. package/dist/halal-core/rules/scamFraudRules.d.ts +2 -5
  204. package/dist/halal-core/rules/scamFraudRules.js +2 -3
  205. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  206. package/dist/halal-core/rules/selfHarmRules.d.ts +2 -5
  207. package/dist/halal-core/rules/selfHarmRules.js +2 -3
  208. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  209. package/dist/halal-core/rules/violenceExtremismRules.d.ts +2 -5
  210. package/dist/halal-core/rules/violenceExtremismRules.js +2 -3
  211. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  212. package/dist/halal-core/runtime/guard.d.ts +3 -7
  213. package/dist/halal-core/runtime/guard.js +5 -7
  214. package/dist/halal-core/runtime/guard.js.map +1 -1
  215. package/dist/halal-core/runtime/index.js +1 -2
  216. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -8
  217. package/dist/halal-core/runtime/reviewedMemory.js +3 -5
  218. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  219. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +5 -9
  220. package/dist/halal-core/runtime/serializeRuntimeContent.js +4 -6
  221. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  222. package/dist/halal-core/runtime/types.d.ts +9 -13
  223. package/dist/halal-core/runtime/types.js +1 -1
  224. package/dist/halal-core/scanner/scanApiRoutes.d.ts +1 -4
  225. package/dist/halal-core/scanner/scanApiRoutes.js +2 -4
  226. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  227. package/dist/halal-core/scanner/scanComponents.d.ts +1 -4
  228. package/dist/halal-core/scanner/scanComponents.js +2 -4
  229. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  230. package/dist/halal-core/scanner/scanContent.d.ts +2 -5
  231. package/dist/halal-core/scanner/scanContent.js +4 -6
  232. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  233. package/dist/halal-core/scanner/scanDependencies.d.ts +1 -4
  234. package/dist/halal-core/scanner/scanDependencies.js +2 -4
  235. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  236. package/dist/halal-core/scanner/scanDomains.d.ts +1 -4
  237. package/dist/halal-core/scanner/scanDomains.js +2 -3
  238. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  239. package/dist/halal-core/scanner/scanEnvNames.d.ts +1 -4
  240. package/dist/halal-core/scanner/scanEnvNames.js +2 -4
  241. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  242. package/dist/halal-core/scanner/scanMetadata.d.ts +2 -5
  243. package/dist/halal-core/scanner/scanMetadata.js +2 -4
  244. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  245. package/dist/halal-core/scanner/scanPages.d.ts +1 -4
  246. package/dist/halal-core/scanner/scanPages.js +2 -4
  247. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  248. package/dist/halal-core/scanner/scanProject.d.ts +2 -6
  249. package/dist/halal-core/scanner/scanProject.js +2 -4
  250. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  251. package/dist/halal-core/scanner/scanRoutes.d.ts +1 -4
  252. package/dist/halal-core/scanner/scanRoutes.js +2 -4
  253. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  254. package/dist/halal-core/scanner/scanTranslations.d.ts +1 -4
  255. package/dist/halal-core/scanner/scanTranslations.js +2 -4
  256. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  257. package/dist/halal-core/status.d.ts +2 -5
  258. package/dist/halal-core/status.js +1 -1
  259. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +1 -4
  260. package/dist/halal-core/tamper/verifyCoreIntegrity.js +2 -4
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  262. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +1 -4
  263. package/dist/halal-core/tamper/verifyLifecycleHooks.js +2 -3
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  265. package/dist/halal-core/tamper/verifyReportSignature.d.ts +1 -5
  266. package/dist/halal-core/tamper/verifyReportSignature.js +4 -5
  267. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  268. package/dist/halal.d.ts +2 -2
  269. package/dist/halal.js +2 -3
  270. package/dist/i18n/index.d.ts +11 -14
  271. package/dist/i18n/index.js +9 -9
  272. package/dist/i18n/index.js.map +1 -1
  273. package/dist/i18n/shared.d.ts +14 -17
  274. package/dist/i18n/shared.js +5 -6
  275. package/dist/i18n/shared.js.map +1 -1
  276. package/dist/icons/api-fetcher.d.ts +4 -0
  277. package/dist/icons/api-fetcher.js +77 -0
  278. package/dist/icons/api-fetcher.js.map +1 -0
  279. package/dist/icons/cache.d.ts +22 -0
  280. package/dist/icons/cache.js +74 -0
  281. package/dist/icons/cache.js.map +1 -0
  282. package/dist/icons/component.d.ts +157 -0
  283. package/dist/icons/component.js +139 -0
  284. package/dist/icons/component.js.map +1 -0
  285. package/dist/icons/constants.d.ts +14 -0
  286. package/dist/icons/constants.js +16 -0
  287. package/dist/icons/constants.js.map +1 -0
  288. package/dist/icons/css-mode.d.ts +7 -0
  289. package/dist/icons/css-mode.js +51 -0
  290. package/dist/icons/css-mode.js.map +1 -0
  291. package/dist/icons/index.d.ts +14 -152
  292. package/dist/icons/index.js +30 -286
  293. package/dist/icons/index.js.map +1 -1
  294. package/dist/icons/local-svg.d.ts +5 -0
  295. package/dist/icons/local-svg.js +53 -0
  296. package/dist/icons/local-svg.js.map +1 -0
  297. package/dist/icons/normalize.d.ts +5 -0
  298. package/dist/icons/normalize.js +63 -0
  299. package/dist/icons/normalize.js.map +1 -0
  300. package/dist/icons/offline-loader.d.ts +21 -0
  301. package/dist/icons/offline-loader.js +94 -0
  302. package/dist/icons/offline-loader.js.map +1 -0
  303. package/dist/icons/parser.d.ts +5 -0
  304. package/dist/icons/parser.js +89 -0
  305. package/dist/icons/parser.js.map +1 -0
  306. package/dist/icons/registry.d.ts +6 -21
  307. package/dist/icons/registry.js +82 -75
  308. package/dist/icons/registry.js.map +1 -1
  309. package/dist/icons/resolver.d.ts +4 -0
  310. package/dist/icons/resolver.js +45 -0
  311. package/dist/icons/resolver.js.map +1 -0
  312. package/dist/icons/svg-mode.d.ts +4 -0
  313. package/dist/icons/svg-mode.js +54 -0
  314. package/dist/icons/svg-mode.js.map +1 -0
  315. package/dist/icons/transform.d.ts +11 -0
  316. package/dist/icons/transform.js +68 -0
  317. package/dist/icons/transform.js.map +1 -0
  318. package/dist/icons/types.d.ts +49 -0
  319. package/dist/icons/types.js +1 -0
  320. package/dist/index.d.ts +4 -2
  321. package/dist/index.js +2 -2
  322. package/dist/kit/index.d.ts +21 -25
  323. package/dist/kit/index.js +2 -4
  324. package/dist/kit/index.js.map +1 -1
  325. package/dist/nitro-server/index.d.ts +2 -5
  326. package/dist/nitro-server/index.js +2 -3
  327. package/dist/nitro-server/index.js.map +1 -1
  328. package/dist/node.d.ts +2 -6
  329. package/dist/node.js +7 -9
  330. package/dist/node.js.map +1 -1
  331. package/dist/reactivity/computed.d.ts +3 -7
  332. package/dist/reactivity/computed.js +4 -5
  333. package/dist/reactivity/computed.js.map +1 -1
  334. package/dist/reactivity/effect.d.ts +13 -17
  335. package/dist/reactivity/effect.js +11 -11
  336. package/dist/reactivity/effect.js.map +1 -1
  337. package/dist/reactivity/index.d.ts +1 -1
  338. package/dist/reactivity/index.js +3 -4
  339. package/dist/reactivity/reactive.d.ts +5 -8
  340. package/dist/reactivity/reactive.js +5 -7
  341. package/dist/reactivity/reactive.js.map +1 -1
  342. package/dist/reactivity/readonly.js +1 -3
  343. package/dist/reactivity/ref.d.ts +9 -12
  344. package/dist/reactivity/ref.js +6 -5
  345. package/dist/reactivity/ref.js.map +1 -1
  346. package/dist/reactivity/scheduler.d.ts +5 -7
  347. package/dist/reactivity/scheduler.js +2 -3
  348. package/dist/reactivity/scheduler.js.map +1 -1
  349. package/dist/reactivity/types.d.ts +11 -14
  350. package/dist/reactivity/types.js +1 -1
  351. package/dist/reactivity/utils.d.ts +9 -12
  352. package/dist/reactivity/utils.js +2 -3
  353. package/dist/reactivity/utils.js.map +1 -1
  354. package/dist/reactivity/watch.d.ts +3 -6
  355. package/dist/reactivity/watch.js +7 -7
  356. package/dist/reactivity/watch.js.map +1 -1
  357. package/dist/runtime/core.d.ts +4 -20
  358. package/dist/runtime/core.js +11 -24
  359. package/dist/runtime/core.js.map +1 -1
  360. package/dist/runtime/index.d.ts +162 -158
  361. package/dist/runtime/index.js +2749 -1025
  362. package/dist/runtime/index.js.map +1 -1
  363. package/dist/runtime/reactivity.d.ts +4 -4
  364. package/dist/runtime/reactivity.js +2 -3
  365. package/dist/runtime/resume.d.ts +14 -51
  366. package/dist/runtime/resume.js +4 -34
  367. package/dist/runtime/resume.js.map +1 -1
  368. package/dist/runtime/router.d.ts +5 -17
  369. package/dist/runtime/router.js +7 -17
  370. package/dist/runtime/router.js.map +1 -1
  371. package/dist/runtime/streaming.d.ts +6 -13
  372. package/dist/runtime/streaming.js +4 -9
  373. package/dist/runtime/streaming.js.map +1 -1
  374. package/dist/runtime/view-transitions/detect.d.ts +11 -0
  375. package/dist/runtime/view-transitions/detect.js +16 -0
  376. package/dist/runtime/view-transitions/detect.js.map +1 -0
  377. package/dist/runtime/view-transitions/index.d.ts +4 -0
  378. package/dist/runtime/view-transitions/index.js +3 -0
  379. package/dist/runtime/view-transitions/transition.d.ts +4 -0
  380. package/dist/runtime/view-transitions/transition.js +41 -0
  381. package/dist/runtime/view-transitions/transition.js.map +1 -0
  382. package/dist/runtime/view-transitions/types.d.ts +8 -0
  383. package/dist/runtime/view-transitions/types.js +1 -0
  384. package/dist/security/media-fetch.d.ts +10 -13
  385. package/dist/security/media-fetch.js +5 -7
  386. package/dist/security/media-fetch.js.map +1 -1
  387. package/dist/security/path-boundary.d.ts +4 -7
  388. package/dist/security/path-boundary.js +2 -4
  389. package/dist/security/path-boundary.js.map +1 -1
  390. package/dist/ui/index.d.ts +367 -217
  391. package/dist/ui/index.js +199 -152
  392. package/dist/ui/index.js.map +1 -1
  393. package/dist/ui/verification-code.d.ts +134 -0
  394. package/dist/ui/verification-code.js +472 -0
  395. package/dist/ui/verification-code.js.map +1 -0
  396. package/dist/vite-builder/index.d.ts +2 -5
  397. package/dist/vite-builder/index.js +2 -3
  398. package/dist/vite-builder/index.js.map +1 -1
  399. package/package.json +5 -2
@@ -1,21 +1,18 @@
1
1
  import { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, createRouteManifest, fileUrl, resolveFileExtension } from "./index.js";
2
2
  import { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource } from "./directives.js";
3
-
4
- //#region src/compiler/adapter.d.ts
5
- interface ResuxCompileVueSourceOptions {
3
+ export interface ResuxCompileVueSourceOptions {
6
4
  file: string;
7
5
  id: string;
8
6
  name: string;
9
7
  /** Enables development-only compiler diagnostics. */
10
8
  dev?: boolean;
11
9
  }
12
- declare function compileVueSource(source: string, options: ResuxCompileVueSourceOptions): CompiledComponent;
13
- declare function compileVueFile(file: string, options: {
10
+ export declare function compileVueSource(source: string, options: ResuxCompileVueSourceOptions): CompiledComponent;
11
+ export declare function compileVueFile(file: string, options: {
14
12
  id: string;
15
13
  name?: string;
16
14
  dev?: boolean;
17
15
  }): Promise<CompiledComponent>;
18
- declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
19
- //#endregion
20
- export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, ResuxCompileVueSourceOptions, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
16
+ export declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
17
+ export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
21
18
  //# sourceMappingURL=adapter.d.ts.map
@@ -5,8 +5,7 @@ import { syncBuiltinESMExports } from "node:module";
5
5
  import { promises } from "node:fs";
6
6
  import { readFile } from "node:fs/promises";
7
7
  import path from "node:path";
8
-
9
- //#region src/compiler/adapter.ts
8
+ // src/compiler/adapter.ts
10
9
  function compileVueSource(source, options) {
11
10
  const usesResuxDirectives = source.includes("rx-");
12
11
  if (options.dev === true) emitResuxDevWarnings(source, options.file);
@@ -76,7 +75,6 @@ async function withResuxDirectiveFileReads(task, emittedDevWarnings) {
76
75
  function pascalCase(value) {
77
76
  return value.replace(/\[[^\]]+\]/g, (match) => match.slice(1, -1)).split(/[^A-Za-z0-9]+/).filter(Boolean).map((part) => part.charAt(0).toUpperCase() + part.slice(1)).join("");
78
77
  }
79
-
80
- //#endregion
81
78
  export { ResuxCompileError, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, resolveFileExtension };
79
+
82
80
  //# sourceMappingURL=adapter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.js","names":["implementation.compileVueSource","implementation.buildProject","fsPromises"],"sources":["../../src/compiler/adapter.ts"],"sourcesContent":["import { promises as fsPromises } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { syncBuiltinESMExports } from \"node:module\";\nimport path from \"node:path\";\nimport * as implementation from \"./implementation.js\";\nimport {\n normalizeResuxSfcSource,\n rethrowWithResuxDirectiveBrand,\n} from \"./directives.js\";\nimport { emitResuxDevWarnings } from \"./dev-warnings.js\";\nimport type { BuildOptions, BuildResult, CompiledComponent } from \"./implementation.js\";\n\nexport * from \"./implementation.js\";\nexport { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource } from \"./directives.js\";\n\nexport interface ResuxCompileVueSourceOptions {\n file: string;\n id: string;\n name: string;\n /** Enables development-only compiler diagnostics. */\n dev?: boolean;\n}\n\nexport function compileVueSource(\n source: string,\n options: ResuxCompileVueSourceOptions,\n): CompiledComponent {\n const usesResuxDirectives = source.includes(\"rx-\");\n\n if (options.dev === true) {\n emitResuxDevWarnings(source, options.file);\n }\n\n try {\n return implementation.compileVueSource(\n normalizeResuxSfcSource(source, options.file),\n {\n file: options.file,\n id: options.id,\n name: options.name,\n },\n );\n } catch (error) {\n if (usesResuxDirectives) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n throw error;\n }\n}\n\nexport async function compileVueFile(\n file: string,\n options: { id: string; name?: string; dev?: boolean },\n): Promise<CompiledComponent> {\n const source = await readFile(file, \"utf8\");\n return compileVueSource(source, {\n file,\n id: options.id,\n name: options.name ?? pascalCase(path.basename(file, \".vue\")),\n dev: options.dev,\n });\n}\n\nlet buildQueue: Promise<void> = Promise.resolve();\nconst emittedBuildDevWarnings = new Set<string>();\n\nexport function buildProject(\n appRoot: string,\n outDir?: string,\n options?: BuildOptions,\n): Promise<BuildResult> {\n return enqueueBuild(async () => {\n const emittedDevWarnings = options?.vite === \"dev\"\n ? emittedBuildDevWarnings\n : undefined;\n\n try {\n return await withResuxDirectiveFileReads(\n () => implementation.buildProject(appRoot, outDir, options),\n emittedDevWarnings,\n );\n } catch (error) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n });\n}\n\nfunction enqueueBuild<T>(task: () => Promise<T>): Promise<T> {\n const run = buildQueue.then(task, task);\n buildQueue = run.then(() => undefined, () => undefined);\n return run;\n}\n\nasync function withResuxDirectiveFileReads<T>(\n task: () => Promise<T>,\n emittedDevWarnings?: Set<string>,\n): Promise<T> {\n const mutableFs = fsPromises as typeof fsPromises & { readFile: typeof fsPromises.readFile };\n const originalReadFile = mutableFs.readFile;\n\n mutableFs.readFile = (async (...args: Parameters<typeof originalReadFile>) => {\n const result = await originalReadFile(...args);\n const file = args[0];\n const filename = typeof file === \"string\"\n ? file\n : file instanceof URL\n ? file.pathname\n : Buffer.isBuffer(file)\n ? file.toString()\n : String(file);\n\n if (!filename.toLowerCase().endsWith(\".vue\")) {\n return result;\n }\n\n if (typeof result === \"string\") {\n if (emittedDevWarnings) {\n emitResuxDevWarnings(result, filename, emittedDevWarnings);\n }\n return normalizeResuxSfcSource(result, filename);\n }\n\n if (Buffer.isBuffer(result)) {\n const source = result.toString(\"utf8\");\n if (emittedDevWarnings) {\n emitResuxDevWarnings(source, filename, emittedDevWarnings);\n }\n return Buffer.from(normalizeResuxSfcSource(source, filename), \"utf8\");\n }\n\n return result;\n }) as typeof originalReadFile;\n\n syncBuiltinESMExports();\n\n try {\n return await task();\n } finally {\n mutableFs.readFile = originalReadFile;\n syncBuiltinESMExports();\n }\n}\n\nfunction pascalCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n}\n"],"mappings":";;;;;;;;;AAuBA,SAAgB,iBACd,QACA,SACmB;CACnB,MAAM,sBAAsB,OAAO,SAAS,MAAM;AAElD,KAAI,QAAQ,QAAQ,KAClB,sBAAqB,QAAQ,QAAQ,KAAK;AAG5C,KAAI;AACF,SAAOA,mBACL,wBAAwB,QAAQ,QAAQ,KAAK,EAC7C;GACE,MAAM,QAAQ;GACd,IAAI,QAAQ;GACZ,MAAM,QAAQ;GACf,CACF;UACM,OAAO;AACd,MAAI,oBACF,QAAO,+BAA+B,MAAM;AAE9C,QAAM;;;AAIV,eAAsB,eACpB,MACA,SAC4B;AAE5B,QAAO,iBADQ,MAAM,SAAS,MAAM,OAAO,EACX;EAC9B;EACA,IAAI,QAAQ;EACZ,MAAM,QAAQ,QAAQ,WAAW,KAAK,SAAS,MAAM,OAAO,CAAC;EAC7D,KAAK,QAAQ;EACd,CAAC;;AAGJ,IAAI,aAA4B,QAAQ,SAAS;AACjD,MAAM,0CAA0B,IAAI,KAAa;AAEjD,SAAgB,aACd,SACA,QACA,SACsB;AACtB,QAAO,aAAa,YAAY;EAC9B,MAAM,qBAAqB,SAAS,SAAS,QACzC,0BACA;AAEJ,MAAI;AACF,UAAO,MAAM,kCACLC,eAA4B,SAAS,QAAQ,QAAQ,EAC3D,mBACD;WACM,OAAO;AACd,UAAO,+BAA+B,MAAM;;GAE9C;;AAGJ,SAAS,aAAgB,MAAoC;CAC3D,MAAM,MAAM,WAAW,KAAK,MAAM,KAAK;AACvC,cAAa,IAAI,WAAW,cAAiB,OAAU;AACvD,QAAO;;AAGT,eAAe,4BACb,MACA,oBACY;CACZ,MAAM,YAAYC;CAClB,MAAM,mBAAmB,UAAU;AAEnC,WAAU,YAAY,OAAO,GAAG,SAA8C;EAC5E,MAAM,SAAS,MAAM,iBAAiB,GAAG,KAAK;EAC9C,MAAM,OAAO,KAAK;EAClB,MAAM,WAAW,OAAO,SAAS,WAC7B,OACA,gBAAgB,MACd,KAAK,WACL,OAAO,SAAS,KAAK,GACnB,KAAK,UAAU,GACf,OAAO,KAAK;AAEpB,MAAI,CAAC,SAAS,aAAa,CAAC,SAAS,OAAO,CAC1C,QAAO;AAGT,MAAI,OAAO,WAAW,UAAU;AAC9B,OAAI,mBACF,sBAAqB,QAAQ,UAAU,mBAAmB;AAE5D,UAAO,wBAAwB,QAAQ,SAAS;;AAGlD,MAAI,OAAO,SAAS,OAAO,EAAE;GAC3B,MAAM,SAAS,OAAO,SAAS,OAAO;AACtC,OAAI,mBACF,sBAAqB,QAAQ,UAAU,mBAAmB;AAE5D,UAAO,OAAO,KAAK,wBAAwB,QAAQ,SAAS,EAAE,OAAO;;AAGvE,SAAO;;AAGT,wBAAuB;AAEvB,KAAI;AACF,SAAO,MAAM,MAAM;WACX;AACR,YAAU,WAAW;AACrB,yBAAuB;;;AAI3B,SAAS,WAAW,OAAuB;AACzC,QAAO,MACJ,QAAQ,gBAAgB,UAAU,MAAM,MAAM,GAAG,GAAG,CAAC,CACrD,MAAM,gBAAgB,CACtB,OAAO,QAAQ,CACf,KAAK,SAAS,KAAK,OAAO,EAAE,CAAC,aAAa,GAAG,KAAK,MAAM,EAAE,CAAC,CAC3D,KAAK,GAAG"}
1
+ {"version":3,"file":"adapter.js","names":["implementation.compileVueSource","implementation.buildProject","fsPromises"],"sources":["../../src/compiler/adapter.ts"],"sourcesContent":["import { promises as fsPromises } from \"node:fs\";\nimport { readFile } from \"node:fs/promises\";\nimport { syncBuiltinESMExports } from \"node:module\";\nimport path from \"node:path\";\nimport * as implementation from \"./implementation.js\";\nimport {\n normalizeResuxSfcSource,\n rethrowWithResuxDirectiveBrand,\n} from \"./directives.js\";\nimport { emitResuxDevWarnings } from \"./dev-warnings.js\";\nimport type { BuildOptions, BuildResult, CompiledComponent } from \"./implementation.js\";\n\nexport * from \"./implementation.js\";\nexport { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource } from \"./directives.js\";\n\nexport interface ResuxCompileVueSourceOptions {\n file: string;\n id: string;\n name: string;\n /** Enables development-only compiler diagnostics. */\n dev?: boolean;\n}\n\nexport function compileVueSource(\n source: string,\n options: ResuxCompileVueSourceOptions,\n): CompiledComponent {\n const usesResuxDirectives = source.includes(\"rx-\");\n\n if (options.dev === true) {\n emitResuxDevWarnings(source, options.file);\n }\n\n try {\n return implementation.compileVueSource(\n normalizeResuxSfcSource(source, options.file),\n {\n file: options.file,\n id: options.id,\n name: options.name,\n },\n );\n } catch (error) {\n if (usesResuxDirectives) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n throw error;\n }\n}\n\nexport async function compileVueFile(\n file: string,\n options: { id: string; name?: string; dev?: boolean },\n): Promise<CompiledComponent> {\n const source = await readFile(file, \"utf8\");\n return compileVueSource(source, {\n file,\n id: options.id,\n name: options.name ?? pascalCase(path.basename(file, \".vue\")),\n dev: options.dev,\n });\n}\n\nlet buildQueue: Promise<void> = Promise.resolve();\nconst emittedBuildDevWarnings = new Set<string>();\n\nexport function buildProject(\n appRoot: string,\n outDir?: string,\n options?: BuildOptions,\n): Promise<BuildResult> {\n return enqueueBuild(async () => {\n const emittedDevWarnings = options?.vite === \"dev\"\n ? emittedBuildDevWarnings\n : undefined;\n\n try {\n return await withResuxDirectiveFileReads(\n () => implementation.buildProject(appRoot, outDir, options),\n emittedDevWarnings,\n );\n } catch (error) {\n return rethrowWithResuxDirectiveBrand(error);\n }\n });\n}\n\nfunction enqueueBuild<T>(task: () => Promise<T>): Promise<T> {\n const run = buildQueue.then(task, task);\n buildQueue = run.then(() => undefined, () => undefined);\n return run;\n}\n\nasync function withResuxDirectiveFileReads<T>(\n task: () => Promise<T>,\n emittedDevWarnings?: Set<string>,\n): Promise<T> {\n const mutableFs = fsPromises as typeof fsPromises & { readFile: typeof fsPromises.readFile };\n const originalReadFile = mutableFs.readFile;\n\n mutableFs.readFile = (async (...args: Parameters<typeof originalReadFile>) => {\n const result = await originalReadFile(...args);\n const file = args[0];\n const filename = typeof file === \"string\"\n ? file\n : file instanceof URL\n ? file.pathname\n : Buffer.isBuffer(file)\n ? file.toString()\n : String(file);\n\n if (!filename.toLowerCase().endsWith(\".vue\")) {\n return result;\n }\n\n if (typeof result === \"string\") {\n if (emittedDevWarnings) {\n emitResuxDevWarnings(result, filename, emittedDevWarnings);\n }\n return normalizeResuxSfcSource(result, filename);\n }\n\n if (Buffer.isBuffer(result)) {\n const source = result.toString(\"utf8\");\n if (emittedDevWarnings) {\n emitResuxDevWarnings(source, filename, emittedDevWarnings);\n }\n return Buffer.from(normalizeResuxSfcSource(source, filename), \"utf8\");\n }\n\n return result;\n }) as typeof originalReadFile;\n\n syncBuiltinESMExports();\n\n try {\n return await task();\n } finally {\n mutableFs.readFile = originalReadFile;\n syncBuiltinESMExports();\n }\n}\n\nfunction pascalCase(value: string): string {\n return value\n .replace(/\\[[^\\]]+\\]/g, (match) => match.slice(1, -1))\n .split(/[^A-Za-z0-9]+/)\n .filter(Boolean)\n .map((part) => part.charAt(0).toUpperCase() + part.slice(1))\n .join(\"\");\n}\n"],"mappings":";;;;;;;;AAuBA,SAAgB,iBACd,QACA,SACmB;CACnB,MAAM,sBAAsB,OAAO,SAAS,KAAK;CAEjD,IAAI,QAAQ,QAAQ,MAClB,qBAAqB,QAAQ,QAAQ,IAAI;CAG3C,IAAI;EACF,OAAOA,mBACL,wBAAwB,QAAQ,QAAQ,IAAI,GAC5C;GACE,MAAM,QAAQ;GACd,IAAI,QAAQ;GACZ,MAAM,QAAQ;EAChB,CACF;CACF,SAAS,OAAO;EACd,IAAI,qBACF,OAAO,+BAA+B,KAA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OAAO,SAAS,MAAM;GACrC,IAAI,oBACF,qBAAqB,QAAQ,UAAU,kBAAkB;GAE3D,OAAO,OAAO,KAAK,wBAAwB,QAAQ,QAAQ,GAAG,MAAM;EACtE;EAEA,OAAO;CACT;CAEA,sBAAsB;CAEtB,IAAI;EACF,OAAO,MAAM,KAAK;CACpB,UAAU;EACR,UAAU,WAAW;EACrB,sBAAsB;CACxB;AACF;AAEA,SAAS,WAAW,OAAuB;CACzC,OAAO,MACJ,QAAQ,gBAAgB,UAAU,MAAM,MAAM,GAAG,EAAE,CAAC,CAAC,CACrD,MAAM,eAAe,CAAC,CACtB,OAAO,OAAO,CAAC,CACf,KAAK,SAAS,KAAK,OAAO,CAAC,CAAC,CAAC,YAAY,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,CAC3D,KAAK,EAAE;AACZ"}
@@ -1,15 +1,12 @@
1
- //#region src/compiler/dev-warnings.d.ts
2
- type ResuxDevWarningCode = "RX_EVENT_INLINE_ATTRIBUTE" | "RX_EVENT_DIRECT_LISTENER";
3
- interface ResuxDevWarning {
1
+ export type ResuxDevWarningCode = "RX_EVENT_INLINE_ATTRIBUTE" | "RX_EVENT_DIRECT_LISTENER";
2
+ export interface ResuxDevWarning {
4
3
  code: ResuxDevWarningCode;
5
4
  file: string;
6
5
  line: number;
7
6
  column: number;
8
7
  message: string;
9
8
  }
10
- declare function collectResuxDevWarnings(source: string, file?: string): ResuxDevWarning[];
11
- declare function emitResuxDevWarnings(source: string, file: string, emitted?: Set<string>): void;
12
- declare function formatResuxDevWarning(warning: ResuxDevWarning): string;
13
- //#endregion
14
- export { ResuxDevWarning, ResuxDevWarningCode, collectResuxDevWarnings, emitResuxDevWarnings, formatResuxDevWarning };
9
+ export declare function collectResuxDevWarnings(source: string, file?: string): ResuxDevWarning[];
10
+ export declare function emitResuxDevWarnings(source: string, file: string, emitted?: Set<string>): void;
11
+ export declare function formatResuxDevWarning(warning: ResuxDevWarning): string;
15
12
  //# sourceMappingURL=dev-warnings.d.ts.map
@@ -1,9 +1,8 @@
1
1
  import ts from "typescript";
2
2
  import { NodeTypes, parse } from "@vue/compiler-dom";
3
3
  import { parse as parse$1 } from "@vue/compiler-sfc";
4
-
5
- //#region src/compiler/dev-warnings.ts
6
- const INLINE_DOM_EVENT_ATTRIBUTES = new Set([
4
+ // src/compiler/dev-warnings.ts
5
+ const INLINE_DOM_EVENT_ATTRIBUTES = /* @__PURE__ */ new Set([
7
6
  "onabort",
8
7
  "onanimationcancel",
9
8
  "onanimationend",
@@ -99,7 +98,7 @@ const INLINE_DOM_EVENT_ATTRIBUTES = new Set([
99
98
  "onwaiting",
100
99
  "onwheel"
101
100
  ]);
102
- const DOM_QUERY_METHODS = new Set([
101
+ const DOM_QUERY_METHODS = /* @__PURE__ */ new Set([
103
102
  "getElementById",
104
103
  "getElementsByClassName",
105
104
  "getElementsByName",
@@ -108,7 +107,7 @@ const DOM_QUERY_METHODS = new Set([
108
107
  "querySelector",
109
108
  "querySelectorAll"
110
109
  ]);
111
- const GLOBAL_EVENT_TARGETS = new Set([
110
+ const GLOBAL_EVENT_TARGETS = /* @__PURE__ */ new Set([
112
111
  "document",
113
112
  "globalThis",
114
113
  "window"
@@ -205,8 +204,8 @@ function isLikelyDomElement(expression, domTargets) {
205
204
  if (ts.isCallExpression(value)) return isDomQueryExpression(value);
206
205
  if (ts.isPropertyAccessExpression(value)) {
207
206
  if (value.name.text === "value") {
208
- const root$1 = rootIdentifier(value.expression);
209
- return Boolean(root$1 && domTargets.has(root$1));
207
+ const root = rootIdentifier(value.expression);
208
+ return Boolean(root && domTargets.has(root));
210
209
  }
211
210
  const root = rootIdentifier(value);
212
211
  return Boolean(root && domTargets.has(root));
@@ -282,7 +281,6 @@ function dedupeWarnings(warnings) {
282
281
  return true;
283
282
  });
284
283
  }
285
-
286
- //#endregion
287
284
  export { collectResuxDevWarnings, emitResuxDevWarnings, formatResuxDevWarning };
285
+
288
286
  //# sourceMappingURL=dev-warnings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dev-warnings.js","names":["parseSfc","parseTemplate","root"],"sources":["../../src/compiler/dev-warnings.ts"],"sourcesContent":["import { NodeTypes, parse as parseTemplate, type ElementNode, type RootNode, type TemplateChildNode } from \"@vue/compiler-dom\";\nimport { parse as parseSfc, type SFCBlock } from \"@vue/compiler-sfc\";\nimport ts from \"typescript\";\n\nexport type ResuxDevWarningCode =\n | \"RX_EVENT_INLINE_ATTRIBUTE\"\n | \"RX_EVENT_DIRECT_LISTENER\";\n\nexport interface ResuxDevWarning {\n code: ResuxDevWarningCode;\n file: string;\n line: number;\n column: number;\n message: string;\n}\n\nconst INLINE_DOM_EVENT_ATTRIBUTES = new Set([\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncontextmenu\",\n \"oncopy\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"onfullscreenchange\",\n \"onfullscreenerror\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwheel\",\n]);\n\nconst DOM_QUERY_METHODS = new Set([\n \"getElementById\",\n \"getElementsByClassName\",\n \"getElementsByName\",\n \"getElementsByTagName\",\n \"getElementsByTagNameNS\",\n \"querySelector\",\n \"querySelectorAll\",\n]);\n\nconst GLOBAL_EVENT_TARGETS = new Set([\"document\", \"globalThis\", \"window\"]);\n\nexport function collectResuxDevWarnings(source: string, file = \"component.vue\"): ResuxDevWarning[] {\n if (!isNormalResuxComponent(file)) {\n return [];\n }\n\n try {\n const parsed = parseSfc(source, { filename: file });\n if (parsed.errors.length > 0) {\n return [];\n }\n\n const warnings: ResuxDevWarning[] = [];\n const templateRefs = new Set<string>();\n const template = parsed.descriptor.template;\n\n if (template) {\n collectTemplateWarnings(source, file, template, templateRefs, warnings);\n }\n\n for (const block of [parsed.descriptor.script, parsed.descriptor.scriptSetup]) {\n if (block) {\n collectScriptWarnings(source, file, block, templateRefs, warnings);\n }\n }\n\n return dedupeWarnings(warnings);\n } catch {\n // Development diagnostics must never make a valid compilation fail.\n return [];\n }\n}\n\nexport function emitResuxDevWarnings(\n source: string,\n file: string,\n emitted = new Set<string>(),\n): void {\n for (const warning of collectResuxDevWarnings(source, file)) {\n const key = `${warning.code}:${warning.file}:${warning.line}:${warning.column}:${warning.message}`;\n if (emitted.has(key)) {\n continue;\n }\n emitted.add(key);\n console.warn(formatResuxDevWarning(warning));\n }\n}\n\nexport function formatResuxDevWarning(warning: ResuxDevWarning): string {\n return `[Resux dev:${warning.code}] ${warning.file}:${warning.line}:${warning.column} ${warning.message}`;\n}\n\nfunction collectTemplateWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: Set<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const root = parseTemplate(block.content, { comments: false });\n visitTemplateChildren(root, (element) => {\n for (const property of element.props) {\n if (property.type !== NodeTypes.ATTRIBUTE) {\n continue;\n }\n\n const attributeName = property.name.toLowerCase();\n if (attributeName === \"ref\" && property.value?.content) {\n templateRefs.add(property.value.content);\n }\n\n if (!INLINE_DOM_EVENT_ATTRIBUTES.has(attributeName)) {\n continue;\n }\n\n const eventName = attributeName.slice(2);\n const location = locate(source, contentOffset + property.loc.start.offset);\n warnings.push({\n code: \"RX_EVENT_INLINE_ATTRIBUTE\",\n file,\n ...location,\n message: `Inline DOM handler \\`${property.name}\\` bypasses Resux event delegation. Use \\`@${eventName}\\` or \\`rx-on:${eventName}\\` instead.`,\n });\n }\n });\n}\n\nfunction collectScriptWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: ReadonlySet<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const sourceFile = ts.createSourceFile(\n file,\n block.content,\n ts.ScriptTarget.Latest,\n true,\n scriptKindFor(block.lang),\n );\n const domTargets = new Set(templateRefs);\n\n walk(sourceFile, (node) => {\n if (!ts.isVariableDeclaration(node) || !ts.isIdentifier(node.name)) {\n return;\n }\n\n if (\n templateRefs.has(node.name.text)\n || typeLooksLikeDomElement(node.type, sourceFile)\n || isDomQueryExpression(node.initializer)\n ) {\n domTargets.add(node.name.text);\n }\n });\n\n walk(sourceFile, (node) => {\n if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) {\n return;\n }\n if (node.expression.name.text !== \"addEventListener\") {\n return;\n }\n\n const receiver = unwrapExpression(node.expression.expression);\n if (isGlobalEventTarget(receiver) || !isLikelyDomElement(receiver, domTargets)) {\n return;\n }\n\n const eventName = readStringLiteral(node.arguments[0]);\n const eventLabel = eventName && /^[a-z][\\w:-]*$/i.test(eventName)\n ? `@${eventName}`\n : \"a template @event handler\";\n const listenerLabel = eventName\n ? `addEventListener(\"${eventName}\")`\n : \"addEventListener\";\n const location = locate(source, contentOffset + node.expression.name.getStart(sourceFile));\n warnings.push({\n code: \"RX_EVENT_DIRECT_LISTENER\",\n file,\n ...location,\n message: `Direct DOM \\`${listenerLabel}\\` bypasses Resux's resumable event delegation. Prefer \\`${eventLabel}\\` on the template element. Keep direct listeners for global or third-party EventTargets and always remove manually managed listeners during cleanup.`,\n });\n });\n}\n\nfunction visitTemplateChildren(\n root: RootNode,\n visit: (element: ElementNode) => void,\n): void {\n const traverse = (children: TemplateChildNode[]): void => {\n for (const child of children) {\n if (child.type !== NodeTypes.ELEMENT) {\n continue;\n }\n visit(child);\n traverse(child.children);\n }\n };\n\n traverse(root.children);\n}\n\nfunction walk(node: ts.Node, visit: (node: ts.Node) => void): void {\n visit(node);\n node.forEachChild((child) => walk(child, visit));\n}\n\nfunction isLikelyDomElement(expression: ts.Expression, domTargets: ReadonlySet<string>): boolean {\n const value = unwrapExpression(expression);\n\n if (ts.isIdentifier(value)) {\n return domTargets.has(value.text);\n }\n\n if (ts.isCallExpression(value)) {\n return isDomQueryExpression(value);\n }\n\n if (ts.isPropertyAccessExpression(value)) {\n if (value.name.text === \"value\") {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n const root = rootIdentifier(value);\n return Boolean(root && domTargets.has(root));\n }\n\n if (ts.isElementAccessExpression(value)) {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n\n return false;\n}\n\nfunction isGlobalEventTarget(expression: ts.Expression): boolean {\n const root = rootIdentifier(expression);\n return Boolean(root && GLOBAL_EVENT_TARGETS.has(root));\n}\n\nfunction rootIdentifier(expression: ts.Expression): string | undefined {\n const value = unwrapExpression(expression);\n if (ts.isIdentifier(value)) {\n return value.text;\n }\n if (ts.isPropertyAccessExpression(value) || ts.isElementAccessExpression(value)) {\n return rootIdentifier(value.expression);\n }\n return undefined;\n}\n\nfunction isDomQueryExpression(expression: ts.Expression | undefined): boolean {\n if (!expression) {\n return false;\n }\n const value = unwrapExpression(expression);\n if (!ts.isCallExpression(value) || !ts.isPropertyAccessExpression(value.expression)) {\n return false;\n }\n if (!DOM_QUERY_METHODS.has(value.expression.name.text)) {\n return false;\n }\n const root = rootIdentifier(value.expression.expression);\n return root === \"document\";\n}\n\nfunction typeLooksLikeDomElement(type: ts.TypeNode | undefined, sourceFile: ts.SourceFile): boolean {\n if (!type) {\n return false;\n }\n return /\\b(?:Element|[A-Z][A-Za-z0-9]*Element)\\b/.test(type.getText(sourceFile));\n}\n\nfunction readStringLiteral(node: ts.Expression | undefined): string | undefined {\n if (!node) {\n return undefined;\n }\n return ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)\n ? node.text\n : undefined;\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let value = expression;\n while (\n ts.isParenthesizedExpression(value)\n || ts.isAsExpression(value)\n || ts.isTypeAssertionExpression(value)\n || ts.isNonNullExpression(value)\n || ts.isSatisfiesExpression(value)\n ) {\n value = value.expression;\n }\n return value;\n}\n\nfunction scriptKindFor(lang: string | undefined): ts.ScriptKind {\n switch (lang?.toLowerCase()) {\n case \"js\":\n return ts.ScriptKind.JS;\n case \"jsx\":\n return ts.ScriptKind.JSX;\n case \"tsx\":\n return ts.ScriptKind.TSX;\n default:\n return ts.ScriptKind.TS;\n }\n}\n\nfunction resolveBlockContentOffset(source: string, block: SFCBlock): number {\n const reportedOffset = block.loc.start.offset;\n if (source.slice(reportedOffset, reportedOffset + block.content.length) === block.content) {\n return reportedOffset;\n }\n const fallback = source.indexOf(block.content, Math.max(0, reportedOffset));\n return fallback >= 0 ? fallback : source.indexOf(block.content);\n}\n\nfunction locate(source: string, offset: number): { line: number; column: number } {\n const safeOffset = Math.max(0, Math.min(offset, source.length));\n const before = source.slice(0, safeOffset);\n const lastNewline = before.lastIndexOf(\"\\n\");\n return {\n line: before.split(\"\\n\").length,\n column: safeOffset - lastNewline,\n };\n}\n\nfunction isNormalResuxComponent(file: string): boolean {\n const normalized = file.replaceAll(\"\\\\\", \"/\").toLowerCase();\n return normalized.endsWith(\".vue\")\n && !/(?:^|\\/)node_modules\\//.test(normalized)\n && !/(?:^|\\/)islands\\/vue\\//.test(normalized);\n}\n\nfunction dedupeWarnings(warnings: ResuxDevWarning[]): ResuxDevWarning[] {\n const seen = new Set<string>();\n return warnings.filter((warning) => {\n const key = `${warning.code}:${warning.line}:${warning.column}:${warning.message}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n"],"mappings":";;;;;AAgBA,MAAM,8BAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACD,CAAC;AAEF,MAAM,oBAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;CACD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AAG,WAAW;;;AAI3B,SAAS,0BAA0B,QAAgB,OAAyB;CAC1E,MAAM,iBAAiB,MAAM,IAAI,MAAM;AACvC,KAAI,OAAO,MAAM,gBAAgB,iBAAiB,MAAM,QAAQ,OAAO,KAAK,MAAM,QAChF,QAAO;CAET,MAAM,WAAW,OAAO,QAAQ,MAAM,SAAS,KAAK,IAAI,GAAG,eAAe,CAAC;AAC3E,QAAO,YAAY,IAAI,WAAW,OAAO,QAAQ,MAAM,QAAQ;;AAGjE,SAAS,OAAO,QAAgB,QAAkD;CAChF,MAAM,aAAa,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,OAAO,OAAO,CAAC;CAC/D,MAAM,SAAS,OAAO,MAAM,GAAG,WAAW;CAC1C,MAAM,cAAc,OAAO,YAAY,KAAK;AAC5C,QAAO;EACL,MAAM,OAAO,MAAM,KAAK,CAAC;EACzB,QAAQ,aAAa;EACtB;;AAGH,SAAS,uBAAuB,MAAuB;CACrD,MAAM,aAAa,KAAK,WAAW,MAAM,IAAI,CAAC,aAAa;AAC3D,QAAO,WAAW,SAAS,OAAO,IAC7B,CAAC,yBAAyB,KAAK,WAAW,IAC1C,CAAC,yBAAyB,KAAK,WAAW;;AAGjD,SAAS,eAAe,UAAgD;CACtE,MAAM,uBAAO,IAAI,KAAa;AAC9B,QAAO,SAAS,QAAQ,YAAY;EAClC,MAAM,MAAM,GAAG,QAAQ,KAAK,GAAG,QAAQ,KAAK,GAAG,QAAQ,OAAO,GAAG,QAAQ;AACzE,MAAI,KAAK,IAAI,IAAI,CACf,QAAO;AAET,OAAK,IAAI,IAAI;AACb,SAAO;GACP"}
1
+ {"version":3,"file":"dev-warnings.js","names":["parseSfc","parseTemplate"],"sources":["../../src/compiler/dev-warnings.ts"],"sourcesContent":["import { NodeTypes, parse as parseTemplate, type ElementNode, type RootNode, type TemplateChildNode } from \"@vue/compiler-dom\";\nimport { parse as parseSfc, type SFCBlock } from \"@vue/compiler-sfc\";\nimport ts from \"typescript\";\n\nexport type ResuxDevWarningCode =\n | \"RX_EVENT_INLINE_ATTRIBUTE\"\n | \"RX_EVENT_DIRECT_LISTENER\";\n\nexport interface ResuxDevWarning {\n code: ResuxDevWarningCode;\n file: string;\n line: number;\n column: number;\n message: string;\n}\n\nconst INLINE_DOM_EVENT_ATTRIBUTES = new Set([\n \"onabort\",\n \"onanimationcancel\",\n \"onanimationend\",\n \"onanimationiteration\",\n \"onanimationstart\",\n \"onauxclick\",\n \"onbeforeinput\",\n \"onbeforetoggle\",\n \"onblur\",\n \"oncancel\",\n \"oncanplay\",\n \"oncanplaythrough\",\n \"onchange\",\n \"onclick\",\n \"onclose\",\n \"oncontextmenu\",\n \"oncopy\",\n \"oncut\",\n \"ondblclick\",\n \"ondrag\",\n \"ondragend\",\n \"ondragenter\",\n \"ondragleave\",\n \"ondragover\",\n \"ondragstart\",\n \"ondrop\",\n \"ondurationchange\",\n \"onemptied\",\n \"onended\",\n \"onerror\",\n \"onfocus\",\n \"onfocusin\",\n \"onfocusout\",\n \"onformdata\",\n \"onfullscreenchange\",\n \"onfullscreenerror\",\n \"ongotpointercapture\",\n \"oninput\",\n \"oninvalid\",\n \"onkeydown\",\n \"onkeypress\",\n \"onkeyup\",\n \"onload\",\n \"onloadeddata\",\n \"onloadedmetadata\",\n \"onloadstart\",\n \"onlostpointercapture\",\n \"onmousedown\",\n \"onmouseenter\",\n \"onmouseleave\",\n \"onmousemove\",\n \"onmouseout\",\n \"onmouseover\",\n \"onmouseup\",\n \"onpaste\",\n \"onpause\",\n \"onplay\",\n \"onplaying\",\n \"onpointercancel\",\n \"onpointerdown\",\n \"onpointerenter\",\n \"onpointerleave\",\n \"onpointermove\",\n \"onpointerout\",\n \"onpointerover\",\n \"onpointerup\",\n \"onprogress\",\n \"onratechange\",\n \"onreset\",\n \"onresize\",\n \"onscroll\",\n \"onscrollend\",\n \"onseeked\",\n \"onseeking\",\n \"onselect\",\n \"onselectionchange\",\n \"onselectstart\",\n \"onslotchange\",\n \"onstalled\",\n \"onsubmit\",\n \"onsuspend\",\n \"ontimeupdate\",\n \"ontoggle\",\n \"ontouchcancel\",\n \"ontouchend\",\n \"ontouchmove\",\n \"ontouchstart\",\n \"ontransitioncancel\",\n \"ontransitionend\",\n \"ontransitionrun\",\n \"ontransitionstart\",\n \"onvolumechange\",\n \"onwaiting\",\n \"onwheel\",\n]);\n\nconst DOM_QUERY_METHODS = new Set([\n \"getElementById\",\n \"getElementsByClassName\",\n \"getElementsByName\",\n \"getElementsByTagName\",\n \"getElementsByTagNameNS\",\n \"querySelector\",\n \"querySelectorAll\",\n]);\n\nconst GLOBAL_EVENT_TARGETS = new Set([\"document\", \"globalThis\", \"window\"]);\n\nexport function collectResuxDevWarnings(source: string, file = \"component.vue\"): ResuxDevWarning[] {\n if (!isNormalResuxComponent(file)) {\n return [];\n }\n\n try {\n const parsed = parseSfc(source, { filename: file });\n if (parsed.errors.length > 0) {\n return [];\n }\n\n const warnings: ResuxDevWarning[] = [];\n const templateRefs = new Set<string>();\n const template = parsed.descriptor.template;\n\n if (template) {\n collectTemplateWarnings(source, file, template, templateRefs, warnings);\n }\n\n for (const block of [parsed.descriptor.script, parsed.descriptor.scriptSetup]) {\n if (block) {\n collectScriptWarnings(source, file, block, templateRefs, warnings);\n }\n }\n\n return dedupeWarnings(warnings);\n } catch {\n // Development diagnostics must never make a valid compilation fail.\n return [];\n }\n}\n\nexport function emitResuxDevWarnings(\n source: string,\n file: string,\n emitted = new Set<string>(),\n): void {\n for (const warning of collectResuxDevWarnings(source, file)) {\n const key = `${warning.code}:${warning.file}:${warning.line}:${warning.column}:${warning.message}`;\n if (emitted.has(key)) {\n continue;\n }\n emitted.add(key);\n console.warn(formatResuxDevWarning(warning));\n }\n}\n\nexport function formatResuxDevWarning(warning: ResuxDevWarning): string {\n return `[Resux dev:${warning.code}] ${warning.file}:${warning.line}:${warning.column} ${warning.message}`;\n}\n\nfunction collectTemplateWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: Set<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const root = parseTemplate(block.content, { comments: false });\n visitTemplateChildren(root, (element) => {\n for (const property of element.props) {\n if (property.type !== NodeTypes.ATTRIBUTE) {\n continue;\n }\n\n const attributeName = property.name.toLowerCase();\n if (attributeName === \"ref\" && property.value?.content) {\n templateRefs.add(property.value.content);\n }\n\n if (!INLINE_DOM_EVENT_ATTRIBUTES.has(attributeName)) {\n continue;\n }\n\n const eventName = attributeName.slice(2);\n const location = locate(source, contentOffset + property.loc.start.offset);\n warnings.push({\n code: \"RX_EVENT_INLINE_ATTRIBUTE\",\n file,\n ...location,\n message: `Inline DOM handler \\`${property.name}\\` bypasses Resux event delegation. Use \\`@${eventName}\\` or \\`rx-on:${eventName}\\` instead.`,\n });\n }\n });\n}\n\nfunction collectScriptWarnings(\n source: string,\n file: string,\n block: SFCBlock,\n templateRefs: ReadonlySet<string>,\n warnings: ResuxDevWarning[],\n): void {\n const contentOffset = resolveBlockContentOffset(source, block);\n if (contentOffset < 0) {\n return;\n }\n\n const sourceFile = ts.createSourceFile(\n file,\n block.content,\n ts.ScriptTarget.Latest,\n true,\n scriptKindFor(block.lang),\n );\n const domTargets = new Set(templateRefs);\n\n walk(sourceFile, (node) => {\n if (!ts.isVariableDeclaration(node) || !ts.isIdentifier(node.name)) {\n return;\n }\n\n if (\n templateRefs.has(node.name.text)\n || typeLooksLikeDomElement(node.type, sourceFile)\n || isDomQueryExpression(node.initializer)\n ) {\n domTargets.add(node.name.text);\n }\n });\n\n walk(sourceFile, (node) => {\n if (!ts.isCallExpression(node) || !ts.isPropertyAccessExpression(node.expression)) {\n return;\n }\n if (node.expression.name.text !== \"addEventListener\") {\n return;\n }\n\n const receiver = unwrapExpression(node.expression.expression);\n if (isGlobalEventTarget(receiver) || !isLikelyDomElement(receiver, domTargets)) {\n return;\n }\n\n const eventName = readStringLiteral(node.arguments[0]);\n const eventLabel = eventName && /^[a-z][\\w:-]*$/i.test(eventName)\n ? `@${eventName}`\n : \"a template @event handler\";\n const listenerLabel = eventName\n ? `addEventListener(\"${eventName}\")`\n : \"addEventListener\";\n const location = locate(source, contentOffset + node.expression.name.getStart(sourceFile));\n warnings.push({\n code: \"RX_EVENT_DIRECT_LISTENER\",\n file,\n ...location,\n message: `Direct DOM \\`${listenerLabel}\\` bypasses Resux's resumable event delegation. Prefer \\`${eventLabel}\\` on the template element. Keep direct listeners for global or third-party EventTargets and always remove manually managed listeners during cleanup.`,\n });\n });\n}\n\nfunction visitTemplateChildren(\n root: RootNode,\n visit: (element: ElementNode) => void,\n): void {\n const traverse = (children: TemplateChildNode[]): void => {\n for (const child of children) {\n if (child.type !== NodeTypes.ELEMENT) {\n continue;\n }\n visit(child);\n traverse(child.children);\n }\n };\n\n traverse(root.children);\n}\n\nfunction walk(node: ts.Node, visit: (node: ts.Node) => void): void {\n visit(node);\n node.forEachChild((child) => walk(child, visit));\n}\n\nfunction isLikelyDomElement(expression: ts.Expression, domTargets: ReadonlySet<string>): boolean {\n const value = unwrapExpression(expression);\n\n if (ts.isIdentifier(value)) {\n return domTargets.has(value.text);\n }\n\n if (ts.isCallExpression(value)) {\n return isDomQueryExpression(value);\n }\n\n if (ts.isPropertyAccessExpression(value)) {\n if (value.name.text === \"value\") {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n const root = rootIdentifier(value);\n return Boolean(root && domTargets.has(root));\n }\n\n if (ts.isElementAccessExpression(value)) {\n const root = rootIdentifier(value.expression);\n return Boolean(root && domTargets.has(root));\n }\n\n return false;\n}\n\nfunction isGlobalEventTarget(expression: ts.Expression): boolean {\n const root = rootIdentifier(expression);\n return Boolean(root && GLOBAL_EVENT_TARGETS.has(root));\n}\n\nfunction rootIdentifier(expression: ts.Expression): string | undefined {\n const value = unwrapExpression(expression);\n if (ts.isIdentifier(value)) {\n return value.text;\n }\n if (ts.isPropertyAccessExpression(value) || ts.isElementAccessExpression(value)) {\n return rootIdentifier(value.expression);\n }\n return undefined;\n}\n\nfunction isDomQueryExpression(expression: ts.Expression | undefined): boolean {\n if (!expression) {\n return false;\n }\n const value = unwrapExpression(expression);\n if (!ts.isCallExpression(value) || !ts.isPropertyAccessExpression(value.expression)) {\n return false;\n }\n if (!DOM_QUERY_METHODS.has(value.expression.name.text)) {\n return false;\n }\n const root = rootIdentifier(value.expression.expression);\n return root === \"document\";\n}\n\nfunction typeLooksLikeDomElement(type: ts.TypeNode | undefined, sourceFile: ts.SourceFile): boolean {\n if (!type) {\n return false;\n }\n return /\\b(?:Element|[A-Z][A-Za-z0-9]*Element)\\b/.test(type.getText(sourceFile));\n}\n\nfunction readStringLiteral(node: ts.Expression | undefined): string | undefined {\n if (!node) {\n return undefined;\n }\n return ts.isStringLiteral(node) || ts.isNoSubstitutionTemplateLiteral(node)\n ? node.text\n : undefined;\n}\n\nfunction unwrapExpression(expression: ts.Expression): ts.Expression {\n let value = expression;\n while (\n ts.isParenthesizedExpression(value)\n || ts.isAsExpression(value)\n || ts.isTypeAssertionExpression(value)\n || ts.isNonNullExpression(value)\n || ts.isSatisfiesExpression(value)\n ) {\n value = value.expression;\n }\n return value;\n}\n\nfunction scriptKindFor(lang: string | undefined): ts.ScriptKind {\n switch (lang?.toLowerCase()) {\n case \"js\":\n return ts.ScriptKind.JS;\n case \"jsx\":\n return ts.ScriptKind.JSX;\n case \"tsx\":\n return ts.ScriptKind.TSX;\n default:\n return ts.ScriptKind.TS;\n }\n}\n\nfunction resolveBlockContentOffset(source: string, block: SFCBlock): number {\n const reportedOffset = block.loc.start.offset;\n if (source.slice(reportedOffset, reportedOffset + block.content.length) === block.content) {\n return reportedOffset;\n }\n const fallback = source.indexOf(block.content, Math.max(0, reportedOffset));\n return fallback >= 0 ? fallback : source.indexOf(block.content);\n}\n\nfunction locate(source: string, offset: number): { line: number; column: number } {\n const safeOffset = Math.max(0, Math.min(offset, source.length));\n const before = source.slice(0, safeOffset);\n const lastNewline = before.lastIndexOf(\"\\n\");\n return {\n line: before.split(\"\\n\").length,\n column: safeOffset - lastNewline,\n };\n}\n\nfunction isNormalResuxComponent(file: string): boolean {\n const normalized = file.replaceAll(\"\\\\\", \"/\").toLowerCase();\n return normalized.endsWith(\".vue\")\n && !/(?:^|\\/)node_modules\\//.test(normalized)\n && !/(?:^|\\/)islands\\/vue\\//.test(normalized);\n}\n\nfunction dedupeWarnings(warnings: ResuxDevWarning[]): ResuxDevWarning[] {\n const seen = new Set<string>();\n return warnings.filter((warning) => {\n const key = `${warning.code}:${warning.line}:${warning.column}:${warning.message}`;\n if (seen.has(key)) {\n return false;\n }\n seen.add(key);\n return true;\n });\n}\n"],"mappings":";;;;AAgBA,MAAM,8CAA8B,IAAI,IAAI;CAC1C;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,oCAAoB,IAAI,IAAI;CAChC;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAM,uCAAuB,IAAI,IAAI;CAAC;CAAY;CAAc;AAAQ,CAAC;AAEzE,SAAgB,wBAAwB,QAAgB,OAAO,iBAAoC;CACjG,IAAI,CAAC,uBAAuB,IAAI,GAC9B,OAAO,CAAC;CAGV,IAAI;EACF,MAAM,SAASA,QAAS,QAAQ,EAAE,UAAU,KAAK,C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M,gBAAgB,iBAAiB,MAAM,QAAQ,MAAM,MAAM,MAAM,SAChF,OAAO;CAET,MAAM,WAAW,OAAO,QAAQ,MAAM,SAAS,KAAK,IAAI,GAAG,cAAc,CAAC;CAC1E,OAAO,YAAY,IAAI,WAAW,OAAO,QAAQ,MAAM,OAAO;AAChE;AAEA,SAAS,OAAO,QAAgB,QAAkD;CAChF,MAAM,aAAa,KAAK,IAAI,GAAG,KAAK,IAAI,QAAQ,OAAO,MAAM,CAAC;CAC9D,MAAM,SAAS,OAAO,MAAM,GAAG,UAAU;CACzC,MAAM,cAAc,OAAO,YAAY,IAAI;CAC3C,OAAO;EACL,MAAM,OAAO,MAAM,IAAI,CAAC,CAAC;EACzB,QAAQ,aAAa;CACvB;AACF;AAEA,SAAS,uBAAuB,MAAuB;CACrD,MAAM,aAAa,KAAK,WAAW,MAAM,GAAG,CAAC,CAAC,YAAY;CAC1D,OAAO,WAAW,SAAS,MAAM,KAC5B,CAAC,yBAAyB,KAAK,UAAU,KACzC,CAAC,yBAAyB,KAAK,UAAU;AAChD;AAEA,SAAS,eAAe,UAAgD;CACtE,MAAM,uBAAO,IAAI,IAAY;CAC7B,OAAO,SAAS,QAAQ,YAAY;EAClC,MAAM,MAAM,GAAG,QAAQ,KAAK,GAAG,QAAQ,KAAK,GAAG,QAAQ,OAAO,GAAG,QAAQ;EACzE,IAAI,KAAK,IAAI,GAAG,GACd,OAAO;EAET,KAAK,IAAI,GAAG;EACZ,OAAO;CACT,CAAC;AACH"}
@@ -1,17 +1,14 @@
1
- //#region src/compiler/directives.d.ts
2
1
  /**
3
2
  * Converts Resux-branded directive attributes (`rx-*`) to the directive names
4
3
  * understood by Vue's template parser. Only attribute names inside opening
5
4
  * template tags are changed; text, comments and attribute values are preserved.
6
5
  */
7
- declare function normalizeResuxDirectiveSyntax(template: string): string;
6
+ export declare function normalizeResuxDirectiveSyntax(template: string): string;
8
7
  /**
9
8
  * Normalizes only the `<template>` block of a Vue SFC. Script and style blocks
10
9
  * are intentionally untouched, so strings such as `"rx-if"` keep their value.
11
10
  */
12
- declare function normalizeResuxSfcSource(source: string, filename?: string): string;
11
+ export declare function normalizeResuxSfcSource(source: string, filename?: string): string;
13
12
  /** Rewords compiler diagnostics so the public API always speaks Resux syntax. */
14
- declare function rethrowWithResuxDirectiveBrand(error: unknown): never;
15
- //#endregion
16
- export { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, rethrowWithResuxDirectiveBrand };
13
+ export declare function rethrowWithResuxDirectiveBrand(error: unknown): never;
17
14
  //# sourceMappingURL=directives.d.ts.map
@@ -1,6 +1,5 @@
1
1
  import { parse } from "@vue/compiler-sfc";
2
-
3
- //#region src/compiler/directives.ts
2
+ // src/compiler/directives.ts
4
3
  const RX_DIRECTIVE_PREFIX = "rx-";
5
4
  const VUE_DIRECTIVE_PREFIX = "v-";
6
5
  /**
@@ -136,7 +135,6 @@ function normalizeOpeningTag(tag) {
136
135
  }
137
136
  return output;
138
137
  }
139
-
140
- //#endregion
141
138
  export { normalizeResuxDirectiveSyntax, normalizeResuxSfcSource, rethrowWithResuxDirectiveBrand };
139
+
142
140
  //# sourceMappingURL=directives.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"directives.js","names":["parseSfc"],"sources":["../../src/compiler/directives.ts"],"sourcesContent":["import { parse as parseSfc } from \"@vue/compiler-sfc\";\n\nconst RX_DIRECTIVE_PREFIX = \"rx-\";\nconst VUE_DIRECTIVE_PREFIX = \"v-\";\n\n/**\n * Converts Resux-branded directive attributes (`rx-*`) to the directive names\n * understood by Vue's template parser. Only attribute names inside opening\n * template tags are changed; text, comments and attribute values are preserved.\n */\nexport function normalizeResuxDirectiveSyntax(template: string): string {\n let output = \"\";\n let cursor = 0;\n\n while (cursor < template.length) {\n const tagStart = template.indexOf(\"<\", cursor);\n if (tagStart === -1) {\n output += template.slice(cursor);\n break;\n }\n\n output += template.slice(cursor, tagStart);\n\n if (template.startsWith(\"<!--\", tagStart)) {\n const commentEnd = template.indexOf(\"-->\", tagStart + 4);\n if (commentEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n output += template.slice(tagStart, commentEnd + 3);\n cursor = commentEnd + 3;\n continue;\n }\n\n const tagEnd = findTagEnd(template, tagStart + 1);\n if (tagEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n\n output += normalizeOpeningTag(template.slice(tagStart, tagEnd + 1));\n cursor = tagEnd + 1;\n }\n\n return output;\n}\n\n/**\n * Normalizes only the `<template>` block of a Vue SFC. Script and style blocks\n * are intentionally untouched, so strings such as `\"rx-if\"` keep their value.\n */\nexport function normalizeResuxSfcSource(source: string, filename = \"component.vue\"): string {\n if (!source.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const parsed = parseSfc(source, { filename });\n const template = parsed.descriptor.template;\n if (!template || !template.content.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const normalizedTemplate = normalizeResuxDirectiveSyntax(template.content);\n if (normalizedTemplate === template.content) {\n return source;\n }\n\n const bounds = resolveTemplateContentBounds(source, template.content, template.loc.start.offset);\n if (!bounds) {\n return source;\n }\n\n return `${source.slice(0, bounds.start)}${normalizedTemplate}${source.slice(bounds.end)}`;\n}\n\n/** Rewords compiler diagnostics so the public API always speaks Resux syntax. */\nexport function rethrowWithResuxDirectiveBrand(error: unknown): never {\n if (error instanceof Error) {\n error.message = brandDirectiveText(error.message);\n if (error.stack) {\n error.stack = brandDirectiveText(error.stack);\n }\n }\n throw error;\n}\n\nfunction brandDirectiveText(value: string): string {\n return value.replace(/\\bv-(?=[a-z][\\w-]*)/gi, RX_DIRECTIVE_PREFIX);\n}\n\nfunction resolveTemplateContentBounds(\n source: string,\n content: string,\n reportedOffset: number,\n): { start: number; end: number } | null {\n if (source.slice(reportedOffset, reportedOffset + content.length) === content) {\n return { start: reportedOffset, end: reportedOffset + content.length };\n }\n\n const templateOpen = /<template(?:\\s[^>]*)?>/i.exec(source);\n if (!templateOpen || templateOpen.index === undefined) {\n return null;\n }\n\n const openingEnd = templateOpen.index + templateOpen[0].length;\n const fallbackStart = source.indexOf(content, openingEnd);\n if (fallbackStart === -1) {\n return null;\n }\n\n return { start: fallbackStart, end: fallbackStart + content.length };\n}\n\nfunction findTagEnd(source: string, start: number): number {\n let quote: '\"' | \"'\" | null = null;\n\n for (let index = start; index < source.length; index++) {\n const char = source[index];\n if (quote) {\n if (char === quote && source[index - 1] !== \"\\\\\") {\n quote = null;\n }\n continue;\n }\n\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n\n if (char === \">\") {\n return index;\n }\n }\n\n return -1;\n}\n\nfunction normalizeOpeningTag(tag: string): string {\n if (/^<\\s*(?:\\/|!|\\?)/.test(tag)) {\n return tag;\n }\n\n let output = \"\";\n let cursor = 0;\n let expectsUnquotedValue = false;\n\n // Copy the opening bracket, whitespace and element name unchanged.\n while (cursor < tag.length && !/\\s/.test(tag[cursor]) && tag[cursor] !== \">\") {\n output += tag[cursor++];\n }\n\n while (cursor < tag.length) {\n const char = tag[cursor];\n\n if (char === '\"' || char === \"'\") {\n const quote = char;\n const valueStart = cursor;\n cursor++;\n while (cursor < tag.length) {\n if (tag[cursor] === quote && tag[cursor - 1] !== \"\\\\\") {\n cursor++;\n break;\n }\n cursor++;\n }\n output += tag.slice(valueStart, cursor);\n expectsUnquotedValue = false;\n continue;\n }\n\n if (/\\s/.test(char) || char === \"/\" || char === \">\") {\n output += char;\n cursor++;\n continue;\n }\n\n if (char === \"=\") {\n output += char;\n cursor++;\n expectsUnquotedValue = true;\n continue;\n }\n\n const tokenStart = cursor;\n while (\n cursor < tag.length\n && !/\\s/.test(tag[cursor])\n && tag[cursor] !== \"=\"\n && tag[cursor] !== \"/\"\n && tag[cursor] !== \">\"\n ) {\n cursor++;\n }\n\n const token = tag.slice(tokenStart, cursor);\n output += !expectsUnquotedValue\n && token.startsWith(RX_DIRECTIVE_PREFIX)\n && token.length > RX_DIRECTIVE_PREFIX.length\n ? `${VUE_DIRECTIVE_PREFIX}${token.slice(RX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AAI,IAAI,YAAY,IACvE,WAAU,IAAI;AAGhB,QAAO,SAAS,IAAI,QAAQ;EAC1B,MAAM,OAAO,IAAI;AAEjB,MAAI,SAAS,QAAO,SAAS,KAAK;GAChC,MAAM,QAAQ;GACd,MAAM,aAAa;AACnB;AACA,UAAO,SAAS,IAAI,QAAQ;AAC1B,QAAI,IAAI,YAAY,SAAS,IAAI,SAAS,OAAO,MAAM;AACrD;AACA;;AAEF;;AAEF,aAAU,IAAI,MAAM,YAAY,OAAO;AACvC,0BAAuB;AACvB;;AAGF,MAAI,KAAK,KAAK,KAAK,IAAI,SAAS,OAAO,SAAS,KAAK;AACnD,aAAU;AACV;AACA;;AAGF,MAAI,SAAS,KAAK;AAChB,aAAU;AACV;AACA,0BAAuB;AACvB;;EAGF,MAAM,aAAa;AACnB,SACE,SAAS,IAAI,UACV,CAAC,KAAK,KAAK,IAAI,QAAQ,IACvB,IAAI,YAAY,OAChB,IAAI,YAAY,OAChB,IAAI,YAAY,IAEnB;EAGF,MAAM,QAAQ,IAAI,MAAM,YAAY,OAAO;AAC3C,YAAU,CAAC,wBACN,MAAM,WAAW,oBAAoB,IACrC,MAAM,SAAS,IACd,GAAG,uBAAuB,MAAM,MAAM,EAA2B,KACjE;AACN,yBAAuB;;AAGzB,QAAO"}
1
+ {"version":3,"file":"directives.js","names":["parseSfc"],"sources":["../../src/compiler/directives.ts"],"sourcesContent":["import { parse as parseSfc } from \"@vue/compiler-sfc\";\n\nconst RX_DIRECTIVE_PREFIX = \"rx-\";\nconst VUE_DIRECTIVE_PREFIX = \"v-\";\n\n/**\n * Converts Resux-branded directive attributes (`rx-*`) to the directive names\n * understood by Vue's template parser. Only attribute names inside opening\n * template tags are changed; text, comments and attribute values are preserved.\n */\nexport function normalizeResuxDirectiveSyntax(template: string): string {\n let output = \"\";\n let cursor = 0;\n\n while (cursor < template.length) {\n const tagStart = template.indexOf(\"<\", cursor);\n if (tagStart === -1) {\n output += template.slice(cursor);\n break;\n }\n\n output += template.slice(cursor, tagStart);\n\n if (template.startsWith(\"<!--\", tagStart)) {\n const commentEnd = template.indexOf(\"-->\", tagStart + 4);\n if (commentEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n output += template.slice(tagStart, commentEnd + 3);\n cursor = commentEnd + 3;\n continue;\n }\n\n const tagEnd = findTagEnd(template, tagStart + 1);\n if (tagEnd === -1) {\n output += template.slice(tagStart);\n break;\n }\n\n output += normalizeOpeningTag(template.slice(tagStart, tagEnd + 1));\n cursor = tagEnd + 1;\n }\n\n return output;\n}\n\n/**\n * Normalizes only the `<template>` block of a Vue SFC. Script and style blocks\n * are intentionally untouched, so strings such as `\"rx-if\"` keep their value.\n */\nexport function normalizeResuxSfcSource(source: string, filename = \"component.vue\"): string {\n if (!source.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const parsed = parseSfc(source, { filename });\n const template = parsed.descriptor.template;\n if (!template || !template.content.includes(RX_DIRECTIVE_PREFIX)) {\n return source;\n }\n\n const normalizedTemplate = normalizeResuxDirectiveSyntax(template.content);\n if (normalizedTemplate === template.content) {\n return source;\n }\n\n const bounds = resolveTemplateContentBounds(source, template.content, template.loc.start.offset);\n if (!bounds) {\n return source;\n }\n\n return `${source.slice(0, bounds.start)}${normalizedTemplate}${source.slice(bounds.end)}`;\n}\n\n/** Rewords compiler diagnostics so the public API always speaks Resux syntax. */\nexport function rethrowWithResuxDirectiveBrand(error: unknown): never {\n if (error instanceof Error) {\n error.message = brandDirectiveText(error.message);\n if (error.stack) {\n error.stack = brandDirectiveText(error.stack);\n }\n }\n throw error;\n}\n\nfunction brandDirectiveText(value: string): string {\n return value.replace(/\\bv-(?=[a-z][\\w-]*)/gi, RX_DIRECTIVE_PREFIX);\n}\n\nfunction resolveTemplateContentBounds(\n source: string,\n content: string,\n reportedOffset: number,\n): { start: number; end: number } | null {\n if (source.slice(reportedOffset, reportedOffset + content.length) === content) {\n return { start: reportedOffset, end: reportedOffset + content.length };\n }\n\n const templateOpen = /<template(?:\\s[^>]*)?>/i.exec(source);\n if (!templateOpen || templateOpen.index === undefined) {\n return null;\n }\n\n const openingEnd = templateOpen.index + templateOpen[0].length;\n const fallbackStart = source.indexOf(content, openingEnd);\n if (fallbackStart === -1) {\n return null;\n }\n\n return { start: fallbackStart, end: fallbackStart + content.length };\n}\n\nfunction findTagEnd(source: string, start: number): number {\n let quote: '\"' | \"'\" | null = null;\n\n for (let index = start; index < source.length; index++) {\n const char = source[index];\n if (quote) {\n if (char === quote && source[index - 1] !== \"\\\\\") {\n quote = null;\n }\n continue;\n }\n\n if (char === '\"' || char === \"'\") {\n quote = char;\n continue;\n }\n\n if (char === \">\") {\n return index;\n }\n }\n\n return -1;\n}\n\nfunction normalizeOpeningTag(tag: string): string {\n if (/^<\\s*(?:\\/|!|\\?)/.test(tag)) {\n return tag;\n }\n\n let output = \"\";\n let cursor = 0;\n let expectsUnquotedValue = false;\n\n // Copy the opening bracket, whitespace and element name unchanged.\n while (cursor < tag.length && !/\\s/.test(tag[cursor]) && tag[cursor] !== \">\") {\n output += tag[cursor++];\n }\n\n while (cursor < tag.length) {\n const char = tag[cursor];\n\n if (char === '\"' || char === \"'\") {\n const quote = char;\n const valueStart = cursor;\n cursor++;\n while (cursor < tag.length) {\n if (tag[cursor] === quote && tag[cursor - 1] !== \"\\\\\") {\n cursor++;\n break;\n }\n cursor++;\n }\n output += tag.slice(valueStart, cursor);\n expectsUnquotedValue = false;\n continue;\n }\n\n if (/\\s/.test(char) || char === \"/\" || char === \">\") {\n output += char;\n cursor++;\n continue;\n }\n\n if (char === \"=\") {\n output += char;\n cursor++;\n expectsUnquotedValue = true;\n continue;\n }\n\n const tokenStart = cursor;\n while (\n cursor < tag.length\n && !/\\s/.test(tag[cursor])\n && tag[cursor] !== \"=\"\n && tag[cursor] !== \"/\"\n && tag[cursor] !== \">\"\n ) {\n cursor++;\n }\n\n const token = tag.slice(tokenStart, cursor);\n output += !expectsUnquotedValue\n && token.startsWith(RX_DIRECTIVE_PREFIX)\n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AK,GAAG,GAC7B,OAAO;CAGT,IAAI,SAAS;CACb,IAAI,SAAS;CACb,IAAI,uBAAuB;CAG3B,OAAO,SAAS,IAAI,UAAU,CAAC,KAAK,KAAK,IAAI,OAAO,KAAK,IAAI,YAAY,KACvE,UAAU,IAAI;CAGhB,OAAO,SAAS,IAAI,QAAQ;EAC1B,MAAM,OAAO,IAAI;EAEjB,IAAI,SAAS,QAAO,SAAS,KAAK;GAChC,MAAM,QAAQ;GACd,MAAM,aAAa;GACnB;GACA,OAAO,SAAS,IAAI,QAAQ;IAC1B,IAAI,IAAI,YAAY,SAAS,IAAI,SAAS,OAAO,MAAM;KACrD;KACA;IACF;IACA;GACF;GACA,UAAU,IAAI,MAAM,YAAY,MAAM;GACtC,uBAAuB;GACvB;EACF;EAEA,IAAI,KAAK,KAAK,IAAI,KAAK,SAAS,OAAO,SAAS,KAAK;GACnD,UAAU;GACV;GACA;EACF;EAEA,IAAI,SAAS,KAAK;GAChB,UAAU;GACV;GACA,uBAAuB;GACvB;EACF;EAEA,MAAM,aAAa;EACnB,OACE,SAAS,IAAI,UACV,CAAC,KAAK,KAAK,IAAI,OAAO,KACtB,IAAI,YAAY,OAChB,IAAI,YAAY,OAChB,IAAI,YAAY,KAEnB;EAGF,MAAM,QAAQ,IAAI,MAAM,YAAY,MAAM;EAC1C,UAAU,CAAC,wBACN,MAAM,WAAW,mBAAmB,KACpC,MAAM,SAAS,IACd,GAAG,uBAAuB,MAAM,MAAM,CAA0B,MAChE;EACN,uBAAuB;CACzB;CAEA,OAAO;AACT"}
@@ -1,17 +1,16 @@
1
- import { ComponentStyle, PageMeta, TemplateNode } from "../runtime/index.js";
2
1
  import { ResuxHooks } from "../core/hooks.js";
3
-
4
- //#region src/compiler/index.d.ts
5
- interface CompileErrorLocation {
2
+ import { ResuxModuleContributions } from "../core/module-container.js";
3
+ import { ComponentStyle, PageMeta, TemplateNode } from "../runtime/index.js";
4
+ export interface CompileErrorLocation {
6
5
  file: string;
7
6
  line: number;
8
7
  column: number;
9
8
  }
10
- declare class ResuxCompileError extends Error {
9
+ export declare class ResuxCompileError extends Error {
11
10
  readonly location?: CompileErrorLocation;
12
11
  constructor(message: string, location?: CompileErrorLocation);
13
12
  }
14
- interface CompiledComponent {
13
+ export interface CompiledComponent {
15
14
  id: string;
16
15
  name: string;
17
16
  file: string;
@@ -29,7 +28,7 @@ interface CompiledComponent {
29
28
  locals: string[];
30
29
  }[];
31
30
  }
32
- interface RouteManifestRecord {
31
+ export interface RouteManifestRecord {
33
32
  id: string;
34
33
  path: string;
35
34
  file: string;
@@ -37,20 +36,20 @@ interface RouteManifestRecord {
37
36
  componentId: string;
38
37
  meta?: PageMeta;
39
38
  }
40
- interface CompiledPlugin {
39
+ export interface CompiledPlugin {
41
40
  id: string;
42
41
  file: string;
43
42
  mode: "all" | "server" | "client";
44
43
  serverSource: string;
45
44
  clientSource: string;
46
45
  }
47
- interface ClientEnhancementManifestEntry {
46
+ export interface ClientEnhancementManifestEntry {
48
47
  name: string;
49
48
  id: string;
50
49
  file: string;
51
50
  src: string;
52
51
  }
53
- interface CompiledMiddleware {
52
+ export interface CompiledMiddleware {
54
53
  id: string;
55
54
  name: string;
56
55
  file: string;
@@ -59,23 +58,23 @@ interface CompiledMiddleware {
59
58
  serverSource: string;
60
59
  clientSource: string;
61
60
  }
62
- interface CompiledServerMiddleware {
61
+ export interface CompiledServerMiddleware {
63
62
  id: string;
64
63
  file: string;
65
64
  source: string;
66
65
  }
67
- interface ServerHandlerRecord {
66
+ export interface ServerHandlerRecord {
68
67
  id: string;
69
68
  path: string;
70
69
  file: string;
71
70
  params: string[];
72
71
  source: string;
73
72
  }
74
- interface VueIslandRecord {
73
+ export interface VueIslandRecord {
75
74
  name: string;
76
75
  file: string;
77
76
  }
78
- interface RouteRuleConfig {
77
+ export interface RouteRuleConfig {
79
78
  headers?: Record<string, string>;
80
79
  redirect?: string | {
81
80
  to: string;
@@ -93,7 +92,7 @@ interface RouteRuleConfig {
93
92
  credentials?: boolean;
94
93
  };
95
94
  }
96
- interface BuildResult {
95
+ export interface BuildResult {
97
96
  appRoot: string;
98
97
  outDir: string;
99
98
  routes: RouteManifestRecord[];
@@ -106,31 +105,30 @@ interface BuildResult {
106
105
  serverHandlers: ServerHandlerRecord[];
107
106
  vueIslands: VueIslandRecord[];
108
107
  routeRules: Record<string, RouteRuleConfig>;
108
+ contributions?: ResuxModuleContributions;
109
109
  app?: CompiledComponent;
110
110
  error?: CompiledComponent;
111
111
  }
112
- interface BuildOptions {
112
+ export interface BuildOptions {
113
113
  vite?: "build" | "dev";
114
114
  server?: "bundle" | "modules";
115
115
  hooks?: ResuxHooks;
116
116
  changedPath?: string;
117
117
  traceBuild?: boolean;
118
118
  }
119
- declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
120
- declare function compileVueFile(file: string, options: {
119
+ export declare function buildProject(appRoot: string, outDir?: string, options?: BuildOptions): Promise<BuildResult>;
120
+ export declare function compileVueFile(file: string, options: {
121
121
  id: string;
122
122
  name?: string;
123
123
  outDir?: string;
124
124
  }): Promise<CompiledComponent>;
125
- declare function compileVueSource(source: string, options: {
125
+ export declare function compileVueSource(source: string, options: {
126
126
  file: string;
127
127
  id: string;
128
128
  name: string;
129
129
  outDir?: string;
130
130
  }): CompiledComponent;
131
- declare function createRouteManifest(root: string, files: string[], idByFile?: Map<string, string>, compiledByFile?: Map<string, CompiledComponent>): RouteManifestRecord[];
132
- declare function resolveFileExtension(filePath: string): string;
133
- declare function fileUrl(file: string): string;
134
- //#endregion
135
- export { BuildOptions, BuildResult, ClientEnhancementManifestEntry, CompileErrorLocation, CompiledComponent, CompiledMiddleware, CompiledPlugin, CompiledServerMiddleware, ResuxCompileError, RouteManifestRecord, RouteRuleConfig, ServerHandlerRecord, VueIslandRecord, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, resolveFileExtension };
131
+ export declare function createRouteManifest(root: string, files: string[], idByFile?: Map<string, string>, compiledByFile?: Map<string, CompiledComponent>): RouteManifestRecord[];
132
+ export declare function resolveFileExtension(filePath: string): string;
133
+ export declare function fileUrl(file: string): string;
136
134
  //# sourceMappingURL=index.d.ts.map