resuxjs 0.4.0-beta.6 → 0.4.0-beta.8

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 (405) hide show
  1. package/README.md +55 -13
  2. package/dist/_virtual/_rolldown/runtime.js +4 -0
  3. package/dist/bin.d.ts +1 -1
  4. package/dist/bin.js +2 -4
  5. package/dist/bin.js.map +1 -1
  6. package/dist/build/index.d.ts +8 -12
  7. package/dist/build/index.js +3 -4
  8. package/dist/build/index.js.map +1 -1
  9. package/dist/cli.d.ts +8 -9
  10. package/dist/cli.js +292 -163
  11. package/dist/cli.js.map +1 -1
  12. package/dist/compiler/adapter.d.ts +6 -10
  13. package/dist/compiler/adapter.js +3 -5
  14. package/dist/compiler/adapter.js.map +1 -1
  15. package/dist/compiler/dev-warnings.d.ts +5 -9
  16. package/dist/compiler/dev-warnings.js +7 -9
  17. package/dist/compiler/dev-warnings.js.map +1 -1
  18. package/dist/compiler/directives.d.ts +3 -7
  19. package/dist/compiler/directives.js +2 -4
  20. package/dist/compiler/directives.js.map +1 -1
  21. package/dist/compiler/implementation.d.ts +25 -25
  22. package/dist/compiler/implementation.js +206 -157
  23. package/dist/compiler/index.d.ts +6 -10
  24. package/dist/compiler/index.js +3 -5
  25. package/dist/compiler/index.js.map +1 -1
  26. package/dist/core/config.d.ts +5 -10
  27. package/dist/core/config.js +2 -3
  28. package/dist/core/config.js.map +1 -1
  29. package/dist/core/hooks.d.ts +15 -10
  30. package/dist/core/hooks.js +2 -3
  31. package/dist/core/hooks.js.map +1 -1
  32. package/dist/core/index.d.ts +2 -2
  33. package/dist/core/index.js +1 -2
  34. package/dist/core/module-container.d.ts +21 -26
  35. package/dist/core/module-container.js +6 -6
  36. package/dist/core/module-container.js.map +1 -1
  37. package/dist/core/resux.d.ts +4 -9
  38. package/dist/core/resux.js +2 -4
  39. package/dist/core/resux.js.map +1 -1
  40. package/dist/create-bin.d.ts +1 -1
  41. package/dist/create-bin.js +2 -4
  42. package/dist/create-bin.js.map +1 -1
  43. package/dist/create.d.ts +2 -6
  44. package/dist/create.js +119 -43
  45. package/dist/create.js.map +1 -1
  46. package/dist/deploy/cloudflare.d.ts +1 -6
  47. package/dist/deploy/cloudflare.js +2 -4
  48. package/dist/deploy/cloudflare.js.map +1 -1
  49. package/dist/deploy/common.d.ts +12 -16
  50. package/dist/deploy/common.js +2 -4
  51. package/dist/deploy/common.js.map +1 -1
  52. package/dist/deploy/framework-runtime.d.ts +1 -5
  53. package/dist/deploy/framework-runtime.js +2 -4
  54. package/dist/deploy/framework-runtime.js.map +1 -1
  55. package/dist/deploy/index.d.ts +2 -7
  56. package/dist/deploy/index.js +7 -6
  57. package/dist/deploy/index.js.map +1 -1
  58. package/dist/deploy/netlify.d.ts +1 -6
  59. package/dist/deploy/netlify.js +3 -5
  60. package/dist/deploy/netlify.js.map +1 -1
  61. package/dist/deploy/node.d.ts +1 -6
  62. package/dist/deploy/node.js +4 -5
  63. package/dist/deploy/node.js.map +1 -1
  64. package/dist/deploy/production-report.d.ts +1 -5
  65. package/dist/deploy/production-report.js +2 -4
  66. package/dist/deploy/production-report.js.map +1 -1
  67. package/dist/deploy/runtime-dependencies.d.ts +4 -8
  68. package/dist/deploy/runtime-dependencies.js +4 -5
  69. package/dist/deploy/runtime-dependencies.js.map +1 -1
  70. package/dist/deploy/static.d.ts +1 -6
  71. package/dist/deploy/static.js +2 -4
  72. package/dist/deploy/static.js.map +1 -1
  73. package/dist/deploy/types.d.ts +8 -12
  74. package/dist/deploy/types.js +1 -1
  75. package/dist/deploy/vercel.d.ts +2 -7
  76. package/dist/deploy/vercel.js +6 -8
  77. package/dist/deploy/vercel.js.map +1 -1
  78. package/dist/fonts/index.d.ts +60 -12
  79. package/dist/fonts/index.js +422 -46
  80. package/dist/fonts/index.js.map +1 -1
  81. package/dist/globals.d.ts +2 -5
  82. package/dist/globals.js +1 -1
  83. package/dist/halal-core/ai/classifyProject.d.ts +3 -8
  84. package/dist/halal-core/ai/classifyProject.js +2 -4
  85. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  86. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +1 -6
  87. package/dist/halal-core/ai/classifyRuntimeContent.js +3 -5
  88. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  89. package/dist/halal-core/ai/createProjectSummary.d.ts +2 -6
  90. package/dist/halal-core/ai/createProjectSummary.js +2 -4
  91. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  92. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +1 -5
  93. package/dist/halal-core/ai/halalClassifierPrompt.js +2 -3
  94. package/dist/halal-core/ai/redactSensitiveData.d.ts +1 -5
  95. package/dist/halal-core/ai/redactSensitiveData.js +2 -3
  96. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  97. package/dist/halal-core/ai/validateAiResponse.d.ts +1 -6
  98. package/dist/halal-core/ai/validateAiResponse.js +4 -5
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +1 -5
  101. package/dist/halal-core/cli/check.js +5 -6
  102. package/dist/halal-core/cli/check.js.map +1 -1
  103. package/dist/halal-core/cli/explain.d.ts +1 -5
  104. package/dist/halal-core/cli/explain.js +5 -6
  105. package/dist/halal-core/cli/explain.js.map +1 -1
  106. package/dist/halal-core/cli/report.d.ts +1 -5
  107. package/dist/halal-core/cli/report.js +5 -6
  108. package/dist/halal-core/cli/report.js.map +1 -1
  109. package/dist/halal-core/cli/submitReview.d.ts +1 -5
  110. package/dist/halal-core/cli/submitReview.js +5 -6
  111. package/dist/halal-core/cli/submitReview.js.map +1 -1
  112. package/dist/halal-core/cli/verifyReview.d.ts +1 -5
  113. package/dist/halal-core/cli/verifyReview.js +7 -7
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +10 -12
  116. package/dist/halal-core/config.js +46 -11
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +5 -9
  119. package/dist/halal-core/crypto/integrity.js +3 -5
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +7 -9
  122. package/dist/halal-core/enforce.js +47 -19
  123. package/dist/halal-core/enforce.js.map +1 -1
  124. package/dist/halal-core/index.d.ts +6 -6
  125. package/dist/halal-core/index.js +8 -9
  126. package/dist/halal-core/lifecycle.d.ts +1 -5
  127. package/dist/halal-core/lifecycle.js +2 -4
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +1 -6
  130. package/dist/halal-core/policy.js +2 -4
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +1 -6
  133. package/dist/halal-core/report/formatBrowserOverlay.js +2 -3
  134. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  135. package/dist/halal-core/report/formatTerminalReport.d.ts +1 -6
  136. package/dist/halal-core/report/formatTerminalReport.js +2 -3
  137. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  138. package/dist/halal-core/report/generateHalalReport.d.ts +2 -7
  139. package/dist/halal-core/report/generateHalalReport.js +8 -7
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +2 -7
  142. package/dist/halal-core/report/signReport.js +2 -4
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +4 -9
  145. package/dist/halal-core/report/verifyReport.js +4 -6
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +1 -6
  148. package/dist/halal-core/review/createReviewRequest.js +4 -5
  149. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  150. package/dist/halal-core/review/reviewPolicy.d.ts +3 -7
  151. package/dist/halal-core/review/reviewPolicy.js +2 -3
  152. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  153. package/dist/halal-core/review/signedReviewFile.d.ts +4 -9
  154. package/dist/halal-core/review/signedReviewFile.js +2 -4
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +3 -7
  157. package/dist/halal-core/review/verifyReviewApproval.js +2 -4
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +2 -6
  160. package/dist/halal-core/rules/adultContentRules.js +2 -3
  161. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +2 -6
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js +2 -3
  164. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  165. package/dist/halal-core/rules/childSafetyRules.d.ts +2 -6
  166. package/dist/halal-core/rules/childSafetyRules.js +2 -3
  167. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  168. package/dist/halal-core/rules/coreCategories.d.ts +2 -6
  169. package/dist/halal-core/rules/coreCategories.js +2 -3
  170. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  171. package/dist/halal-core/rules/cyberAbuseRules.d.ts +2 -6
  172. package/dist/halal-core/rules/cyberAbuseRules.js +2 -3
  173. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  174. package/dist/halal-core/rules/defaultBlockedRules.d.ts +2 -7
  175. package/dist/halal-core/rules/defaultBlockedRules.js +12 -11
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +3 -7
  178. package/dist/halal-core/rules/dependencyRules.js +2 -3
  179. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  180. package/dist/halal-core/rules/endpointRules.d.ts +3 -7
  181. package/dist/halal-core/rules/endpointRules.js +2 -3
  182. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  183. package/dist/halal-core/rules/environmentalHarmRules.d.ts +2 -6
  184. package/dist/halal-core/rules/environmentalHarmRules.js +2 -3
  185. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  186. package/dist/halal-core/rules/financeRibaRules.d.ts +2 -6
  187. package/dist/halal-core/rules/financeRibaRules.js +2 -3
  188. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  189. package/dist/halal-core/rules/gamblingRules.d.ts +2 -6
  190. package/dist/halal-core/rules/gamblingRules.js +2 -3
  191. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  192. package/dist/halal-core/rules/generalHarmRules.d.ts +2 -6
  193. package/dist/halal-core/rules/generalHarmRules.js +2 -3
  194. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  195. package/dist/halal-core/rules/healthHarmRules.d.ts +2 -6
  196. package/dist/halal-core/rules/healthHarmRules.js +2 -3
  197. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  198. package/dist/halal-core/rules/keywordRules.d.ts +2 -6
  199. package/dist/halal-core/rules/keywordRules.js +2 -3
  200. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  201. package/dist/halal-core/rules/privacyAbuseRules.d.ts +2 -6
  202. package/dist/halal-core/rules/privacyAbuseRules.js +2 -3
  203. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  204. package/dist/halal-core/rules/scamFraudRules.d.ts +2 -6
  205. package/dist/halal-core/rules/scamFraudRules.js +2 -3
  206. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  207. package/dist/halal-core/rules/selfHarmRules.d.ts +2 -6
  208. package/dist/halal-core/rules/selfHarmRules.js +2 -3
  209. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  210. package/dist/halal-core/rules/violenceExtremismRules.d.ts +2 -6
  211. package/dist/halal-core/rules/violenceExtremismRules.js +2 -3
  212. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  213. package/dist/halal-core/runtime/guard.d.ts +3 -8
  214. package/dist/halal-core/runtime/guard.js +5 -7
  215. package/dist/halal-core/runtime/guard.js.map +1 -1
  216. package/dist/halal-core/runtime/index.js +1 -2
  217. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -9
  218. package/dist/halal-core/runtime/reviewedMemory.js +3 -5
  219. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  220. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +5 -10
  221. package/dist/halal-core/runtime/serializeRuntimeContent.js +4 -6
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  223. package/dist/halal-core/runtime/types.d.ts +10 -15
  224. package/dist/halal-core/runtime/types.js +1 -1
  225. package/dist/halal-core/scanner/scanApiRoutes.d.ts +1 -5
  226. package/dist/halal-core/scanner/scanApiRoutes.js +2 -4
  227. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  228. package/dist/halal-core/scanner/scanComponents.d.ts +1 -5
  229. package/dist/halal-core/scanner/scanComponents.js +2 -4
  230. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  231. package/dist/halal-core/scanner/scanContent.d.ts +2 -6
  232. package/dist/halal-core/scanner/scanContent.js +4 -6
  233. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  234. package/dist/halal-core/scanner/scanDependencies.d.ts +1 -5
  235. package/dist/halal-core/scanner/scanDependencies.js +2 -4
  236. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  237. package/dist/halal-core/scanner/scanDomains.d.ts +2 -6
  238. package/dist/halal-core/scanner/scanDomains.js +2 -3
  239. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  240. package/dist/halal-core/scanner/scanEnvNames.d.ts +1 -5
  241. package/dist/halal-core/scanner/scanEnvNames.js +2 -4
  242. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  243. package/dist/halal-core/scanner/scanMetadata.d.ts +2 -6
  244. package/dist/halal-core/scanner/scanMetadata.js +2 -4
  245. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  246. package/dist/halal-core/scanner/scanPages.d.ts +1 -5
  247. package/dist/halal-core/scanner/scanPages.js +2 -4
  248. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  249. package/dist/halal-core/scanner/scanProject.d.ts +3 -8
  250. package/dist/halal-core/scanner/scanProject.js +2 -4
  251. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  252. package/dist/halal-core/scanner/scanRoutes.d.ts +1 -5
  253. package/dist/halal-core/scanner/scanRoutes.js +2 -4
  254. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  255. package/dist/halal-core/scanner/scanTranslations.d.ts +1 -5
  256. package/dist/halal-core/scanner/scanTranslations.js +2 -4
  257. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  258. package/dist/halal-core/status.d.ts +3 -7
  259. package/dist/halal-core/status.js +1 -1
  260. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +1 -5
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.js +2 -4
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  263. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +1 -5
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.js +2 -3
  265. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  266. package/dist/halal-core/tamper/verifyReportSignature.d.ts +2 -7
  267. package/dist/halal-core/tamper/verifyReportSignature.js +4 -5
  268. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  269. package/dist/halal.d.ts +2 -2
  270. package/dist/halal.js +2 -3
  271. package/dist/head/utils.d.ts +15 -0
  272. package/dist/head/utils.js +52 -0
  273. package/dist/head/utils.js.map +1 -0
  274. package/dist/i18n/index.d.ts +11 -15
  275. package/dist/i18n/index.js +9 -9
  276. package/dist/i18n/index.js.map +1 -1
  277. package/dist/i18n/shared.d.ts +15 -19
  278. package/dist/i18n/shared.js +5 -6
  279. package/dist/i18n/shared.js.map +1 -1
  280. package/dist/icons/api-fetcher.d.ts +3 -0
  281. package/dist/icons/api-fetcher.js +77 -0
  282. package/dist/icons/api-fetcher.js.map +1 -0
  283. package/dist/icons/cache.d.ts +21 -0
  284. package/dist/icons/cache.js +74 -0
  285. package/dist/icons/cache.js.map +1 -0
  286. package/dist/icons/component.d.ts +156 -0
  287. package/dist/icons/component.js +139 -0
  288. package/dist/icons/component.js.map +1 -0
  289. package/dist/icons/constants.d.ts +13 -0
  290. package/dist/icons/constants.js +16 -0
  291. package/dist/icons/constants.js.map +1 -0
  292. package/dist/icons/css-mode.d.ts +6 -0
  293. package/dist/icons/css-mode.js +51 -0
  294. package/dist/icons/css-mode.js.map +1 -0
  295. package/dist/icons/index.d.ts +14 -153
  296. package/dist/icons/index.js +30 -286
  297. package/dist/icons/index.js.map +1 -1
  298. package/dist/icons/local-svg.d.ts +4 -0
  299. package/dist/icons/local-svg.js +53 -0
  300. package/dist/icons/local-svg.js.map +1 -0
  301. package/dist/icons/normalize.d.ts +4 -0
  302. package/dist/icons/normalize.js +63 -0
  303. package/dist/icons/normalize.js.map +1 -0
  304. package/dist/icons/offline-loader.d.ts +20 -0
  305. package/dist/icons/offline-loader.js +94 -0
  306. package/dist/icons/offline-loader.js.map +1 -0
  307. package/dist/icons/parser.d.ts +4 -0
  308. package/dist/icons/parser.js +89 -0
  309. package/dist/icons/parser.js.map +1 -0
  310. package/dist/icons/registry.d.ts +6 -22
  311. package/dist/icons/registry.js +82 -75
  312. package/dist/icons/registry.js.map +1 -1
  313. package/dist/icons/resolver.d.ts +3 -0
  314. package/dist/icons/resolver.js +45 -0
  315. package/dist/icons/resolver.js.map +1 -0
  316. package/dist/icons/svg-mode.d.ts +3 -0
  317. package/dist/icons/svg-mode.js +54 -0
  318. package/dist/icons/svg-mode.js.map +1 -0
  319. package/dist/icons/transform.d.ts +10 -0
  320. package/dist/icons/transform.js +68 -0
  321. package/dist/icons/transform.js.map +1 -0
  322. package/dist/icons/types.d.ts +48 -0
  323. package/dist/icons/types.js +1 -0
  324. package/dist/index.d.ts +4 -2
  325. package/dist/index.js +3 -3
  326. package/dist/kit/index.d.ts +21 -26
  327. package/dist/kit/index.js +2 -4
  328. package/dist/kit/index.js.map +1 -1
  329. package/dist/nitro-server/index.d.ts +2 -6
  330. package/dist/nitro-server/index.js +2 -3
  331. package/dist/nitro-server/index.js.map +1 -1
  332. package/dist/node.d.ts +2 -7
  333. package/dist/node.js +7 -9
  334. package/dist/node.js.map +1 -1
  335. package/dist/reactivity/computed.d.ts +3 -8
  336. package/dist/reactivity/computed.js +4 -5
  337. package/dist/reactivity/computed.js.map +1 -1
  338. package/dist/reactivity/effect.d.ts +14 -18
  339. package/dist/reactivity/effect.js +18 -13
  340. package/dist/reactivity/effect.js.map +1 -1
  341. package/dist/reactivity/index.d.ts +1 -1
  342. package/dist/reactivity/index.js +3 -4
  343. package/dist/reactivity/reactive.d.ts +5 -9
  344. package/dist/reactivity/reactive.js +225 -17
  345. package/dist/reactivity/reactive.js.map +1 -1
  346. package/dist/reactivity/readonly.js +1 -3
  347. package/dist/reactivity/ref.d.ts +9 -13
  348. package/dist/reactivity/ref.js +6 -5
  349. package/dist/reactivity/ref.js.map +1 -1
  350. package/dist/reactivity/scheduler.d.ts +5 -8
  351. package/dist/reactivity/scheduler.js +4 -3
  352. package/dist/reactivity/scheduler.js.map +1 -1
  353. package/dist/reactivity/types.d.ts +12 -16
  354. package/dist/reactivity/types.js +1 -1
  355. package/dist/reactivity/utils.d.ts +9 -13
  356. package/dist/reactivity/utils.js +2 -3
  357. package/dist/reactivity/utils.js.map +1 -1
  358. package/dist/reactivity/watch.d.ts +3 -7
  359. package/dist/reactivity/watch.js +7 -7
  360. package/dist/reactivity/watch.js.map +1 -1
  361. package/dist/runtime/core.d.ts +4 -21
  362. package/dist/runtime/core.js +11 -24
  363. package/dist/runtime/core.js.map +1 -1
  364. package/dist/runtime/index.d.ts +180 -159
  365. package/dist/runtime/index.js +3205 -1080
  366. package/dist/runtime/index.js.map +1 -1
  367. package/dist/runtime/reactivity.d.ts +4 -4
  368. package/dist/runtime/reactivity.js +2 -3
  369. package/dist/runtime/resume.d.ts +14 -52
  370. package/dist/runtime/resume.js +4 -34
  371. package/dist/runtime/resume.js.map +1 -1
  372. package/dist/runtime/router.d.ts +5 -18
  373. package/dist/runtime/router.js +7 -17
  374. package/dist/runtime/router.js.map +1 -1
  375. package/dist/runtime/streaming.d.ts +6 -14
  376. package/dist/runtime/streaming.js +4 -9
  377. package/dist/runtime/streaming.js.map +1 -1
  378. package/dist/runtime/view-transitions/detect.d.ts +10 -0
  379. package/dist/runtime/view-transitions/detect.js +16 -0
  380. package/dist/runtime/view-transitions/detect.js.map +1 -0
  381. package/dist/runtime/view-transitions/index.d.ts +4 -0
  382. package/dist/runtime/view-transitions/index.js +3 -0
  383. package/dist/runtime/view-transitions/transition.d.ts +3 -0
  384. package/dist/runtime/view-transitions/transition.js +41 -0
  385. package/dist/runtime/view-transitions/transition.js.map +1 -0
  386. package/dist/runtime/view-transitions/types.d.ts +7 -0
  387. package/dist/runtime/view-transitions/types.js +1 -0
  388. package/dist/security/media-fetch.d.ts +11 -15
  389. package/dist/security/media-fetch.js +5 -7
  390. package/dist/security/media-fetch.js.map +1 -1
  391. package/dist/security/path-boundary.d.ts +4 -8
  392. package/dist/security/path-boundary.js +12 -8
  393. package/dist/security/path-boundary.js.map +1 -1
  394. package/dist/ui/index.d.ts +378 -229
  395. package/dist/ui/index.js +199 -152
  396. package/dist/ui/index.js.map +1 -1
  397. package/dist/ui/verification-code.d.ts +133 -0
  398. package/dist/ui/verification-code.js +472 -0
  399. package/dist/ui/verification-code.js.map +1 -0
  400. package/dist/vite-builder/index.d.ts +2 -6
  401. package/dist/vite-builder/index.js +2 -3
  402. package/dist/vite-builder/index.js.map +1 -1
  403. package/package.json +5 -2
  404. package/templates/default/.env.example +3 -0
  405. package/templates/default/nitro.config.ts +16 -4
