resuxjs 0.3.10 → 0.4.0-beta.2

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 (361) hide show
  1. package/README.md +23 -1
  2. package/dist/bin.d.ts +1 -2
  3. package/dist/bin.js +4 -0
  4. package/dist/bin.js.map +1 -1
  5. package/dist/build/index.d.ts +28 -0
  6. package/dist/build/index.js +51 -0
  7. package/dist/build/index.js.map +1 -0
  8. package/dist/cli.d.ts +15 -5
  9. package/dist/cli.js +2648 -3668
  10. package/dist/cli.js.map +1 -1
  11. package/dist/compiler/adapter.d.ts +14 -11
  12. package/dist/compiler/adapter.js +68 -93
  13. package/dist/compiler/adapter.js.map +1 -1
  14. package/dist/compiler/dev-warnings.d.ts +8 -5
  15. package/dist/compiler/dev-warnings.js +248 -321
  16. package/dist/compiler/dev-warnings.js.map +1 -1
  17. package/dist/compiler/directives.d.ts +3 -0
  18. package/dist/compiler/directives.js +124 -150
  19. package/dist/compiler/directives.js.map +1 -1
  20. package/dist/compiler/implementation.d.ts +96 -93
  21. package/dist/compiler/implementation.js +2967 -3430
  22. package/dist/compiler/index.d.ts +14 -11
  23. package/dist/compiler/index.js +68 -93
  24. package/dist/compiler/index.js.map +1 -1
  25. package/dist/core/config.d.ts +12 -5
  26. package/dist/core/config.js +42 -25
  27. package/dist/core/config.js.map +1 -1
  28. package/dist/core/hooks.d.ts +127 -126
  29. package/dist/core/hooks.js +45 -55
  30. package/dist/core/hooks.js.map +1 -1
  31. package/dist/core/index.d.ts +5 -4
  32. package/dist/core/index.js +5 -5
  33. package/dist/core/module-container.d.ts +76 -74
  34. package/dist/core/module-container.js +181 -186
  35. package/dist/core/module-container.js.map +1 -1
  36. package/dist/core/resux.d.ts +15 -12
  37. package/dist/core/resux.js +17 -13
  38. package/dist/core/resux.js.map +1 -1
  39. package/dist/create-bin.d.ts +1 -2
  40. package/dist/create-bin.js +4 -0
  41. package/dist/create-bin.js.map +1 -1
  42. package/dist/create.d.ts +3 -0
  43. package/dist/create.js +499 -638
  44. package/dist/create.js.map +1 -1
  45. package/dist/deploy/cloudflare.d.ts +4 -1
  46. package/dist/deploy/cloudflare.js +30 -34
  47. package/dist/deploy/cloudflare.js.map +1 -1
  48. package/dist/deploy/common.d.ts +6 -4
  49. package/dist/deploy/common.js +118 -188
  50. package/dist/deploy/common.js.map +1 -1
  51. package/dist/deploy/framework-runtime.d.ts +3 -0
  52. package/dist/deploy/framework-runtime.js +43 -48
  53. package/dist/deploy/framework-runtime.js.map +1 -1
  54. package/dist/deploy/index.d.ts +4 -1
  55. package/dist/deploy/index.js +58 -80
  56. package/dist/deploy/index.js.map +1 -1
  57. package/dist/deploy/netlify.d.ts +4 -1
  58. package/dist/deploy/netlify.js +40 -41
  59. package/dist/deploy/netlify.js.map +1 -1
  60. package/dist/deploy/node.d.ts +4 -1
  61. package/dist/deploy/node.js +24 -19
  62. package/dist/deploy/node.js.map +1 -1
  63. package/dist/deploy/production-report.d.ts +3 -0
  64. package/dist/deploy/production-report.js +14 -14
  65. package/dist/deploy/production-report.js.map +1 -1
  66. package/dist/deploy/runtime-dependencies.d.ts +3 -0
  67. package/dist/deploy/runtime-dependencies.js +158 -220
  68. package/dist/deploy/runtime-dependencies.js.map +1 -1
  69. package/dist/deploy/static.d.ts +4 -1
  70. package/dist/deploy/static.js +16 -14
  71. package/dist/deploy/static.js.map +1 -1
  72. package/dist/deploy/types.d.ts +25 -22
  73. package/dist/deploy/types.js +0 -1
  74. package/dist/deploy/vercel.d.ts +4 -1
  75. package/dist/deploy/vercel.js +137 -188
  76. package/dist/deploy/vercel.js.map +1 -1
  77. package/dist/fonts/index.d.ts +15 -11
  78. package/dist/fonts/index.js +114 -134
  79. package/dist/fonts/index.js.map +1 -1
  80. package/dist/globals.d.ts +79 -78
  81. package/dist/globals.js +0 -1
  82. package/dist/halal-core/ai/classifyProject.d.ts +4 -1
  83. package/dist/halal-core/ai/classifyProject.js +81 -95
  84. package/dist/halal-core/ai/classifyProject.js.map +1 -1
  85. package/dist/halal-core/ai/classifyRuntimeContent.d.ts +5 -2
  86. package/dist/halal-core/ai/classifyRuntimeContent.js +77 -95
  87. package/dist/halal-core/ai/classifyRuntimeContent.js.map +1 -1
  88. package/dist/halal-core/ai/createProjectSummary.d.ts +38 -35
  89. package/dist/halal-core/ai/createProjectSummary.js +38 -39
  90. package/dist/halal-core/ai/createProjectSummary.js.map +1 -1
  91. package/dist/halal-core/ai/halalClassifierPrompt.d.ts +3 -0
  92. package/dist/halal-core/ai/halalClassifierPrompt.js +5 -1
  93. package/dist/halal-core/ai/halalClassifierPrompt.js.map +1 -1
  94. package/dist/halal-core/ai/redactSensitiveData.d.ts +3 -0
  95. package/dist/halal-core/ai/redactSensitiveData.js +82 -110
  96. package/dist/halal-core/ai/redactSensitiveData.js.map +1 -1
  97. package/dist/halal-core/ai/validateAiResponse.d.ts +4 -1
  98. package/dist/halal-core/ai/validateAiResponse.js +58 -85
  99. package/dist/halal-core/ai/validateAiResponse.js.map +1 -1
  100. package/dist/halal-core/cli/check.d.ts +3 -0
  101. package/dist/halal-core/cli/check.js +28 -30
  102. package/dist/halal-core/cli/check.js.map +1 -1
  103. package/dist/halal-core/cli/explain.d.ts +3 -0
  104. package/dist/halal-core/cli/explain.js +27 -31
  105. package/dist/halal-core/cli/explain.js.map +1 -1
  106. package/dist/halal-core/cli/report.d.ts +3 -0
  107. package/dist/halal-core/cli/report.js +14 -10
  108. package/dist/halal-core/cli/report.js.map +1 -1
  109. package/dist/halal-core/cli/submitReview.d.ts +3 -0
  110. package/dist/halal-core/cli/submitReview.js +13 -9
  111. package/dist/halal-core/cli/submitReview.js.map +1 -1
  112. package/dist/halal-core/cli/verifyReview.d.ts +3 -0
  113. package/dist/halal-core/cli/verifyReview.js +18 -15
  114. package/dist/halal-core/cli/verifyReview.js.map +1 -1
  115. package/dist/halal-core/config.d.ts +30 -27
  116. package/dist/halal-core/config.js +76 -118
  117. package/dist/halal-core/config.js.map +1 -1
  118. package/dist/halal-core/crypto/integrity.d.ts +6 -3
  119. package/dist/halal-core/crypto/integrity.js +64 -87
  120. package/dist/halal-core/crypto/integrity.js.map +1 -1
  121. package/dist/halal-core/enforce.d.ts +3 -0
  122. package/dist/halal-core/enforce.js +92 -105
  123. package/dist/halal-core/enforce.js.map +1 -1
  124. package/dist/halal-core/index.d.ts +20 -16
  125. package/dist/halal-core/index.js +18 -19
  126. package/dist/halal-core/lifecycle.d.ts +3 -0
  127. package/dist/halal-core/lifecycle.js +15 -13
  128. package/dist/halal-core/lifecycle.js.map +1 -1
  129. package/dist/halal-core/policy.d.ts +4 -1
  130. package/dist/halal-core/policy.js +6 -2
  131. package/dist/halal-core/policy.js.map +1 -1
  132. package/dist/halal-core/report/formatBrowserOverlay.d.ts +4 -1
  133. package/dist/halal-core/report/formatBrowserOverlay.js +10 -8
  134. package/dist/halal-core/report/formatBrowserOverlay.js.map +1 -1
  135. package/dist/halal-core/report/formatTerminalReport.d.ts +4 -1
  136. package/dist/halal-core/report/formatTerminalReport.js +27 -37
  137. package/dist/halal-core/report/formatTerminalReport.js.map +1 -1
  138. package/dist/halal-core/report/generateHalalReport.d.ts +7 -4
  139. package/dist/halal-core/report/generateHalalReport.js +26 -26
  140. package/dist/halal-core/report/generateHalalReport.js.map +1 -1
  141. package/dist/halal-core/report/signReport.d.ts +4 -1
  142. package/dist/halal-core/report/signReport.js +16 -12
  143. package/dist/halal-core/report/signReport.js.map +1 -1
  144. package/dist/halal-core/report/verifyReport.d.ts +9 -6
  145. package/dist/halal-core/report/verifyReport.js +51 -41
  146. package/dist/halal-core/report/verifyReport.js.map +1 -1
  147. package/dist/halal-core/review/createReviewRequest.d.ts +4 -1
  148. package/dist/halal-core/review/createReviewRequest.js +21 -17
  149. package/dist/halal-core/review/createReviewRequest.js.map +1 -1
  150. package/dist/halal-core/review/reviewPolicy.d.ts +3 -0
  151. package/dist/halal-core/review/reviewPolicy.js +19 -17
  152. package/dist/halal-core/review/reviewPolicy.js.map +1 -1
  153. package/dist/halal-core/review/signedReviewFile.d.ts +11 -8
  154. package/dist/halal-core/review/signedReviewFile.js +24 -22
  155. package/dist/halal-core/review/signedReviewFile.js.map +1 -1
  156. package/dist/halal-core/review/verifyReviewApproval.d.ts +9 -6
  157. package/dist/halal-core/review/verifyReviewApproval.js +68 -62
  158. package/dist/halal-core/review/verifyReviewApproval.js.map +1 -1
  159. package/dist/halal-core/rules/adultContentRules.d.ts +3 -0
  160. package/dist/halal-core/rules/adultContentRules.js +23 -23
  161. package/dist/halal-core/rules/adultContentRules.js.map +1 -1
  162. package/dist/halal-core/rules/alcoholDrugVapeRules.d.ts +3 -0
  163. package/dist/halal-core/rules/alcoholDrugVapeRules.js +22 -22
  164. package/dist/halal-core/rules/alcoholDrugVapeRules.js.map +1 -1
  165. package/dist/halal-core/rules/childSafetyRules.d.ts +3 -0
  166. package/dist/halal-core/rules/childSafetyRules.js +19 -19
  167. package/dist/halal-core/rules/childSafetyRules.js.map +1 -1
  168. package/dist/halal-core/rules/coreCategories.d.ts +7 -4
  169. package/dist/halal-core/rules/coreCategories.js +237 -110
  170. package/dist/halal-core/rules/coreCategories.js.map +1 -1
  171. package/dist/halal-core/rules/cyberAbuseRules.d.ts +3 -0
  172. package/dist/halal-core/rules/cyberAbuseRules.js +27 -27
  173. package/dist/halal-core/rules/cyberAbuseRules.js.map +1 -1
  174. package/dist/halal-core/rules/defaultBlockedRules.d.ts +21 -18
  175. package/dist/halal-core/rules/defaultBlockedRules.js +158 -199
  176. package/dist/halal-core/rules/defaultBlockedRules.js.map +1 -1
  177. package/dist/halal-core/rules/dependencyRules.d.ts +8 -5
  178. package/dist/halal-core/rules/dependencyRules.js +50 -56
  179. package/dist/halal-core/rules/dependencyRules.js.map +1 -1
  180. package/dist/halal-core/rules/endpointRules.d.ts +6 -3
  181. package/dist/halal-core/rules/endpointRules.js +21 -23
  182. package/dist/halal-core/rules/endpointRules.js.map +1 -1
  183. package/dist/halal-core/rules/environmentalHarmRules.d.ts +3 -0
  184. package/dist/halal-core/rules/environmentalHarmRules.js +17 -17
  185. package/dist/halal-core/rules/environmentalHarmRules.js.map +1 -1
  186. package/dist/halal-core/rules/financeRibaRules.d.ts +3 -0
  187. package/dist/halal-core/rules/financeRibaRules.js +20 -20
  188. package/dist/halal-core/rules/financeRibaRules.js.map +1 -1
  189. package/dist/halal-core/rules/gamblingRules.d.ts +3 -0
  190. package/dist/halal-core/rules/gamblingRules.js +22 -22
  191. package/dist/halal-core/rules/gamblingRules.js.map +1 -1
  192. package/dist/halal-core/rules/generalHarmRules.d.ts +3 -0
  193. package/dist/halal-core/rules/generalHarmRules.js +15 -15
  194. package/dist/halal-core/rules/generalHarmRules.js.map +1 -1
  195. package/dist/halal-core/rules/healthHarmRules.d.ts +3 -0
  196. package/dist/halal-core/rules/healthHarmRules.js +19 -19
  197. package/dist/halal-core/rules/healthHarmRules.js.map +1 -1
  198. package/dist/halal-core/rules/keywordRules.d.ts +11 -8
  199. package/dist/halal-core/rules/keywordRules.js +90 -39
  200. package/dist/halal-core/rules/keywordRules.js.map +1 -1
  201. package/dist/halal-core/rules/privacyAbuseRules.d.ts +3 -0
  202. package/dist/halal-core/rules/privacyAbuseRules.js +21 -21
  203. package/dist/halal-core/rules/privacyAbuseRules.js.map +1 -1
  204. package/dist/halal-core/rules/scamFraudRules.d.ts +3 -0
  205. package/dist/halal-core/rules/scamFraudRules.js +29 -29
  206. package/dist/halal-core/rules/scamFraudRules.js.map +1 -1
  207. package/dist/halal-core/rules/selfHarmRules.d.ts +3 -0
  208. package/dist/halal-core/rules/selfHarmRules.js +17 -17
  209. package/dist/halal-core/rules/selfHarmRules.js.map +1 -1
  210. package/dist/halal-core/rules/violenceExtremismRules.d.ts +3 -0
  211. package/dist/halal-core/rules/violenceExtremismRules.js +30 -30
  212. package/dist/halal-core/rules/violenceExtremismRules.js.map +1 -1
  213. package/dist/halal-core/runtime/guard.d.ts +17 -14
  214. package/dist/halal-core/runtime/guard.js +162 -183
  215. package/dist/halal-core/runtime/guard.js.map +1 -1
  216. package/dist/halal-core/runtime/index.d.ts +5 -4
  217. package/dist/halal-core/runtime/index.js +4 -5
  218. package/dist/halal-core/runtime/reviewedMemory.d.ts +4 -1
  219. package/dist/halal-core/runtime/reviewedMemory.js +74 -110
  220. package/dist/halal-core/runtime/reviewedMemory.js.map +1 -1
  221. package/dist/halal-core/runtime/serializeRuntimeContent.d.ts +10 -7
  222. package/dist/halal-core/runtime/serializeRuntimeContent.js +132 -156
  223. package/dist/halal-core/runtime/serializeRuntimeContent.js.map +1 -1
  224. package/dist/halal-core/runtime/types.d.ts +44 -41
  225. package/dist/halal-core/runtime/types.js +0 -1
  226. package/dist/halal-core/scanner/scanApiRoutes.d.ts +3 -0
  227. package/dist/halal-core/scanner/scanApiRoutes.js +32 -36
  228. package/dist/halal-core/scanner/scanApiRoutes.js.map +1 -1
  229. package/dist/halal-core/scanner/scanComponents.d.ts +3 -0
  230. package/dist/halal-core/scanner/scanComponents.js +12 -13
  231. package/dist/halal-core/scanner/scanComponents.js.map +1 -1
  232. package/dist/halal-core/scanner/scanContent.d.ts +5 -2
  233. package/dist/halal-core/scanner/scanContent.js +193 -263
  234. package/dist/halal-core/scanner/scanContent.js.map +1 -1
  235. package/dist/halal-core/scanner/scanDependencies.d.ts +3 -0
  236. package/dist/halal-core/scanner/scanDependencies.js +16 -15
  237. package/dist/halal-core/scanner/scanDependencies.js.map +1 -1
  238. package/dist/halal-core/scanner/scanDomains.d.ts +5 -2
  239. package/dist/halal-core/scanner/scanDomains.js +12 -12
  240. package/dist/halal-core/scanner/scanDomains.js.map +1 -1
  241. package/dist/halal-core/scanner/scanEnvNames.d.ts +3 -0
  242. package/dist/halal-core/scanner/scanEnvNames.js +23 -26
  243. package/dist/halal-core/scanner/scanEnvNames.js.map +1 -1
  244. package/dist/halal-core/scanner/scanMetadata.d.ts +6 -3
  245. package/dist/halal-core/scanner/scanMetadata.js +20 -29
  246. package/dist/halal-core/scanner/scanMetadata.js.map +1 -1
  247. package/dist/halal-core/scanner/scanPages.d.ts +3 -0
  248. package/dist/halal-core/scanner/scanPages.js +12 -15
  249. package/dist/halal-core/scanner/scanPages.js.map +1 -1
  250. package/dist/halal-core/scanner/scanProject.d.ts +15 -10
  251. package/dist/halal-core/scanner/scanProject.js +43 -49
  252. package/dist/halal-core/scanner/scanProject.js.map +1 -1
  253. package/dist/halal-core/scanner/scanRoutes.d.ts +3 -0
  254. package/dist/halal-core/scanner/scanRoutes.js +32 -39
  255. package/dist/halal-core/scanner/scanRoutes.js.map +1 -1
  256. package/dist/halal-core/scanner/scanTranslations.d.ts +3 -0
  257. package/dist/halal-core/scanner/scanTranslations.js +21 -29
  258. package/dist/halal-core/scanner/scanTranslations.js.map +1 -1
  259. package/dist/halal-core/status.d.ts +14 -11
  260. package/dist/halal-core/status.js +0 -1
  261. package/dist/halal-core/tamper/verifyCoreIntegrity.d.ts +3 -0
  262. package/dist/halal-core/tamper/verifyCoreIntegrity.js +26 -24
  263. package/dist/halal-core/tamper/verifyCoreIntegrity.js.map +1 -1
  264. package/dist/halal-core/tamper/verifyLifecycleHooks.d.ts +3 -0
  265. package/dist/halal-core/tamper/verifyLifecycleHooks.js +13 -12
  266. package/dist/halal-core/tamper/verifyLifecycleHooks.js.map +1 -1
  267. package/dist/halal-core/tamper/verifyReportSignature.d.ts +6 -3
  268. package/dist/halal-core/tamper/verifyReportSignature.js +20 -14
  269. package/dist/halal-core/tamper/verifyReportSignature.js.map +1 -1
  270. package/dist/halal.d.ts +20 -1
  271. package/dist/halal.js +18 -2
  272. package/dist/i18n/index.d.ts +34 -31
  273. package/dist/i18n/index.js +219 -288
  274. package/dist/i18n/index.js.map +1 -1
  275. package/dist/i18n/shared.d.ts +18 -15
  276. package/dist/i18n/shared.js +204 -266
  277. package/dist/i18n/shared.js.map +1 -1
  278. package/dist/icons/index.d.ts +143 -139
  279. package/dist/icons/index.js +322 -273
  280. package/dist/icons/index.js.map +1 -1
  281. package/dist/index.d.ts +8 -1
  282. package/dist/index.js +7 -2
  283. package/dist/kit/index.d.ts +9 -6
  284. package/dist/kit/index.js +45 -43
  285. package/dist/kit/index.js.map +1 -1
  286. package/dist/nitro-server/index.d.ts +7 -4
  287. package/dist/nitro-server/index.js +6 -2
  288. package/dist/nitro-server/index.js.map +1 -1
  289. package/dist/node.d.ts +6 -3
  290. package/dist/node.js +88 -116
  291. package/dist/node.js.map +1 -1
  292. package/dist/reactivity/computed.d.ts +6 -3
  293. package/dist/reactivity/computed.js +46 -53
  294. package/dist/reactivity/computed.js.map +1 -1
  295. package/dist/reactivity/effect.d.ts +8 -5
  296. package/dist/reactivity/effect.js +105 -146
  297. package/dist/reactivity/effect.js.map +1 -1
  298. package/dist/reactivity/index.d.ts +8 -8
  299. package/dist/reactivity/index.js +7 -8
  300. package/dist/reactivity/reactive.d.ts +3 -0
  301. package/dist/reactivity/reactive.js +93 -133
  302. package/dist/reactivity/reactive.js.map +1 -1
  303. package/dist/reactivity/readonly.d.ts +2 -1
  304. package/dist/reactivity/readonly.js +2 -2
  305. package/dist/reactivity/ref.d.ts +15 -15
  306. package/dist/reactivity/ref.js +73 -81
  307. package/dist/reactivity/ref.js.map +1 -1
  308. package/dist/reactivity/scheduler.d.ts +3 -1
  309. package/dist/reactivity/scheduler.js +67 -69
  310. package/dist/reactivity/scheduler.js.map +1 -1
  311. package/dist/reactivity/types.d.ts +17 -14
  312. package/dist/reactivity/types.js +0 -1
  313. package/dist/reactivity/utils.d.ts +7 -4
  314. package/dist/reactivity/utils.js +25 -24
  315. package/dist/reactivity/utils.js.map +1 -1
  316. package/dist/reactivity/watch.d.ts +4 -2
  317. package/dist/reactivity/watch.js +75 -103
  318. package/dist/reactivity/watch.js.map +1 -1
  319. package/dist/runtime/core.d.ts +31 -0
  320. package/dist/runtime/core.js +156 -0
  321. package/dist/runtime/core.js.map +1 -0
  322. package/dist/runtime/index.d.ts +487 -461
  323. package/dist/runtime/index.js +4129 -5254
  324. package/dist/runtime/index.js.map +1 -1
  325. package/dist/runtime/reactivity.d.ts +7 -0
  326. package/dist/runtime/reactivity.js +6 -0
  327. package/dist/runtime/resume.d.ts +79 -0
  328. package/dist/runtime/resume.js +482 -0
  329. package/dist/runtime/resume.js.map +1 -0
  330. package/dist/runtime/router.d.ts +20 -0
  331. package/dist/runtime/router.js +60 -0
  332. package/dist/runtime/router.js.map +1 -0
  333. package/dist/runtime/streaming.d.ts +24 -0
  334. package/dist/runtime/streaming.js +200 -0
  335. package/dist/runtime/streaming.js.map +1 -0
  336. package/dist/security/media-fetch.d.ts +32 -0
  337. package/dist/security/media-fetch.js +301 -0
  338. package/dist/security/media-fetch.js.map +1 -0
  339. package/dist/security/path-boundary.d.ts +7 -0
  340. package/dist/security/path-boundary.js +70 -0
  341. package/dist/security/path-boundary.js.map +1 -0
  342. package/dist/ui/index.d.ts +1580 -1576
  343. package/dist/ui/index.js +975 -674
  344. package/dist/ui/index.js.map +1 -1
  345. package/dist/vite-builder/index.d.ts +6 -3
  346. package/dist/vite-builder/index.js +6 -2
  347. package/dist/vite-builder/index.js.map +1 -1
  348. package/package.json +46 -86
  349. package/dist/compiler/implementation.js.map +0 -1
  350. package/dist/core/index.js.map +0 -1
  351. package/dist/deploy/types.js.map +0 -1
  352. package/dist/globals.js.map +0 -1
  353. package/dist/halal-core/index.js.map +0 -1
  354. package/dist/halal-core/runtime/index.js.map +0 -1
  355. package/dist/halal-core/runtime/types.js.map +0 -1
  356. package/dist/halal-core/status.js.map +0 -1
  357. package/dist/halal.js.map +0 -1
  358. package/dist/index.js.map +0 -1
  359. package/dist/reactivity/index.js.map +0 -1
  360. package/dist/reactivity/readonly.js.map +0 -1
  361. package/dist/reactivity/types.js.map +0 -1
