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
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { a as join, l as relative } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { a as deriveWebSocketClassNameFromName, o as inferWebSocketResourceName } from "./plugin-inference-CXWnn79A.mjs";
|
|
3
|
+
import { m as readConfig } from "./config-Br_JZD6u.mjs";
|
|
4
|
+
import { a as inferDurableResourceName, i as deriveDurableResourceIdentity, t as analyzeApplicationSync } from "./application-analysis-BVsVqc11.mjs";
|
|
5
|
+
import { n as VOID_LOCK_FILE } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
6
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
7
|
+
//#region src/cli/info.ts
|
|
8
|
+
function isRecord(value) {
|
|
9
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
10
|
+
}
|
|
11
|
+
function readRecordedResources(root, resources) {
|
|
12
|
+
const path = join(root, VOID_LOCK_FILE);
|
|
13
|
+
if (!existsSync(path)) return [];
|
|
14
|
+
let lock;
|
|
15
|
+
try {
|
|
16
|
+
lock = JSON.parse(readFileSync(path, "utf8"));
|
|
17
|
+
} catch {
|
|
18
|
+
throw new Error("info: Invalid void.lock.json. Fix or restore it before continuing.");
|
|
19
|
+
}
|
|
20
|
+
if (!isRecord(lock) || lock.version !== 1 || !isRecord(lock.resolved)) throw new Error("info: Invalid void.lock.json. Fix or restore it before continuing.");
|
|
21
|
+
const durable = lock.resolved.durable_objects;
|
|
22
|
+
const bindings = isRecord(durable) && Array.isArray(durable.bindings) ? durable.bindings : [];
|
|
23
|
+
const migrations = Array.isArray(lock.resolved.migrations) ? lock.resolved.migrations : [];
|
|
24
|
+
const recorded = [];
|
|
25
|
+
for (const binding of bindings) {
|
|
26
|
+
if (!isRecord(binding) || typeof binding.name !== "string" || typeof binding.class_name !== "string" || binding.script_name !== void 0) continue;
|
|
27
|
+
const className = binding.class_name;
|
|
28
|
+
const bindingName = binding.name;
|
|
29
|
+
if (resources.some((resource) => resource.className === className && resource.bindingName === bindingName)) continue;
|
|
30
|
+
const resource = {
|
|
31
|
+
className,
|
|
32
|
+
bindingName
|
|
33
|
+
};
|
|
34
|
+
if (className.endsWith("Ws") && bindingName === className) {
|
|
35
|
+
const name = className.slice(0, -2);
|
|
36
|
+
if (name && deriveWebSocketClassNameFromName(name) === className) {
|
|
37
|
+
resource.name = name;
|
|
38
|
+
resource.definition = "defineRoom | defineWebSocket";
|
|
39
|
+
}
|
|
40
|
+
} else if (className.endsWith("DurableObject")) {
|
|
41
|
+
const candidates = [className.slice(0, -13), bindingName.toLowerCase().replaceAll("_", "-")];
|
|
42
|
+
for (const name of candidates) {
|
|
43
|
+
if (!name) continue;
|
|
44
|
+
const identity = deriveDurableResourceIdentity(name);
|
|
45
|
+
const matchesMigration = migrations.some((migration) => {
|
|
46
|
+
if (!isRecord(migration) || migration.tag !== identity.migrationTag) return false;
|
|
47
|
+
return [migration.new_classes, migration.new_sqlite_classes].some((classes) => Array.isArray(classes) && classes.includes(className));
|
|
48
|
+
});
|
|
49
|
+
if (identity.className === className && identity.bindingName === bindingName && matchesMigration) {
|
|
50
|
+
resource.name = name;
|
|
51
|
+
resource.definition = "defineDurableState";
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
recorded.push(resource);
|
|
57
|
+
}
|
|
58
|
+
return recorded.sort((a, b) => a.className.localeCompare(b.className) || a.bindingName.localeCompare(b.bindingName));
|
|
59
|
+
}
|
|
60
|
+
/** Inspect source without provisioning, generating files, or consulting credentials. */
|
|
61
|
+
function getProjectInfo(root) {
|
|
62
|
+
const analysis = analyzeApplicationSync(root, { config: readConfig(root) });
|
|
63
|
+
const resources = [...analysis.websockets.map((route) => ({
|
|
64
|
+
file: relative(root, analysis.paths.routesDir) + "/" + route.filePath,
|
|
65
|
+
definition: route.mode === "room" ? "defineRoom" : "defineWebSocket",
|
|
66
|
+
name: route.name ?? inferWebSocketResourceName(route.filePath),
|
|
67
|
+
nameSource: route.name === void 0 ? "inferred" : "explicit",
|
|
68
|
+
className: route.className,
|
|
69
|
+
bindingName: route.bindingName,
|
|
70
|
+
route: route.pattern
|
|
71
|
+
})), ...analysis.durableObjects.map((module) => ({
|
|
72
|
+
file: relative(root, module.filePath),
|
|
73
|
+
definition: "defineDurableState",
|
|
74
|
+
name: module.name ?? inferDurableResourceName(module.filePath),
|
|
75
|
+
nameSource: module.name === void 0 ? "inferred" : "explicit",
|
|
76
|
+
className: module.className,
|
|
77
|
+
bindingName: module.bindingName
|
|
78
|
+
}))];
|
|
79
|
+
resources.sort((a, b) => a.file.localeCompare(b.file));
|
|
80
|
+
return {
|
|
81
|
+
resources,
|
|
82
|
+
recordedResources: readRecordedResources(root, resources)
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function formatProjectInfo(info) {
|
|
86
|
+
if (info.resources.length === 0 && info.recordedResources.length === 0) return "No persistent resource definitions found in this project.";
|
|
87
|
+
return [info.resources.map((resource) => {
|
|
88
|
+
const lines = [
|
|
89
|
+
resource.file,
|
|
90
|
+
` ${resource.nameSource === "inferred" ? "Inferred" : "Explicit"} name: ${resource.name}`,
|
|
91
|
+
` Class: ${resource.className}`,
|
|
92
|
+
` Binding: ${resource.bindingName}`
|
|
93
|
+
];
|
|
94
|
+
if (resource.nameSource === "inferred") lines.push(` To preserve this resource when moving its code, add this to '${resource.definition}':`, ` name: ${JSON.stringify(resource.name)},`);
|
|
95
|
+
else lines.push(" Keep this name when moving its code to preserve the resource.");
|
|
96
|
+
return lines.join("\n");
|
|
97
|
+
}).join("\n\n"), info.recordedResources.map((resource) => {
|
|
98
|
+
const lines = [
|
|
99
|
+
"Recorded in void.lock.json (no matching source definition)",
|
|
100
|
+
` Class: ${resource.className}`,
|
|
101
|
+
` Binding: ${resource.bindingName}`
|
|
102
|
+
];
|
|
103
|
+
if (resource.name !== void 0) lines.push(` If this is the resource you moved, use this name in its ${resource.definition} definition:`, ` name: ${JSON.stringify(resource.name)},`);
|
|
104
|
+
else lines.push(" Restore the original definition from source history and run void info to discover its name.");
|
|
105
|
+
return lines.join("\n");
|
|
106
|
+
}).join("\n\n")].filter(Boolean).join("\n\n");
|
|
107
|
+
}
|
|
108
|
+
async function runInfoCommand(root, args) {
|
|
109
|
+
const info = getProjectInfo(root);
|
|
110
|
+
console.log(args.json ? JSON.stringify(info, null, 2) : formatProjectInfo(info));
|
|
111
|
+
}
|
|
112
|
+
//#endregion
|
|
113
|
+
export { runInfoCommand };
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { a as join, i as isAbsolute, l as relative, n as dirname, t as basename, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
2
|
+
import { r as detectFramework } from "./plugin-inference-CXWnn79A.mjs";
|
|
2
3
|
import { n as readProjectPaths, o as TYPED_CONFIG_FILE } from "./project-paths-GgcMozYz.mjs";
|
|
3
|
-
import { c as getToken, u as isStagingMode } from "./auth-DLNN0D3Z.mjs";
|
|
4
|
-
import { d as writeProjectConfig, i as readDeploymentPlatform, l as writeDeploymentPlatform, o as readProjectConfig, t as attachSelectedPlatform } from "./project-C0Fqu05O.mjs";
|
|
5
4
|
import { m as readConfig, u as getDatabaseDialect } from "./config-Br_JZD6u.mjs";
|
|
6
|
-
import {
|
|
5
|
+
import { l as writeProjectConfig, n as readDeploymentPlatform, r as readProjectConfig, s as writeDeploymentPlatform, t as attachSelectedPlatform } from "./project-DKG5Ra8p.mjs";
|
|
6
|
+
import { c as getToken } from "./auth-CQkSDS50.mjs";
|
|
7
|
+
import { r as materializeCloudflareConfig } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
8
|
+
import { A as writeProvisionedWranglerConfig, i as LATEST_KNOWN_COMPAT_DATE } from "./wrangler-7K-bW_DL.mjs";
|
|
7
9
|
import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-B8GeM0RM.mjs";
|
|
8
|
-
import { r as detectFramework } from "./plugin-inference-BMfKRSqE.mjs";
|
|
9
10
|
import { n as parseDotenvFile, t as expandDotenv } from "./dotenv-VQxupEUv.mjs";
|
|
10
11
|
import { t as MagicString } from "./dist-AoCzRTJE.mjs";
|
|
11
|
-
import {
|
|
12
|
+
import { A as confirm, B as note, H as outro, K as select, L as log, N as intro, O as cancel, X as text, tt as isCancel } from "./prompts-BNUoTiaf.mjs";
|
|
12
13
|
import { t as writeDrizzleConfig } from "./config-D8MOgiQV.mjs";
|
|
13
14
|
import { n as getPackageDir, t as detectAgents } from "./agents-B_pX_HmQ.mjs";
|
|
14
|
-
import { n as PlatformClient } from "./client-
|
|
15
|
-
import {
|
|
15
|
+
import { n as PlatformClient } from "./client-DKAsFA4X.mjs";
|
|
16
|
+
import { o as formatProjectCommand } from "./cloudflare-process-B-wekeR6.mjs";
|
|
16
17
|
import { n as writeVoidProjectConfig, t as canRewriteVoidProjectConfig } from "./config-write-B1f88wJA.mjs";
|
|
17
|
-
import { i as migrateFrameworkAdapterPaths, t as migrateLegacyVoidConfig } from "./migrate-
|
|
18
|
-
import { r as cliTitle } from "./output-
|
|
19
|
-
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-
|
|
20
|
-
import { t as promptForLoginToken } from "./login-
|
|
21
|
-
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-
|
|
22
|
-
import { t as connectCloudflare } from "./cloudflare-connect-
|
|
18
|
+
import { i as migrateFrameworkAdapterPaths, t as migrateLegacyVoidConfig } from "./migrate-q4_njtaW.mjs";
|
|
19
|
+
import { r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
20
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-CYOOAYcn.mjs";
|
|
21
|
+
import { t as promptForLoginToken } from "./login-BuiMyUrx.mjs";
|
|
22
|
+
import { i as saveDiscoveredPlatform, t as discoverPlatform } from "./platform-cmd-DMDEc9uS.mjs";
|
|
23
|
+
import { t as connectCloudflare } from "./cloudflare-connect-IiR3ZieC.mjs";
|
|
23
24
|
import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-BV4AzNul.mjs";
|
|
24
25
|
import { createRequire } from "node:module";
|
|
25
26
|
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -33,7 +34,7 @@ async function ensureToken(root) {
|
|
|
33
34
|
const existing = getToken(root);
|
|
34
35
|
if (existing) return existing;
|
|
35
36
|
const token = await promptForLoginToken(root);
|
|
36
|
-
log.success(
|
|
37
|
+
log.success("Token saved.");
|
|
37
38
|
return token;
|
|
38
39
|
}
|
|
39
40
|
async function maybeSetupDeployProject(root) {
|
|
@@ -411,6 +412,7 @@ function getIndexServer() {
|
|
|
411
412
|
return `import { defineHandler, type InferProps } from "void";
|
|
412
413
|
import { db, desc } from "void/db";
|
|
413
414
|
import { messages } from "@schema";
|
|
415
|
+
import { createInsertSchema } from "void/drizzle-zod";
|
|
414
416
|
|
|
415
417
|
export type Props = InferProps<typeof loader>;
|
|
416
418
|
|
|
@@ -418,6 +420,11 @@ export const loader = defineHandler(async () => {
|
|
|
418
420
|
const rows = await db.select().from(messages).orderBy(desc(messages.id));
|
|
419
421
|
return { messages: rows };
|
|
420
422
|
});
|
|
423
|
+
export const action = defineHandler.withValidator({
|
|
424
|
+
body: createInsertSchema(messages, { text: schema => schema.trim().min(1).max(1000) }).pick({ text: true }),
|
|
425
|
+
})(async (_c, { body }) => {
|
|
426
|
+
await db.insert(messages).values(body);
|
|
427
|
+
});
|
|
421
428
|
`;
|
|
422
429
|
}
|
|
423
430
|
function getHelloRoute(frameworkLabel, starterMode) {
|
|
@@ -523,9 +530,11 @@ function getIndexPage(framework, starterMode) {
|
|
|
523
530
|
`;
|
|
524
531
|
}
|
|
525
532
|
switch (framework) {
|
|
526
|
-
case "react": return `import
|
|
533
|
+
case "react": return `import { Form, useForm } from "${SCAFFOLD_FRAMEWORKS[framework].adapterPackage}";
|
|
534
|
+
import type { Props } from "./index.server";
|
|
527
535
|
|
|
528
536
|
export default function HomePage({ messages }: Props) {
|
|
537
|
+
const form = useForm("/", { text: "" });
|
|
529
538
|
return (
|
|
530
539
|
<main>
|
|
531
540
|
<h1>Welcome to Void</h1>
|
|
@@ -552,14 +561,20 @@ export default function HomePage({ messages }: Props) {
|
|
|
552
561
|
))}
|
|
553
562
|
</ul>
|
|
554
563
|
)}
|
|
564
|
+
<Form form={form}>
|
|
565
|
+
<label>Message <input value={form.data.text} onChange={event => form.setData("text", event.target.value)} /></label>
|
|
566
|
+
<button disabled={form.pending}>Add message</button>
|
|
567
|
+
</Form>
|
|
555
568
|
</main>
|
|
556
569
|
);
|
|
557
570
|
}
|
|
558
571
|
`;
|
|
559
572
|
case "vue": return `<script setup lang="ts">
|
|
560
573
|
import type { Props } from "./index.server";
|
|
574
|
+
import { Form, useForm } from "@void/vue";
|
|
561
575
|
|
|
562
576
|
defineProps<Props>();
|
|
577
|
+
const form = useForm("/", { text: "" });
|
|
563
578
|
<\/script>
|
|
564
579
|
|
|
565
580
|
<template>
|
|
@@ -583,11 +598,17 @@ defineProps<Props>();
|
|
|
583
598
|
<small>{{ String(message.createdAt) }}</small>
|
|
584
599
|
</li>
|
|
585
600
|
</ul>
|
|
601
|
+
<Form :form="form">
|
|
602
|
+
<label>Message <input v-model="form.data.text" /></label>
|
|
603
|
+
<button :disabled="form.pending">Add message</button>
|
|
604
|
+
</Form>
|
|
586
605
|
</main>
|
|
587
606
|
</template>
|
|
588
607
|
`;
|
|
589
608
|
case "svelte": return `<script lang="ts">
|
|
590
609
|
import type { Props } from "./index.server";
|
|
610
|
+
import { Form, useForm } from "@void/svelte";
|
|
611
|
+
const form = useForm("/", { text: "" });
|
|
591
612
|
|
|
592
613
|
let { messages }: Props = $props();
|
|
593
614
|
<\/script>
|
|
@@ -617,11 +638,17 @@ defineProps<Props>();
|
|
|
617
638
|
{/each}
|
|
618
639
|
</ul>
|
|
619
640
|
{/if}
|
|
641
|
+
<Form {form}>
|
|
642
|
+
<label>Message <input bind:value={form.data.text} /></label>
|
|
643
|
+
<button disabled={form.pending}>Add message</button>
|
|
644
|
+
</Form>
|
|
620
645
|
</main>
|
|
621
646
|
`;
|
|
622
|
-
case "solid": return `import
|
|
647
|
+
case "solid": return `import { Form, useForm } from "${SCAFFOLD_FRAMEWORKS[framework].adapterPackage}";
|
|
648
|
+
import type { Props } from "./index.server";
|
|
623
649
|
|
|
624
650
|
export default function HomePage(props: Props) {
|
|
651
|
+
const form = useForm("/", { text: "" });
|
|
625
652
|
return (
|
|
626
653
|
<main>
|
|
627
654
|
<h1>Welcome to Void</h1>
|
|
@@ -648,6 +675,10 @@ export default function HomePage(props: Props) {
|
|
|
648
675
|
))}
|
|
649
676
|
</ul>
|
|
650
677
|
)}
|
|
678
|
+
<Form form={form}>
|
|
679
|
+
<label>Message <input value={form.data.text} onInput={event => form.setData("text", event.target.value)} /></label>
|
|
680
|
+
<button disabled={form.pending}>Add message</button>
|
|
681
|
+
</Form>
|
|
651
682
|
</main>
|
|
652
683
|
);
|
|
653
684
|
}
|
|
@@ -1071,11 +1102,12 @@ async function resolveInitRoot(root) {
|
|
|
1071
1102
|
process.exit(0);
|
|
1072
1103
|
}
|
|
1073
1104
|
if (choice === "current") return root;
|
|
1105
|
+
const defaultFolder = "my-void-app";
|
|
1074
1106
|
const folder = await text({
|
|
1075
1107
|
message: "New project folder name:",
|
|
1076
|
-
placeholder:
|
|
1077
|
-
|
|
1078
|
-
validate: (value) => validateSubfolderName(root, value)
|
|
1108
|
+
placeholder: defaultFolder,
|
|
1109
|
+
defaultValue: defaultFolder,
|
|
1110
|
+
validate: (value) => validateSubfolderName(root, value || defaultFolder)
|
|
1079
1111
|
});
|
|
1080
1112
|
if (isCancel(folder) || typeof folder === "symbol") {
|
|
1081
1113
|
cancel("Setup cancelled.");
|
|
@@ -1901,11 +1933,11 @@ async function ensureVoidPlatformConnection(root) {
|
|
|
1901
1933
|
let selectedApiUrl = null;
|
|
1902
1934
|
let promptedForPlatform = false;
|
|
1903
1935
|
try {
|
|
1904
|
-
const { getApiUrl, getSiteDomain } = await import("./auth-
|
|
1936
|
+
const { getApiUrl, getSiteDomain } = await import("./auth-DX3JURcX.mjs");
|
|
1905
1937
|
selectedApiUrl = getApiUrl(root);
|
|
1906
1938
|
getSiteDomain(root);
|
|
1907
1939
|
} catch (error) {
|
|
1908
|
-
if (!(error instanceof Error) || !error.message.includes("No Void platform
|
|
1940
|
+
if (!(error instanceof Error) || !error.message.includes("No Void platform connected")) throw error;
|
|
1909
1941
|
}
|
|
1910
1942
|
if (!selectedApiUrl) {
|
|
1911
1943
|
promptedForPlatform = true;
|
|
@@ -1945,7 +1977,6 @@ function getNodeVersionLine(root) {
|
|
|
1945
1977
|
if (existsSync(join(root, ".node-version"))) return "node-version-file: .node-version";
|
|
1946
1978
|
return "node-version: lts/*";
|
|
1947
1979
|
}
|
|
1948
|
-
const WORKFLOW_DEFAULT_API_URL = "https://api.void.cloud";
|
|
1949
1980
|
function getWorkflowSetupSteps(root, pm) {
|
|
1950
1981
|
const nodeVersion = getNodeVersionLine(root);
|
|
1951
1982
|
switch (pm) {
|
|
@@ -1994,7 +2025,7 @@ function getWorkflowSetupSteps(root, pm) {
|
|
|
1994
2025
|
* otherwise a `${{ vars.VOID_PROJECT }}` placeholder is emitted with a comment
|
|
1995
2026
|
* telling the user to set the repository variable.
|
|
1996
2027
|
*/
|
|
1997
|
-
function getWorkflowYaml(root, pm, slug, platform = "void", platformApiUrl
|
|
2028
|
+
function getWorkflowYaml(root, pm, slug, platform = "void", platformApiUrl) {
|
|
1998
2029
|
const { setup, install, runner } = getWorkflowSetupSteps(root, pm);
|
|
1999
2030
|
if (platform === "cloudflare") return `name: Deploy to Cloudflare
|
|
2000
2031
|
on:
|
|
@@ -2028,6 +2059,7 @@ ${install}
|
|
|
2028
2059
|
CF_ACCESS_CLIENT_SECRET: \${{ secrets.CF_ACCESS_CLIENT_SECRET }}
|
|
2029
2060
|
run: ${runner} deploy --platform cloudflare
|
|
2030
2061
|
`;
|
|
2062
|
+
if (!platformApiUrl) throw new Error("init: Connect to a Void platform before generating a deployment workflow. Run `void connect <url>` first.");
|
|
2031
2063
|
return `name: Deploy to Void
|
|
2032
2064
|
on:
|
|
2033
2065
|
push:
|
|
@@ -2063,10 +2095,12 @@ jobs:
|
|
|
2063
2095
|
${setup}
|
|
2064
2096
|
${install}
|
|
2065
2097
|
- name: Deploy
|
|
2066
|
-
run:
|
|
2098
|
+
run: |
|
|
2099
|
+
${runner} connect "$VOID_API_URL" --no-login
|
|
2100
|
+
${runner} deploy --platform void --project "$VOID_PROJECT"
|
|
2067
2101
|
`;
|
|
2068
2102
|
}
|
|
2069
|
-
function setupGithubActions(root, state, platform = "void", platformApiUrl
|
|
2103
|
+
function setupGithubActions(root, state, platform = "void", platformApiUrl) {
|
|
2070
2104
|
const workflowDir = join(root, ".github", "workflows");
|
|
2071
2105
|
const workflowPath = join(workflowDir, "void-deploy.yml");
|
|
2072
2106
|
if (existsSync(workflowPath)) {
|
|
@@ -2646,7 +2680,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2646
2680
|
injectAgentBlock(root);
|
|
2647
2681
|
const agents = detectAgents(root);
|
|
2648
2682
|
if (agents.length > 0) {
|
|
2649
|
-
const { linkSkillsForSpecificAgents } = await import("./skills-
|
|
2683
|
+
const { linkSkillsForSpecificAgents } = await import("./skills-C1PlclPt.mjs");
|
|
2650
2684
|
linkSkillsForSpecificAgents(root, agents);
|
|
2651
2685
|
} else log.info("No coding agent detected; read the bundled docs linked in AGENTS.md");
|
|
2652
2686
|
}
|
|
@@ -2680,7 +2714,7 @@ async function runInitCommand(root, initArgs) {
|
|
|
2680
2714
|
let shouldSetupGithub = targeted ? initArgs?.github === true : deploymentPlatform !== "none";
|
|
2681
2715
|
if (shouldSetupGithub && !githubStepSkipForSubpackage && deploymentPlatform !== "cloudflare" && deploymentPlatform !== "none") {
|
|
2682
2716
|
if (!voidPlatformDiscovery) {
|
|
2683
|
-
const { getApiUrl } = await import("./auth-
|
|
2717
|
+
const { getApiUrl } = await import("./auth-DX3JURcX.mjs");
|
|
2684
2718
|
voidPlatformDiscovery = await discoverPlatform(getApiUrl(root));
|
|
2685
2719
|
}
|
|
2686
2720
|
if (!voidPlatformDiscovery.capabilities.githubActions) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { UsageLimitData, UsageLimitData as UsageLimitData$1, readUsageLimit as readUsageLimit$1 } from "@void/edge";
|
|
2
|
+
//#region src/runtime/limits.d.ts
|
|
3
|
+
declare class UsageLimit extends Error {
|
|
4
|
+
override readonly name: string;
|
|
5
|
+
readonly code: "usage_limit";
|
|
6
|
+
readonly resource: UsageLimitData["resource"];
|
|
7
|
+
readonly reason: UsageLimitData["reason"];
|
|
8
|
+
readonly retryAt?: string;
|
|
9
|
+
constructor(data: Omit<UsageLimitData, "code">);
|
|
10
|
+
response(options?: {
|
|
11
|
+
message?: string;
|
|
12
|
+
}): Response;
|
|
13
|
+
getResponse(): Response;
|
|
14
|
+
}
|
|
15
|
+
type LimitHandlers<T, R, L> = {
|
|
16
|
+
ok(value: T): R | Promise<R>;
|
|
17
|
+
limited(limit: UsageLimit): L | Promise<L>;
|
|
18
|
+
};
|
|
19
|
+
interface LimitOperation<T> {
|
|
20
|
+
match<R, L>(handlers: LimitHandlers<T, R, L>): Promise<R | L>;
|
|
21
|
+
}
|
|
22
|
+
/** Lazy, single-execution operation. Quota callbacks never catch failures from the user's ok handler. */
|
|
23
|
+
declare function limitOperation<T>(execute: () => Promise<T>, classify?: (error: unknown) => UsageLimit | null, prepare?: (value: T, limited: (limit: UsageLimit) => unknown) => T): LimitOperation<T>;
|
|
24
|
+
declare function asUsageLimit(error: unknown): UsageLimit | null;
|
|
25
|
+
declare function limitFromResponse(response: Response, resource: UsageLimitData["resource"]): Promise<UsageLimit | null>;
|
|
26
|
+
//#endregion
|
|
27
|
+
export { asUsageLimit as a, readUsageLimit$1 as c, UsageLimitData$1 as i, LimitOperation as n, limitFromResponse as o, UsageLimit as r, limitOperation as s, LimitHandlers as t };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { readUsageLimit, readUsageLimit as readUsageLimit$1, usageLimitResponse } from "@void/edge";
|
|
2
|
+
//#region src/runtime/limits.ts
|
|
3
|
+
var UsageLimit = class extends Error {
|
|
4
|
+
name = "UsageLimit";
|
|
5
|
+
code = "usage_limit";
|
|
6
|
+
resource;
|
|
7
|
+
reason;
|
|
8
|
+
retryAt;
|
|
9
|
+
constructor(data) {
|
|
10
|
+
super(data.message);
|
|
11
|
+
this.resource = data.resource;
|
|
12
|
+
this.reason = data.reason;
|
|
13
|
+
this.retryAt = data.retryAt;
|
|
14
|
+
}
|
|
15
|
+
response(options = {}) {
|
|
16
|
+
return usageLimitResponse({
|
|
17
|
+
code: this.code,
|
|
18
|
+
resource: this.resource,
|
|
19
|
+
reason: this.reason,
|
|
20
|
+
message: options.message ?? this.message,
|
|
21
|
+
...this.retryAt ? { retryAt: this.retryAt } : {}
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getResponse() {
|
|
25
|
+
return this.response();
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
/** Lazy, single-execution operation. Quota callbacks never catch failures from the user's ok handler. */
|
|
29
|
+
function limitOperation(execute, classify = asUsageLimit, prepare) {
|
|
30
|
+
let result;
|
|
31
|
+
return Object.freeze({
|
|
32
|
+
get then() {
|
|
33
|
+
throw new TypeError("Use .match({ ok, limited }) to execute this operation.");
|
|
34
|
+
},
|
|
35
|
+
async match(handlers) {
|
|
36
|
+
if (typeof handlers?.ok !== "function" || typeof handlers?.limited !== "function") throw new TypeError("Both ok and limited handlers are required.");
|
|
37
|
+
let value;
|
|
38
|
+
try {
|
|
39
|
+
value = await (result ??= Promise.resolve().then(execute));
|
|
40
|
+
} catch (error) {
|
|
41
|
+
const limit = classify(error);
|
|
42
|
+
if (limit) return handlers.limited(limit);
|
|
43
|
+
throw error;
|
|
44
|
+
}
|
|
45
|
+
return handlers.ok(prepare ? prepare(value, handlers.limited) : value);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
function asUsageLimit(error) {
|
|
50
|
+
if (error instanceof UsageLimit) return error;
|
|
51
|
+
const data = readUsageLimit(error);
|
|
52
|
+
return data ? new UsageLimit(data) : null;
|
|
53
|
+
}
|
|
54
|
+
async function limitFromResponse(response, resource) {
|
|
55
|
+
if (response.status !== 429) return null;
|
|
56
|
+
const data = readUsageLimit(await response.clone().json().catch(() => null));
|
|
57
|
+
if (data) return new UsageLimit(data);
|
|
58
|
+
const retry = response.headers.get("retry-after");
|
|
59
|
+
const retryTime = retry === null ? NaN : /^\d+$/.test(retry) ? Date.now() + Number(retry) * 1e3 : Date.parse(retry);
|
|
60
|
+
return new UsageLimit({
|
|
61
|
+
resource,
|
|
62
|
+
reason: "rate_limit",
|
|
63
|
+
message: `${resource === "ai" ? "AI" : "Service"} is temporarily unavailable because its usage limit was reached.`,
|
|
64
|
+
...Number.isFinite(retryTime) ? { retryAt: new Date(retryTime).toISOString() } : {}
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { readUsageLimit$1 as a, limitOperation as i, asUsageLimit as n, limitFromResponse as r, UsageLimit as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as PlatformClient } from "./client-
|
|
5
|
-
import { c as import_picocolors, r as cliTitle } from "./output-
|
|
6
|
-
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-
|
|
1
|
+
import { l as writeProjectConfig, r as readProjectConfig, t as attachSelectedPlatform } 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, O as cancel } from "./prompts-BNUoTiaf.mjs";
|
|
4
|
+
import { n as PlatformClient } from "./client-DKAsFA4X.mjs";
|
|
5
|
+
import { c as import_picocolors, r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
6
|
+
import { a as promptProjectSelection, r as promptAndCreateProject } from "./create-project-CYOOAYcn.mjs";
|
|
7
7
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
8
8
|
//#region src/cli/link.ts
|
|
9
9
|
function projectLabel(slug, root, url) {
|
|
@@ -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, o as ensureUtc, r as cliTitle } from "./output-
|
|
1
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DKG5Ra8p.mjs";
|
|
2
|
+
import { c as getToken } 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, o as ensureUtc, r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
6
6
|
import { r as resolveProjectBySlug } from "./resolve-project-BG5ORGID.mjs";
|
|
7
7
|
//#region src/cli/list.ts
|
|
8
8
|
async function runListCommand(root, slug) {
|
|
@@ -43,7 +43,7 @@ async function runListCommand(root, slug) {
|
|
|
43
43
|
}
|
|
44
44
|
async function showCloudflareDeployments(root, slug) {
|
|
45
45
|
if (slug) throw new Error("project: A project name selects a Void platform project and is not used for direct Cloudflare apps.");
|
|
46
|
-
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-
|
|
46
|
+
const { readCloudflareWorkerStatus, resolveCloudflareOperationContext } = await import("./cloudflare-operations-BCdXSsmo.mjs");
|
|
47
47
|
const status = await readCloudflareWorkerStatus(resolveCloudflareOperationContext(root));
|
|
48
48
|
if (status.versions.length === 0) {
|
|
49
49
|
outro(`No deployments for ${status.workerName}.`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as AuthUser } from "./auth-DkcFflXV.mjs";
|
|
2
|
-
import { a as CloudEnv, r as CloudContext } from "./handler-
|
|
2
|
+
import { a as CloudEnv, r as CloudContext } from "./handler-CZ4nAylQ.mjs";
|
|
3
3
|
//#region src/runtime/live.d.ts
|
|
4
4
|
type MaybePromise<T> = T | Promise<T>;
|
|
5
5
|
type LiveControlRequest = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join, i as isAbsolute, u as resolve } from "./dist-BVqXeR_h.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { r as getMiniflareDatabasePath } from "./runner-
|
|
2
|
+
import { y as readRootWranglerConfig } from "./wrangler-7K-bW_DL.mjs";
|
|
3
|
+
import { r as getMiniflareDatabasePath } from "./runner-Ol0TNjk6.mjs";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
5
5
|
import { createHash } from "node:crypto";
|
|
6
6
|
//#region src/local-d1.ts
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { n as __toESM } from "./rolldown-runtime-DXIUcv95.mjs";
|
|
2
|
+
import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
|
|
3
|
+
//#region src/log.ts
|
|
4
|
+
var import_picocolors = /* @__PURE__ */ __toESM(require_picocolors(), 1);
|
|
5
|
+
const tag = import_picocolors.default.bold(import_picocolors.default.blue("[void]"));
|
|
6
|
+
const timeFormat = new Intl.DateTimeFormat(void 0, {
|
|
7
|
+
hour: "numeric",
|
|
8
|
+
minute: "numeric",
|
|
9
|
+
second: "numeric"
|
|
10
|
+
});
|
|
11
|
+
let showTimestamp = true;
|
|
12
|
+
function setShowTimestamp(value) {
|
|
13
|
+
showTimestamp = value;
|
|
14
|
+
}
|
|
15
|
+
function prefix() {
|
|
16
|
+
if (!showTimestamp) return tag;
|
|
17
|
+
return `${import_picocolors.default.dim(timeFormat.format())} ${tag}`;
|
|
18
|
+
}
|
|
19
|
+
function voidLog(msg) {
|
|
20
|
+
console.log(`${prefix()} ${msg}`);
|
|
21
|
+
}
|
|
22
|
+
function voidWarn(msg) {
|
|
23
|
+
console.log(`${prefix()} ${import_picocolors.default.yellow(msg)}`);
|
|
24
|
+
}
|
|
25
|
+
function voidError(msg) {
|
|
26
|
+
console.log(`${prefix()} ${import_picocolors.default.red(msg)}`);
|
|
27
|
+
}
|
|
28
|
+
//#endregion
|
|
29
|
+
export { voidWarn as i, voidError as n, voidLog as r, setShowTimestamp as t };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { i as isExpiredTokenError, n as PlatformClient } from "./client-
|
|
4
|
-
import { c as import_picocolors, i as createSpinner, r as cliTitle } from "./output-
|
|
1
|
+
import { a as getApiUrl, c as getToken, f as removeToken, g as saveToken, h as savePlatformToken, l as getTokenSource, m as runPlatformLogin, p as runLogin } from "./auth-CQkSDS50.mjs";
|
|
2
|
+
import { H as outro, K as select, L as log, N as intro, O as cancel, tt as isCancel } from "./prompts-BNUoTiaf.mjs";
|
|
3
|
+
import { i as isExpiredTokenError, n as PlatformClient } from "./client-DKAsFA4X.mjs";
|
|
4
|
+
import { c as import_picocolors, i as createSpinner, r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
5
5
|
//#region src/cli/login.ts
|
|
6
6
|
async function selectPlatformLoginMethod(platform, requestedId) {
|
|
7
7
|
const providers = platform?.authenticationProviders ?? ["github", "google"];
|
|
@@ -29,12 +29,12 @@ async function selectPlatformLoginMethod(platform, requestedId) {
|
|
|
29
29
|
return methods.find((method) => method.id === provider);
|
|
30
30
|
}
|
|
31
31
|
async function promptForLoginToken(root = process.cwd(), platform) {
|
|
32
|
-
const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-
|
|
32
|
+
const { id: provider, label: providerName } = await selectPlatformLoginMethod(platform ?? await import("./platform-cmd-pMTRhvYs.mjs").then(({ discoverPlatform }) => discoverPlatform(getApiUrl(root))));
|
|
33
33
|
const s = createSpinner();
|
|
34
34
|
s.start(`Opening browser for ${providerName} login...`);
|
|
35
35
|
try {
|
|
36
36
|
const onUrl = (url) => {
|
|
37
|
-
s.message(`Waiting for ${providerName} login. If your browser didn't open, visit:\n${import_picocolors.default.
|
|
37
|
+
s.message(`Waiting for ${providerName} login. If your browser didn't open, visit:\n${import_picocolors.default.blue(url)}`);
|
|
38
38
|
};
|
|
39
39
|
const token = platform ? await runPlatformLogin(platform.apiUrl, provider, onUrl) : await runLogin(root, provider, onUrl);
|
|
40
40
|
if (platform) savePlatformToken(token, platform.apiUrl);
|
|
@@ -77,10 +77,10 @@ async function runLoginCommand(root = process.cwd()) {
|
|
|
77
77
|
}
|
|
78
78
|
await promptForLoginToken(root);
|
|
79
79
|
if (expiredEnvToken) {
|
|
80
|
-
outro(
|
|
80
|
+
outro("Token saved. Unset `VOID_TOKEN` to use it.");
|
|
81
81
|
return;
|
|
82
82
|
}
|
|
83
|
-
outro(
|
|
83
|
+
outro("Token saved.");
|
|
84
84
|
}
|
|
85
85
|
//#endregion
|
|
86
86
|
export { runLoginCommand as n, selectPlatformLoginMethod as r, promptForLoginToken as t };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { n as PlatformClient } from "./client-
|
|
5
|
-
import { a as dim, c as import_picocolors, r as cliTitle } from "./output-
|
|
1
|
+
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-DKG5Ra8p.mjs";
|
|
2
|
+
import { c as getToken } from "./auth-CQkSDS50.mjs";
|
|
3
|
+
import { $ as wrapTextWithPrefix, 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, r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
6
6
|
//#region src/cli/logs.ts
|
|
7
7
|
async function runLogsCommand(root, filter, range, deployment, level) {
|
|
8
8
|
console.log();
|
|
9
9
|
intro(cliTitle("project logs"));
|
|
10
10
|
const platform = readDeploymentPlatform(root);
|
|
11
11
|
if (platform === "cloudflare") {
|
|
12
|
-
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-
|
|
12
|
+
const { resolveCloudflareOperationContext, tailCloudflareWorker } = await import("./cloudflare-operations-BCdXSsmo.mjs");
|
|
13
13
|
if (range !== "1h") log.warn("Cloudflare tail streams live logs; --range does not select historical entries.");
|
|
14
14
|
if (level && level !== "all" && level !== "error") log.warn("Cloudflare tail cannot filter individual console levels; showing all invocation logs.");
|
|
15
15
|
await tailCloudflareWorker(resolveCloudflareOperationContext(root), {
|
|
@@ -57,15 +57,14 @@ function printEntry(entry) {
|
|
|
57
57
|
const status = entry.status || "-";
|
|
58
58
|
const statusNum = parseInt(status, 10);
|
|
59
59
|
const coloredStatus = entry.outcome === "exception" || statusNum >= 500 ? import_picocolors.default.red(status) : statusNum >= 400 ? import_picocolors.default.yellow(status) : status;
|
|
60
|
-
console.log(
|
|
60
|
+
console.log(wrapTextWithPrefix(process.stdout, `${method} ${url} ${coloredStatus}`, " ".repeat(time.length + 1), `${dim(time)} `));
|
|
61
61
|
for (const l of entry.logs) {
|
|
62
62
|
const text = l.message.map(String).join(" ");
|
|
63
63
|
const level = l.level ?? "log";
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
else console.log(` ${dim(`[${level}]`)} ${text}`);
|
|
64
|
+
const marker = level === "error" ? import_picocolors.default.red(`[${level}]`) : level === "warn" ? import_picocolors.default.yellow(`[${level}]`) : dim(`[${level}]`);
|
|
65
|
+
console.log(wrapTextWithPrefix(process.stdout, text, " ".repeat(level.length + 5), ` ${marker} `));
|
|
67
66
|
}
|
|
68
|
-
for (const ex of entry.exceptions) console.log(` ${import_picocolors.default.red("[exception]")}
|
|
67
|
+
for (const ex of entry.exceptions) console.log(wrapTextWithPrefix(process.stdout, `${ex.name}: ${ex.message}`, " ".repeat(14), ` ${import_picocolors.default.red("[exception]")} `));
|
|
69
68
|
}
|
|
70
69
|
function formatTime(ts) {
|
|
71
70
|
return new Date(ts).toLocaleTimeString("en-GB", { hour12: false });
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { a as join, n as dirname } from "./dist-BVqXeR_h.mjs";
|
|
2
2
|
import { o as TYPED_CONFIG_FILE, s as loadTypedVoidConfigFile } from "./project-paths-GgcMozYz.mjs";
|
|
3
3
|
import { g as validateConfig } from "./config-Br_JZD6u.mjs";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import { n as VOID_LOCK_FILE, o as seedCloudflareConfig, s as stashCloudflareDeployPointer } from "./cloudflare-config-Bktvwtpf.mjs";
|
|
5
|
+
import "./wrangler-7K-bW_DL.mjs";
|
|
6
|
+
import { H as outro, L as log, N as intro } from "./prompts-BNUoTiaf.mjs";
|
|
7
|
+
import { r as cliTitle } from "./output-CbM85T4k.mjs";
|
|
7
8
|
import { existsSync, mkdirSync, readFileSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
|
|
8
9
|
import { parseSync } from "vite";
|
|
9
10
|
import { randomUUID } from "node:crypto";
|