void 1.1.11 → 1.2.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/dist/{account-cmd-R35a4Oa8.mjs → account-cmd-CdUll_35.mjs} +5 -5
- package/dist/action-key-XZ9HkWAO.mjs +26 -0
- package/dist/{application-analysis-D7nNmNJb.mjs → application-analysis-fEqoSeMp.mjs} +11 -11
- package/dist/{application-routing-CZH66gXn.mjs → application-routing-DAhNP4u3.mjs} +1 -1
- package/dist/{ast-CPGPjb0V.mjs → ast-CsZ_q_gc.mjs} +6 -1
- package/dist/ast-bindings-C3yaPs1y.mjs +296 -0
- package/dist/{auth-link-VHmiKZmP.mjs → auth-link-C87vGXM-.mjs} +5 -5
- package/dist/{auth-router-O_Wrs5kg.mjs → auth-router-6I81r-ix.mjs} +3 -3
- package/dist/{better-auth-shared-Bv18bB-l.d.mts → better-auth-shared-DVk2DkTW.d.mts} +1 -1
- package/dist/{build-cmd-CMZiMn46.mjs → build-cmd-ex1g-j_e.mjs} +4 -4
- package/dist/{cache-TZ5Ab3d7.mjs → cache-oHzrnY3z.mjs} +4 -4
- package/dist/{cancel-deploy-DXoR6oC3.mjs → cancel-deploy-viAMD0Q_.mjs} +3 -3
- package/dist/cf-build-output-BJHuSsVN.mjs +1 -0
- package/dist/{cf-build-output-Bc8i3dzE.mjs → cf-build-output-BhVxldCw.mjs} +75 -10
- package/dist/{cf-user-agent-ChjQp2MU.mjs → cf-command-values-ByHk0xg4.mjs} +6 -16
- package/dist/cf-worker-settings-BECvvTVd.mjs +37 -0
- package/dist/cli/cli.mjs +139 -35
- package/dist/cli/cloudflare-operation-process.mjs +65 -18
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +3 -3
- package/dist/{client-GuSO3v_x.mjs → client-BEkdj1kx.mjs} +58 -13
- package/dist/client-BiRDZTSd.mjs +1 -0
- package/dist/{cloudflare-auth-DSvBc1Gu.mjs → cloudflare-auth-Byo_0_N9.mjs} +1 -1
- package/dist/{cloudflare-cmd-ZSErUl6Y.mjs → cloudflare-cmd-DMzCv12s.mjs} +5 -5
- package/dist/{cloudflare-config-rdFOys4X.mjs → cloudflare-config-DchHxPTo.mjs} +1 -1
- package/dist/{cloudflare-connect-BN-k2kD-.mjs → cloudflare-connect-CCRTVg-I.mjs} +3 -3
- package/dist/{cloudflare-operations-DH3GedbV.mjs → cloudflare-operations-Dh9dEHJj.mjs} +17 -7
- package/dist/{cloudflare-operations-Cm8lVx7W.mjs → cloudflare-operations-DsSaw2BT.mjs} +1 -1
- package/dist/{cloudflare-process-CZJ4viYl.mjs → cloudflare-process-8jEYIeim.mjs} +3 -2
- package/dist/{config-DC5llZaI.mjs → config-BIaXIkkv.mjs} +8 -3
- package/dist/{config-DYJV8aEH.mjs → config-BU6hMu1W.mjs} +1 -1
- package/dist/{config-D26zcdKy.mjs → config-DHgSEWT7.mjs} +39 -6
- package/dist/{config-7qoq2p9v.d.mts → config-DQfHOKh9.d.mts} +10 -1
- package/dist/config-entry.d.mts +1 -1
- package/dist/{connect-yQuLbuiJ.mjs → connect-k7R2rPVA.mjs} +6 -6
- package/dist/{create-project-CGOo_OL_.mjs → create-project-DTuy-l0z.mjs} +1 -1
- package/dist/{create-project-DEEWJX_M.mjs → create-project-DV71ol5d.mjs} +4 -4
- package/dist/{db-COI-yTJE.mjs → db-DVOkLH5X.mjs} +79 -23
- package/dist/{delete-PgN6L_9N.mjs → delete-BbP5eopu.mjs} +4 -4
- package/dist/{deploy-DsW-PrRQ.mjs → deploy-7H32EnUs.mjs} +220 -95
- package/dist/deploy-CE0Ev0Ob.mjs +2 -0
- package/dist/{deploy-managed-static-Dqz06S2u.mjs → deploy-managed-static-DlvcvnQT.mjs} +74 -28
- package/dist/{deploy-transport-nY3vLXPL.mjs → deploy-transport-BzGEj0Ge.mjs} +2 -2
- package/dist/deploy.d.mts +22 -1
- package/dist/deploy.mjs +49 -8
- package/dist/{dev-inbox-Rd6j_8vM.mjs → dev-inbox-D0jxye_D.mjs} +1 -1
- package/dist/{dispatch-BAbbn3jg.mjs → dispatch-DoUnxTNo.mjs} +15 -11
- package/dist/{dist-CfgIkieS.mjs → dist-B1PLt4_8.mjs} +1 -1
- package/dist/{dist-BVdsO7Py.mjs → dist-Cor9XGoz.mjs} +94 -200
- package/dist/{dist-Bn8Kodjp.mjs → dist-D15hFhP0.mjs} +1 -1
- package/dist/{domain-DKlNI0SR.mjs → domain-CA2wBgra.mjs} +5 -5
- package/dist/drizzle-9TubSZvI.mjs +1 -0
- package/dist/{email-BcjSyAL0.mjs → email-B9ayYQEG.mjs} +1 -1
- package/dist/{email-C0s3OvJk.mjs → email-DXpCc77w.mjs} +10 -10
- package/dist/{email-cloudflare-etpKiITL.mjs → email-cloudflare-D03g2TkS.mjs} +7 -7
- package/dist/{entry-B_0IhV64.mjs → entry-BEM8ZuGP.mjs} +40 -12
- package/dist/{env-BX2JFsgF.mjs → env-DgOQ9_8S.mjs} +6 -6
- package/dist/{env-public-CCdykygU.d.mts → env-public-6lqiSD2b.d.mts} +1 -0
- package/dist/{env-types-GRchm5dw.mjs → env-types-BicfKBhV.mjs} +1 -1
- package/dist/{env-validation-CuGfWRJd.mjs → env-validation-BmsdCZEk.mjs} +1 -1
- package/dist/{env-validation-D_KyMdab.mjs → env-validation-Dwq3PJzK.mjs} +3 -3
- package/dist/{fetch-DHLOuPyk.d.mts → fetch-CUX0tB78.d.mts} +14 -1
- package/dist/fetch-CtESUYWd.mjs +26 -0
- package/dist/{fetch-error-Dj3crt0e.mjs → fetch-error-Bw0n-IY-.mjs} +1 -1
- package/dist/{fetch-stream-PGgz4uGz.mjs → fetch-stream-BspOeTAI.mjs} +1 -1
- package/dist/{fetch-stream-CNxOrBdP.d.mts → fetch-stream-DfkAzZf-.d.mts} +1 -1
- package/dist/{gen-Bj6ZkOcI.mjs → gen-BfmcIi2g.mjs} +5 -5
- package/dist/gen-NrOlWZaG.mjs +1 -0
- package/dist/{github-cmd-DQDryS-5.mjs → github-cmd-CY9LUqLh.mjs} +4 -4
- package/dist/{handler-_PqY82xe.d.mts → handler-BbkSPzGF.d.mts} +91 -9
- package/dist/{headers-Bi4bOAwp.mjs → headers-D522zd0A.mjs} +2 -2
- package/dist/help-BeAFFE5C.mjs +1 -0
- package/dist/{help-D49SL_lN.mjs → help-CxSlPpzJ.mjs} +83 -12
- package/dist/{inbound-BuTfm11U.mjs → inbound-VrOLqwZY.mjs} +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +125 -124
- package/dist/{info-Bxunp14X.mjs → info-7VDlhtyy.mjs} +4 -4
- package/dist/{init-DyTEY04s.mjs → init-DxYyOs4-.mjs} +103 -43
- package/dist/{link-CgOVn9EC.mjs → link-Ddmod1dZ.mjs} +5 -5
- package/dist/{list-CUfD9RSb.mjs → list-MogaugiO.mjs} +5 -5
- package/dist/{live-DJONVlQK.d.mts → live-Bt8Y_0bg.d.mts} +1 -1
- package/dist/{local-d1-CpaPbd_L.mjs → local-d1-BHBnKWRb.mjs} +1 -1
- package/dist/{log-vqY3pqwI.mjs → log-BMwmN5Ae.mjs} +2 -2
- package/dist/{login-BJvGW5Eu.mjs → login-Cttnagmm.mjs} +4 -4
- package/dist/login-DgDwlKc_.mjs +1 -0
- package/dist/{logs-DeizBI4j.mjs → logs-CAszUWZI.mjs} +4 -4
- package/dist/{migrate-8rk56vV8.mjs → migrate-DyT2jJ8y.mjs} +5 -5
- package/dist/migrate-n49ZeS1X.mjs +1 -0
- package/dist/{mime-srOklVVv.mjs → mime-BAyHPskU.mjs} +1 -1
- package/dist/nitro.mjs +3 -3
- package/dist/{node-uN8_zxJr.mjs → node-WB7c2N4L.mjs} +2 -2
- package/dist/operator-cmd-d2MvJOrl.mjs +1 -0
- package/dist/{operator-cmd-CA5QQyvE.mjs → operator-cmd-skshjMGl.mjs} +4 -4
- package/dist/output-BW9uK099.mjs +1 -0
- package/dist/{output-Ba6ZbrzY.mjs → output-BpgYODYx.mjs} +16 -4
- package/dist/pages/client.d.mts +2 -2
- package/dist/pages/client.mjs +48 -25
- package/dist/pages/index.d.mts +2 -2
- package/dist/pages/index.mjs +4 -4
- package/dist/pages/islands-plugin.d.mts +43 -5
- package/dist/pages/islands-plugin.mjs +100 -28
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/pages/serialize.d.mts +2 -2
- package/dist/pages/serialize.mjs +1 -1
- package/dist/{parse-filename-CUbj-1MP.mjs → parse-filename-DioPHiR9.mjs} +1 -35
- package/dist/{picocolors-BTps1_gs.mjs → picocolors-BsDfhxIw.mjs} +1 -1
- package/dist/{platform-args-B7ke06up.mjs → platform-args-DVbVClZl.mjs} +12 -4
- package/dist/platform-args-kQrgxScY.mjs +1 -0
- package/dist/{platform-auth-config-CZaY812e.mjs → platform-auth-config-C-pm5Qzx.mjs} +6 -6
- package/dist/{platform-auth-protection-U9HCqoXv.mjs → platform-auth-protection-SHhvim1L.mjs} +4 -4
- package/dist/{platform-auth-recovery-B0BV2hfV.mjs → platform-auth-recovery-DXVWs-wA.mjs} +4 -4
- package/dist/{platform-cmd-CXrjk4fb.mjs → platform-cmd-D5I1beUX.mjs} +7 -7
- package/dist/{platform-cmd-D9lwFpcl.mjs → platform-cmd-PiNRkopU.mjs} +1 -1
- package/dist/{platform-domain-CXyq-68_.mjs → platform-domain-jpmBfZeb.mjs} +4 -4
- package/dist/{platform-lifecycle-Dz2cJsLX.mjs → platform-lifecycle-DH3Yr1qQ.mjs} +1 -1
- package/dist/{platform-lifecycle-D0TdyXbN.mjs → platform-lifecycle-DyKmuNY6.mjs} +405 -44
- package/dist/{platform-management-CnXhgxTM.mjs → platform-management--vDwSn35.mjs} +49 -5
- package/dist/{platform-management-BvgbusqL.mjs → platform-management-7m-PLaPJ.mjs} +1 -1
- package/dist/{platform-plans-config-BWn1S2Rv.mjs → platform-plans-config-CeydDSj0.mjs} +2 -2
- package/dist/{platform-recovery-CH_fThW6.mjs → platform-recovery-BiNpZZab.mjs} +2 -2
- package/dist/{platform-setup-YvN9VQXV.mjs → platform-setup-Ca53gtt0.mjs} +3 -2
- package/dist/{plugin-inference-Bekzjuqw.mjs → plugin-inference-DUjCd55H.mjs} +145 -218
- package/dist/{prepare-2XD6kh77.mjs → prepare-BcAE5Sdj.mjs} +3 -3
- package/dist/prepare-C4I0f--h.mjs +1 -0
- package/dist/{prepare-DepAGBcV.mjs → prepare-DA-17DhO.mjs} +5 -5
- package/dist/{prerender-render-Bfsumdkv.mjs → prerender-render-Cijv7UFo.mjs} +11 -6
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-CpLYflCH.mjs → project-cmd-DA4K5faU.mjs} +18 -18
- package/dist/{project-team-CTSY7W7Q.mjs → project-team-CQBNveX3.mjs} +4 -4
- package/dist/{project-token-Cybtlfbl.mjs → project-token-CCalFyQf.mjs} +4 -4
- package/dist/{project-zero-trust-DKOtqyvu.mjs → project-zero-trust-DPnkiEuT.mjs} +4 -4
- package/dist/{protocol-B8sI8dRD.d.mts → protocol-BBDpJz3G.d.mts} +3 -1
- package/dist/{protocol-RNP0u7UY.mjs → protocol-DimNxVRr.mjs} +42 -17
- package/dist/{provision-UcYjpTRh.mjs → provision-BFLCrnUp.mjs} +1 -1
- package/dist/{provision-BuifYvLc.mjs → provision-DtROpNNI.mjs} +6 -5
- package/dist/{requests-Ryiazz9i.mjs → requests-BpH0kImL.mjs} +3 -3
- package/dist/resolve-project-DD1vu8s9.mjs +1 -0
- package/dist/{resolve-project-WpwkCB_c.mjs → resolve-project-Xoi6eTWY.mjs} +1 -1
- package/dist/{rollback-Or0EV3rP.mjs → rollback-CXS1tAa-.mjs} +10 -9
- package/dist/{rolldown-runtime-DXIUcv95.mjs → rolldown-runtime-3h0WiCiA.mjs} +1 -1
- package/dist/{routing-assets-VkrKIbxE.mjs → routing-assets-DdSFxoLp.mjs} +10 -4
- package/dist/runtime/better-auth-mysql.d.mts +1 -1
- package/dist/runtime/better-auth-pg.d.mts +1 -1
- package/dist/runtime/better-auth.d.mts +1 -1
- package/dist/runtime/client-react.d.mts +2 -2
- package/dist/runtime/client-react.mjs +3 -3
- package/dist/runtime/client-solid.d.mts +2 -2
- package/dist/runtime/client-solid.mjs +3 -3
- package/dist/runtime/client-svelte.d.mts +2 -2
- package/dist/runtime/client-svelte.mjs +3 -3
- package/dist/runtime/client-vue.d.mts +2 -2
- package/dist/runtime/client-vue.mjs +3 -3
- package/dist/runtime/client.d.mts +2 -2
- package/dist/runtime/client.mjs +3 -3
- package/dist/runtime/email/testing.mjs +4 -4
- package/dist/runtime/email.mjs +3 -3
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/fetch-server.d.mts +8 -0
- package/dist/runtime/fetch-server.mjs +30 -0
- package/dist/runtime/fetch-stream.d.mts +2 -2
- package/dist/runtime/fetch-stream.mjs +2 -2
- package/dist/runtime/fetch.d.mts +2 -2
- package/dist/runtime/fetch.mjs +3 -3
- package/dist/runtime/handler.d.mts +1 -1
- package/dist/runtime/live-client.d.mts +1 -1
- package/dist/runtime/live.d.mts +1 -1
- package/dist/runtime/routing.d.mts +17 -76
- package/dist/runtime/routing.mjs +277 -216
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +2 -2
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{scan-D2-FcLHs.mjs → scan-8IzYXiU_.mjs} +12 -11
- package/dist/{secret-CClHaFxm.mjs → secret-BbXHfLAt.mjs} +6 -6
- package/dist/serialize-DtR8Vwa_.d.mts +18 -0
- package/dist/serialize-YHvlcG3Q.mjs +31 -0
- package/dist/{skills-C_yRTg0g.mjs → skills-CrUO3PJ0.mjs} +1 -1
- package/dist/{subcommand-prompt-Bm3ZlYgA.mjs → subcommand-prompt-D9OhhbGG.mjs} +2 -2
- package/dist/{version-metadata-B1Bm2wSq.mjs → version-metadata-tS39iW09.mjs} +1 -1
- package/dist/wrangler-BLb3_luP.mjs +1 -0
- package/dist/{wrangler-C9XSzrju.mjs → wrangler-F96NnLyb.mjs} +13 -5
- package/dist/{wrapper-BOigE1xJ.mjs → wrapper-D3sZyh2C.mjs} +5 -3
- package/dist/{ws-CsBNxv86.d.mts → ws-BH-im_tX.d.mts} +1 -1
- package/docs/guide/ai.md +1 -1
- package/docs/guide/database/postgresql.md +1 -1
- package/docs/guide/database.md +26 -0
- package/docs/guide/deployment.md +2 -0
- package/docs/guide/edge/headers.md +1 -1
- package/docs/guide/email/domains.md +1 -1
- package/docs/guide/email/receiving.md +1 -1
- package/docs/guide/email/sending.md +3 -3
- package/docs/guide/pages-routing/actions-and-forms.md +1 -1
- package/docs/guide/pages-routing/markdown.md +3 -1
- package/docs/guide/platform/administration/email.md +7 -1
- package/docs/guide/platform/installation/ci.md +2 -0
- package/docs/guide/platform/installation/credentials.md +24 -6
- package/docs/guide/platform/installation/domains.md +16 -0
- package/docs/guide/platform/installation/maintenance.md +32 -2
- package/docs/guide/platform/installation/setup.md +1 -1
- package/docs/guide/self-hosted-platform.md +1 -1
- package/docs/guide/server-routing.md +1 -1
- package/docs/guide/typed-fetch.md +1 -1
- package/docs/integrations/cloudflare.md +2 -1
- package/docs/integrations/frameworks/tanstack-start.md +25 -0
- package/docs/reference/api/deploy.md +35 -3
- package/docs/reference/api/env.md +1 -1
- package/docs/reference/api/rewrites.md +1 -1
- package/docs/reference/api/types.md +1 -0
- package/docs/reference/cli/database.md +15 -0
- package/docs/reference/cli/platform-installation.md +5 -2
- package/docs/reference/cli/project.md +4 -2
- package/docs/reference/cli/setup.md +17 -0
- package/docs/reference/cli.md +1 -0
- package/docs/reference/config.md +14 -1
- package/docs/reference/resource-inference.md +4 -0
- package/package.json +23 -22
- package/sandbox.Dockerfile +1 -1
- package/schema.json +23 -3
- package/dist/cf-build-output-BU3hqdHu.mjs +0 -1
- package/dist/client-DrdeJgHR.mjs +0 -1
- package/dist/deploy-CxNgEYr4.mjs +0 -2
- package/dist/fetch-sAcwjzLO.mjs +0 -18
- package/dist/gen-DsCukhuw.mjs +0 -1
- package/dist/help-DOFygYi4.mjs +0 -1
- package/dist/login-alAlxw4S.mjs +0 -1
- package/dist/migrate-D2odrAmh.mjs +0 -1
- package/dist/operator-cmd-D7toMPJ9.mjs +0 -1
- package/dist/platform-args-B_LrqEZB.mjs +0 -1
- package/dist/prepare-EVEbQ9n2.mjs +0 -1
- package/dist/resolve-project-PnhzMtY6.mjs +0 -1
- package/dist/serialize-BtQyaYoC.mjs +0 -20
- package/dist/serialize-CfSwWfF2.d.mts +0 -10
- package/dist/wrangler-DAdxHEzh.mjs +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { S as writePendingInstallationSecrets, _ as removePlatformConnectionForInstallation, g as removeInstallationRecoverySecrets, h as readPendingInstallationSecrets, m as readInstallationRecoverySecrets, o as listInstallationManifests, t as acquirePlatformLifecycleLock, v as resolveInstallationManifest, x as writeInstallationManifest } from "./platform-registry-B9mWX9LO.mjs";
|
|
2
2
|
import { t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
|
|
3
|
-
import { A as confirm, H as outro, K as select, L as log, tt as isCancel } from "./dist-
|
|
4
|
-
import { f as import_picocolors, l as formatUrl, m as printSuccess, p as note, r as createSpinner } from "./output-
|
|
5
|
-
import {
|
|
3
|
+
import { A as confirm, H as outro, K as select, L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
4
|
+
import { f as import_picocolors, l as formatUrl, m as printSuccess, p as note, r as createSpinner } from "./output-BpgYODYx.mjs";
|
|
5
|
+
import { $ as hyperdriveOriginMatches, A as dnsRecordConfigHash, B as turnOffInstalledProjectZeroTrust, C as createPlatformHealthProbeToken, D as platformTrafficAttachmentWorker, F as platformAdoptionIntentHash, H as resolvePlatformCloudflareCredential, I as r2BucketConfigHash, J as PlatformCloudflareApiError, L as resourceMarkerProblem, M as hasProvisionIntentStep, N as legacyResourceConfigHash, P as matchesRecordedR2Fingerprint, Q as hyperdriveOriginFromConnectionString, R as revalidatePlatformInstallAction, S as loadPlatformRuntime, T as resolveBootstrapGitHubId, U as verifyPlatformCloudflareCredential, V as assertPlatformOperatorCredentialCanApplyPlan, W as activatePlatformAccessCredentials, X as PlatformRuntimeTokenEmailPermissionError, Y as PlatformCloudflareClient, Z as hyperdriveOriginConfigHash, _ as readPlatformProjectSlugs, a as findPlatformWorkerOutsideChanges, b as formatZeroTrustApplications, c as uploadPlatformWorkerOutsideChanges, d as replacePendingInstallationAuthentication, et as verifyPlatformRuntimeTokenEmailPermissions, f as REMOTE_INSTALLATION_MANIFEST_KEY, j as formatPlatformInstallPlan, k as createPlatformInstallPlan, l as authenticationSetupRequestHash, m as acquirePlatformDatabaseLifecycleLock, n as resolvePlatformInstallDatabaseUrl, o as formatPlatformWorkerOutsideChanges, p as installPlatform, s as reviewPlatformWorkerOutsideChanges, t as assertNoninteractivePlatformMutationAcknowledged, tt as verifyPlatformRuntimeTokenPermissions, u as readLoginReplacementFile, v as readPlatformProjectZeroTrustState, w as createPlatformInstallationSecrets, x as readPlatformDatabase, y as assertProjectZeroTrustAllowsUninstall, z as platformDatabaseNameFromOwnerUrl } from "./platform-lifecycle-DyKmuNY6.mjs";
|
|
6
6
|
import { PLATFORM_DISABLED_KEY, PLATFORM_DISABLED_VALUE, PLATFORM_R2_OWNERSHIP_MARKER_KEY, parsePlatformInstallationManifest, recordInstallationResource, recordInstallationStep, setInstallationDesiredState, transitionInstallation } from "@void/platform";
|
|
7
7
|
import { setTimeout } from "node:timers/promises";
|
|
8
8
|
//#region src/cli/platform-teardown.ts
|
|
@@ -624,6 +624,7 @@ function platformLifecycleResumeCommand(args, installationId) {
|
|
|
624
624
|
if (args.runtime) command.push("--runtime", commandArgument(args.runtime));
|
|
625
625
|
if (args.subcommand === "rollback" && args.fromRuntime) command.push("--from-runtime", commandArgument(args.fromRuntime));
|
|
626
626
|
if ("dashboardUrl" in args && args.dashboardUrl) command.push("--dashboard-url", commandArgument(args.dashboardUrl));
|
|
627
|
+
if ("customDomains" in args && args.customDomains) command.push("--custom-domains");
|
|
627
628
|
if (args.yes) command.push("--yes");
|
|
628
629
|
return command.join(" ");
|
|
629
630
|
}
|
|
@@ -714,6 +715,7 @@ async function runInstalledPlatformCommand(args) {
|
|
|
714
715
|
applicationDomain: deployment.application.baseDomain,
|
|
715
716
|
controlPlaneDomain: deployment.controlPlane.apiHostname ?? "",
|
|
716
717
|
...args.subcommand !== "rollback" && args.dashboardUrl !== void 0 ? { dashboardUrl: args.dashboardUrl } : {},
|
|
718
|
+
...args.subcommand !== "rollback" && args.customDomains ? { customDomains: true } : {},
|
|
717
719
|
dedicatedZone: deployment.application.dedicatedZone,
|
|
718
720
|
displayName: deployment.displayName,
|
|
719
721
|
installationSlug: deployment.installationSlug,
|
|
@@ -738,6 +740,8 @@ async function runInstalledPlatformCommand(args) {
|
|
|
738
740
|
log.info(manifest.desiredState === "disabled" && args.subcommand !== "enable" ? "Application traffic will stay paused because this installation is disabled." : "Application traffic may pause briefly during a safe cutover.");
|
|
739
741
|
if (args.plan) {
|
|
740
742
|
if (loginFile !== void 0) log.info(`Login settings will be replaced from ${loginFile}; a new setup code is printed at the end.`);
|
|
743
|
+
const outsideChanges = await findPlatformWorkerOutsideChanges(client, plan, runtime, { manifest });
|
|
744
|
+
if (outsideChanges.length > 0) log.warn(`${formatPlatformWorkerOutsideChanges(outsideChanges)}\nThis command replaces their configuration with the Void configuration. Run it in a terminal to review them first.`);
|
|
741
745
|
outro("No Cloudflare or local installation state was changed.");
|
|
742
746
|
return;
|
|
743
747
|
}
|
|
@@ -788,15 +792,42 @@ async function runInstalledPlatformCommand(args) {
|
|
|
788
792
|
r2SecretAccessKey: process.env.VOID_PLATFORM_R2_SECRET_ACCESS_KEY || "",
|
|
789
793
|
...replacedLogin
|
|
790
794
|
});
|
|
791
|
-
const runtimeTokenToPreflight = resolvePlatformRuntimeTokenToPreflight(plan, secrets);
|
|
795
|
+
const runtimeTokenToPreflight = resolvePlatformRuntimeTokenToPreflight(plan, secrets, { enablingCustomDomains: plan.deployment.capabilities.customDomains && !manifest.deployment.capabilities.customDomains });
|
|
796
|
+
const emailZoneId = installation.desiredState !== "disabled" && plan.deployment.capabilities.email ? plan.deployment.emailSharedZoneId : void 0;
|
|
792
797
|
if (runtimeTokenToPreflight) await verifyPlatformRuntimeTokenPermissions(new PlatformCloudflareClient(runtimeTokenToPreflight), {
|
|
793
798
|
accountId: manifest.account.id,
|
|
794
799
|
applicationDomain: deployment.application.baseDomain,
|
|
795
800
|
customDomains: plan.deployment.capabilities.customDomains,
|
|
801
|
+
...emailZoneId ? { emailZoneId } : {},
|
|
796
802
|
zoneId: plan.zone?.id ?? null
|
|
797
803
|
});
|
|
804
|
+
else if (emailZoneId && secrets.cloudflareApiToken) try {
|
|
805
|
+
await verifyPlatformRuntimeTokenEmailPermissions(new PlatformCloudflareClient(secrets.cloudflareApiToken), {
|
|
806
|
+
accountId: manifest.account.id,
|
|
807
|
+
savedToken: true,
|
|
808
|
+
zoneId: emailZoneId
|
|
809
|
+
});
|
|
810
|
+
} catch (error) {
|
|
811
|
+
if (!(error instanceof PlatformRuntimeTokenEmailPermissionError) || !error.tokenNotValid) throw error;
|
|
812
|
+
log.warn("The runtime API token saved on this machine is not valid (HTTP 401). Void cannot check the platform email permissions before it changes the platform, and it continues without this check. To do the check, set VOID_PLATFORM_RUNTIME_CLOUDFLARE_API_TOKEN to the runtime token of the platform.");
|
|
813
|
+
}
|
|
798
814
|
markPhase("runtime token");
|
|
799
815
|
if (!databaseLock?.readAuthenticationState) throw new Error("platform: The database lifecycle lock cannot read authoritative authentication settings.");
|
|
816
|
+
const outsideChanges = await reviewPlatformWorkerOutsideChanges({
|
|
817
|
+
client,
|
|
818
|
+
plan,
|
|
819
|
+
runtime,
|
|
820
|
+
installation: {
|
|
821
|
+
manifest: installation,
|
|
822
|
+
readAuthenticationState: databaseLock.readAuthenticationState
|
|
823
|
+
},
|
|
824
|
+
interactive: process.stdin.isTTY === true && process.stdout.isTTY === true && !args.yes,
|
|
825
|
+
command: platformLifecycleResumeCommand({
|
|
826
|
+
...args,
|
|
827
|
+
yes: false
|
|
828
|
+
}, manifest.id)
|
|
829
|
+
});
|
|
830
|
+
markPhase("outside changes");
|
|
800
831
|
progress = createSpinner({ onCancel: () => {
|
|
801
832
|
if (!process.emit("SIGINT")) process.exit(130);
|
|
802
833
|
} });
|
|
@@ -825,6 +856,15 @@ async function runInstalledPlatformCommand(args) {
|
|
|
825
856
|
}),
|
|
826
857
|
client,
|
|
827
858
|
operatorApiToken: operatorCredential.token,
|
|
859
|
+
...outsideChanges.length > 0 ? {
|
|
860
|
+
replaceOutsideChanges: outsideChanges.map((change) => change.name),
|
|
861
|
+
uploadOutsideChanges: (configs) => uploadPlatformWorkerOutsideChanges(configs, {
|
|
862
|
+
changes: outsideChanges,
|
|
863
|
+
client,
|
|
864
|
+
operatorApiToken: operatorCredential.token,
|
|
865
|
+
progress
|
|
866
|
+
})
|
|
867
|
+
} : {},
|
|
828
868
|
databaseRollbackSource: rollbackSourceRuntime ?? void 0,
|
|
829
869
|
onProgress: (message) => {
|
|
830
870
|
markPhase(message);
|
|
@@ -937,9 +977,13 @@ function assertPlatformRollbackCompatibility(installation, target, source) {
|
|
|
937
977
|
if (installation.databaseSchemaDigest !== source.manifest.database.schemaDigest) throw new Error("platform: The authoritative installation checkpoint does not record the installed runtime database schema. Repair or roll forward before rollback.");
|
|
938
978
|
if (target.manifest.safetyProtocols.sandboxDrain < installation.safetyProtocols.sandboxDrain) throw new Error("platform: The rollback target predates the installed sandbox-drain safety protocol.");
|
|
939
979
|
}
|
|
940
|
-
function resolvePlatformRuntimeTokenToPreflight(plan, secrets) {
|
|
980
|
+
function resolvePlatformRuntimeTokenToPreflight(plan, secrets, options = {}) {
|
|
941
981
|
const explicitUpdate = secrets.workerSecretUpdates?.CF_API_TOKEN;
|
|
942
982
|
if (explicitUpdate) return explicitUpdate;
|
|
983
|
+
if (options.enablingCustomDomains) {
|
|
984
|
+
if (!secrets.cloudflareApiToken) throw new Error("platform: Before enabling project custom domains, set VOID_PLATFORM_RUNTIME_CLOUDFLARE_API_TOKEN to the platform runtime token with Zone → SSL and Certificates → Edit on the application zone so Void can check its access.");
|
|
985
|
+
return secrets.cloudflareApiToken;
|
|
986
|
+
}
|
|
943
987
|
return plan.actions.some((action) => action.kind === "worker" && action.action === "create" && (action.key === "api-worker" || action.key === "proxy-worker")) ? secrets.cloudflareApiToken : "";
|
|
944
988
|
}
|
|
945
989
|
async function resolveInstalledPlatformManifest(selector, dependencies = {}) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { c as runInstalledPlatformCommand, l as selectAuthoritativePlatformManifest, d as verifyPlatformInstallationOwnership } from "./platform-management
|
|
1
|
+
export { c as runInstalledPlatformCommand, l as selectAuthoritativePlatformManifest, d as verifyPlatformInstallationOwnership } from "./platform-management--vDwSn35.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as confirm, K as select, X as text, tt as isCancel } from "./dist-
|
|
2
|
-
import { m as printSuccess } from "./output-
|
|
1
|
+
import { A as confirm, K as select, X as text, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
2
|
+
import { m as printSuccess } from "./output-BpgYODYx.mjs";
|
|
3
3
|
import { n as OperatorClient, r as OperatorClientError } from "./operator-client-C-ROjk1I.mjs";
|
|
4
4
|
import { a as resolveOperatorOrigin, r as readOperatorToken } from "./operator-auth-Cr2zCc-J.mjs";
|
|
5
5
|
import { stripVTControlCharacters } from "node:util";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { o as listInstallationManifests, t as acquirePlatformLifecycleLock, x as writeInstallationManifest, y as savePlatformConnection } from "./platform-registry-B9mWX9LO.mjs";
|
|
2
2
|
import { t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
|
|
3
|
-
import {
|
|
4
|
-
import { a as recoverDurablyMarkedProvisionIntents, d as verifyPlatformInstallationOwnership, r as isPlatformManifestMonotonicExtension } from "./platform-management
|
|
3
|
+
import { f as REMOTE_INSTALLATION_MANIFEST_KEY, k as createPlatformInstallPlan } from "./platform-lifecycle-DyKmuNY6.mjs";
|
|
4
|
+
import { a as recoverDurablyMarkedProvisionIntents, d as verifyPlatformInstallationOwnership, r as isPlatformManifestMonotonicExtension } from "./platform-management--vDwSn35.mjs";
|
|
5
5
|
import { parsePlatformInstallationManifest, setInstallationEndpoints } from "@void/platform";
|
|
6
6
|
//#region src/cli/platform-recovery.ts
|
|
7
7
|
async function recoverPlatformInstallations(client, accountId, verifyEndpoint = verifyInstallationEndpoint, selector = "") {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { u as openBrowser } from "./auth-B6iOCjKI.mjs";
|
|
2
|
-
import { L as log, tt as isCancel } from "./dist-
|
|
3
|
-
import { f as import_picocolors, s as formatLink } from "./output-
|
|
2
|
+
import { L as log, tt as isCancel } from "./dist-Cor9XGoz.mjs";
|
|
3
|
+
import { f as import_picocolors, s as formatLink } from "./output-BpgYODYx.mjs";
|
|
4
4
|
//#region src/cli/platform-setup.ts
|
|
5
5
|
/** Return a prompt answer, or stop the platform command when the prompt was cancelled. */
|
|
6
6
|
function platformPromptAnswer(value) {
|
|
@@ -254,6 +254,7 @@ function platformInstallCommandArguments(options) {
|
|
|
254
254
|
flag("--zone", options.zoneName);
|
|
255
255
|
if (options.dedicatedZone) parts.push("--dedicated-zone");
|
|
256
256
|
else parts.push("--no-dedicated-zone");
|
|
257
|
+
if (options.customDomains) parts.push("--custom-domains");
|
|
257
258
|
}
|
|
258
259
|
flag("--control-plane-domain", options.controlPlaneDomain);
|
|
259
260
|
if (!options.controlPlaneDomain) parts.push("--no-control-plane-domain");
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { a as join, l as toSlash, s as relative } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import { n as readProjectPaths } from "./project-paths-DGu_QZ_Q.mjs";
|
|
3
|
-
import { n as globSync } from "./dist-
|
|
4
|
-
import { a as isObjectExpression, i as isMemberExpression, n as isIdentifier, r as isLiteral, t as isCallExpression } from "./ast-
|
|
5
|
-
import { a as staticLiteral, n as
|
|
3
|
+
import { n as globSync } from "./dist-D15hFhP0.mjs";
|
|
4
|
+
import { a as isObjectExpression, i as isMemberExpression, n as isIdentifier, r as isLiteral, t as isCallExpression } from "./ast-CsZ_q_gc.mjs";
|
|
5
|
+
import { a as staticLiteral, n as bindingResolver, o as unwrapStaticExpression, r as walk } from "./ast-bindings-C3yaPs1y.mjs";
|
|
6
6
|
import { n as resourceNameWords, t as isResourceName } from "./resource-name-C7LVpcRm.mjs";
|
|
7
|
-
import { r as
|
|
7
|
+
import { n as parseRouteFilename, r as parseWebSocketFilename, t as isRouteEnabledForEnvironment } from "./parse-filename-DioPHiR9.mjs";
|
|
8
|
+
import { r as getSsrServerEntryPath } from "./entry-BEM8ZuGP.mjs";
|
|
8
9
|
import { existsSync, readFileSync } from "node:fs";
|
|
9
10
|
import { parseSync } from "vite";
|
|
10
11
|
//#region src/application-features.ts
|
|
@@ -31,7 +32,7 @@ function needsApplicationDatabase(bindings, migrationCount) {
|
|
|
31
32
|
//#region src/shared/convention-files.ts
|
|
32
33
|
/** Handler files under `dir`, relative to it, skipping paths with a `_`-prefixed segment. */
|
|
33
34
|
function listConventionFiles(dir) {
|
|
34
|
-
return globSync("**/*.{ts,mts,js,mjs}", { cwd: dir }).filter((filePath) => !filePath.split("/").some((segment) => segment.startsWith("_")));
|
|
35
|
+
return globSync(["**/*.{ts,mts,js,mjs}", ".well-known/**/*.{ts,mts,js,mjs}"], { cwd: dir }).filter((filePath) => !filePath.split("/").some((segment) => segment.startsWith("_")));
|
|
35
36
|
}
|
|
36
37
|
//#endregion
|
|
37
38
|
//#region src/shared/resource-definition.ts
|
|
@@ -149,193 +150,6 @@ function readResourceDefinition(filename, source, helpers) {
|
|
|
149
150
|
};
|
|
150
151
|
}
|
|
151
152
|
//#endregion
|
|
152
|
-
//#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/walker.js
|
|
153
|
-
/**
|
|
154
|
-
* @typedef { import('estree').Node} Node
|
|
155
|
-
* @typedef {{
|
|
156
|
-
* skip: () => void;
|
|
157
|
-
* remove: () => void;
|
|
158
|
-
* replace: (node: Node) => void;
|
|
159
|
-
* }} WalkerContext
|
|
160
|
-
*/
|
|
161
|
-
var WalkerBase = class {
|
|
162
|
-
constructor() {
|
|
163
|
-
/** @type {boolean} */
|
|
164
|
-
this.should_skip = false;
|
|
165
|
-
/** @type {boolean} */
|
|
166
|
-
this.should_remove = false;
|
|
167
|
-
/** @type {Node | null} */
|
|
168
|
-
this.replacement = null;
|
|
169
|
-
/** @type {WalkerContext} */
|
|
170
|
-
this.context = {
|
|
171
|
-
skip: () => this.should_skip = true,
|
|
172
|
-
remove: () => this.should_remove = true,
|
|
173
|
-
replace: (node) => this.replacement = node
|
|
174
|
-
};
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* @template {Node} Parent
|
|
178
|
-
* @param {Parent | null | undefined} parent
|
|
179
|
-
* @param {keyof Parent | null | undefined} prop
|
|
180
|
-
* @param {number | null | undefined} index
|
|
181
|
-
* @param {Node} node
|
|
182
|
-
*/
|
|
183
|
-
replace(parent, prop, index, node) {
|
|
184
|
-
if (parent && prop) {
|
|
185
|
-
if (index != null)
|
|
186
|
-
/** @type {Array<Node>} */ parent[prop][index] = node;
|
|
187
|
-
else
|
|
188
|
-
/** @type {Node} */ parent[prop] = node;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
/**
|
|
192
|
-
* @template {Node} Parent
|
|
193
|
-
* @param {Parent | null | undefined} parent
|
|
194
|
-
* @param {keyof Parent | null | undefined} prop
|
|
195
|
-
* @param {number | null | undefined} index
|
|
196
|
-
*/
|
|
197
|
-
remove(parent, prop, index) {
|
|
198
|
-
if (parent && prop) {
|
|
199
|
-
if (index !== null && index !== void 0)
|
|
200
|
-
/** @type {Array<Node>} */ parent[prop].splice(index, 1);
|
|
201
|
-
else delete parent[prop];
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
};
|
|
205
|
-
//#endregion
|
|
206
|
-
//#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/sync.js
|
|
207
|
-
/**
|
|
208
|
-
* @typedef { import('estree').Node} Node
|
|
209
|
-
* @typedef { import('./walker.js').WalkerContext} WalkerContext
|
|
210
|
-
* @typedef {(
|
|
211
|
-
* this: WalkerContext,
|
|
212
|
-
* node: Node,
|
|
213
|
-
* parent: Node | null,
|
|
214
|
-
* key: string | number | symbol | null | undefined,
|
|
215
|
-
* index: number | null | undefined
|
|
216
|
-
* ) => void} SyncHandler
|
|
217
|
-
*/
|
|
218
|
-
var SyncWalker = class extends WalkerBase {
|
|
219
|
-
/**
|
|
220
|
-
*
|
|
221
|
-
* @param {SyncHandler} [enter]
|
|
222
|
-
* @param {SyncHandler} [leave]
|
|
223
|
-
*/
|
|
224
|
-
constructor(enter, leave) {
|
|
225
|
-
super();
|
|
226
|
-
/** @type {boolean} */
|
|
227
|
-
this.should_skip = false;
|
|
228
|
-
/** @type {boolean} */
|
|
229
|
-
this.should_remove = false;
|
|
230
|
-
/** @type {Node | null} */
|
|
231
|
-
this.replacement = null;
|
|
232
|
-
/** @type {WalkerContext} */
|
|
233
|
-
this.context = {
|
|
234
|
-
skip: () => this.should_skip = true,
|
|
235
|
-
remove: () => this.should_remove = true,
|
|
236
|
-
replace: (node) => this.replacement = node
|
|
237
|
-
};
|
|
238
|
-
/** @type {SyncHandler | undefined} */
|
|
239
|
-
this.enter = enter;
|
|
240
|
-
/** @type {SyncHandler | undefined} */
|
|
241
|
-
this.leave = leave;
|
|
242
|
-
}
|
|
243
|
-
/**
|
|
244
|
-
* @template {Node} Parent
|
|
245
|
-
* @param {Node} node
|
|
246
|
-
* @param {Parent | null} parent
|
|
247
|
-
* @param {keyof Parent} [prop]
|
|
248
|
-
* @param {number | null} [index]
|
|
249
|
-
* @returns {Node | null}
|
|
250
|
-
*/
|
|
251
|
-
visit(node, parent, prop, index) {
|
|
252
|
-
if (node) {
|
|
253
|
-
if (this.enter) {
|
|
254
|
-
const _should_skip = this.should_skip;
|
|
255
|
-
const _should_remove = this.should_remove;
|
|
256
|
-
const _replacement = this.replacement;
|
|
257
|
-
this.should_skip = false;
|
|
258
|
-
this.should_remove = false;
|
|
259
|
-
this.replacement = null;
|
|
260
|
-
this.enter.call(this.context, node, parent, prop, index);
|
|
261
|
-
if (this.replacement) {
|
|
262
|
-
node = this.replacement;
|
|
263
|
-
this.replace(parent, prop, index, node);
|
|
264
|
-
}
|
|
265
|
-
if (this.should_remove) this.remove(parent, prop, index);
|
|
266
|
-
const skipped = this.should_skip;
|
|
267
|
-
const removed = this.should_remove;
|
|
268
|
-
this.should_skip = _should_skip;
|
|
269
|
-
this.should_remove = _should_remove;
|
|
270
|
-
this.replacement = _replacement;
|
|
271
|
-
if (skipped) return node;
|
|
272
|
-
if (removed) return null;
|
|
273
|
-
}
|
|
274
|
-
/** @type {keyof Node} */
|
|
275
|
-
let key;
|
|
276
|
-
for (key in node) {
|
|
277
|
-
/** @type {unknown} */
|
|
278
|
-
const value = node[key];
|
|
279
|
-
if (value && typeof value === "object") {
|
|
280
|
-
if (Array.isArray(value)) {
|
|
281
|
-
const nodes = value;
|
|
282
|
-
for (let i = 0; i < nodes.length; i += 1) {
|
|
283
|
-
const item = nodes[i];
|
|
284
|
-
if (isNode(item)) {
|
|
285
|
-
if (!this.visit(item, node, key, i)) i--;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
} else if (isNode(value)) this.visit(value, node, key, null);
|
|
289
|
-
}
|
|
290
|
-
}
|
|
291
|
-
if (this.leave) {
|
|
292
|
-
const _replacement = this.replacement;
|
|
293
|
-
const _should_remove = this.should_remove;
|
|
294
|
-
this.replacement = null;
|
|
295
|
-
this.should_remove = false;
|
|
296
|
-
this.leave.call(this.context, node, parent, prop, index);
|
|
297
|
-
if (this.replacement) {
|
|
298
|
-
node = this.replacement;
|
|
299
|
-
this.replace(parent, prop, index, node);
|
|
300
|
-
}
|
|
301
|
-
if (this.should_remove) this.remove(parent, prop, index);
|
|
302
|
-
const removed = this.should_remove;
|
|
303
|
-
this.replacement = _replacement;
|
|
304
|
-
this.should_remove = _should_remove;
|
|
305
|
-
if (removed) return null;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
return node;
|
|
309
|
-
}
|
|
310
|
-
};
|
|
311
|
-
/**
|
|
312
|
-
* Ducktype a node.
|
|
313
|
-
*
|
|
314
|
-
* @param {unknown} value
|
|
315
|
-
* @returns {value is Node}
|
|
316
|
-
*/
|
|
317
|
-
function isNode(value) {
|
|
318
|
-
return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
|
|
319
|
-
}
|
|
320
|
-
//#endregion
|
|
321
|
-
//#region ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/index.js
|
|
322
|
-
/**
|
|
323
|
-
* @typedef {import('estree').Node} Node
|
|
324
|
-
* @typedef {import('./sync.js').SyncHandler} SyncHandler
|
|
325
|
-
* @typedef {import('./async.js').AsyncHandler} AsyncHandler
|
|
326
|
-
*/
|
|
327
|
-
/**
|
|
328
|
-
* @param {Node} ast
|
|
329
|
-
* @param {{
|
|
330
|
-
* enter?: SyncHandler
|
|
331
|
-
* leave?: SyncHandler
|
|
332
|
-
* }} walker
|
|
333
|
-
* @returns {Node | null}
|
|
334
|
-
*/
|
|
335
|
-
function walk(ast, { enter, leave }) {
|
|
336
|
-
return new SyncWalker(enter, leave).visit(ast, null);
|
|
337
|
-
}
|
|
338
|
-
//#endregion
|
|
339
153
|
//#region src/shared/module-references.ts
|
|
340
154
|
/** Runtime imports and re-exports, in source order, including empty export lists. */
|
|
341
155
|
function staticModuleReferences(parsed, code) {
|
|
@@ -363,8 +177,105 @@ function staticModuleReferences(parsed, code) {
|
|
|
363
177
|
});
|
|
364
178
|
}
|
|
365
179
|
//#endregion
|
|
180
|
+
//#region src/inference/client-auth.ts
|
|
181
|
+
const CLIENT_MODULES = /* @__PURE__ */ new Set([
|
|
182
|
+
"void/client",
|
|
183
|
+
"void/client/react",
|
|
184
|
+
"void/client/vue",
|
|
185
|
+
"void/client/svelte",
|
|
186
|
+
"void/client/solid"
|
|
187
|
+
]);
|
|
188
|
+
function name(node) {
|
|
189
|
+
return isIdentifier(node) ? node.name : staticLiteral(node);
|
|
190
|
+
}
|
|
191
|
+
function propertyName(node) {
|
|
192
|
+
const key = node.property ?? node.key;
|
|
193
|
+
return node.computed ? staticLiteral(key) : name(key);
|
|
194
|
+
}
|
|
195
|
+
/** Detect runtime auth imports and namespace reads without confusing aliases or type names. */
|
|
196
|
+
function inferClientAuth(parsed, code) {
|
|
197
|
+
let hasNamespace = false;
|
|
198
|
+
for (const statement of parsed.module.staticImports) {
|
|
199
|
+
if (!CLIENT_MODULES.has(statement.moduleRequest.value)) continue;
|
|
200
|
+
for (const entry of statement.entries) if (!entry.isType) {
|
|
201
|
+
if (entry.importName.name === "auth") return true;
|
|
202
|
+
hasNamespace ||= entry.importName.kind === "NamespaceObject";
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
for (const statement of parsed.module.staticExports) for (const entry of statement.entries) if (!entry.isType && entry.moduleRequest && CLIENT_MODULES.has(entry.moduleRequest.value)) {
|
|
206
|
+
if (entry.importName.name === "auth" || entry.importName.kind === "All" || entry.importName.kind === "AllButDefault") return true;
|
|
207
|
+
}
|
|
208
|
+
if (!hasNamespace && parsed.module.dynamicImports.length === 0 || !/\bauth\b|\\(?:u|x|h|[0-7\r\n\u2028\u2029])/.test(code)) return false;
|
|
209
|
+
return inferNamespaceAuth(parsed.program);
|
|
210
|
+
}
|
|
211
|
+
function inferNamespaceAuth(program) {
|
|
212
|
+
const namespaces = /* @__PURE__ */ new Set();
|
|
213
|
+
for (const statement of program.body ?? []) {
|
|
214
|
+
const source = staticLiteral(statement.source);
|
|
215
|
+
if (typeof source !== "string" || !CLIENT_MODULES.has(source)) continue;
|
|
216
|
+
if (statement.importKind === "type" || statement.exportKind === "type") continue;
|
|
217
|
+
if (statement.type === "ExportAllDeclaration") return true;
|
|
218
|
+
for (const specifier of statement.specifiers ?? []) {
|
|
219
|
+
if (specifier.importKind === "type" || specifier.exportKind === "type") continue;
|
|
220
|
+
if (statement.type === "ImportDeclaration") {
|
|
221
|
+
if (specifier.type === "ImportNamespaceSpecifier") namespaces.add(specifier);
|
|
222
|
+
else if (name(specifier.imported) === "auth") return true;
|
|
223
|
+
} else if (statement.type === "ExportNamedDeclaration" && name(specifier.local) === "auth") return true;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
const reads = [];
|
|
227
|
+
const resolve = bindingResolver(program, { visit(node) {
|
|
228
|
+
if (isMemberExpression(node) && propertyName(node) === "auth") reads.push(node.object);
|
|
229
|
+
else if ([
|
|
230
|
+
"VariableDeclarator",
|
|
231
|
+
"AssignmentExpression",
|
|
232
|
+
"AssignmentPattern"
|
|
233
|
+
].includes(node.type)) {
|
|
234
|
+
const pattern = node.id ?? node.left;
|
|
235
|
+
const value = node.init ?? node.right;
|
|
236
|
+
if (pattern?.type === "ObjectPattern" && (pattern.properties ?? []).some((property) => property.type === "Property" && propertyName(property) === "auth")) reads.push(value);
|
|
237
|
+
}
|
|
238
|
+
return isIdentifier(node);
|
|
239
|
+
} });
|
|
240
|
+
const namespaceValues = /* @__PURE__ */ new Map();
|
|
241
|
+
function isClientNamespace(node) {
|
|
242
|
+
const aliases = [];
|
|
243
|
+
let found = false;
|
|
244
|
+
while (node = unwrapStaticExpression(node)) {
|
|
245
|
+
if (node.type === "AwaitExpression") {
|
|
246
|
+
node = node.argument;
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if (node.type === "ImportExpression") {
|
|
250
|
+
const source = staticLiteral(node.source);
|
|
251
|
+
found = typeof source === "string" && CLIENT_MODULES.has(source);
|
|
252
|
+
break;
|
|
253
|
+
}
|
|
254
|
+
if (!isIdentifier(node)) break;
|
|
255
|
+
const binding = resolve(node, node.name);
|
|
256
|
+
if (binding && namespaces.has(binding)) {
|
|
257
|
+
found = true;
|
|
258
|
+
break;
|
|
259
|
+
}
|
|
260
|
+
if (binding?.type !== "VariableDeclarator" || !isIdentifier(binding.id)) break;
|
|
261
|
+
const cached = namespaceValues.get(binding);
|
|
262
|
+
if (cached !== void 0) {
|
|
263
|
+
found = cached;
|
|
264
|
+
break;
|
|
265
|
+
}
|
|
266
|
+
namespaceValues.set(binding, false);
|
|
267
|
+
aliases.push(binding);
|
|
268
|
+
node = binding.init;
|
|
269
|
+
}
|
|
270
|
+
for (const alias of aliases) namespaceValues.set(alias, found);
|
|
271
|
+
return found;
|
|
272
|
+
}
|
|
273
|
+
return reads.some(isClientNamespace);
|
|
274
|
+
}
|
|
275
|
+
//#endregion
|
|
366
276
|
//#region src/inference/walk.ts
|
|
367
|
-
const ENV_BINDING_RE = /\benv\
|
|
277
|
+
const ENV_BINDING_RE = /\benv\b|\\(?:u|x|[0-7\r\n\u2028\u2029])/;
|
|
278
|
+
const RESOURCE_BINDING_RE = /\b(?:DB\b|KV\b|STORAGE\b|AI\b|SANDBOX\b|QUEUE_)|\\(?:u|x|[0-7A-Z_\r\n\u2028\u2029])/;
|
|
368
279
|
/**
|
|
369
280
|
* Infer which Cloudflare bindings a source file uses.
|
|
370
281
|
*
|
|
@@ -389,7 +300,9 @@ function inferBindingsFromSource(code, filename) {
|
|
|
389
300
|
} catch {
|
|
390
301
|
return result;
|
|
391
302
|
}
|
|
392
|
-
|
|
303
|
+
let hasClientModule = false;
|
|
304
|
+
function recordModuleReference(source) {
|
|
305
|
+
if (CLIENT_MODULES.has(source)) hasClientModule = true;
|
|
393
306
|
switch (source) {
|
|
394
307
|
case "void/db":
|
|
395
308
|
result.needsD1 = true;
|
|
@@ -415,35 +328,29 @@ function inferBindingsFromSource(code, filename) {
|
|
|
415
328
|
case "void/email":
|
|
416
329
|
result.needsEmail = true;
|
|
417
330
|
break;
|
|
418
|
-
case "void/live":
|
|
419
|
-
result.needsLive = true;
|
|
420
|
-
break;
|
|
421
|
-
case "void/client":
|
|
422
|
-
case "void/client/react":
|
|
423
|
-
case "void/client/vue":
|
|
424
|
-
case "void/client/svelte":
|
|
425
|
-
case "void/client/solid": if (/\bauth\b/.test(statement)) result.needsAuth = true;
|
|
331
|
+
case "void/live": result.needsLive = true;
|
|
426
332
|
}
|
|
427
333
|
}
|
|
428
|
-
for (const reference of staticModuleReferences(parsed, code)) recordModuleReference(reference.source
|
|
334
|
+
for (const reference of staticModuleReferences(parsed, code)) recordModuleReference(reference.source);
|
|
429
335
|
for (const reference of parsed.module.dynamicImports) {
|
|
430
336
|
const argument = code.slice(reference.moduleRequest.start, reference.moduleRequest.end);
|
|
431
337
|
const expression = parseSync(filename, `(${argument})`).program.body[0];
|
|
432
338
|
const source = expression?.type === "ExpressionStatement" ? staticLiteral(expression.expression) : void 0;
|
|
433
|
-
if (typeof source === "string") recordModuleReference(source
|
|
339
|
+
if (typeof source === "string") recordModuleReference(source);
|
|
434
340
|
}
|
|
435
|
-
if (
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
341
|
+
if (hasClientModule) result.needsAuth ||= inferClientAuth(parsed, code);
|
|
342
|
+
if (!ENV_BINDING_RE.test(code) || !RESOURCE_BINDING_RE.test(code)) return result;
|
|
343
|
+
function propertyName(node) {
|
|
344
|
+
const key = node.property ?? node.key;
|
|
345
|
+
const name = !node.computed && isIdentifier(key) ? key.name : staticLiteral(key);
|
|
346
|
+
return typeof name === "string" ? name : void 0;
|
|
347
|
+
}
|
|
348
|
+
function isEnv(node) {
|
|
349
|
+
node = unwrapStaticExpression(node);
|
|
350
|
+
return isIdentifier(node) && node.name === "env" || isMemberExpression(node) && propertyName(node) === "env";
|
|
351
|
+
}
|
|
352
|
+
function recordBinding(name) {
|
|
353
|
+
switch (name) {
|
|
447
354
|
case "DB":
|
|
448
355
|
result.needsD1 = true;
|
|
449
356
|
break;
|
|
@@ -459,8 +366,28 @@ function inferBindingsFromSource(code, filename) {
|
|
|
459
366
|
case "SANDBOX":
|
|
460
367
|
result.needsSandbox = true;
|
|
461
368
|
break;
|
|
462
|
-
default: if (
|
|
369
|
+
default: if (name?.startsWith("QUEUE_")) result.needsQueues = true;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function inspectPattern(pattern, fromEnv = false) {
|
|
373
|
+
if (pattern?.type === "AssignmentPattern") inspectPattern(pattern.left, fromEnv || isEnv(pattern.right));
|
|
374
|
+
else if (pattern?.type === "ObjectPattern") for (const property of pattern.properties ?? []) {
|
|
375
|
+
if (property.type !== "Property") continue;
|
|
376
|
+
const name = propertyName(property);
|
|
377
|
+
if (fromEnv) recordBinding(name);
|
|
378
|
+
inspectPattern(property.value, name === "env");
|
|
463
379
|
}
|
|
380
|
+
else if (pattern?.type === "ArrayPattern") for (const element of pattern.elements ?? []) inspectPattern(element);
|
|
381
|
+
}
|
|
382
|
+
walk(parsed.program, { enter(node) {
|
|
383
|
+
const current = node;
|
|
384
|
+
if (isMemberExpression(current) && isEnv(current.object)) recordBinding(propertyName(current));
|
|
385
|
+
else if (current.type === "VariableDeclarator" || current.type === "AssignmentExpression") inspectPattern(current.id ?? current.left, isEnv(current.init ?? current.right));
|
|
386
|
+
else if ([
|
|
387
|
+
"FunctionDeclaration",
|
|
388
|
+
"FunctionExpression",
|
|
389
|
+
"ArrowFunctionExpression"
|
|
390
|
+
].includes(current.type)) for (const parameter of current.params ?? []) inspectPattern(parameter);
|
|
464
391
|
} });
|
|
465
392
|
return result;
|
|
466
393
|
}
|
|
@@ -707,4 +634,4 @@ function inferProjectBindings(root, options, scanDirs) {
|
|
|
707
634
|
return applyBindingOverrides(mergeBindings(allBindings), options?.bindings);
|
|
708
635
|
}
|
|
709
636
|
//#endregion
|
|
710
|
-
export { deriveWebSocketClassNameFromName as a, scanWebSocketRoutesSync as c,
|
|
637
|
+
export { deriveWebSocketClassNameFromName as a, scanWebSocketRoutesSync as c, readResourceDefinition as d, listConventionFiles as f, inferProjectBindings as i, inferBindingsFromSource 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, staticModuleReferences as u };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { L as log } from "./dist-
|
|
2
|
-
import { m as printSuccess, p as note } from "./output-
|
|
3
|
-
import { t as prepareProject } from "./prepare-
|
|
1
|
+
import { L as log } from "./dist-Cor9XGoz.mjs";
|
|
2
|
+
import { m as printSuccess, p as note } from "./output-BpgYODYx.mjs";
|
|
3
|
+
import { t as prepareProject } from "./prepare-DA-17DhO.mjs";
|
|
4
4
|
//#region src/cli/prepare.ts
|
|
5
5
|
async function runPrepareCommand(root) {
|
|
6
6
|
console.log();
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as prepareProject } from "./prepare-DA-17DhO.mjs";
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
2
|
import { n as loadVoidAuthConfig } from "./config-CyUJzi3q.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { c as getDatabaseCasing, p as readConfig } from "./config-DHgSEWT7.mjs";
|
|
4
4
|
import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-Itv1f4WC.mjs";
|
|
5
5
|
import { n as generateDbDts } from "./db-types-NGxPwnlt.mjs";
|
|
6
6
|
import { t as discoverSchema } from "./discover-LaV0tbIu.mjs";
|
|
7
7
|
import { o as loadLocalEnv } from "./env-BJjULvL0.mjs";
|
|
8
|
-
import { n as findEnvFileForPaths, r as generateEnvTypes } from "./env-types-
|
|
9
|
-
import { t as analyzeApplication } from "./application-routing-
|
|
10
|
-
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-BQfyvQKX.mjs";
|
|
8
|
+
import { n as findEnvFileForPaths, r as generateEnvTypes } from "./env-types-BicfKBhV.mjs";
|
|
9
|
+
import { t as analyzeApplication } from "./application-routing-DAhNP4u3.mjs";
|
|
11
10
|
import { n as generateQueueTypes, t as generateRouteTypes } from "./route-types-BZi26DVS.mjs";
|
|
11
|
+
import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-BQfyvQKX.mjs";
|
|
12
12
|
import { existsSync, rmSync } from "node:fs";
|
|
13
13
|
import { fileURLToPath } from "node:url";
|
|
14
14
|
//#region src/codegen/prepare.ts
|
|
@@ -40,7 +40,7 @@ async function prepareProject(root) {
|
|
|
40
40
|
if (existsSync(paths.queuesDir)) writeGeneratedFile(outDir, "queues.d.ts", generateQueueTypes(scan.queues, paths.queuesDir, outDir), written);
|
|
41
41
|
else removeGeneratedFile(outDir, "queues.d.ts", removed);
|
|
42
42
|
const schema = discoverSchema(root, paths);
|
|
43
|
-
const hasDbRuntime = schema != null || authEnabled;
|
|
43
|
+
const hasDbRuntime = schema != null || authEnabled || getDatabaseCasing(config) !== void 0;
|
|
44
44
|
if (hasDbRuntime) {
|
|
45
45
|
if (generateDbDts(outDir, schema, dialect)) written.push(join(".void", "db.d.ts"));
|
|
46
46
|
} else removeGeneratedFile(outDir, "db.d.ts", removed);
|