@velastack/patterns 0.13.0 → 0.13.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 (228) hide show
  1. package/dist/chunks/{_layout-DQhSAhfF.js → _layout-xBzFhszN.js} +36 -20
  2. package/dist/chunks/_layout-xBzFhszN.js.map +1 -0
  3. package/dist/chunks/{_page-C7kGoW7_.js → _page-44USwLXO.js} +2 -3
  4. package/dist/chunks/{_page-C7kGoW7_.js.map → _page-44USwLXO.js.map} +1 -1
  5. package/dist/chunks/{_page-DoPdZgZv.js → _page-Bt37d4uo.js} +2 -3
  6. package/dist/chunks/_page-Bt37d4uo.js.map +1 -0
  7. package/dist/chunks/{_page-B6yd6_Vl.js → _page-DcbEFpyw.js} +2 -3
  8. package/dist/chunks/_page-DcbEFpyw.js.map +1 -0
  9. package/dist/chunks/{auth-pages-jsyDV1GR.js → auth-pages-BW3_yluN.js} +6 -9
  10. package/dist/chunks/{auth-pages-jsyDV1GR.js.map → auth-pages-BW3_yluN.js.map} +1 -1
  11. package/dist/chunks/{collections-DZOuRpvS.js → collections-CFW9ZqUE.js} +5 -7
  12. package/dist/chunks/{collections-DZOuRpvS.js.map → collections-CFW9ZqUE.js.map} +1 -1
  13. package/dist/chunks/{collections-zEoRuILr.js → collections-D-xbHi4M.js} +39 -45
  14. package/dist/chunks/{collections-zEoRuILr.js.map → collections-D-xbHi4M.js.map} +1 -1
  15. package/dist/chunks/{compose-handle-BBlamPfx.js → compose-handle-Da7m6lV_.js} +3 -4
  16. package/dist/chunks/{compose-handle-BBlamPfx.js.map → compose-handle-Da7m6lV_.js.map} +1 -1
  17. package/dist/chunks/{config-target-BgyFkbFL.js → config-target-DJbVHwHl.js} +3 -4
  18. package/dist/chunks/{config-target-BgyFkbFL.js.map → config-target-DJbVHwHl.js.map} +1 -1
  19. package/dist/chunks/{constants-CUv536Rj.js → constants-DpK-r_m5.js} +2 -4
  20. package/dist/chunks/{constants-CUv536Rj.js.map → constants-DpK-r_m5.js.map} +1 -1
  21. package/dist/chunks/{currency.server-DygAf6a1.js → currency.server-BwuXG0a9.js} +9 -11
  22. package/dist/chunks/{currency.server-DygAf6a1.js.map → currency.server-BwuXG0a9.js.map} +1 -1
  23. package/dist/chunks/{dedent-Gq6Krl4n.js → dedent-CCUOcPFW.js} +2 -3
  24. package/dist/chunks/{dedent-Gq6Krl4n.js.map → dedent-CCUOcPFW.js.map} +1 -1
  25. package/dist/chunks/{dispatch-BIvOwbKN.js → dispatch-BxlKS_5v.js} +2 -3
  26. package/dist/chunks/{dispatch-BIvOwbKN.js.map → dispatch-BxlKS_5v.js.map} +1 -1
  27. package/dist/chunks/{env-BugddEjd.js → env-AxyRWcC_.js} +2 -3
  28. package/dist/chunks/{env-BugddEjd.js.map → env-AxyRWcC_.js.map} +1 -1
  29. package/dist/chunks/{env-vars-mnRA0hOe.js → env-vars-CUh4mLM_.js} +2 -3
  30. package/dist/chunks/{env-vars-mnRA0hOe.js.map → env-vars-CUh4mLM_.js.map} +1 -1
  31. package/dist/chunks/{env-vars-XvAeH6u5.js → env-vars-CVn2076k.js} +58 -59
  32. package/dist/chunks/{env-vars-XvAeH6u5.js.map → env-vars-CVn2076k.js.map} +1 -1
  33. package/dist/chunks/{env-vars-Cr4lbMD_.js → env-vars-T3_7JNSg.js} +3 -4
  34. package/dist/chunks/{env-vars-Cr4lbMD_.js.map → env-vars-T3_7JNSg.js.map} +1 -1
  35. package/dist/chunks/{env-vars-file-B_6esJW3.js → env-vars-file-B2zHQZqO.js} +2 -3
  36. package/dist/chunks/{env-vars-file-B_6esJW3.js.map → env-vars-file-B2zHQZqO.js.map} +1 -1
  37. package/dist/chunks/{env.preview-uMRKT5Pc.js → env.preview-C676UTOP.js} +2 -3
  38. package/dist/chunks/{env.preview-uMRKT5Pc.js.map → env.preview-C676UTOP.js.map} +1 -1
  39. package/dist/chunks/{errors-DR3gF_7a.js → errors-DdSUZI8f.js} +2 -3
  40. package/dist/chunks/{errors-DR3gF_7a.js.map → errors-DdSUZI8f.js.map} +1 -1
  41. package/dist/chunks/{format-result-BVoLVknk.js → format-result-CojavkIZ.js} +2 -3
  42. package/dist/chunks/{format-result-BVoLVknk.js.map → format-result-CojavkIZ.js.map} +1 -1
  43. package/dist/chunks/{generate-Cbg-Z3sA.js → generate-BCYvhyF9.js} +62 -63
  44. package/dist/chunks/{generate-Cbg-Z3sA.js.map → generate-BCYvhyF9.js.map} +1 -1
  45. package/dist/chunks/{generate-DyV5R8NP.js → generate-CKuUg3p-.js} +3 -4
  46. package/dist/chunks/{generate-DyV5R8NP.js.map → generate-CKuUg3p-.js.map} +1 -1
  47. package/dist/chunks/{generate-DjuhSibA.js → generate-CY_Ii_bz.js} +61 -64
  48. package/dist/chunks/{generate-DjuhSibA.js.map → generate-CY_Ii_bz.js.map} +1 -1
  49. package/dist/chunks/generate-CuOm66dn.js +57 -0
  50. package/dist/chunks/{generate-BtWZCvuO.js.map → generate-CuOm66dn.js.map} +1 -1
  51. package/dist/chunks/{generate-BrOPb9tW.js → generate-DYq5Oj58.js} +3 -4
  52. package/dist/chunks/{generate-BrOPb9tW.js.map → generate-DYq5Oj58.js.map} +1 -1
  53. package/dist/chunks/{generate-Crdzw45a.js → generate-F4FDWvFo.js} +13 -14
  54. package/dist/chunks/{generate-Crdzw45a.js.map → generate-F4FDWvFo.js.map} +1 -1
  55. package/dist/chunks/{generate-DgZhFNjO.js → generate-oZ1QeqPr.js} +17 -19
  56. package/dist/chunks/{generate-DgZhFNjO.js.map → generate-oZ1QeqPr.js.map} +1 -1
  57. package/dist/chunks/{generate.runtime-ByC9kOl2.js → generate.runtime-22jW8aVT.js} +37 -41
  58. package/dist/chunks/{generate.runtime-ByC9kOl2.js.map → generate.runtime-22jW8aVT.js.map} +1 -1
  59. package/dist/chunks/{generate.runtime-BfQlxsWK.js → generate.runtime-B06rPt_j.js} +103 -108
  60. package/dist/chunks/{generate.runtime-BfQlxsWK.js.map → generate.runtime-B06rPt_j.js.map} +1 -1
  61. package/dist/chunks/{generate.runtime-s9ai7PxV.js → generate.runtime-B6FeCL5I.js} +85 -90
  62. package/dist/chunks/{generate.runtime-s9ai7PxV.js.map → generate.runtime-B6FeCL5I.js.map} +1 -1
  63. package/dist/chunks/{generate.runtime-DzCVGruq.js → generate.runtime-BgGeOqYG.js} +19 -21
  64. package/dist/chunks/{generate.runtime-DzCVGruq.js.map → generate.runtime-BgGeOqYG.js.map} +1 -1
  65. package/dist/chunks/{generate.runtime-USnFqTbU.js → generate.runtime-Bv_16lWi.js} +94 -99
  66. package/dist/chunks/{generate.runtime-USnFqTbU.js.map → generate.runtime-Bv_16lWi.js.map} +1 -1
  67. package/dist/chunks/generate.runtime-Bz9z0VPR.js +108 -0
  68. package/dist/chunks/{generate.runtime-DVUj1LJK.js.map → generate.runtime-Bz9z0VPR.js.map} +1 -1
  69. package/dist/chunks/{generate.runtime-CHaE6Mm9.js → generate.runtime-C37djibw.js} +25 -27
  70. package/dist/chunks/{generate.runtime-CHaE6Mm9.js.map → generate.runtime-C37djibw.js.map} +1 -1
  71. package/dist/chunks/{generate.runtime-BsjcGBme.js → generate.runtime-CM3bj0nP.js} +12 -14
  72. package/dist/chunks/{generate.runtime-BsjcGBme.js.map → generate.runtime-CM3bj0nP.js.map} +1 -1
  73. package/dist/chunks/generate.runtime-CMuxVUIY.js +46 -0
  74. package/dist/chunks/{generate.runtime-BfM3dX_R.js.map → generate.runtime-CMuxVUIY.js.map} +1 -1
  75. package/dist/chunks/{generate.runtime-DRZDjZqw.js → generate.runtime-CVqPHddZ.js} +44 -46
  76. package/dist/chunks/generate.runtime-CVqPHddZ.js.map +1 -0
  77. package/dist/chunks/{generate.runtime-CEd3qCtW.js → generate.runtime-C_SdcnRs.js} +44 -47
  78. package/dist/chunks/generate.runtime-C_SdcnRs.js.map +1 -0
  79. package/dist/chunks/generate.runtime-Cco2mFW2.js +63 -0
  80. package/dist/chunks/{generate.runtime-taYl9Tg5.js.map → generate.runtime-Cco2mFW2.js.map} +1 -1
  81. package/dist/chunks/generate.runtime-Cg-dfN9B.js +48 -0
  82. package/dist/chunks/{generate.runtime-TKR-qAJM.js.map → generate.runtime-Cg-dfN9B.js.map} +1 -1
  83. package/dist/chunks/{generate.runtime-DqYYJXAz.js → generate.runtime-CjqX4tDg.js} +5 -6
  84. package/dist/chunks/{generate.runtime-DqYYJXAz.js.map → generate.runtime-CjqX4tDg.js.map} +1 -1
  85. package/dist/chunks/generate.runtime-Cry-DBNl.js +111 -0
  86. package/dist/chunks/{generate.runtime-2GD2E1NK.js.map → generate.runtime-Cry-DBNl.js.map} +1 -1
  87. package/dist/chunks/{generate.runtime-DGmpjkRe.js → generate.runtime-Ct7cG8va.js} +76 -79
  88. package/dist/chunks/generate.runtime-Ct7cG8va.js.map +1 -0
  89. package/dist/chunks/generate.runtime-Cxg1b_BK.js +63 -0
  90. package/dist/chunks/{generate.runtime-CXGiQWDK.js.map → generate.runtime-Cxg1b_BK.js.map} +1 -1
  91. package/dist/chunks/{generate.runtime-4TxcYKld.js → generate.runtime-CyWuhV6m.js} +16 -18
  92. package/dist/chunks/{generate.runtime-4TxcYKld.js.map → generate.runtime-CyWuhV6m.js.map} +1 -1
  93. package/dist/chunks/generate.runtime-CzYArKUA.js +42 -0
  94. package/dist/chunks/{generate.runtime-g6qaIY3k.js.map → generate.runtime-CzYArKUA.js.map} +1 -1
  95. package/dist/chunks/{generate.runtime-C_5Ghjri.js → generate.runtime-D769VJFt.js} +3 -4
  96. package/dist/chunks/{generate.runtime-C_5Ghjri.js.map → generate.runtime-D769VJFt.js.map} +1 -1
  97. package/dist/chunks/{generate.runtime-C9yduilW.js → generate.runtime-DICcLOts.js} +19 -22
  98. package/dist/chunks/{generate.runtime-C9yduilW.js.map → generate.runtime-DICcLOts.js.map} +1 -1
  99. package/dist/chunks/generate.runtime-DLg2CKxQ.js +341 -0
  100. package/dist/chunks/generate.runtime-DLg2CKxQ.js.map +1 -0
  101. package/dist/chunks/{generate.runtime-C2pIioyZ.js → generate.runtime-DaPA2NNL.js} +47 -50
  102. package/dist/chunks/{generate.runtime-C2pIioyZ.js.map → generate.runtime-DaPA2NNL.js.map} +1 -1
  103. package/dist/chunks/{generate.runtime-B2DI0x05.js → generate.runtime-DfHFd8xs.js} +36 -44
  104. package/dist/chunks/{generate.runtime-B2DI0x05.js.map → generate.runtime-DfHFd8xs.js.map} +1 -1
  105. package/dist/chunks/generate.runtime-Dfl-07VS.js +428 -0
  106. package/dist/chunks/generate.runtime-Dfl-07VS.js.map +1 -0
  107. package/dist/chunks/{generate.runtime-BO1KyRcJ.js → generate.runtime-DhNspd-h.js} +64 -76
  108. package/dist/chunks/generate.runtime-DhNspd-h.js.map +1 -0
  109. package/dist/chunks/{generate.runtime-BPVZsAL0.js → generate.runtime-DkS7CBmK.js} +8 -10
  110. package/dist/chunks/{generate.runtime-BPVZsAL0.js.map → generate.runtime-DkS7CBmK.js.map} +1 -1
  111. package/dist/chunks/generate.runtime-Dtae524O.js +34 -0
  112. package/dist/chunks/{generate.runtime-Du8puIJQ.js.map → generate.runtime-Dtae524O.js.map} +1 -1
  113. package/dist/chunks/{generate.runtime-CvtSK0E1.js → generate.runtime-EB8vpc7D.js} +57 -66
  114. package/dist/chunks/{generate.runtime-CvtSK0E1.js.map → generate.runtime-EB8vpc7D.js.map} +1 -1
  115. package/dist/chunks/{generate.runtime-UrLaWKvN.js → generate.runtime-TCVlsBbJ.js} +7 -8
  116. package/dist/chunks/{generate.runtime-UrLaWKvN.js.map → generate.runtime-TCVlsBbJ.js.map} +1 -1
  117. package/dist/chunks/{generate.runtime-B8y_l-6N.js → generate.runtime-YFyuyFhh.js} +108 -132
  118. package/dist/chunks/generate.runtime-YFyuyFhh.js.map +1 -0
  119. package/dist/chunks/{generate.runtime-bWGwyz2U.js → generate.runtime-cYh0CQ5d.js} +36 -41
  120. package/dist/chunks/{generate.runtime-bWGwyz2U.js.map → generate.runtime-cYh0CQ5d.js.map} +1 -1
  121. package/dist/chunks/generate.runtime-erWI6j7m.js +64 -0
  122. package/dist/chunks/{generate.runtime-B-WOQsda.js.map → generate.runtime-erWI6j7m.js.map} +1 -1
  123. package/dist/chunks/{generate.runtime-DI73x08q.js → generate.runtime-hq8xt0m_.js} +21 -23
  124. package/dist/chunks/generate.runtime-hq8xt0m_.js.map +1 -0
  125. package/dist/chunks/{generate.runtime-C4hyve9h.js → generate.runtime-i3tMIA1A.js} +85 -108
  126. package/dist/chunks/{generate.runtime-C4hyve9h.js.map → generate.runtime-i3tMIA1A.js.map} +1 -1
  127. package/dist/chunks/generate.runtime-j_5K3Uue.js +120 -0
  128. package/dist/chunks/generate.runtime-j_5K3Uue.js.map +1 -0
  129. package/dist/chunks/{generate.runtime-BEvi6bml.js → generate.runtime-mE0knt2T.js} +34 -38
  130. package/dist/chunks/{generate.runtime-BEvi6bml.js.map → generate.runtime-mE0knt2T.js.map} +1 -1
  131. package/dist/chunks/{layout.svelte-Cb12mxua.js → layout.svelte-B6wOQ7SM.js} +10 -11
  132. package/dist/chunks/{layout.svelte-Cb12mxua.js.map → layout.svelte-B6wOQ7SM.js.map} +1 -1
  133. package/dist/chunks/{lib-specifier-Cngo1zF_.js → lib-specifier-C3M0WTev.js} +2 -3
  134. package/dist/chunks/{lib-specifier-Cngo1zF_.js.map → lib-specifier-C3M0WTev.js.map} +1 -1
  135. package/dist/chunks/{load-function-Dmkhg1pQ.js → load-function-BFvIVsh7.js} +3 -4
  136. package/dist/chunks/{load-function-Dmkhg1pQ.js.map → load-function-BFvIVsh7.js.map} +1 -1
  137. package/dist/chunks/{logger-CQONztPm.js → logger-t1HxmpG2.js} +2 -3
  138. package/dist/chunks/{logger-CQONztPm.js.map → logger-t1HxmpG2.js.map} +1 -1
  139. package/dist/chunks/{modify-file-D9U2LXEa.js → modify-file-CRZ_gMg0.js} +7 -10
  140. package/dist/chunks/{modify-file-D9U2LXEa.js.map → modify-file-CRZ_gMg0.js.map} +1 -1
  141. package/dist/chunks/{modify-nav-user-CJ1LevSU.js → modify-nav-user--7OwY9fI.js} +7 -16
  142. package/dist/chunks/{modify-nav-user-CJ1LevSU.js.map → modify-nav-user--7OwY9fI.js.map} +1 -1
  143. package/dist/chunks/{modify-nav-user-iUpv2lm-.js → modify-nav-user-D42kWyU6.js} +8 -14
  144. package/dist/chunks/{modify-nav-user-iUpv2lm-.js.map → modify-nav-user-D42kWyU6.js.map} +1 -1
  145. package/dist/chunks/modify-svelte-config-remote-wE5K2bU_.js +20 -0
  146. package/dist/chunks/{modify-svelte-config-remote-CEyYydL7.js.map → modify-svelte-config-remote-wE5K2bU_.js.map} +1 -1
  147. package/dist/chunks/{modify-user-signup-DLtopazD.js → modify-user-signup-ENhadGKH.js} +5 -6
  148. package/dist/chunks/{modify-user-signup-DLtopazD.js.map → modify-user-signup-ENhadGKH.js.map} +1 -1
  149. package/dist/chunks/{modify-utils-Cw-on_cL.js → modify-utils--zro3IGe.js} +3 -4
  150. package/dist/chunks/{modify-utils-Cw-on_cL.js.map → modify-utils--zro3IGe.js.map} +1 -1
  151. package/dist/chunks/{package-imports-B9Asv3ZH.js → package-imports-CcIIHbp5.js} +3 -4
  152. package/dist/chunks/{package-imports-B9Asv3ZH.js.map → package-imports-CcIIHbp5.js.map} +1 -1
  153. package/dist/chunks/{pocketbase-C5GS-Dh5.js → pocketbase-CvsJYXj-.js} +2 -3
  154. package/dist/chunks/{pocketbase-C5GS-Dh5.js.map → pocketbase-CvsJYXj-.js.map} +1 -1
  155. package/dist/chunks/{pocketbase-DpudAAmd.js → pocketbase-YG9yht8R.js} +2 -3
  156. package/dist/chunks/{pocketbase-DpudAAmd.js.map → pocketbase-YG9yht8R.js.map} +1 -1
  157. package/dist/chunks/{pocketbase-BTR3gI8o.js → pocketbase-gUn2UrDd.js} +6 -14
  158. package/dist/chunks/{pocketbase-BTR3gI8o.js.map → pocketbase-gUn2UrDd.js.map} +1 -1
  159. package/dist/chunks/{providers-CpRRQdMg.js → providers-BB3Z2TrN.js} +4 -5
  160. package/dist/chunks/{providers-CpRRQdMg.js.map → providers-BB3Z2TrN.js.map} +1 -1
  161. package/dist/chunks/{providers-CL9kQ4hp.js → providers-tjlFH5di.js} +4 -5
  162. package/dist/chunks/{providers-CL9kQ4hp.js.map → providers-tjlFH5di.js.map} +1 -1
  163. package/dist/chunks/{rolldown-runtime-5HNE8Q1r.js → rolldown-runtime-CwxnZyOB.js} +1 -2
  164. package/dist/chunks/{root-layout.svelte-CUVbnlX-.js → root-layout.svelte-DE0c_y-T.js} +12 -16
  165. package/dist/chunks/{root-layout.svelte-CUVbnlX-.js.map → root-layout.svelte-DE0c_y-T.js.map} +1 -1
  166. package/dist/chunks/{shared-CAjLx_8Z.js → shared-DE-J_b1j.js} +4 -5
  167. package/dist/chunks/{shared-CAjLx_8Z.js.map → shared-DE-J_b1j.js.map} +1 -1
  168. package/dist/chunks/{site-D0IuWkAR.js → site-B9hDxucR.js} +11 -12
  169. package/dist/chunks/{site-D0IuWkAR.js.map → site-B9hDxucR.js.map} +1 -1
  170. package/dist/chunks/{stripe-customer-B3tP8gtD.js → stripe-customer-5S-nOXP1.js} +2 -3
  171. package/dist/chunks/stripe-customer-5S-nOXP1.js.map +1 -0
  172. package/dist/chunks/{svelte-file-Dv5-bl79.js → svelte-file-DfplF3BU.js} +2 -3
  173. package/dist/chunks/{svelte-file-Dv5-bl79.js.map → svelte-file-DfplF3BU.js.map} +1 -1
  174. package/dist/chunks/{table-core-BKBoEStB.js → table-core-BXmnfjln.js} +26 -33
  175. package/dist/chunks/{table-core-BKBoEStB.js.map → table-core-BXmnfjln.js.map} +1 -1
  176. package/dist/chunks/{taggedTemplateLiteral-KSUnuvOk.js → taggedTemplateLiteral-CLenToGE.js} +1 -2
  177. package/dist/chunks/test-setup-cZj1tqaf.js +176 -0
  178. package/dist/chunks/test-setup-cZj1tqaf.js.map +1 -0
  179. package/dist/chunks/{ts-morph-helpers-CHI9wAil.js → ts-morph-helpers-B4KZXP44.js} +2 -3
  180. package/dist/chunks/{ts-morph-helpers-CHI9wAil.js.map → ts-morph-helpers-B4KZXP44.js.map} +1 -1
  181. package/dist/chunks/{ui-DD4NltyN.js → ui-D5xgIDR_.js} +3 -4
  182. package/dist/chunks/{ui-DD4NltyN.js.map → ui-D5xgIDR_.js.map} +1 -1
  183. package/dist/chunks/{ui-B3Db8cQg.js → ui-IkdkLwmB.js} +53 -55
  184. package/dist/chunks/{ui-B3Db8cQg.js.map → ui-IkdkLwmB.js.map} +1 -1
  185. package/dist/chunks/{unmodify-load-Buak-r1f.js → unmodify-load-CdWXJ_Ac.js} +3 -4
  186. package/dist/chunks/{unmodify-load-Buak-r1f.js.map → unmodify-load-CdWXJ_Ac.js.map} +1 -1
  187. package/dist/chunks/{util-BLYliuUK.js → util-ILWdjRAd.js} +2 -3
  188. package/dist/chunks/{util-BLYliuUK.js.map → util-ILWdjRAd.js.map} +1 -1
  189. package/dist/chunks/{whatsapp-Pya8Zi07.js → whatsapp-Bt4o4_q2.js} +3 -4
  190. package/dist/chunks/{whatsapp-Pya8Zi07.js.map → whatsapp-Bt4o4_q2.js.map} +1 -1
  191. package/dist/chunks/write-result-C1GYInL8.js +499 -0
  192. package/dist/chunks/write-result-C1GYInL8.js.map +1 -0
  193. package/dist/chunks/{wuchale-config-c3Q4JVSF.js → wuchale-config-CNXoq4rc.js} +2 -3
  194. package/dist/chunks/{wuchale-config-c3Q4JVSF.js.map → wuchale-config-CNXoq4rc.js.map} +1 -1
  195. package/dist/index.js +1497 -1581
  196. package/dist/index.js.map +1 -1
  197. package/package.json +1 -1
  198. package/dist/chunks/_layout-DQhSAhfF.js.map +0 -1
  199. package/dist/chunks/_page-B6yd6_Vl.js.map +0 -1
  200. package/dist/chunks/_page-DoPdZgZv.js.map +0 -1
  201. package/dist/chunks/generate-BtWZCvuO.js +0 -58
  202. package/dist/chunks/generate.runtime-2GD2E1NK.js +0 -114
  203. package/dist/chunks/generate.runtime-7sU7RzIA.js +0 -483
  204. package/dist/chunks/generate.runtime-7sU7RzIA.js.map +0 -1
  205. package/dist/chunks/generate.runtime-B-WOQsda.js +0 -67
  206. package/dist/chunks/generate.runtime-B8y_l-6N.js.map +0 -1
  207. package/dist/chunks/generate.runtime-BO1KyRcJ.js.map +0 -1
  208. package/dist/chunks/generate.runtime-BfM3dX_R.js +0 -48
  209. package/dist/chunks/generate.runtime-CEd3qCtW.js.map +0 -1
  210. package/dist/chunks/generate.runtime-CXGiQWDK.js +0 -64
  211. package/dist/chunks/generate.runtime-DGmpjkRe.js.map +0 -1
  212. package/dist/chunks/generate.runtime-DI73x08q.js.map +0 -1
  213. package/dist/chunks/generate.runtime-DIkM5xIB.js +0 -326
  214. package/dist/chunks/generate.runtime-DIkM5xIB.js.map +0 -1
  215. package/dist/chunks/generate.runtime-DRZDjZqw.js.map +0 -1
  216. package/dist/chunks/generate.runtime-DVUj1LJK.js +0 -112
  217. package/dist/chunks/generate.runtime-Deg1Tz9u.js +0 -124
  218. package/dist/chunks/generate.runtime-Deg1Tz9u.js.map +0 -1
  219. package/dist/chunks/generate.runtime-Du8puIJQ.js +0 -35
  220. package/dist/chunks/generate.runtime-TKR-qAJM.js +0 -50
  221. package/dist/chunks/generate.runtime-g6qaIY3k.js +0 -43
  222. package/dist/chunks/generate.runtime-taYl9Tg5.js +0 -65
  223. package/dist/chunks/modify-svelte-config-remote-CEyYydL7.js +0 -42
  224. package/dist/chunks/stripe-customer-B3tP8gtD.js.map +0 -1
  225. package/dist/chunks/test-setup-CbCXmPkE.js +0 -179
  226. package/dist/chunks/test-setup-CbCXmPkE.js.map +0 -1
  227. package/dist/chunks/write-result-BWXq9RRn.js +0 -499
  228. package/dist/chunks/write-result-BWXq9RRn.js.map +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velastack/patterns",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Registry of VelaStack patterns: generators and modifications applied to SvelteKit projects by the VelaStack CLI.",