@@ -1,9 +1,11 @@
1
- import { ResuxModuleContainer } from "../core/module-container.js";
1
+ import { __require } from "../_virtual/_rolldown/runtime.js";
2
2
  import { createResux } from "../core/resux.js";
3
+ import { cspDirectiveSources } from "../head/utils.js";
4
+ import { ResuxModuleContainer } from "../core/module-container.js";
3
5
  import { buildLocalePath, normalizeI18nRuntimeConfig } from "../i18n/shared.js";
4
- import { getClientRuntimeSource } from "../runtime/index.js";
5
6
  import { withResuxKitContext } from "../kit/index.js";
6
- import { createRequire } from "node:module";
7
+ import { isPathWithinBoundary } from "../security/path-boundary.js";
8
+ import { getClientRuntimeSource } from "../runtime/index.js";
7
9
  import { existsSync, mkdirSync, statSync, writeFileSync } from "node:fs";
8
10
  import { mkdir, readFile, readdir, rm, stat, writeFile } from "node:fs/promises";
9
11
  import path from "node:path";
@@ -14,9 +16,7 @@ import { NodeTypes, parse } from "@vue/compiler-dom";
14
16
  import { compileStyle, parse as parse$1 } from "@vue/compiler-sfc";
15
17
  import vuePlugin from "@vitejs/plugin-vue";
