void 1.7.0 → 1.8.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-BfkJ_1PC.mjs → account-cmd-CZKntRH2.mjs} +5 -5
- package/dist/action-key-ByZ6DDld.mjs +64 -0
- package/dist/{application-analysis-OV0CBJ80.mjs → application-analysis-CyTagJQM.mjs} +25 -5
- package/dist/{application-routing-QpyC5G8z.mjs → application-routing-BLrMVpqi.mjs} +1 -1
- package/dist/{auth-CZrthGxs.d.mts → auth-Bk9VGtQW.d.mts} +1 -1
- package/dist/{auth-link-CW1Zh6FM.mjs → auth-link-BOaQWMKw.mjs} +5 -5
- package/dist/{auth-router-CNBKnEZi.mjs → auth-router-D0-VcmDs.mjs} +3 -3
- package/dist/{better-auth-shared-C-0uZg8-.d.mts → better-auth-shared-CQFdtguU.d.mts} +2 -2
- package/dist/boundary-plans-CRmWH68v.d.mts +25 -0
- package/dist/{build-cmd-C9qOKW9W.mjs → build-cmd-JTsXXf2F.mjs} +4 -4
- package/dist/{cache-DVBBbWQL.mjs → cache-D0m3Z_Xf.mjs} +4 -4
- package/dist/{cancel-deploy-COavnjud.mjs → cancel-deploy-Ce6Os4fa.mjs} +3 -3
- package/dist/cli/cli.mjs +1 -1
- package/dist/cli/cloudflare-operation-process.mjs +92 -19
- package/dist/cli/env-schema-probe.d.mts +1 -1
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/{cli-main-DFteHrJI.mjs → cli-main-rkrJy2Ge.mjs} +32 -32
- package/dist/client-D1Vz1Zep.mjs +1 -0
- package/dist/{client-BEZmTP6p.mjs → client-SZPyj4X_.mjs} +1 -1
- package/dist/{cloudflare-auth-DGIivpTb.mjs → cloudflare-auth-7jTqy9Bx.mjs} +1 -1
- package/dist/{cloudflare-cmd-DJaxC-bc.mjs → cloudflare-cmd-ChPLQcTP.mjs} +4 -4
- package/dist/{cloudflare-connect-BjpWmglw.mjs → cloudflare-connect-Co93VYTo.mjs} +2 -2
- package/dist/{cloudflare-operations-k7wYUv56.mjs → cloudflare-operations-CXaDKYj2.mjs} +4 -4
- package/dist/{cloudflare-operations-CZkjFrzH.mjs → cloudflare-operations-DATekLwI.mjs} +1 -1
- package/dist/{cloudflare-process-BcPvlMFd.mjs → cloudflare-process-DmTxZR-N.mjs} +1 -1
- package/dist/{connect-j1F1C_rW.mjs → connect-DlvXt1JR.mjs} +6 -6
- package/dist/{create-project-CE3jOmd5.mjs → create-project-CC_7hmYJ.mjs} +4 -4
- package/dist/{create-project-DZH3aYGQ.mjs → create-project-DzY05xqC.mjs} +1 -1
- package/dist/{db-DyLzzxvM.mjs → db-FhyYGcJJ.mjs} +13 -13
- package/dist/{db-types-DdHHUVPy.mjs → db-types-sVwEpyPR.mjs} +3 -1
- package/dist/{delete-Dey6YoMA.mjs → delete-CModjyOC.mjs} +4 -4
- package/dist/{deploy-Ccw2D2lw.mjs → deploy-Cz9TEzZy.mjs} +34 -24
- package/dist/deploy-DMieisRu.mjs +2 -0
- package/dist/{deploy-managed-static-BBVtpuGv.mjs → deploy-managed-static-DlxxXkAM.mjs} +10 -10
- package/dist/{deploy-transport-Dt0IvSVW.mjs → deploy-transport-DUvm6-CR.mjs} +2 -2
- package/dist/deploy.mjs +5 -5
- package/dist/{dispatch-pYaww76u.mjs → dispatch-CCiaAnSK.mjs} +4 -4
- package/dist/{dist-DeTdhbZc.mjs → dist-Cp4b1_T9.mjs} +1 -1
- package/dist/{dist-BQdgCVQF.mjs → dist-STQXl8ck.mjs} +86 -138
- package/dist/{domain-Dh3mG8Vs.mjs → domain-DvdZPA50.mjs} +5 -5
- package/dist/{drizzle-C8MPqt5m.mjs → drizzle-D4V_06-B.mjs} +1 -1
- package/dist/{drizzle-lFdzSEa9.mjs → drizzle-DBSpPpU1.mjs} +34 -8
- package/dist/{email-DKyMjOYM.mjs → email-ASpNrfLd.mjs} +7 -7
- package/dist/{email-cloudflare-CTt2n_W2.mjs → email-cloudflare-kqoN9jst.mjs} +13 -8
- package/dist/{entry-Bw-G1VVx.mjs → entry-BweGTCgj.mjs} +1 -1
- package/dist/{env-DkZzh_Dd.mjs → env-Bpkg3G5i.mjs} +5 -5
- package/dist/{env-CuzZZyjB.mjs → env-UqS-21xi.mjs} +8 -1
- package/dist/{env-public-CeNeO_AT.d.mts → env-public-DtJL_hZq.d.mts} +8 -7
- package/dist/{env-validation-1snjKtDX.mjs → env-validation-BpCCQE_6.mjs} +3 -3
- package/dist/{env-validation-C8NL3lEH.mjs → env-validation-CN386Utu.mjs} +1 -1
- package/dist/gen-M5fNQKfH.mjs +1 -0
- package/dist/{gen-BZmFOGDQ.mjs → gen-upKJChvd.mjs} +3 -3
- package/dist/{github-cmd-7Oky9qgH.mjs → github-cmd-BvMOlb8Z.mjs} +4 -4
- package/dist/{handler-DjqciiDc.d.mts → handler-BO7Od-z9.d.mts} +3 -2
- package/dist/{headers-CimYIfQI.mjs → headers-COGEDoMN.mjs} +10 -1
- package/dist/help-CItQVDL4.mjs +1 -0
- package/dist/{help-CNuUb47C.mjs → help-TPCjTu6e.mjs} +3 -3
- package/dist/index.d.mts +3 -3
- package/dist/index.mjs +247 -178
- package/dist/{info-DwB8IWIx.mjs → info-EsDyihwf.mjs} +2 -2
- package/dist/{init-CUGSmcED.mjs → init-a4lVagrb.mjs} +13 -14
- package/dist/{link-BlRTGHan.mjs → link-CE55DDzS.mjs} +5 -5
- package/dist/{list-iCg7d5Pa.mjs → list-CxRthQks.mjs} +5 -5
- package/dist/{live-zKGbRT4h.d.mts → live-Kc55iuOQ.d.mts} +2 -2
- package/dist/{login-TA51e5Fw.mjs → login-AfcSGSmE.mjs} +4 -4
- package/dist/login-ZHsAm-I6.mjs +1 -0
- package/dist/{logs-BlyAxlvx.mjs → logs-BgRJuvb1.mjs} +4 -4
- package/dist/{migrate-BH6LCr00.mjs → migrate-BNAh6m_C.mjs} +2 -2
- package/dist/migrate-BflbbZQK.mjs +1 -0
- package/dist/nitro.mjs +2 -2
- package/dist/{node-B0otYjDv.mjs → node-CXFUw0Uz.mjs} +2 -2
- package/dist/{operator-args-DuKAQ3Ks.mjs → operator-args-DGTuCdSE.mjs} +8 -0
- package/dist/{operator-cmd-CoHlJjcT.mjs → operator-cmd-C-viB7Si.mjs} +4 -4
- package/dist/operator-cmd-D6qNuJ_z.mjs +1 -0
- package/dist/output-BsdnNpxa.mjs +1 -0
- package/dist/{output-CXJTIAtF.mjs → output-DNVILSz2.mjs} +1 -1
- package/dist/pages/client.d.mts +28 -3
- package/dist/pages/client.mjs +132 -15
- package/dist/pages/index.d.mts +3 -2
- package/dist/pages/index.mjs +2 -2
- package/dist/pages/islands-plugin.d.mts +1 -1
- package/dist/pages/islands-plugin.mjs +13 -2
- package/dist/pages/protocol.d.mts +2 -2
- package/dist/pages/protocol.mjs +1 -1
- package/dist/{platform-args-DfT8yQBF.mjs → platform-args-CiYeZmc5.mjs} +1 -1
- package/dist/platform-args-DJvF1-kl.mjs +1 -0
- package/dist/{platform-auth-config-MO0VdVs9.mjs → platform-auth-config-Dt2qEc2w.mjs} +6 -6
- package/dist/{platform-auth-protection-Dv208eyL.mjs → platform-auth-protection-B7TaF-PZ.mjs} +4 -4
- package/dist/{platform-auth-recovery-DvAQ674F.mjs → platform-auth-recovery-suXSteJ6.mjs} +4 -4
- package/dist/{platform-cmd-dlSxrcQ7.mjs → platform-cmd-9rvYBBtr.mjs} +7 -7
- package/dist/{platform-cmd-BpUA19r_.mjs → platform-cmd-DuAsIxbU.mjs} +1 -1
- package/dist/{platform-domain-DSO4eUEw.mjs → platform-domain-DhH_vDr6.mjs} +4 -4
- package/dist/{platform-lifecycle-CfcFygHb.mjs → platform-lifecycle-3uI-E2bF.mjs} +1 -1
- package/dist/{platform-lifecycle-BSvsyB_x.mjs → platform-lifecycle-CXmXe2xt.mjs} +13 -13
- package/dist/{platform-management-CrP1XhVd.mjs → platform-management-BBCHfwji.mjs} +3 -3
- package/dist/{platform-management-BMdyt667.mjs → platform-management-PdrgDQTe.mjs} +1 -1
- package/dist/{platform-plans-config-CgDiwflR.mjs → platform-plans-config-BGwkXYDM.mjs} +2 -2
- package/dist/{platform-recovery-CHWwXVZ6.mjs → platform-recovery-C8NxXGRR.mjs} +2 -2
- package/dist/{platform-setup-BTQVbnTC.mjs → platform-setup-Casiffqj.mjs} +2 -2
- package/dist/{plugin-inference-g66Q1Mx9.mjs → plugin-inference-CErfTgEx.mjs} +3 -3
- package/dist/{prepare-DXduEwQp.mjs → prepare-BDKWZgfL.mjs} +5 -5
- package/dist/{prepare-DJYHjpzq.mjs → prepare-BLrzXjIl.mjs} +3 -3
- package/dist/prepare-a1_5usAn.mjs +1 -0
- package/dist/{prerender-render-BN9Lmebs.mjs → prerender-render-BAdYhivW.mjs} +15 -2
- package/dist/prerender-render.d.mts +2 -0
- package/dist/prerender-render.mjs +1 -1
- package/dist/{project-cmd-Dfb1Sg8w.mjs → project-cmd-DzGvxXKH.mjs} +17 -17
- package/dist/{project-team-BO2dyc7S.mjs → project-team-C5XtHbZk.mjs} +4 -4
- package/dist/{project-token-ByO2mEI2.mjs → project-token-B4D5yhHQ.mjs} +4 -4
- package/dist/{project-zero-trust-CoQfwRBR.mjs → project-zero-trust--0LvktDg.mjs} +4 -4
- package/dist/{protocol-yxdHxFLN.mjs → protocol-B1Tvc9-x.mjs} +191 -69
- package/dist/{protocol-xZMvWsrg.d.mts → protocol-Cg2I81NA.d.mts} +9 -2
- package/dist/{provision-D5q-ptD3.mjs → provision-C3yiHdld.mjs} +1 -1
- package/dist/{provision-CMH4-8ri.mjs → provision-CAcrauvr.mjs} +1 -1
- package/dist/{requests-CPOiDkjh.mjs → requests-CrRiTgQA.mjs} +3 -3
- package/dist/resolve-project-C5wC-Hoi.mjs +1 -0
- package/dist/{resolve-project-ClvLMTI9.mjs → resolve-project-Da3OgCU1.mjs} +1 -1
- package/dist/{rollback-BfCs2la4.mjs → rollback-BsmQyj-Q.mjs} +4 -4
- package/dist/{route-types-Cl3x0Q8B.mjs → route-types-CgtlFCDz.mjs} +3 -2
- package/dist/routes-stub.d.mts +4 -3
- package/dist/runtime/auth.d.mts +1 -1
- 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 +1 -1
- package/dist/runtime/client-solid.d.mts +1 -1
- package/dist/runtime/client-svelte.d.mts +1 -1
- package/dist/runtime/client-vue.d.mts +1 -1
- package/dist/runtime/client.d.mts +1 -1
- package/dist/runtime/db.d.mts +6 -3
- package/dist/runtime/db.mjs +2 -2
- package/dist/runtime/env-public.d.mts +1 -1
- package/dist/runtime/env-public.mjs +53 -39
- 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 +8 -3
- package/dist/runtime/routing.mjs +161 -21
- package/dist/runtime/validator.d.mts +1 -1
- package/dist/runtime/ws-server.d.mts +3 -3
- package/dist/runtime/ws.d.mts +1 -1
- package/dist/{scan-L8OSv1f7.mjs → scan-BJ3bj6aP.mjs} +228 -27
- package/dist/{secret-CuI6LTpD.mjs → secret-D0g5oBsP.mjs} +6 -6
- package/dist/{skills-BBO9wMjB.mjs → skills-CoBB9_Ao.mjs} +1 -1
- package/dist/{ast-bindings-BkivMJIo.mjs → static-exports-DFkzL-NX.mjs} +96 -33
- package/dist/{subcommand-prompt-BZMnCA8T.mjs → subcommand-prompt-0yIARXf2.mjs} +2 -2
- package/dist/{types-agfx0alu.d.mts → types-IPut3_Yx.d.mts} +15 -1
- package/dist/{wrapper-BGsi_uHs.mjs → wrapper-CVMZarxf.mjs} +1 -1
- package/dist/{ws-DB8Feytg.d.mts → ws--U7QicYy.d.mts} +2 -2
- package/docs/guide/ai.md +1 -0
- package/docs/guide/app-types.md +1 -0
- package/docs/guide/auth.md +1 -0
- package/docs/guide/database/d1.md +16 -1
- package/docs/guide/database/mysql.md +1 -0
- package/docs/guide/database/postgresql.md +1 -0
- package/docs/guide/database.md +1 -0
- package/docs/guide/deployment.md +1 -0
- package/docs/guide/durable-state.md +1 -0
- package/docs/guide/edge/headers.md +1 -0
- package/docs/guide/edge/prerendering.md +1 -0
- package/docs/guide/edge/redirects.md +1 -0
- package/docs/guide/edge/revalidation.md +3 -0
- package/docs/guide/edge/rewrites.md +1 -0
- package/docs/guide/edge/static-assets.md +1 -0
- package/docs/guide/email/domains.md +1 -0
- package/docs/guide/email/receiving.md +3 -2
- package/docs/guide/email/sending.md +3 -2
- package/docs/guide/email.md +1 -0
- package/docs/guide/env-vars.md +4 -0
- package/docs/guide/index.md +1 -0
- package/docs/guide/jobs.md +1 -0
- package/docs/guide/kv.md +1 -0
- package/docs/guide/live.md +1 -0
- package/docs/guide/pages-routing/actions-and-forms.md +36 -18
- package/docs/guide/pages-routing/errors.md +101 -0
- package/docs/guide/pages-routing/head.md +1 -0
- package/docs/guide/pages-routing/islands.md +1 -0
- package/docs/guide/pages-routing/layouts.md +3 -0
- package/docs/guide/pages-routing/loaders.md +1 -0
- package/docs/guide/pages-routing/markdown.md +1 -1
- package/docs/guide/pages-routing/overview.md +3 -0
- package/docs/guide/pages-routing/view-transitions.md +1 -0
- package/docs/guide/platform/administration/access.md +1 -0
- package/docs/guide/platform/administration/connected-apps.md +4 -0
- package/docs/guide/platform/administration/email.md +1 -0
- package/docs/guide/platform/administration/operations.md +1 -0
- package/docs/guide/platform/administration/plans.md +1 -0
- package/docs/guide/platform/administration/projects.md +11 -0
- package/docs/guide/platform/administration/zero-trust.md +1 -0
- package/docs/guide/platform/development/local.md +1 -0
- package/docs/guide/platform/development/runtime.md +1 -0
- package/docs/guide/platform/development/schema-ci.md +1 -0
- package/docs/guide/platform/installation/ci.md +1 -0
- package/docs/guide/platform/installation/credentials.md +1 -0
- package/docs/guide/platform/installation/domains.md +1 -0
- package/docs/guide/platform/installation/first-deployment.md +1 -0
- package/docs/guide/platform/installation/maintenance.md +1 -0
- package/docs/guide/platform/installation/prerequisites.md +1 -0
- package/docs/guide/platform/installation/setup.md +1 -0
- package/docs/guide/platform/installation/uninstall.md +1 -0
- package/docs/guide/platform-administration.md +1 -0
- package/docs/guide/platform-development.md +1 -0
- package/docs/guide/project-collaboration.md +1 -0
- package/docs/guide/queues.md +3 -0
- package/docs/guide/quickstart.md +3 -2
- package/docs/guide/remote-dev.md +1 -0
- package/docs/guide/sandboxes.md +1 -0
- package/docs/guide/self-hosted-platform.md +1 -0
- package/docs/guide/server-routing.md +1 -0
- package/docs/guide/sse.md +1 -0
- package/docs/guide/ssg.md +1 -0
- package/docs/guide/ssr.md +1 -0
- package/docs/guide/storage.md +1 -0
- package/docs/guide/testing.md +62 -0
- package/docs/guide/type-safety.md +1 -0
- package/docs/guide/typed-fetch.md +1 -0
- package/docs/guide/websockets.md +1 -0
- package/docs/index.md +1 -0
- package/docs/integrations/agents.md +1 -0
- package/docs/integrations/cloudflare.md +1 -0
- package/docs/integrations/frameworks/analog.md +1 -0
- package/docs/integrations/frameworks/astro.md +1 -0
- package/docs/integrations/frameworks/nuxt.md +1 -0
- package/docs/integrations/frameworks/overview.md +1 -0
- package/docs/integrations/frameworks/react-router.md +1 -0
- package/docs/integrations/frameworks/sveltekit.md +1 -0
- package/docs/integrations/frameworks/tanstack-start.md +1 -0
- package/docs/integrations/hono.md +1 -0
- package/docs/integrations/nodejs-bun-deno.md +1 -0
- package/docs/reference/api/auth.md +1 -0
- package/docs/reference/api/client.md +1 -0
- package/docs/reference/api/database.md +24 -1
- package/docs/reference/api/deploy.md +4 -0
- package/docs/reference/api/durable.md +1 -0
- package/docs/reference/api/env.md +1 -0
- package/docs/reference/api/handlers.md +1 -0
- package/docs/reference/api/pages.md +22 -4
- package/docs/reference/api/plugin.md +1 -0
- package/docs/reference/api/resources.md +1 -0
- package/docs/reference/api/rewrites.md +2 -1
- package/docs/reference/api/types.md +1 -0
- package/docs/reference/api.md +1 -0
- package/docs/reference/cli/auth.md +1 -0
- package/docs/reference/cli/database.md +1 -0
- package/docs/reference/cli/deploy.md +1 -0
- package/docs/reference/cli/domains.md +1 -0
- package/docs/reference/cli/email.md +1 -0
- package/docs/reference/cli/generate.md +1 -0
- package/docs/reference/cli/github.md +1 -0
- package/docs/reference/cli/platform-config.md +1 -0
- package/docs/reference/cli/platform-email.md +1 -0
- package/docs/reference/cli/platform-installation.md +1 -0
- package/docs/reference/cli/platform-operations.md +1 -0
- package/docs/reference/cli/platform-users.md +23 -0
- package/docs/reference/cli/platform-zero-trust.md +1 -0
- package/docs/reference/cli/platform.md +1 -0
- package/docs/reference/cli/project.md +1 -0
- package/docs/reference/cli/secrets.md +1 -0
- package/docs/reference/cli/setup.md +1 -0
- package/docs/reference/cli.md +3 -0
- package/docs/reference/config.md +1 -0
- package/docs/reference/resource-inference.md +1 -0
- package/docs/reference/structure.md +1 -0
- package/package.json +25 -25
- package/skills/void/SKILL.md +2 -0
- package/dist/action-key-XtKKbbsi.mjs +0 -25
- package/dist/client-BAxLpSKv.mjs +0 -1
- package/dist/deploy-DEZkUS77.mjs +0 -2
- package/dist/gen-C6iknRdI.mjs +0 -1
- package/dist/help-C_cqTByy.mjs +0 -1
- package/dist/login-C4q1S-5b.mjs +0 -1
- package/dist/migrate-CVBsSFhC.mjs +0 -1
- package/dist/operator-cmd-DnaCnCSP.mjs +0 -1
- package/dist/output-CNsMDEd2.mjs +0 -1
- package/dist/platform-args-B7-wQ0_B.mjs +0 -1
- package/dist/prepare-Bx4a8cb1.mjs +0 -1
- package/dist/resolve-project-BALVa9q0.mjs +0 -1
|
@@ -3,7 +3,7 @@ import { t as glob } from "./dist-BWNkVq50.mjs";
|
|
|
3
3
|
import { p as readConfig } from "./config-5oSQhZNj.mjs";
|
|
4
4
|
import { i as voidWarn } from "./log-D9hwSySP.mjs";
|
|
5
5
|
import { n as readProjectPaths } from "./project-paths-G0yut6Zz.mjs";
|
|
6
|
-
import {
|
|
6
|
+
import { i as staticLiteral, n as readStaticExports, o as bindingNames, r as staticExports, t as mayExportAll } from "./static-exports-DFkzL-NX.mjs";
|
|
7
7
|
import { n as isIdentifier, o as moduleExportName, r as isLiteral } from "./ast-Cv0JwXqb.mjs";
|
|
8
8
|
import { t as MagicString } from "./dist-B6eN80gc.mjs";
|
|
9
9
|
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
@@ -175,6 +175,12 @@ function invalidateSourceAnalysis(path) {
|
|
|
175
175
|
entries.delete(toSlash(path));
|
|
176
176
|
}
|
|
177
177
|
// src/pages/island-imports.ts
|
|
178
|
+
const SCRIPT_ATTRIBUTE_RE = /([^\s"'=/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'>]+)))?/g;
|
|
179
|
+
/** `<script module>` (Svelte 5) or `<script context="module">` (Svelte 4). */
|
|
180
|
+
function isSvelteModuleScript(attributes) {
|
|
181
|
+
for (const [, name, doubleQuoted, singleQuoted, bare] of attributes.matchAll(SCRIPT_ATTRIBUTE_RE)) if (name === "module" || name === "context" && (doubleQuoted ?? singleQuoted ?? bare) === "module") return true;
|
|
182
|
+
return false;
|
|
183
|
+
}
|
|
178
184
|
const MARKDOWN_SCRIPT_RE = /^<script\b[^>]*>([\s\S]*?)<\/script>\s*\n?/;
|
|
179
185
|
/**
|
|
180
186
|
* The whole JS/TS module, each `<script>` block of a Vue/Svelte SFC, or the
|
|
@@ -197,13 +203,16 @@ function scriptBlocks(code, filename) {
|
|
|
197
203
|
filename
|
|
198
204
|
}];
|
|
199
205
|
const scriptFilename = filename.replace(/\.(?:vue|svelte)$/, ".ts");
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
206
|
+
const svelte = filename.endsWith(".svelte");
|
|
207
|
+
return [...code.matchAll(/<script\b([^>]*)>([\s\S]*?)<\/script\s*>/gi)].map((match) => {
|
|
208
|
+
const source = match[2];
|
|
209
|
+
const block = {
|
|
203
210
|
source,
|
|
204
211
|
offset: match.index + match[0].indexOf(source),
|
|
205
212
|
filename: scriptFilename
|
|
206
213
|
};
|
|
214
|
+
if (svelte && !isSvelteModuleScript(match[1])) block.instance = true;
|
|
215
|
+
return block;
|
|
207
216
|
});
|
|
208
217
|
}
|
|
209
218
|
/** Collect stylesheet imports from authored modules without treating dynamic imports or text as dependencies. */
|
|
@@ -306,6 +315,7 @@ function resolveEffectiveLayoutEntries(page, layouts, namedLayouts) {
|
|
|
306
315
|
if (page.layout === false) return [];
|
|
307
316
|
const defaultChain = resolveLayoutChain(page.componentId, layouts, page.componentPath).map((layout) => ({
|
|
308
317
|
id: toLayoutId(layout),
|
|
318
|
+
directory: layout.directory,
|
|
309
319
|
definition: layout
|
|
310
320
|
}));
|
|
311
321
|
if (page.layout === void 0) return defaultChain;
|
|
@@ -314,9 +324,13 @@ function resolveEffectiveLayoutEntries(page, layouts, namedLayouts) {
|
|
|
314
324
|
if (!resolved) return defaultChain;
|
|
315
325
|
const namedEntry = {
|
|
316
326
|
id: toLayoutId(resolved),
|
|
327
|
+
directory: defaultChain.at(-1)?.directory ?? (page.componentPath ?? page.componentId).split("/").slice(0, -1).join("/"),
|
|
317
328
|
definition: resolved
|
|
318
329
|
};
|
|
319
|
-
if (isExclusive || defaultChain.length === 0)
|
|
330
|
+
if (isExclusive || defaultChain.length === 0) {
|
|
331
|
+
namedEntry.directory = (page.componentPath ?? page.componentId).split("/").slice(0, -1).join("/");
|
|
332
|
+
return [namedEntry];
|
|
333
|
+
}
|
|
320
334
|
const chain = [...defaultChain];
|
|
321
335
|
chain[chain.length - 1] = namedEntry;
|
|
322
336
|
return chain;
|
|
@@ -328,6 +342,91 @@ function resolveEffectiveLayoutChain(page, layouts, namedLayouts) {
|
|
|
328
342
|
function resolveLayoutIds(page, layouts, namedLayouts) {
|
|
329
343
|
return resolveEffectiveLayoutEntries(page, layouts, namedLayouts).map((layout) => layout.id);
|
|
330
344
|
}
|
|
345
|
+
// src/pages/boundary-plans.ts
|
|
346
|
+
const encloses = (outer, inner) => !outer || outer === inner || inner.startsWith(outer + "/");
|
|
347
|
+
/** Build-local render identities preserve a named layout's logical placement. */
|
|
348
|
+
function createBoundaryManifest(scan) {
|
|
349
|
+
if (!scan.boundaries?.length) return {
|
|
350
|
+
plans: {},
|
|
351
|
+
pages: {}
|
|
352
|
+
};
|
|
353
|
+
const plans = {};
|
|
354
|
+
const pages = {};
|
|
355
|
+
const pageIds = new Set(scan.pages.map((page) => page.componentId));
|
|
356
|
+
const layoutKey = (id) => pageIds.has(id) ? id.replace(/(^|\/)([^/]+)$/, "$1_$2") : id;
|
|
357
|
+
for (const page of scan.pages) {
|
|
358
|
+
const directory = page.componentPath.split("/").slice(0, -1).join("/");
|
|
359
|
+
const layouts = resolveEffectiveLayoutEntries(page, scan.layouts, scan.namedLayouts);
|
|
360
|
+
const candidates = (scan.boundaries ?? []).filter((b) => encloses(b.directory, directory)).sort((a, b) => b.directory.length - a.directory.length);
|
|
361
|
+
const add = (boundary) => {
|
|
362
|
+
const retained = layouts.filter((l) => encloses(l.directory, boundary.directory)).map((l) => layoutKey(l.id));
|
|
363
|
+
const id = `_void:boundary:${JSON.stringify([
|
|
364
|
+
page.componentId,
|
|
365
|
+
boundary.componentId,
|
|
366
|
+
retained
|
|
367
|
+
])}`;
|
|
368
|
+
plans[id] = {
|
|
369
|
+
id,
|
|
370
|
+
...boundary,
|
|
371
|
+
source: page.componentId,
|
|
372
|
+
layouts: retained
|
|
373
|
+
};
|
|
374
|
+
return id;
|
|
375
|
+
};
|
|
376
|
+
const errors = candidates.filter((b) => b.kind === "error");
|
|
377
|
+
const notFound = candidates.find((b) => b.kind === "not-found");
|
|
378
|
+
pages[page.componentId] = {
|
|
379
|
+
...notFound ? {
|
|
380
|
+
notFound: add(notFound),
|
|
381
|
+
notFoundErrors: errors.filter((b) => encloses(b.directory, notFound.directory)).map(add)
|
|
382
|
+
} : {},
|
|
383
|
+
errors: errors.map(add),
|
|
384
|
+
catches: errors.map((b) => ({
|
|
385
|
+
depth: layouts.filter((l) => encloses(l.directory, b.directory)).length,
|
|
386
|
+
plan: add(b)
|
|
387
|
+
}))
|
|
388
|
+
};
|
|
389
|
+
}
|
|
390
|
+
const root = scan.boundaries?.find((b) => b.kind === "not-found" && !b.directory);
|
|
391
|
+
if (root) {
|
|
392
|
+
const id = `_void:boundary:root-not-found:${JSON.stringify(scan.layouts.filter((l) => !l.directory).map((l) => l.filePath))}`;
|
|
393
|
+
plans[id] = {
|
|
394
|
+
id,
|
|
395
|
+
...root,
|
|
396
|
+
source: id,
|
|
397
|
+
layouts: scan.layouts.filter((l) => !l.directory).map((l) => layoutKey(l.directory ? l.directory + "/layout" : "layout"))
|
|
398
|
+
};
|
|
399
|
+
const error = scan.boundaries?.find((b) => b.kind === "error" && !b.directory);
|
|
400
|
+
const rootErrors = [];
|
|
401
|
+
if (error) {
|
|
402
|
+
const errorId = `_void:boundary:root-error:${id}`;
|
|
403
|
+
plans[errorId] = {
|
|
404
|
+
...error,
|
|
405
|
+
id: errorId,
|
|
406
|
+
source: id,
|
|
407
|
+
layouts: [...plans[id].layouts]
|
|
408
|
+
};
|
|
409
|
+
rootErrors.push(errorId);
|
|
410
|
+
}
|
|
411
|
+
pages[id] = {
|
|
412
|
+
errors: rootErrors,
|
|
413
|
+
catches: rootErrors.map((plan) => ({
|
|
414
|
+
depth: plans[id].layouts.length,
|
|
415
|
+
plan
|
|
416
|
+
}))
|
|
417
|
+
};
|
|
418
|
+
return {
|
|
419
|
+
plans,
|
|
420
|
+
pages,
|
|
421
|
+
root: id,
|
|
422
|
+
rootErrors
|
|
423
|
+
};
|
|
424
|
+
}
|
|
425
|
+
return {
|
|
426
|
+
plans,
|
|
427
|
+
pages
|
|
428
|
+
};
|
|
429
|
+
}
|
|
331
430
|
// src/pages/manifest.ts
|
|
332
431
|
/**
|
|
333
432
|
* Generates the component import map and layout tree as code strings.
|
|
@@ -385,6 +484,13 @@ for (const [pattern, id, load, chain] of __voidDynamicRoutes) {
|
|
|
385
484
|
routes.push({ pattern, id });
|
|
386
485
|
}`);
|
|
387
486
|
for (const layout of [...scan.layouts, ...scan.namedLayouts]) lines.push(`components[${JSON.stringify(layoutKey(toLayoutId(layout)))}] = ${load(layout.filePath)};`);
|
|
487
|
+
for (const boundary of scan.boundaries ?? []) lines.push(`components[${JSON.stringify(boundary.componentId)}] = ${load(boundary.filePath)};`);
|
|
488
|
+
const boundaryManifest = createBoundaryManifest(scan);
|
|
489
|
+
lines.push(`const boundaryManifest = ${JSON.stringify(boundaryManifest)};`);
|
|
490
|
+
for (const plan of Object.values(boundaryManifest.plans)) {
|
|
491
|
+
lines.push(`components[${JSON.stringify(plan.id)}] = ${load(plan.filePath)};`);
|
|
492
|
+
lines.push(`layoutTree[${JSON.stringify(plan.id)}] = ${JSON.stringify(plan.layouts)};`);
|
|
493
|
+
}
|
|
388
494
|
lines.push("const routeMeta = {");
|
|
389
495
|
for (const page of scan.pages) {
|
|
390
496
|
const flags = [];
|
|
@@ -393,6 +499,7 @@ for (const [pattern, id, load, chain] of __voidDynamicRoutes) {
|
|
|
393
499
|
if (flags.length > 0) lines.push(` ${JSON.stringify(page.componentId)}: { ${flags.join(", ")} },`);
|
|
394
500
|
}
|
|
395
501
|
lines.push("};");
|
|
502
|
+
for (const plan of Object.values(boundaryManifest.plans)) lines.push(`routeMeta[${JSON.stringify(plan.id)}] = { boundary: true };`);
|
|
396
503
|
lines.push(`function matchRoute(path) {
|
|
397
504
|
const id = __voidStaticRouteIds.get(path);
|
|
398
505
|
if (id !== undefined) return id;
|
|
@@ -445,14 +552,60 @@ const MAX_REVALIDATE = 31536e3;
|
|
|
445
552
|
const warnedLayoutPaths = /* @__PURE__ */ new Set();
|
|
446
553
|
/** Unreachable pages already reported, for the same reason. */
|
|
447
554
|
const warnedShadowedPages = /* @__PURE__ */ new Set();
|
|
555
|
+
/** Ignored page settings already reported, for the same reason. */
|
|
556
|
+
const warnedPageSettings = /* @__PURE__ */ new Set();
|
|
557
|
+
/**
|
|
558
|
+
* Page settings (layout, revalidate, prerender, ssr) are read from the source
|
|
559
|
+
* without running it. One the source does not show keeps its default, as
|
|
560
|
+
* before, with a warning: a hard error would break builds that already ship it.
|
|
561
|
+
*/
|
|
562
|
+
function warnPageSettings(pagesDir, warnings) {
|
|
563
|
+
for (const warning of warnings) {
|
|
564
|
+
const key = `${pagesDir}\0${warning}`;
|
|
565
|
+
if (!warnedPageSettings.has(key)) {
|
|
566
|
+
warnedPageSettings.add(key);
|
|
567
|
+
voidWarn(warning);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
const LAYOUT_EXPORT = /* @__PURE__ */ new Set(["layout"]);
|
|
572
|
+
function mayExportLayout(source) {
|
|
573
|
+
return source.includes("layout") || mayExportAll(source);
|
|
574
|
+
}
|
|
575
|
+
/** The first script block that declares a readable layout wins; warnings only apply when none does. */
|
|
448
576
|
function componentLayout(source, filename) {
|
|
449
|
-
if (!source
|
|
577
|
+
if (!mayExportLayout(source)) return {
|
|
578
|
+
layout: void 0,
|
|
579
|
+
warnings: []
|
|
580
|
+
};
|
|
581
|
+
let ignored;
|
|
582
|
+
let exportsAll = false;
|
|
450
583
|
for (const script of scriptBlocks(source, filename)) {
|
|
451
|
-
if (!script.source
|
|
452
|
-
const
|
|
584
|
+
if (!mayExportLayout(script.source)) continue;
|
|
585
|
+
const exports = readStaticExports(script.filename, script.source, LAYOUT_EXPORT);
|
|
586
|
+
const initializer = exports.initializers.get("layout");
|
|
453
587
|
const value = staticLiteral(initializer);
|
|
454
|
-
if (typeof value === "string" || value === false) return
|
|
588
|
+
if (typeof value === "string" || value === false) return {
|
|
589
|
+
layout: value,
|
|
590
|
+
warnings: []
|
|
591
|
+
};
|
|
592
|
+
if (script.instance) continue;
|
|
593
|
+
exportsAll ||= exports.exportsAll;
|
|
594
|
+
if (exports.unreadable.has("layout")) ignored ??= `pages: layout in '${filename}' is ignored. Declare it in that file as \`export const layout = '<name>'\`; re-exported layouts and other export forms are not read.`;
|
|
595
|
+
else if (initializer) ignored ??= `pages: layout in '${filename}' is ignored. It must be a string literal or \`false\`, such as \`export const layout = 'landing'\`.`;
|
|
455
596
|
}
|
|
597
|
+
if (ignored) return {
|
|
598
|
+
layout: void 0,
|
|
599
|
+
warnings: [ignored]
|
|
600
|
+
};
|
|
601
|
+
if (exportsAll) return {
|
|
602
|
+
layout: void 0,
|
|
603
|
+
warnings: [`pages: '${filename}' uses \`export * from\`. Void does not read a layout export through it, so declare layout in that file with \`export const\`.`]
|
|
604
|
+
};
|
|
605
|
+
return {
|
|
606
|
+
layout: void 0,
|
|
607
|
+
warnings: []
|
|
608
|
+
};
|
|
456
609
|
}
|
|
457
610
|
const TRANSPARENT_EXPRESSION_TYPES = /* @__PURE__ */ new Set([
|
|
458
611
|
"ParenthesizedExpression",
|
|
@@ -465,8 +618,41 @@ function readLiteral(node) {
|
|
|
465
618
|
while (node && TRANSPARENT_EXPRESSION_TYPES.has(node.type)) node = node.expression;
|
|
466
619
|
return isLiteral(node) ? node.value : void 0;
|
|
467
620
|
}
|
|
621
|
+
const PAGE_SETTINGS = [
|
|
622
|
+
"revalidate",
|
|
623
|
+
"prerender",
|
|
624
|
+
"ssr"
|
|
625
|
+
];
|
|
626
|
+
const PAGE_SETTING_SET = new Set(PAGE_SETTINGS);
|
|
627
|
+
const PAGE_SETTING_PLACEHOLDERS = {
|
|
628
|
+
revalidate: "<seconds>",
|
|
629
|
+
prerender: "<boolean>",
|
|
630
|
+
ssr: "<boolean>"
|
|
631
|
+
};
|
|
632
|
+
/** Read revalidate, prerender and ssr from a page's server file, collecting warnings for values it cannot read. */
|
|
633
|
+
function readPageSettings(program, filename, metadata) {
|
|
634
|
+
const settings = staticExports(program, PAGE_SETTING_SET);
|
|
635
|
+
for (const name of PAGE_SETTINGS) {
|
|
636
|
+
if (settings.unreadable.has(name)) {
|
|
637
|
+
metadata.warnings.push(`pages: ${name} in '${filename}' is ignored. Declare it in that file as \`export const ${name} = ${PAGE_SETTING_PLACEHOLDERS[name]}\`; re-exported settings and other export forms are not read.`);
|
|
638
|
+
continue;
|
|
639
|
+
}
|
|
640
|
+
const initializer = settings.initializers.get(name);
|
|
641
|
+
if (!initializer) continue;
|
|
642
|
+
const value = readLiteral(initializer);
|
|
643
|
+
if (name === "revalidate") {
|
|
644
|
+
if (typeof value === "number" && Number.isInteger(value) && value >= 0) metadata.revalidate = value;
|
|
645
|
+
else metadata.warnings.push(`pages: revalidate in '${filename}' is ignored. It must be a nonnegative integer literal, such as \`export const revalidate = 3600\`.`);
|
|
646
|
+
} else if (typeof value === "boolean") metadata[name] = value;
|
|
647
|
+
else metadata.warnings.push(`pages: ${name} in '${filename}' is ignored. It must be \`true\` or \`false\`.`);
|
|
648
|
+
}
|
|
649
|
+
if (settings.exportsAll) metadata.warnings.push(`pages: '${filename}' uses \`export * from\`. Void does not see page exports through it, so export loader, action, actions and getPrerenderPaths by name, and declare revalidate, prerender and ssr in that file with \`export const\`.`);
|
|
650
|
+
}
|
|
468
651
|
function detectPageServerMetadata(source, filename) {
|
|
469
|
-
const metadata = {
|
|
652
|
+
const metadata = {
|
|
653
|
+
methods: [],
|
|
654
|
+
warnings: []
|
|
655
|
+
};
|
|
470
656
|
let parsed;
|
|
471
657
|
try {
|
|
472
658
|
parsed = parseSync(filename, source);
|
|
@@ -481,20 +667,8 @@ function detectPageServerMetadata(source, filename) {
|
|
|
481
667
|
const declaration = exported.declaration;
|
|
482
668
|
if (declaration?.type === "VariableDeclaration") {
|
|
483
669
|
const variables = declaration;
|
|
484
|
-
for (const variable of variables.declarations ?? [])
|
|
485
|
-
|
|
486
|
-
else if (name === "getPrerenderPaths") metadata.hasGetPrerenderPaths = true;
|
|
487
|
-
if (isIdentifier(variable.id) && variables.kind === "const") {
|
|
488
|
-
const name = variable.id.name;
|
|
489
|
-
if (name === "revalidate") {
|
|
490
|
-
const value = readLiteral(variable.init);
|
|
491
|
-
if (typeof value === "number" && Number.isInteger(value) && value >= 0) metadata.revalidate = value;
|
|
492
|
-
} else if (name === "prerender" || name === "ssr") {
|
|
493
|
-
const value = readLiteral(variable.init);
|
|
494
|
-
if (typeof value === "boolean") metadata[name] = value;
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
}
|
|
670
|
+
for (const variable of variables.declarations ?? []) for (const name of bindingNames(variable.id)) if (PAGE_METHODS.has(name)) metadata.methods.push(name);
|
|
671
|
+
else if (name === "getPrerenderPaths") metadata.hasGetPrerenderPaths = true;
|
|
498
672
|
} else if (declaration?.type === "FunctionDeclaration") {
|
|
499
673
|
const functionName = declaration.id;
|
|
500
674
|
if (isIdentifier(functionName)) {
|
|
@@ -509,6 +683,7 @@ function detectPageServerMetadata(source, filename) {
|
|
|
509
683
|
else if (name === "getPrerenderPaths") metadata.hasGetPrerenderPaths = true;
|
|
510
684
|
}
|
|
511
685
|
}
|
|
686
|
+
readPageSettings(program, filename, metadata);
|
|
512
687
|
return metadata;
|
|
513
688
|
}
|
|
514
689
|
function inferAutoPrerender(page, options) {
|
|
@@ -560,8 +735,28 @@ async function scanPages(root, options) {
|
|
|
560
735
|
const pages = [];
|
|
561
736
|
const layouts = [];
|
|
562
737
|
const namedLayouts = [];
|
|
738
|
+
const boundaries = [];
|
|
563
739
|
for (const file of files.sort()) {
|
|
564
740
|
const segments = file.split("/");
|
|
741
|
+
const boundary = /^_(error|not-found)(?:\.(dev|prod))?(\.island)?\.(tsx|jsx|vue|svelte)$/.exec(segments.at(-1));
|
|
742
|
+
if (boundary && !segments.slice(0, -1).some((segment) => segment.startsWith("_"))) {
|
|
743
|
+
const env = boundary[2];
|
|
744
|
+
if (options?.environment && env && env !== options.environment) continue;
|
|
745
|
+
const base = file.slice(0, -extname(file).length);
|
|
746
|
+
if (boundary[3] || ROUTE_EXTENSIONS.some((ext) => existsSync(join(pagesDir, `${base}.server.${ext}`))) || deriveFromSource(join(pagesDir, file), "page-boundary-layout", (source) => scriptBlocks(source, file).some((script) => readStaticExports(script.filename, script.source, /* @__PURE__ */ new Set(["layout"])).initializers.has("layout")))) throw new Error(`pages: Boundary '${file}' cannot be an island, select a layout, or have a .server companion.`);
|
|
747
|
+
const directory = segments.slice(0, -1).join("/");
|
|
748
|
+
for (const prior of boundaries) {
|
|
749
|
+
const priorEnv = /^_(?:error|not-found)\.(dev|prod)\./.exec(basename(prior.filePath))?.[1];
|
|
750
|
+
if (prior.directory === directory && prior.kind === boundary[1] && (!env || !priorEnv || env === priorEnv)) throw new Error(`pages: Ambiguous boundary files '${prior.filePath}' and '${file}'.`);
|
|
751
|
+
}
|
|
752
|
+
boundaries.push({
|
|
753
|
+
kind: boundary[1],
|
|
754
|
+
directory,
|
|
755
|
+
componentId: base,
|
|
756
|
+
filePath: file
|
|
757
|
+
});
|
|
758
|
+
continue;
|
|
759
|
+
}
|
|
565
760
|
if (segments.some((s) => s.startsWith("_") && s !== "_layouts")) continue;
|
|
566
761
|
const ext = extname(file);
|
|
567
762
|
let base = basename(file, ext);
|
|
@@ -613,6 +808,7 @@ async function scanPages(root, options) {
|
|
|
613
808
|
prerender = metadata.prerender;
|
|
614
809
|
ssr = metadata.ssr;
|
|
615
810
|
hasGetPrerenderPaths = metadata.hasGetPrerenderPaths;
|
|
811
|
+
warnPageSettings(pagesDir, metadata.warnings);
|
|
616
812
|
break;
|
|
617
813
|
}
|
|
618
814
|
}
|
|
@@ -635,7 +831,11 @@ async function scanPages(root, options) {
|
|
|
635
831
|
metadata: extractFrontmatterMeta(source),
|
|
636
832
|
layout: extractFrontmatterLayout(source, matter)
|
|
637
833
|
})));
|
|
638
|
-
} else
|
|
834
|
+
} else {
|
|
835
|
+
const component = deriveFromSource(join(pagesDir, file), "page-layout", (source) => componentLayout(source, file));
|
|
836
|
+
layout = component.layout;
|
|
837
|
+
warnPageSettings(pagesDir, component.warnings);
|
|
838
|
+
}
|
|
639
839
|
pages.push({
|
|
640
840
|
pattern: trailingSlash && route.pattern !== "/" ? `${route.pattern}/` : route.pattern,
|
|
641
841
|
params: route.params,
|
|
@@ -687,7 +887,8 @@ async function scanPages(root, options) {
|
|
|
687
887
|
return {
|
|
688
888
|
pages,
|
|
689
889
|
layouts,
|
|
690
|
-
namedLayouts
|
|
890
|
+
namedLayouts,
|
|
891
|
+
...boundaries.length ? { boundaries } : {}
|
|
691
892
|
};
|
|
692
893
|
}
|
|
693
894
|
function compareText(left, right) {
|
|
@@ -766,4 +967,4 @@ function extractFrontmatterLayout(source, matter) {
|
|
|
766
967
|
if (value === false || value === "false") return false;
|
|
767
968
|
return typeof value === "string" ? value : JSON.stringify(value);
|
|
768
969
|
}
|
|
769
|
-
export {
|
|
970
|
+
export { isRouteEnabledForEnvironment as _, createBoundaryManifest as a, ROUTE_EXTENSIONS as b, resolveLayoutIds as c, editIslandSource as d, findIslandImports as f, compareRouteSpecificity as g, invalidateSourceAnalysis as h, patternToRegex as i, resolveNamedLayout as l, deriveFromSource as m, scanPages as n, resolveEffectiveLayoutChain as o, findStaticCssImports as p, generateComponentManifest as r, resolveLayoutChain as s, pageFileEnvironment as t, toLayoutId as u, parseRouteFilename as v, parseWebSocketFilename as y };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { A as confirm, H as outro, L as log, O as cancel, U as password, tt as isCancel } from "./dist-
|
|
1
|
+
import { A as confirm, H as outro, L as log, O as cancel, U as password, tt as isCancel } from "./dist-STQXl8ck.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-CCk9Seol.mjs";
|
|
3
|
-
import { r as PlatformClient } from "./client-
|
|
4
|
-
import { _ as validateSecretValues } from "./env-validation-
|
|
5
|
-
import { m as printSuccess, o as formatCount, p as note } from "./output-
|
|
3
|
+
import { r as PlatformClient } from "./client-SZPyj4X_.mjs";
|
|
4
|
+
import { _ as validateSecretValues } from "./env-validation-BpCCQE_6.mjs";
|
|
5
|
+
import { m as printSuccess, o as formatCount, p as note } from "./output-DNVILSz2.mjs";
|
|
6
6
|
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-CLwxcEdq.mjs";
|
|
7
|
-
import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-
|
|
7
|
+
import { a as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-Da3OgCU1.mjs";
|
|
8
8
|
import { readFileSync } from "node:fs";
|
|
9
9
|
import { parseEnv } from "node:util";
|
|
10
10
|
// src/cli/secret.ts
|
|
@@ -97,7 +97,7 @@ async function resolveSecretBackend(root, args) {
|
|
|
97
97
|
}
|
|
98
98
|
async function resolveCloudflareSecretBackend(root, args) {
|
|
99
99
|
if (args.projectName) throw new Error("secret: --project selects a Void platform project and is not used for direct Cloudflare apps.");
|
|
100
|
-
const { deleteCloudflareSecret, listCloudflareSecrets, putCloudflareSecret, resolveCloudflareOperationContext, syncCloudflareSecrets } = await import("./cloudflare-operations-
|
|
100
|
+
const { deleteCloudflareSecret, listCloudflareSecrets, putCloudflareSecret, resolveCloudflareOperationContext, syncCloudflareSecrets } = await import("./cloudflare-operations-DATekLwI.mjs");
|
|
101
101
|
const context = resolveCloudflareOperationContext(root);
|
|
102
102
|
return {
|
|
103
103
|
target: "Cloudflare Worker",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { L as log } from "./dist-
|
|
1
|
+
import { L as log } from "./dist-STQXl8ck.mjs";
|
|
2
2
|
import { a as join, s as relative } from "./dist-DMYe8CZJ.mjs";
|
|
3
3
|
import { r as getPackageDir } from "./agents-DRo8gzni.mjs";
|
|
4
4
|
import { existsSync, mkdirSync, readFileSync, readdirSync, readlinkSync, symlinkSync } from "node:fs";
|
|
@@ -1,36 +1,5 @@
|
|
|
1
|
-
import { n as isIdentifier } from "./ast-Cv0JwXqb.mjs";
|
|
1
|
+
import { n as isIdentifier, o as moduleExportName } from "./ast-Cv0JwXqb.mjs";
|
|
2
2
|
import { parseSync } from "vite";
|
|
3
|
-
// src/shared/static-exports.ts
|
|
4
|
-
/** Read the initializer of directly exported constants without evaluating user code. */
|
|
5
|
-
function staticExportInitializers(filename, source, names) {
|
|
6
|
-
const result = /* @__PURE__ */ new Map();
|
|
7
|
-
const program = parseSync(filename, source).program;
|
|
8
|
-
for (const statement of program.body ?? []) {
|
|
9
|
-
if (statement.type !== "ExportNamedDeclaration") continue;
|
|
10
|
-
const declaration = statement.declaration;
|
|
11
|
-
if (declaration?.type !== "VariableDeclaration" || declaration.kind !== "const") continue;
|
|
12
|
-
for (const variable of declaration.declarations ?? []) if (isIdentifier(variable.id) && names.has(variable.id.name) && variable.init) result.set(variable.id.name, variable.init);
|
|
13
|
-
}
|
|
14
|
-
return result;
|
|
15
|
-
}
|
|
16
|
-
function unwrapStaticExpression(node) {
|
|
17
|
-
while (node && [
|
|
18
|
-
"ParenthesizedExpression",
|
|
19
|
-
"TSAsExpression",
|
|
20
|
-
"TSSatisfiesExpression",
|
|
21
|
-
"TSTypeAssertion"
|
|
22
|
-
].includes(node.type)) node = node.expression;
|
|
23
|
-
return node;
|
|
24
|
-
}
|
|
25
|
-
function staticLiteral(node) {
|
|
26
|
-
node = unwrapStaticExpression(node);
|
|
27
|
-
if (node?.type === "Literal") return node.value;
|
|
28
|
-
if (node?.type === "TemplateLiteral") {
|
|
29
|
-
const expressions = node.expressions;
|
|
30
|
-
const quasis = node.quasis;
|
|
31
|
-
if (expressions?.length === 0 && quasis?.length === 1) return quasis[0]?.value?.cooked;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
3
|
// ../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/walker.js
|
|
35
4
|
/**
|
|
36
5
|
* @typedef { import('estree').Node} Node
|
|
@@ -288,4 +257,98 @@ function bindingResolver(program, options) {
|
|
|
288
257
|
}
|
|
289
258
|
};
|
|
290
259
|
}
|
|
291
|
-
|
|
260
|
+
// src/shared/static-exports.ts
|
|
261
|
+
const LINE_TERMINATORS = /* @__PURE__ */ new Set([
|
|
262
|
+
"\n",
|
|
263
|
+
"\r",
|
|
264
|
+
"\u2028",
|
|
265
|
+
"\u2029"
|
|
266
|
+
]);
|
|
267
|
+
/**
|
|
268
|
+
* Whether `export` is followed by `*` once whitespace and comments are skipped,
|
|
269
|
+
* so a comment between the two still counts. True only means the source needs
|
|
270
|
+
* parsing: the text may sit in a string or comment. This is a scan because a
|
|
271
|
+
* regular expression that skips repeated comments can backtrack exponentially.
|
|
272
|
+
*/
|
|
273
|
+
function mayExportAll(source) {
|
|
274
|
+
for (let index = source.indexOf("export"); index !== -1; index = source.indexOf("export", index + 1)) {
|
|
275
|
+
let cursor = index + 6;
|
|
276
|
+
while (cursor < source.length) if (/\s/.test(source[cursor])) cursor += 1;
|
|
277
|
+
else if (source.startsWith("/*", cursor)) {
|
|
278
|
+
const end = source.indexOf("*/", cursor + 2);
|
|
279
|
+
cursor = end === -1 ? source.length : end + 2;
|
|
280
|
+
} else if (source.startsWith("//", cursor)) {
|
|
281
|
+
cursor += 2;
|
|
282
|
+
while (cursor < source.length && !LINE_TERMINATORS.has(source[cursor])) cursor += 1;
|
|
283
|
+
} else break;
|
|
284
|
+
if (source[cursor] === "*") return true;
|
|
285
|
+
}
|
|
286
|
+
return false;
|
|
287
|
+
}
|
|
288
|
+
const VALUE_DECLARATIONS = /* @__PURE__ */ new Set([
|
|
289
|
+
"FunctionDeclaration",
|
|
290
|
+
"ClassDeclaration",
|
|
291
|
+
"TSEnumDeclaration"
|
|
292
|
+
]);
|
|
293
|
+
/** Read how a parsed module exports `names` without evaluating user code. Type-only exports are skipped. */
|
|
294
|
+
function staticExports(program, names) {
|
|
295
|
+
const result = {
|
|
296
|
+
initializers: /* @__PURE__ */ new Map(),
|
|
297
|
+
unreadable: /* @__PURE__ */ new Set(),
|
|
298
|
+
exportsAll: false
|
|
299
|
+
};
|
|
300
|
+
const markUnreadable = (name) => {
|
|
301
|
+
if (name !== void 0 && names.has(name)) result.unreadable.add(name);
|
|
302
|
+
};
|
|
303
|
+
for (const statement of program.body ?? []) {
|
|
304
|
+
if (statement.type === "ExportAllDeclaration") {
|
|
305
|
+
const exported = statement;
|
|
306
|
+
if (exported.exportKind === "type") continue;
|
|
307
|
+
if (exported.exported) markUnreadable(moduleExportName(exported.exported));
|
|
308
|
+
else result.exportsAll = true;
|
|
309
|
+
continue;
|
|
310
|
+
}
|
|
311
|
+
if (statement.type !== "ExportNamedDeclaration") continue;
|
|
312
|
+
const exported = statement;
|
|
313
|
+
if (exported.exportKind === "type") continue;
|
|
314
|
+
for (const specifier of exported.specifiers ?? []) if (specifier.exportKind !== "type") markUnreadable(moduleExportName(specifier.exported));
|
|
315
|
+
const declaration = exported.declaration;
|
|
316
|
+
if (declaration?.type === "VariableDeclaration") {
|
|
317
|
+
const variables = declaration;
|
|
318
|
+
for (const variable of variables.declarations ?? []) {
|
|
319
|
+
if (variables.kind === "const" && isIdentifier(variable.id) && variable.init) {
|
|
320
|
+
if (names.has(variable.id.name)) result.initializers.set(variable.id.name, variable.init);
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
for (const name of bindingNames(variable.id)) markUnreadable(name);
|
|
324
|
+
}
|
|
325
|
+
} else if (declaration && VALUE_DECLARATIONS.has(declaration.type)) {
|
|
326
|
+
const id = declaration.id;
|
|
327
|
+
markUnreadable(isIdentifier(id) ? id.name : void 0);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
return result;
|
|
331
|
+
}
|
|
332
|
+
/** Parse a module and read how it exports `names` without evaluating user code. */
|
|
333
|
+
function readStaticExports(filename, source, names) {
|
|
334
|
+
return staticExports(parseSync(filename, source).program, names);
|
|
335
|
+
}
|
|
336
|
+
function unwrapStaticExpression(node) {
|
|
337
|
+
while (node && [
|
|
338
|
+
"ParenthesizedExpression",
|
|
339
|
+
"TSAsExpression",
|
|
340
|
+
"TSSatisfiesExpression",
|
|
341
|
+
"TSTypeAssertion"
|
|
342
|
+
].includes(node.type)) node = node.expression;
|
|
343
|
+
return node;
|
|
344
|
+
}
|
|
345
|
+
function staticLiteral(node) {
|
|
346
|
+
node = unwrapStaticExpression(node);
|
|
347
|
+
if (node?.type === "Literal") return node.value;
|
|
348
|
+
if (node?.type === "TemplateLiteral") {
|
|
349
|
+
const expressions = node.expressions;
|
|
350
|
+
const quasis = node.quasis;
|
|
351
|
+
if (expressions?.length === 0 && quasis?.length === 1) return quasis[0]?.value?.cooked;
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
export { unwrapStaticExpression as a, walk as c, staticLiteral as i, readStaticExports as n, bindingNames as o, staticExports as r, bindingResolver as s, mayExportAll as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { $ as wrapTextWithPrefix, G as promptTitle, M as getGuide, V as optionText, b as S_RADIO_ACTIVE, d as S_CHECKBOX_SELECTED, i as S_BAR_END, it as wrapAnsi, j as formatInstructionFooter, n as SELECT_INSTRUCTIONS, r as S_BAR, t as MULTISELECT_INSTRUCTIONS, u as S_CHECKBOX_INACTIVE, w as S_STEP_SUBMIT } from "./dist-
|
|
2
|
-
import { f as import_picocolors } from "./output-
|
|
1
|
+
import { $ as wrapTextWithPrefix, G as promptTitle, M as getGuide, V as optionText, b as S_RADIO_ACTIVE, d as S_CHECKBOX_SELECTED, i as S_BAR_END, it as wrapAnsi, j as formatInstructionFooter, n as SELECT_INSTRUCTIONS, r as S_BAR, t as MULTISELECT_INSTRUCTIONS, u as S_CHECKBOX_INACTIVE, w as S_STEP_SUBMIT } from "./dist-STQXl8ck.mjs";
|
|
2
|
+
import { f as import_picocolors } from "./output-DNVILSz2.mjs";
|
|
3
3
|
// src/cli/subcommand-prompt.ts
|
|
4
4
|
const isUpKey = (key) => key === "\x1B[A" || key === "\x1BOA";
|
|
5
5
|
const isDownKey = (key) => key === "\x1B[B" || key === "\x1BOB";
|
|
@@ -68,7 +68,21 @@ type PageScanResult = {
|
|
|
68
68
|
pages: Array<PageDefinition>;
|
|
69
69
|
layouts: Array<LayoutDefinition>;
|
|
70
70
|
namedLayouts: Array<NamedLayoutDefinition>;
|
|
71
|
+
boundaries?: Array<PageBoundaryDefinition>;
|
|
71
72
|
};
|
|
73
|
+
type PageBoundaryDefinition = {
|
|
74
|
+
kind: "error" | "not-found";
|
|
75
|
+
directory: string;
|
|
76
|
+
componentId: string;
|
|
77
|
+
filePath: string;
|
|
78
|
+
};
|
|
79
|
+
type PageError = Readonly<{
|
|
80
|
+
status: number;
|
|
81
|
+
message: string;
|
|
82
|
+
}>;
|
|
83
|
+
type ErrorPageProps = Readonly<{
|
|
84
|
+
error: PageError;
|
|
85
|
+
}>;
|
|
72
86
|
type DevCssAsset = {
|
|
73
87
|
/** Vite client URL used to request the CSS module. */
|
|
74
88
|
url: string;
|
|
@@ -77,4 +91,4 @@ type DevCssAsset = {
|
|
|
77
91
|
/** CSS bytes returned by Vite's client environment transform with ?inline. */
|
|
78
92
|
css: string;
|
|
79
93
|
};
|
|
80
|
-
export {
|
|
94
|
+
export { PageDefinition as a, PageScanResult as c, NamedLayoutDefinition as i, RouteEnvironment as l, ErrorPageProps as n, PageError as o, LayoutDefinition as r, PageRenderMode as s, DevCssAsset as t };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as join, l as toSlash, n as dirname, r as extname } from "./dist-DMYe8CZJ.mjs";
|
|
2
2
|
import { l as getDatabaseDialect, p as readConfig } from "./config-5oSQhZNj.mjs";
|
|
3
|
-
import { c as voidDbBundlerPlugin, r as cloudflareQueueName, t as generateQueueResolverSource } from "./dispatch-
|
|
3
|
+
import { c as voidDbBundlerPlugin, r as cloudflareQueueName, t as generateQueueResolverSource } from "./dispatch-CCiaAnSK.mjs";
|
|
4
4
|
import { n as readProjectPaths } from "./project-paths-G0yut6Zz.mjs";
|
|
5
5
|
import { t as WORKER_CONDITIONS } from "./worker-conditions-CBZ0RYsZ.mjs";
|
|
6
6
|
import { t as MagicString } from "./dist-B6eN80gc.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as StandardSchemaV1 } from "./standard-schema-CuDawHOC.mjs";
|
|
2
|
-
import { i as AuthUser } from "./auth-
|
|
3
|
-
import { a as CloudEnv } from "./handler-
|
|
2
|
+
import { i as AuthUser } from "./auth-Bk9VGtQW.mjs";
|
|
3
|
+
import { a as CloudEnv } from "./handler-BO7Od-z9.mjs";
|
|
4
4
|
import { WebSocketRouteMap } from "void/routes";
|
|
5
5
|
type MaybePromise<T> = T | Promise<T>;
|
|
6
6
|
type ParamsRecord = Record<string, string>;
|
package/docs/guide/ai.md
CHANGED
package/docs/guide/app-types.md
CHANGED
package/docs/guide/auth.md
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
---
|
|
2
|
+
description: "Use Cloudflare D1, Void's default SQLite database. Void runs it locally and provisions it when you deploy."
|
|
2
3
|
outline: deep
|
|
3
4
|
---
|
|
4
5
|
|
|
@@ -42,7 +43,21 @@ await db.batch([
|
|
|
42
43
|
|
|
43
44
|
Void enables [D1 read replication](https://developers.cloudflare.com/d1/best-practices/read-replication/) when it provisions a database. To enable it on an existing database, run `void deploy --platform cloudflare --provision`. Queries through `db` from `void/db` use a D1 session for each Void request, so reads can run near the request and later queries in that request see at least the same data. Framework handlers without Void's request scope start each database operation on the primary. `createDb` starts a replica-capable session for the binding you pass it.
|
|
44
45
|
|
|
45
|
-
Replicas can lag between requests. Authentication session checks start on the primary so a revoked session is not accepted because of replica lag.
|
|
46
|
+
Replicas can lag between requests. Authentication session checks start on the primary so a revoked session is not accepted because of replica lag. For another read that needs the latest primary data, create a Drizzle client inside that request with `createDb(env.DB, { session: 'first-primary' })`:
|
|
47
|
+
|
|
48
|
+
```ts
|
|
49
|
+
import { users } from '@schema';
|
|
50
|
+
import { env } from 'cloudflare:workers';
|
|
51
|
+
import { defineHandler } from 'void';
|
|
52
|
+
import { createDb } from 'void/db';
|
|
53
|
+
|
|
54
|
+
export const GET = defineHandler(async () => {
|
|
55
|
+
const primaryDb = createDb(env.DB, { session: 'first-primary' });
|
|
56
|
+
return primaryDb.select().from(users).all();
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The first query uses the primary; subsequent queries in that session see at least the same data. Without this option, `createDb()` uses `'first-unconstrained'`, allowing its first query to use a replica. Other query libraries and raw D1 calls need their own `withSession()` to use replicas; a bare D1 binding reads from the primary.
|
|
46
61
|
|
|
47
62
|
## Alternative Query Layers
|
|
48
63
|
|