void 0.28.0 → 1.0.3
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-Ci00cncT.mjs → account-cmd-BTcUzv9L.mjs} +4 -4
- package/dist/{application-analysis-D72ZQfMZ.mjs → application-analysis-AB_YYWgH.mjs} +1 -1
- package/dist/{application-routing-Dy589Vgn.mjs → application-routing-L7V-TFhZ.mjs} +1 -1
- package/dist/auth-Cbqi1iVX.mjs +1 -0
- package/dist/{auth-link-DWr6Afao.mjs → auth-link-DUJuvRx5.mjs} +4 -4
- package/dist/{auth-router-DP14wVkZ.mjs → auth-router-CIxiMG7i.mjs} +3 -3
- package/dist/{build-cmd-Cr3FJxv0.mjs → build-cmd-BkIv25PA.mjs} +3 -3
- package/dist/{cache-D0Tt28cn.mjs → cache-Ctzfig-W.mjs} +3 -3
- package/dist/{cancel-deploy-CJKvk7AN.mjs → cancel-deploy-CD9o-SsC.mjs} +2 -2
- package/dist/cf-build-output-BU3hqdHu.mjs +1 -0
- package/dist/cli/cli.mjs +31 -31
- package/dist/cli/cloudflare-operation-process.mjs +2 -2
- package/dist/cli/env-schema-probe.d.mts +2 -1
- package/dist/cli/env-schema-probe.mjs +2 -2
- package/dist/client-B60PwCC4.mjs +1 -0
- package/dist/{cloudflare-cmd-CTrn-lXJ.mjs → cloudflare-cmd-BIAF_BIY.mjs} +2 -2
- package/dist/{cloudflare-connect-BosmCNlq.mjs → cloudflare-connect-WjwnVOJA.mjs} +1 -1
- package/dist/{cloudflare-operations-BKdSfNBN.mjs → cloudflare-operations-B42EZeJy.mjs} +3 -3
- package/dist/cloudflare-operations-CrSUFRzJ.mjs +1 -0
- package/dist/collect-Cae8A7Zr.mjs +1 -0
- package/dist/config-QrJWu0IX.mjs +1 -0
- package/dist/{connect-nukQSoEO.mjs → connect-CKtk-EZe.mjs} +5 -5
- package/dist/create-project-B-ewF_Af.mjs +1 -0
- package/dist/{create-project-D4APeBwX.mjs → create-project-yInGo72M.mjs} +3 -3
- package/dist/database-provider.mjs +1 -2
- package/dist/{db-27RztQLy.mjs → db-7I_gfdVq.mjs} +37 -38
- package/dist/db-types-Bb4WBWIs.mjs +49 -0
- package/dist/{delete-BbsZFZIw.mjs → delete-Cy-M1u-r.mjs} +3 -3
- package/dist/deploy-9lgfhrXS.mjs +2 -0
- package/dist/{deploy-B06EQq4t.mjs → deploy-BYYlnsiy.mjs} +176 -21
- package/dist/{deploy-managed-static-CGswbcay.mjs → deploy-managed-static-Ca4TFdmx.mjs} +24 -706
- package/dist/{deploy-transport-BiicfoQW.mjs → deploy-transport-DWlWBe6M.mjs} +1 -1
- package/dist/deploy.mjs +4 -4
- package/dist/discover-ClzFSwns.mjs +1 -0
- package/dist/dispatch-DrTTk8Xg.mjs +431 -0
- package/dist/{dist-D3m88sjf.mjs → dist-BVdsO7Py.mjs} +5 -6
- package/dist/dist-CfgIkieS.mjs +1 -0
- package/dist/{domain-Bfq9n03H.mjs → domain-CZGxPv9u.mjs} +4 -4
- package/dist/edge.mjs +1 -2
- package/dist/{email-DIwaQU4P.mjs → email-DzyNVuoU.mjs} +6 -6
- package/dist/{email-cloudflare-CH053RxK.mjs → email-cloudflare-DfG6UEMm.mjs} +1 -1
- package/dist/{env-BhdWMrNy.mjs → env-0jrMQJI_.mjs} +5 -2
- package/dist/{env-C6ipBLp3.mjs → env-Nx3yf50r.mjs} +4 -4
- package/dist/{env-raw-Cklzcde3.mjs → env-raw-D74P4ebM.mjs} +12 -1
- package/dist/env-validation-BT7z-qpQ.mjs +1 -0
- package/dist/{env-validation-cE0zcmzO.mjs → env-validation-DYxjz_Wo.mjs} +2 -0
- package/dist/{gen-CnN1Xidx.mjs → gen-CufHEf42.mjs} +2 -2
- package/dist/gen-sXyp5DFO.mjs +1 -0
- package/dist/generate-ClI89brV.mjs +1 -0
- package/dist/{github-cmd-BdkU4Nhe.mjs → github-cmd-FU8EjFyU.mjs} +3 -3
- package/dist/{help-Bug7pyK_.mjs → help-BT2hovNI.mjs} +9 -5
- package/dist/help-i2YGGnTH.mjs +1 -0
- package/dist/{inbound-DmkTQeWp.mjs → inbound-BuTfm11U.mjs} +1 -1
- package/dist/index.mjs +551 -303
- package/dist/{info-CujPwtMe.mjs → info-l249eUdH.mjs} +1 -1
- package/dist/{init-ZWOJvc-Z.mjs → init-D0A6M64Q.mjs} +60 -14
- package/dist/{isr-config-DPjXM8J2.mjs → isr-config-fZaJJ8t7.mjs} +1 -30
- package/dist/{link-UEc7bnF4.mjs → link-WMoJFf4i.mjs} +4 -4
- package/dist/{list-CuWeOnzk.mjs → list-CQ2EQEHL.mjs} +4 -4
- package/dist/{live-BxLX-JqJ.mjs → live-BcHoTDFe.mjs} +1 -1
- package/dist/{local-d1-BM3p74mm.mjs → local-d1-BxvQYEFi.mjs} +1 -1
- package/dist/{login-CZ2Cqa-D.mjs → login-C2T1oVG-.mjs} +3 -3
- package/dist/login-XD844Xs-.mjs +1 -0
- package/dist/{logs-TihRcLTk.mjs → logs-DnC1d7xB.mjs} +3 -3
- package/dist/{migrate-uFwojusJ.mjs → migrate-BDIprOYd.mjs} +2 -2
- package/dist/migrate-BRwU-blY.mjs +1 -0
- package/dist/mysql-migration-sql-BIS5vbNk.mjs +241 -0
- package/dist/nitro.d.mts +30 -0
- package/dist/nitro.mjs +88 -0
- package/dist/{node-DoKbo1SZ.mjs → node-cPadMgUO.mjs} +3 -3
- package/dist/operator-cmd-D6gnZsnK.mjs +1 -0
- package/dist/{operator-cmd-C5lCctnc.mjs → operator-cmd-DHieWtFp.mjs} +5 -5
- package/dist/{output-FNHKw5Ac.mjs → output-Ba6ZbrzY.mjs} +1 -1
- package/dist/pages/head.mjs +1 -2
- package/dist/pages/prefetch.mjs +1 -2
- package/dist/pages/serialize.mjs +1 -2
- package/dist/plan-CKX_jWnD.mjs +1 -0
- package/dist/platform-args-B0HeTh0C.mjs +1 -0
- package/dist/{platform-args-C6Mb_I3a.mjs → platform-args-CaCL_1Ch.mjs} +9 -2
- package/dist/{platform-auth-config-CJmNkFT2.mjs → platform-auth-config-Z16-I8nT.mjs} +6 -6
- package/dist/{platform-auth-protection-D5wvsI-Y.mjs → platform-auth-protection-BXwZiJSF.mjs} +4 -4
- package/dist/{platform-auth-recovery-D_0I3n-1.mjs → platform-auth-recovery-CXjfqyOv.mjs} +4 -4
- package/dist/{platform-cmd-DxxZO6e5.mjs → platform-cmd-DaAOiWTl.mjs} +7 -7
- package/dist/platform-cmd-PT4YwMLM.mjs +1 -0
- package/dist/{platform-domain-zLXnW1G_.mjs → platform-domain-CxpvUeo0.mjs} +4 -4
- package/dist/{platform-lifecycle-DOW-wLfx.mjs → platform-lifecycle-DBiS0cJd.mjs} +317 -99
- package/dist/platform-lifecycle-u9pMOvxC.mjs +1 -0
- package/dist/{platform-management-t7HKy4-U.mjs → platform-management-DhEFdQAf.mjs} +67 -9
- package/dist/platform-management-DvBS83rC.mjs +1 -0
- package/dist/{platform-plans-config-CNH6zbPX.mjs → platform-plans-config-BWn1S2Rv.mjs} +2 -2
- package/dist/{platform-recovery-DeucI7A9.mjs → platform-recovery-BUGOB4RC.mjs} +2 -2
- package/dist/{platform-setup-CTf6MMT9.mjs → platform-setup-YvN9VQXV.mjs} +3 -3
- package/dist/prepare-CYT6tAzD.mjs +1 -0
- package/dist/{prepare-CSH9dKTI.mjs → prepare-DEB5SeVJ.mjs} +3 -2
- package/dist/{prepare-C4zfwks4.mjs → prepare-PQCgsny0.mjs} +3 -3
- package/dist/prerender-render.mjs +1 -2
- package/dist/{project-cmd-Dq75AXzy.mjs → project-cmd-DVatD8Ev.mjs} +16 -16
- package/dist/project-slug-6cyz8E7k.mjs +1 -0
- package/dist/{project-team-B3_QcStG.mjs → project-team-DJrWEAG1.mjs} +3 -3
- package/dist/{project-token-CvsRvv2I.mjs → project-token-CBgLBuL6.mjs} +3 -3
- package/dist/project-zdB3fs9G.mjs +1 -0
- package/dist/{project-zero-trust-D1ICiwN_.mjs → project-zero-trust-92gLtZ25.mjs} +3 -3
- package/dist/{provision-DDh7ITVS.mjs → provision-BnSSkiED.mjs} +1 -1
- package/dist/{requests-3CL3BuZh.mjs → requests-7W1Pygt2.mjs} +2 -2
- package/dist/resolve-project-PnhzMtY6.mjs +1 -0
- package/dist/{resolve-project-C_Cu7E8a.mjs → resolve-project-WpwkCB_c.mjs} +1 -1
- package/dist/{rollback-Ce1d_0J9.mjs → rollback-BcASVnwP.mjs} +3 -3
- package/dist/{route-types-IrBuwJ7u.mjs → route-types-BZi26DVS.mjs} +2 -49
- package/dist/{runner-DcVDrzuR.mjs → runner-CabsQ-iM.mjs} +15 -6
- package/dist/runner-So9mYfcm.mjs +1 -0
- package/dist/runner-mysql-BhRaONkO.mjs +146 -0
- package/dist/runner-mysql-DWwE8jKi.mjs +1 -0
- package/dist/{runner-pg-CPd-CB_F.mjs → runner-pg-BRemq_GX.mjs} +2 -2
- package/dist/runner-pg-_Xncr3H5.mjs +1 -0
- package/dist/runtime/ai.mjs +15 -4
- package/dist/runtime/auth-client-react.mjs +1 -2
- package/dist/runtime/auth-client-solid.mjs +1 -2
- package/dist/runtime/auth-client-svelte.mjs +1 -2
- package/dist/runtime/auth-client-vue.mjs +1 -2
- package/dist/runtime/auth-client.mjs +1 -2
- package/dist/runtime/auth.mjs +1 -2
- package/dist/runtime/better-auth-mysql.mjs +4 -1
- package/dist/runtime/db.mjs +6 -2
- package/dist/runtime/durable.d.mts +2 -1
- package/dist/runtime/durable.mjs +1 -1
- package/dist/runtime/email/testing.mjs +1 -1
- package/dist/runtime/email-protocol.mjs +1 -2
- package/dist/runtime/email.mjs +1 -1
- package/dist/runtime/env-public.mjs +2 -2
- package/dist/runtime/env.mjs +1 -2
- package/dist/runtime/isr.mjs +1 -1
- package/dist/runtime/kv.mjs +1 -1
- package/dist/runtime/limits.mjs +1 -2
- package/dist/runtime/live-client.d.mts +2 -1
- package/dist/runtime/live-server.d.mts +2 -1
- package/dist/runtime/live-server.mjs +1 -1
- package/dist/runtime/live.mjs +1 -2
- package/dist/runtime/log.d.mts +2 -1
- package/dist/runtime/migration-handler-mysql.mjs +38 -8
- package/dist/runtime/migration-handler.mjs +1 -2
- package/dist/runtime/queues.mjs +1 -1
- package/dist/runtime/response.mjs +1 -2
- package/dist/runtime/route-url.mjs +1 -2
- package/dist/runtime/routing.d.mts +2 -1
- package/dist/runtime/sandbox-container.mjs +1 -2
- package/dist/runtime/sandbox.mjs +3 -3
- package/dist/runtime/seed.d.mts +2 -1
- package/dist/runtime/sse.mjs +1 -2
- package/dist/runtime/storage.mjs +1 -1
- package/dist/runtime/validator.mjs +1 -2
- package/dist/runtime/ws-server.d.mts +2 -1
- package/dist/runtime/ws-server.mjs +1 -1
- package/dist/{secret-B5J8bBsI.mjs → secret-bg73f1Ge.mjs} +5 -5
- package/dist/{skills-BJsan98C.mjs → skills-C_yRTg0g.mjs} +1 -1
- package/dist/{subcommand-prompt-gQ-NDA-u.mjs → subcommand-prompt-Bm3ZlYgA.mjs} +2 -2
- package/dist/sveltekit.d.mts +2 -1
- package/dist/validate-BQFdf0Pi.mjs +1 -0
- package/dist/wrapper-CwhpNWtH.mjs +663 -0
- package/docs/guide/ai.md +8 -2
- package/docs/guide/database/mysql.md +14 -3
- package/docs/guide/database.md +1 -5
- package/docs/guide/durable-state.md +9 -5
- package/docs/guide/platform/installation/credentials.md +18 -2
- package/docs/guide/platform/installation/domains.md +1 -1
- package/docs/guide/platform/installation/maintenance.md +38 -1
- package/docs/guide/platform/installation/prerequisites.md +6 -2
- package/docs/guide/platform/installation/setup.md +23 -1
- package/docs/guide/platform/installation/uninstall.md +6 -1
- package/docs/guide/sandboxes.md +1 -1
- package/docs/guide/self-hosted-platform.md +1 -1
- package/docs/integrations/cloudflare.md +2 -2
- package/docs/integrations/frameworks/analog.md +3 -11
- package/docs/integrations/frameworks/nuxt.md +7 -10
- package/docs/integrations/nodejs-bun-deno.md +2 -0
- package/docs/reference/api.md +1 -0
- package/docs/reference/cli/platform-installation.md +18 -6
- package/docs/reference/config.md +2 -0
- package/package.json +34 -28
- package/sandbox.Dockerfile +1 -1
- package/skills/void/SKILL.md +1 -1
- package/dist/auth-wn6F8dB8.mjs +0 -2
- package/dist/cf-build-output-2u583yJK.mjs +0 -2
- package/dist/client-C1BjRn3g.mjs +0 -2
- package/dist/cloudflare-operations-Ds-lX3Ts.mjs +0 -2
- package/dist/collect-NUlJMpLY.mjs +0 -2
- package/dist/config-CNnrSMYm.mjs +0 -2
- package/dist/create-project-DL7YXpjj.mjs +0 -2
- package/dist/deploy-Db2ALnQP.mjs +0 -3
- package/dist/discover-CTUiSsfG.mjs +0 -2
- package/dist/dist-Bx1z6Eva.mjs +0 -2
- package/dist/env-validation-CTn-HhG1.mjs +0 -2
- package/dist/gen-F8pSZnhc.mjs +0 -2
- package/dist/generate-Rii9klHB.mjs +0 -2
- package/dist/help-s9q7LTcu.mjs +0 -2
- package/dist/login-DhK7o1oJ.mjs +0 -2
- package/dist/migrate-BgT-hmu8.mjs +0 -2
- package/dist/operator-cmd-Cjk5DiRx.mjs +0 -2
- package/dist/plan-CH2G51je.mjs +0 -2
- package/dist/platform-args-Cm7x-fot.mjs +0 -2
- package/dist/platform-cmd-Cuj4oUVo.mjs +0 -2
- package/dist/platform-lifecycle-_gfnjUBr.mjs +0 -2
- package/dist/platform-management-CYrLvTGH.mjs +0 -2
- package/dist/prepare-dr9uxQSV.mjs +0 -2
- package/dist/project-DiiOBZPF.mjs +0 -2
- package/dist/project-slug-DofjTFd-.mjs +0 -2
- package/dist/resolve-project-B9Hr0D3n.mjs +0 -2
- package/dist/runner-B5huK2eC.mjs +0 -2
- package/dist/runner-mysql-CCtyI0p6.mjs +0 -55
- package/dist/runner-mysql-CaJq-hd6.mjs +0 -2
- package/dist/runner-pg-BJhFZZG4.mjs +0 -2
- package/dist/validate-C9xtFOYR.mjs +0 -2
- package/dist/{sandbox-container-DBKIqDEK.mjs → sandbox-container-a9LRUtii.mjs} +1 -1
|
@@ -4,17 +4,17 @@ import { n as readProjectPaths } from "./project-paths-DMvEeSau.mjs";
|
|
|
4
4
|
import { d as readConfig, f as resolveBindingNames, s as getDatabaseDialect } from "./config-Bx_1SpnO.mjs";
|
|
5
5
|
import { i as writeJournal, n as readJournal, r as stripSqlExt, t as collectMigrations } from "./collect-xjffdCdk.mjs";
|
|
6
6
|
import { n as readDeploymentPlatform, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
7
|
-
import { t as resolveLocalD1Target } from "./local-d1-
|
|
7
|
+
import { t as resolveLocalD1Target } from "./local-d1-BxvQYEFi.mjs";
|
|
8
8
|
import { t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
|
|
9
9
|
import { n as ensurePlatformProxyAccess, r as isCloudflareAccessChallenge, t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
|
|
10
10
|
import { c as getToken, o as getProxyUrl } from "./auth-B6iOCjKI.mjs";
|
|
11
|
-
import { A as confirm, H as outro, L as log, X as text, tt as isCancel } from "./dist-
|
|
12
|
-
import { f as import_picocolors, i as dim, l as formatUrl, m as printSuccess, o as formatCount, u as getErrorMessage } from "./output-
|
|
11
|
+
import { A as confirm, H as outro, L as log, X as text, tt as isCancel } from "./dist-BVdsO7Py.mjs";
|
|
12
|
+
import { f as import_picocolors, i as dim, l as formatUrl, m as printSuccess, o as formatCount, u as getErrorMessage } from "./output-Ba6ZbrzY.mjs";
|
|
13
13
|
import { o as loadLocalEnv } from "./env-BJjULvL0.mjs";
|
|
14
14
|
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CheZGRE7.mjs";
|
|
15
15
|
import { n as PlatformApiError, r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
16
16
|
import { n as drizzleKitBin } from "./yarn-pnp-DLbEFMT0.mjs";
|
|
17
|
-
import { n as formatTimestamp } from "./gen-
|
|
17
|
+
import { n as formatTimestamp } from "./gen-CufHEf42.mjs";
|
|
18
18
|
import { createRequire } from "node:module";
|
|
19
19
|
import { existsSync, mkdirSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
|
|
20
20
|
import { pathToFileURL } from "node:url";
|
|
@@ -156,7 +156,7 @@ function runDrizzleKit(root, args) {
|
|
|
156
156
|
* already printed its own error.
|
|
157
157
|
*/
|
|
158
158
|
async function runDrizzleKitWithDatabaseUrl(root, url, dialect, command) {
|
|
159
|
-
const { withPrivateDrizzleConfig } = await import("./config-
|
|
159
|
+
const { withPrivateDrizzleConfig } = await import("./config-QrJWu0IX.mjs");
|
|
160
160
|
if (!withPrivateDrizzleConfig(root, url, dialect, (configPath) => {
|
|
161
161
|
try {
|
|
162
162
|
runDrizzleKit(root, [
|
|
@@ -187,7 +187,7 @@ async function withPgClient(root, fn) {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
async function withMySqlClient(root, fn) {
|
|
190
|
-
const { toMySqlClient } = await import("./runner-mysql-
|
|
190
|
+
const { toMySqlClient } = await import("./runner-mysql-DWwE8jKi.mjs");
|
|
191
191
|
const { createConnection } = await import("mysql2/promise");
|
|
192
192
|
const connection = await createConnection({
|
|
193
193
|
uri: getLocalDatabaseUrl(root, "mysql"),
|
|
@@ -305,7 +305,7 @@ async function runPush(root, dialect) {
|
|
|
305
305
|
printSuccess("Database schema pushed.");
|
|
306
306
|
return;
|
|
307
307
|
}
|
|
308
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
308
|
+
const { writeDrizzleConfig } = await import("./config-QrJWu0IX.mjs");
|
|
309
309
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
310
310
|
mkdirSync(dirname(dbPath), { recursive: true });
|
|
311
311
|
const configPath = writeDrizzleConfig(root, dbPath);
|
|
@@ -321,15 +321,15 @@ async function runPush(root, dialect) {
|
|
|
321
321
|
printSuccess("Database schema pushed.");
|
|
322
322
|
}
|
|
323
323
|
async function runGenerate(root, dialect) {
|
|
324
|
-
const { prepareProject } = await import("./prepare-
|
|
325
|
-
const { PLACEHOLDER_DB_URL, writeDrizzleConfig } = await import("./config-
|
|
324
|
+
const { prepareProject } = await import("./prepare-CYT6tAzD.mjs");
|
|
325
|
+
const { PLACEHOLDER_DB_URL, writeDrizzleConfig } = await import("./config-QrJWu0IX.mjs");
|
|
326
326
|
await prepareProject(root);
|
|
327
327
|
const authSchemaPath = join(root, ".void", "better-auth-schema.ts");
|
|
328
328
|
const additionalSchemas = existsSync(authSchemaPath) ? [authSchemaPath] : void 0;
|
|
329
329
|
const configPath = writeDrizzleConfig(root, PLACEHOLDER_DB_URL[dialect], dialect, { additionalSchemas });
|
|
330
330
|
try {
|
|
331
331
|
if (dialect === "sqlite") {
|
|
332
|
-
const { generateValidatedSqliteMigrations } = await import("./generate-
|
|
332
|
+
const { generateValidatedSqliteMigrations } = await import("./generate-ClI89brV.mjs");
|
|
333
333
|
await generateValidatedSqliteMigrations(readProjectPaths(root).migrationsDir, () => {
|
|
334
334
|
runDrizzleKit(root, [
|
|
335
335
|
"generate",
|
|
@@ -364,19 +364,19 @@ async function runStatus(root, dialect) {
|
|
|
364
364
|
}
|
|
365
365
|
let localApplied;
|
|
366
366
|
if (dialect === "postgresql") try {
|
|
367
|
-
const { readPgAppliedMigrations } = await import("./runner-pg-
|
|
367
|
+
const { readPgAppliedMigrations } = await import("./runner-pg-_Xncr3H5.mjs");
|
|
368
368
|
localApplied = await withPgClient(root, readPgAppliedMigrations);
|
|
369
369
|
} catch {
|
|
370
370
|
localApplied = [];
|
|
371
371
|
}
|
|
372
372
|
else if (dialect === "mysql") try {
|
|
373
|
-
const { readMySqlAppliedMigrations } = await import("./runner-mysql-
|
|
373
|
+
const { readMySqlAppliedMigrations } = await import("./runner-mysql-DWwE8jKi.mjs");
|
|
374
374
|
localApplied = await withMySqlClient(root, readMySqlAppliedMigrations);
|
|
375
375
|
} catch {
|
|
376
376
|
localApplied = [];
|
|
377
377
|
}
|
|
378
378
|
else {
|
|
379
|
-
const { getAppliedMigrations } = await import("./runner-
|
|
379
|
+
const { getAppliedMigrations } = await import("./runner-So9mYfcm.mjs");
|
|
380
380
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
381
381
|
localApplied = (await getAppliedMigrations(dbPath)).map((m) => m.name);
|
|
382
382
|
}
|
|
@@ -386,12 +386,12 @@ async function runStatus(root, dialect) {
|
|
|
386
386
|
if (dialect !== "sqlite") {
|
|
387
387
|
const databaseUrl = process.env.DATABASE_URL;
|
|
388
388
|
if (!databaseUrl) throw new Error("DATABASE_URL is not available.");
|
|
389
|
-
remoteApplied = (dialect === "postgresql" ? await (await import("./runner-pg-
|
|
389
|
+
remoteApplied = (dialect === "postgresql" ? await (await import("./runner-pg-_Xncr3H5.mjs")).getPgAppliedMigrations(databaseUrl) : await (await import("./runner-mysql-DWwE8jKi.mjs")).getMySqlAppliedMigrations(databaseUrl)).map((name) => ({
|
|
390
390
|
name,
|
|
391
391
|
applied_at: ""
|
|
392
392
|
}));
|
|
393
393
|
} else {
|
|
394
|
-
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
394
|
+
const { readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-CrSUFRzJ.mjs");
|
|
395
395
|
remoteApplied = (await readCloudflareD1Migrations(resolveCloudflareD1Context(root, configuredD1Binding(root)))).map((name) => ({
|
|
396
396
|
name,
|
|
397
397
|
applied_at: ""
|
|
@@ -459,7 +459,7 @@ async function resetDatabase(root, dialect, yes) {
|
|
|
459
459
|
const { Client } = await import("pg");
|
|
460
460
|
const { host, port, database } = new Client({ connectionString: getLocalDatabaseUrl(root, dialect) });
|
|
461
461
|
await confirmDropAllTables(host, `database "${database}" on ${host}:${port}`, yes);
|
|
462
|
-
const { applyPgMigrations } = await import("./runner-pg-
|
|
462
|
+
const { applyPgMigrations } = await import("./runner-pg-_Xncr3H5.mjs");
|
|
463
463
|
await withPgClient(root, async (client) => {
|
|
464
464
|
const tables = await client.query("SELECT tablename FROM pg_tables WHERE schemaname = 'public'");
|
|
465
465
|
for (const row of tables.rows) await client.query(`DROP TABLE IF EXISTS "${row.tablename}" CASCADE`);
|
|
@@ -470,25 +470,24 @@ async function resetDatabase(root, dialect, yes) {
|
|
|
470
470
|
if (dialect === "mysql") {
|
|
471
471
|
const { hostname, host, pathname } = new URL(getLocalDatabaseUrl(root, dialect));
|
|
472
472
|
await confirmDropAllTables(hostname, `database "${decodeURIComponent(pathname.slice(1))}" on ${host}`, yes);
|
|
473
|
-
|
|
473
|
+
const { applyPendingMySqlMigrations, withMySqlMigrationLock } = await import("./runner-mysql-DWwE8jKi.mjs");
|
|
474
|
+
await withMySqlClient(root, (client) => withMySqlMigrationLock(client, async () => {
|
|
474
475
|
const tables = await client.query("SELECT table_name AS table_name FROM information_schema.tables WHERE table_schema = DATABASE() AND table_type = 'BASE TABLE'");
|
|
475
476
|
await client.query("SET FOREIGN_KEY_CHECKS = 0");
|
|
476
477
|
try {
|
|
477
478
|
for (const row of tables) {
|
|
479
|
+
if (row.table_name === "_void_migration_lock") continue;
|
|
478
480
|
const table = String(row.table_name).replaceAll("`", "``");
|
|
479
481
|
await client.query(`DROP TABLE IF EXISTS \`${table}\``);
|
|
480
482
|
}
|
|
481
483
|
} finally {
|
|
482
484
|
await client.query("SET FOREIGN_KEY_CHECKS = 1");
|
|
483
485
|
}
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
const { applyMySqlMigrations } = await import("./runner-mysql-CaJq-hd6.mjs");
|
|
487
|
-
await withMySqlClient(root, (client) => applyMySqlMigrations(client, migrations));
|
|
488
|
-
}
|
|
486
|
+
await applyPendingMySqlMigrations(client, migrations);
|
|
487
|
+
}));
|
|
489
488
|
return migrations.length;
|
|
490
489
|
}
|
|
491
|
-
const { runMigrations } = await import("./runner-
|
|
490
|
+
const { runMigrations } = await import("./runner-So9mYfcm.mjs");
|
|
492
491
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
493
492
|
rmSync(dbPath, { force: true });
|
|
494
493
|
rmSync(dbPath + "-wal", { force: true });
|
|
@@ -520,7 +519,7 @@ async function runSeed(root, file, dialect, yes) {
|
|
|
520
519
|
printSuccess(`Seeded from ${seed.displayPath}.`);
|
|
521
520
|
return;
|
|
522
521
|
}
|
|
523
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
522
|
+
const { openSqliteDatabase } = await import("./runner-So9mYfcm.mjs");
|
|
524
523
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
525
524
|
const db = await openSqliteDatabase(dbPath);
|
|
526
525
|
try {
|
|
@@ -616,7 +615,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
616
615
|
process.exit(0);
|
|
617
616
|
}
|
|
618
617
|
if (dialect === "sqlite") {
|
|
619
|
-
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
618
|
+
const { executeCloudflareD1Sql, resolveCloudflareD1Context } = await import("./cloudflare-operations-CrSUFRzJ.mjs");
|
|
620
619
|
const rows = await executeCloudflareD1Sql(resolveCloudflareD1Context(root, configuredD1Binding(root)), sql);
|
|
621
620
|
if (rows.length > 0) printTable(rows);
|
|
622
621
|
} else {
|
|
@@ -716,7 +715,7 @@ async function runExecute(root, command, file, dialect, remote) {
|
|
|
716
715
|
printSuccess("SQL executed successfully.");
|
|
717
716
|
return;
|
|
718
717
|
}
|
|
719
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
718
|
+
const { openSqliteDatabase } = await import("./runner-So9mYfcm.mjs");
|
|
720
719
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
721
720
|
if (!existsSync(dbPath)) {
|
|
722
721
|
log.error("No local database found. Run `void dev` first.");
|
|
@@ -780,11 +779,11 @@ async function runMigrate(root, dialect, remote) {
|
|
|
780
779
|
let appliedNames;
|
|
781
780
|
let applyMigrations;
|
|
782
781
|
if (dialect === "postgresql") {
|
|
783
|
-
const { getPgAppliedMigrations, runPgMigrations } = await import("./runner-pg-
|
|
782
|
+
const { getPgAppliedMigrations, runPgMigrations } = await import("./runner-pg-_Xncr3H5.mjs");
|
|
784
783
|
appliedNames = await getPgAppliedMigrations(databaseUrl);
|
|
785
784
|
applyMigrations = () => runPgMigrations(migrationsDir, databaseUrl);
|
|
786
785
|
} else {
|
|
787
|
-
const { getMySqlAppliedMigrations, runMySqlMigrations } = await import("./runner-mysql-
|
|
786
|
+
const { getMySqlAppliedMigrations, runMySqlMigrations } = await import("./runner-mysql-DWwE8jKi.mjs");
|
|
788
787
|
appliedNames = await getMySqlAppliedMigrations(databaseUrl);
|
|
789
788
|
applyMigrations = () => runMySqlMigrations(migrationsDir, databaseUrl);
|
|
790
789
|
}
|
|
@@ -809,7 +808,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
809
808
|
log.info(`No migration files found in ${paths.sourceRelative("db/migrations")}/`);
|
|
810
809
|
return;
|
|
811
810
|
}
|
|
812
|
-
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-
|
|
811
|
+
const { applyCloudflareD1Migrations, readCloudflareD1Migrations, resolveCloudflareD1Context } = await import("./cloudflare-operations-CrSUFRzJ.mjs");
|
|
813
812
|
const binding = configuredD1Binding(root);
|
|
814
813
|
const context = resolveCloudflareD1Context(root, binding);
|
|
815
814
|
const remoteBefore = new Set(await readCloudflareD1Migrations(context));
|
|
@@ -824,7 +823,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
824
823
|
log.error(getErrorMessage(error));
|
|
825
824
|
process.exit(1);
|
|
826
825
|
}
|
|
827
|
-
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-
|
|
826
|
+
const { checkWranglerMigrationApplySet, parseRootWranglerConfig } = await import("./deploy-9lgfhrXS.mjs");
|
|
828
827
|
const applySet = await checkWranglerMigrationApplySet(context.operation.configPath, parseRootWranglerConfig(context.operation.configPath), binding, context.migrationsDir, rawMigrations);
|
|
829
828
|
if (!applySet.ok) {
|
|
830
829
|
log.error(applySet.reason);
|
|
@@ -886,7 +885,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
886
885
|
return;
|
|
887
886
|
}
|
|
888
887
|
if (dialect === "postgresql") {
|
|
889
|
-
const { applyPgMigrations, readPgAppliedMigrations } = await import("./runner-pg-
|
|
888
|
+
const { applyPgMigrations, readPgAppliedMigrations } = await import("./runner-pg-_Xncr3H5.mjs");
|
|
890
889
|
const applied = await withPgClient(root, async (client) => {
|
|
891
890
|
const appliedNames = await readPgAppliedMigrations(client).catch(() => []);
|
|
892
891
|
try {
|
|
@@ -905,7 +904,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
905
904
|
return;
|
|
906
905
|
}
|
|
907
906
|
if (dialect === "mysql") {
|
|
908
|
-
const { applyMySqlMigrations, readMySqlAppliedMigrations } = await import("./runner-mysql-
|
|
907
|
+
const { applyMySqlMigrations, readMySqlAppliedMigrations } = await import("./runner-mysql-DWwE8jKi.mjs");
|
|
909
908
|
const applied = await withMySqlClient(root, async (client) => {
|
|
910
909
|
const appliedNames = await readMySqlAppliedMigrations(client).catch(() => []);
|
|
911
910
|
try {
|
|
@@ -923,7 +922,7 @@ async function runMigrate(root, dialect, remote) {
|
|
|
923
922
|
}
|
|
924
923
|
return;
|
|
925
924
|
}
|
|
926
|
-
const { getAppliedMigrations, runMigrations } = await import("./runner-
|
|
925
|
+
const { getAppliedMigrations, runMigrations } = await import("./runner-So9mYfcm.mjs");
|
|
927
926
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
928
927
|
try {
|
|
929
928
|
const existingRows = await getAppliedMigrations(dbPath);
|
|
@@ -976,7 +975,7 @@ async function runStudio(root, dialect, remote) {
|
|
|
976
975
|
await runDrizzleKitWithDatabaseUrl(root, url, dialect, "studio");
|
|
977
976
|
return;
|
|
978
977
|
}
|
|
979
|
-
const { writeDrizzleConfig } = await import("./config-
|
|
978
|
+
const { writeDrizzleConfig } = await import("./config-QrJWu0IX.mjs");
|
|
980
979
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
981
980
|
if (!existsSync(dbPath)) {
|
|
982
981
|
log.error("No local database found. Run `void dev` first.");
|
|
@@ -1175,7 +1174,7 @@ async function runRenameMigrations(root, dialect) {
|
|
|
1175
1174
|
await rollback("db: Failed to update MySQL tracking table. File renames have been reverted.\nFix the database connection and run `void db rename-migrations` again.", err);
|
|
1176
1175
|
}
|
|
1177
1176
|
else {
|
|
1178
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1177
|
+
const { openSqliteDatabase } = await import("./runner-So9mYfcm.mjs");
|
|
1179
1178
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1180
1179
|
if (existsSync(dbPath)) try {
|
|
1181
1180
|
const db = await openSqliteDatabase(dbPath);
|
|
@@ -1318,7 +1317,7 @@ async function runExport(root, args, dialect) {
|
|
|
1318
1317
|
} else process.stdout.write(output);
|
|
1319
1318
|
return;
|
|
1320
1319
|
}
|
|
1321
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1320
|
+
const { openSqliteDatabase } = await import("./runner-So9mYfcm.mjs");
|
|
1322
1321
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1323
1322
|
if (!existsSync(dbPath)) {
|
|
1324
1323
|
log.error("No local database found. Run `void dev` first.", errOut);
|
|
@@ -1482,7 +1481,7 @@ async function runSeedModule(root, seedPath, dialect) {
|
|
|
1482
1481
|
return;
|
|
1483
1482
|
}
|
|
1484
1483
|
const { drizzle } = await import("drizzle-orm/better-sqlite3");
|
|
1485
|
-
const { openSqliteDatabase } = await import("./runner-
|
|
1484
|
+
const { openSqliteDatabase } = await import("./runner-So9mYfcm.mjs");
|
|
1486
1485
|
const { databasePath: dbPath } = getLocalD1Target(root);
|
|
1487
1486
|
const sqlite = await openSqliteDatabase(dbPath);
|
|
1488
1487
|
try {
|
|
@@ -1503,7 +1502,7 @@ async function loadSeedFunction(seedPath) {
|
|
|
1503
1502
|
return seed;
|
|
1504
1503
|
}
|
|
1505
1504
|
async function loadSeedSchema(root) {
|
|
1506
|
-
const { discoverSchema } = await import("./discover-
|
|
1505
|
+
const { discoverSchema } = await import("./discover-ClzFSwns.mjs");
|
|
1507
1506
|
const location = discoverSchema(root, readProjectPaths(root));
|
|
1508
1507
|
if (!location) return {};
|
|
1509
1508
|
if (location.type === "file") {
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { a as join } from "./dist-ipQi0Q8y.mjs";
|
|
2
|
+
import { r as writeFileIfChanged } from "./project-tsconfig-bveqhlYA.mjs";
|
|
3
|
+
//#region src/codegen/db-types.ts
|
|
4
|
+
const DRIZZLE_OPERATORS = "sql, eq, ne, gt, gte, lt, lte, and, or, not, desc, asc, like, ilike, notLike, inArray, notInArray, isNull, isNotNull, between, notBetween, exists, notExists, count, sum, avg, min, max";
|
|
5
|
+
const DIALECT_DB_TYPES = {
|
|
6
|
+
sqlite: {
|
|
7
|
+
type: "DrizzleD1Database",
|
|
8
|
+
from: "void/_db",
|
|
9
|
+
arg: "d1: D1Database"
|
|
10
|
+
},
|
|
11
|
+
postgresql: {
|
|
12
|
+
type: "NodePgDatabase",
|
|
13
|
+
from: "void/_db-pg",
|
|
14
|
+
arg: "connectionString: string"
|
|
15
|
+
},
|
|
16
|
+
mysql: {
|
|
17
|
+
type: "MySql2Database",
|
|
18
|
+
from: "void/_db-mysql",
|
|
19
|
+
arg: "connectionString: string"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Generate `.void/db.d.ts` with Drizzle types referencing the user's schema.
|
|
24
|
+
*
|
|
25
|
+
* This is a proper module file (not `declare module`) whose types override
|
|
26
|
+
* the base `void/db` package via a tsconfig `paths` redirect:
|
|
27
|
+
* "void/db": ["./.void/db.d.ts"]
|
|
28
|
+
*
|
|
29
|
+
* Imports reference `void/_db` (internal subpath pointing at the same
|
|
30
|
+
* base module) to avoid circular resolution through the paths redirect.
|
|
31
|
+
*/
|
|
32
|
+
function generateDbDts(outDir, schema, dialect) {
|
|
33
|
+
const { type, from, arg } = DIALECT_DB_TYPES[dialect];
|
|
34
|
+
const schemaType = schema ? "Schema" : "Record<string, never>";
|
|
35
|
+
const lines = [
|
|
36
|
+
"// Auto-generated by void — do not edit",
|
|
37
|
+
...dialect === "sqlite" ? ["/// <reference types=\"@cloudflare/workers-types\" />"] : [],
|
|
38
|
+
`import type { ${type} } from "${from}";`,
|
|
39
|
+
...schema ? ["import type * as schema from \"@schema\";", "type Schema = typeof schema;"] : [],
|
|
40
|
+
`export declare const db: ${type}<${schemaType}>;`,
|
|
41
|
+
`export declare function createDb(${arg}): ${type}<${schemaType}>;`,
|
|
42
|
+
`export { ${DRIZZLE_OPERATORS} } from "void/_db";`,
|
|
43
|
+
`export type { ${type} } from "${from}";`,
|
|
44
|
+
""
|
|
45
|
+
];
|
|
46
|
+
return writeFileIfChanged(join(outDir, "db.d.ts"), lines.join("\n"));
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
export { generateDbDts as n, DRIZZLE_OPERATORS as t };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { o as removeProjectConfig, r as readProjectConfig } from "./project-rqDnVsJN.mjs";
|
|
2
2
|
import { c as getToken } from "./auth-B6iOCjKI.mjs";
|
|
3
|
-
import { L as log, O as cancel, X as text, tt as isCancel } from "./dist-
|
|
4
|
-
import { m as printSuccess, p as note, r as createSpinner } from "./output-
|
|
3
|
+
import { L as log, O as cancel, X as text, tt as isCancel } from "./dist-BVdsO7Py.mjs";
|
|
4
|
+
import { m as printSuccess, p as note, r as createSpinner } from "./output-Ba6ZbrzY.mjs";
|
|
5
5
|
import { r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
6
|
-
import { a as resolveProjectBySlug } from "./resolve-project-
|
|
6
|
+
import { a as resolveProjectBySlug } from "./resolve-project-WpwkCB_c.mjs";
|
|
7
7
|
//#region src/cli/delete.ts
|
|
8
8
|
async function runDeleteCommand(root, slug, options) {
|
|
9
9
|
console.log();
|
|
@@ -4,11 +4,11 @@ import { t as require_picocolors } from "./picocolors-BTps1_gs.mjs";
|
|
|
4
4
|
import { r as detectFramework } from "./plugin-inference-DsARdQKE.mjs";
|
|
5
5
|
import { t as assertNoRootSourceConventionConflicts } from "./project-paths-DMvEeSau.mjs";
|
|
6
6
|
import { c as isNodeTarget, d as readConfig, f as resolveBindingNames } from "./config-Bx_1SpnO.mjs";
|
|
7
|
-
import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, o as requiresSandboxPlatformImage, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync } from "./application-analysis-
|
|
7
|
+
import { a as hasSandboxSqliteMigration, c as sandboxContainerConfig, i as assertSandboxNamespaceConfig, o as requiresSandboxPlatformImage, r as SANDBOX_MIGRATION_TAG, s as resolveSandboxConfig, t as analyzeApplicationSync } from "./application-analysis-AB_YYWgH.mjs";
|
|
8
8
|
import { t as collectMigrations } from "./collect-xjffdCdk.mjs";
|
|
9
9
|
import { o as validateSsrEntry } from "./entry-ehmBvs5w.mjs";
|
|
10
10
|
import { r as hasEmailHandlers } from "./email-BcjSyAL0.mjs";
|
|
11
|
-
import { a as resolveDistDir, c as
|
|
11
|
+
import { a as resolveDistDir, c as hasDocumentRoutes, l as resolveAssetConfig, n as collectRevalidate, o as resolveWorkerDirName, r as hasRevalidate, s as hasApiRoutes } from "./isr-config-fZaJJ8t7.mjs";
|
|
12
12
|
import { i as voidWarn } from "./log-vqY3pqwI.mjs";
|
|
13
13
|
import { t as writeFileAtomic } from "./atomic-write-Dq6R0BPN.mjs";
|
|
14
14
|
import { s as listPlatformConnections } from "./platform-registry-B9mWX9LO.mjs";
|
|
@@ -19,30 +19,31 @@ import { C as readWranglerManagedQueueCleanupCandidates, E as resolveLiveBinding
|
|
|
19
19
|
import { r as trustedCloudflareWorkerAccessHeaders, t as cfAccessHeaders } from "./cf-access-BM9G0lhO.mjs";
|
|
20
20
|
import { t as ensurePlatformAccessToken } from "./cf-access-CWP4avfP.mjs";
|
|
21
21
|
import { a as getApiUrl, c as getToken, l as getTokenSource } from "./auth-B6iOCjKI.mjs";
|
|
22
|
-
import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-
|
|
23
|
-
import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-
|
|
22
|
+
import { A as confirm, K as select, L as log, tt as isCancel } from "./dist-BVdsO7Py.mjs";
|
|
23
|
+
import { o as formatCount, p as note, r as createSpinner, u as getErrorMessage } from "./output-Ba6ZbrzY.mjs";
|
|
24
24
|
import { c as resolveRemoteMode, t as CLOUDFLARE_DEPLOY_BUILD_ENV } from "./env-BJjULvL0.mjs";
|
|
25
25
|
import { a as buildEnv, n as readVersionMetadataBinding, r as selectNativeVersionMetadataBinding, t as CLOUDFLARE_PRESERVE_BINDINGS_BUILD_ENV } from "./version-metadata-DIrqEHQo.mjs";
|
|
26
|
-
import { a as emailConfigInputs, c as renderAddressMap, d as collectPrerenderPathsNode, f as prerenderPages, i as createNodeEmailDns, l as renderEmailChecklist, n as SEND_EMAIL_BINDING, o as preflightEmail, p as prerenderPagesNode, r as applyEmailSetup, t as EMAIL_FROM_VAR, u as collectPrerenderPaths } from "./email-cloudflare-
|
|
27
|
-
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-
|
|
26
|
+
import { a as emailConfigInputs, c as renderAddressMap, d as collectPrerenderPathsNode, f as prerenderPages, i as createNodeEmailDns, l as renderEmailChecklist, n as SEND_EMAIL_BINDING, o as preflightEmail, p as prerenderPagesNode, r as applyEmailSetup, t as EMAIL_FROM_VAR, u as collectPrerenderPaths } from "./email-cloudflare-DfG6UEMm.mjs";
|
|
27
|
+
import { n as completeApplicationAnalysis, t as analyzeApplication } from "./application-routing-L7V-TFhZ.mjs";
|
|
28
28
|
import { i as validateMigrations, t as assertJournalCoherence } from "./validate-CheZGRE7.mjs";
|
|
29
29
|
import { r as getPackageDir } from "./agents-CuNtT0D_.mjs";
|
|
30
30
|
import { a as isExpiredTokenError, r as PlatformClient } from "./client-DM9Kcf4e.mjs";
|
|
31
|
-
import { t as getRequestedProjectSlug } from "./resolve-project-
|
|
31
|
+
import { t as getRequestedProjectSlug } from "./resolve-project-WpwkCB_c.mjs";
|
|
32
32
|
import { a as FRAMEWORK_PRESETS, c as hasBackendFiles, i as isCleanCloudflareExit, l as resolveCloudflareOperationArgv, o as detectPreset, s as formatProjectCommand, t as createCloudflareProcessRunner, u as resolveProjectCommand } from "./cloudflare-process-CeDWJRhj.mjs";
|
|
33
|
-
import { f as listSelfHostSecretNames, h as selfHostSchemaFailureMessage, i as SelfHostSecretListError, l as dischargeSelfHostEnvContext, n as SelfHostFirstDeployError, p as readEmittedWorkerVars, r as SelfHostSchemaError, s as deriveSelfHostEnvContextFromVars, t as SelfHostEnvValidationError } from "./env-validation-
|
|
34
|
-
import {
|
|
35
|
-
import { a as
|
|
36
|
-
import { c as
|
|
33
|
+
import { f as listSelfHostSecretNames, h as selfHostSchemaFailureMessage, i as SelfHostSecretListError, l as dischargeSelfHostEnvContext, n as SelfHostFirstDeployError, p as readEmittedWorkerVars, r as SelfHostSchemaError, s as deriveSelfHostEnvContextFromVars, t as SelfHostEnvValidationError } from "./env-validation-DYxjz_Wo.mjs";
|
|
34
|
+
import { a as needsWrapper, r as cleanupWrapper, t as bundleEntry } from "./wrapper-CwhpNWtH.mjs";
|
|
35
|
+
import { A as resolveDeployLiveBindingConfig, C as generateDeployWrapperIfNeeded, D as hasPrerenderSources, E as hasNonPageBackend, F as resolveStaticDeployPreset, I as toManifestSchedulesAndQueues, L as validateDeployMigrations, M as resolveDeployWranglerCompat, N as resolveFullDeployBuildCommand, O as log$1, P as resolveStaticBuildCommand, S as ensureManagedHyperdrive, T as getGitCommit, _ as hasDeploySchemaDrift, a as collectAndHashAssets, b as assertWorkerMainUploaded, c as formatDeploySummary, d as mergeAndLintRoutingRules, f as streamDirectR2Deploy, g as getDeploySchemaDriftMessage, h as assertDeploySchemaDriftFree, i as buildStaticManifest, j as resolveDeployWorkerMain, k as promptDeployProjectConfig, l as printDeployContext, m as warnUnpublishedRouting, n as runStaticDeploy, o as collectWorkerFiles, p as warnIgnoredNotFoundForFramework, r as buildFrameworkManifest, s as detectNonSpaFallbackWarning, t as assembleVoidManifest, u as printDeploySuccess, v as assertEnvSchemaValid, w as getExitCode, x as createProjectFromSlug, y as assertProjectDeployAccess } from "./deploy-managed-static-Ca4TFdmx.mjs";
|
|
36
|
+
import { a as deleteEnvVarCaseAware, c as isRealKvId, l as provisionCloudflareResources, n as assertValidResourceName, o as isQueueConfirmedAbsent, r as checkCloudflareProvisionDrift, s as isRealD1Id } from "./provision-BnSSkiED.mjs";
|
|
37
|
+
import { c as scrubWranglerAuthCredentials, n as buildSchemaProbeEnv, o as resolveDeployTransport, r as deployChildEnv, s as scrubManagedDeployBuildMarkers, t as MANAGED_DEPLOY_BUILD_ENV } from "./deploy-transport-DWlWBe6M.mjs";
|
|
37
38
|
import { i as safePositional, n as getVoidUserAgent, r as readCfUploadOutput, t as getCfCliVersion } from "./cf-user-agent-ChjQp2MU.mjs";
|
|
38
|
-
import { t as promptForLoginToken } from "./login-
|
|
39
|
+
import { t as promptForLoginToken } from "./login-C2T1oVG-.mjs";
|
|
39
40
|
import { a as record, i as migrateBuiltWranglerConfig, n as prepareCfFrameworkBuildOutput, r as prepareCfStaticBuildOutput, t as prepareCfBuildOutput } from "./cf-build-output-Bc8i3dzE.mjs";
|
|
40
41
|
import { a as parseCloudflareAuthSession, i as ensureCloudflareAuthentication, n as cloudflareCredentialOverrides, t as CloudflareAuthenticationError } from "./cloudflare-auth-CqFBDo52.mjs";
|
|
41
|
-
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-
|
|
42
|
+
import { a as createCloudflareEmptyDomainPublisher, i as createCloudflareEmptyCronPublisher } from "./cloudflare-operations-B42EZeJy.mjs";
|
|
42
43
|
import { n as openMigrationValidationDatabase, t as SqliteMigrationError } from "./sqlite-validation-BzKMWnO4.mjs";
|
|
43
|
-
import { a as discoverFrameworkWranglerFiles, i as writeVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-
|
|
44
|
-
import {
|
|
45
|
-
import { i as runPgMigrations } from "./runner-pg-
|
|
44
|
+
import { a as discoverFrameworkWranglerFiles, i as writeVoidProjectConfig, t as migrateLegacyVoidConfig } from "./migrate-BDIprOYd.mjs";
|
|
45
|
+
import { a as runMySqlMigrations } from "./runner-mysql-BhRaONkO.mjs";
|
|
46
|
+
import { i as runPgMigrations } from "./runner-pg-BRemq_GX.mjs";
|
|
46
47
|
import { t as collectGitDeployMetadata } from "./git-metadata-D-gurjzG.mjs";
|
|
47
48
|
import { createRequire } from "node:module";
|
|
48
49
|
import { cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, readlinkSync, realpathSync, rmSync, statSync, unlinkSync, writeFileSync } from "node:fs";
|
|
@@ -3471,7 +3472,7 @@ async function prepareCloudflareFrameworkArtifact(options) {
|
|
|
3471
3472
|
main: relative(dirname(configPath), workerMain),
|
|
3472
3473
|
assetsDirectory: relative(dirname(configPath), assetsDirectory),
|
|
3473
3474
|
compatibilityDate: voidConfig.worker?.compatibility_date ?? readWranglerTopLevelString(rootConfig, "compatibility_date") ?? DEFAULT_COMPATIBILITY_DATE,
|
|
3474
|
-
compatibilityFlags: preset.cloudflareCompatibilityFlags,
|
|
3475
|
+
compatibilityFlags: analysis.dialect === "sqlite" ? preset.cloudflareCompatibilityFlags : [...preset.cloudflareCompatibilityFlags ?? [], "nodejs_compat"],
|
|
3475
3476
|
crons: [...new Set(crons.flatMap((job) => job.crons))],
|
|
3476
3477
|
requiredSecrets: requiredSecretNames,
|
|
3477
3478
|
versionMetadataBinding,
|
|
@@ -5056,13 +5057,165 @@ async function runCloudflareDeploy(root, options, cliLog, deps = {}) {
|
|
|
5056
5057
|
printDeploySuccess();
|
|
5057
5058
|
}
|
|
5058
5059
|
//#endregion
|
|
5060
|
+
//#region src/cli/deploy-managed-framework.ts
|
|
5061
|
+
/**
|
|
5062
|
+
* Class B/C framework deploy: build with framework CLI, package with preset output paths.
|
|
5063
|
+
*/
|
|
5064
|
+
async function runFrameworkDeploy(root, config, client, detected, fwPreset, voidConfig, skipBuild, gitMetadata, cliLog) {
|
|
5065
|
+
log$1.info(`${detected.name} framework deploy`);
|
|
5066
|
+
cliLog?.info("deploy_mode", {
|
|
5067
|
+
mode: "framework",
|
|
5068
|
+
framework: detected.name
|
|
5069
|
+
});
|
|
5070
|
+
const buildCmd = voidConfig.inference?.build ?? formatProjectCommand(root, fwPreset.buildCommand);
|
|
5071
|
+
if (!skipBuild) {
|
|
5072
|
+
log$1.step(`Building (${buildCmd})...`);
|
|
5073
|
+
cliLog?.info("build_start", { command: buildCmd });
|
|
5074
|
+
const buildStartedAt = Date.now();
|
|
5075
|
+
execSync(voidConfig.inference?.build ?? resolveProjectCommand(root, fwPreset.buildCommand), {
|
|
5076
|
+
cwd: root,
|
|
5077
|
+
stdio: "inherit",
|
|
5078
|
+
env: buildEnv({ ...MANAGED_DEPLOY_BUILD_ENV }, { localBinRoot: root })
|
|
5079
|
+
});
|
|
5080
|
+
cliLog?.info("build_end", { durationMs: Date.now() - buildStartedAt });
|
|
5081
|
+
} else cliLog?.info("build_skipped", { reason: "skipBuild" });
|
|
5082
|
+
const workerDir = join(root, fwPreset.workerDir);
|
|
5083
|
+
const assetsDir = join(root, fwPreset.assetsDir);
|
|
5084
|
+
const frameworkAssetIgnorePatterns = fwPreset.workerDir === fwPreset.assetsDir && fwPreset.workerMain === "_worker.js" ? [`/${fwPreset.workerMain}`, "/_routes.json"] : [];
|
|
5085
|
+
const { headerRules, redirectRules, fallbackRules } = mergeAndLintRoutingRules(assetsDir, voidConfig.routing);
|
|
5086
|
+
warnIgnoredNotFoundForFramework(voidConfig.routing?.notFound, detected.name);
|
|
5087
|
+
if (!existsSync(workerDir)) {
|
|
5088
|
+
log$1.error(`deploy: Worker output '${fwPreset.workerDir}' not found. Run '${buildCmd}' first.`);
|
|
5089
|
+
process.exit(1);
|
|
5090
|
+
}
|
|
5091
|
+
const analysis = analyzeApplicationSync(root, {
|
|
5092
|
+
config: voidConfig,
|
|
5093
|
+
environment: "prod"
|
|
5094
|
+
});
|
|
5095
|
+
const { paths, bindings, authEnabled, dialect } = analysis;
|
|
5096
|
+
if (authEnabled) {
|
|
5097
|
+
log$1.error("deploy: Void-managed Better Auth is only supported in Void apps. Use Better Auth's official integration for this framework instead.");
|
|
5098
|
+
process.exit(1);
|
|
5099
|
+
}
|
|
5100
|
+
if (bindings.needsLive) {
|
|
5101
|
+
log$1.error("deploy: void/live is currently supported in Void apps only.");
|
|
5102
|
+
process.exit(1);
|
|
5103
|
+
}
|
|
5104
|
+
assertDeploySchemaDriftFree(root, dialect);
|
|
5105
|
+
const validatedMigrations = validateDeployMigrations(paths.migrationsDir, analysis.migrations);
|
|
5106
|
+
if (dialect !== "sqlite" && analysis.needsDatabase) await ensureManagedHyperdrive(client, config.projectId, dialect);
|
|
5107
|
+
const rawJobs = analysis.jobs;
|
|
5108
|
+
const rawQueues = analysis.queues;
|
|
5109
|
+
const originalEntry = join(workerDir, fwPreset.workerMain);
|
|
5110
|
+
const wrapperFeatures = {
|
|
5111
|
+
crons: rawJobs,
|
|
5112
|
+
queues: rawQueues,
|
|
5113
|
+
hasMigrations: validatedMigrations != null && validatedMigrations.length > 0,
|
|
5114
|
+
migrationDialect: dialect
|
|
5115
|
+
};
|
|
5116
|
+
let actualWorkerDir = workerDir;
|
|
5117
|
+
let actualWorkerMain = fwPreset.workerMain;
|
|
5118
|
+
if (fwPreset.bundle) {
|
|
5119
|
+
log$1.step("Bundling worker...");
|
|
5120
|
+
const bundleResult = await bundleEntry(root, originalEntry);
|
|
5121
|
+
actualWorkerDir = bundleResult.outputDir;
|
|
5122
|
+
actualWorkerMain = bundleResult.entryFilename;
|
|
5123
|
+
log$1.info("Worker bundled");
|
|
5124
|
+
}
|
|
5125
|
+
if (needsWrapper(wrapperFeatures)) {
|
|
5126
|
+
log$1.step("Generating wrapper...");
|
|
5127
|
+
await generateDeployWrapperIfNeeded(root, actualWorkerDir, actualWorkerMain, wrapperFeatures);
|
|
5128
|
+
log$1.info("Wrapper generated");
|
|
5129
|
+
}
|
|
5130
|
+
const wranglerCompat = resolveDeployWranglerCompat(root, voidConfig, workerDir, { dialect });
|
|
5131
|
+
const revalidate = collectRevalidate(voidConfig, null);
|
|
5132
|
+
const prerender = voidConfig.routing?.isr === false ? void 0 : voidConfig.routing?.prerender;
|
|
5133
|
+
const { schedules, queues } = toManifestSchedulesAndQueues(rawJobs, rawQueues);
|
|
5134
|
+
await assertEnvSchemaValid(root, client, config.projectId, voidConfig.worker?.vars);
|
|
5135
|
+
const s = createSpinner();
|
|
5136
|
+
const onProgress = (msg) => s.message(msg);
|
|
5137
|
+
s.start("Checking for changes...");
|
|
5138
|
+
cliLog?.info("preflight_start", { dir: assetsDir });
|
|
5139
|
+
const { assetManifest, assetFiles } = await collectAndHashAssets(assetsDir, onProgress, { ignorePatterns: frameworkAssetIgnorePatterns });
|
|
5140
|
+
const { needed, skipped } = await client.preflight(config.projectId, assetManifest, true);
|
|
5141
|
+
s.stop("Checked for changes");
|
|
5142
|
+
cliLog?.info("preflight_end", {
|
|
5143
|
+
total: Object.keys(assetManifest).length,
|
|
5144
|
+
needed: needed.length,
|
|
5145
|
+
skipped
|
|
5146
|
+
});
|
|
5147
|
+
if (skipped > 0) log$1.info(`Skipping ${formatCount(skipped, "unchanged asset")}`);
|
|
5148
|
+
s.start("Packaging...");
|
|
5149
|
+
cliLog?.info("package_start", {
|
|
5150
|
+
mode: "framework",
|
|
5151
|
+
framework: detected.name
|
|
5152
|
+
});
|
|
5153
|
+
const packageStartedAt = Date.now();
|
|
5154
|
+
const packageOptions = {
|
|
5155
|
+
bindingNames: analysis.bindingNames,
|
|
5156
|
+
compatibilityDate: wranglerCompat?.compatibilityDate,
|
|
5157
|
+
compatibilityFlags: wranglerCompat?.compatibilityFlags,
|
|
5158
|
+
cpuMs: voidConfig.worker?.limits?.cpu_ms
|
|
5159
|
+
};
|
|
5160
|
+
const manifest = buildFrameworkManifest({
|
|
5161
|
+
frameworkName: detected.name,
|
|
5162
|
+
workerMain: actualWorkerMain,
|
|
5163
|
+
bindings,
|
|
5164
|
+
migrations: validatedMigrations,
|
|
5165
|
+
schedules,
|
|
5166
|
+
queues,
|
|
5167
|
+
revalidate,
|
|
5168
|
+
revalidateQueryAllowlist: voidConfig.routing?.revalidateQueryAllowlist,
|
|
5169
|
+
prerender,
|
|
5170
|
+
vars: voidConfig.worker?.vars,
|
|
5171
|
+
assetConfig: { not_found_handling: "none" },
|
|
5172
|
+
packageOptions,
|
|
5173
|
+
hashedAssetsPrefix: fwPreset.hashedAssetsPrefix ?? "assets",
|
|
5174
|
+
headerRules,
|
|
5175
|
+
redirectRules,
|
|
5176
|
+
fallbackRules,
|
|
5177
|
+
dialect
|
|
5178
|
+
});
|
|
5179
|
+
const workerFiles = collectWorkerFiles(actualWorkerDir);
|
|
5180
|
+
cliLog?.info("package_end", {
|
|
5181
|
+
mode: "framework",
|
|
5182
|
+
durationMs: Date.now() - packageStartedAt
|
|
5183
|
+
});
|
|
5184
|
+
const result = await streamDirectR2Deploy({
|
|
5185
|
+
client,
|
|
5186
|
+
projectId: config.projectId,
|
|
5187
|
+
manifest,
|
|
5188
|
+
assetManifest,
|
|
5189
|
+
assetFiles,
|
|
5190
|
+
needed,
|
|
5191
|
+
gitMetadata,
|
|
5192
|
+
preflightUsed: skipped > 0,
|
|
5193
|
+
workerFiles,
|
|
5194
|
+
spinner: s,
|
|
5195
|
+
cliLog
|
|
5196
|
+
});
|
|
5197
|
+
note(formatDeploySummary({
|
|
5198
|
+
workers: result.workers,
|
|
5199
|
+
assets: result.assets,
|
|
5200
|
+
unchangedAssets: skipped,
|
|
5201
|
+
migrations: result.migrations,
|
|
5202
|
+
cronJobs: schedules.length,
|
|
5203
|
+
queues: queues.length,
|
|
5204
|
+
prerenderedPages: prerender?.length,
|
|
5205
|
+
revalidate,
|
|
5206
|
+
framework: detected.name
|
|
5207
|
+
}), result.url);
|
|
5208
|
+
cleanupWrapper(root);
|
|
5209
|
+
warnUnpublishedRouting(result);
|
|
5210
|
+
printDeploySuccess(result.published !== false);
|
|
5211
|
+
}
|
|
5212
|
+
//#endregion
|
|
5059
5213
|
//#region src/cli/deploy-managed-full.ts
|
|
5060
5214
|
async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBuild, gitMetadata, detected, cliLog) {
|
|
5061
5215
|
cliLog?.info("deploy_mode", {
|
|
5062
5216
|
mode: "full",
|
|
5063
5217
|
framework: detected?.name
|
|
5064
5218
|
});
|
|
5065
|
-
assertManagedDurableStateSupported(root);
|
|
5066
5219
|
if (!skipBuild) {
|
|
5067
5220
|
const { label: buildCmd, command: buildExec } = resolveFullDeployBuildCommand(root, voidConfig.inference?.build);
|
|
5068
5221
|
log$1.step(`Building (${buildCmd})...`);
|
|
@@ -5172,7 +5325,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5172
5325
|
authEnabled,
|
|
5173
5326
|
hasLive: liveConfig !== void 0
|
|
5174
5327
|
});
|
|
5175
|
-
if (allPrerenderable && !nonPageBackend && schedules.length === 0 && queues.length === 0) {
|
|
5328
|
+
if (allPrerenderable && !nonPageBackend && analysis.durableObjects.length === 0 && schedules.length === 0 && queues.length === 0) {
|
|
5176
5329
|
log$1.info("All pages prerendered — deploying as static site");
|
|
5177
5330
|
cliLog?.info("full_to_static_redirect", { reason: "all_pages_prerendered" });
|
|
5178
5331
|
return runStaticDeploy(root, config, client, {
|
|
@@ -5206,7 +5359,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5206
5359
|
needsSandbox: bindings.needsSandbox
|
|
5207
5360
|
});
|
|
5208
5361
|
const workerMain = resolveDeployWorkerMain(voidConfig, join(distDir, workerDirName));
|
|
5209
|
-
await assertEnvSchemaValid(root, client, config.projectId);
|
|
5362
|
+
await assertEnvSchemaValid(root, client, config.projectId, voidConfig.worker?.vars);
|
|
5210
5363
|
const s = createSpinner();
|
|
5211
5364
|
const onProgress = (msg) => s.message(msg);
|
|
5212
5365
|
const assetConfig = resolveAssetConfig({
|
|
@@ -5268,6 +5421,7 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5268
5421
|
ssr: isSsr || hasRoutes || hasMiddleware || hasWebSockets || authEnabled,
|
|
5269
5422
|
framework: isFrameworkMode ? detected.name : void 0,
|
|
5270
5423
|
revalidate,
|
|
5424
|
+
vars: voidConfig.worker?.vars,
|
|
5271
5425
|
queues,
|
|
5272
5426
|
prerender: uniquePrerenderPaths,
|
|
5273
5427
|
assetConfig,
|
|
@@ -5277,7 +5431,8 @@ async function runFullDeploy(root, config, client, voidConfig, fwPreset, skipBui
|
|
|
5277
5431
|
redirectRules,
|
|
5278
5432
|
fallbackRules,
|
|
5279
5433
|
dialect,
|
|
5280
|
-
webSockets
|
|
5434
|
+
webSockets,
|
|
5435
|
+
durableObjects: analysis.durableObjects
|
|
5281
5436
|
}, voidConfig.routing?.revalidate, voidConfig.routing?.isr !== false);
|
|
5282
5437
|
const workerDir = join(distDir, workerDirName);
|
|
5283
5438
|
if (isFrameworkMode) {
|