@@ -1,250 +1,188 @@
1
- import { cp, mkdir, readFile, readdir, rm } from "node:fs/promises";
1
+ import { pathExists, readJsonRecord } from "./common.js";
2
2
  import { builtinModules, createRequire } from "node:module";
3
+ import { cp, mkdir, readFile, readdir, rm } from "node:fs/promises";
3
4
  import path from "node:path";
4
5
  import ts from "typescript";
5
- import { pathExists, readJsonRecord } from "./common.js";
6
- const nodeBuiltins = new Set(builtinModules.flatMap((name) => [
7
- name,
8
- name.startsWith("node:") ? name.slice(5) : `node:${name}`,
9
- ]));
6
+ //#region src/deploy/runtime-dependencies.ts
7
+ const nodeBuiltins = new Set(builtinModules.flatMap((name) => [name, name.startsWith("node:") ? name.slice(5) : `node:${name}`]));
10
8
  function isRecord(value) {
11
- return typeof value === "object" && value !== null && !Array.isArray(value);
9
+ return typeof value === "object" && value !== null && !Array.isArray(value);
12
10
  }
13
11
  function runtimeDependencyNames(value) {
14
- if (!isRecord(value)) {
15
- return [];
16
- }
17
- return Object.keys(value).filter((name) => name.trim().length > 0);
12
+ if (!isRecord(value)) return [];
13
+ return Object.keys(value).filter((name) => name.trim().length > 0);
18
14
  }