16
18
  import { build } from "vite";
17
-
18
- //#region src/compiler/index.ts
19
- const require = createRequire(import.meta.url);
19
+ // src/compiler/index.ts
20
20
  var ResuxCompileError = class extends Error {
21
21
  location;
22
22
  constructor(message, location) {
@@ -25,7 +25,7 @@ var ResuxCompileError = class extends Error {
25
25
  this.location = location;
26
26
  }
27
27
  };
28
- const RESUMABLE_HANDLER_ALLOWED_GLOBALS = new Set([
28
+ const RESUMABLE_HANDLER_ALLOWED_GLOBALS = /* @__PURE__ */ new Set([
29
29
  "Math",
30
30
  "Number",
31
31
  "String",
@@ -39,6 +39,14 @@ const RESUMABLE_HANDLER_ALLOWED_GLOBALS = new Set([
39
39
  "console",
40
40
  "undefined",
41
41
  "globalThis",
42
+ "window",
43
+ "document",
44
+ "navigator",
45
+ "localStorage",
46
+ "sessionStorage",
47
+ "location",
48
+ "history",
49
+ "alert",
42
50
  "performance",
43
51
  "fetch",
44
52
  "Headers",
@@ -358,8 +366,8 @@ async function buildProject(appRoot, outDir = path.join(appRoot, ".resux"), opti
358
366
  const layouts = layoutFiles.map((file) => compiledByFile.get(file));
359
367
  const plugins = unique(pluginFiles).sort((left, right) => normalizePath(left).localeCompare(normalizePath(right))).map((file, pluginIndex) => {
360
368
  const compiled = compilePluginFile(file, pluginIndex);
361
- const mode$1 = pluginModeByFile.get(file);
362
- if (mode$1) compiled.mode = mode$1;
369
+ const mode = pluginModeByFile.get(file);
370
+ if (mode) compiled.mode = mode;
363
371
  return compiled;
364
372
  });
365
373
  const clientEnhancements = plugins.filter((plugin) => plugin.mode !== "server" && clientEnhancementFileSet.has(normalizePath(path.resolve(plugin.file)))).map((plugin) => ({
@@ -539,6 +547,7 @@ async function buildProject(appRoot, outDir = path.join(appRoot, ".resux"), opti
539
547
  serverHandlers,
540
548
  vueIslands,
541
549
  routeRules,
550
+ contributions,
542
551
  app,
543
552
  error
544
553
  };
@@ -686,8 +695,7 @@ async function buildServerBundle(root, outDir) {
686
695
  }
687
696
  async function buildClientAssets(root, outDir, components, plugins, middleware, vueIslands, packageRegistry, hooks, contributions) {
688
697
  const inputRoot = path.join(outDir, "vite-client");
689
- const runtimeInput = await writeViteClientRuntime(outDir, packageRegistry);
690
- const input = { "runtime-client": runtimeInput };
698
+ const input = { "runtime-client": await writeViteClientRuntime(outDir, packageRegistry) };
691
699
  for (const component of components) input[`handlers/${component.id}`] = path.join(inputRoot, "handlers", `${component.id}.mjs`);
692
700
  for (const plugin of plugins.filter((entry) => entry.mode !== "server")) input[`plugins/${plugin.id}`] = path.join(inputRoot, "plugins", `${plugin.id}.mjs`);
693
701
  for (const entry of middleware.filter((candidate) => candidate.mode !== "server")) input[`middleware/${entry.id}`] = path.join(inputRoot, "middleware", `${entry.id}.mjs`);
@@ -703,7 +711,7 @@ async function buildClientAssets(root, outDir, components, plugins, middleware,
703
711
  logLevel: "warn",
704
712
  plugins: [vuePlugin(), ...contributions?.vitePlugins ?? []],
705
713
  resolve: { alias: {
706
- vue: require.resolve("vue"),
714
+ vue: __require.resolve("vue"),
707
715
  "@": normalizePath(root),
708
716
  "~": normalizePath(root)
709
717
  } },
@@ -789,6 +797,8 @@ function compileVueSource(source, options) {
789
797
  name: options.name,
790
798
  file: options.file,
791
799
  template: template.nodes,
800
+ templateRefs: template.templateRefs,
801
+ templateForRefs: template.templateForRefs,
792
802
  analysis,
793
803
  styles: compiledStyles.styles,
794
804
  styleScopeId: compiledStyles.styleScopeId,
@@ -801,6 +811,8 @@ function compileVueSource(source, options) {
801
811
  name: options.name,
802
812
  file: options.file,
803
813
  template: template.nodes,
814
+ templateRefs: template.templateRefs,
815
+ templateForRefs: template.templateForRefs,
804
816
  analysis,
805
817
  styles: compiledStyles.styles,
806
818
  styleScopeId: compiledStyles.styleScopeId,
@@ -815,6 +827,8 @@ function compileVueSource(source, options) {
815
827
  serverSource,
816
828
  clientSource,
817
829
  template: template.nodes,
830
+ templateRefs: template.templateRefs,
831
+ templateForRefs: template.templateForRefs,
818
832
  handlers: [...new Set(template.handlers.map((event) => event.handler))],
819
833
  styles: compiledStyles.styles,
820
834
  styleScopeId: compiledStyles.styleScopeId,
@@ -932,11 +946,21 @@ function readRuntimeI18nConfig(runtimeConfig) {
932
946
  const i18n = publicConfig.i18n;
933
947
  return normalizeI18nRuntimeConfig(i18n);
934
948
  }
949
+ function collectTemplateForRefs(nodes, insideFor = false, out = /* @__PURE__ */ new Set()) {
950
+ for (const node of nodes) {
951
+ if (!node || node.type !== "element") continue;
952
+ const nowInsideFor = insideFor || Boolean(node.for);
953
+ if (nowInsideFor && node.ref) out.add(node.ref);
954
+ if (Array.isArray(node.children)) collectTemplateForRefs(node.children, nowInsideFor, out);
955
+ }
956
+ return out;
957
+ }
935
958
  function compileTemplate(template, file, templateRefBindings = /* @__PURE__ */ new Set()) {
936
959
  const ast = parse(template, { comments: false });
937
960
  const state = {
938
961
  file,
939
962
  templateRefBindings,
963
+ templateRefs: /* @__PURE__ */ new Set(),
940
964
  bindingIndex: 0,
941
965
  inlineHandlerIndex: 0,
942
966
  handlers: [],
@@ -945,12 +969,15 @@ function compileTemplate(template, file, templateRefBindings = /* @__PURE__ */ n
945
969
  activeLocals: [],
946
970
  allLocals: /* @__PURE__ */ new Set()
947
971
  };
972
+ const nodes = compileTemplateChildren(ast.children, state);
948
973
  return {
949
- nodes: compileTemplateChildren(ast.children, state),
974
+ nodes,
950
975
  handlers: state.handlers,
951
976
  inlineHandlers: state.inlineHandlers,
952
977
  expressions: state.expressions,
953
- allLocals: Array.from(state.allLocals)
978
+ allLocals: Array.from(state.allLocals),
979
+ templateRefs: Array.from(state.templateRefs),
980
+ templateForRefs: Array.from(collectTemplateForRefs(nodes))
954
981
  };
955
982
  }
956
983
  function compileTemplateChildren(children, state) {
@@ -961,30 +988,30 @@ function compileTemplateChildren(children, state) {
961
988
  const conditionalDirective = resolveConditionalDirective(child, state);
962
989
  if (!conditionalDirective) {
963
990
  conditionalChainExpressions = null;
964
- const compiledNode$2 = compileTemplateNode(child, state);
965
- if (compiledNode$2) nodes.push(compiledNode$2);
991
+ const compiledNode = compileTemplateNode(child, state);
992
+ if (compiledNode) nodes.push(compiledNode);
966
993
  continue;
967
994
  }
968
995
  if (conditionalDirective.kind === "if") {
969
996
  const expressionResult = transformTemplateExpressionCode(conditionalDirective.expression, state.templateRefBindings, state.file, conditionalDirective.directive);
970
997
  conditionalChainExpressions = [expressionResult.transformed];
971
- const compiledNode$2 = compileTemplateNode(child, state, { ifExpressionOverride: expressionResult.transformed });
972
- if (compiledNode$2) nodes.push(compiledNode$2);
998
+ const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expressionResult.transformed });
999
+ if (compiledNode) nodes.push(compiledNode);
973
1000
  continue;
974
1001
  }
975
1002
  if (!conditionalChainExpressions || conditionalChainExpressions.length === 0) throw new ResuxCompileError(`v-${conditionalDirective.kind} must follow a sibling with v-if or v-else-if.`, locationFromVueNode(state.file, conditionalDirective.directive));
976
1003
  if (conditionalDirective.kind === "else-if") {
977
1004
  const branchExpressionResult = transformTemplateExpressionCode(conditionalDirective.expression, state.templateRefBindings, state.file, conditionalDirective.directive);
978
- const expression$1 = `${buildConditionalChainGuard(conditionalChainExpressions)} && (${branchExpressionResult.transformed})`;
1005
+ const expression = `${buildConditionalChainGuard(conditionalChainExpressions)} && (${branchExpressionResult.transformed})`;
979
1006
  conditionalChainExpressions.push(branchExpressionResult.transformed);
980
- const compiledNode$2 = compileTemplateNode(child, state, { ifExpressionOverride: expression$1 });
981
- if (compiledNode$2) nodes.push(compiledNode$2);
1007
+ const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });
1008
+ if (compiledNode) nodes.push(compiledNode);
982
1009
  continue;
983
1010
  }
984
1011
  const expression = buildConditionalChainGuard(conditionalChainExpressions);
985
1012
  conditionalChainExpressions = null;
986
- const compiledNode$1 = compileTemplateNode(child, state, { ifExpressionOverride: expression });
987
- if (compiledNode$1) nodes.push(compiledNode$1);
1013
+ const compiledNode = compileTemplateNode(child, state, { ifExpressionOverride: expression });
1014
+ if (compiledNode) nodes.push(compiledNode);
988
1015
  continue;
989
1016
  }
990
1017
  if (child.type !== NodeTypes.TEXT || child.content.trim().length > 0) conditionalChainExpressions = null;
@@ -1067,6 +1094,13 @@ function compileTemplateNode(node, state, options = {}) {
1067
1094
  };
1068
1095
  for (const prop of node.props) {
1069
1096
  if (prop.type === NodeTypes.ATTRIBUTE) {
1097
+ if (prop.name === "ref" && prop.value?.content) {
1098
+ const refName = prop.value.content.trim();
1099
+ if (refName) {
1100
+ state.templateRefs.add(refName);
1101
+ element.ref = refName;
1102
+ }
1103
+ }
1070
1104
  attrs.push({
1071
1105
  kind: "static",
1072
1106
  name: prop.name,
@@ -1077,27 +1111,36 @@ function compileTemplateNode(node, state, options = {}) {
1077
1111
  if (prop.type !== NodeTypes.DIRECTIVE) continue;
1078
1112
  if (prop.name === "bind") {
1079
1113
  const arg = expressionContent(prop.arg);
1080
- const expression$1 = expressionContent(prop.exp);
1081
- if (!arg || !expression$1) throw new ResuxCompileError("Dynamic bindings need an argument and expression.", locationFromVueNode(state.file, prop));
1114
+ const expression = expressionContent(prop.exp);
1115
+ if (!arg || !expression) throw new ResuxCompileError("Dynamic bindings need an argument and expression.", locationFromVueNode(state.file, prop));
1116
+ if (arg === "ref") {
1117
+ const trimmed = expression.trim();
1118
+ const quotedMatch = /^(['"`])([\s\S]*)\1$/.exec(trimmed);
1119
+ const staticRefName = quotedMatch ? quotedMatch[2].trim() : /^[A-Za-z_$][\w$]*$/.test(trimmed) ? trimmed : "";
1120
+ if (staticRefName) {
1121
+ state.templateRefs.add(staticRefName);
1122
+ element.ref = staticRefName;
1123
+ }
1124
+ }
1082
1125
  attrs.push({
1083
1126
  kind: "dynamic",
1084
1127
  name: arg,
1085
- value: registerTemplateExpression(expression$1, state.templateRefBindings, state.file, prop, state),
1128
+ value: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
1086
1129
  bindingId: nextBindingId(state)
1087
1130
  });
1088
1131
  continue;
1089
1132
  }
1090
1133
  if (prop.name === "on") {
1091
1134
  const arg = expressionContent(prop.arg);
1092
- const expression$1 = expressionContent(prop.exp);
1135
+ const expression = expressionContent(prop.exp);
1093
1136
  const modifiers = normalizeEventModifiers(prop.modifiers ?? [], state.file, prop);
1094
- if (!arg || !expression$1) throw new ResuxCompileError("Events need an argument and expression.", locationFromVueNode(state.file, prop));
1095
- const isSimpleIdentifier = /^[A-Za-z_$][\w$]*$/.test(expression$1);
1096
- if (isSimpleIdentifier && state.activeLocals.includes(expression$1)) throw new ResuxCompileError(`Direct template-local event handler "${expression$1}" cannot be resumed because template locals are serialized by value. Call a top-level handler with serializable local data instead.`, locationFromVueNode(state.file, prop));
1097
- const inlineHandler = !isSimpleIdentifier ? createInlineEventHandler(expression$1, state, prop) : null;
1137
+ if (!arg || !expression) throw new ResuxCompileError("Events need an argument and expression.", locationFromVueNode(state.file, prop));
1138
+ const isSimpleIdentifier = /^[A-Za-z_$][\w$]*$/.test(expression);
1139
+ if (isSimpleIdentifier && state.activeLocals.includes(expression)) throw new ResuxCompileError(`Direct template-local event handler "${expression}" cannot be resumed because template locals are serialized by value. Call a top-level handler with serializable local data instead.`, locationFromVueNode(state.file, prop));
1140
+ const inlineHandler = !isSimpleIdentifier ? createInlineEventHandler(expression, state, prop) : null;
1098
1141
  const event = {
1099
1142
  name: arg,
1100
- handler: inlineHandler?.name ?? expression$1,
1143
+ handler: inlineHandler?.name ?? expression,
1101
1144
  modifiers,
1102
1145
  ...inlineHandler?.locals.length ? { locals: inlineHandler.locals } : {}
1103
1146
  };
@@ -1107,10 +1150,10 @@ function compileTemplateNode(node, state, options = {}) {
1107
1150
  }
1108
1151
  if (prop.name === "if") {
1109
1152
  if (options.ifExpressionOverride) continue;
1110
- const expression$1 = expressionContent(prop.exp);
1111
- if (!expression$1) throw new ResuxCompileError("v-if needs an expression.", locationFromVueNode(state.file, prop));
1153
+ const expression = expressionContent(prop.exp);
1154
+ if (!expression) throw new ResuxCompileError("v-if needs an expression.", locationFromVueNode(state.file, prop));
1112
1155
  element.if = {
1113
- expression: registerTemplateExpression(expression$1, state.templateRefBindings, state.file, prop, state),
1156
+ expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
1114
1157
  blockId: nextBindingId(state)
1115
1158
  };
1116
1159
  continue;
@@ -1120,50 +1163,50 @@ function compileTemplateNode(node, state, options = {}) {
1120
1163
  throw new ResuxCompileError(`v-${prop.name} must follow a sibling with v-if or v-else-if.`, locationFromVueNode(state.file, prop));
1121
1164
  }
1122
1165
  if (prop.name === "for") {
1123
- const expression$1 = expressionContent(prop.exp);
1124
- if (!expression$1) throw new ResuxCompileError("v-for needs an expression.", locationFromVueNode(state.file, prop));
1125
- element.for = parseForExpression(expression$1, state.file, prop, state);
1166
+ const expression = expressionContent(prop.exp);
1167
+ if (!expression) throw new ResuxCompileError("v-for needs an expression.", locationFromVueNode(state.file, prop));
1168
+ element.for = parseForExpression(expression, state.file, prop, state);
1126
1169
  element.for.source = registerTemplateExpression(element.for.source, state.templateRefBindings, state.file, prop, state);
1127
1170
  continue;
1128
1171
  }
1129
1172
  if (prop.name === "show") {
1130
- const expression$1 = expressionContent(prop.exp);
1131
- if (!expression$1) throw new ResuxCompileError("v-show needs an expression.", locationFromVueNode(state.file, prop));
1173
+ const expression = expressionContent(prop.exp);
1174
+ if (!expression) throw new ResuxCompileError("v-show needs an expression.", locationFromVueNode(state.file, prop));
1132
1175
  attrs.push({
1133
1176
  kind: "dynamic",
1134
1177
  name: "hidden",
1135
- value: registerRawTemplateExpression(`!(${transformTemplateExpressionCode(expression$1, state.templateRefBindings, state.file, prop).transformed})`, expression$1, transformTemplateExpressionCode(expression$1, state.templateRefBindings, state.file, prop).identifiers, state),
1178
+ value: registerRawTemplateExpression(`!(${transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).transformed})`, expression, transformTemplateExpressionCode(expression, state.templateRefBindings, state.file, prop).identifiers, state),
1136
1179
  bindingId: nextBindingId(state)
1137
1180
  });
1138
1181
  continue;
1139
1182
  }
1140
1183
  if (prop.name === "text") {
1141
- const expression$1 = expressionContent(prop.exp);
1142
- if (!expression$1) throw new ResuxCompileError("v-text needs an expression.", locationFromVueNode(state.file, prop));
1184
+ const expression = expressionContent(prop.exp);
1185
+ if (!expression) throw new ResuxCompileError("v-text needs an expression.", locationFromVueNode(state.file, prop));
1143
1186
  element.children = [{
1144
1187
  type: "interpolation",
1145
- expression: registerTemplateExpression(expression$1, state.templateRefBindings, state.file, prop, state),
1188
+ expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
1146
1189
  bindingId: nextBindingId(state)
1147
1190
  }];
1148
1191
  continue;
1149
1192
  }
1150
1193
  if (prop.name === "html") {
1151
- const expression$1 = expressionContent(prop.exp);
1152
- if (!expression$1) throw new ResuxCompileError("v-html needs an expression.", locationFromVueNode(state.file, prop));
1194
+ const expression = expressionContent(prop.exp);
1195
+ if (!expression) throw new ResuxCompileError("v-html needs an expression.", locationFromVueNode(state.file, prop));
1153
1196
  element.html = {
1154
- expression: registerTemplateExpression(expression$1, state.templateRefBindings, state.file, prop, state),
1197
+ expression: registerTemplateExpression(expression, state.templateRefBindings, state.file, prop, state),
1155
1198
  bindingId: nextBindingId(state)
1156
1199
  };
1157
1200
  element.children = [];
1158
1201
  continue;
1159
1202
  }
1160
1203
  if (prop.name === "model") {
1161
- const expression$1 = expressionContent(prop.exp);
1162
- if (!expression$1) throw new ResuxCompileError("v-model needs an expression.", locationFromVueNode(state.file, prop));
1163
- if (!isAssignableExpression(expression$1)) throw new ResuxCompileError("v-model needs an assignable expression like \"message.value\".", locationFromVueNode(state.file, prop));
1164
- const assignmentRoot = assignableExpressionRoot(expression$1);
1204
+ const expression = expressionContent(prop.exp);
1205
+ if (!expression) throw new ResuxCompileError("v-model needs an expression.", locationFromVueNode(state.file, prop));
1206
+ if (!isAssignableExpression(expression)) throw new ResuxCompileError("v-model needs an assignable expression like \"message.value\".", locationFromVueNode(state.file, prop));
1207
+ const assignmentRoot = assignableExpressionRoot(expression);
1165
1208
  if (assignmentRoot && state.activeLocals.includes(assignmentRoot)) throw new ResuxCompileError(`v-model cannot assign through template-local binding "${assignmentRoot}" because resumed event locals are serialized by value. Bind v-model to resumable component state instead.`, locationFromVueNode(state.file, prop));
1166
- const model = createModelBinding(node.tag, node.props, expression$1, state, prop);
1209
+ const model = createModelBinding(node.tag, node.props, expression, state, prop);
1167
1210
  attrs.push({
1168
1211
  kind: "dynamic",
1169
1212
  name: model.attribute,
@@ -1336,7 +1379,7 @@ function assignableExpressionRoot(expression) {
1336
1379
  }
1337
1380
  function normalizeEventModifiers(modifiers, file, node) {
1338
1381
  const modifierNames = modifiers.map((modifier) => String(modifier.content));
1339
- const supported = new Set([
1382
+ const supported = /* @__PURE__ */ new Set([
1340
1383
  "prevent",
1341
1384
  "stop",
1342
1385
  "self",
@@ -1430,7 +1473,7 @@ function findProjectRoot(startFile) {
1430
1473
  }
1431
1474
  return path.dirname(startFile);
1432
1475
  }
1433
- const IMAGE_VIDEO_FONT_EXTENSIONS = new Set([
1476
+ const IMAGE_VIDEO_FONT_EXTENSIONS = /* @__PURE__ */ new Set([
1434
1477
  ".webp",
1435
1478
  ".png",
1436
1479
  ".jpg",
@@ -1448,7 +1491,7 @@ const IMAGE_VIDEO_FONT_EXTENSIONS = new Set([
1448
1491
  ".ttf",
1449
1492
  ".eot"
1450
1493
  ]);
1451
- const STYLESHEET_EXTENSIONS = new Set([
1494
+ const STYLESHEET_EXTENSIONS = /* @__PURE__ */ new Set([
1452
1495
  ".css",
1453
1496
  ".scss",
1454
1497
  ".sass",
@@ -1481,11 +1524,11 @@ function ensureCompiledUserModule(resolvedFile, projectRoot, outDir, compiledSet
1481
1524
  if (ext === ".ts" || ext === ".tsx" || ext === ".js" || ext === ".jsx") {
1482
1525
  const compiledTarget = ensureCompiledUserModule(resolvedImported, projectRoot, outDir, compiledSet);
1483
1526
  const relativeToCompiled = path.relative(path.dirname(targetJsFile), compiledTarget);
1484
- const relativeImportPath$1 = relativeToCompiled.startsWith(".") ? relativeToCompiled.replace(/\\/g, "/") : "./" + relativeToCompiled.replace(/\\/g, "/");
1527
+ const relativeImportPath = relativeToCompiled.startsWith(".") ? relativeToCompiled.replace(/\\/g, "/") : "./" + relativeToCompiled.replace(/\\/g, "/");
1485
1528
  replacements.push({
1486
1529
  start: specifier.getStart(sourceFile),
1487
1530
  end: specifier.getEnd(),
1488
- replacement: JSON.stringify(relativeImportPath$1)
1531
+ replacement: JSON.stringify(relativeImportPath)
1489
1532
  });
1490
1533
  }
1491
1534
  }
@@ -1517,41 +1560,45 @@ function processImportDeclaration(statement, sourceFile, file, client, outDir) {
1517
1560
  const isRelative = importPath.startsWith(".");
1518
1561
  const isAlias = importPath.startsWith("@/") || importPath.startsWith("~/");
1519
1562
  const ext = path.extname(importPath).toLowerCase();
1520
- if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) if (client) {
1521
- if (isRelative) {
1522
- const normalized = fileUrl(path.resolve(path.dirname(file), importPath));
1523
- const fullText = statement.getFullText(sourceFile);
1524
- const start = specifier.getStart(sourceFile) - statement.getFullStart();
1525
- const end = specifier.getEnd() - statement.getFullStart();
1526
- return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1527
- }
1528
- if (isAlias) {
1563
+ if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {
1564
+ if (client) {
1565
+ if (isRelative) {
1566
+ const normalized = fileUrl(path.resolve(path.dirname(file), importPath));
1567
+ const fullText = statement.getFullText(sourceFile);
1568
+ const start = specifier.getStart(sourceFile) - statement.getFullStart();
1569
+ const end = specifier.getEnd() - statement.getFullStart();
1570
+ return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1571
+ }
1572
+ if (isAlias) {
1573
+ const projectRoot = findProjectRoot(file);
1574
+ const normalized = fileUrl(path.resolve(projectRoot, importPath.slice(2)));
1575
+ const fullText = statement.getFullText(sourceFile);
1576
+ const start = specifier.getStart(sourceFile) - statement.getFullStart();
1577
+ const end = specifier.getEnd() - statement.getFullStart();
1578
+ return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1579
+ }
1580
+ return statement.getFullText(sourceFile);
1581
+ } else {
1582
+ if (STYLESHEET_EXTENSIONS.has(ext)) return "";
1529
1583
  const projectRoot = findProjectRoot(file);
1530
- const normalized = fileUrl(path.resolve(projectRoot, importPath.slice(2)));
1531
- const fullText = statement.getFullText(sourceFile);
1532
- const start = specifier.getStart(sourceFile) - statement.getFullStart();
1533
- const end = specifier.getEnd() - statement.getFullStart();
1534
- return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1584
+ let absolutePath = "";
1585
+ if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
1586
+ else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
1587
+ else absolutePath = importPath;
1588
+ let webPath = importPath;
1589
+ const relativeToRoot = path.relative(projectRoot, absolutePath);
1590
+ if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
1591
+ const clause = statement.importClause;
1592
+ if (!clause) return "";
1593
+ const bindings = [];
1594
+ if (clause.name) bindings.push(clause.name.text);
1595
+ if (clause.namedBindings) {
1596
+ if (ts.isNamespaceImport(clause.namedBindings)) bindings.push(clause.namedBindings.name.text);
1597
+ else for (const element of clause.namedBindings.elements) bindings.push(element.name.text);
1598
+ }
1599
+ if (bindings.length === 0) return "";
1600
+ return bindings.map((name) => `const ${name} = ${JSON.stringify(webPath)};`).join("\n");
1535
1601
  }
1536
- return statement.getFullText(sourceFile);
1537
- } else {
1538
- if (STYLESHEET_EXTENSIONS.has(ext)) return "";
1539
- const projectRoot = findProjectRoot(file);
1540
- let absolutePath = "";
1541
- if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
1542
- else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
1543
- else absolutePath = importPath;
1544
- let webPath = importPath;
1545
- const relativeToRoot = path.relative(projectRoot, absolutePath);
1546
- if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
1547
- const clause = statement.importClause;
1548
- if (!clause) return "";
1549
- const bindings = [];
1550
- if (clause.name) bindings.push(clause.name.text);
1551
- if (clause.namedBindings) if (ts.isNamespaceImport(clause.namedBindings)) bindings.push(clause.namedBindings.name.text);
1552
- else for (const element of clause.namedBindings.elements) bindings.push(element.name.text);
1553
- if (bindings.length === 0) return "";
1554
- return bindings.map((name) => `const ${name} = ${JSON.stringify(webPath)};`).join("\n");
1555
1602
  }
1556
1603
  if (isRelative) {
1557
1604
  const resolvedPath = resolveFileExtension(path.resolve(path.dirname(file), importPath));
@@ -1584,35 +1631,37 @@ function processImportDeclaration(statement, sourceFile, file, client, outDir) {
1584
1631
  const isRelative = importPath.startsWith(".");
1585
1632
  const isAlias = importPath.startsWith("@/") || importPath.startsWith("~/");
1586
1633
  const ext = path.extname(importPath).toLowerCase();
1587
- if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) if (client) {
1588
- if (isRelative) {
1589
- const normalized = fileUrl(path.resolve(path.dirname(file), importPath));
1590
- const fullText = statement.getFullText(sourceFile);
1591
- const start = specifier.getStart(sourceFile) - statement.getFullStart();
1592
- const end = specifier.getEnd() - statement.getFullStart();
1593
- return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1594
- }
1595
- if (isAlias) {
1634
+ if (IMAGE_VIDEO_FONT_EXTENSIONS.has(ext) || STYLESHEET_EXTENSIONS.has(ext)) {
1635
+ if (client) {
1636
+ if (isRelative) {
1637
+ const normalized = fileUrl(path.resolve(path.dirname(file), importPath));
1638
+ const fullText = statement.getFullText(sourceFile);
1639
+ const start = specifier.getStart(sourceFile) - statement.getFullStart();
1640
+ const end = specifier.getEnd() - statement.getFullStart();
1641
+ return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1642
+ }
1643
+ if (isAlias) {
1644
+ const projectRoot = findProjectRoot(file);
1645
+ const normalized = fileUrl(path.resolve(projectRoot, importPath.slice(2)));
1646
+ const fullText = statement.getFullText(sourceFile);
1647
+ const start = specifier.getStart(sourceFile) - statement.getFullStart();
1648
+ const end = specifier.getEnd() - statement.getFullStart();
1649
+ return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1650
+ }
1651
+ return statement.getFullText(sourceFile);
1652
+ } else {
1653
+ if (STYLESHEET_EXTENSIONS.has(ext)) return "";
1596
1654
  const projectRoot = findProjectRoot(file);
1597
- const normalized = fileUrl(path.resolve(projectRoot, importPath.slice(2)));
1598
- const fullText = statement.getFullText(sourceFile);
1599
- const start = specifier.getStart(sourceFile) - statement.getFullStart();
1600
- const end = specifier.getEnd() - statement.getFullStart();
1601
- return fullText.slice(0, start) + JSON.stringify(normalized) + fullText.slice(end);
1655
+ let absolutePath = "";
1656
+ if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
1657
+ else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
1658
+ else absolutePath = importPath;
1659
+ let webPath = importPath;
1660
+ const relativeToRoot = path.relative(projectRoot, absolutePath);
1661
+ if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
1662
+ if (!statement.name) return "";
1663
+ return `const ${statement.name.text} = ${JSON.stringify(webPath)};`;
1602
1664
  }
1603
- return statement.getFullText(sourceFile);
1604
- } else {
1605
- if (STYLESHEET_EXTENSIONS.has(ext)) return "";
1606
- const projectRoot = findProjectRoot(file);
1607
- let absolutePath = "";
1608
- if (isAlias) absolutePath = path.resolve(projectRoot, importPath.slice(2));
1609
- else if (isRelative) absolutePath = path.resolve(path.dirname(file), importPath);
1610
- else absolutePath = importPath;
1611
- let webPath = importPath;
1612
- const relativeToRoot = path.relative(projectRoot, absolutePath);
1613
- if (relativeToRoot === "" || relativeToRoot !== ".." && !relativeToRoot.startsWith(`..${path.sep}`) && !path.isAbsolute(relativeToRoot)) webPath = "/" + relativeToRoot.replace(/\\/g, "/");
1614
- if (!statement.name) return "";
1615
- return `const ${statement.name.text} = ${JSON.stringify(webPath)};`;
1616
1665
  }
1617
1666
  if (isRelative) {
1618
1667
  const resolvedPath = resolveFileExtension(path.resolve(path.dirname(file), importPath));
@@ -1667,12 +1716,14 @@ function analyzeScript(script, file, inlineHandlers = []) {
1667
1716
  bindings.add(clause.name.text);
1668
1717
  importedBindings.add(clause.name.text);
1669
1718
  }
1670
- if (clause.namedBindings) if (ts.isNamespaceImport(clause.namedBindings)) {
1671
- bindings.add(clause.namedBindings.name.text);
1672
- importedBindings.add(clause.namedBindings.name.text);
1673
- } else for (const element of clause.namedBindings.elements) {
1674
- bindings.add(element.name.text);
1675
- importedBindings.add(element.name.text);
1719
+ if (clause.namedBindings) {
1720
+ if (ts.isNamespaceImport(clause.namedBindings)) {
1721
+ bindings.add(clause.namedBindings.name.text);
1722
+ importedBindings.add(clause.namedBindings.name.text);
1723
+ } else for (const element of clause.namedBindings.elements) {
1724
+ bindings.add(element.name.text);
1725
+ importedBindings.add(element.name.text);
1726
+ }
1676
1727
  }
1677
1728
  }
1678
1729
  } else if (ts.isImportEqualsDeclaration(statement) && statement.name) {
@@ -1813,23 +1864,23 @@ function readPropertyName(name, sourceFile, file) {
1813
1864
  throw new ResuxCompileError("Only simple property names are supported here.", locationFromTsNode(file, sourceFile, name));
1814
1865
  }
1815
1866
  function validateTemplateHandlers(events, analysis, file, fullSource, templateLocals = []) {
1816
- const allowedHandlers = new Set([...analysis.handlerNames, ...templateLocals]);
1867
+ const allowedHandlers = /* @__PURE__ */ new Set([...analysis.handlerNames, ...templateLocals]);
1817
1868
  for (const event of events) {
1818
1869
  if (!allowedHandlers.has(event.handler)) throw new ResuxCompileError(`Handler "${event.handler}" must be a top-level function or arrow function.`, locationFromOffset(file, fullSource, 0));
1819
1870
  const handlerNode = analysis.handlers.get(event.handler);
1820
1871
  if (!handlerNode) continue;
1821
1872
  const locals = analysis.inlineHandlerLocals.get(event.handler) ?? [];
1822
1873
  const unsupportedCapture = findUnsupportedCapture(handlerNode, event.handler, analysis, locals);
1823
- if (unsupportedCapture) throw new ResuxCompileError(`Handler "${event.handler}" captures "${unsupportedCapture}", which is not resumable in Resux.`, locationFromTsNode(file, analysis.sourceFile, handlerNode));
1874
+ if (unsupportedCapture) throw new ResuxCompileError(`Handler "${event.handler}" captures "${unsupportedCapture}", which is not resumable in Resux. If this is a client or browser API, access it via "globalThis.${unsupportedCapture}" or move client-only logic into onMounted() or useClientEnhancement(). See https://resux.dev/guide/resumability-handlers for allowed globals and resumability rules.`, locationFromTsNode(file, analysis.sourceFile, handlerNode));
1824
1875
  }
1825
1876
  }
1826
1877
  function findUnsupportedCapture(node, handlerName, analysis, templateLocals = []) {
1827
- const locals = new Set([
1878
+ const locals = /* @__PURE__ */ new Set([
1828
1879
  handlerName,
1829
1880
  "event",
1830
1881
  ...templateLocals
1831
1882
  ]);
1832
- const allowedTopLevel = new Set([
1883
+ const allowedTopLevel = /* @__PURE__ */ new Set([
1833
1884
  ...analysis.resumableBindings,
1834
1885
  ...analysis.handlerNames,
1835
1886
  ...analysis.importedBindings
@@ -1960,6 +2011,8 @@ function createComponentModuleSource(options) {
1960
2011
  `file: ${JSON.stringify(normalizePath(options.file))},`,
1961
2012
  `script: __rx_setup,`,
1962
2013
  `template: __template,`,
2014
+ `templateRefs: ${JSON.stringify(options.templateRefs ?? [])},`,
2015
+ `templateForRefs: ${JSON.stringify(options.templateForRefs ?? [])}`,
1963
2016
  `handlers: ${JSON.stringify([...options.analysis.handlerNames])},`,
1964
2017
  `styles: ${JSON.stringify(options.styles)},`,
1965
2018
  `styleScopeId: ${JSON.stringify(options.styleScopeId)},`,
@@ -2206,20 +2259,6 @@ function readSecurityContentSecurityPolicy(config, head) {
2206
2259
  }
2207
2260
  return "";
2208
2261
  }
2209
- function cspDirectiveSources(csp, names) {
2210
- if (!csp.trim()) return null;
2211
- const directives = /* @__PURE__ */ new Map();
2212
- for (const rawDirective of csp.split(";")) {
2213
- const tokens = rawDirective.trim().split(/\s+/).filter(Boolean);
2214
- if (!tokens.length) continue;
2215
- directives.set(tokens[0].toLowerCase(), tokens.slice(1));
2216
- }
2217
- for (const name of names) {
2218
- const sources = directives.get(name);
2219
- if (sources) return sources;
2220
- }
2221
- return null;
2222
- }
2223
2262
  function allowsInlineStyleForCsp(csp) {
2224
2263
  const sources = cspDirectiveSources(csp, [
2225
2264
  "style-src-elem",
@@ -2267,10 +2306,16 @@ function readInlinePublicCss(appRoot, href, maxBytes) {
2267
2306
  if (!pathname.toLowerCase().endsWith(".css")) return null;
2268
2307
  const publicRoot = path.resolve(appRoot, "public");
2269
2308
  const staticRoot = path.resolve(appRoot, "static");
2270
- const relativePath = pathname.replace(/^\/+/, "");
2271
- const candidates = [path.resolve(publicRoot, relativePath), path.resolve(staticRoot, relativePath)];
2272
- for (const candidate of candidates) {
2273
- if (!(candidate.startsWith(publicRoot + path.sep) ? publicRoot : candidate.startsWith(staticRoot + path.sep) ? staticRoot : null) || !existsSync(candidate)) continue;
2309
+ const relativePath = pathname.replace(/^[/\\]+/, "");
2310
+ const candidates = [{
2311
+ root: publicRoot,
2312
+ candidate: path.resolve(publicRoot, relativePath)
2313
+ }, {
2314
+ root: staticRoot,
2315
+ candidate: path.resolve(staticRoot, relativePath)
2316
+ }];
2317
+ for (const { root, candidate } of candidates) {
2318
+ if (!isPathWithinBoundary(root, candidate) || !existsSync(candidate)) continue;
2274
2319
  const css = ts.sys.readFile(candidate);
2275
2320
  if (typeof css !== "string" || Buffer.byteLength(css, "utf8") > maxBytes || hasRelativeCssReferences(css)) continue;
2276
2321
  return css;
@@ -2326,13 +2371,15 @@ function createRuntimeConfig(config) {
2326
2371
  const runtimeConfig = config.runtimeConfig;
2327
2372
  const packagesConfig = isPlainObject(config.packages) ? config.packages : null;
2328
2373
  const videoConfig = isPlainObject(config.video) ? config.video : null;
2374
+ const routerConfig = isPlainObject(config.router) ? config.router : null;
2329
2375
  const publicConfig = runtimeConfig?.public && typeof runtimeConfig.public === "object" && !Array.isArray(runtimeConfig.public) ? runtimeConfig.public : {};
2330
2376
  const appRuntimeConfig = {
2331
2377
  ...runtimeConfig ?? {},
2332
2378
  public: {
2333
2379
  ...publicConfig,
2334
2380
  ...packagesConfig ? { packages: packagesConfig } : {},
2335
- ...videoConfig ? { video: videoConfig } : {}
2381
+ ...videoConfig ? { video: videoConfig } : {},
2382
+ ...routerConfig ? { router: routerConfig } : {}
2336
2383
  }
2337
2384
  };
2338
2385
  const halalConfig = config.halalAI;
@@ -2490,7 +2537,7 @@ function createSupportModuleAutoImportPrefix(file, source, autoImports) {
2490
2537
  for (const name of entry.names) {
2491
2538
  if (seen.has(name) || declared.has(name)) continue;
2492
2539
  seen.add(name);
2493
- if (!(/* @__PURE__ */ new RegExp(`\\b${name}\\b`)).test(source)) continue;
2540
+ if (!new RegExp(`\\b${name}\\b`).test(source)) continue;
2494
2541
  names.push(name);
2495
2542
  }
2496
2543
  if (names.length > 0) lines.push(`import { ${names.join(", ")} } from ${JSON.stringify(entry.from)};`);
@@ -2506,8 +2553,10 @@ function collectSupportModuleTopLevelBindings(file, source) {
2506
2553
  const clause = statement.importClause;
2507
2554
  if (!clause) continue;
2508
2555
  if (clause.name) bindings.add(clause.name.text);
2509
- if (clause.namedBindings) if (ts.isNamespaceImport(clause.namedBindings)) bindings.add(clause.namedBindings.name.text);
2510
- else for (const element of clause.namedBindings.elements) bindings.add(element.name.text);
2556
+ if (clause.namedBindings) {
2557
+ if (ts.isNamespaceImport(clause.namedBindings)) bindings.add(clause.namedBindings.name.text);
2558
+ else for (const element of clause.namedBindings.elements) bindings.add(element.name.text);
2559
+ }
2511
2560
  continue;
2512
2561
  }
2513
2562
  if (ts.isVariableStatement(statement)) {
@@ -2621,13 +2670,14 @@ function createModuleOptions(module, options) {
2621
2670
  return options;
2622
2671
  }
2623
2672
  function resolveBuiltinModule(specifier) {
2624
- return builtinModules$1[specifier.startsWith("resux:") ? specifier.slice(6) : specifier] ?? null;
2673
+ const normalized = specifier.startsWith("resux:") ? specifier.slice(6) : specifier;
2674
+ return builtinModules[normalized] ?? null;
2625
2675
  }
2626
2676
  const i18nBuiltinModule = { async setup(options, resux) {
2627
2677
  const imported = await import("../i18n/index.js");
2628
2678
  await getModuleSetup(imported.default ?? imported)(options, resux);
2629
2679
  } };
2630
- const builtinModules$1 = {
2680
+ const builtinModules = {
2631
2681
  i18n: i18nBuiltinModule,
2632
2682
  "resuxjs/i18n": i18nBuiltinModule,
2633
2683
  "@resuxjs/i18n": i18nBuiltinModule,
@@ -2694,7 +2744,7 @@ function resolveModuleSpecifier(specifier, root) {
2694
2744
  const resolved = specifier.startsWith("file:") ? new URL(specifier) : path.resolve(root, specifier);
2695
2745
  return resolveLocalModuleFile(resolved instanceof URL ? fileURLToPath(resolved) : resolved);
2696
2746
  }
2697
- return require.resolve(specifier, { paths: [root] });
2747
+ return __require.resolve(specifier, { paths: [root] });
2698
2748
  }
2699
2749
  function resolveLocalModuleFile(file) {
2700
2750
  const found = [
@@ -3220,7 +3270,7 @@ function normalizeConfiguredPackageCssMap(config) {
3220
3270
  }
3221
3271
  function canResolvePackageSpecifier(appRoot, specifier) {
3222
3272
  try {
3223
- require.resolve(specifier, { paths: [appRoot] });
3273
+ __require.resolve(specifier, { paths: [appRoot] });
3224
3274
  return true;
3225
3275
  } catch {
3226
3276
  return false;
@@ -3307,7 +3357,7 @@ function resolveConfiguredPackageMode(packageName, config) {
3307
3357
  async function analyzePackageUsage(appRoot, sources, runtimeConfig) {
3308
3358
  const configuredPackages = readConfiguredPackages(runtimeConfig);
3309
3359
  const map = /* @__PURE__ */ new Map();
3310
- const ignoredPackages = new Set([
3360
+ const ignoredPackages = /* @__PURE__ */ new Set([
3311
3361
  "resuxjs",
3312
3362
  "vue",
3313
3363
  "h3",
@@ -3351,7 +3401,7 @@ async function analyzePackageUsage(appRoot, sources, runtimeConfig) {
3351
3401
  for (const [name, usage] of map.entries()) {
3352
3402
  let missing = false;
3353
3403
  try {
3354
- require.resolve(name, { paths: [appRoot] });
3404
+ __require.resolve(name, { paths: [appRoot] });
3355
3405
  } catch {
3356
3406
  missing = true;
3357
3407
  usage.warnings.add(`Package "${name}" is imported but not installed.`);
@@ -3534,7 +3584,6 @@ function resolveFileExtension(filePath) {
3534
3584
  function fileUrl(file) {
3535
3585
  return pathToFileURL(file).href;
3536
3586
  }
3587
+ export { RESUMABLE_HANDLER_ALLOWED_GLOBALS, ResuxCompileError, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, resolveFileExtension };
3537
3588
 
3538
- //#endregion
3539
- export { ResuxCompileError, buildProject, compileVueFile, compileVueSource, createRouteManifest, fileUrl, resolveFileExtension };
3540
3589
  //# sourceMappingURL=index.js.map