void 0.22.0 → 0.24.0
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/AGENTS_TEMPLATE.md +1 -1
- package/README.md +5 -1
- package/dist/{account-cmd-CjyxcGkM.mjs → account-cmd-vJhh5lrb.mjs} +5 -5
- package/dist/{scan-ClYmX3sa.mjs → application-analysis-BVsVqc11.mjs} +135 -18
- package/dist/application-routing-B7QEjqSR.mjs +27 -0
- package/dist/{auth-DLNN0D3Z.mjs → auth-CQkSDS50.mjs} +26 -96
- package/dist/auth-DX3JURcX.mjs +2 -0
- package/dist/{auth-link-BLO4ptzo.mjs → auth-link-D75t9wO2.mjs} +5 -5
- package/dist/{auth-router-ZUg9MF_U.mjs → auth-router-ClfhL1J7.mjs} +7 -7
- package/dist/{better-auth-shared-rsBGBvWJ.mjs → better-auth-shared-hy6RPh9W.mjs} +13 -2
- package/dist/{build-cmd-BxR5FROK.mjs → build-cmd-zMi1iFnS.mjs} +21 -9
- package/dist/{cache-D0sWhgKI.mjs → cache-ZtQmyxVV.mjs} +5 -5
- package/dist/{cancel-deploy-D4NUqFbi.mjs → cancel-deploy-Box0kkEV.mjs} +5 -5
- package/dist/{cf-access-P0iZnu0q.mjs → cf-access-BGe5sWXF.mjs} +4 -48
- package/dist/{cf-access-DRsQRe6k.mjs → cf-access-TWNzXltp.mjs} +3 -11
- package/dist/{cf-build-output-BJ6yGEIS.mjs → cf-build-output-BPqOT964.mjs} +2 -1
- package/dist/cf-build-output-_0HNWysu.mjs +2 -0
- package/dist/cli/cli.mjs +89 -461
- package/dist/cli/{cf-compat.mjs → cloudflare-operation-process.mjs} +454 -424
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +4 -4
- package/dist/client-B9UBI03V.mjs +2 -0
- package/dist/{client-BTZ3XkrB.mjs → client-DKAsFA4X.mjs} +161 -24
- package/dist/{cloudflare-auth-DQkqoMYa.mjs → cloudflare-auth-Qdc7tw8F.mjs} +41 -38
- package/dist/{cloudflare-cmd-BKlfGHAy.mjs → cloudflare-cmd-CmY8dGkd.mjs} +6 -6
- package/dist/cloudflare-config-Bktvwtpf.mjs +182 -0
- package/dist/{cloudflare-connect-Ctmrw579.mjs → cloudflare-connect-IiR3ZieC.mjs} +4 -4
- package/dist/{cloudflare-operations-BT6OWFBk.mjs → cloudflare-operations-BCdXSsmo.mjs} +1 -1
- package/dist/{cloudflare-operations-B9tzgjmf.mjs → cloudflare-operations-DzH-A966.mjs} +116 -172
- package/dist/{preset-UHj9ARyP.mjs → cloudflare-process-B-wekeR6.mjs} +93 -6
- package/dist/{config-VavjpDnp.d.mts → config-BMHb8RCj.d.mts} +1 -0
- package/dist/config-C_XRIPx2.mjs +89 -0
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-Dg-WkW-C.mjs → connect-B-usTnlF.mjs} +9 -9
- package/dist/{create-project-l9J7pbtm.mjs → create-project-CYOOAYcn.mjs} +12 -12
- package/dist/{create-project-DdoqwFLF.mjs → create-project-FWbf5Olo.mjs} +1 -1
- package/dist/{db-gp2sCXyN.mjs → db-Ck2eZ2iB.mjs} +26 -26
- package/dist/{delete-TTedbH6B.mjs → delete-sK56qtzZ.mjs} +5 -5
- package/dist/{deploy-CH-o2CaZ.mjs → deploy-gCVaiJbS.mjs} +984 -616
- package/dist/{deploy-B19L2Bra.mjs → deploy-irP5q0-x.mjs} +1 -1
- package/dist/{domain-JRF59P_r.mjs → domain-DFfQE8jg.mjs} +6 -6
- package/dist/{email-Bo6G9LOZ.mjs → email-CdnhUHvJ.mjs} +15 -30
- package/dist/{env-BYOrWQnv.mjs → env-DmGdHi5i.mjs} +8 -8
- package/dist/{env-public-BxU_0yTL.d.mts → env-public-BX_r8HR6.d.mts} +1 -1
- package/dist/{env-types-C2_bIk_b.mjs → env-types-D5kds_OZ.mjs} +1 -1
- package/dist/{env-validation-BB4GkLxn.mjs → env-validation-C_8tPdhs.mjs} +20 -73
- package/dist/{env-validation-BXge7uyK.mjs → env-validation-zZOCcQVZ.mjs} +1 -1
- package/dist/{fetch-CXDChK7B.mjs → fetch-BIZJh7vR.mjs} +2 -2
- package/dist/{fetch-stream-AOByI7Ki.mjs → fetch-stream-IvCYKyQL.mjs} +24 -4
- package/dist/{gen-sCtlCOdA.mjs → gen-CshAkukR.mjs} +4 -4
- package/dist/gen-DvQTWzDU.mjs +2 -0
- package/dist/{github-cmd-0-7PexDq.mjs → github-cmd-DftuEvIt.mjs} +13 -13
- package/dist/{handler-HEcZsaij.d.mts → handler-CZ4nAylQ.d.mts} +1 -1
- package/dist/{headers-DWi2IXWx.mjs → headers-2rKda9Y6.mjs} +1 -1
- package/dist/{help-GKtwl07I.mjs → help-Dotbf6iz.mjs} +236 -750
- package/dist/help-mabuIV98.mjs +2 -0
- package/dist/{inbound-aVHEUhKo.mjs → inbound-fRkqcXaC.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +299 -1517
- package/dist/info-B97bTX9N.mjs +113 -0
- package/dist/{init-FZx3Elvz.mjs → init-BTQEZZGJ.mjs} +61 -27
- package/dist/limits-Bq5LG8Id.d.mts +27 -0
- package/dist/limits-Cjuk2VPm.mjs +68 -0
- package/dist/{link-BrQfb_CU.mjs → link-B46sYH0K.mjs} +6 -6
- package/dist/{list-D44jmIAM.mjs → list-BnPrIsU_.mjs} +6 -6
- package/dist/{live-CKJlvlNp.d.mts → live-Chw1eIMv.d.mts} +1 -1
- package/dist/{local-d1-Bg9OzEEO.mjs → local-d1-2CMnpuW_.mjs} +2 -2
- package/dist/log-vqY3pqwI.mjs +29 -0
- package/dist/{login-CAsAsQ-_.mjs → login-BuiMyUrx.mjs} +8 -8
- package/dist/login-DIy9Sb-U.mjs +2 -0
- package/dist/{logs-BjKvFnVM.mjs → logs-CZG9d-ic.mjs} +10 -11
- package/dist/migrate-BCiJ8w0f.mjs +2 -0
- package/dist/{migrate-BPITvDJN.mjs → migrate-q4_njtaW.mjs} +4 -3
- package/dist/{node-Dt7z256D.mjs → node-BkyRWRx8.mjs} +1 -1
- package/dist/operator-args-B3BTmSoi.mjs +697 -0
- package/dist/{operator-auth-8KnOVXVd.mjs → operator-auth-7erYc6Lt.mjs} +2 -2
- package/dist/{operator-client-DUwumHpQ.mjs → operator-client-CpHjTd0t.mjs} +3 -3
- package/dist/{operator-cmd-BK5CCiT9.mjs → operator-cmd-DGqPJUD3.mjs} +70 -24
- package/dist/{output-Dm_A4Tbv.mjs → output-CbM85T4k.mjs} +18 -10
- package/dist/pages/client.d.mts +34 -2
- package/dist/pages/client.mjs +59 -3
- package/dist/pages/index.d.mts +1 -1
- package/dist/pages/index.mjs +2 -2
- package/dist/pages/islands-plugin.mjs +1 -1
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +2 -308
- package/dist/{parse-filename-DioPHiR9.mjs → parse-filename-CUbj-1MP.mjs} +35 -1
- package/dist/plan-D1Q5rf-r.mjs +2 -0
- package/dist/plan-NPpwZ_kc.mjs +58 -0
- package/dist/platform-args-3k8X9-H_.mjs +514 -0
- package/dist/platform-args-DdnM6WIf.mjs +2 -0
- package/dist/{platform-auth-config-BlN8xTdD.mjs → platform-auth-config-DDrxUy4m.mjs} +6 -6
- package/dist/{platform-auth-protection-7d5aV2Jg.mjs → platform-auth-protection-BLadnnct.mjs} +8 -8
- package/dist/{platform-auth-recovery-Dxij8ZbR.mjs → platform-auth-recovery-CmCzX2Fl.mjs} +6 -6
- package/dist/{platform-cmd-B3hwKrFK.mjs → platform-cmd-DMDEc9uS.mjs} +29 -8
- package/dist/{platform-cmd-E0FuL212.mjs → platform-cmd-pMTRhvYs.mjs} +1 -1
- package/dist/{platform-domain-D6Xcy9ZX.mjs → platform-domain-Di6EYrQl.mjs} +5 -5
- package/dist/{platform-lifecycle-k0E0xoxx.mjs → platform-lifecycle-BBoNzojY.mjs} +1541 -572
- package/dist/{platform-lifecycle-DMh_qrry.mjs → platform-lifecycle-BFdSi9Qt.mjs} +1 -1
- package/dist/{platform-management-Brz_BDiT.mjs → platform-management-CWOQOWXm.mjs} +10 -7
- package/dist/{platform-management-DOtss0BN.mjs → platform-management-DG47jys8.mjs} +1 -1
- package/dist/platform-plans-config-Vl9BP3H4.mjs +359 -0
- package/dist/{platform-recovery-BvtcXON5.mjs → platform-recovery-BJnQJEtQ.mjs} +4 -4
- package/dist/{platform-registry-QBa4DK32.mjs → platform-registry-DkPPXfp_.mjs} +2 -2
- package/dist/{plugin-inference-BMfKRSqE.mjs → plugin-inference-CXWnn79A.mjs} +174 -64
- package/dist/{prepare-C-6YZyyg.mjs → prepare-CBLT3CHH.mjs} +3 -3
- package/dist/prepare-CnjcTV2s.mjs +2 -0
- package/dist/{prepare-CRhJbVrG.mjs → prepare-DnaKBi--.mjs} +5 -21
- package/dist/{project-C0Fqu05O.mjs → project-DKG5Ra8p.mjs} +15 -82
- package/dist/project-DsblYifa.mjs +2 -0
- package/dist/{project-cmd-BZLCqOqw.mjs → project-cmd-DxnXstAq.mjs} +19 -19
- package/dist/{project-team-BvgM0WoX.mjs → project-team-BmHcaALJ.mjs} +5 -5
- package/dist/{project-token-l5DqK6Az.mjs → project-token-GionZlBI.mjs} +5 -5
- package/dist/{project-zero-trust-v6Mvpp8y.mjs → project-zero-trust-JLCjVQA7.mjs} +5 -5
- package/dist/prompts-2TGE6oXx.mjs +2 -0
- package/dist/prompts-BNUoTiaf.mjs +2044 -0
- package/dist/{protocol-BBa6cstI.d.mts → protocol-CjF_iI9X.d.mts} +2 -2
- package/dist/protocol-U7bfjHmA.mjs +331 -0
- package/dist/{provision-Fr9pRqce.mjs → provision-CVku1JFU.mjs} +1 -1
- package/dist/{provision-C4IGqkBf.mjs → provision-CaoxO_U7.mjs} +90 -199
- package/dist/{requests-DN-BbNiM.mjs → requests-BOjIVAeF.mjs} +5 -5
- package/dist/resource-name-C7LVpcRm.mjs +11 -0
- package/dist/{rollback-D7rzSaZM.mjs → rollback-CwR3pLj3.mjs} +6 -6
- package/dist/route-url-CG7U-cRN.mjs +15 -0
- package/dist/{runner-B8wXwWlo.mjs → runner-CXA9Fh8h.mjs} +1 -1
- package/dist/{runner-p-dMs2UN.mjs → runner-Ol0TNjk6.mjs} +2 -2
- package/dist/runtime/ai.d.mts +12 -8
- package/dist/runtime/ai.mjs +87 -22
- package/dist/runtime/better-auth-mysql.mjs +1 -1
- package/dist/runtime/better-auth-pg.mjs +1 -1
- package/dist/runtime/better-auth.mjs +1 -1
- package/dist/runtime/client-react.mjs +2 -2
- package/dist/runtime/client-solid.mjs +2 -2
- package/dist/runtime/client-svelte.mjs +2 -2
- package/dist/runtime/client-vue.mjs +2 -2
- package/dist/runtime/client.mjs +2 -2
- package/dist/runtime/durable.d.mts +3 -1
- package/dist/runtime/durable.mjs +4 -1
- package/dist/runtime/email/testing.mjs +2 -2
- package/dist/runtime/email.mjs +1 -1
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-stream.mjs +1 -1
- package/dist/runtime/fetch.mjs +1 -1
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/kv.mjs +0 -1
- package/dist/runtime/limits.d.mts +2 -0
- package/dist/runtime/limits.mjs +2 -0
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live-server.mjs +25 -16
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/migration-handler.mjs +62 -42
- package/dist/runtime/remote/index.mjs +2 -2
- package/dist/runtime/route-url.d.mts +4 -0
- package/dist/runtime/route-url.mjs +2 -0
- package/dist/runtime/routing.d.mts +180 -0
- package/dist/runtime/routing.mjs +1082 -0
- package/dist/runtime/sandbox-container.d.mts +1 -1
- package/dist/runtime/sandbox-container.mjs +1 -1
- package/dist/runtime/sandbox.d.mts +3 -3
- package/dist/runtime/sandbox.mjs +75 -45
- package/dist/runtime/sse.mjs +1 -1
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +4 -2
- package/dist/runtime/ws-server.mjs +27 -2
- package/dist/runtime/ws.d.mts +2 -2
- package/dist/runtime/ws.mjs +8 -6
- package/dist/{sandbox-qpNBT8a3.d.mts → sandbox-XZAqzFlG.d.mts} +11 -8
- package/dist/{sandbox-container-DdNEBfCc.d.mts → sandbox-container-Bo0eiFKz.d.mts} +2 -1
- package/dist/{sandbox-container-4fdqLnyb.mjs → sandbox-container-C6ItmVuN.mjs} +4 -2
- package/dist/{scan-4tfN-PSn.mjs → scan-C7okrLyM.mjs} +4 -35
- package/dist/{secret-BOtOl_cb.mjs → secret-ByWJWBUG.mjs} +7 -7
- package/dist/{skills-D1II1Juz.mjs → skills-C1PlclPt.mjs} +1 -1
- package/dist/{sse-BaC1jXko.mjs → sse-CQNaDFFV.mjs} +6 -3
- package/dist/{subcommand-prompt-CY1C4fvl.mjs → subcommand-prompt-klFCfcor.mjs} +40 -32
- package/dist/validate-Dq_L3s0S.mjs +2 -0
- package/dist/{validate-CIUwFpjB.mjs → validate-ctOrgiS3.mjs} +2 -1
- package/dist/{wrangler-DQF1vKyf.mjs → wrangler-7K-bW_DL.mjs} +8 -239
- package/dist/{ws-BoY7vQML.d.mts → ws-CL1w7GXU.d.mts} +13 -2
- package/package.json +16 -10
- package/skills/migrate-vite-cloudflare-to-void/SKILL.md +34 -157
- package/skills/void/SKILL.md +55 -135
- package/skills/void/docs/guide/ai.md +94 -84
- package/skills/void/docs/guide/app-types.md +3 -32
- package/skills/void/docs/guide/auth.md +12 -116
- package/skills/void/docs/guide/database/d1.md +9 -54
- package/skills/void/docs/guide/database/mysql.md +1 -1
- package/skills/void/docs/guide/database/postgresql.md +5 -26
- package/skills/void/docs/guide/database.md +23 -75
- package/skills/void/docs/guide/deployment.md +48 -112
- package/skills/void/docs/guide/durable-state.md +43 -18
- package/skills/void/docs/guide/edge/headers.md +4 -48
- package/skills/void/docs/guide/edge/prerendering.md +5 -20
- package/skills/void/docs/guide/edge/redirects.md +11 -64
- package/skills/void/docs/guide/edge/revalidation.md +5 -18
- package/skills/void/docs/guide/edge/rewrites.md +56 -284
- package/skills/void/docs/guide/edge/static-assets.md +22 -72
- package/skills/void/docs/guide/email/domains.md +116 -0
- package/skills/void/docs/guide/email/receiving.md +139 -0
- package/skills/void/docs/guide/email/sending.md +231 -0
- package/skills/void/docs/guide/email.md +13 -619
- package/skills/void/docs/guide/env-migration.md +11 -11
- package/skills/void/docs/guide/env-vars.md +9 -29
- package/skills/void/docs/guide/index.md +0 -15
- package/skills/void/docs/guide/jobs.md +3 -18
- package/skills/void/docs/guide/kv.md +5 -11
- package/skills/void/docs/guide/live.md +5 -56
- package/skills/void/docs/guide/pages-routing/actions-and-forms.md +78 -125
- package/skills/void/docs/guide/pages-routing/head.md +10 -10
- package/skills/void/docs/guide/pages-routing/islands.md +6 -36
- package/skills/void/docs/guide/pages-routing/layouts.md +6 -128
- package/skills/void/docs/guide/pages-routing/loaders.md +3 -19
- package/skills/void/docs/guide/pages-routing/markdown.md +13 -171
- package/skills/void/docs/guide/pages-routing/overview.md +7 -17
- package/skills/void/docs/guide/pages-routing/view-transitions.md +1 -1
- package/skills/void/docs/guide/platform/administration/access.md +1 -4
- package/skills/void/docs/guide/platform/administration/email.md +35 -8
- package/skills/void/docs/guide/platform/administration/operations.md +26 -4
- package/skills/void/docs/guide/platform/administration/plans.md +126 -0
- package/skills/void/docs/guide/platform/administration/projects.md +5 -2
- package/skills/void/docs/guide/platform/administration/zero-trust.md +49 -160
- package/skills/void/docs/guide/platform/development/runtime.md +3 -13
- package/skills/void/docs/guide/platform/development/schema-ci.md +0 -58
- package/skills/void/docs/guide/platform/installation/ci.md +1 -1
- package/skills/void/docs/guide/platform/installation/credentials.md +15 -6
- package/skills/void/docs/guide/platform/installation/domains.md +35 -2
- package/skills/void/docs/guide/platform/installation/first-deployment.md +4 -2
- package/skills/void/docs/guide/platform/installation/maintenance.md +15 -1
- package/skills/void/docs/guide/platform/installation/prerequisites.md +24 -18
- package/skills/void/docs/guide/platform/installation/setup.md +88 -14
- package/skills/void/docs/guide/platform-administration.md +1 -0
- package/skills/void/docs/guide/queues.md +7 -9
- package/skills/void/docs/guide/quickstart.md +38 -37
- package/skills/void/docs/guide/remote-dev.md +5 -10
- package/skills/void/docs/guide/sandboxes.md +29 -21
- package/skills/void/docs/guide/server-routing.md +9 -72
- package/skills/void/docs/guide/sse.md +4 -18
- package/skills/void/docs/guide/ssg.md +3 -15
- package/skills/void/docs/guide/ssr.md +14 -62
- package/skills/void/docs/guide/storage.md +9 -4
- package/skills/void/docs/guide/type-safety.md +3 -14
- package/skills/void/docs/guide/typed-fetch.md +3 -7
- package/skills/void/docs/guide/websockets.md +68 -40
- package/skills/void/docs/integrations/agents.md +3 -3
- package/skills/void/docs/integrations/cloudflare.md +85 -316
- package/skills/void/docs/integrations/frameworks/analog.md +5 -64
- package/skills/void/docs/integrations/frameworks/astro.md +4 -73
- package/skills/void/docs/integrations/frameworks/nuxt.md +5 -62
- package/skills/void/docs/integrations/frameworks/overview.md +11 -54
- package/skills/void/docs/integrations/frameworks/react-router.md +5 -60
- package/skills/void/docs/integrations/frameworks/sveltekit.md +6 -65
- package/skills/void/docs/integrations/frameworks/tanstack-start.md +4 -62
- package/skills/void/docs/integrations/nodejs-bun-deno.md +5 -69
- package/skills/void/docs/reference/api/auth.md +156 -0
- package/skills/void/docs/reference/api/client.md +87 -0
- package/skills/void/docs/reference/api/database.md +95 -0
- package/skills/void/docs/reference/api/durable.md +46 -0
- package/skills/void/docs/reference/api/env.md +50 -0
- package/skills/void/docs/reference/api/handlers.md +254 -0
- package/skills/void/docs/reference/api/pages.md +241 -0
- package/skills/void/docs/reference/api/plugin.md +39 -0
- package/skills/void/docs/reference/api/resources.md +109 -0
- package/skills/void/docs/reference/api/rewrites.md +76 -0
- package/skills/void/docs/reference/api/types.md +92 -0
- package/skills/void/docs/reference/api.md +56 -1218
- package/skills/void/docs/reference/cli/auth.md +89 -0
- package/skills/void/docs/reference/cli/database.md +128 -0
- package/skills/void/docs/reference/cli/deploy.md +105 -0
- package/skills/void/docs/reference/cli/domains.md +41 -0
- package/skills/void/docs/reference/cli/email.md +129 -0
- package/skills/void/docs/reference/cli/generate.md +116 -0
- package/skills/void/docs/reference/cli/github.md +189 -0
- package/skills/void/docs/reference/cli/platform-config.md +92 -0
- package/skills/void/docs/reference/cli/platform-email.md +81 -0
- package/skills/void/docs/reference/cli/platform-installation.md +142 -0
- package/skills/void/docs/reference/cli/platform-operations.md +90 -0
- package/skills/void/docs/reference/cli/platform-users.md +89 -0
- package/skills/void/docs/reference/cli/platform-zero-trust.md +59 -0
- package/skills/void/docs/reference/cli/platform.md +70 -0
- package/skills/void/docs/reference/cli/project.md +214 -0
- package/skills/void/docs/reference/cli/secrets.md +76 -0
- package/skills/void/docs/reference/cli/setup.md +70 -0
- package/skills/void/docs/reference/cli.md +32 -1682
- package/skills/void/docs/reference/config.md +12 -18
- package/skills/void/docs/reference/resource-inference.md +3 -58
- package/skills/void/docs/reference/structure.md +14 -41
- package/dist/auth-CZuiVsFh.mjs +0 -2
- package/dist/canonical-json-DuDiiUsQ.mjs +0 -13
- package/dist/client-Czz8o5jP.mjs +0 -2
- package/dist/dist-BuDuKZJv.mjs +0 -2
- package/dist/dist-CTBk70IR.mjs +0 -1310
- package/dist/gen-CNJ62MM7.mjs +0 -2
- package/dist/help-CmZzxUba.mjs +0 -2
- package/dist/log-ChfPKsVd.mjs +0 -26
- package/dist/login-CGcRKEoi.mjs +0 -2
- package/dist/migrate-CYfbKkXh.mjs +0 -2
- package/dist/plan-BEZ8VJW0.mjs +0 -256
- package/dist/plan-DpuOr14e.mjs +0 -2
- package/dist/prepare-Bm3iq-u4.mjs +0 -2
- package/dist/project-BuUwfj6f.mjs +0 -2
- package/dist/validate-EKmJWxmy.mjs +0 -2
- /package/dist/cli/{cf-compat.d.mts → cloudflare-operation-process.d.mts} +0 -0
|
@@ -2,11 +2,148 @@ import { a as join, d as toSlash, l as relative } from "./dist-BVqXeR_h.mjs";
|
|
|
2
2
|
import { n as readProjectPaths } from "./project-paths-GgcMozYz.mjs";
|
|
3
3
|
import { n as globSync, t as glob } from "./dist-Bn8Kodjp.mjs";
|
|
4
4
|
import { a as isObjectExpression, i as isMemberExpression, n as isIdentifier, r as isLiteral, t as isCallExpression } from "./ast-CPGPjb0V.mjs";
|
|
5
|
-
import { n as parseRouteFilename, r as parseWebSocketFilename, t as isRouteEnabledForEnvironment } from "./parse-filename-
|
|
5
|
+
import { a as staticLiteral, n as parseRouteFilename, o as unwrapStaticExpression, r as parseWebSocketFilename, t as isRouteEnabledForEnvironment } from "./parse-filename-CUbj-1MP.mjs";
|
|
6
|
+
import { n as resourceNameWords, t as isResourceName } from "./resource-name-C7LVpcRm.mjs";
|
|
6
7
|
import { r as getSsrServerEntryPath } from "./entry-CF5wvH4w.mjs";
|
|
7
8
|
import { existsSync, readFileSync } from "node:fs";
|
|
8
9
|
import { parseSync } from "vite";
|
|
9
10
|
import { parse } from "es-module-lexer/js";
|
|
11
|
+
//#region src/application-features.ts
|
|
12
|
+
/** Apply explicitly named overrides while preserving unrelated source features. */
|
|
13
|
+
function applyBindingOverrides(inferred, overrides) {
|
|
14
|
+
const bindings = { ...inferred };
|
|
15
|
+
if (overrides) for (const [key, inferredKey] of Object.entries({
|
|
16
|
+
db: "needsD1",
|
|
17
|
+
kv: "needsKV",
|
|
18
|
+
storage: "needsR2",
|
|
19
|
+
ai: "needsAI",
|
|
20
|
+
email: "needsEmail"
|
|
21
|
+
})) {
|
|
22
|
+
const value = overrides[key];
|
|
23
|
+
if (value !== void 0) bindings[inferredKey] = Boolean(value);
|
|
24
|
+
}
|
|
25
|
+
return bindings;
|
|
26
|
+
}
|
|
27
|
+
/** Shared database requirement for development and both deployment targets. */
|
|
28
|
+
function needsApplicationDatabase(bindings, migrationCount) {
|
|
29
|
+
return bindings.needsD1 || bindings.needsAuth || migrationCount > 0;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/shared/resource-definition.ts
|
|
33
|
+
/** Inspect default helper definitions without running application code. */
|
|
34
|
+
function readResourceDefinition(filename, source, helpers) {
|
|
35
|
+
let program;
|
|
36
|
+
try {
|
|
37
|
+
program = parseSync(filename, source).program;
|
|
38
|
+
} catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const constants = /* @__PURE__ */ new Map();
|
|
42
|
+
const definitions = /* @__PURE__ */ new Map();
|
|
43
|
+
const importedHelpers = /* @__PURE__ */ new Map();
|
|
44
|
+
const namespaces = /* @__PURE__ */ new Map();
|
|
45
|
+
const bindings = /* @__PURE__ */ new Set();
|
|
46
|
+
function recordBindings(node) {
|
|
47
|
+
if (isIdentifier(node)) bindings.add(node.name);
|
|
48
|
+
else if (node?.type === "ObjectPattern") for (const property of node.properties ?? []) recordBindings(property.type === "RestElement" ? property.argument : property.value);
|
|
49
|
+
else if (node?.type === "ArrayPattern") for (const element of node.elements ?? []) recordBindings(element);
|
|
50
|
+
else if (node?.type === "AssignmentPattern" || node?.type === "RestElement") recordBindings(node.left ?? node.argument);
|
|
51
|
+
}
|
|
52
|
+
for (const statement of program.body ?? []) {
|
|
53
|
+
if (statement.type === "ImportDeclaration") {
|
|
54
|
+
const declaration = statement;
|
|
55
|
+
const source = declaration.source.value;
|
|
56
|
+
const supported = source === "void/ws" ? /* @__PURE__ */ new Set(["defineRoom", "defineWebSocket"]) : source === "void/durable" ? /* @__PURE__ */ new Set(["defineDurableState"]) : /* @__PURE__ */ new Set();
|
|
57
|
+
for (const specifier of declaration.specifiers ?? []) {
|
|
58
|
+
const local = specifier.local;
|
|
59
|
+
recordBindings(local);
|
|
60
|
+
if (specifier.type === "ImportNamespaceSpecifier") namespaces.set(specifier.local.name, supported);
|
|
61
|
+
else if (specifier.type === "ImportSpecifier") {
|
|
62
|
+
const named = specifier;
|
|
63
|
+
const imported = isIdentifier(named.imported) ? named.imported.name : staticLiteral(named.imported);
|
|
64
|
+
if (typeof imported === "string" && supported.has(imported) && helpers.has(imported)) importedHelpers.set(named.local.name, imported);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
continue;
|
|
68
|
+
}
|
|
69
|
+
const declaration = statement.type === "ExportNamedDeclaration" ? statement.declaration : statement;
|
|
70
|
+
recordBindings(declaration?.id);
|
|
71
|
+
if (declaration?.type !== "VariableDeclaration") continue;
|
|
72
|
+
for (const variable of declaration.declarations ?? []) {
|
|
73
|
+
recordBindings(variable.id);
|
|
74
|
+
if (isIdentifier(variable.id) && variable.init) {
|
|
75
|
+
definitions.set(variable.id.name, variable.init);
|
|
76
|
+
if (declaration.kind === "const") constants.set(variable.id.name, variable.init);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
function resolve(node, seen = /* @__PURE__ */ new Set()) {
|
|
81
|
+
node = unwrapStaticExpression(node);
|
|
82
|
+
if (!isIdentifier(node) || !constants.has(node.name) || seen.has(node.name)) return node;
|
|
83
|
+
seen.add(node.name);
|
|
84
|
+
return resolve(constants.get(node.name), seen);
|
|
85
|
+
}
|
|
86
|
+
function isStaticUndefined(node) {
|
|
87
|
+
node = resolve(node);
|
|
88
|
+
return isIdentifier(node) && node.name === "undefined" && !bindings.has(node.name);
|
|
89
|
+
}
|
|
90
|
+
function readName(options, seen = /* @__PURE__ */ new Set()) {
|
|
91
|
+
options = resolve(options);
|
|
92
|
+
if (!isObjectExpression(options) || seen.has(options)) return { present: false };
|
|
93
|
+
seen.add(options);
|
|
94
|
+
let name = { present: false };
|
|
95
|
+
for (const property of options.properties ?? []) {
|
|
96
|
+
if (property.type === "SpreadElement") {
|
|
97
|
+
const spread = resolve(property.argument);
|
|
98
|
+
if (isObjectExpression(spread)) {
|
|
99
|
+
const spreadName = readName(spread, seen);
|
|
100
|
+
if (spreadName.present) name = spreadName;
|
|
101
|
+
} else if (name.value !== void 0) throw new Error(`${filename}: resource name cannot be overridden by a dynamic spread.`);
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (property.type !== "Property") continue;
|
|
105
|
+
const key = property.key;
|
|
106
|
+
const keyName = !property.computed && isIdentifier(key) ? key.name : staticLiteral(key);
|
|
107
|
+
if (keyName !== "name") {
|
|
108
|
+
if (property.computed && keyName === void 0 && name.value !== void 0) throw new Error(`${filename}: resource name cannot be overridden by a dynamic key.`);
|
|
109
|
+
continue;
|
|
110
|
+
}
|
|
111
|
+
const valueNode = property.value;
|
|
112
|
+
if (isStaticUndefined(valueNode)) {
|
|
113
|
+
name = { present: true };
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
const value = staticLiteral(resolve(valueNode));
|
|
117
|
+
if (!isResourceName(value)) throw new Error(`${filename}: resource name must be a static string containing a word starting with a letter.`);
|
|
118
|
+
name = {
|
|
119
|
+
present: true,
|
|
120
|
+
value
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
seen.delete(options);
|
|
124
|
+
return name;
|
|
125
|
+
}
|
|
126
|
+
const statement = program.body?.find((node) => node.type === "ExportDefaultDeclaration");
|
|
127
|
+
const declaration = unwrapStaticExpression(statement?.declaration);
|
|
128
|
+
const call = resolve(isIdentifier(declaration) ? definitions.get(declaration.name) : declaration);
|
|
129
|
+
if (!isCallExpression(call)) return null;
|
|
130
|
+
const callee = resolve(call.callee);
|
|
131
|
+
let helper;
|
|
132
|
+
if (isIdentifier(callee)) helper = importedHelpers.get(callee.name) ?? (helpers.has(callee.name) ? callee.name : void 0);
|
|
133
|
+
else if (isMemberExpression(callee) && isIdentifier(callee.object)) {
|
|
134
|
+
const property = !callee.computed && isIdentifier(callee.property) ? callee.property.name : staticLiteral(callee.property);
|
|
135
|
+
if (typeof property === "string" && helpers.has(property) && namespaces.get(callee.object.name)?.has(property)) helper = property;
|
|
136
|
+
}
|
|
137
|
+
if (!helper) return null;
|
|
138
|
+
const options = resolve(call.arguments?.[0]);
|
|
139
|
+
const name = readName(options).value;
|
|
140
|
+
return {
|
|
141
|
+
helper,
|
|
142
|
+
options,
|
|
143
|
+
...name === void 0 ? {} : { name }
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
//#endregion
|
|
10
147
|
//#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/walker.js
|
|
11
148
|
/**
|
|
12
149
|
* @typedef { import('estree').Node} Node
|
|
@@ -348,12 +485,18 @@ const WEBSOCKET_ROUTE_RE = /(?:\.(?:dev|prod))?\.ws\.(?:ts|mts|js|mjs)$/;
|
|
|
348
485
|
function isWebSocketRouteFile(filePath) {
|
|
349
486
|
return WEBSOCKET_ROUTE_RE.test(filePath.replace(/\\/g, "/"));
|
|
350
487
|
}
|
|
351
|
-
function
|
|
352
|
-
return segment.replace(/^\(\s*|\s*\)$/g, "").replace(/^\[\.\.\.(.+)\]$/, "$1").replace(/^\[(.+)\]$/, "$1").replace(/\.ws$/, "").replace(/\.(dev|prod)$/, "").replace(/[^a-zA-Z0-9]+/g, " ").split(" ").filter(Boolean)
|
|
488
|
+
function identifierWords(segment) {
|
|
489
|
+
return segment.replace(/^\(\s*|\s*\)$/g, "").replace(/^\[\.\.\.(.+)\]$/, "$1").replace(/^\[(.+)\]$/, "$1").replace(/\.ws$/, "").replace(/\.(dev|prod)$/, "").replace(/[^a-zA-Z0-9]+/g, " ").split(" ").filter(Boolean);
|
|
490
|
+
}
|
|
491
|
+
function deriveWebSocketClassNameFromName(name) {
|
|
492
|
+
return resourceNameWords(name).map((part) => part[0].toUpperCase() + part.slice(1)).join("") + "Ws";
|
|
493
|
+
}
|
|
494
|
+
function inferWebSocketResourceName(filePath) {
|
|
495
|
+
const parts = filePath.replace(/\\/g, "/").replace(/\.(ts|mts|js|mjs)$/, "").split("/").filter((segment) => segment.length > 0 && !(segment.startsWith("(") && segment.endsWith(")"))).flatMap(identifierWords);
|
|
496
|
+
return parts.length > 0 ? parts.join("-") : "WebSocket";
|
|
353
497
|
}
|
|
354
498
|
function deriveWebSocketClassName(filePath) {
|
|
355
|
-
|
|
356
|
-
return (parts.length > 0 ? parts.join("") : "WebSocket") + "Ws";
|
|
499
|
+
return deriveWebSocketClassNameFromName(inferWebSocketResourceName(filePath));
|
|
357
500
|
}
|
|
358
501
|
function getPropertyName(node) {
|
|
359
502
|
if (!node) return null;
|
|
@@ -361,64 +504,43 @@ function getPropertyName(node) {
|
|
|
361
504
|
if (isLiteral(node) && typeof node.value === "string") return node.value;
|
|
362
505
|
return null;
|
|
363
506
|
}
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
let hasAuthGate = false;
|
|
370
|
-
const options = call.arguments?.[0];
|
|
371
|
-
if (isObjectExpression(options)) for (const property of options.properties ?? []) {
|
|
372
|
-
if (property.type !== "Property") continue;
|
|
373
|
-
if (getPropertyName(property.key) === "onBeforeConnect") {
|
|
374
|
-
hasAuthGate = true;
|
|
375
|
-
break;
|
|
376
|
-
}
|
|
377
|
-
}
|
|
507
|
+
const WEBSOCKET_HELPERS = /* @__PURE__ */ new Set(["defineRoom", "defineWebSocket"]);
|
|
508
|
+
function detectWebSocketDefinition(absPath) {
|
|
509
|
+
const definition = readResourceDefinition(absPath, readFileSync(absPath, "utf-8"), WEBSOCKET_HELPERS);
|
|
510
|
+
if (!definition) return null;
|
|
511
|
+
const hasAuthGate = isObjectExpression(definition.options) && (definition.options.properties ?? []).some((property) => property.type === "Property" && getPropertyName(property.key) === "onBeforeConnect");
|
|
378
512
|
return {
|
|
379
|
-
mode:
|
|
380
|
-
hasAuthGate
|
|
513
|
+
mode: definition.helper === "defineRoom" ? "room" : "socket",
|
|
514
|
+
hasAuthGate,
|
|
515
|
+
...definition.name === void 0 ? {} : { name: definition.name }
|
|
381
516
|
};
|
|
382
517
|
}
|
|
383
|
-
function detectWebSocketDefinition(absPath) {
|
|
384
|
-
const code = readFileSync(absPath, "utf-8");
|
|
385
|
-
const filename = absPath.split("/").pop() ?? absPath;
|
|
386
|
-
let parsed;
|
|
387
|
-
try {
|
|
388
|
-
parsed = parseSync(filename, code);
|
|
389
|
-
} catch {
|
|
390
|
-
return null;
|
|
391
|
-
}
|
|
392
|
-
const program = parsed.program;
|
|
393
|
-
const variableInitializers = /* @__PURE__ */ new Map();
|
|
394
|
-
for (const node of program.body ?? []) if (node.type === "VariableDeclaration") {
|
|
395
|
-
for (const declarator of node.declarations ?? []) if (isIdentifier(declarator.id) && declarator.init) variableInitializers.set(declarator.id.name, declarator.init);
|
|
396
|
-
}
|
|
397
|
-
for (const node of program.body ?? []) {
|
|
398
|
-
if (node.type !== "ExportDefaultDeclaration") continue;
|
|
399
|
-
const declaration = node.declaration;
|
|
400
|
-
if (isIdentifier(declaration)) return extractDefinition(variableInitializers.get(declaration.name));
|
|
401
|
-
return extractDefinition(declaration);
|
|
402
|
-
}
|
|
403
|
-
return null;
|
|
404
|
-
}
|
|
405
518
|
function buildWebSocketRoute(root, filePath, paths = readProjectPaths(root)) {
|
|
406
519
|
const parsed = parseWebSocketFilename(filePath);
|
|
407
520
|
const info = detectWebSocketDefinition(join(paths.routesDir, filePath));
|
|
408
|
-
const className = deriveWebSocketClassName(filePath);
|
|
521
|
+
const className = info?.name === void 0 ? deriveWebSocketClassName(filePath) : deriveWebSocketClassNameFromName(info.name);
|
|
409
522
|
return {
|
|
410
523
|
...parsed,
|
|
411
524
|
className,
|
|
412
525
|
bindingName: className,
|
|
413
526
|
mode: info?.mode ?? "socket",
|
|
414
|
-
hasAuthGate: info?.hasAuthGate ?? false
|
|
527
|
+
hasAuthGate: info?.hasAuthGate ?? false,
|
|
528
|
+
...info?.name === void 0 ? {} : { name: info.name }
|
|
415
529
|
};
|
|
416
530
|
}
|
|
417
531
|
function parseWebSocketFiles(root, files, paths = readProjectPaths(root), environment) {
|
|
418
|
-
|
|
532
|
+
const routes = files.filter((f) => isWebSocketRouteFile(f)).filter((f) => !f.split("/").some((segment) => segment.startsWith("_"))).filter((filePath) => isRouteEnabledForEnvironment(parseWebSocketFilename(filePath), environment)).map((filePath) => buildWebSocketRoute(root, filePath, paths)).sort((a, b) => {
|
|
419
533
|
if (a.catchAll !== b.catchAll) return a.catchAll ? 1 : -1;
|
|
420
534
|
return a.pattern.localeCompare(b.pattern);
|
|
421
535
|
});
|
|
536
|
+
const byClass = /* @__PURE__ */ new Map();
|
|
537
|
+
for (const route of routes) {
|
|
538
|
+
const previous = byClass.get(route.className) ?? [];
|
|
539
|
+
if (previous.some((other) => other.env === null || route.env === null || other.env === route.env)) throw new Error(`websocket: duplicate generated name '${route.className}' for '${route.filePath}'. Choose a different resource name or rename one of the WebSocket route files.`);
|
|
540
|
+
previous.push(route);
|
|
541
|
+
byClass.set(route.className, previous);
|
|
542
|
+
}
|
|
543
|
+
return routes;
|
|
422
544
|
}
|
|
423
545
|
async function scanWebSocketRoutes(root, paths = readProjectPaths(root), environment) {
|
|
424
546
|
const pattern = `**/*.{${HANDLER_EXTENSIONS.join(",")}}`;
|
|
@@ -549,23 +671,15 @@ function inferBindingsFromFile(file, code) {
|
|
|
549
671
|
* @param scanDirs - Override the default scan directories (e.g., for framework mode)
|
|
550
672
|
*/
|
|
551
673
|
function inferProjectBindings(root, options, scanDirs) {
|
|
552
|
-
if (options?.bindings) return {
|
|
553
|
-
needsD1: Boolean(options.bindings.db),
|
|
554
|
-
needsKV: Boolean(options.bindings.kv),
|
|
555
|
-
needsR2: Boolean(options.bindings.storage),
|
|
556
|
-
needsAuth: false,
|
|
557
|
-
needsQueues: false,
|
|
558
|
-
needsAI: Boolean(options.bindings.ai),
|
|
559
|
-
needsSandbox: false,
|
|
560
|
-
needsLive: false,
|
|
561
|
-
needsEmail: Boolean(options.bindings.email)
|
|
562
|
-
};
|
|
563
674
|
const paths = options?.paths ?? readProjectPaths(root);
|
|
564
675
|
const dirs = scanDirs ?? (paths.sourceDir ? [paths.sourceDir] : DEFAULT_SCAN_DIRS);
|
|
565
676
|
const allBindings = [];
|
|
677
|
+
const scannedFiles = /* @__PURE__ */ new Set();
|
|
566
678
|
const routesPrefix = `${toSlash(paths.routesDir).replace(/\/$/, "")}/`;
|
|
567
679
|
const addFile = (file) => {
|
|
568
680
|
const normalizedFile = toSlash(file);
|
|
681
|
+
if (scannedFiles.has(normalizedFile)) return;
|
|
682
|
+
scannedFiles.add(normalizedFile);
|
|
569
683
|
if (options?.environment && normalizedFile.startsWith(routesPrefix) && /\.(?:ts|mts|js|mjs)$/.test(normalizedFile)) {
|
|
570
684
|
const routePath = relative(paths.routesDir, normalizedFile);
|
|
571
685
|
const route = isWebSocketPatternFile(routePath) ? parseWebSocketFilename(routePath) : parseRouteFilename(routePath);
|
|
@@ -588,11 +702,7 @@ function inferProjectBindings(root, options, scanDirs) {
|
|
|
588
702
|
for (const file of files) addFile(file);
|
|
589
703
|
}
|
|
590
704
|
const ssrEntry = getSsrServerEntryPath(root, paths);
|
|
591
|
-
if (ssrEntry)
|
|
592
|
-
const code = readFileSync(ssrEntry, "utf-8");
|
|
593
|
-
const filename = ssrEntry.split("/").pop() ?? "main.ssr.ts";
|
|
594
|
-
allBindings.push(inferBindingsFromSource(code, filename));
|
|
595
|
-
}
|
|
705
|
+
if (ssrEntry) addFile(ssrEntry);
|
|
596
706
|
const dirsSet = new Set(dirs);
|
|
597
707
|
const srcRel = paths.sourceDir ? paths.sourceDir : "src";
|
|
598
708
|
if (!dirsSet.has(srcRel)) {
|
|
@@ -608,7 +718,7 @@ function inferProjectBindings(root, options, scanDirs) {
|
|
|
608
718
|
}
|
|
609
719
|
for (const file of srcFiles) addFile(file);
|
|
610
720
|
}
|
|
611
|
-
return mergeBindings(allBindings);
|
|
721
|
+
return applyBindingOverrides(mergeBindings(allBindings), options?.bindings);
|
|
612
722
|
}
|
|
613
723
|
//#endregion
|
|
614
|
-
export {
|
|
724
|
+
export { deriveWebSocketClassNameFromName as a, scanWebSocketRoutes as c, walk as d, readResourceDefinition as f, inferProjectBindings as i, scanWebSocketRoutesSync as l, needsApplicationDatabase as m, FRAMEWORK_SCAN_DIRS as n, inferWebSocketResourceName as o, applyBindingOverrides as p, detectFramework as r, isWebSocketPatternFile as s, DEFAULT_SCAN_DIRS as t, inferBindingsFromSource as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as cliTitle } from "./output-
|
|
3
|
-
import { t as prepareProject } from "./prepare-
|
|
1
|
+
import { B as note, H as outro, L as log, N as intro } from "./prompts-BNUoTiaf.mjs";
|
|
2
|
+
import { r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
3
|
+
import { t as prepareProject } from "./prepare-DnaKBi--.mjs";
|
|
4
4
|
//#region src/cli/prepare.ts
|
|
5
5
|
async function runPrepareCommand(root, _args) {
|
|
6
6
|
console.log();
|
|
@@ -1,14 +1,12 @@
|
|
|
1
1
|
import { a as join } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
2
|
+
import { n as loadVoidAuthConfig } from "./config-DPByhVck.mjs";
|
|
3
|
+
import { m as readConfig } from "./config-Br_JZD6u.mjs";
|
|
5
4
|
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-B8GeM0RM.mjs";
|
|
6
|
-
import { r as scanRoutes } from "./scan-ClYmX3sa.mjs";
|
|
7
|
-
import { i as inferProjectBindings, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-BMfKRSqE.mjs";
|
|
8
5
|
import { i as generateDbDts, n as generateQueueTypes, t as generateRouteTypes } from "./route-types-Clm4WD0B.mjs";
|
|
9
6
|
import { t as discoverSchema } from "./discover-BcPPiF1o.mjs";
|
|
10
|
-
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-
|
|
7
|
+
import { r as generateEnvTypes, t as findEnvFile } from "./env-types-D5kds_OZ.mjs";
|
|
11
8
|
import { a as loadLocalEnv } from "./env-_v349JBd.mjs";
|
|
9
|
+
import { t as analyzeApplication } from "./application-routing-B7QEjqSR.mjs";
|
|
12
10
|
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-Beb2Am5S.mjs";
|
|
13
11
|
import { existsSync, mkdirSync, rmSync } from "node:fs";
|
|
14
12
|
import { fileURLToPath } from "node:url";
|
|
@@ -25,30 +23,16 @@ function removeGeneratedFile(outDir, fileName, removed) {
|
|
|
25
23
|
}
|
|
26
24
|
async function prepareProject(root) {
|
|
27
25
|
const config = readConfig(root);
|
|
28
|
-
const paths =
|
|
26
|
+
const { paths, authConfigPath, authEnabled, dialect, scan } = await analyzeApplication(root, { config });
|
|
29
27
|
const outDir = join(root, ".void");
|
|
30
28
|
const written = [];
|
|
31
29
|
const removed = [];
|
|
32
30
|
mkdirSync(outDir, { recursive: true });
|
|
33
|
-
const detectedFramework = detectFramework(root);
|
|
34
|
-
const inferenceOptions = config.inference?.bindings ? { bindings: config.inference.bindings } : void 0;
|
|
35
|
-
const scanDirs = config.inference?.scanDirs ?? (detectedFramework ? FRAMEWORK_SCAN_DIRS : void 0);
|
|
36
|
-
const bindings = inferProjectBindings(root, {
|
|
37
|
-
...inferenceOptions,
|
|
38
|
-
paths
|
|
39
|
-
}, scanDirs);
|
|
40
|
-
const authConfigPath = findVoidAuthConfig(root, paths);
|
|
41
|
-
const authEnabled = bindings.needsAuth || authConfigPath !== null || config.auth !== void 0;
|
|
42
|
-
const dialect = getDatabaseDialect(config);
|
|
43
31
|
const envFile = findEnvFile(root);
|
|
44
32
|
if (envFile) {
|
|
45
33
|
const { dts } = generateEnvTypes(envFile, outDir);
|
|
46
34
|
writeGeneratedFile(outDir, "env.d.ts", dts, written);
|
|
47
35
|
} else removeGeneratedFile(outDir, "env.d.ts", removed);
|
|
48
|
-
const scan = await scanRoutes(root, {
|
|
49
|
-
output: config.output,
|
|
50
|
-
paths
|
|
51
|
-
});
|
|
52
36
|
const hasRouteTypes = scan.routes.length > 0 || (scan.websockets?.length ?? 0) > 0 || scan.pages.pages.length > 0;
|
|
53
37
|
if (hasRouteTypes) {
|
|
54
38
|
const { dts } = generateRouteTypes(scan, paths.routesDir, outDir, paths.pagesDir);
|
|
@@ -1,60 +1,7 @@
|
|
|
1
1
|
import { a as join, n as dirname } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import { o as listPlatformConnections, s as normalizePlatformApiUrl } from "./platform-registry-
|
|
2
|
+
import { o as listPlatformConnections, s as normalizePlatformApiUrl } from "./platform-registry-DkPPXfp_.mjs";
|
|
3
3
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
-
import { homedir } from "node:os";
|
|
5
4
|
import { normalizeApplicationDomain } from "@void/platform";
|
|
6
|
-
//#region src/cli/hosted-platform.ts
|
|
7
|
-
const VOID_CLOUD_PLATFORM = Object.freeze({
|
|
8
|
-
apiUrl: "https://api.void.cloud",
|
|
9
|
-
applicationDomain: "void.app",
|
|
10
|
-
displayName: "Void Cloud",
|
|
11
|
-
proxyUrl: "https://proxy.void.cloud"
|
|
12
|
-
});
|
|
13
|
-
const VOID_CLOUD_STAGING_PLATFORM = Object.freeze({
|
|
14
|
-
apiUrl: "https://api.staging.void.cloud",
|
|
15
|
-
applicationDomain: "staging.void.app",
|
|
16
|
-
displayName: "Void Cloud staging",
|
|
17
|
-
proxyUrl: "https://proxy.staging.void.cloud"
|
|
18
|
-
});
|
|
19
|
-
const HOSTED_PLATFORMS = [VOID_CLOUD_PLATFORM, VOID_CLOUD_STAGING_PLATFORM];
|
|
20
|
-
function hostedPlatformForApiUrl(apiUrl) {
|
|
21
|
-
if (typeof apiUrl !== "string") return null;
|
|
22
|
-
let normalized;
|
|
23
|
-
try {
|
|
24
|
-
const parsed = new URL(apiUrl);
|
|
25
|
-
if (parsed.protocol !== "https:" || parsed.username || parsed.password || parsed.search || parsed.hash || parsed.pathname !== "/" && parsed.pathname !== "") return null;
|
|
26
|
-
normalized = parsed.origin;
|
|
27
|
-
} catch {
|
|
28
|
-
return null;
|
|
29
|
-
}
|
|
30
|
-
return HOSTED_PLATFORMS.find((platform) => platform.apiUrl === normalized) ?? null;
|
|
31
|
-
}
|
|
32
|
-
/** Resolve an old ~/.void/config.json selection without returning credential values. */
|
|
33
|
-
function readLegacyHostedPlatformSelection(configPath = join(homedir(), ".void", "config.json")) {
|
|
34
|
-
let value = {};
|
|
35
|
-
try {
|
|
36
|
-
value = JSON.parse(readFileSync(configPath, "utf8"));
|
|
37
|
-
} catch {
|
|
38
|
-
return null;
|
|
39
|
-
}
|
|
40
|
-
if (value.api !== void 0) {
|
|
41
|
-
const platform = hostedPlatformForApiUrl(value.api);
|
|
42
|
-
return platform ? {
|
|
43
|
-
...platform,
|
|
44
|
-
source: "configured-api"
|
|
45
|
-
} : null;
|
|
46
|
-
}
|
|
47
|
-
if (typeof value.token === "string" && value.token !== "") return {
|
|
48
|
-
...VOID_CLOUD_PLATFORM,
|
|
49
|
-
source: "legacy-credential"
|
|
50
|
-
};
|
|
51
|
-
if (typeof value.stagingToken === "string" && value.stagingToken !== "") return {
|
|
52
|
-
...VOID_CLOUD_STAGING_PLATFORM,
|
|
53
|
-
source: "legacy-credential"
|
|
54
|
-
};
|
|
55
|
-
return null;
|
|
56
|
-
}
|
|
57
|
-
//#endregion
|
|
58
5
|
//#region src/cli/project.ts
|
|
59
6
|
const PROJECT_FILE = ".void/project.json";
|
|
60
7
|
function readProjectConfigFile(root) {
|
|
@@ -83,7 +30,6 @@ function readProjectConfig(root) {
|
|
|
83
30
|
if (typeof config.platformUrl === "string") result.platformUrl = normalizePlatformApiUrl(config.platformUrl);
|
|
84
31
|
if (typeof config.applicationDomain === "string") result.applicationDomain = normalizeApplicationDomain(config.applicationDomain);
|
|
85
32
|
if (typeof config.proxyUrl === "string") result.proxyUrl = normalizePlatformApiUrl(config.proxyUrl);
|
|
86
|
-
if (config.voidInternalStaging === true) result.voidInternalStaging = true;
|
|
87
33
|
return result;
|
|
88
34
|
}
|
|
89
35
|
/**
|
|
@@ -112,7 +58,6 @@ function writeDeploymentPlatform(root, platform) {
|
|
|
112
58
|
if (typeof existing?.applicationDomain === "string") next.applicationDomain = existing.applicationDomain;
|
|
113
59
|
if (typeof existing?.proxyUrl === "string") next.proxyUrl = existing.proxyUrl;
|
|
114
60
|
if (typeof existing?.slug === "string") next.slug = existing.slug;
|
|
115
|
-
if (existing?.voidInternalStaging === true) next.voidInternalStaging = true;
|
|
116
61
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
117
62
|
writeFileSync(filePath, JSON.stringify(next, null, 2) + "\n");
|
|
118
63
|
}
|
|
@@ -120,12 +65,18 @@ function writeDeploymentPlatform(root, platform) {
|
|
|
120
65
|
function writePlatformSelection(root, connection) {
|
|
121
66
|
const existing = readProjectConfigFile(root);
|
|
122
67
|
const linked = readProjectConfig(root);
|
|
123
|
-
const pinnedUrl =
|
|
68
|
+
const pinnedUrl = linked?.platformUrl;
|
|
124
69
|
if (pinnedUrl && pinnedUrl !== connection.apiUrl) return false;
|
|
70
|
+
const metadata = { ...existing };
|
|
71
|
+
delete metadata.voidInternalStaging;
|
|
72
|
+
if (linked && !pinnedUrl) {
|
|
73
|
+
delete metadata.projectId;
|
|
74
|
+
delete metadata.slug;
|
|
75
|
+
}
|
|
125
76
|
const filePath = join(root, PROJECT_FILE);
|
|
126
77
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
127
78
|
writeFileSync(filePath, JSON.stringify({
|
|
128
|
-
...
|
|
79
|
+
...metadata,
|
|
129
80
|
platform: "void",
|
|
130
81
|
platformUrl: normalizePlatformApiUrl(connection.apiUrl),
|
|
131
82
|
applicationDomain: normalizeApplicationDomain(connection.applicationDomain),
|
|
@@ -133,32 +84,19 @@ function writePlatformSelection(root, connection) {
|
|
|
133
84
|
}, null, 2) + "\n");
|
|
134
85
|
return true;
|
|
135
86
|
}
|
|
136
|
-
/**
|
|
137
|
-
* Internal-only platform developers' staging switch.
|
|
138
|
-
* This intentionally lives with the project link state, not public void.json.
|
|
139
|
-
*/
|
|
140
|
-
function isVoidInternalStaging(root) {
|
|
141
|
-
return readProjectConfigFile(root)?.voidInternalStaging === true;
|
|
142
|
-
}
|
|
143
87
|
function readProjectPlatformUrl(root) {
|
|
144
88
|
const value = readProjectConfigFile(root)?.platformUrl;
|
|
145
89
|
return typeof value === "string" && value !== "" ? normalizePlatformApiUrl(value) : null;
|
|
146
90
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
91
|
+
/** A deploy can establish a first link, but must never replace a saved destination. */
|
|
92
|
+
function shouldLinkDeployProject(root, apiUrl) {
|
|
93
|
+
const platform = readDeploymentPlatform(root);
|
|
94
|
+
const selectedUrl = readProjectPlatformUrl(root);
|
|
95
|
+
return !readProjectConfig(root) && platform !== "cloudflare" && platform !== "none" && (!selectedUrl || selectedUrl === normalizePlatformApiUrl(apiUrl));
|
|
150
96
|
}
|
|
151
97
|
/** Resolve the immutable platform identity that every newly linked project records. */
|
|
152
98
|
function attachSelectedPlatform(root, config, platformApiUrl) {
|
|
153
99
|
const apiUrl = normalizePlatformApiUrl(platformApiUrl);
|
|
154
|
-
const hosted = hostedPlatformForApiUrl(apiUrl);
|
|
155
|
-
if (hosted) return {
|
|
156
|
-
...config,
|
|
157
|
-
applicationDomain: hosted.applicationDomain,
|
|
158
|
-
platformUrl: hosted.apiUrl,
|
|
159
|
-
proxyUrl: hosted.proxyUrl,
|
|
160
|
-
...isVoidInternalStaging(root) && hosted.apiUrl === VOID_CLOUD_STAGING_PLATFORM.apiUrl ? { voidInternalStaging: true } : {}
|
|
161
|
-
};
|
|
162
100
|
const connection = listPlatformConnections().find((entry) => entry.apiUrl === apiUrl);
|
|
163
101
|
if (connection?.applicationDomain && connection.proxyUrl) return {
|
|
164
102
|
...config,
|
|
@@ -168,10 +106,6 @@ function attachSelectedPlatform(root, config, platformApiUrl) {
|
|
|
168
106
|
};
|
|
169
107
|
throw new Error(`platform: No verified metadata is registered for ${apiUrl}. Run \`void connect ${apiUrl}\` before linking a project.`);
|
|
170
108
|
}
|
|
171
|
-
function isLegacyVoidCloudProject(root) {
|
|
172
|
-
const config = readProjectConfigFile(root);
|
|
173
|
-
return typeof config?.projectId === "string" && typeof config.slug === "string" && typeof config.platformUrl !== "string";
|
|
174
|
-
}
|
|
175
109
|
/**
|
|
176
110
|
* Write the project config to the project root.
|
|
177
111
|
*/
|
|
@@ -189,7 +123,6 @@ function writeProjectConfig(root, config) {
|
|
|
189
123
|
else if (typeof existing?.applicationDomain === "string") next.applicationDomain = existing.applicationDomain;
|
|
190
124
|
if (config.proxyUrl) next.proxyUrl = normalizePlatformApiUrl(config.proxyUrl);
|
|
191
125
|
else if (typeof existing?.proxyUrl === "string") next.proxyUrl = existing.proxyUrl;
|
|
192
|
-
if (config.voidInternalStaging === true || existing?.voidInternalStaging === true) next.voidInternalStaging = true;
|
|
193
126
|
mkdirSync(dirname(filePath), { recursive: true });
|
|
194
127
|
writeFileSync(filePath, JSON.stringify(next, null, 2) + "\n");
|
|
195
128
|
}
|
|
@@ -206,4 +139,4 @@ function removeProjectConfig(root) {
|
|
|
206
139
|
}
|
|
207
140
|
}
|
|
208
141
|
//#endregion
|
|
209
|
-
export {
|
|
142
|
+
export { removeProjectConfig as a, writePlatformSelection as c, readProjectPlatformUrl as i, writeProjectConfig as l, readDeploymentPlatform as n, shouldLinkDeployProject as o, readProjectConfig as r, writeDeploymentPlatform as s, attachSelectedPlatform as t };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as PlatformClient } from "./client-
|
|
5
|
-
import { a as dim, c as import_picocolors, d as tablePrefix, r as cliTitle } from "./output-
|
|
1
|
+
import { n as readDeploymentPlatform } from "./project-DKG5Ra8p.mjs";
|
|
2
|
+
import { c as getToken, s as getSiteDomain } from "./auth-CQkSDS50.mjs";
|
|
3
|
+
import { H as outro, L as log, N as intro } from "./prompts-BNUoTiaf.mjs";
|
|
4
|
+
import { n as PlatformClient } from "./client-DKAsFA4X.mjs";
|
|
5
|
+
import { a as dim, c as import_picocolors, d as tablePrefix, r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
6
6
|
//#region src/cli/projects.ts
|
|
7
7
|
async function runProjectsCommand(root) {
|
|
8
8
|
console.log();
|
|
@@ -39,77 +39,77 @@ async function runProjectsCommand(root) {
|
|
|
39
39
|
async function runProjectCommand(root, args) {
|
|
40
40
|
const cloudflare = readDeploymentPlatform(root) === "cloudflare";
|
|
41
41
|
if (args.subcommand === "status") {
|
|
42
|
-
const { runListCommand } = await import("./list-
|
|
42
|
+
const { runListCommand } = await import("./list-BnPrIsU_.mjs");
|
|
43
43
|
return runListCommand(root, args.name || void 0);
|
|
44
44
|
}
|
|
45
45
|
if (args.subcommand === "link") {
|
|
46
46
|
if (cloudflare) throw new Error("project: Direct Cloudflare apps are identified by cloudflare.name in void.config.ts and do not need linking.");
|
|
47
|
-
const { runLink } = await import("./link-
|
|
47
|
+
const { runLink } = await import("./link-B46sYH0K.mjs");
|
|
48
48
|
return runLink(root, args.name || void 0);
|
|
49
49
|
}
|
|
50
50
|
if (args.subcommand === "list") {
|
|
51
51
|
if (cloudflare) {
|
|
52
|
-
const { runListCommand } = await import("./list-
|
|
52
|
+
const { runListCommand } = await import("./list-BnPrIsU_.mjs");
|
|
53
53
|
return runListCommand(root);
|
|
54
54
|
}
|
|
55
55
|
return runProjectsCommand(root);
|
|
56
56
|
}
|
|
57
57
|
if (args.subcommand === "token") {
|
|
58
58
|
if (cloudflare) throw new Error("project: CI deploy credentials are available only for Void platform projects.");
|
|
59
|
-
const { runProjectTokenCommand } = await import("./project-token-
|
|
59
|
+
const { runProjectTokenCommand } = await import("./project-token-GionZlBI.mjs");
|
|
60
60
|
return runProjectTokenCommand(root, args);
|
|
61
61
|
}
|
|
62
62
|
if (args.subcommand === "team") {
|
|
63
63
|
if (args.action === "") {
|
|
64
|
-
const { printHelpPage } = await import("./help-
|
|
64
|
+
const { printHelpPage } = await import("./help-mabuIV98.mjs");
|
|
65
65
|
printHelpPage(["project", "team"]);
|
|
66
66
|
return;
|
|
67
67
|
}
|
|
68
68
|
const accountInvitationAction = args.action === "pending" || args.action === "accept" || args.action === "decline";
|
|
69
69
|
if (cloudflare && !accountInvitationAction) throw new Error("project: Teams are available only for projects hosted on a Void platform, not direct Cloudflare deployments.");
|
|
70
|
-
const { runProjectTeamCommand } = await import("./project-team-
|
|
70
|
+
const { runProjectTeamCommand } = await import("./project-team-BmHcaALJ.mjs");
|
|
71
71
|
return runProjectTeamCommand(root, args);
|
|
72
72
|
}
|
|
73
73
|
if (args.subcommand === "zero-trust") {
|
|
74
74
|
if (cloudflare) throw new Error("project: Zero Trust overrides are available only for projects hosted on a Void platform.");
|
|
75
75
|
if (args.action === "") {
|
|
76
|
-
const { printHelpPage } = await import("./help-
|
|
76
|
+
const { printHelpPage } = await import("./help-mabuIV98.mjs");
|
|
77
77
|
printHelpPage(["project", "zero-trust"]);
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
const action = args.action;
|
|
81
|
-
const { runProjectZeroTrustCommand } = await import("./project-zero-trust-
|
|
81
|
+
const { runProjectZeroTrustCommand } = await import("./project-zero-trust-JLCjVQA7.mjs");
|
|
82
82
|
return runProjectZeroTrustCommand(root, {
|
|
83
83
|
...args,
|
|
84
84
|
action
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
if (args.subcommand === "logs") {
|
|
88
|
-
const { runLogsCommand } = await import("./logs-
|
|
88
|
+
const { runLogsCommand } = await import("./logs-CZG9d-ic.mjs");
|
|
89
89
|
return runLogsCommand(root, args.filter, args.range, args.deployment || void 0, args.level || void 0);
|
|
90
90
|
}
|
|
91
91
|
if (args.subcommand === "requests") {
|
|
92
92
|
if (cloudflare) throw new Error("project: Historical request analytics require the Void platform. Use `void project logs` for a live Cloudflare tail.");
|
|
93
|
-
const { runRequestsCommand } = await import("./requests-
|
|
93
|
+
const { runRequestsCommand } = await import("./requests-BOjIVAeF.mjs");
|
|
94
94
|
return runRequestsCommand(root, args.range, args.status || void 0);
|
|
95
95
|
}
|
|
96
96
|
if (args.subcommand === "rollback") {
|
|
97
|
-
const { runRollbackCommand } = await import("./rollback-
|
|
97
|
+
const { runRollbackCommand } = await import("./rollback-CwR3pLj3.mjs");
|
|
98
98
|
return runRollbackCommand(root, args.deployId || void 0);
|
|
99
99
|
}
|
|
100
100
|
if (args.subcommand === "cancel") {
|
|
101
101
|
if (cloudflare) throw new Error("project: Direct Cloudflare deploys activate only after readiness succeeds, so there is no remote build to cancel.");
|
|
102
|
-
const { runCancelDeployCommand } = await import("./cancel-deploy-
|
|
102
|
+
const { runCancelDeployCommand } = await import("./cancel-deploy-Box0kkEV.mjs");
|
|
103
103
|
return runCancelDeployCommand(root, args.deployId || void 0);
|
|
104
104
|
}
|
|
105
105
|
if (args.subcommand === "delete") {
|
|
106
106
|
if (cloudflare) throw new Error("project: Refusing to delete Cloudflare resources through this command. Direct deployments are additive and existing resources may be shared.");
|
|
107
|
-
const { runDeleteCommand } = await import("./delete-
|
|
107
|
+
const { runDeleteCommand } = await import("./delete-sK56qtzZ.mjs");
|
|
108
108
|
return runDeleteCommand(root, args.name || void 0, { force: args.force });
|
|
109
109
|
}
|
|
110
110
|
if (args.subcommand === "purge-cache") {
|
|
111
111
|
if (cloudflare) throw new Error("project: Direct Cloudflare ISR cache purge is not available yet; redeploy or purge the configured KV namespace explicitly.");
|
|
112
|
-
const { runPurgeCacheCommand } = await import("./cache-
|
|
112
|
+
const { runPurgeCacheCommand } = await import("./cache-ZtQmyxVV.mjs");
|
|
113
113
|
return runPurgeCacheCommand(root, args.projectSlug || void 0);
|
|
114
114
|
}
|
|
115
115
|
}
|