19
15
  function dependencyTargetPath(runtimeRoot, packageName) {
20
- return path.join(runtimeRoot, "node_modules", ...packageName.split("/"));
16
+ return path.join(runtimeRoot, "node_modules", ...packageName.split("/"));
21
17
  }
22
18
  function packageNameFromSpecifier(specifier) {
23
- if (!specifier
24
- || specifier.startsWith(".")
25
- || specifier.startsWith("/")
26
- || specifier.startsWith("#")
27
- || specifier.startsWith("data:")
28
- || specifier.startsWith("file:")
29
- || nodeBuiltins.has(specifier)) {
30
- return null;
31
- }
32
- if (specifier.startsWith("@")) {
33
- const [scope, name] = specifier.split("/");
34
- return scope && name ? `${scope}/${name}` : null;
35
- }
36
- const packageName = specifier.split("/")[0] ?? "";
37
- return packageName && !nodeBuiltins.has(packageName) ? packageName : null;
19
+ if (!specifier || specifier.startsWith(".") || specifier.startsWith("/") || specifier.startsWith("#") || specifier.startsWith("data:") || specifier.startsWith("file:") || nodeBuiltins.has(specifier)) return null;
20
+ if (specifier.startsWith("@")) {
21
+ const [scope, name] = specifier.split("/");
22
+ return scope && name ? `${scope}/${name}` : null;
23
+ }
24
+ const packageName = specifier.split("/")[0] ?? "";
25
+ return packageName && !nodeBuiltins.has(packageName) ? packageName : null;
38
26
  }