5
5
  "type": "module",
6
6
  "private": false,
@@ -1 +0,0 @@
1
- {"version":3,"file":"_layout-DQhSAhfF.js","names":["dedent","ensureNamedImport","formatLikeSource","ensurePackageImports","fs","path","LOCALES_IMPORTS","modifyPackageImportsI18n","root","IMPORT_SNIPPET","LOAD_STATEMENT","LOAD_SNIPPET","FAILURE_HINT","ensureRootLayoutI18n","layoutPath","existing","sourceFile","Project","QuoteKind","ensureImports"],"sources":["../../src/patterns/enable/i18n/modifies/package-imports.ts","../../src/patterns/enable/i18n/modifies/+layout.ts"],"sourcesContent":["import {\n ensurePackageImports,\n type PackageJsonEditResult,\n} from \"../../../../runtime/package-imports\";\n\n/**\n * The package.json `imports` entry the app's `#locales/*.js` specifiers\n * resolve through. wuchale writes its loaders and data to `src/locales`;\n * SvelteKit 3 deprecates `alias`, so the directory is mapped the way `#lib`\n * is. wuchale's own generated imports are relative and never go through it.\n */\nexport const LOCALES_IMPORTS = { \"#locales/*\": \"./src/locales/*\" };\n\n/** Add `#locales/*` to package.json `imports`; a different value already there is reported. */\nexport function modifyPackageImportsI18n(root: string): PackageJsonEditResult {\n return ensurePackageImports(root, LOCALES_IMPORTS);\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport dedent from \"dedent\";\nimport { Project, QuoteKind } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport {\n ensureImports,\n ensureNamedImport,\n formatLikeSource,\n} from \"../../../../runtime/ts-morph-helpers\";\n\nconst IMPORT_SNIPPET = dedent`\n import { browser } from '$app/env';\n import { loadLocale } from 'wuchale/load-utils';\n\n import { getLocale } from '#locales/main.url.js';\n import '#locales/main.loader.svelte.js';\n import '#locales/js.loader.js';\n`;\n\n/** The load `disable-i18n` looks for to take it out again. */\nexport const LOAD_STATEMENT = dedent`\n export const load = async ({ url, data }) => {\n const locale = getLocale(url);\n\n if (browser) {\n await loadLocale(locale);\n }\n\n return data;\n };\n`;\n\n/** The whole file, for a project that had no root `+layout.ts`. */\nexport const LOAD_SNIPPET = `${IMPORT_SNIPPET}\\n\\n${LOAD_STATEMENT}`;\n\nconst FAILURE_HINT = [\n \"Merge the wuchale loader into your existing load function in +layout.ts:\",\n \"\",\n LOAD_SNIPPET,\n].join(\"\\n\");\n\nexport function ensureRootLayoutI18n(layoutPath: string): ModifyOutcome {\n if (!fs.existsSync(layoutPath)) {\n fs.mkdirSync(path.dirname(layoutPath), { recursive: true });\n fs.writeFileSync(layoutPath, LOAD_SNIPPET + \"\\n\");\n return { status: \"success\", changed: true };\n }\n\n const existing = fs.readFileSync(layoutPath, \"utf8\");\n if (existing.includes(\"loadLocale\") || existing.includes(\"translateUrl\")) {\n return { status: \"success\", changed: false };\n }\n\n if (/\\bexport\\s+(const|function)\\s+load\\b/.test(existing)) {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n\n // No load to merge with, but the file may hold other route options\n // (`export const prerender = true`, say), so the load is added to it\n // rather than written over it.\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(layoutPath);\n\n ensureNamedImport(sourceFile, \"$app/env\", \"browser\");\n ensureNamedImport(sourceFile, \"wuchale/load-utils\", \"loadLocale\");\n ensureNamedImport(sourceFile, \"#locales/main.url.js\", \"getLocale\");\n ensureImports(sourceFile, [\n { moduleSpecifier: \"#locales/main.loader.svelte.js\" },\n { moduleSpecifier: \"#locales/js.loader.js\" },\n ]);\n\n sourceFile.addStatements(`\\n${LOAD_STATEMENT}\\n`);\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return { status: \"success\", changed: true };\n}\n"],"mappings":";;;;;;;AAWA,IAAaM,IAAkB,EAAE,cAAc,kBAAkB;AAGjE,SAAgBC,EAAyB,GAAqC;CAC5E,OAAOJ,EAAqBK,GAAMF,CAAe;AACnD;;;ACLA,IAAMG,IAAiB,CAAM;;;;;;;GAUhBC,IAAiB,CAAM;;;;;;;;;;GAavBC,IAAe,GAAGF,EAAe,MAAMC,KAE9CE,IAAe;CACnB;CACA;CACAD;AACF,CAAC,CAAC,KAAK,IAAI;AAEX,SAAgBE,EAAqB,GAAmC;CACtE,IAAI,CAACT,EAAG,WAAWU,CAAU,GAG3B,OAFAV,EAAG,UAAUC,EAAK,QAAQS,CAAU,GAAG,EAAE,WAAW,GAAK,CAAC,GAC1DV,EAAG,cAAcU,GAAYH,IAAe,IAAI,GACzC;EAAE,QAAQ;EAAW,SAAS;CAAK;CAG5C,IAAMI,IAAWX,EAAG,aAAaU,GAAY,MAAM;CACnD,IAAIC,EAAS,SAAS,YAAY,KAAKA,EAAS,SAAS,cAAc,GACrE,OAAO;EAAE,QAAQ;EAAW,SAAS;CAAM;CAG7C,IAAI,uCAAuC,KAAKA,CAAQ,GACtD,OAAO;EAAE,QAAQ;EAAU,SAASH;CAAa;CAUnD,IAAMI,IAAa,IAJCC,EAAQ;EAC1B,iBAAiB,EAAE,SAAS,GAAK;EACjC,sBAAsB,EAAE,WAAWC,EAAU,OAAO;CACtD,CACmB,CAAA,CAAQ,oBAAoBJ,CAAU;CAazD,OAXAb,EAAkBe,GAAY,YAAY,SAAS,GACnDf,EAAkBe,GAAY,sBAAsB,YAAY,GAChEf,EAAkBe,GAAY,wBAAwB,WAAW,GACjEG,EAAcH,GAAY,CACxB,EAAE,iBAAiB,iCAAiC,GACpD,EAAE,iBAAiB,wBAAwB,CAC7C,CAAC,GAEDA,EAAW,cAAc,KAAKN,EAAe,GAAG,GAChDR,EAAiBc,CAAU,GAC3BA,EAAW,SAAS,GACb;EAAE,QAAQ;EAAW,SAAS;CAAK;AAC5C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_page-B6yd6_Vl.js","names":["_page_server_default","_page_default"],"sources":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"_page-DoPdZgZv.js","names":["_page_server_default","_page_default"],"sources":[],"mappings":""}
@@ -1,58 +0,0 @@
1
- import { t as e } from "./util-BLYliuUK.js";
2
- import { t } from "./providers-CL9kQ4hp.js";
3
- import { a as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, o as u, p as d, r as f, s as p, t as m, u as h } from "./generate-DjuhSibA.js";
4
- import { n as g } from "./shared-CAjLx_8Z.js";
5
- //#region src/patterns/disable/ai/generate.ts
6
- var _ = /* #__PURE__ */ Object.assign({
7
- "../../enable/ai/creates/src/routes/(public)/ai/+page.svelte": a,
8
- "../../enable/ai/creates/src/routes/api/chat/+server.ts": o,
9
- "../../enable/ai/creates/src/routes/api/chat/server.test.ts": l
10
- }), v = /* #__PURE__ */ Object.assign({
11
- "../../enable/ai/creates-app-mode/src/routes/api/chat/+server.ts": d,
12
- "../../enable/ai/creates-app-mode/src/routes/api/chat/server.test.ts": i
13
- }), y = /* #__PURE__ */ Object.assign({
14
- "../../enable/ai/providers/anthropic/src/lib/server/ai.ts": r,
15
- "../../enable/ai/providers/gateway/src/lib/server/ai.ts": h,
16
- "../../enable/ai/providers/openai/src/lib/server/ai.ts": c
17
- });
18
- function b(e) {
19
- let t = [!1, !0].map((t) => u({
20
- ...e,
21
- features: {
22
- ...e.features,
23
- auth: t
24
- }
25
- }));
26
- return [...new Set(t)];
27
- }
28
- function x(e, t) {
29
- return e.startsWith("src/routes/(public)/ai/") ? `${t}/${e.slice(m.length)}` : e;
30
- }
31
- function S(n) {
32
- let r = u(n), i = new Set(t(y));
33
- for (let [t, n] of [[_, "../../enable/ai/creates/"], [v, "../../enable/ai/creates-app-mode/"]]) for (let a of Object.keys(t)) i.add(x(e(a, n), r));
34
- return [...i].sort();
35
- }
36
- function C() {
37
- return s.flatMap((e) => p(e));
38
- }
39
- function w() {
40
- return s.flatMap((e) => (e.env ?? []).map((e) => e.key));
41
- }
42
- async function T(e) {
43
- return {
44
- creates: [],
45
- modifies: [],
46
- deletes: S(e).map(g),
47
- components: [],
48
- packages: [],
49
- uninstalls: [...f, ...Object.values(n).flat()],
50
- collections: [],
51
- collectionPatches: [],
52
- collectionDrops: []
53
- };
54
- }
55
- //#endregion
56
- export { T as i, w as n, b as r, C as t };
57
-
58
- //# sourceMappingURL=generate-BtWZCvuO.js.map
@@ -1,114 +0,0 @@
1
- import { t as e } from "./lib-specifier-Cngo1zF_.js";
2
- import { n as t } from "./logger-CQONztPm.js";
3
- import { a as n } from "./currency.server-DygAf6a1.js";
4
- import { t as r } from "./shared-CAjLx_8Z.js";
5
- import { n as i } from "./generate-Cbg-Z3sA.js";
6
- import { n as a } from "./env-BugddEjd.js";
7
- import { f as o, m as s, n as c, o as l } from "./ts-morph-helpers-CHI9wAil.js";
8
- import { r as u } from "./modify-file-D9U2LXEa.js";
9
- import { unmodifyEnvVarsFiles as d } from "./env-vars-XvAeH6u5.js";
10
- import { t as f } from "./svelte-file-Dv5-bl79.js";
11
- import { c as p, i as m, n as h, o as g } from "./root-layout.svelte-CUVbnlX-.js";
12
- import { n as _, t as v } from "./wuchale-config-c3Q4JVSF.js";
13
- import y from "node:fs";
14
- import b from "node:path";
15
- import { Project as x, QuoteKind as S, SyntaxKind as C } from "ts-morph";
16
- //#region src/patterns/disable/payments/modifies/modify-nav-user.ts
17
- function w(e) {
18
- if (!y.existsSync(e)) return {
19
- status: "success",
20
- changed: !1
21
- };
22
- let t = y.readFileSync(e, "utf8");
23
- if (!t.includes("/billing")) return {
24
- status: "success",
25
- changed: !1
26
- };
27
- let n = new f(t), r = !1, i = (e) => {
28
- r || e((e) => {
29
- let t = o(e, "Billing", "@lucide/svelte/icons/credit-card");
30
- return t.wasRemoved && (r = !0), t.source;
31
- });
32
- };
33
- return i((e) => n.modifyModuleScript(e)), r || i((e) => n.modifyScript(e)), r ? (y.writeFileSync(e, n.toString(), "utf8"), {
34
- status: "success",
35
- changed: !0
36
- }) : {
37
- status: "success",
38
- changed: !1
39
- };
40
- }
41
- //#endregion
42
- //#region src/patterns/disable/payments/modifies/modify-user-signup.ts
43
- var T = /* @__PURE__ */ new Set(["linkStripeCustomer.run", "linkStripeCustomer"]);
44
- function E(t) {
45
- if (!y.existsSync(t)) return {
46
- status: "success",
47
- changed: !1
48
- };
49
- let n = y.readFileSync(t, "utf8");
50
- if (!n.includes("linkStripeCustomer")) return {
51
- status: "success",
52
- changed: !1
53
- };
54
- let r = new x({ manipulationSettings: { quoteKind: S.Single } }).addSourceFileAtPath(t);
55
- for (let t of ["workflows/link-stripe-customer", "stripe"]) {
56
- let n = r.getImportDeclarations().find((n) => e(n.getModuleSpecifierValue(), t));
57
- n && n.remove();
58
- }
59
- let i = r.getVariableStatement((e) => e.getDeclarations().some((e) => e.getName() === "linkStripeCustomer"));
60
- i && i.remove();
61
- let a = r.getDescendantsOfKind(C.CallExpression).filter((e) => T.has(e.getExpression().getText()));
62
- for (let e of a) {
63
- let t = e.getFirstAncestorByKind(C.ExpressionStatement);
64
- t && s(r, t);
65
- }
66
- return l(r), c(r), r.saveSync(), {
67
- status: "success",
68
- changed: r.getFullText() !== n
69
- };
70
- }
71
- //#endregion
72
- //#region src/patterns/disable/payments/generate.runtime.ts
73
- var D = [
74
- "transactions",
75
- "stripe_customers",
76
- "stripe_payment_methods",
77
- "stripe_prices",
78
- "stripe_products"
79
- ];
80
- async function O(e) {
81
- let o = e.features.auth, s = t(e), c = i(e), l = c.some((e) => e.id === "stripe"), f = [], x = [], S = (e) => {
82
- e && f.push(e);
83
- }, C = b.join(e.root, ".env");
84
- for (let e of c) s.info(`Stripping ${e.label} credentials from .env`), S(u(C, a(C, n(e))));
85
- s.info("Removing the currency select from the navbar");
86
- let T = b.join(e.root, "src", "routes", "(public)", "root-layout.svelte");
87
- S(u(T, h(T)));
88
- let O = b.join(e.root, "src", "hooks.server.ts"), k = b.join(e.root, "src", "routes", "+layout.server.ts"), A = b.join(e.root, "src", "routes", "+layout.svelte");
89
- y.existsSync(k) && (s.info("Removing the visitor's currency from the server"), S(u(A, m(A))), S(u(k, g(k))), S(u(O, p(O)))), s.info("Removing payment variables from src/env.ts");
90
- let j = d(e.root, c.flatMap((e) => (e.env ?? []).map((e) => e.key)));
91
- S(j.modify), j.delete && x.push(j.delete);
92
- let M = b.join(e.root, "wuchale.config.js");
93
- if (c.some((e) => e.id === "whatsapp") && y.existsSync(M) && (s.info("Removing src/lib/order.ts from wuchale's js adapter"), S(u(M, _(M, v, "remove")))), l && o) {
94
- s.info("Reverting nav-user.svelte");
95
- let t = b.join(e.root, "src", "lib", "components", "nav-user.svelte");
96
- S(u(t, w(t))), s.info("Reverting signup +page.server.ts");
97
- let n = b.join(e.root, "src", "routes", "(public)", "(auth)", "signup", "+page.server.ts");
98
- S(u(n, E(n)));
99
- }
100
- return {
101
- creates: [],
102
- modifies: f,
103
- deletes: x,
104
- components: [],
105
- packages: [],
106
- collections: [],
107
- collectionPatches: [],
108
- collectionDrops: l && e.features.backend ? await r(D, e) : []
109
- };
110
- }
111
- //#endregion
112
- export { O as generate };
113
-
114
- //# sourceMappingURL=generate.runtime-2GD2E1NK.js.map
@@ -1,483 +0,0 @@
1
- import { t as e } from "./dedent-Gq6Krl4n.js";
2
- import { t } from "./ui-DD4NltyN.js";
3
- import { n } from "./logger-CQONztPm.js";
4
- import { _ as r, i, o as a, r as o } from "./ts-morph-helpers-CHI9wAil.js";
5
- import { r as s } from "./modify-file-D9U2LXEa.js";
6
- import { t as c } from "./svelte-file-Dv5-bl79.js";
7
- import { t as l } from "./compose-handle-BBlamPfx.js";
8
- import { a as u, t as d } from "./config-target-BgyFkbFL.js";
9
- import { i as f, n as p } from "./_layout-DQhSAhfF.js";
10
- import { r as m, t as h } from "./wuchale-config-c3Q4JVSF.js";
11
- import g from "node:fs";
12
- import _ from "node:path";
13
- import { Project as v, QuoteKind as y, SyntaxKind as b } from "ts-morph";
14
- //#region src/patterns/enable/i18n/modifies/vite-config.ts
15
- var x = [
16
- "Add the wuchale plugin to your Vite config:",
17
- "",
18
- "import { wuchale } from 'wuchale/vite';",
19
- "",
20
- "export default defineConfig({",
21
- " plugins: [wuchale(), /* ...existing plugins */],",
22
- "});"
23
- ].join("\n"), S = [
24
- "Create a Vite config with the wuchale plugin:",
25
- "",
26
- "import { defineConfig } from 'vite';",
27
- "import { wuchale } from 'wuchale/vite';",
28
- "",
29
- "export default defineConfig({",
30
- " plugins: [wuchale()],",
31
- "});"
32
- ].join("\n");
33
- function C(e) {
34
- if (!g.existsSync(e)) return {
35
- status: "not-found",
36
- message: S
37
- };
38
- let t = new v({
39
- compilerOptions: { allowJs: !0 },
40
- manipulationSettings: { quoteKind: y.Single }
41
- }).addSourceFileAtPath(e), n = !1, r = !1;
42
- t.getImportDeclarations().some((e) => e.getModuleSpecifierValue() === "wuchale/vite") || (t.insertImportDeclaration(0, {
43
- namedImports: ["wuchale"],
44
- moduleSpecifier: "wuchale/vite"
45
- }), n = !0);
46
- let i = t.getDescendantsOfKind(b.CallExpression).find((e) => e.getExpression().getText() === "defineConfig")?.getArguments()?.[0], o = i?.getKind() === b.ObjectLiteralExpression ? i : null;
47
- if (!o) r = !0;
48
- else {
49
- let e = o.getProperty("plugins");
50
- if (!e) o.addPropertyAssignment({
51
- name: "plugins",
52
- initializer: "[wuchale()]"
53
- }), n = !0;
54
- else if (e.getKind() !== b.PropertyAssignment) r = !0;
55
- else {
56
- let t = e.getInitializer();
57
- if (!t) e.setInitializer("[wuchale()]"), n = !0;
58
- else if (t.getKind() !== b.ArrayLiteralExpression) r = !0;
59
- else {
60
- let e = t;
61
- e.getElements().some((e) => e.getText().replace(/\s/g, "") === "wuchale()") || (e.insertElement(0, "wuchale()"), n = !0);
62
- }
63
- }
64
- }
65
- return n && (a(t), t.saveSync()), r ? {
66
- status: "failed",
67
- message: x
68
- } : {
69
- status: "success",
70
- changed: n
71
- };
72
- }
73
- //#endregion
74
- //#region src/patterns/enable/i18n/modifies/hooks.server.ts
75
- var w = "handleWuchale", T = e`
76
- Wrap your exported handle with the wuchale i18n handler:
77
-
78
- import { sequence } from '@sveltejs/kit/hooks';
79
- import { runWithLocale, loadLocales } from 'wuchale/load-utils/server';
80
- import { getLocale } from '#locales/main.url.js';
81
- import { locales } from '#locales/data.js';
82
- import * as main from '#locales/main.loader.server.svelte.js';
83
- import * as js from '#locales/js.loader.server.js';
84
-
85
- loadLocales(main.key, main.loadCount, main.loadCatalog, locales);
86
- loadLocales(js.key, js.loadCount, js.loadCatalog, locales);
87
-
88
- const handleWuchale = async ({ event, resolve }: any) => {
89
- const locale = getLocale(event.url);
90
- return await runWithLocale(locale, () =>
91
- resolve(event, {
92
- transformPageChunk: ({ html }: { html: string }) =>
93
- html.replace('%sveltekit.lang%', locale),
94
- }),
95
- );
96
- };
97
-
98
- export const handle = sequence(handleWuchale, /* your existing handle */);
99
- `, E = e`
100
- import type { Handle } from '@sveltejs/kit/hooks';
101
- import { runWithLocale, loadLocales } from 'wuchale/load-utils/server';
102
- import { getLocale } from '#locales/main.url.js';
103
- import { locales } from '#locales/data.js';
104
- import * as main from '#locales/main.loader.server.svelte.js';
105
- import * as js from '#locales/js.loader.server.js';
106
-
107
- loadLocales(main.key, main.loadCount, main.loadCatalog, locales);
108
- loadLocales(js.key, js.loadCount, js.loadCatalog, locales);
109
-
110
- const handleWuchale: Handle = async ({ event, resolve }) => {
111
- const locale = getLocale(event.url);
112
- return await runWithLocale(locale, () =>
113
- resolve(event, {
114
- transformPageChunk: ({ html }) => html.replace('%sveltekit.lang%', locale)
115
- })
116
- );
117
- };
118
-
119
- export const handle = handleWuchale;
120
- `;
121
- function D(e, t, n) {
122
- e.getImportDeclarations().find((e) => e.getModuleSpecifierValue() === t) || e.addImportDeclaration({
123
- namespaceImport: n,
124
- moduleSpecifier: t
125
- });
126
- }
127
- function O(t) {
128
- if (!g.existsSync(t)) return g.existsSync(t.replace(/\.ts$/, ".js")) ? {
129
- status: "failed",
130
- message: T
131
- } : (g.mkdirSync(_.dirname(t), { recursive: !0 }), g.writeFileSync(t, E + "\n"), {
132
- status: "success",
133
- changed: !0
134
- });
135
- let n = g.readFileSync(t, "utf8");
136
- if (n.includes("runWithLocale") || n.includes("loadLocales(")) return {
137
- status: "success",
138
- changed: !1
139
- };
140
- let r = new v({
141
- compilerOptions: { allowJs: !0 },
142
- manipulationSettings: { quoteKind: y.Single }
143
- }).addSourceFileAtPath(t), o = l(r, { expression: w });
144
- if (o.status === "unsupported" || !o.statement) return {
145
- status: "failed",
146
- message: T
147
- };
148
- let s = o.statement;
149
- i(r, "wuchale/load-utils/server", "runWithLocale"), i(r, "wuchale/load-utils/server", "loadLocales"), i(r, "#locales/main.url.js", "getLocale"), i(r, "#locales/data.js", "locales"), D(r, "#locales/main.loader.server.svelte.js", "main"), D(r, "#locales/js.loader.server.js", "js");
150
- let c = e`
151
- loadLocales(main.key, main.loadCount, main.loadCatalog, locales);
152
- loadLocales(js.key, js.loadCount, js.loadCatalog, locales);
153
- `, u = e`
154
- const ${w} = async ({ event, resolve }: any) => {
155
- const locale = getLocale(event.url);
156
- return await runWithLocale(locale, () =>
157
- resolve(event, {
158
- transformPageChunk: ({ html }: { html: string }) =>
159
- html.replace('%sveltekit.lang%', locale)
160
- })
161
- );
162
- };
163
- `;
164
- return r.insertText(s.getStart(!0), `${c}\n\n${u}\n\n`), a(r), r.saveSync(), {
165
- status: "success",
166
- changed: !0
167
- };
168
- }
169
- //#endregion
170
- //#region src/patterns/enable/i18n/modifies/hooks.ts
171
- var k = e`
172
- const rerouteDeLocalize = (url: string) => {
173
- const [upath, locale] = deLocalizeDefault(url, locales);
174
- const { path } = matchUrl(upath, locale);
175
- return path ?? url;
176
- };
177
- `, A = e`
178
- import { deLocalizeDefault } from 'wuchale/url';
179
- import { matchUrl } from '#locales/main.url.js';
180
- import { locales } from '#locales/data.js';
181
-
182
- const rerouteDeLocalize = (url: string) => {
183
- const [upath, locale] = deLocalizeDefault(url, locales);
184
- const { path } = matchUrl(upath, locale);
185
- return path ?? url;
186
- };
187
-
188
- export const reroute = ({ url }) => rerouteDeLocalize(url.pathname);
189
- `, j = e`
190
- Compose your existing reroute in src/hooks.ts with the wuchale de-localizer:
191
-
192
- import { deLocalizeDefault } from 'wuchale/url';
193
- import { matchUrl } from '#locales/main.url.js';
194
- import { locales } from '#locales/data.js';
195
-
196
- const rerouteDeLocalize = (url: string) => {
197
- const [upath, locale] = deLocalizeDefault(url, locales);
198
- const { path } = matchUrl(upath, locale);
199
- return path ?? url;
200
- };
201
-
202
- export const reroute = ({ url }) => rerouteDeLocalize(existingReroute(url.pathname));
203
- `, M = /^\(\s*\{\s*url\s*\}\s*\)\s*=>\s*negotiateReroute\(\s*url\.pathname\s*\)$/;
204
- function N(e) {
205
- return e.getFunction("reroute") ? !0 : e.getExportDeclarations().some((e) => e.getNamedExports().some((e) => (e.getAliasNode()?.getText() ?? e.getName()) === "reroute"));
206
- }
207
- function P(e) {
208
- i(e, "wuchale/url", "deLocalizeDefault"), i(e, "#locales/main.url.js", "matchUrl"), i(e, "#locales/data.js", "locales");
209
- }
210
- function ee(e) {
211
- if (!g.existsSync(e)) return g.mkdirSync(_.dirname(e), { recursive: !0 }), g.writeFileSync(e, A + "\n"), {
212
- status: "success",
213
- changed: !0
214
- };
215
- if (g.readFileSync(e, "utf8").includes("rerouteDeLocalize")) return {
216
- status: "success",
217
- changed: !1
218
- };
219
- let t = new v({
220
- compilerOptions: { allowJs: !0 },
221
- manipulationSettings: { quoteKind: y.Single }
222
- }).addSourceFileAtPath(e), n = t.getVariableDeclaration("reroute");
223
- if (!n) return N(t) ? {
224
- status: "failed",
225
- message: j
226
- } : (P(t), t.addStatements(`\n${k}\n\nexport const reroute = ({ url }) => rerouteDeLocalize(url.pathname);\n`), a(t), t.saveSync(), {
227
- status: "success",
228
- changed: !0
229
- });
230
- if (!n.getFirstAncestorByKind(b.VariableStatement)?.hasExportKeyword()) return {
231
- status: "failed",
232
- message: j
233
- };
234
- let r = n.getInitializer();
235
- if (!r || !M.test(r.getText())) return {
236
- status: "failed",
237
- message: j
238
- };
239
- P(t), n.setInitializer("({ url }) => rerouteDeLocalize(negotiateReroute(url.pathname))");
240
- let i = t.getVariableStatements().find((e) => e.getDeclarations().some((e) => e.getName() === "reroute"));
241
- return t.insertText(i.getStart(!0), `${k}\n\n`), a(t), t.saveSync(), {
242
- status: "success",
243
- changed: !0
244
- };
245
- }
246
- //#endregion
247
- //#region src/patterns/enable/i18n/modifies/app-html.ts
248
- var F = [
249
- "Add the sveltekit lang placeholder to the <html> tag:",
250
- "",
251
- "<html lang=\"%sveltekit.lang%\">"
252
- ].join("\n"), I = [
253
- "Create src/app.html with a lang placeholder:",
254
- "",
255
- "<!doctype html>",
256
- "<html lang=\"%sveltekit.lang%\">",
257
- " <head>",
258
- " <meta charset=\"utf-8\" />",
259
- " %sveltekit.head%",
260
- " </head>",
261
- " <body data-sveltekit-preload-data=\"hover\">",
262
- " <div style=\"display: contents\">%sveltekit.body%</div>",
263
- " </body>",
264
- "</html>"
265
- ].join("\n");
266
- function L(e) {
267
- if (!g.existsSync(e)) return {
268
- status: "not-found",
269
- message: I
270
- };
271
- let t = g.readFileSync(e, "utf8");
272
- if (t.includes("lang=\"%sveltekit.lang%\"") || t.includes("lang='%sveltekit.lang%'")) return {
273
- status: "success",
274
- changed: !1
275
- };
276
- let n = t.replace(/<html(\s[^>]*?)?>/i, (e) => /\slang\s*=/i.test(e) ? e.replace(/\slang\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/i, " lang=\"%sveltekit.lang%\"") : e.replace(/<html/i, "<html lang=\"%sveltekit.lang%\""));
277
- return n === t ? {
278
- status: "failed",
279
- message: F
280
- } : (g.writeFileSync(e, n), {
281
- status: "success",
282
- changed: !0
283
- });
284
- }
285
- //#endregion
286
- //#region src/patterns/enable/i18n/modifies/gitignore.ts
287
- var R = [
288
- "Create a .gitignore with the wuchale cache ignored:",
289
- "",
290
- "# Wuchale",
291
- "src/locales/.wuchale"
292
- ].join("\n");
293
- function z(t) {
294
- if (!g.existsSync(t)) return {
295
- status: "not-found",
296
- message: R
297
- };
298
- let n = g.readFileSync(t, "utf8");
299
- if (n.includes("src/locales/.wuchale")) return {
300
- status: "success",
301
- changed: !1
302
- };
303
- let r = e`
304
- # Wuchale
305
- src/locales/.wuchale
306
- `, i = n + (n.length > 0 && !n.endsWith("\n") ? "\n" : "") + "\n" + r + "\n";
307
- return g.writeFileSync(t, i), {
308
- status: "success",
309
- changed: !0
310
- };
311
- }
312
- //#endregion
313
- //#region src/patterns/enable/i18n/modifies/root-layout.svelte.ts
314
- var B = "<Navbar.Item>\n <LanguageSelect />\n </Navbar.Item>\n ", V = "<LanguageSelect />", H = e`
315
- import LanguageSelect from '#lib/components/language-select.svelte';
316
- `, U = [
317
- "Add the language select inside your <Navbar.List> in the root layout.",
318
- "",
319
- "Import to add to the <script> tag:",
320
- "",
321
- H,
322
- "",
323
- "Markup to add at the end of <Navbar.List>:",
324
- B
325
- ].join("\n"), W = [
326
- "Create a root layout that includes a language select inside <Navbar.List>.",
327
- "",
328
- "Import for the <script> tag:",
329
- "",
330
- H,
331
- "",
332
- "Markup at the end of <Navbar.List>:",
333
- B
334
- ].join("\n"), G = [
335
- "Add the language select to your root layout.",
336
- "",
337
- "Import to add to the <script> tag:",
338
- "",
339
- H,
340
- "",
341
- "Markup to add wherever it should render, e.g. above {@render children()}:",
342
- "",
343
- V
344
- ].join("\n"), K = [
345
- "Create a root layout that includes the language select.",
346
- "",
347
- "Import for the <script> tag:",
348
- "",
349
- H,
350
- "",
351
- "Markup above {@render children()}:",
352
- "",
353
- V
354
- ].join("\n");
355
- function q(e) {
356
- e.modifyScript((e) => {
357
- let { source: t } = r(e, (e) => {
358
- o(e, [{
359
- defaultImport: "LanguageSelect",
360
- moduleSpecifier: "#lib/components/language-select.svelte"
361
- }]);
362
- });
363
- return t;
364
- });
365
- }
366
- function J(e, t = "shadcn") {
367
- let n = t === "plain";
368
- if (!g.existsSync(e)) return {
369
- status: "not-found",
370
- message: n ? K : W
371
- };
372
- let r = c.fromPath(e);
373
- return r.hasElement("LanguageSelect") ? {
374
- status: "success",
375
- changed: !1
376
- } : n ? !r.getScript() || !r.insertBeforeChildren(V) ? {
377
- status: "failed",
378
- message: G
379
- } : (q(r), r.writeTo(e), {
380
- status: "success",
381
- changed: r.hasChanged()
382
- }) : r.hasElement("Navbar.List") ? (q(r), r.insertBeforeClosingTag("Navbar.List", B), r.writeTo(e), {
383
- status: "success",
384
- changed: r.hasChanged()
385
- }) : {
386
- status: "failed",
387
- message: U
388
- };
389
- }
390
- //#endregion
391
- //#region src/patterns/enable/i18n/welcome-catalog.ts
392
- var Y = "src/routes/+page.svelte", X = "src/locales/es.po", Z = ["<h1>Welcome to SvelteKit</h1>", "<p>Visit <a href=\"https://svelte.dev/docs/kit\">svelte.dev/docs/kit</a> to read the documentation</p>"].join("\n"), Q = [{
393
- reference: Y,
394
- msgid: "Welcome to SvelteKit",
395
- msgstr: "Bienvenido a SvelteKit"
396
- }, {
397
- reference: Y,
398
- msgid: "Visit <0>svelte.dev/docs/kit</0> to read the documentation",
399
- msgstr: "Visita <0>svelte.dev/docs/kit</0> para leer la documentación"
400
- }], te = {
401
- reference: "src/lib/components/language-select.svelte",
402
- msgid: "Language",
403
- msgstr: "Idioma"
404
- }, ne = [
405
- "msgid \"\"",
406
- "msgstr \"\"",
407
- "\"Source-Language: en\\n\"",
408
- "\"Language: es\\n\"",
409
- "\"MIME-Version: 1.0\\n\"",
410
- "\"Content-Type: text/plain; charset=utf-8\\n\"",
411
- "\"Content-Transfer-Encoding: 8bit\\n\"",
412
- "\"Plural-Forms: nplurals=3\\n\"",
413
- "\"X-Plurals-Order: one, many, other\\n\""
414
- ].join("\n"), $ = (e) => e.replace(/\s+/g, "");
415
- function re(e, t) {
416
- if (g.existsSync(_.join(e, X))) return null;
417
- let n = _.join(e, Y);
418
- return !g.existsSync(n) || $(g.readFileSync(n, "utf8")) !== $(Z) ? null : {
419
- path: X,
420
- language: "text",
421
- content: [ne, ...(t === "plain" ? [...Q, te] : Q).map((e) => [
422
- `#: ${e.reference}`,
423
- `msgid "${e.msgid}"`,
424
- `msgstr "${e.msgstr}"`
425
- ].join("\n"))].join("\n\n") + "\n",
426
- status: "success"
427
- };
428
- }
429
- //#endregion
430
- //#region src/patterns/enable/i18n/generate.runtime.ts
431
- function ie(e, t) {
432
- let n = h.filter((t) => g.existsSync(_.join(e, t)));
433
- return n.length === 0 ? t : t.map((e) => {
434
- if (!e.path.endsWith("wuchale.config.js")) return e;
435
- let t = m(e.content, n);
436
- return t?.changed ? {
437
- ...e,
438
- content: t.source
439
- } : e;
440
- });
441
- }
442
- async function ae(e) {
443
- let r = n(e), i = [], a = (e) => {
444
- e && i.push(e);
445
- };
446
- r.info("Modifying vite.config");
447
- let o = u(e.root, d) ?? _.join(e.root, d[0]);
448
- a(s(o, C(o))), r.info("Adding #locales to package.json imports");
449
- let c = f(e.root);
450
- a(s(c.filePath, c.outcome)), r.info("Modifying hooks.server.ts");
451
- let l = _.join(e.root, "src", "hooks.server.ts");
452
- a(s(l, O(l))), r.info("Modifying hooks.ts");
453
- let m = _.join(e.root, "src", "hooks.ts");
454
- a(s(m, ee(m))), r.info("Modifying app.html");
455
- let h = _.join(e.root, "src", "app.html");
456
- a(s(h, L(h))), r.info("Modifying root +layout.ts");
457
- let v = _.join(e.root, "src", "routes", "+layout.ts");
458
- a(s(v, p(v))), r.info("Modifying root layout language select");
459
- let y = [
460
- _.join(e.root, "src", "routes", "(public)", "root-layout.svelte"),
461
- _.join(e.root, "src", "routes", "root-layout.svelte"),
462
- _.join(e.root, "src", "routes", "(public)", "+layout.svelte"),
463
- _.join(e.root, "src", "routes", "+layout.svelte")
464
- ], b = t(e), x = y.find((e) => g.existsSync(e)) ?? (b === "plain" ? y[3] : y[0]);
465
- a(s(x, J(x, b))), r.info("Updating .gitignore");
466
- let S = _.join(e.root, ".gitignore");
467
- a(s(S, z(S)));
468
- let w = re(e.root, b);
469
- return w && r.info("Translating the welcome page into Spanish"), {
470
- creates: w ? [w] : [],
471
- modifies: i,
472
- deletes: [],
473
- components: [],
474
- packages: [],
475
- collections: [],
476
- collectionPatches: [],
477
- collectionDrops: []
478
- };
479
- }
480
- //#endregion
481
- export { ae as generate, ie as withLibraryTexts };
482
-
483
- //# sourceMappingURL=generate.runtime-7sU7RzIA.js.map