@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.
- package/dist/chunks/{_layout-DQhSAhfF.js → _layout-xBzFhszN.js} +36 -20
- package/dist/chunks/_layout-xBzFhszN.js.map +1 -0
- package/dist/chunks/{_page-C7kGoW7_.js → _page-44USwLXO.js} +2 -3
- package/dist/chunks/{_page-C7kGoW7_.js.map → _page-44USwLXO.js.map} +1 -1
- package/dist/chunks/{_page-DoPdZgZv.js → _page-Bt37d4uo.js} +2 -3
- package/dist/chunks/_page-Bt37d4uo.js.map +1 -0
- package/dist/chunks/{_page-B6yd6_Vl.js → _page-DcbEFpyw.js} +2 -3
- package/dist/chunks/_page-DcbEFpyw.js.map +1 -0
- package/dist/chunks/{auth-pages-jsyDV1GR.js → auth-pages-BW3_yluN.js} +6 -9
- package/dist/chunks/{auth-pages-jsyDV1GR.js.map → auth-pages-BW3_yluN.js.map} +1 -1
- package/dist/chunks/{collections-DZOuRpvS.js → collections-CFW9ZqUE.js} +5 -7
- package/dist/chunks/{collections-DZOuRpvS.js.map → collections-CFW9ZqUE.js.map} +1 -1
- package/dist/chunks/{collections-zEoRuILr.js → collections-D-xbHi4M.js} +39 -45
- package/dist/chunks/{collections-zEoRuILr.js.map → collections-D-xbHi4M.js.map} +1 -1
- package/dist/chunks/{compose-handle-BBlamPfx.js → compose-handle-Da7m6lV_.js} +3 -4
- package/dist/chunks/{compose-handle-BBlamPfx.js.map → compose-handle-Da7m6lV_.js.map} +1 -1
- package/dist/chunks/{config-target-BgyFkbFL.js → config-target-DJbVHwHl.js} +3 -4
- package/dist/chunks/{config-target-BgyFkbFL.js.map → config-target-DJbVHwHl.js.map} +1 -1
- package/dist/chunks/{constants-CUv536Rj.js → constants-DpK-r_m5.js} +2 -4
- package/dist/chunks/{constants-CUv536Rj.js.map → constants-DpK-r_m5.js.map} +1 -1
- package/dist/chunks/{currency.server-DygAf6a1.js → currency.server-BwuXG0a9.js} +9 -11
- package/dist/chunks/{currency.server-DygAf6a1.js.map → currency.server-BwuXG0a9.js.map} +1 -1
- package/dist/chunks/{dedent-Gq6Krl4n.js → dedent-CCUOcPFW.js} +2 -3
- package/dist/chunks/{dedent-Gq6Krl4n.js.map → dedent-CCUOcPFW.js.map} +1 -1
- package/dist/chunks/{dispatch-BIvOwbKN.js → dispatch-BxlKS_5v.js} +2 -3
- package/dist/chunks/{dispatch-BIvOwbKN.js.map → dispatch-BxlKS_5v.js.map} +1 -1
- package/dist/chunks/{env-BugddEjd.js → env-AxyRWcC_.js} +2 -3
- package/dist/chunks/{env-BugddEjd.js.map → env-AxyRWcC_.js.map} +1 -1
- package/dist/chunks/{env-vars-mnRA0hOe.js → env-vars-CUh4mLM_.js} +2 -3
- package/dist/chunks/{env-vars-mnRA0hOe.js.map → env-vars-CUh4mLM_.js.map} +1 -1
- package/dist/chunks/{env-vars-XvAeH6u5.js → env-vars-CVn2076k.js} +58 -59
- package/dist/chunks/{env-vars-XvAeH6u5.js.map → env-vars-CVn2076k.js.map} +1 -1
- package/dist/chunks/{env-vars-Cr4lbMD_.js → env-vars-T3_7JNSg.js} +3 -4
- package/dist/chunks/{env-vars-Cr4lbMD_.js.map → env-vars-T3_7JNSg.js.map} +1 -1
- package/dist/chunks/{env-vars-file-B_6esJW3.js → env-vars-file-B2zHQZqO.js} +2 -3
- package/dist/chunks/{env-vars-file-B_6esJW3.js.map → env-vars-file-B2zHQZqO.js.map} +1 -1
- package/dist/chunks/{env.preview-uMRKT5Pc.js → env.preview-C676UTOP.js} +2 -3
- package/dist/chunks/{env.preview-uMRKT5Pc.js.map → env.preview-C676UTOP.js.map} +1 -1
- package/dist/chunks/{errors-DR3gF_7a.js → errors-DdSUZI8f.js} +2 -3
- package/dist/chunks/{errors-DR3gF_7a.js.map → errors-DdSUZI8f.js.map} +1 -1
- package/dist/chunks/{format-result-BVoLVknk.js → format-result-CojavkIZ.js} +2 -3
- package/dist/chunks/{format-result-BVoLVknk.js.map → format-result-CojavkIZ.js.map} +1 -1
- package/dist/chunks/{generate-Cbg-Z3sA.js → generate-BCYvhyF9.js} +62 -63
- package/dist/chunks/{generate-Cbg-Z3sA.js.map → generate-BCYvhyF9.js.map} +1 -1
- package/dist/chunks/{generate-DyV5R8NP.js → generate-CKuUg3p-.js} +3 -4
- package/dist/chunks/{generate-DyV5R8NP.js.map → generate-CKuUg3p-.js.map} +1 -1
- package/dist/chunks/{generate-DjuhSibA.js → generate-CY_Ii_bz.js} +61 -64
- package/dist/chunks/{generate-DjuhSibA.js.map → generate-CY_Ii_bz.js.map} +1 -1
- package/dist/chunks/generate-CuOm66dn.js +57 -0
- package/dist/chunks/{generate-BtWZCvuO.js.map → generate-CuOm66dn.js.map} +1 -1
- package/dist/chunks/{generate-BrOPb9tW.js → generate-DYq5Oj58.js} +3 -4
- package/dist/chunks/{generate-BrOPb9tW.js.map → generate-DYq5Oj58.js.map} +1 -1
- package/dist/chunks/{generate-Crdzw45a.js → generate-F4FDWvFo.js} +13 -14
- package/dist/chunks/{generate-Crdzw45a.js.map → generate-F4FDWvFo.js.map} +1 -1
- package/dist/chunks/{generate-DgZhFNjO.js → generate-oZ1QeqPr.js} +17 -19
- package/dist/chunks/{generate-DgZhFNjO.js.map → generate-oZ1QeqPr.js.map} +1 -1
- package/dist/chunks/{generate.runtime-ByC9kOl2.js → generate.runtime-22jW8aVT.js} +37 -41
- package/dist/chunks/{generate.runtime-ByC9kOl2.js.map → generate.runtime-22jW8aVT.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BfQlxsWK.js → generate.runtime-B06rPt_j.js} +103 -108
- package/dist/chunks/{generate.runtime-BfQlxsWK.js.map → generate.runtime-B06rPt_j.js.map} +1 -1
- package/dist/chunks/{generate.runtime-s9ai7PxV.js → generate.runtime-B6FeCL5I.js} +85 -90
- package/dist/chunks/{generate.runtime-s9ai7PxV.js.map → generate.runtime-B6FeCL5I.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DzCVGruq.js → generate.runtime-BgGeOqYG.js} +19 -21
- package/dist/chunks/{generate.runtime-DzCVGruq.js.map → generate.runtime-BgGeOqYG.js.map} +1 -1
- package/dist/chunks/{generate.runtime-USnFqTbU.js → generate.runtime-Bv_16lWi.js} +94 -99
- package/dist/chunks/{generate.runtime-USnFqTbU.js.map → generate.runtime-Bv_16lWi.js.map} +1 -1
- package/dist/chunks/generate.runtime-Bz9z0VPR.js +108 -0
- package/dist/chunks/{generate.runtime-DVUj1LJK.js.map → generate.runtime-Bz9z0VPR.js.map} +1 -1
- package/dist/chunks/{generate.runtime-CHaE6Mm9.js → generate.runtime-C37djibw.js} +25 -27
- package/dist/chunks/{generate.runtime-CHaE6Mm9.js.map → generate.runtime-C37djibw.js.map} +1 -1
- package/dist/chunks/{generate.runtime-BsjcGBme.js → generate.runtime-CM3bj0nP.js} +12 -14
- package/dist/chunks/{generate.runtime-BsjcGBme.js.map → generate.runtime-CM3bj0nP.js.map} +1 -1
- package/dist/chunks/generate.runtime-CMuxVUIY.js +46 -0
- package/dist/chunks/{generate.runtime-BfM3dX_R.js.map → generate.runtime-CMuxVUIY.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DRZDjZqw.js → generate.runtime-CVqPHddZ.js} +44 -46
- package/dist/chunks/generate.runtime-CVqPHddZ.js.map +1 -0
- package/dist/chunks/{generate.runtime-CEd3qCtW.js → generate.runtime-C_SdcnRs.js} +44 -47
- package/dist/chunks/generate.runtime-C_SdcnRs.js.map +1 -0
- package/dist/chunks/generate.runtime-Cco2mFW2.js +63 -0
- package/dist/chunks/{generate.runtime-taYl9Tg5.js.map → generate.runtime-Cco2mFW2.js.map} +1 -1
- package/dist/chunks/generate.runtime-Cg-dfN9B.js +48 -0
- package/dist/chunks/{generate.runtime-TKR-qAJM.js.map → generate.runtime-Cg-dfN9B.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DqYYJXAz.js → generate.runtime-CjqX4tDg.js} +5 -6
- package/dist/chunks/{generate.runtime-DqYYJXAz.js.map → generate.runtime-CjqX4tDg.js.map} +1 -1
- package/dist/chunks/generate.runtime-Cry-DBNl.js +111 -0
- package/dist/chunks/{generate.runtime-2GD2E1NK.js.map → generate.runtime-Cry-DBNl.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DGmpjkRe.js → generate.runtime-Ct7cG8va.js} +76 -79
- package/dist/chunks/generate.runtime-Ct7cG8va.js.map +1 -0
- package/dist/chunks/generate.runtime-Cxg1b_BK.js +63 -0
- package/dist/chunks/{generate.runtime-CXGiQWDK.js.map → generate.runtime-Cxg1b_BK.js.map} +1 -1
- package/dist/chunks/{generate.runtime-4TxcYKld.js → generate.runtime-CyWuhV6m.js} +16 -18
- package/dist/chunks/{generate.runtime-4TxcYKld.js.map → generate.runtime-CyWuhV6m.js.map} +1 -1
- package/dist/chunks/generate.runtime-CzYArKUA.js +42 -0
- package/dist/chunks/{generate.runtime-g6qaIY3k.js.map → generate.runtime-CzYArKUA.js.map} +1 -1
- package/dist/chunks/{generate.runtime-C_5Ghjri.js → generate.runtime-D769VJFt.js} +3 -4
- package/dist/chunks/{generate.runtime-C_5Ghjri.js.map → generate.runtime-D769VJFt.js.map} +1 -1
- package/dist/chunks/{generate.runtime-C9yduilW.js → generate.runtime-DICcLOts.js} +19 -22
- package/dist/chunks/{generate.runtime-C9yduilW.js.map → generate.runtime-DICcLOts.js.map} +1 -1
- package/dist/chunks/generate.runtime-DLg2CKxQ.js +341 -0
- package/dist/chunks/generate.runtime-DLg2CKxQ.js.map +1 -0
- package/dist/chunks/{generate.runtime-C2pIioyZ.js → generate.runtime-DaPA2NNL.js} +47 -50
- package/dist/chunks/{generate.runtime-C2pIioyZ.js.map → generate.runtime-DaPA2NNL.js.map} +1 -1
- package/dist/chunks/{generate.runtime-B2DI0x05.js → generate.runtime-DfHFd8xs.js} +36 -44
- package/dist/chunks/{generate.runtime-B2DI0x05.js.map → generate.runtime-DfHFd8xs.js.map} +1 -1
- package/dist/chunks/generate.runtime-Dfl-07VS.js +428 -0
- package/dist/chunks/generate.runtime-Dfl-07VS.js.map +1 -0
- package/dist/chunks/{generate.runtime-BO1KyRcJ.js → generate.runtime-DhNspd-h.js} +64 -76
- package/dist/chunks/generate.runtime-DhNspd-h.js.map +1 -0
- package/dist/chunks/{generate.runtime-BPVZsAL0.js → generate.runtime-DkS7CBmK.js} +8 -10
- package/dist/chunks/{generate.runtime-BPVZsAL0.js.map → generate.runtime-DkS7CBmK.js.map} +1 -1
- package/dist/chunks/generate.runtime-Dtae524O.js +34 -0
- package/dist/chunks/{generate.runtime-Du8puIJQ.js.map → generate.runtime-Dtae524O.js.map} +1 -1
- package/dist/chunks/{generate.runtime-CvtSK0E1.js → generate.runtime-EB8vpc7D.js} +57 -66
- package/dist/chunks/{generate.runtime-CvtSK0E1.js.map → generate.runtime-EB8vpc7D.js.map} +1 -1
- package/dist/chunks/{generate.runtime-UrLaWKvN.js → generate.runtime-TCVlsBbJ.js} +7 -8
- package/dist/chunks/{generate.runtime-UrLaWKvN.js.map → generate.runtime-TCVlsBbJ.js.map} +1 -1
- package/dist/chunks/{generate.runtime-B8y_l-6N.js → generate.runtime-YFyuyFhh.js} +108 -132
- package/dist/chunks/generate.runtime-YFyuyFhh.js.map +1 -0
- package/dist/chunks/{generate.runtime-bWGwyz2U.js → generate.runtime-cYh0CQ5d.js} +36 -41
- package/dist/chunks/{generate.runtime-bWGwyz2U.js.map → generate.runtime-cYh0CQ5d.js.map} +1 -1
- package/dist/chunks/generate.runtime-erWI6j7m.js +64 -0
- package/dist/chunks/{generate.runtime-B-WOQsda.js.map → generate.runtime-erWI6j7m.js.map} +1 -1
- package/dist/chunks/{generate.runtime-DI73x08q.js → generate.runtime-hq8xt0m_.js} +21 -23
- package/dist/chunks/generate.runtime-hq8xt0m_.js.map +1 -0
- package/dist/chunks/{generate.runtime-C4hyve9h.js → generate.runtime-i3tMIA1A.js} +85 -108
- package/dist/chunks/{generate.runtime-C4hyve9h.js.map → generate.runtime-i3tMIA1A.js.map} +1 -1
- package/dist/chunks/generate.runtime-j_5K3Uue.js +120 -0
- package/dist/chunks/generate.runtime-j_5K3Uue.js.map +1 -0
- package/dist/chunks/{generate.runtime-BEvi6bml.js → generate.runtime-mE0knt2T.js} +34 -38
- package/dist/chunks/{generate.runtime-BEvi6bml.js.map → generate.runtime-mE0knt2T.js.map} +1 -1
- package/dist/chunks/{layout.svelte-Cb12mxua.js → layout.svelte-B6wOQ7SM.js} +10 -11
- package/dist/chunks/{layout.svelte-Cb12mxua.js.map → layout.svelte-B6wOQ7SM.js.map} +1 -1
- package/dist/chunks/{lib-specifier-Cngo1zF_.js → lib-specifier-C3M0WTev.js} +2 -3
- package/dist/chunks/{lib-specifier-Cngo1zF_.js.map → lib-specifier-C3M0WTev.js.map} +1 -1
- package/dist/chunks/{load-function-Dmkhg1pQ.js → load-function-BFvIVsh7.js} +3 -4
- package/dist/chunks/{load-function-Dmkhg1pQ.js.map → load-function-BFvIVsh7.js.map} +1 -1
- package/dist/chunks/{logger-CQONztPm.js → logger-t1HxmpG2.js} +2 -3
- package/dist/chunks/{logger-CQONztPm.js.map → logger-t1HxmpG2.js.map} +1 -1
- package/dist/chunks/{modify-file-D9U2LXEa.js → modify-file-CRZ_gMg0.js} +7 -10
- package/dist/chunks/{modify-file-D9U2LXEa.js.map → modify-file-CRZ_gMg0.js.map} +1 -1
- package/dist/chunks/{modify-nav-user-CJ1LevSU.js → modify-nav-user--7OwY9fI.js} +7 -16
- package/dist/chunks/{modify-nav-user-CJ1LevSU.js.map → modify-nav-user--7OwY9fI.js.map} +1 -1
- package/dist/chunks/{modify-nav-user-iUpv2lm-.js → modify-nav-user-D42kWyU6.js} +8 -14
- package/dist/chunks/{modify-nav-user-iUpv2lm-.js.map → modify-nav-user-D42kWyU6.js.map} +1 -1
- package/dist/chunks/modify-svelte-config-remote-wE5K2bU_.js +20 -0
- package/dist/chunks/{modify-svelte-config-remote-CEyYydL7.js.map → modify-svelte-config-remote-wE5K2bU_.js.map} +1 -1
- package/dist/chunks/{modify-user-signup-DLtopazD.js → modify-user-signup-ENhadGKH.js} +5 -6
- package/dist/chunks/{modify-user-signup-DLtopazD.js.map → modify-user-signup-ENhadGKH.js.map} +1 -1
- package/dist/chunks/{modify-utils-Cw-on_cL.js → modify-utils--zro3IGe.js} +3 -4
- package/dist/chunks/{modify-utils-Cw-on_cL.js.map → modify-utils--zro3IGe.js.map} +1 -1
- package/dist/chunks/{package-imports-B9Asv3ZH.js → package-imports-CcIIHbp5.js} +3 -4
- package/dist/chunks/{package-imports-B9Asv3ZH.js.map → package-imports-CcIIHbp5.js.map} +1 -1
- package/dist/chunks/{pocketbase-C5GS-Dh5.js → pocketbase-CvsJYXj-.js} +2 -3
- package/dist/chunks/{pocketbase-C5GS-Dh5.js.map → pocketbase-CvsJYXj-.js.map} +1 -1
- package/dist/chunks/{pocketbase-DpudAAmd.js → pocketbase-YG9yht8R.js} +2 -3
- package/dist/chunks/{pocketbase-DpudAAmd.js.map → pocketbase-YG9yht8R.js.map} +1 -1
- package/dist/chunks/{pocketbase-BTR3gI8o.js → pocketbase-gUn2UrDd.js} +6 -14
- package/dist/chunks/{pocketbase-BTR3gI8o.js.map → pocketbase-gUn2UrDd.js.map} +1 -1
- package/dist/chunks/{providers-CpRRQdMg.js → providers-BB3Z2TrN.js} +4 -5
- package/dist/chunks/{providers-CpRRQdMg.js.map → providers-BB3Z2TrN.js.map} +1 -1
- package/dist/chunks/{providers-CL9kQ4hp.js → providers-tjlFH5di.js} +4 -5
- package/dist/chunks/{providers-CL9kQ4hp.js.map → providers-tjlFH5di.js.map} +1 -1
- package/dist/chunks/{rolldown-runtime-5HNE8Q1r.js → rolldown-runtime-CwxnZyOB.js} +1 -2
- package/dist/chunks/{root-layout.svelte-CUVbnlX-.js → root-layout.svelte-DE0c_y-T.js} +12 -16
- package/dist/chunks/{root-layout.svelte-CUVbnlX-.js.map → root-layout.svelte-DE0c_y-T.js.map} +1 -1
- package/dist/chunks/{shared-CAjLx_8Z.js → shared-DE-J_b1j.js} +4 -5
- package/dist/chunks/{shared-CAjLx_8Z.js.map → shared-DE-J_b1j.js.map} +1 -1
- package/dist/chunks/{site-D0IuWkAR.js → site-B9hDxucR.js} +11 -12
- package/dist/chunks/{site-D0IuWkAR.js.map → site-B9hDxucR.js.map} +1 -1
- package/dist/chunks/{stripe-customer-B3tP8gtD.js → stripe-customer-5S-nOXP1.js} +2 -3
- package/dist/chunks/stripe-customer-5S-nOXP1.js.map +1 -0
- package/dist/chunks/{svelte-file-Dv5-bl79.js → svelte-file-DfplF3BU.js} +2 -3
- package/dist/chunks/{svelte-file-Dv5-bl79.js.map → svelte-file-DfplF3BU.js.map} +1 -1
- package/dist/chunks/{table-core-BKBoEStB.js → table-core-BXmnfjln.js} +26 -33
- package/dist/chunks/{table-core-BKBoEStB.js.map → table-core-BXmnfjln.js.map} +1 -1
- package/dist/chunks/{taggedTemplateLiteral-KSUnuvOk.js → taggedTemplateLiteral-CLenToGE.js} +1 -2
- package/dist/chunks/test-setup-cZj1tqaf.js +176 -0
- package/dist/chunks/test-setup-cZj1tqaf.js.map +1 -0
- package/dist/chunks/{ts-morph-helpers-CHI9wAil.js → ts-morph-helpers-B4KZXP44.js} +2 -3
- package/dist/chunks/{ts-morph-helpers-CHI9wAil.js.map → ts-morph-helpers-B4KZXP44.js.map} +1 -1
- package/dist/chunks/{ui-DD4NltyN.js → ui-D5xgIDR_.js} +3 -4
- package/dist/chunks/{ui-DD4NltyN.js.map → ui-D5xgIDR_.js.map} +1 -1
- package/dist/chunks/{ui-B3Db8cQg.js → ui-IkdkLwmB.js} +53 -55
- package/dist/chunks/{ui-B3Db8cQg.js.map → ui-IkdkLwmB.js.map} +1 -1
- package/dist/chunks/{unmodify-load-Buak-r1f.js → unmodify-load-CdWXJ_Ac.js} +3 -4
- package/dist/chunks/{unmodify-load-Buak-r1f.js.map → unmodify-load-CdWXJ_Ac.js.map} +1 -1
- package/dist/chunks/{util-BLYliuUK.js → util-ILWdjRAd.js} +2 -3
- package/dist/chunks/{util-BLYliuUK.js.map → util-ILWdjRAd.js.map} +1 -1
- package/dist/chunks/{whatsapp-Pya8Zi07.js → whatsapp-Bt4o4_q2.js} +3 -4
- package/dist/chunks/{whatsapp-Pya8Zi07.js.map → whatsapp-Bt4o4_q2.js.map} +1 -1
- package/dist/chunks/write-result-C1GYInL8.js +499 -0
- package/dist/chunks/write-result-C1GYInL8.js.map +1 -0
- package/dist/chunks/{wuchale-config-c3Q4JVSF.js → wuchale-config-CNXoq4rc.js} +2 -3
- package/dist/chunks/{wuchale-config-c3Q4JVSF.js.map → wuchale-config-CNXoq4rc.js.map} +1 -1
- package/dist/index.js +1497 -1581
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/_layout-DQhSAhfF.js.map +0 -1
- package/dist/chunks/_page-B6yd6_Vl.js.map +0 -1
- package/dist/chunks/_page-DoPdZgZv.js.map +0 -1
- package/dist/chunks/generate-BtWZCvuO.js +0 -58
- package/dist/chunks/generate.runtime-2GD2E1NK.js +0 -114
- package/dist/chunks/generate.runtime-7sU7RzIA.js +0 -483
- package/dist/chunks/generate.runtime-7sU7RzIA.js.map +0 -1
- package/dist/chunks/generate.runtime-B-WOQsda.js +0 -67
- package/dist/chunks/generate.runtime-B8y_l-6N.js.map +0 -1
- package/dist/chunks/generate.runtime-BO1KyRcJ.js.map +0 -1
- package/dist/chunks/generate.runtime-BfM3dX_R.js +0 -48
- package/dist/chunks/generate.runtime-CEd3qCtW.js.map +0 -1
- package/dist/chunks/generate.runtime-CXGiQWDK.js +0 -64
- package/dist/chunks/generate.runtime-DGmpjkRe.js.map +0 -1
- package/dist/chunks/generate.runtime-DI73x08q.js.map +0 -1
- package/dist/chunks/generate.runtime-DIkM5xIB.js +0 -326
- package/dist/chunks/generate.runtime-DIkM5xIB.js.map +0 -1
- package/dist/chunks/generate.runtime-DRZDjZqw.js.map +0 -1
- package/dist/chunks/generate.runtime-DVUj1LJK.js +0 -112
- package/dist/chunks/generate.runtime-Deg1Tz9u.js +0 -124
- package/dist/chunks/generate.runtime-Deg1Tz9u.js.map +0 -1
- package/dist/chunks/generate.runtime-Du8puIJQ.js +0 -35
- package/dist/chunks/generate.runtime-TKR-qAJM.js +0 -50
- package/dist/chunks/generate.runtime-g6qaIY3k.js +0 -43
- package/dist/chunks/generate.runtime-taYl9Tg5.js +0 -65
- package/dist/chunks/modify-svelte-config-remote-CEyYydL7.js +0 -42
- package/dist/chunks/stripe-customer-B3tP8gtD.js.map +0 -1
- package/dist/chunks/test-setup-CbCXmPkE.js +0 -179
- package/dist/chunks/test-setup-CbCXmPkE.js.map +0 -1
- package/dist/chunks/write-result-BWXq9RRn.js +0 -499
- package/dist/chunks/write-result-BWXq9RRn.js.map +0 -1
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
import { r as e, t } from "./lib-specifier-Cngo1zF_.js";
|
|
2
|
-
import { t as n } from "./dedent-Gq6Krl4n.js";
|
|
3
|
-
import { n as r } from "./logger-CQONztPm.js";
|
|
4
|
-
import { n as i } from "./shared-CAjLx_8Z.js";
|
|
5
|
-
import { _ as a, d as o, n as s, o as c, u as l } from "./ts-morph-helpers-CHI9wAil.js";
|
|
6
|
-
import { a as u, r as d } from "./modify-file-D9U2LXEa.js";
|
|
7
|
-
import { t as f } from "./svelte-file-Dv5-bl79.js";
|
|
8
|
-
import { n as p } from "./compose-handle-BBlamPfx.js";
|
|
9
|
-
import m from "node:fs";
|
|
10
|
-
import h from "node:path";
|
|
11
|
-
import { Project as g, QuoteKind as _, SyntaxKind as v } from "ts-morph";
|
|
12
|
-
//#region src/patterns/disable/content-negotiation/modifies/hooks.server.ts
|
|
13
|
-
var y = n`
|
|
14
|
-
Take handleNegotiate out of the exported handle in src/hooks.server.ts, then
|
|
15
|
-
remove its import:
|
|
16
|
-
|
|
17
|
-
import { handle as handleNegotiate } from '#lib/negotiate.js';
|
|
18
|
-
`;
|
|
19
|
-
function b(e) {
|
|
20
|
-
let n = e.getImportDeclarations().find((e) => t(e.getModuleSpecifierValue(), "negotiate"));
|
|
21
|
-
if (!n) return !1;
|
|
22
|
-
let r = n.getNamedImports().find((e) => e.getName() === "handle" && e.getAliasNode()?.getText() === "handleNegotiate");
|
|
23
|
-
return r ? (n.getNamedImports().length === 1 && !n.getDefaultImport() ? n.remove() : r.remove(), !0) : !1;
|
|
24
|
-
}
|
|
25
|
-
function x(e) {
|
|
26
|
-
if (!m.existsSync(e)) return {
|
|
27
|
-
status: "success",
|
|
28
|
-
changed: !1
|
|
29
|
-
};
|
|
30
|
-
let t = m.readFileSync(e, "utf8");
|
|
31
|
-
if (!t.includes("handleNegotiate")) return {
|
|
32
|
-
status: "success",
|
|
33
|
-
changed: !1
|
|
34
|
-
};
|
|
35
|
-
let n = new g({
|
|
36
|
-
compilerOptions: { allowJs: !0 },
|
|
37
|
-
manipulationSettings: { quoteKind: _.Single }
|
|
38
|
-
}).addSourceFileAtPath(e);
|
|
39
|
-
return p(n, "handleNegotiate").status === "unsupported" ? {
|
|
40
|
-
status: "failed",
|
|
41
|
-
message: y
|
|
42
|
-
} : (b(n), o(n, "@sveltejs/kit/hooks", "sequence"), c(n), s(n), n.saveSync(), {
|
|
43
|
-
status: "success",
|
|
44
|
-
changed: n.getFullText() !== t
|
|
45
|
-
});
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
//#region src/patterns/disable/content-negotiation/modifies/hooks.ts
|
|
49
|
-
function S(e) {
|
|
50
|
-
let n = e.getImportDeclarations().find((e) => t(e.getModuleSpecifierValue(), "negotiate"));
|
|
51
|
-
if (!n) return !1;
|
|
52
|
-
let r = n.getNamedImports().find((e) => e.getName() === "reroute" && e.getAliasNode()?.getText() === "negotiateReroute");
|
|
53
|
-
return r ? (n.getNamedImports().length === 1 && !n.getDefaultImport() ? n.remove() : r.remove(), !0) : !1;
|
|
54
|
-
}
|
|
55
|
-
function C(e) {
|
|
56
|
-
return e.getStatements().every((e) => e.getKind() === v.EmptyStatement);
|
|
57
|
-
}
|
|
58
|
-
function w(e) {
|
|
59
|
-
if (!m.existsSync(e)) return {
|
|
60
|
-
status: "success",
|
|
61
|
-
changed: !1
|
|
62
|
-
};
|
|
63
|
-
let t = m.readFileSync(e, "utf8");
|
|
64
|
-
if (!t.includes("negotiateReroute")) return {
|
|
65
|
-
status: "success",
|
|
66
|
-
changed: !1
|
|
67
|
-
};
|
|
68
|
-
let n = new g({
|
|
69
|
-
compilerOptions: { allowJs: !0 },
|
|
70
|
-
manipulationSettings: { quoteKind: _.Single }
|
|
71
|
-
}).addSourceFileAtPath(e), r = n.getVariableDeclaration("reroute"), i = (r?.getInitializer())?.getText() ?? "", a = n.getVariableDeclarations().some((e) => e.getName() === "rerouteDeLocalize");
|
|
72
|
-
return r && a && i.includes("rerouteDeLocalize") && i.includes("negotiateReroute") ? r.setInitializer("({ url }) => rerouteDeLocalize(url.pathname)") : r && i.includes("negotiateReroute") && r.getFirstAncestorByKind(v.VariableStatement)?.remove(), S(n), C(n) ? (m.writeFileSync(e, "", "utf8"), {
|
|
73
|
-
status: "success",
|
|
74
|
-
changed: !0
|
|
75
|
-
}) : (c(n), n.saveSync(), {
|
|
76
|
-
status: "success",
|
|
77
|
-
changed: n.getFullText() !== t
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/patterns/disable/content-negotiation/modifies/root-layout.svelte.ts
|
|
82
|
-
function T(t) {
|
|
83
|
-
if (!m.existsSync(t)) return {
|
|
84
|
-
status: "success",
|
|
85
|
-
changed: !1
|
|
86
|
-
};
|
|
87
|
-
let n = f.fromPath(t), r = n.hasElement("Negotiate");
|
|
88
|
-
return n.modifyScript((t) => {
|
|
89
|
-
let { source: n } = a(t, (t) => {
|
|
90
|
-
l(t, e("negotiate"));
|
|
91
|
-
});
|
|
92
|
-
return n;
|
|
93
|
-
}), r && n.removeElement("Negotiate"), n.writeTo(t), {
|
|
94
|
-
status: "success",
|
|
95
|
-
changed: n.hasChanged()
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/patterns/disable/content-negotiation/generate.runtime.ts
|
|
100
|
-
async function E(e) {
|
|
101
|
-
let t = r(e), n = [], a = [], o = (e) => {
|
|
102
|
-
e && n.push(e);
|
|
103
|
-
};
|
|
104
|
-
t.info("Reverting hooks.server.ts");
|
|
105
|
-
let s = h.join(e.root, "src", "hooks.server.ts"), c = u(s, x(s));
|
|
106
|
-
o(c.modify), c.delete && a.push(c.delete), t.info("Reverting hooks.ts");
|
|
107
|
-
let l = h.join(e.root, "src", "hooks.ts"), f = w(l);
|
|
108
|
-
m.existsSync(l) && m.readFileSync(l, "utf8").trim() === "" ? a.push(i(l)) : o(d(l, f)), t.info("Reverting src/routes/+layout.svelte");
|
|
109
|
-
let p = h.join(e.root, "src", "routes", "+layout.svelte");
|
|
110
|
-
return o(d(p, T(p))), {
|
|
111
|
-
creates: [],
|
|
112
|
-
modifies: n,
|
|
113
|
-
deletes: a,
|
|
114
|
-
components: [],
|
|
115
|
-
packages: [],
|
|
116
|
-
collections: [],
|
|
117
|
-
collectionPatches: [],
|
|
118
|
-
collectionDrops: []
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
//#endregion
|
|
122
|
-
export { E as generate };
|
|
123
|
-
|
|
124
|
-
//# sourceMappingURL=generate.runtime-Deg1Tz9u.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"generate.runtime-Deg1Tz9u.js","names":["removeNegotiateImport","libModule","dedent","getLogger","toDeleteEntry","withInMemoryScript","removeNamedImportIfUnused","ensureBlankLineAfterImports","formatLikeSource","removeImportByModuleSpecifier","revertOutcomeToFile","modifyOutcomeToFile","SvelteFile","removeHandle","fs","path","FAILURE_HINT","removeNegotiateImport$1","decl","sourceFile","isLibSpecifier","d","named","ni","unmodifyHooksServerNegotiate","hooksServerPath","original","Project","QuoteKind","removeNegotiateImport","isMeaningfullyEmpty","s","SyntaxKind","unmodifyHooksNegotiate","hooksPath","rerouteDecl","initText","hasI18nHelper","unmodifyRootLayoutNegotiate","layoutPath","file","hasElement","out","source","sf","generate","logger","options","modifies","deletes","pushResult","hooksServerRevert","hooksOutcome","rootLayoutPath"],"sources":["../../src/patterns/disable/content-negotiation/modifies/hooks.server.ts","../../src/patterns/disable/content-negotiation/modifies/hooks.ts","../../src/patterns/disable/content-negotiation/modifies/root-layout.svelte.ts","../../src/patterns/disable/content-negotiation/generate.runtime.ts"],"sourcesContent":["import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport { Project, QuoteKind, type SourceFile } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { removeHandle } from \"../../../../runtime/compose-handle\";\nimport {\n ensureBlankLineAfterImports,\n removeNamedImportIfUnused,\n formatLikeSource,\n} from \"../../../../runtime/ts-morph-helpers\";\nimport { isLibSpecifier } from \"../../../../runtime/lib-specifier\";\n\nconst FAILURE_HINT = dedent`\n Take handleNegotiate out of the exported handle in src/hooks.server.ts, then\n remove its import:\n\n import { handle as handleNegotiate } from '#lib/negotiate.js';\n`;\n\nfunction removeNegotiateImport(sourceFile: SourceFile): boolean {\n const decl = sourceFile\n .getImportDeclarations()\n .find((d) => isLibSpecifier(d.getModuleSpecifierValue(), \"negotiate\"));\n if (!decl) return false;\n\n const named = decl.getNamedImports().find((ni) => {\n return (\n ni.getName() === \"handle\" &&\n ni.getAliasNode()?.getText() === \"handleNegotiate\"\n );\n });\n\n if (!named) return false;\n\n if (decl.getNamedImports().length === 1 && !decl.getDefaultImport()) {\n decl.remove();\n } else {\n named.remove();\n }\n return true;\n}\n\n/**\n * Undo `modifyHooksServerNegotiate`: take `handleNegotiate` out of the\n * exported handle and drop its import. A file that held nothing else comes\n * out empty, for the caller to delete.\n */\nexport function unmodifyHooksServerNegotiate(\n hooksServerPath: string,\n): ModifyOutcome {\n if (!fs.existsSync(hooksServerPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(hooksServerPath, \"utf8\");\n if (!original.includes(\"handleNegotiate\")) {\n return { status: \"success\", changed: false };\n }\n\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(hooksServerPath);\n\n const removed = removeHandle(sourceFile, \"handleNegotiate\");\n if (removed.status === \"unsupported\") {\n return { status: \"failed\", message: FAILURE_HINT };\n }\n removeNegotiateImport(sourceFile);\n removeNamedImportIfUnused(sourceFile, \"@sveltejs/kit/hooks\", \"sequence\");\n formatLikeSource(sourceFile);\n ensureBlankLineAfterImports(sourceFile);\n sourceFile.saveSync();\n\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== original,\n };\n}\n","import fs from \"node:fs\";\nimport { Project, QuoteKind, SyntaxKind, type SourceFile } from \"ts-morph\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { formatLikeSource } from \"../../../../runtime/ts-morph-helpers\";\nimport { isLibSpecifier } from \"../../../../runtime/lib-specifier\";\n\nfunction removeNegotiateImport(sourceFile: SourceFile): boolean {\n const decl = sourceFile\n .getImportDeclarations()\n .find((d) => isLibSpecifier(d.getModuleSpecifierValue(), \"negotiate\"));\n if (!decl) return false;\n\n const named = decl.getNamedImports().find((ni) => {\n return (\n ni.getName() === \"reroute\" &&\n ni.getAliasNode()?.getText() === \"negotiateReroute\"\n );\n });\n if (!named) return false;\n\n if (decl.getNamedImports().length === 1 && !decl.getDefaultImport()) {\n decl.remove();\n } else {\n named.remove();\n }\n return true;\n}\n\nfunction isMeaningfullyEmpty(sourceFile: SourceFile): boolean {\n return sourceFile\n .getStatements()\n .every((s) => s.getKind() === SyntaxKind.EmptyStatement);\n}\n\nexport function unmodifyHooksNegotiate(hooksPath: string): ModifyOutcome {\n if (!fs.existsSync(hooksPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(hooksPath, \"utf8\");\n if (!original.includes(\"negotiateReroute\")) {\n return { status: \"success\", changed: false };\n }\n\n const project = new Project({\n compilerOptions: { allowJs: true },\n manipulationSettings: { quoteKind: QuoteKind.Single },\n });\n const sourceFile = project.addSourceFileAtPath(hooksPath);\n\n const rerouteDecl = sourceFile.getVariableDeclaration(\"reroute\");\n const init = rerouteDecl?.getInitializer();\n const initText = init?.getText() ?? \"\";\n\n const hasI18nHelper = sourceFile\n .getVariableDeclarations()\n .some((d) => d.getName() === \"rerouteDeLocalize\");\n\n if (\n rerouteDecl &&\n hasI18nHelper &&\n initText.includes(\"rerouteDeLocalize\") &&\n initText.includes(\"negotiateReroute\")\n ) {\n rerouteDecl.setInitializer(\"({ url }) => rerouteDeLocalize(url.pathname)\");\n } else if (rerouteDecl && initText.includes(\"negotiateReroute\")) {\n const stmt = rerouteDecl.getFirstAncestorByKind(\n SyntaxKind.VariableStatement,\n );\n stmt?.remove();\n }\n\n removeNegotiateImport(sourceFile);\n\n if (isMeaningfullyEmpty(sourceFile)) {\n // Emptied rather than removed: the runtime turns an empty hooks.ts into a\n // delete entry, so the removal is written and reported like any other.\n fs.writeFileSync(hooksPath, \"\", \"utf8\");\n return { status: \"success\", changed: true };\n }\n\n formatLikeSource(sourceFile);\n sourceFile.saveSync();\n return {\n status: \"success\",\n changed: sourceFile.getFullText() !== original,\n };\n}\n","import fs from \"node:fs\";\nimport { SvelteFile } from \"../../../../runtime/svelte-file\";\nimport {\n removeImportByModuleSpecifier,\n withInMemoryScript,\n} from \"../../../../runtime/ts-morph-helpers\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\nimport { libModule } from \"../../../../runtime/lib-specifier\";\n\nexport function unmodifyRootLayoutNegotiate(layoutPath: string): ModifyOutcome {\n if (!fs.existsSync(layoutPath)) {\n return { status: \"success\", changed: false };\n }\n\n const file = SvelteFile.fromPath(layoutPath);\n const hasElement = file.hasElement(\"Negotiate\");\n\n file.modifyScript((source) => {\n const { source: out } = withInMemoryScript(source, (sf) => {\n removeImportByModuleSpecifier(sf, libModule(\"negotiate\"));\n });\n return out;\n });\n\n if (hasElement) {\n file.removeElement(\"Negotiate\");\n }\n\n file.writeTo(layoutPath);\n return { status: \"success\", changed: file.hasChanged() };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { File, Options, Result } from \"../../../core/types\";\nimport { toDeleteEntry } from \"../../destroy/shared\";\nimport { getLogger } from \"../../../core/logger\";\nimport {\n modifyOutcomeToFile,\n revertOutcomeToFile,\n} from \"../../../runtime/modify-file\";\nimport { unmodifyHooksServerNegotiate } from \"./modifies/hooks.server\";\nimport { unmodifyHooksNegotiate } from \"./modifies/hooks\";\nimport { unmodifyRootLayoutNegotiate } from \"./modifies/root-layout.svelte\";\n\nexport async function generate(options: Options) {\n const logger = getLogger(options);\n const modifies: File[] = [];\n const deletes: File[] = [];\n const pushResult = (file: File | null) => {\n if (file) modifies.push(file);\n };\n\n logger.info(\"Reverting hooks.server.ts\");\n const hooksServerPath = path.join(options.root, \"src\", \"hooks.server.ts\");\n // Emptied once the negotiation handle was all it held, it goes.\n const hooksServerRevert = revertOutcomeToFile(\n hooksServerPath,\n unmodifyHooksServerNegotiate(hooksServerPath),\n );\n pushResult(hooksServerRevert.modify);\n if (hooksServerRevert.delete) deletes.push(hooksServerRevert.delete);\n\n logger.info(\"Reverting hooks.ts\");\n const hooksPath = path.join(options.root, \"src\", \"hooks.ts\");\n const hooksOutcome = unmodifyHooksNegotiate(hooksPath);\n if (\n fs.existsSync(hooksPath) &&\n fs.readFileSync(hooksPath, \"utf8\").trim() === \"\"\n ) {\n // The reroute was all it contained; the file goes with it.\n deletes.push(toDeleteEntry(hooksPath));\n } else {\n pushResult(modifyOutcomeToFile(hooksPath, hooksOutcome));\n }\n\n logger.info(\"Reverting src/routes/+layout.svelte\");\n const rootLayoutPath = path.join(\n options.root,\n \"src\",\n \"routes\",\n \"+layout.svelte\",\n );\n pushResult(\n modifyOutcomeToFile(\n rootLayoutPath,\n unmodifyRootLayoutNegotiate(rootLayoutPath),\n ),\n );\n\n return {\n creates: [],\n modifies,\n deletes,\n components: [],\n packages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Q,MAAM,OAAO,UAAU,GACrDK,IAAenB,EAAuBC,CAAS;CAWrD,AATEpB,EAAG,WAAWoB,CAAS,KACvBpB,EAAG,aAAaoB,GAAW,MAAM,CAAC,CAAC,KAAK,MAAM,KAG9Ce,EAAQ,KAAK7C,EAAc8B,CAAS,CAAC,IAErCgB,EAAWvC,EAAoBuB,GAAWkB,CAAY,CAAC,GAGzDN,EAAO,KAAK,qCAAqC;CACjD,IAAMO,IAAiBtC,EAAK,KAC1BgC,EAAQ,MACR,OACA,UACA,gBACF;CAQA,OAPAG,EACEvC,EACE0C,GACAf,EAA4Be,CAAc,CAC5C,CACF,GAEO;EACL,SAAS,CAAC;EACV;EACA;EACA,YAAY,CAAC;EACb,UAAU,CAAC;EACX,aAAa,CAAC;EACd,mBAAmB,CAAC;EACpB,iBAAiB,CAAC;CACpB;AACF"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { o as e } from "./generate-DjuhSibA.js";
|
|
2
|
-
import { n as t } from "./logger-CQONztPm.js";
|
|
3
|
-
import { n } from "./shared-CAjLx_8Z.js";
|
|
4
|
-
import { n as r, r as i, t as a } from "./generate-BtWZCvuO.js";
|
|
5
|
-
import { n as o } from "./env-BugddEjd.js";
|
|
6
|
-
import { t as s } from "./modify-file-D9U2LXEa.js";
|
|
7
|
-
import { unmodifyEnvVarsFiles as c } from "./env-vars-XvAeH6u5.js";
|
|
8
|
-
import l from "node:fs";
|
|
9
|
-
import u from "node:path";
|
|
10
|
-
//#region src/patterns/disable/ai/generate.runtime.ts
|
|
11
|
-
async function d(d) {
|
|
12
|
-
let f = t(d), p = [], m = [], h = e(d);
|
|
13
|
-
for (let e of i(d)) {
|
|
14
|
-
let t = `${e}/+page.svelte`;
|
|
15
|
-
e !== h && l.existsSync(u.join(d.root, t)) && m.push(n(t));
|
|
16
|
-
}
|
|
17
|
-
f.info("Removing the AI provider's API key from src/env.ts");
|
|
18
|
-
let g = c(d.root, r());
|
|
19
|
-
g.modify && p.push(g.modify), g.delete && m.push(g.delete), f.info("Removing the AI provider's API key from .env");
|
|
20
|
-
let _ = u.join(d.root, ".env"), v = s(_, o(_, a()));
|
|
21
|
-
return v.modify && p.push(v.modify), v.delete && m.push(v.delete), {
|
|
22
|
-
creates: [],
|
|
23
|
-
modifies: p,
|
|
24
|
-
deletes: m,
|
|
25
|
-
components: [],
|
|
26
|
-
packages: [],
|
|
27
|
-
collections: [],
|
|
28
|
-
collectionPatches: [],
|
|
29
|
-
collectionDrops: []
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
//#endregion
|
|
33
|
-
export { d as generate };
|
|
34
|
-
|
|
35
|
-
//# sourceMappingURL=generate.runtime-Du8puIJQ.js.map
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { n as e } from "./logger-CQONztPm.js";
|
|
2
|
-
import { _ as t, n, u as r } from "./ts-morph-helpers-CHI9wAil.js";
|
|
3
|
-
import { r as i } from "./modify-file-D9U2LXEa.js";
|
|
4
|
-
import { t as a } from "./svelte-file-Dv5-bl79.js";
|
|
5
|
-
import { n as o, t as s } from "./layout.svelte-Cb12mxua.js";
|
|
6
|
-
import c from "node:fs";
|
|
7
|
-
import l from "node:path";
|
|
8
|
-
import { Node as u } from "ts-morph";
|
|
9
|
-
//#region src/patterns/disable/og/modifies/layout.svelte.ts
|
|
10
|
-
function d(e) {
|
|
11
|
-
if (!c.existsSync(e)) return {
|
|
12
|
-
status: "success",
|
|
13
|
-
changed: !1
|
|
14
|
-
};
|
|
15
|
-
let i = a.fromPath(e);
|
|
16
|
-
return i.getScript()?.content.includes("withCard") ? (i.modifyScript((e) => {
|
|
17
|
-
let { source: i } = t(e, (e) => {
|
|
18
|
-
let t = o(e)?.getArguments()[0];
|
|
19
|
-
t && u.isCallExpression(t) && t.getExpression().getText() === "withCard" && t.replaceWithText(t.getArguments()[0].getText()), r(e, s), n(e);
|
|
20
|
-
});
|
|
21
|
-
return i;
|
|
22
|
-
}), i.writeTo(e), {
|
|
23
|
-
status: "success",
|
|
24
|
-
changed: i.hasChanged()
|
|
25
|
-
}) : {
|
|
26
|
-
status: "success",
|
|
27
|
-
changed: !1
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
//#endregion
|
|
31
|
-
//#region src/patterns/disable/og/generate.runtime.ts
|
|
32
|
-
async function f(t) {
|
|
33
|
-
let n = e(t), r = [];
|
|
34
|
-
n.info("Reverting src/routes/+layout.svelte");
|
|
35
|
-
let a = l.join(t.root, "src", "routes", "+layout.svelte"), o = i(a, d(a));
|
|
36
|
-
return o && r.push(o), {
|
|
37
|
-
creates: [],
|
|
38
|
-
modifies: r,
|
|
39
|
-
deletes: [],
|
|
40
|
-
components: [],
|
|
41
|
-
packages: [],
|
|
42
|
-
collections: [],
|
|
43
|
-
collectionPatches: [],
|
|
44
|
-
collectionDrops: []
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
//#endregion
|
|
48
|
-
export { f as generate };
|
|
49
|
-
|
|
50
|
-
//# sourceMappingURL=generate.runtime-TKR-qAJM.js.map
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { t as e } from "./errors-DR3gF_7a.js";
|
|
2
|
-
import { n as t } from "./constants-CUv536Rj.js";
|
|
3
|
-
import { a as n, c as r, l as i } from "./providers-CL9kQ4hp.js";
|
|
4
|
-
import { n as a, s as o } from "./generate-DjuhSibA.js";
|
|
5
|
-
import { n as s } from "./logger-CQONztPm.js";
|
|
6
|
-
import { t as c } from "./env-BugddEjd.js";
|
|
7
|
-
import { r as l } from "./modify-file-D9U2LXEa.js";
|
|
8
|
-
import { modifyEnvVarsFiles as u } from "./env-vars-XvAeH6u5.js";
|
|
9
|
-
import { o as d } from "./config-target-BgyFkbFL.js";
|
|
10
|
-
import { c as f } from "./write-result-BWXq9RRn.js";
|
|
11
|
-
import p from "node:path";
|
|
12
|
-
//#region src/patterns/enable/ai/generate.runtime.ts
|
|
13
|
-
var m = f(t), h = [
|
|
14
|
-
`AI needs a server, and this project builds with ${m}.`,
|
|
15
|
-
"The chat endpoint streams each reply from the server with a private API key, which a static site cannot do.",
|
|
16
|
-
"Switch to a server adapter first: `vela enable backend` moves the project to @sveltejs/adapter-node."
|
|
17
|
-
].join("\n");
|
|
18
|
-
function g(e) {
|
|
19
|
-
let t = d(e);
|
|
20
|
-
return t.status === "resolved" && t.target.sourceFile.getImportDeclarations().some((e) => e.getModuleSpecifierValue() === m);
|
|
21
|
-
}
|
|
22
|
-
async function _(t) {
|
|
23
|
-
if (g(t.root)) throw new e(h);
|
|
24
|
-
let d = s(t), f = r(a, t), m = [], _ = [];
|
|
25
|
-
d.info("Declaring the API key in src/env.ts");
|
|
26
|
-
let v = u(t.root, n(f));
|
|
27
|
-
v.create && m.push(v.create), v.modify && _.push(v.modify), d.info("Updating .env");
|
|
28
|
-
let y = p.join(t.root, ".env"), b = l(y, c(y, o(f, i(t))));
|
|
29
|
-
return b && _.push(b), {
|
|
30
|
-
creates: m,
|
|
31
|
-
modifies: _,
|
|
32
|
-
deletes: [],
|
|
33
|
-
components: [],
|
|
34
|
-
packages: [],
|
|
35
|
-
collections: [],
|
|
36
|
-
collectionPatches: [],
|
|
37
|
-
collectionDrops: []
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
//#endregion
|
|
41
|
-
export { _ as generate };
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=generate.runtime-g6qaIY3k.js.map
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { r as e } from "./lib-specifier-Cngo1zF_.js";
|
|
2
|
-
import { n as t } from "./logger-CQONztPm.js";
|
|
3
|
-
import { n, t as r } from "./generate-Crdzw45a.js";
|
|
4
|
-
import { n as i } from "./env-BugddEjd.js";
|
|
5
|
-
import { _ as a, n as o, u as s } from "./ts-morph-helpers-CHI9wAil.js";
|
|
6
|
-
import { r as c, t as l } from "./modify-file-D9U2LXEa.js";
|
|
7
|
-
import { unmodifyEnvVarsFiles as u } from "./env-vars-XvAeH6u5.js";
|
|
8
|
-
import { t as d } from "./svelte-file-Dv5-bl79.js";
|
|
9
|
-
import f from "node:fs";
|
|
10
|
-
import p from "node:path";
|
|
11
|
-
//#region src/patterns/disable/analytics/modifies/layout.svelte.ts
|
|
12
|
-
var m = "components/analytics/analytics.svelte";
|
|
13
|
-
function h(t) {
|
|
14
|
-
if (!f.existsSync(t)) return {
|
|
15
|
-
status: "success",
|
|
16
|
-
changed: !1
|
|
17
|
-
};
|
|
18
|
-
let n = f.readFileSync(t, "utf8");
|
|
19
|
-
if (!n.includes(m) && !n.includes("<Analytics")) return {
|
|
20
|
-
status: "success",
|
|
21
|
-
changed: !1
|
|
22
|
-
};
|
|
23
|
-
let r = d.fromPath(t);
|
|
24
|
-
r.modifyScript((t) => {
|
|
25
|
-
let { source: n } = a(t, (t) => {
|
|
26
|
-
s(t, e(m)), o(t);
|
|
27
|
-
});
|
|
28
|
-
return n;
|
|
29
|
-
});
|
|
30
|
-
let i = r.toString().replace(/[ \t]*<Analytics\s*\/>[ \t]*\r?\n?/g, "");
|
|
31
|
-
return i === n ? {
|
|
32
|
-
status: "success",
|
|
33
|
-
changed: !1
|
|
34
|
-
} : (f.writeFileSync(t, i, "utf8"), {
|
|
35
|
-
status: "success",
|
|
36
|
-
changed: !0
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
//#region src/patterns/disable/analytics/generate.runtime.ts
|
|
41
|
-
async function g(e) {
|
|
42
|
-
let a = t(e), o = [], s = [], d = (e) => {
|
|
43
|
-
e && o.push(e);
|
|
44
|
-
};
|
|
45
|
-
a.info("Reverting src/routes/+layout.svelte");
|
|
46
|
-
let f = p.join(e.root, "src", "routes", "+layout.svelte");
|
|
47
|
-
d(c(f, h(f))), a.info("Removing analytics variables from src/env.ts");
|
|
48
|
-
let m = u(e.root, n());
|
|
49
|
-
d(m.modify), m.delete && s.push(m.delete), a.info("Removing analytics variables from .env");
|
|
50
|
-
let g = p.join(e.root, ".env"), _ = l(g, i(g, r()));
|
|
51
|
-
return d(_.modify), _.delete && s.push(_.delete), {
|
|
52
|
-
creates: [],
|
|
53
|
-
modifies: o,
|
|
54
|
-
deletes: s,
|
|
55
|
-
components: [],
|
|
56
|
-
packages: [],
|
|
57
|
-
collections: [],
|
|
58
|
-
collectionPatches: [],
|
|
59
|
-
collectionDrops: []
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
//#endregion
|
|
63
|
-
export { g as generate };
|
|
64
|
-
|
|
65
|
-
//# sourceMappingURL=generate.runtime-taYl9Tg5.js.map
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { i as e, n as t, r as n } from "./config-target-BgyFkbFL.js";
|
|
2
|
-
//#region src/runtime/modify-svelte-config-remote.ts
|
|
3
|
-
var r = [
|
|
4
|
-
"Enable SvelteKit remote functions and Svelte async in your config",
|
|
5
|
-
"(the sveltekit() plugin arg in vite.config):",
|
|
6
|
-
"",
|
|
7
|
-
"experimental: { remoteFunctions: true },",
|
|
8
|
-
"compilerOptions: { experimental: { async: true } },"
|
|
9
|
-
].join("\n"), i = [
|
|
10
|
-
"Enable SvelteKit remote functions and Svelte async by passing config to the",
|
|
11
|
-
"sveltekit() plugin in vite.config.ts:",
|
|
12
|
-
"",
|
|
13
|
-
"import { sveltekit } from '@sveltejs/kit/vite';",
|
|
14
|
-
"import { defineConfig } from 'vite';",
|
|
15
|
-
"",
|
|
16
|
-
"export default defineConfig({",
|
|
17
|
-
" plugins: [",
|
|
18
|
-
" sveltekit({",
|
|
19
|
-
" experimental: { remoteFunctions: true },",
|
|
20
|
-
" compilerOptions: { experimental: { async: true } },",
|
|
21
|
-
" }),",
|
|
22
|
-
" ],",
|
|
23
|
-
"});"
|
|
24
|
-
].join("\n");
|
|
25
|
-
function a(a) {
|
|
26
|
-
return e(a, {
|
|
27
|
-
notFound: i,
|
|
28
|
-
failed: r
|
|
29
|
-
}, (e) => {
|
|
30
|
-
let r = n(e.configObject, "experimental", "{}");
|
|
31
|
-
if (!r) return !1;
|
|
32
|
-
t(r, "remoteFunctions");
|
|
33
|
-
let i = n(e.configObject, "compilerOptions", "{}");
|
|
34
|
-
if (!i) return !1;
|
|
35
|
-
let a = n(i, "experimental", "{}");
|
|
36
|
-
return a ? (t(a, "async"), !0) : !1;
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
|
-
//#endregion
|
|
40
|
-
export { a as modifySvelteConfigRemote };
|
|
41
|
-
|
|
42
|
-
//# sourceMappingURL=modify-svelte-config-remote-CEyYydL7.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stripe-customer-B3tP8gtD.js","names":["stripe_customer_default"],"sources":[],"mappings":""}
|
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { n as e, t } from "./constants-CUv536Rj.js";
|
|
2
|
-
import { t as n } from "./dedent-Gq6Krl4n.js";
|
|
3
|
-
import { o as r, s as i } from "./config-target-BgyFkbFL.js";
|
|
4
|
-
import { c as a } from "./write-result-BWXq9RRn.js";
|
|
5
|
-
import o from "node:fs";
|
|
6
|
-
import s from "node:path";
|
|
7
|
-
import { SyntaxKind as c } from "ts-morph";
|
|
8
|
-
//#region src/patterns/enable/backend/modifies/svelte-config.ts
|
|
9
|
-
var l = a(t), u = a(e), d = "@sveltejs/adapter-auto", f = n`
|
|
10
|
-
Switch the SvelteKit adapter to ${l}:
|
|
11
|
-
|
|
12
|
-
import adapter from '${l}';
|
|
13
|
-
|
|
14
|
-
// ...
|
|
15
|
-
adapter: adapter()
|
|
16
|
-
`, p = n`
|
|
17
|
-
Configure ${l} via the sveltekit() plugin in vite.config.ts.
|
|
18
|
-
`;
|
|
19
|
-
function m(e) {
|
|
20
|
-
return e.getImportDeclarations().find((e) => [
|
|
21
|
-
u,
|
|
22
|
-
d,
|
|
23
|
-
l
|
|
24
|
-
].includes(e.getModuleSpecifierValue()));
|
|
25
|
-
}
|
|
26
|
-
function h(e) {
|
|
27
|
-
return e.getDescendantsOfKind(c.CallExpression).filter((e) => e.getExpression().getText() === "adapter");
|
|
28
|
-
}
|
|
29
|
-
function g(e) {
|
|
30
|
-
let t = r(e, {
|
|
31
|
-
notFound: p,
|
|
32
|
-
failed: f
|
|
33
|
-
});
|
|
34
|
-
if (t.status !== "resolved") return {
|
|
35
|
-
filePath: t.filePath,
|
|
36
|
-
outcome: {
|
|
37
|
-
status: t.status,
|
|
38
|
-
message: t.message
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
let { target: n } = t, a = m(n.sourceFile);
|
|
42
|
-
if (!a) return {
|
|
43
|
-
filePath: n.filePath,
|
|
44
|
-
outcome: {
|
|
45
|
-
status: "failed",
|
|
46
|
-
message: f
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
a.getModuleSpecifierValue() !== l && a.setModuleSpecifier(l);
|
|
50
|
-
for (let e of h(n.sourceFile)) {
|
|
51
|
-
let t = e.getArguments();
|
|
52
|
-
for (let n = t.length - 1; n >= 0; n--) e.removeArgument(n);
|
|
53
|
-
}
|
|
54
|
-
return {
|
|
55
|
-
filePath: n.filePath,
|
|
56
|
-
outcome: i(n)
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function _(e) {
|
|
60
|
-
let t = r(e, {
|
|
61
|
-
notFound: p,
|
|
62
|
-
failed: f
|
|
63
|
-
});
|
|
64
|
-
if (t.status === "not-found") return {
|
|
65
|
-
filePath: t.filePath,
|
|
66
|
-
outcome: {
|
|
67
|
-
status: "success",
|
|
68
|
-
changed: !1
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
if (t.status === "failed") return {
|
|
72
|
-
filePath: t.filePath,
|
|
73
|
-
outcome: {
|
|
74
|
-
status: "failed",
|
|
75
|
-
message: t.message
|
|
76
|
-
}
|
|
77
|
-
};
|
|
78
|
-
let { target: n } = t, a = m(n.sourceFile);
|
|
79
|
-
if (!a) return {
|
|
80
|
-
filePath: n.filePath,
|
|
81
|
-
outcome: {
|
|
82
|
-
status: "success",
|
|
83
|
-
changed: !1
|
|
84
|
-
}
|
|
85
|
-
};
|
|
86
|
-
a.getModuleSpecifierValue() !== u && a.setModuleSpecifier(u);
|
|
87
|
-
for (let e of h(n.sourceFile)) e.getArguments().length === 0 && e.addArgument("{ fallback: '200.html' }");
|
|
88
|
-
return {
|
|
89
|
-
filePath: n.filePath,
|
|
90
|
-
outcome: i(n)
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
//#endregion
|
|
94
|
-
//#region src/patterns/enable/backend/modifies/gitignore.ts
|
|
95
|
-
var v = "# PocketBase\n/data/*\n!/data/fixtures\n!/data/seeds\n!/data/hooks\n", y = n`
|
|
96
|
-
Create a .gitignore at the project root with the PocketBase block:
|
|
97
|
-
|
|
98
|
-
# PocketBase
|
|
99
|
-
/data/*
|
|
100
|
-
!/data/fixtures
|
|
101
|
-
!/data/seeds
|
|
102
|
-
!/data/hooks
|
|
103
|
-
`;
|
|
104
|
-
function b(e) {
|
|
105
|
-
if (!o.existsSync(e)) return {
|
|
106
|
-
status: "not-found",
|
|
107
|
-
message: y
|
|
108
|
-
};
|
|
109
|
-
let t = o.readFileSync(e, "utf8");
|
|
110
|
-
if (t.includes("# PocketBase") && t.includes("/data/*")) return {
|
|
111
|
-
status: "success",
|
|
112
|
-
changed: !1
|
|
113
|
-
};
|
|
114
|
-
let n = t + (t.endsWith("\n") ? "\n" : "\n\n") + v;
|
|
115
|
-
return o.writeFileSync(e, n, "utf8"), {
|
|
116
|
-
status: "success",
|
|
117
|
-
changed: !0
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
|
-
function x(e) {
|
|
121
|
-
if (!o.existsSync(e)) return {
|
|
122
|
-
status: "success",
|
|
123
|
-
changed: !1
|
|
124
|
-
};
|
|
125
|
-
let t = o.readFileSync(e, "utf8");
|
|
126
|
-
if (!t.includes("# PocketBase")) return {
|
|
127
|
-
status: "success",
|
|
128
|
-
changed: !1
|
|
129
|
-
};
|
|
130
|
-
let n = t.replace(/\n*# PocketBase\n\/data\/\*\n!\/data\/fixtures\n!\/data\/seeds\n!\/data\/hooks\n?/, "\n").replace(/\n{3,}$/, "\n");
|
|
131
|
-
return n === t ? {
|
|
132
|
-
status: "success",
|
|
133
|
-
changed: !1
|
|
134
|
-
} : (o.writeFileSync(e, n, "utf8"), {
|
|
135
|
-
status: "success",
|
|
136
|
-
changed: !0
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
//#endregion
|
|
140
|
-
//#region src/patterns/enable/backend/modifies/test-setup.ts
|
|
141
|
-
var S = "import { beforeEach, afterEach, beforeAll, inject } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase/testing';\nimport type {} from 'vela/testing';\n\n// The servers `vela/testing` started: a throwaway PocketBase and the app.\nconst servers = inject('vela');\nif (!servers) {\n throw new Error(\n 'Server tests need the servers `vela/testing` starts. Add `globalSetup: [\\'vela/testing\\']` to the test config in vitest.config.ts.'\n );\n}\n\nconst admin = new PocketBase(servers.pocketbaseUrl) as App.Locals['admin'];\nconst pb = new PocketBase(servers.pocketbaseUrl) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email?: string }) {\n // Logs in with the password, so it needs the email (made optional by\n // enable-whatsapp, for accounts that sign in with a phone number).\n if (!user.email) {\n throw new Error('authenticateUser needs a user with an email');\n }\n await agent.post('/login').type('form').send({\n type: 'password',\n email: user.email,\n password: testUserPassword\n });\n}\n\nbeforeAll(async () => {\n await admin\n // @ts-ignore\n .collection('_superusers')\n .authWithPassword(servers.superuser.email, servers.superuser.password);\n});\n\nbeforeEach(async (context: TestContext) => {\n context.request = supertest(servers.appUrl);\n context.agent = supertest.agent(servers.appUrl) as TestContext['agent'];\n context.admin = admin;\n context.pb = pb;\n const email = `test-${Math.random().toString(36).slice(2)}@example.com`;\n context.user = await context.admin.collection('users').create({\n email,\n password: testUserPassword,\n passwordConfirm: testUserPassword\n });\n context.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n await context.pb.collection('users').authWithPassword(email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n await context.pb.authStore.clear();\n await context.admin.collection('users').delete(context.user.id);\n});\n", C = "import { beforeEach } from 'vitest';\nimport supertest from 'supertest';\n\nbeforeEach(async (context: any) => {\n context.request = supertest(process.env.VITE_TEST_URL!);\n context.agent = supertest.agent(process.env.VITE_TEST_URL!);\n});\n", w = "import { configDefaults, defineConfig, mergeConfig } from 'vitest/config';\nimport viteConfig from './vite.config';\n\nexport default mergeConfig(\n viteConfig,\n defineConfig({\n test: {\n expect: {\n requireAssertions: true\n },\n environment: 'node',\n passWithNoTests: true,\n // Server tests reach the app over HTTP and import nothing from it, so\n // watch mode cannot see which tests an edit affects. Rerun them all.\n forceRerunTriggers: [\n '**/package.json/**',\n '**/{vitest,vite}.config.*/**',\n 'src/routes/**',\n 'src/lib/server/**',\n 'src/hooks.server.ts',\n 'data/hooks/**'\n ],\n projects: [\n {\n extends: true,\n test: {\n // `server.test.ts` next to a route, `<name>.server.test.ts` elsewhere:\n // tests that run against the app and its database.\n name: 'server',\n include: ['src/**/*server.{test,spec}.{js,ts}'],\n // Starts a throwaway PocketBase and the app before the first test\n // file, and stops them after the last. Every way of running vitest\n // gets the same servers: `vela test:server`, `vitest`, `vitest --watch`,\n // an editor's test runner.\n globalSetup: ['vela/testing'],\n setupFiles: ['test/setup.ts']\n }\n },\n {\n extends: true,\n test: {\n // Every other test: pure functions, no servers, no setup file.\n name: 'unit',\n include: ['src/**/*.{test,spec}.{js,ts}'],\n exclude: [\n ...configDefaults.exclude,\n 'src/**/*server.{test,spec}.{js,ts}',\n 'src/**/*.svelte.{test,spec}.{js,ts}'\n ]\n }\n }\n ]\n }\n })\n);\n", T = [
|
|
142
|
-
"ts",
|
|
143
|
-
"mts",
|
|
144
|
-
"js",
|
|
145
|
-
"mjs"
|
|
146
|
-
].flatMap((e) => [`vitest.config.${e}`, `vitest.workspace.${e}`]);
|
|
147
|
-
function E(e) {
|
|
148
|
-
return T.some((t) => o.existsSync(s.join(e, t))) ? !0 : [
|
|
149
|
-
"ts",
|
|
150
|
-
"mts",
|
|
151
|
-
"js",
|
|
152
|
-
"mjs"
|
|
153
|
-
].some((t) => {
|
|
154
|
-
let n = s.join(e, `vite.config.${t}`);
|
|
155
|
-
return o.existsSync(n) && /\btest\s*:/.test(o.readFileSync(n, "utf8"));
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
function D(e) {
|
|
159
|
-
return !o.existsSync(e) || o.readFileSync(e, "utf8") === "import { beforeEach, afterEach, beforeAll, inject } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase/testing';\nimport type {} from 'vela/testing';\n\n// The servers `vela/testing` started: a throwaway PocketBase and the app.\nconst servers = inject('vela');\nif (!servers) {\n throw new Error(\n 'Server tests need the servers `vela/testing` starts. Add `globalSetup: [\\'vela/testing\\']` to the test config in vitest.config.ts.'\n );\n}\n\nconst admin = new PocketBase(servers.pocketbaseUrl) as App.Locals['admin'];\nconst pb = new PocketBase(servers.pocketbaseUrl) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email?: string }) {\n // Logs in with the password, so it needs the email (made optional by\n // enable-whatsapp, for accounts that sign in with a phone number).\n if (!user.email) {\n throw new Error('authenticateUser needs a user with an email');\n }\n await agent.post('/login').type('form').send({\n type: 'password',\n email: user.email,\n password: testUserPassword\n });\n}\n\nbeforeAll(async () => {\n await admin\n // @ts-ignore\n .collection('_superusers')\n .authWithPassword(servers.superuser.email, servers.superuser.password);\n});\n\nbeforeEach(async (context: TestContext) => {\n context.request = supertest(servers.appUrl);\n context.agent = supertest.agent(servers.appUrl) as TestContext['agent'];\n context.admin = admin;\n context.pb = pb;\n const email = `test-${Math.random().toString(36).slice(2)}@example.com`;\n context.user = await context.admin.collection('users').create({\n email,\n password: testUserPassword,\n passwordConfirm: testUserPassword\n });\n context.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n await context.pb.collection('users').authWithPassword(email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n await context.pb.authStore.clear();\n await context.admin.collection('users').delete(context.user.id);\n});\n" ? {
|
|
160
|
-
status: "success",
|
|
161
|
-
changed: !1
|
|
162
|
-
} : (o.writeFileSync(e, S, "utf8"), {
|
|
163
|
-
status: "success",
|
|
164
|
-
changed: !0
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
function O(e) {
|
|
168
|
-
return !o.existsSync(e) || o.readFileSync(e, "utf8") === C ? {
|
|
169
|
-
status: "success",
|
|
170
|
-
changed: !1
|
|
171
|
-
} : (o.writeFileSync(e, C, "utf8"), {
|
|
172
|
-
status: "success",
|
|
173
|
-
changed: !0
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
//#endregion
|
|
177
|
-
export { O as a, g as c, D as i, _ as l, S as n, b as o, E as r, x as s, w as t };
|
|
178
|
-
|
|
179
|
-
//# sourceMappingURL=test-setup-CbCXmPkE.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"test-setup-CbCXmPkE.js","names":["ADAPTER_NODE_SPEC","ADAPTER_STATIC_SPEC","NOT_FOUND_HINT","ADAPTER_STATIC$1","dedent","resolveConfigTarget","saveTarget","packageName","fs","path","ADAPTER_NODE","ADAPTER_NODE$1","ADAPTER_STATIC","ADAPTER_AUTO","FAILURE_HINT","NOT_FOUND_HINT$1","findAdapterImport","sourceFile","decl","adapterCalls","SyntaxKind","ce","modifySvelteConfig","res","root","adapterImport","target","call","args","i","unmodifySvelteConfig","POCKETBASE_BLOCK","NOT_FOUND_HINT","modifyGitignore","gitignorePath","original","next","unmodifyGitignore","cleaned","WITH_BACKEND","WITHOUT_BACKEND","VITEST_CONFIG","VITEST_CONFIG_NAMES","ext","hasVitestConfig","name","viteConfig","modifyTestSetup","testSetupPath","unmodifyTestSetup"],"sources":["../../src/patterns/enable/backend/modifies/svelte-config.ts","../../src/patterns/enable/backend/modifies/gitignore.ts","../../src/patterns/enable/backend/modifies/test-setup.ts"],"sourcesContent":["import dedent from \"dedent\";\nimport { SyntaxKind } from \"ts-morph\";\nimport {\n resolveConfigTarget,\n saveTarget,\n type ConfigModifyResult,\n type ConfigTarget,\n} from \"../../../../runtime/config-target\";\nimport { packageName } from \"../../../../runtime/write-result\";\nimport {\n ADAPTER_NODE as ADAPTER_NODE_SPEC,\n ADAPTER_STATIC as ADAPTER_STATIC_SPEC,\n} from \"../../../../core/constants\";\n\n// Imports name the package, not the versioned spec the constants install.\nconst ADAPTER_NODE = packageName(ADAPTER_NODE_SPEC);\nconst ADAPTER_STATIC = packageName(ADAPTER_STATIC_SPEC);\nconst ADAPTER_AUTO = \"@sveltejs/adapter-auto\";\n\nconst FAILURE_HINT = dedent`\n Switch the SvelteKit adapter to ${ADAPTER_NODE}:\n\n import adapter from '${ADAPTER_NODE}';\n\n // ...\n adapter: adapter()\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Configure ${ADAPTER_NODE} via the sveltekit() plugin in vite.config.ts.\n`;\n\n/**\n * The adapters this pattern moves between. adapter-auto is included because\n * that is what `sv create` ships, and a project that never chose is one the\n * backend is free to decide for.\n */\nfunction findAdapterImport(sourceFile: ConfigTarget[\"sourceFile\"]) {\n return sourceFile\n .getImportDeclarations()\n .find((decl) =>\n [ADAPTER_STATIC, ADAPTER_AUTO, ADAPTER_NODE].includes(\n decl.getModuleSpecifierValue(),\n ),\n );\n}\n\nfunction adapterCalls(sourceFile: ConfigTarget[\"sourceFile\"]) {\n return sourceFile\n .getDescendantsOfKind(SyntaxKind.CallExpression)\n .filter((ce) => ce.getExpression().getText() === \"adapter\");\n}\n\n/**\n * Switch the adapter to `@sveltejs/adapter-node` and drop its arguments in\n * vite.config, which holds the adapter import + `adapter()` call. A project with a\n * backend is served from a Node process, which is what `vela deploy` runs.\n * Operates on the import and call expression directly, so it never needs the\n * config object.\n */\nexport function modifySvelteConfig(root: string): ConfigModifyResult {\n const res = resolveConfigTarget(root, {\n notFound: NOT_FOUND_HINT,\n failed: FAILURE_HINT,\n });\n if (res.status !== \"resolved\") {\n return {\n filePath: res.filePath,\n outcome: { status: res.status, message: res.message },\n };\n }\n const { target } = res;\n const adapterImport = findAdapterImport(target.sourceFile);\n if (!adapterImport) {\n return {\n filePath: target.filePath,\n outcome: { status: \"failed\", message: FAILURE_HINT },\n };\n }\n\n if (adapterImport.getModuleSpecifierValue() !== ADAPTER_NODE) {\n adapterImport.setModuleSpecifier(ADAPTER_NODE);\n }\n\n for (const call of adapterCalls(target.sourceFile)) {\n const args = call.getArguments();\n for (let i = args.length - 1; i >= 0; i--) {\n call.removeArgument(i);\n }\n }\n\n return { filePath: target.filePath, outcome: saveTarget(target) };\n}\n\n/**\n * Reverse of {@link modifySvelteConfig}: switch back to\n * `@sveltejs/adapter-static` and restore the `{ fallback: '200.html' }` arg.\n * Lenient when there is no config or no adapter import: a no-op success. A\n * config that can't be edited (a leftover svelte.config) still fails.\n */\nexport function unmodifySvelteConfig(root: string): ConfigModifyResult {\n const res = resolveConfigTarget(root, {\n notFound: NOT_FOUND_HINT,\n failed: FAILURE_HINT,\n });\n if (res.status === \"not-found\") {\n // Nothing to revert.\n return {\n filePath: res.filePath,\n outcome: { status: \"success\", changed: false },\n };\n }\n if (res.status === \"failed\") {\n return {\n filePath: res.filePath,\n outcome: { status: \"failed\", message: res.message },\n };\n }\n const { target } = res;\n const adapterImport = findAdapterImport(target.sourceFile);\n if (!adapterImport) {\n return {\n filePath: target.filePath,\n outcome: { status: \"success\", changed: false },\n };\n }\n\n if (adapterImport.getModuleSpecifierValue() !== ADAPTER_STATIC) {\n adapterImport.setModuleSpecifier(ADAPTER_STATIC);\n }\n\n for (const call of adapterCalls(target.sourceFile)) {\n if (call.getArguments().length === 0) {\n call.addArgument(\"{ fallback: '200.html' }\");\n }\n }\n\n return { filePath: target.filePath, outcome: saveTarget(target) };\n}\n","import fs from \"node:fs\";\nimport dedent from \"dedent\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\nconst POCKETBASE_BLOCK = `# PocketBase\n/data/*\n!/data/fixtures\n!/data/seeds\n!/data/hooks\n`;\n\nconst NOT_FOUND_HINT = dedent`\n Create a .gitignore at the project root with the PocketBase block:\n\n # PocketBase\n /data/*\n !/data/fixtures\n !/data/seeds\n !/data/hooks\n`;\n\nexport function modifyGitignore(gitignorePath: string): ModifyOutcome {\n if (!fs.existsSync(gitignorePath)) {\n return { status: \"not-found\", message: NOT_FOUND_HINT };\n }\n\n const original = fs.readFileSync(gitignorePath, \"utf8\");\n\n if (original.includes(\"# PocketBase\") && original.includes(\"/data/*\")) {\n return { status: \"success\", changed: false };\n }\n\n const separator = original.endsWith(\"\\n\") ? \"\\n\" : \"\\n\\n\";\n const next = original + separator + POCKETBASE_BLOCK;\n fs.writeFileSync(gitignorePath, next, \"utf8\");\n\n return { status: \"success\", changed: true };\n}\n\nexport function unmodifyGitignore(gitignorePath: string): ModifyOutcome {\n if (!fs.existsSync(gitignorePath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(gitignorePath, \"utf8\");\n\n if (!original.includes(\"# PocketBase\")) {\n return { status: \"success\", changed: false };\n }\n\n const withBlockRemoved = original.replace(\n /\\n*# PocketBase\\n\\/data\\/\\*\\n!\\/data\\/fixtures\\n!\\/data\\/seeds\\n!\\/data\\/hooks\\n?/,\n \"\\n\",\n );\n\n const cleaned = withBlockRemoved.replace(/\\n{3,}$/, \"\\n\");\n\n if (cleaned === original) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(gitignorePath, cleaned, \"utf8\");\n return { status: \"success\", changed: true };\n}\n","import fs from \"node:fs\";\nimport path from \"node:path\";\nimport type { ModifyOutcome } from \"../../../../core/types\";\n\n// Source of truth: velastack-cli/templates/minimal/test/setup.ts\nexport const WITH_BACKEND = `import { beforeEach, afterEach, beforeAll, inject } from 'vitest';\nimport supertest, { type Agent } from 'supertest';\nimport PocketBase from 'pocketbase-sveltekit';\nimport type { TestContext } from '@velastack/pocketbase/testing';\nimport type {} from 'vela/testing';\n\n// The servers \\`vela/testing\\` started: a throwaway PocketBase and the app.\nconst servers = inject('vela');\nif (!servers) {\n\\tthrow new Error(\n\\t\\t'Server tests need the servers \\`vela/testing\\` starts. Add \\`globalSetup: [\\\\'vela/testing\\\\']\\` to the test config in vitest.config.ts.'\n\\t);\n}\n\nconst admin = new PocketBase(servers.pocketbaseUrl) as App.Locals['admin'];\nconst pb = new PocketBase(servers.pocketbaseUrl) as App.Locals['pb'];\n\nconst testUserPassword = 'password';\n\nasync function authenticateUser(agent: Agent, user: { email?: string }) {\n\\t// Logs in with the password, so it needs the email (made optional by\n\\t// enable-whatsapp, for accounts that sign in with a phone number).\n\\tif (!user.email) {\n\\t\\tthrow new Error('authenticateUser needs a user with an email');\n\\t}\n\\tawait agent.post('/login').type('form').send({\n\\t\\ttype: 'password',\n\\t\\temail: user.email,\n\\t\\tpassword: testUserPassword\n\\t});\n}\n\nbeforeAll(async () => {\n\\tawait admin\n\\t\\t// @ts-ignore\n\\t\\t.collection('_superusers')\n\\t\\t.authWithPassword(servers.superuser.email, servers.superuser.password);\n});\n\nbeforeEach(async (context: TestContext) => {\n\\tcontext.request = supertest(servers.appUrl);\n\\tcontext.agent = supertest.agent(servers.appUrl) as TestContext['agent'];\n\\tcontext.admin = admin;\n\\tcontext.pb = pb;\n\\tconst email = \\`test-\\${Math.random().toString(36).slice(2)}@example.com\\`;\n\\tcontext.user = await context.admin.collection('users').create({\n\\t\\temail,\n\\t\\tpassword: testUserPassword,\n\\t\\tpasswordConfirm: testUserPassword\n\\t});\n\\tcontext.agent.authenticateUser = () => authenticateUser(context.agent, context.user);\n\\tawait context.pb.collection('users').authWithPassword(email, testUserPassword);\n});\n\nafterEach(async (context: TestContext) => {\n\\tawait context.pb.authStore.clear();\n\\tawait context.admin.collection('users').delete(context.user.id);\n});\n`;\n\n// The static template ships no test setup at all; this is the backend-free\n// subset of the minimal one, kept so existing tests keep their agents.\nconst WITHOUT_BACKEND = `import { beforeEach } from 'vitest';\nimport supertest from 'supertest';\n\nbeforeEach(async (context: any) => {\n\\tcontext.request = supertest(process.env.VITE_TEST_URL!);\n\\tcontext.agent = supertest.agent(process.env.VITE_TEST_URL!);\n});\n`;\n\n// Source of truth: velastack-cli/templates/minimal/vitest.config.ts\nexport const VITEST_CONFIG = `import { configDefaults, defineConfig, mergeConfig } from 'vitest/config';\nimport viteConfig from './vite.config';\n\nexport default mergeConfig(\n\\tviteConfig,\n\\tdefineConfig({\n\\t\\ttest: {\n\\t\\t\\texpect: {\n\\t\\t\\t\\trequireAssertions: true\n\\t\\t\\t},\n\\t\\t\\tenvironment: 'node',\n\\t\\t\\tpassWithNoTests: true,\n\\t\\t\\t// Server tests reach the app over HTTP and import nothing from it, so\n\\t\\t\\t// watch mode cannot see which tests an edit affects. Rerun them all.\n\\t\\t\\tforceRerunTriggers: [\n\\t\\t\\t\\t'**/package.json/**',\n\\t\\t\\t\\t'**/{vitest,vite}.config.*/**',\n\\t\\t\\t\\t'src/routes/**',\n\\t\\t\\t\\t'src/lib/server/**',\n\\t\\t\\t\\t'src/hooks.server.ts',\n\\t\\t\\t\\t'data/hooks/**'\n\\t\\t\\t],\n\\t\\t\\tprojects: [\n\\t\\t\\t\\t{\n\\t\\t\\t\\t\\textends: true,\n\\t\\t\\t\\t\\ttest: {\n\\t\\t\\t\\t\\t\\t// \\`server.test.ts\\` next to a route, \\`<name>.server.test.ts\\` elsewhere:\n\\t\\t\\t\\t\\t\\t// tests that run against the app and its database.\n\\t\\t\\t\\t\\t\\tname: 'server',\n\\t\\t\\t\\t\\t\\tinclude: ['src/**/*server.{test,spec}.{js,ts}'],\n\\t\\t\\t\\t\\t\\t// Starts a throwaway PocketBase and the app before the first test\n\\t\\t\\t\\t\\t\\t// file, and stops them after the last. Every way of running vitest\n\\t\\t\\t\\t\\t\\t// gets the same servers: \\`vela test:server\\`, \\`vitest\\`, \\`vitest --watch\\`,\n\\t\\t\\t\\t\\t\\t// an editor's test runner.\n\\t\\t\\t\\t\\t\\tglobalSetup: ['vela/testing'],\n\\t\\t\\t\\t\\t\\tsetupFiles: ['test/setup.ts']\n\\t\\t\\t\\t\\t}\n\\t\\t\\t\\t},\n\\t\\t\\t\\t{\n\\t\\t\\t\\t\\textends: true,\n\\t\\t\\t\\t\\ttest: {\n\\t\\t\\t\\t\\t\\t// Every other test: pure functions, no servers, no setup file.\n\\t\\t\\t\\t\\t\\tname: 'unit',\n\\t\\t\\t\\t\\t\\tinclude: ['src/**/*.{test,spec}.{js,ts}'],\n\\t\\t\\t\\t\\t\\texclude: [\n\\t\\t\\t\\t\\t\\t\\t...configDefaults.exclude,\n\\t\\t\\t\\t\\t\\t\\t'src/**/*server.{test,spec}.{js,ts}',\n\\t\\t\\t\\t\\t\\t\\t'src/**/*.svelte.{test,spec}.{js,ts}'\n\\t\\t\\t\\t\\t\\t]\n\\t\\t\\t\\t\\t}\n\\t\\t\\t\\t}\n\\t\\t\\t]\n\\t\\t}\n\\t})\n);\n`;\n\nconst VITEST_CONFIG_NAMES = [\"ts\", \"mts\", \"js\", \"mjs\"].flatMap((ext) => [\n `vitest.config.${ext}`,\n `vitest.workspace.${ext}`,\n]);\n\n/**\n * Whether the project already configures vitest, in a file of its own or a\n * `test` block in its vite config. Without either, `test/setup.ts` is never\n * loaded and every generated `server.test.ts` fails on its missing context.\n */\nexport function hasVitestConfig(root: string): boolean {\n if (\n VITEST_CONFIG_NAMES.some((name) => fs.existsSync(path.join(root, name)))\n ) {\n return true;\n }\n return [\"ts\", \"mts\", \"js\", \"mjs\"].some((ext) => {\n const viteConfig = path.join(root, `vite.config.${ext}`);\n return (\n fs.existsSync(viteConfig) &&\n /\\btest\\s*:/.test(fs.readFileSync(viteConfig, \"utf8\"))\n );\n });\n}\n\n/**\n * Brings an existing `test/setup.ts` up to the backend one. A project without\n * the file gets it as a create instead (see `generate.runtime.ts`), so it is\n * reported as created rather than modified.\n */\nexport function modifyTestSetup(testSetupPath: string): ModifyOutcome {\n if (!fs.existsSync(testSetupPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(testSetupPath, \"utf8\");\n if (original === WITH_BACKEND) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(testSetupPath, WITH_BACKEND, \"utf8\");\n return { status: \"success\", changed: true };\n}\n\nexport function unmodifyTestSetup(testSetupPath: string): ModifyOutcome {\n if (!fs.existsSync(testSetupPath)) {\n return { status: \"success\", changed: false };\n }\n\n const original = fs.readFileSync(testSetupPath, \"utf8\");\n if (original === WITHOUT_BACKEND) {\n return { status: \"success\", changed: false };\n }\n\n fs.writeFileSync(testSetupPath, WITHOUT_BACKEND, \"utf8\");\n return { status: \"success\", changed: true };\n}\n"],"mappings":";;;;;;;;AAeA,IAAMU,IAAeH,EAAYP,CAAiB,GAC5CY,IAAiBL,EAAYN,CAAmB,GAChDY,IAAe,0BAEfC,IAAe,CAAM;oCACSJ,EAAa;;yBAExBA,EAAa;;;;GAMhCR,IAAiB,CAAM;cACfQ,EAAa;;AAQ3B,SAASM,EAAkB,GAAwC;CACjE,OAAOC,EACJ,sBAAsB,CAAC,CACvB,MAAM,MACL;EAACL;EAAgBC;EAAcH;CAAY,CAAC,CAAC,SAC3CQ,EAAK,wBAAwB,CAC/B,CACF;AACJ;AAEA,SAASC,EAAa,GAAwC;CAC5D,OAAOF,EACJ,qBAAqBG,EAAW,cAAc,CAAC,CAC/C,QAAQ,MAAOC,EAAG,cAAc,CAAC,CAAC,QAAQ,MAAM,SAAS;AAC9D;AASA,SAAgBC,EAAmB,GAAkC;CACnE,IAAMC,IAAMlB,EAAoBmB,GAAM;EACpC,UAAUtB;EACV,QAAQY;CACV,CAAC;CACD,IAAIS,EAAI,WAAW,YACjB,OAAO;EACL,UAAUA,EAAI;EACd,SAAS;GAAE,QAAQA,EAAI;GAAQ,SAASA,EAAI;EAAQ;CACtD;CAEF,IAAM,EAAE,cA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