39
27
  async function walkRuntimeModuleFiles(directory) {
40
- const entries = await readdir(directory, { withFileTypes: true }).catch(() => []);
41
- const files = [];
42
- for (const entry of entries) {
43
- const fullPath = path.join(directory, entry.name);
44
- if (entry.isDirectory()) {
45
- files.push(...(await walkRuntimeModuleFiles(fullPath)));
46
- continue;
47
- }
48
- if (entry.isFile() && /\.(?:mjs|cjs|js)$/.test(entry.name)) {
49
- files.push(fullPath);
50
- }
51
- }
52
- return files;
28
+ const entries = await readdir(directory, { withFileTypes: true }).catch(() => []);
29
+ const files = [];
30
+ for (const entry of entries) {
31
+ const fullPath = path.join(directory, entry.name);
32
+ if (entry.isDirectory()) {
33
+ files.push(...await walkRuntimeModuleFiles(fullPath));
34
+ continue;
35
+ }
36
+ if (entry.isFile() && /\.(?:mjs|cjs|js)$/.test(entry.name)) files.push(fullPath);
37
+ }
38
+ return files;
53
39
  }
54
40
  function collectModuleSpecifiers(sourceFile) {
55
- const specifiers = [];
56
- function visit(node) {
57
- if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node))
58
- && node.moduleSpecifier
59
- && ts.isStringLiteralLike(node.moduleSpecifier)) {
60
- specifiers.push(node.moduleSpecifier.text);
61
- }
62
- else if (ts.isCallExpression(node)
63
- && node.expression.kind === ts.SyntaxKind.ImportKeyword
64
- && node.arguments.length === 1
65
- && ts.isStringLiteralLike(node.arguments[0])) {
66
- specifiers.push(node.arguments[0].text);
67
- }
68
- ts.forEachChild(node, visit);
69
- }
70
- visit(sourceFile);
71
- return specifiers;
41
+ const specifiers = [];
42
+ function visit(node) {
43
+ if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) && node.moduleSpecifier && ts.isStringLiteralLike(node.moduleSpecifier)) specifiers.push(node.moduleSpecifier.text);
44
+ else if (ts.isCallExpression(node) && node.expression.kind === ts.SyntaxKind.ImportKeyword && node.arguments.length === 1 && ts.isStringLiteralLike(node.arguments[0])) specifiers.push(node.arguments[0].text);
45
+ ts.forEachChild(node, visit);
46
+ }
47
+ visit(sourceFile);
48
+ return specifiers;
72
49
  }
73
- export async function collectServerRuntimeDependencyNames(serverRoot) {
74
- if (!(await pathExists(serverRoot))) {
75
- return [];
76
- }
77
- const dependencyNames = new Set();
78
- for (const file of await walkRuntimeModuleFiles(serverRoot)) {
79
- const source = await readFile(file, "utf8");
80
- const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, false, ts.ScriptKind.JS);
81
- for (const specifier of collectModuleSpecifiers(sourceFile)) {
82
- const packageName = packageNameFromSpecifier(specifier);
83
- if (packageName && packageName !== "resuxjs" && packageName !== "resux") {
84
- dependencyNames.add(packageName);
85
- }
86
- }
87
- }
88
- return [...dependencyNames].sort();
50
+ async function collectServerRuntimeDependencyNames(serverRoot) {
51
+ if (!await pathExists(serverRoot)) return [];
52
+ const dependencyNames = /* @__PURE__ */ new Set();
53
+ for (const file of await walkRuntimeModuleFiles(serverRoot)) {
54
+ const source = await readFile(file, "utf8");
55
+ const sourceFile = ts.createSourceFile(file, source, ts.ScriptTarget.Latest, false, ts.ScriptKind.JS);
56
+ for (const specifier of collectModuleSpecifiers(sourceFile)) {
57
+ const packageName = packageNameFromSpecifier(specifier);
58
+ if (packageName && packageName !== "resuxjs" && packageName !== "resux") dependencyNames.add(packageName);
59
+ }
60
+ }
61
+ return [...dependencyNames].sort();
89
62
  }
90
63
  function resolveResuxPackageRequire(appRequire) {
91
- for (const packageName of ["resuxjs", "resux"]) {
92
- try {
93
- return createRequire(appRequire.resolve(packageName));
94
- }
95
- catch {
96
- try {
97
- return createRequire(appRequire.resolve(`${packageName}/package.json`));
98
- }
99
- catch {
100
- // Keep trying known package names.
101
- }
102
- }
103
- }
104
- return null;
64
+ for (const packageName of ["resuxjs", "resux"]) try {
65
+ return createRequire(appRequire.resolve(packageName));
66
+ } catch {
67
+ try {
68
+ return createRequire(appRequire.resolve(`${packageName}/package.json`));
69
+ } catch {}
70
+ }
71
+ return null;
105
72
  }
106
73
  function formatResolutionError(error) {
107
- return error instanceof Error ? error.message : String(error);
74
+ return error instanceof Error ? error.message : String(error);
108
75
  }
109
76
  async function findPackageJsonFromEntry(dependency, entryPath) {
110
- let currentDirectory = path.dirname(entryPath);
111
- while (true) {
112
- const candidate = path.join(currentDirectory, "package.json");
113
- const packageJson = (await readJsonRecord(candidate));
114
- if (packageJson?.name === dependency) {
115
- return candidate;
116
- }
117
- const parentDirectory = path.dirname(currentDirectory);
118
- if (parentDirectory === currentDirectory) {
119
- return null;
120
- }
121
- currentDirectory = parentDirectory;
122
- }
77
+ let currentDirectory = path.dirname(entryPath);
78
+ while (true) {
79
+ const candidate = path.join(currentDirectory, "package.json");
80
+ if ((await readJsonRecord(candidate))?.name === dependency) return candidate;
81
+ const parentDirectory = path.dirname(currentDirectory);
82
+ if (parentDirectory === currentDirectory) return null;
83
+ currentDirectory = parentDirectory;
84
+ }
123
85
  }
124
86
  async function findPackageJsonFromSearchPaths(dependency, resolver) {
125
- const searchPaths = resolver.resolve.paths(dependency) ?? [];
126
- for (const nodeModulesRoot of searchPaths) {
127
- const candidate = path.join(nodeModulesRoot, ...dependency.split("/"), "package.json");
128
- const packageJson = (await readJsonRecord(candidate));
129
- if (packageJson?.name === dependency) {
130
- return candidate;
131
- }
132
- }
133
- return null;
87
+ const searchPaths = resolver.resolve.paths(dependency) ?? [];
88
+ for (const nodeModulesRoot of searchPaths) {
89
+ const candidate = path.join(nodeModulesRoot, ...dependency.split("/"), "package.json");
90
+ if ((await readJsonRecord(candidate))?.name === dependency) return candidate;
91
+ }
92
+ return null;
134
93
  }
135
94
  async function resolveDependencyPackageJsonPath(dependency, resolver, resolutionErrors) {
136
- let entryResolutionError = null;
137
- try {
138
- const entryPath = resolver.resolve(dependency);
139
- const packageJsonPath = await findPackageJsonFromEntry(dependency, entryPath);
140
- if (packageJsonPath) {
141
- return packageJsonPath;
142
- }
143
- entryResolutionError = new Error(`Resolved "${dependency}" to ${entryPath}, but its package root could not be located.`);
144
- }
145
- catch (error) {
146
- entryResolutionError = error;
147
- }
148
- // Native packages such as @img/sharp-linux-x64 intentionally expose only
149
- // specific subpaths, so neither the package root nor ./package.json is
150
- // necessarily resolvable through exports. Node still exposes the node_modules
151
- // lookup roots; inspect those roots directly without bypassing package identity.
152
- const searchPathPackageJson = await findPackageJsonFromSearchPaths(dependency, resolver);
153
- if (searchPathPackageJson) {
154
- return searchPathPackageJson;
155
- }
156
- // Preserve compatibility with packages that explicitly export package.json.
157
- try {
158
- return resolver.resolve(`${dependency}/package.json`);
159
- }
160
- catch (packageJsonError) {
161
- resolutionErrors?.push(`${formatResolutionError(entryResolutionError)} | ${formatResolutionError(packageJsonError)}`);
162
- return null;
163
- }
95
+ let entryResolutionError = null;
96
+ try {
97
+ const entryPath = resolver.resolve(dependency);
98
+ const packageJsonPath = await findPackageJsonFromEntry(dependency, entryPath);
99
+ if (packageJsonPath) return packageJsonPath;
100
+ entryResolutionError = /* @__PURE__ */ new Error(`Resolved "${dependency}" to ${entryPath}, but its package root could not be located.`);
101
+ } catch (error) {
102
+ entryResolutionError = error;
103
+ }
104
+ const searchPathPackageJson = await findPackageJsonFromSearchPaths(dependency, resolver);
105
+ if (searchPathPackageJson) return searchPathPackageJson;
106
+ try {
107
+ return resolver.resolve(`${dependency}/package.json`);
108
+ } catch (packageJsonError) {
109
+ resolutionErrors?.push(`${formatResolutionError(entryResolutionError)} | ${formatResolutionError(packageJsonError)}`);
110
+ return null;
111
+ }
164
112
  }
165
- export async function copyRuntimeDependencyTree(appRoot, runtimeRoot, rootDependency, consumerLabel) {
166
- const appRequire = createRequire(path.join(appRoot, "package.json"));
167
- const resuxPackageRequire = resolveResuxPackageRequire(appRequire);
168
- const rootResolvers = [appRequire, ...(resuxPackageRequire ? [resuxPackageRequire] : [])];
169
- const resolutionErrors = [];
170
- let rootDependencyPackageJsonPath = null;
171
- for (const resolver of rootResolvers) {
172
- rootDependencyPackageJsonPath = await resolveDependencyPackageJsonPath(rootDependency, resolver, resolutionErrors);
173
- if (rootDependencyPackageJsonPath) {
174
- break;
175
- }
176
- }
177
- if (!rootDependencyPackageJsonPath) {
178
- throw new Error(`${consumerLabel} requires "${rootDependency}" but it could not be resolved from app or framework dependencies. (${resolutionErrors.join(" | ")})`);
179
- }
180
- const pending = [{
181
- dependency: rootDependency,
182
- packageJsonPath: rootDependencyPackageJsonPath,
183
- }];
184
- const copied = new Set();
185
- while (pending.length > 0) {
186
- const next = pending.shift();
187
- if (!next || copied.has(next.dependency)) {
188
- continue;
189
- }
190
- copied.add(next.dependency);
191
- const sourcePackageJsonPath = next.packageJsonPath;
192
- const sourcePackageRoot = path.dirname(sourcePackageJsonPath);
193
- const targetPackageRoot = dependencyTargetPath(runtimeRoot, next.dependency);
194
- await rm(targetPackageRoot, { recursive: true, force: true });
195
- await mkdir(path.dirname(targetPackageRoot), { recursive: true });
196
- await cp(sourcePackageRoot, targetPackageRoot, {
197
- recursive: true,
198
- force: true,
199
- dereference: true,
200
- });
201
- const packageJson = (await readJsonRecord(sourcePackageJsonPath));
202
- if (!packageJson) {
203
- continue;
204
- }
205
- const dependencyResolver = createRequire(sourcePackageJsonPath);
206
- for (const dependency of runtimeDependencyNames(packageJson.dependencies)) {
207
- const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(dependency, dependencyResolver);
208
- if (!dependencyPackageJsonPath) {
209
- throw new Error(`${consumerLabel} dependency "${next.dependency}" is missing required package "${dependency}".`);
210
- }
211
- pending.push({ dependency, packageJsonPath: dependencyPackageJsonPath });
212
- }
213
- for (const dependency of runtimeDependencyNames(packageJson.optionalDependencies)) {
214
- const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(dependency, dependencyResolver);
215
- if (!dependencyPackageJsonPath) {
216
- continue;
217
- }
218
- pending.push({ dependency, packageJsonPath: dependencyPackageJsonPath });
219
- }
220
- // Peer dependencies are runtime requirements supplied by the consuming app
221
- // rather than nested package dependencies. Include installed peers in the
222
- // serverless closure, but do not fail packaging when an optional/uninstalled
223
- // peer is intentionally absent. This mirrors Node's runtime resolution model
224
- // without treating peer declarations as unconditional npm package imports.
225
- for (const dependency of runtimeDependencyNames(packageJson.peerDependencies)) {
226
- const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(dependency, dependencyResolver);
227
- if (!dependencyPackageJsonPath) {
228
- continue;
229
- }
230
- pending.push({ dependency, packageJsonPath: dependencyPackageJsonPath });
231
- }
232
- }
233
- const requiredDependencyPath = path.join(dependencyTargetPath(runtimeRoot, rootDependency), "package.json");
234
- if (!(await pathExists(requiredDependencyPath))) {
235
- throw new Error(`${consumerLabel} could not prepare "${rootDependency}" for ${runtimeRoot}.`);
236
- }
113
+ async function copyRuntimeDependencyTree(appRoot, runtimeRoot, rootDependency, consumerLabel) {
114
+ const appRequire = createRequire(path.join(appRoot, "package.json"));
115
+ const resuxPackageRequire = resolveResuxPackageRequire(appRequire);
116
+ const rootResolvers = [appRequire, ...resuxPackageRequire ? [resuxPackageRequire] : []];
117
+ const resolutionErrors = [];
118
+ let rootDependencyPackageJsonPath = null;
119
+ for (const resolver of rootResolvers) {
120
+ rootDependencyPackageJsonPath = await resolveDependencyPackageJsonPath(rootDependency, resolver, resolutionErrors);
121
+ if (rootDependencyPackageJsonPath) break;
122
+ }
123
+ if (!rootDependencyPackageJsonPath) throw new Error(`${consumerLabel} requires "${rootDependency}" but it could not be resolved from app or framework dependencies. (${resolutionErrors.join(" | ")})`);
124
+ const pending = [{
125
+ dependency: rootDependency,
126
+ packageJsonPath: rootDependencyPackageJsonPath
127
+ }];
128
+ const copied = /* @__PURE__ */ new Set();
129
+ while (pending.length > 0) {
130
+ const next = pending.shift();
131
+ if (!next || copied.has(next.dependency)) continue;
132
+ copied.add(next.dependency);
133
+ const sourcePackageJsonPath = next.packageJsonPath;
134
+ const sourcePackageRoot = path.dirname(sourcePackageJsonPath);
135
+ const targetPackageRoot = dependencyTargetPath(runtimeRoot, next.dependency);
136
+ await rm(targetPackageRoot, {
137
+ recursive: true,
138
+ force: true
139
+ });
140
+ await mkdir(path.dirname(targetPackageRoot), { recursive: true });
141
+ await cp(sourcePackageRoot, targetPackageRoot, {
142
+ recursive: true,
143
+ force: true,
144
+ dereference: true
145
+ });
146
+ const packageJson = await readJsonRecord(sourcePackageJsonPath);
147
+ if (!packageJson) continue;
148
+ const dependencyResolver = createRequire(sourcePackageJsonPath);
149
+ for (const dependency of runtimeDependencyNames(packageJson.dependencies)) {
150
+ const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(dependency, dependencyResolver);
151
+ if (!dependencyPackageJsonPath) throw new Error(`${consumerLabel} dependency "${next.dependency}" is missing required package "${dependency}".`);
152
+ pending.push({
153
+ dependency,
154
+ packageJsonPath: dependencyPackageJsonPath
155
+ });
156
+ }
157
+ for (const dependency of runtimeDependencyNames(packageJson.optionalDependencies)) {
158
+ const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(dependency, dependencyResolver);
159
+ if (!dependencyPackageJsonPath) continue;
160
+ pending.push({
161
+ dependency,
162
+ packageJsonPath: dependencyPackageJsonPath
163
+ });
164
+ }
165
+ for (const dependency of runtimeDependencyNames(packageJson.peerDependencies)) {
166
+ const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(dependency, dependencyResolver);
167
+ if (!dependencyPackageJsonPath) continue;
168
+ pending.push({
169
+ dependency,
170
+ packageJsonPath: dependencyPackageJsonPath
171
+ });
172
+ }
173
+ }
174
+ const requiredDependencyPath = path.join(dependencyTargetPath(runtimeRoot, rootDependency), "package.json");
175
+ if (!await pathExists(requiredDependencyPath)) throw new Error(`${consumerLabel} could not prepare "${rootDependency}" for ${runtimeRoot}.`);
237
176
  }
238
- export async function ensureRuntimeDependencyTrees(appRoot, runtimeRoots, rootDependency, consumerLabel) {
239
- for (const runtimeRoot of runtimeRoots) {
240
- await copyRuntimeDependencyTree(appRoot, runtimeRoot, rootDependency, consumerLabel);
241
- }
177
+ async function ensureRuntimeDependencyTrees(appRoot, runtimeRoots, rootDependency, consumerLabel) {
178
+ for (const runtimeRoot of runtimeRoots) await copyRuntimeDependencyTree(appRoot, runtimeRoot, rootDependency, consumerLabel);
242
179
  }
243
- export async function ensureServerRuntimeDependencyTrees(appRoot, serverRoot, runtimeRoots, consumerLabel) {
244
- const dependencies = await collectServerRuntimeDependencyNames(serverRoot);
245
- for (const dependency of dependencies) {
246
- await ensureRuntimeDependencyTrees(appRoot, runtimeRoots, dependency, `${consumerLabel} server runtime`);
247
- }
248
- return dependencies;
180
+ async function ensureServerRuntimeDependencyTrees(appRoot, serverRoot, runtimeRoots, consumerLabel) {
181
+ const dependencies = await collectServerRuntimeDependencyNames(serverRoot);
182
+ for (const dependency of dependencies) await ensureRuntimeDependencyTrees(appRoot, runtimeRoots, dependency, `${consumerLabel} server runtime`);
183
+ return dependencies;
249
184
  }
185
+ //#endregion
186
+ export { collectServerRuntimeDependencyNames, copyRuntimeDependencyTree, ensureRuntimeDependencyTrees, ensureServerRuntimeDependencyTrees };
187
+
250
188
  //# sourceMappingURL=runtime-dependencies.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runtime-dependencies.js","sourceRoot":"","sources":["../../src/deploy/runtime-dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAUzD,MAAM,YAAY,GAAG,IAAI,GAAG,CAC1B,cAAc,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;IAC/B,IAAI;IACJ,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,IAAI,E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EAAE,UAAU,EAAE,eAAe,EAAE,yBAAyB,EAAE,CAAC,CAAC;QAC3E,CAAC;IACH,CAAC;IAED,MAAM,sBAAsB,GAAG,IAAI,CAAC,IAAI,CACtC,oBAAoB,CAAC,WAAW,EAAE,cAAc,CAAC,EACjD,cAAc,CACf,CAAC;IACF,IAAI,CAAC,CAAC,MAAM,UAAU,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,KAAK,CACb,GAAG,aAAa,uBAAuB,cAAc,SAAS,WAAW,GAAG,CAC7E,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,OAAe,EACf,YAAsB,EACtB,cAAsB,EACtB,aAAqB;IAErB,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;QACvC,MAAM,yBAAyB,CAC7B,OAAO,EACP,WAAW,EACX,cAAc,EACd,aAAa,CACd,CAAC;IACJ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,kCAAkC,CACtD,OAAe,EACf,UAAkB,EAClB,YAAsB,EACtB,aAAqB;IAErB,MAAM,YAAY,GAAG,MAAM,mCAAmC,CAAC,UAAU,CAAC,CAAC;IAC3E,KAAK,MAAM,UAAU,IAAI,YAAY,EAAE,CAAC;QACtC,MAAM,4BAA4B,CAChC,OAAO,EACP,YAAY,EACZ,UAAU,EACV,GAAG,aAAa,iBAAiB,CAClC,CAAC;IACJ,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC"}
1
+ {"version":3,"file":"runtime-dependencies.js","names":[],"sources":["../../src/deploy/runtime-dependencies.ts"],"sourcesContent":["import { cp, mkdir, readFile, readdir, rm } from \"node:fs/promises\";\nimport { builtinModules, createRequire } from \"node:module\";\nimport path from \"node:path\";\nimport ts from \"typescript\";\nimport { pathExists, readJsonRecord } from \"./common.js\";\n\ninterface PackageRecord extends Record<string, unknown> {\n name?: unknown;\n dependencies?: unknown;\n optionalDependencies?: unknown;\n peerDependencies?: unknown;\n peerDependenciesMeta?: unknown;\n}\n\nconst nodeBuiltins = new Set(\n builtinModules.flatMap((name) => [\n name,\n name.startsWith(\"node:\") ? name.slice(5) : `node:${name}`,\n ]),\n);\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\nfunction runtimeDependencyNames(value: unknown): string[] {\n if (!isRecord(value)) {\n return [];\n }\n return Object.keys(value).filter((name) => name.trim().length > 0);\n}\n\nfunction dependencyTargetPath(runtimeRoot: string, packageName: string): string {\n return path.join(runtimeRoot, \"node_modules\", ...packageName.split(\"/\"));\n}\n\nfunction packageNameFromSpecifier(specifier: string): string | null {\n if (\n !specifier\n || specifier.startsWith(\".\")\n || specifier.startsWith(\"/\")\n || specifier.startsWith(\"#\")\n || specifier.startsWith(\"data:\")\n || specifier.startsWith(\"file:\")\n || nodeBuiltins.has(specifier)\n ) {\n return null;\n }\n\n if (specifier.startsWith(\"@\")) {\n const [scope, name] = specifier.split(\"/\");\n return scope && name ? `${scope}/${name}` : null;\n }\n\n const packageName = specifier.split(\"/\")[0] ?? \"\";\n return packageName && !nodeBuiltins.has(packageName) ? packageName : null;\n}\n\nasync function walkRuntimeModuleFiles(directory: string): Promise<string[]> {\n const entries = await readdir(directory, { withFileTypes: true }).catch(() => []);\n const files: string[] = [];\n\n for (const entry of entries) {\n const fullPath = path.join(directory, entry.name);\n if (entry.isDirectory()) {\n files.push(...(await walkRuntimeModuleFiles(fullPath)));\n continue;\n }\n if (entry.isFile() && /\\.(?:mjs|cjs|js)$/.test(entry.name)) {\n files.push(fullPath);\n }\n }\n\n return files;\n}\n\nfunction collectModuleSpecifiers(sourceFile: ts.SourceFile): string[] {\n const specifiers: string[] = [];\n\n function visit(node: ts.Node): void {\n if (\n (ts.isImportDeclaration(node) || ts.isExportDeclaration(node))\n && node.moduleSpecifier\n && ts.isStringLiteralLike(node.moduleSpecifier)\n ) {\n specifiers.push(node.moduleSpecifier.text);\n } else if (\n ts.isCallExpression(node)\n && node.expression.kind === ts.SyntaxKind.ImportKeyword\n && node.arguments.length === 1\n && ts.isStringLiteralLike(node.arguments[0])\n ) {\n specifiers.push(node.arguments[0].text);\n }\n\n ts.forEachChild(node, visit);\n }\n\n visit(sourceFile);\n return specifiers;\n}\n\nexport async function collectServerRuntimeDependencyNames(\n serverRoot: string,\n): Promise<string[]> {\n if (!(await pathExists(serverRoot))) {\n return [];\n }\n\n const dependencyNames = new Set<string>();\n\n for (const file of await walkRuntimeModuleFiles(serverRoot)) {\n const source = await readFile(file, \"utf8\");\n const sourceFile = ts.createSourceFile(\n file,\n source,\n ts.ScriptTarget.Latest,\n false,\n ts.ScriptKind.JS,\n );\n\n for (const specifier of collectModuleSpecifiers(sourceFile)) {\n const packageName = packageNameFromSpecifier(specifier);\n if (packageName && packageName !== \"resuxjs\" && packageName !== \"resux\") {\n dependencyNames.add(packageName);\n }\n }\n }\n\n return [...dependencyNames].sort();\n}\n\nfunction resolveResuxPackageRequire(\n appRequire: ReturnType<typeof createRequire>,\n): ReturnType<typeof createRequire> | null {\n for (const packageName of [\"resuxjs\", \"resux\"]) {\n try {\n return createRequire(appRequire.resolve(packageName));\n } catch {\n try {\n return createRequire(appRequire.resolve(`${packageName}/package.json`));\n } catch {\n // Keep trying known package names.\n }\n }\n }\n return null;\n}\n\nfunction formatResolutionError(error: unknown): string {\n return error instanceof Error ? error.message : String(error);\n}\n\nasync function findPackageJsonFromEntry(\n dependency: string,\n entryPath: string,\n): Promise<string | null> {\n let currentDirectory = path.dirname(entryPath);\n\n while (true) {\n const candidate = path.join(currentDirectory, \"package.json\");\n const packageJson = (await readJsonRecord(candidate)) as PackageRecord | null;\n if (packageJson?.name === dependency) {\n return candidate;\n }\n\n const parentDirectory = path.dirname(currentDirectory);\n if (parentDirectory === currentDirectory) {\n return null;\n }\n currentDirectory = parentDirectory;\n }\n}\n\nasync function findPackageJsonFromSearchPaths(\n dependency: string,\n resolver: ReturnType<typeof createRequire>,\n): Promise<string | null> {\n const searchPaths = resolver.resolve.paths(dependency) ?? [];\n for (const nodeModulesRoot of searchPaths) {\n const candidate = path.join(\n nodeModulesRoot,\n ...dependency.split(\"/\"),\n \"package.json\",\n );\n const packageJson = (await readJsonRecord(candidate)) as PackageRecord | null;\n if (packageJson?.name === dependency) {\n return candidate;\n }\n }\n return null;\n}\n\nasync function resolveDependencyPackageJsonPath(\n dependency: string,\n resolver: ReturnType<typeof createRequire>,\n resolutionErrors?: string[],\n): Promise<string | null> {\n let entryResolutionError: unknown = null;\n try {\n const entryPath = resolver.resolve(dependency);\n const packageJsonPath = await findPackageJsonFromEntry(dependency, entryPath);\n if (packageJsonPath) {\n return packageJsonPath;\n }\n entryResolutionError = new Error(\n `Resolved \"${dependency}\" to ${entryPath}, but its package root could not be located.`,\n );\n } catch (error) {\n entryResolutionError = error;\n }\n\n // Native packages such as @img/sharp-linux-x64 intentionally expose only\n // specific subpaths, so neither the package root nor ./package.json is\n // necessarily resolvable through exports. Node still exposes the node_modules\n // lookup roots; inspect those roots directly without bypassing package identity.\n const searchPathPackageJson = await findPackageJsonFromSearchPaths(dependency, resolver);\n if (searchPathPackageJson) {\n return searchPathPackageJson;\n }\n\n // Preserve compatibility with packages that explicitly export package.json.\n try {\n return resolver.resolve(`${dependency}/package.json`);\n } catch (packageJsonError) {\n resolutionErrors?.push(\n `${formatResolutionError(entryResolutionError)} | ${formatResolutionError(packageJsonError)}`,\n );\n return null;\n }\n}\n\nexport async function copyRuntimeDependencyTree(\n appRoot: string,\n runtimeRoot: string,\n rootDependency: string,\n consumerLabel: string,\n): Promise<void> {\n const appRequire = createRequire(path.join(appRoot, \"package.json\"));\n const resuxPackageRequire = resolveResuxPackageRequire(appRequire);\n const rootResolvers = [appRequire, ...(resuxPackageRequire ? [resuxPackageRequire] : [])];\n const resolutionErrors: string[] = [];\n let rootDependencyPackageJsonPath: string | null = null;\n\n for (const resolver of rootResolvers) {\n rootDependencyPackageJsonPath = await resolveDependencyPackageJsonPath(\n rootDependency,\n resolver,\n resolutionErrors,\n );\n if (rootDependencyPackageJsonPath) {\n break;\n }\n }\n\n if (!rootDependencyPackageJsonPath) {\n throw new Error(\n `${consumerLabel} requires \"${rootDependency}\" but it could not be resolved from app or framework dependencies. (${resolutionErrors.join(\" | \")})`,\n );\n }\n\n const pending = [{\n dependency: rootDependency,\n packageJsonPath: rootDependencyPackageJsonPath,\n }];\n const copied = new Set<string>();\n\n while (pending.length > 0) {\n const next = pending.shift();\n if (!next || copied.has(next.dependency)) {\n continue;\n }\n copied.add(next.dependency);\n\n const sourcePackageJsonPath = next.packageJsonPath;\n const sourcePackageRoot = path.dirname(sourcePackageJsonPath);\n const targetPackageRoot = dependencyTargetPath(runtimeRoot, next.dependency);\n\n await rm(targetPackageRoot, { recursive: true, force: true });\n await mkdir(path.dirname(targetPackageRoot), { recursive: true });\n await cp(sourcePackageRoot, targetPackageRoot, {\n recursive: true,\n force: true,\n dereference: true,\n });\n\n const packageJson = (await readJsonRecord(sourcePackageJsonPath)) as PackageRecord | null;\n if (!packageJson) {\n continue;\n }\n\n const dependencyResolver = createRequire(sourcePackageJsonPath);\n for (const dependency of runtimeDependencyNames(packageJson.dependencies)) {\n const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(\n dependency,\n dependencyResolver,\n );\n if (!dependencyPackageJsonPath) {\n throw new Error(\n `${consumerLabel} dependency \"${next.dependency}\" is missing required package \"${dependency}\".`,\n );\n }\n pending.push({ dependency, packageJsonPath: dependencyPackageJsonPath });\n }\n\n for (const dependency of runtimeDependencyNames(packageJson.optionalDependencies)) {\n const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(\n dependency,\n dependencyResolver,\n );\n if (!dependencyPackageJsonPath) {\n continue;\n }\n pending.push({ dependency, packageJsonPath: dependencyPackageJsonPath });\n }\n\n // Peer dependencies are runtime requirements supplied by the consuming app\n // rather than nested package dependencies. Include installed peers in the\n // serverless closure, but do not fail packaging when an optional/uninstalled\n // peer is intentionally absent. This mirrors Node's runtime resolution model\n // without treating peer declarations as unconditional npm package imports.\n for (const dependency of runtimeDependencyNames(packageJson.peerDependencies)) {\n const dependencyPackageJsonPath = await resolveDependencyPackageJsonPath(\n dependency,\n dependencyResolver,\n );\n if (!dependencyPackageJsonPath) {\n continue;\n }\n pending.push({ dependency, packageJsonPath: dependencyPackageJsonPath });\n }\n }\n\n const requiredDependencyPath = path.join(\n dependencyTargetPath(runtimeRoot, rootDependency),\n \"package.json\",\n );\n if (!(await pathExists(requiredDependencyPath))) {\n throw new Error(\n `${consumerLabel} could not prepare \"${rootDependency}\" for ${runtimeRoot}.`,\n );\n }\n}\n\nexport async function ensureRuntimeDependencyTrees(\n appRoot: string,\n runtimeRoots: string[],\n rootDependency: string,\n consumerLabel: string,\n): Promise<void> {\n for (const runtimeRoot of runtimeRoots) {\n await copyRuntimeDependencyTree(\n appRoot,\n runtimeRoot,\n rootDependency,\n consumerLabel,\n );\n }\n}\n\nexport async function ensureServerRuntimeDependencyTrees(\n appRoot: string,\n serverRoot: string,\n runtimeRoots: string[],\n consumerLabel: string,\n): Promise<string[]> {\n const dependencies = await collectServerRuntimeDependencyNames(serverRoot);\n for (const dependency of dependencies) {\n await ensureRuntimeDependencyTrees(\n appRoot,\n runtimeRoots,\n dependency,\n `${consumerLabel} server runtime`,\n );\n }\n return dependencies;\n}"],"mappings":";;;;;;AAcA,MAAM,eAAe,IAAI,IACvB,eAAe,SAAS,SAAS,CAC/B,MACA,KAAK,WAAW,OAAO,IAAI,KAAK,MAAM,CAAC,IAAI,QAAQ,MACrD,CAAC,CACH;AAEA,SAAS,SAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;AAEA,SAAS,uBAAuB,OAA0B;CACxD,IAAI,CAAC,SAAS,KAAK,GACjB,OAAO,CAAC;CAEV,OAAO,OAAO,KAAK,KAAK,CAAC,CAAC,QAAQ,SAAS,KAAK,KAAK,CAA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;IAAE;IAAY,iBAAiB;GAA0B,CAAC;EACzE;EAOA,KAAK,MAAM,cAAc,uBAAuB,YAAY,gBAAgB,GAAG;GAC7E,MAAM,4BAA4B,MAAM,iCACtC,YACA,kBACF;GACA,IAAI,CAAC,2BACH;GAEF,QAAQ,KAAK;IAAE;IAAY,iBAAiB;GAA0B,CAAC;EACzE;CACF;CAEA,MAAM,yBAAyB,KAAK,KAClC,qBAAqB,aAAa,cAAc,GAChD,cACF;CACA,IAAI,CAAE,MAAM,WAAW,sBAAsB,GAC3C,MAAM,IAAI,MACR,GAAG,cAAc,sBAAsB,eAAe,QAAQ,YAAY,EAC5E;AAEJ;AAEA,eAAsB,6BACpB,SACA,cACA,gBACA,eACe;CACf,KAAK,MAAM,eAAe,cACxB,MAAM,0BACJ,SACA,aACA,gBACA,aACF;AAEJ;AAEA,eAAsB,mCACpB,SACA,YACA,cACA,eACmB;CACnB,MAAM,eAAe,MAAM,oCAAoC,UAAU;CACzE,KAAK,MAAM,cAAc,cACvB,MAAM,6BACJ,SACA,cACA,YACA,GAAG,cAAc,gBACnB;CAEF,OAAO;AACT"}
@@ -1,2 +1,5 @@
1
- import type { DeployTargetModule } from "./types.js";
1
+ import { DeployTargetModule } from "./types.js";
2
+ //#region src/deploy/static.d.ts
2
3
  export declare const staticDeployModule: DeployTargetModule;
4
+ //#endregion
5
+ //# sourceMappingURL=static.d.ts.map
@@ -1,19 +1,21 @@
1
- import path from "node:path";
2
1
  import { assertRuntimeClientAsset, ensureResuxClientAssets } from "./common.js";
2
+ import path from "node:path";
3
+ //#region src/deploy/static.ts
3
4
  async function postBuild(context) {
4
- await ensureResuxClientAssets(context.appRoot, [
5
- {
6
- root: path.join(context.appRoot, ".output"),
7
- target: path.join(context.appRoot, ".output", "public", "__resux"),
8
- },
9
- ]);
10
- await assertRuntimeClientAsset(path.join(context.appRoot, ".output", "public"));
5
+ await ensureResuxClientAssets(context.appRoot, [{
6
+ root: path.join(context.appRoot, ".output"),
7
+ target: path.join(context.appRoot, ".output", "public", "__resux")
8
+ }]);
9
+ await assertRuntimeClientAsset(path.join(context.appRoot, ".output", "public"));
11
10
  }
12
- export const staticDeployModule = {
13
- target: "static",
14
- presetAliases: ["static", "_static"],
15
- outputLabel: ".output/public",
16
- inferPreset: () => "static",
17
- postBuild,
11
+ const staticDeployModule = {
12
+ target: "static",
13
+ presetAliases: ["static", "_static"],
14
+ outputLabel: ".output/public",
15
+ inferPreset: () => "static",
16
+ postBuild
18
17
  };
18
+ //#endregion
19
+ export { staticDeployModule };
20
+
19
21
  //# sourceMappingURL=static.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"static.js","sourceRoot":"","sources":["../../src/deploy/static.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AAGhF,KAAK,UAAU,SAAS,CAAC,OAA2B;IAClD,MAAM,uBAAuB,CAAC,OAAO,CAAC,OAAO,EAAE;QAC7C;YACE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC;YAC3C,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS,CAAC;SACnE;KACF,CAAC,CAAC;IAEH,MAAM,wBAAwB,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAuB;IACpD,MAAM,EAAE,QAAQ;IAChB,aAAa,EAAE,CAAC,QAAQ,EAAE,SAAS,CAAC;IACpC,WAAW,EAAE,gBAAgB;IAC7B,WAAW,EAAE,GAAG,EAAE,CAAC,QAAQ;IAC3B,SAAS;CACV,CAAC"}
1
+ {"version":3,"file":"static.js","names":[],"sources":["../../src/deploy/static.ts"],"sourcesContent":["import path from \"node:path\";\nimport { assertRuntimeClientAsset, ensureResuxClientAssets } from \"./common.js\";\nimport type { DeployBuildContext, DeployTargetModule } from \"./types.js\";\n\nasync function postBuild(context: DeployBuildContext): Promise<void> {\n await ensureResuxClientAssets(context.appRoot, [\n {\n root: path.join(context.appRoot, \".output\"),\n target: path.join(context.appRoot, \".output\", \"public\", \"__resux\"),\n },\n ]);\n\n await assertRuntimeClientAsset(path.join(context.appRoot, \".output\", \"public\"));\n}\n\nexport const staticDeployModule: DeployTargetModule = {\n target: \"static\",\n presetAliases: [\"static\", \"_static\"],\n outputLabel: \".output/public\",\n inferPreset: () => \"static\",\n postBuild,\n};\n"],"mappings":";;;AAIA,eAAe,UAAU,SAA4C;CACnE,MAAM,wBAAwB,QAAQ,SAAS,CAC7C;EACE,MAAM,KAAK,KAAK,QAAQ,SAAS,SAAS;EAC1C,QAAQ,KAAK,KAAK,QAAQ,SAAS,WAAW,UAAU,SAAS;CACnE,CACF,CAAC;CAED,MAAM,yBAAyB,KAAK,KAAK,QAAQ,SAAS,WAAW,QAAQ,CAAC;AAChF;AAEA,MAAa,qBAAyC;CACpD,QAAQ;CACR,eAAe,CAAC,UAAU,SAAS;CACnC,aAAa;CACb,mBAAmB;CACnB;AACF"}
@@ -1,34 +1,37 @@
1
+ //#region src/deploy/types.d.ts
1
2
  export type ResuxDeployTarget = "auto" | "node" | "vercel" | "netlify" | "cloudflare" | "static";
2
3
  export type ResuxResolvedDeployTarget = Exclude<ResuxDeployTarget, "auto">;
3
4
  export interface ResuxDeployConfig {
4
- target?: ResuxDeployTarget;
5
- nitroPreset?: string;
5
+ target?: ResuxDeployTarget;
6
+ nitroPreset?: string;
6
7
  }
7
8
  export interface DeployBuildContext {
8
- appRoot: string;
9
- outDir: string;
10
- env: NodeJS.ProcessEnv;
11
- nitroPreset: string | null;
12
- target: ResuxResolvedDeployTarget;
9
+ appRoot: string;
10
+ outDir: string;
11
+ env: NodeJS.ProcessEnv;
12
+ nitroPreset: string | null;
13
+ target: ResuxResolvedDeployTarget;
13
14
  }
14
15
  export interface DeployDetectionContext {
15
- appRoot: string;
16
- outDir: string;
17
- env: NodeJS.ProcessEnv;
18
- explicitNitroPreset: string | null;
19
- deployConfig: ResuxDeployConfig;
16
+ appRoot: string;
17
+ outDir: string;
18
+ env: NodeJS.ProcessEnv;
19
+ explicitNitroPreset: string | null;
20
+ deployConfig: ResuxDeployConfig;
20
21
  }
21
22
  export interface DeployTargetModule {
22
- target: ResuxResolvedDeployTarget;
23
- presetAliases: string[];
24
- outputLabel: string;
25
- detect?(context: DeployDetectionContext): Promise<boolean>;
26
- inferPreset?(context: DeployDetectionContext): string | null;
27
- postBuild?(context: DeployBuildContext): Promise<void>;
23
+ target: ResuxResolvedDeployTarget;
24
+ presetAliases: string[];
25
+ outputLabel: string;
26
+ detect?(context: DeployDetectionContext): Promise<boolean>;
27
+ inferPreset?(context: DeployDetectionContext): string | null;
28
+ postBuild?(context: DeployBuildContext): Promise<void>;
28
29
  }
29
30
  export interface DeploymentResolution {
30
- target: ResuxResolvedDeployTarget;
31
- nitroPreset: string | null;
32
- outputLabel: string;
33
- reason: string;
31
+ target: ResuxResolvedDeployTarget;
32
+ nitroPreset: string | null;
33
+ outputLabel: string;
34
+ reason: string;
34
35
  }
36
+ //#endregion
37
+ //# sourceMappingURL=types.d.ts.map
@@ -1,2 +1 @@
1
1
  export {};
2
- //# sourceMappingURL=types.js.map
@@ -1,3 +1,6 @@
1
- import type { DeployTargetModule } from "./types.js";
1
+ import { DeployTargetModule } from "./types.js";
2
+ //#region src/deploy/vercel.d.ts
2
3
  export declare function resolveVercelNodeRuntime(nodeVersion?: string): string;
3
4
  export declare const vercelDeployModule: DeployTargetModule;
5
+ //#endregion
6
+ //# sourceMappingURL=vercel.d.ts.map