void 0.9.2 → 0.9.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.
Files changed (53) hide show
  1. package/README.md +1 -0
  2. package/dist/{better-auth-shared-ChVbrq52.mjs → better-auth-shared-QAfk8CAS.mjs} +1 -1
  3. package/dist/cli/cli.mjs +12 -12
  4. package/dist/{config-BVEC0lti.mjs → config-8dLIngKW.mjs} +1 -1
  5. package/dist/{db-DiddQC2v.mjs → db-UW4IYQFw.mjs} +4 -4
  6. package/dist/{deploy-CRU9fGjE.mjs → deploy-RQXpVBL-.mjs} +27 -10
  7. package/dist/{drizzle-2fs1qTgy.mjs → drizzle-DYstYz0j.mjs} +1 -1
  8. package/dist/{env-Bvw0wMTI.mjs → env-C_ZcxxED.mjs} +2 -2
  9. package/dist/{env-types-D6qI1ThV.mjs → env-types-CaJaIRXU.mjs} +1 -1
  10. package/dist/{env-validation-DBJsxZLz.mjs → env-validation-LH6eoyW-.mjs} +3 -3
  11. package/dist/{gen-CZdNWIaA.mjs → gen-O5mXZ76K.mjs} +2 -2
  12. package/dist/{handler-xflsMwWM.d.mts → handler-hm9KldPP.d.mts} +21 -1
  13. package/dist/{headers-Y0jshugF.mjs → headers-VkAnACKX.mjs} +2 -2
  14. package/dist/index.d.mts +2 -2
  15. package/dist/index.mjs +48 -43
  16. package/dist/{init-BHupO7Fm.mjs → init-DGrLx2ls.mjs} +5 -5
  17. package/dist/{node-CHWVVjO6.mjs → node-Df8UjQ2H.mjs} +2 -2
  18. package/dist/pages/client.d.mts +1 -1
  19. package/dist/pages/index.d.mts +7 -5
  20. package/dist/pages/index.mjs +3 -3
  21. package/dist/pages/islands-plugin.d.mts +1 -1
  22. package/dist/pages/islands-plugin.mjs +1 -1
  23. package/dist/pages/protocol.d.mts +2 -2
  24. package/dist/pages/protocol.mjs +29 -11
  25. package/dist/{plugin-inference-BUBhHt_1.mjs → plugin-inference--7geW5Z2.mjs} +1 -1
  26. package/dist/{prepare-CrlAVbWS.mjs → prepare-DT-7QII_.mjs} +14 -19
  27. package/dist/{preset-CIJG2O7a.mjs → preset-2aBxMfY1.mjs} +1 -1
  28. package/dist/{project-tsconfig-HAGjfY6w.mjs → project-tsconfig-BTNuNoJ0.mjs} +18 -4
  29. package/dist/{protocol-DYca39yJ.d.mts → protocol-B9GZA4Bn.d.mts} +7 -4
  30. package/dist/{route-types-jxRfWuCb.mjs → route-types-D03ryMXz.mjs} +3 -2
  31. package/dist/runtime/better-auth-pg.mjs +1 -1
  32. package/dist/runtime/better-auth.mjs +1 -1
  33. package/dist/runtime/handler.d.mts +2 -2
  34. package/dist/runtime/handler.mjs +67 -1
  35. package/dist/runtime/live.d.mts +1 -1
  36. package/dist/runtime/validator.d.mts +1 -1
  37. package/dist/runtime/ws.d.mts +1 -1
  38. package/dist/{scan-BNC_1OsY.mjs → scan-B2H1Vo2C.mjs} +3 -3
  39. package/dist/{scan-2YmJkYAf.mjs → scan-VCAM1oh3.mjs} +55 -29
  40. package/dist/{types-Dm9kep2X.d.mts → types-DEWCqHtl.d.mts} +12 -3
  41. package/package.json +2 -2
  42. package/skills/void/docs/guide/pages-routing/layouts.md +8 -7
  43. package/skills/void/docs/guide/pages-routing/loaders.md +1 -1
  44. package/skills/void/docs/guide/pages-routing/overview.md +32 -5
  45. package/skills/void/docs/guide/server-routing.md +28 -0
  46. package/skills/void/docs/node_modules/void/AGENTS.md +15 -14
  47. package/skills/void/docs/node_modules/void/README.md +1 -0
  48. package/skills/void/docs/reference/api.md +44 -1
  49. package/skills/void/docs/reference/config.md +1 -1
  50. /package/dist/{dist-DR9sIMbM.mjs → dist-5cGIJHQQ.mjs} +0 -0
  51. /package/dist/{dotenv-Bkoqyq9r.mjs → dotenv-lS94ymhM.mjs} +0 -0
  52. /package/dist/{log-CWWZV4V1.mjs → log-BdD_Fpms.mjs} +0 -0
  53. /package/dist/{providers-uC0PJg1c.mjs → providers-BwPbdHdi.mjs} +0 -0
package/README.md CHANGED
@@ -48,6 +48,7 @@ Runtime helpers include:
48
48
 
49
49
  - `defineHandler`
50
50
  - `defineMiddleware`
51
+ - `basicAuth`
51
52
  - `defineScheduled`
52
53
  - `defineQueue`
53
54
  - `void/db`
@@ -1,4 +1,4 @@
1
- import { a as isVoidSocialAuthProvider, r as getVoidAuthProviderEnvNames } from "./providers-uC0PJg1c.mjs";
1
+ import { a as isVoidSocialAuthProvider, r as getVoidAuthProviderEnvNames } from "./providers-BwPbdHdi.mjs";
2
2
  import { authContext } from "./runtime/auth.mjs";
3
3
  import { randomBytes, scrypt, timingSafeEqual } from "node:crypto";
4
4
  import { betterAuth } from "better-auth";
package/dist/cli/cli.mjs CHANGED
@@ -1553,7 +1553,7 @@ else if (command === "deploy") {
1553
1553
  R.error(err instanceof Error ? err.message : String(err));
1554
1554
  process.exit(1);
1555
1555
  }
1556
- import("../deploy-CRU9fGjE.mjs").then((n) => n.t).then(({ runDeploy }) => {
1556
+ import("../deploy-RQXpVBL-.mjs").then((n) => n.t).then(({ runDeploy }) => {
1557
1557
  runDeploy(root, {
1558
1558
  projectSlug: deployArgs.projectSlug,
1559
1559
  dir: deployArgs.dir,
@@ -1569,9 +1569,9 @@ else if (command === "deploy") {
1569
1569
  else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-CLrqSbqj.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
1570
1570
  else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-C_uTY7xx.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
1571
1571
  else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-B7RntQ1r.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
1572
- else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-DiddQC2v.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
1573
- else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-Bvw0wMTI.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
1574
- else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-CZdNWIaA.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
1572
+ else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-UW4IYQFw.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
1573
+ else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-C_ZcxxED.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
1574
+ else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-O5mXZ76K.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
1575
1575
  else if (command === "prepare") {
1576
1576
  const root = process.cwd();
1577
1577
  let prepareArgs;
@@ -1581,7 +1581,7 @@ else if (command === "prepare") {
1581
1581
  R.error(err instanceof Error ? err.message : String(err));
1582
1582
  process.exit(1);
1583
1583
  }
1584
- import("../prepare-CrlAVbWS.mjs").then(({ runPrepareCommand }) => {
1584
+ import("../prepare-DT-7QII_.mjs").then(({ runPrepareCommand }) => {
1585
1585
  runPrepareCommand(root, prepareArgs).catch((err) => {
1586
1586
  R.error(err.message ?? err);
1587
1587
  process.exit(1);
@@ -1589,7 +1589,7 @@ else if (command === "prepare") {
1589
1589
  });
1590
1590
  } else if (command === "init") {
1591
1591
  const root = process.cwd();
1592
- import("../init-BHupO7Fm.mjs").then(({ runInitCommand, parseInitArgs }) => {
1592
+ import("../init-DGrLx2ls.mjs").then(({ runInitCommand, parseInitArgs }) => {
1593
1593
  let initArgs;
1594
1594
  try {
1595
1595
  initArgs = parseInitArgs(args.slice(1));
@@ -1678,12 +1678,12 @@ else if (command === "-v" || command === "--version") {
1678
1678
  const root = process.cwd();
1679
1679
  switch (cmd) {
1680
1680
  case "init": {
1681
- const { runInitCommand, parseInitArgs } = await import("../init-BHupO7Fm.mjs");
1681
+ const { runInitCommand, parseInitArgs } = await import("../init-DGrLx2ls.mjs");
1682
1682
  await runInitCommand(root, parseInitArgs([]));
1683
1683
  return;
1684
1684
  }
1685
1685
  case "deploy": {
1686
- const { runDeploy } = await import("../deploy-CRU9fGjE.mjs").then((n) => n.t);
1686
+ const { runDeploy } = await import("../deploy-RQXpVBL-.mjs").then((n) => n.t);
1687
1687
  await runDeploy(root);
1688
1688
  return;
1689
1689
  }
@@ -1696,11 +1696,11 @@ else if (command === "-v" || command === "--version") {
1696
1696
  case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-CLrqSbqj.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
1697
1697
  case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-C_uTY7xx.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
1698
1698
  case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-B7RntQ1r.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
1699
- case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-DiddQC2v.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
1700
- case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-Bvw0wMTI.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
1701
- case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-CZdNWIaA.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
1699
+ case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-UW4IYQFw.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
1700
+ case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-C_ZcxxED.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
1701
+ case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-O5mXZ76K.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
1702
1702
  case "prepare": {
1703
- const { runPrepareCommand } = await import("../prepare-CrlAVbWS.mjs");
1703
+ const { runPrepareCommand } = await import("../prepare-DT-7QII_.mjs");
1704
1704
  await runPrepareCommand(root, parsePrepareArgs([]));
1705
1705
  return;
1706
1706
  }
@@ -1,7 +1,7 @@
1
1
  import { n as __exportAll } from "./chunk-DJd-R1mw.mjs";
2
2
  import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
3
3
  import { a as validateSourceDir } from "./project-paths-CCMrHYQm.mjs";
4
- import { i as isVoidAuthProvider, t as VOID_AUTH_PROVIDERS } from "./providers-uC0PJg1c.mjs";
4
+ import { i as isVoidAuthProvider, t as VOID_AUTH_PROVIDERS } from "./providers-BwPbdHdi.mjs";
5
5
  import { readFileSync } from "node:fs";
6
6
  //#region src/config.ts
7
7
  var config_exports = /* @__PURE__ */ __exportAll({
@@ -5,12 +5,12 @@ import { t as cfAccessHeaders } from "./cf-access-DKDsgwOU.mjs";
5
5
  import { c as getToken, n as PlatformClient, t as PlatformApiError, u as isStagingMode } from "./client-DIfOFf1W.mjs";
6
6
  import { c as R, g as ge, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
7
7
  import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
8
- import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-BVEC0lti.mjs";
9
- import { r as detectFramework } from "./plugin-inference-BUBhHt_1.mjs";
8
+ import { c as getDatabaseDialect, f as readConfig, p as resolveBindingNames } from "./config-8dLIngKW.mjs";
9
+ import { r as detectFramework } from "./plugin-inference--7geW5Z2.mjs";
10
10
  import { a as writeJournal, i as stripSqlExt, r as readJournal, t as collectMigrations } from "./collect-9rO3JFNM.mjs";
11
11
  import { n as listDrizzleArtifacts, r as validateMigrations, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
12
12
  import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-M3pxItg2.mjs";
13
- import { formatTimestamp } from "./gen-CZdNWIaA.mjs";
13
+ import { formatTimestamp } from "./gen-O5mXZ76K.mjs";
14
14
  import { existsSync, readFileSync, readdirSync, renameSync, rmSync, writeFileSync } from "node:fs";
15
15
  import { fileURLToPath, pathToFileURL } from "node:url";
16
16
  import { execFileSync } from "node:child_process";
@@ -947,7 +947,7 @@ async function runExport(root, args, dialect) {
947
947
  }
948
948
  }
949
949
  async function runSetUrl(root) {
950
- const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-BVEC0lti.mjs").then((n) => n.n);
950
+ const { readConfig: readVoidConfig, getDatabaseDialect: getDialect } = await import("./config-8dLIngKW.mjs").then((n) => n.n);
951
951
  if (getDialect(readVoidConfig(root)) !== "postgresql") {
952
952
  R.error("db: This command is only for PostgreSQL projects. Set \"database\": \"pg\" in void.json.");
953
953
  process.exit(1);
@@ -6,24 +6,24 @@ import { t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
6
6
  import { a as isExpiredTokenError, c as getToken, i as isCliOutdatedError, l as getTokenSource, n as PlatformClient, o as parsePlatformErrorBody, t as PlatformApiError, u as isStagingMode } from "./client-DIfOFf1W.mjs";
7
7
  import { c as R, g as ge, u as Se, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
8
8
  import { a as writeProjectConfig, r as readProjectConfig } from "./project-CH9pdo16.mjs";
9
- import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-BVEC0lti.mjs";
10
- import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes } from "./scan-BNC_1OsY.mjs";
11
- import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference-BUBhHt_1.mjs";
12
- import { i as voidWarn, r as voidLog } from "./log-CWWZV4V1.mjs";
9
+ import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-8dLIngKW.mjs";
10
+ import { a as scanQueuesSync, i as scanWebSocketRoutesSync, o as scanJobsSync, r as scanRoutes } from "./scan-B2H1Vo2C.mjs";
11
+ import { i as inferProjectBindings, l as validateSsrEntry, n as FRAMEWORK_SCAN_DIRS, r as detectFramework } from "./plugin-inference--7geW5Z2.mjs";
12
+ import { i as voidWarn, r as voidLog } from "./log-BdD_Fpms.mjs";
13
13
  import { t as discoverSchema } from "./discover-C8N1I4tK.mjs";
14
- import { t as findEnvFile } from "./env-types-D6qI1ThV.mjs";
15
- import { i as validateProdEnv, n as formatEnvReport, r as getDeployEnvDefaults, t as fetchRemoteSecretNames } from "./env-validation-DBJsxZLz.mjs";
14
+ import { t as findEnvFile } from "./env-types-CaJaIRXU.mjs";
15
+ import { i as validateProdEnv, n as formatEnvReport, r as getDeployEnvDefaults, t as fetchRemoteSecretNames } from "./env-validation-LH6eoyW-.mjs";
16
16
  import { n as writeDrizzleConfig } from "./config--wXmVOoe.mjs";
17
17
  import { t as collectMigrations } from "./collect-9rO3JFNM.mjs";
18
18
  import { n as buildMigrationPlanBundle } from "./plan-aD3wRDqF.mjs";
19
19
  import { r as validateMigrations, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
20
- import { t as scanPages } from "./scan-2YmJkYAf.mjs";
20
+ import { t as scanPages } from "./scan-VCAM1oh3.mjs";
21
21
  import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-M3pxItg2.mjs";
22
22
  import { i as promptProjectSetupAction, n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DCUrFJxa.mjs";
23
23
  import { r as resolveProjectBySlug, t as getRequestedProjectSlug } from "./resolve-project-D4O1_fZz.mjs";
24
- import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-Y0jshugF.mjs";
24
+ import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-VkAnACKX.mjs";
25
25
  import { t as promptForLoginToken } from "./login-tt1OmNVg.mjs";
26
- import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-CIJG2O7a.mjs";
26
+ import { i as resolveProjectCommand, n as detectPreset, r as formatProjectCommand, t as FRAMEWORK_PRESETS } from "./preset-2aBxMfY1.mjs";
27
27
  import { createRequire } from "node:module";
28
28
  import { copyFileSync, cpSync, createWriteStream, existsSync, mkdirSync, mkdtempSync, readFileSync, readdirSync, renameSync, rmSync, unlinkSync, writeFileSync } from "node:fs";
29
29
  import { fileURLToPath, pathToFileURL } from "node:url";
@@ -2297,6 +2297,7 @@ var deploy_exports = /* @__PURE__ */ __exportAll({
2297
2297
  hasDeploySchemaDrift: () => hasDeploySchemaDrift,
2298
2298
  promptDeployProjectConfig: () => promptDeployProjectConfig,
2299
2299
  resolveDeployLiveBindingConfig: () => resolveDeployLiveBindingConfig,
2300
+ resolveDeployWorkerMain: () => resolveDeployWorkerMain,
2300
2301
  resolveDeployWranglerCompat: () => resolveDeployWranglerCompat,
2301
2302
  resolveDistDir: () => resolveDistDir,
2302
2303
  resolveStaticBuildCommand: () => resolveStaticBuildCommand,
@@ -2376,6 +2377,19 @@ function resolveDeployWranglerCompat(root, config, buildOutputDir, requirements)
2376
2377
  compatibilityFlags
2377
2378
  };
2378
2379
  }
2380
+ function resolveDeployWorkerMain(config, buildOutputDir) {
2381
+ if (isNodeTarget(config.target)) return;
2382
+ try {
2383
+ const wrangler = JSON.parse(readFileSync(join(buildOutputDir, "wrangler.json"), "utf-8"));
2384
+ return typeof wrangler.main === "string" && wrangler.main.length > 0 ? wrangler.main : void 0;
2385
+ } catch {
2386
+ return;
2387
+ }
2388
+ }
2389
+ function assertWorkerMainUploaded(workerFiles, workerMain) {
2390
+ if (!workerMain || workerFiles.size === 0) return;
2391
+ if (!workerFiles.has(workerMain)) throw new Error(`deploy: Worker entry '${workerMain}' from wrangler.json was not found in uploaded worker modules.`);
2392
+ }
2379
2393
  /**
2380
2394
  * Run the full deploy pipeline:
2381
2395
  * 1. Check auth
@@ -3196,7 +3210,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3196
3210
  else revalidate = perPageRules;
3197
3211
  }
3198
3212
  if (deployConfig.output === "static" && pageScan && !isSsr) {
3199
- if (pageScan.pages.every((p) => p.prerender && (p.params.length === 0 && !p.catchAll || p.hasGetPrerenderPaths)) && !(hasRoutes || hasMiddleware || hasWebSockets || authEnabled || liveConfig !== void 0) && schedules.length === 0 && queues.length === 0) {
3213
+ if (pageScan.pages.every((p) => p.shouldPrerender && (p.params.length === 0 && !p.catchAll || p.hasGetPrerenderPaths)) && !(hasRoutes || hasMiddleware || hasWebSockets || authEnabled || liveConfig !== void 0) && schedules.length === 0 && queues.length === 0) {
3200
3214
  R.info("All pages prerendered — deploying as static site");
3201
3215
  cliLog?.info("full_to_static_redirect", { reason: "all_pages_prerendered" });
3202
3216
  return runStaticDeploy(root, config, client, {
@@ -3223,6 +3237,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3223
3237
  dialect,
3224
3238
  needsSandbox: effectiveBindings.needsSandbox
3225
3239
  });
3240
+ const workerMain = resolveDeployWorkerMain(deployConfig, join(distDir, workerDirName));
3226
3241
  const envVars = loadDeployEnv(root);
3227
3242
  await assertEnvSchemaValid(root, client, config.projectId);
3228
3243
  await applySchemaDefaultsToVars(root, envVars);
@@ -3264,6 +3279,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3264
3279
  const voidPackageOptions = {
3265
3280
  compatibilityDate: wranglerCompat?.compatibilityDate,
3266
3281
  compatibilityFlags: wranglerCompat?.compatibilityFlags,
3282
+ ...workerMain && { workerMain },
3267
3283
  ...sandboxConfig && { sandbox: sandboxConfig },
3268
3284
  ...liveConfig && { live: liveConfig },
3269
3285
  revalidateQueryAllowlist: deployConfig.routing?.revalidateQueryAllowlist
@@ -3311,6 +3327,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3311
3327
  }
3312
3328
  }
3313
3329
  const workerFiles = collectWorkerFiles(workerDir);
3330
+ assertWorkerMainUploaded(workerFiles, workerMain);
3314
3331
  cliLog?.info("package_end", {
3315
3332
  mode: "full",
3316
3333
  durationMs: Date.now() - packageStartedAt
@@ -1,4 +1,4 @@
1
- import { a as isVoidSocialAuthProvider } from "./providers-uC0PJg1c.mjs";
1
+ import { a as isVoidSocialAuthProvider } from "./providers-BwPbdHdi.mjs";
2
2
  import { getAuthTables, getSchema } from "better-auth/db";
3
3
  //#region src/auth/drizzle.ts
4
4
  const DEFAULT_TABLE_ORDER = Number.MAX_SAFE_INTEGER;
@@ -3,8 +3,8 @@ import { n as cliTitle } from "./output-DeiS4oEX.mjs";
3
3
  import { c as getToken, n as PlatformClient } from "./client-DIfOFf1W.mjs";
4
4
  import { c as R, g as ge, u as Se, y as ye } from "./dist-abzUneor.mjs";
5
5
  import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
6
- import { r as generateEnvTypes, t as findEnvFile } from "./env-types-D6qI1ThV.mjs";
7
- import { a as loadUserEnvFile, i as validateProdEnv, n as formatEnvReport, t as fetchRemoteSecretNames } from "./env-validation-DBJsxZLz.mjs";
6
+ import { r as generateEnvTypes, t as findEnvFile } from "./env-types-CaJaIRXU.mjs";
7
+ import { a as loadUserEnvFile, i as validateProdEnv, n as formatEnvReport, t as fetchRemoteSecretNames } from "./env-validation-LH6eoyW-.mjs";
8
8
  import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
9
9
  //#region src/cli/env-example.ts
10
10
  /**
@@ -1,6 +1,6 @@
1
1
  import { s as relative } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
2
2
  import { n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
3
- import { i as voidWarn } from "./log-CWWZV4V1.mjs";
3
+ import { i as voidWarn } from "./log-BdD_Fpms.mjs";
4
4
  import { existsSync } from "node:fs";
5
5
  //#region src/codegen/env-types.ts
6
6
  /** Roots already warned about duplicate env.ts files — dedupes noisy repeat calls. */
@@ -1,7 +1,7 @@
1
1
  import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
2
- import { i as voidWarn } from "./log-CWWZV4V1.mjs";
3
- import { n as mergeAndExpand, r as parseDotenvFile } from "./dotenv-Bkoqyq9r.mjs";
4
- import { t as findEnvFile } from "./env-types-D6qI1ThV.mjs";
2
+ import { i as voidWarn } from "./log-BdD_Fpms.mjs";
3
+ import { n as mergeAndExpand, r as parseDotenvFile } from "./dotenv-lS94ymhM.mjs";
4
+ import { t as findEnvFile } from "./env-types-CaJaIRXU.mjs";
5
5
  import { pathToFileURL } from "node:url";
6
6
  //#region src/host/load-user-env.ts
7
7
  /**
@@ -2,8 +2,8 @@ import { a as join, n as dirname, s as relative } from "./pathe.M-eThtNZ-BrPhGF_
2
2
  import { n as cliTitle } from "./output-DeiS4oEX.mjs";
3
3
  import { n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
4
4
  import { _ as me, c as R, g as ge, i as Ee, x as q, y as ye } from "./dist-abzUneor.mjs";
5
- import { c as getDatabaseDialect, f as readConfig } from "./config-BVEC0lti.mjs";
6
- import { n as ensureProjectTsconfig } from "./project-tsconfig-HAGjfY6w.mjs";
5
+ import { n as ensureProjectTsconfig } from "./project-tsconfig-BTNuNoJ0.mjs";
6
+ import { c as getDatabaseDialect, f as readConfig } from "./config-8dLIngKW.mjs";
7
7
  import { n as writeDrizzleConfig } from "./config--wXmVOoe.mjs";
8
8
  import { r as readJournal, t as collectMigrations } from "./collect-9rO3JFNM.mjs";
9
9
  import { n as listDrizzleArtifacts, t as assertJournalCoherence } from "./validate-CNWm-PsL.mjs";
@@ -162,6 +162,17 @@ declare module "hono" {
162
162
  type CloudContext = Context<CloudEnv>;
163
163
  type HandlerFn = (c: CloudContext) => unknown | Promise<unknown>;
164
164
  type MiddlewareFn = MiddlewareHandler<CloudEnv>;
165
+ type BasicAuthOptionValue = string | (() => string);
166
+ interface BasicAuthOptions {
167
+ /** Username required by the Basic auth challenge. */
168
+ username: BasicAuthOptionValue;
169
+ /** Password required by the Basic auth challenge. */
170
+ password: BasicAuthOptionValue;
171
+ /** Browser prompt realm. Defaults to "Restricted". */
172
+ realm?: BasicAuthOptionValue;
173
+ /** Response body for failed authentication. Defaults to "Authentication required". */
174
+ message?: BasicAuthOptionValue;
175
+ }
165
176
  /** Pre-rendered asset tags injected by the SSR build. */
166
177
  type RenderAssetTags = {
167
178
  /** CSS stylesheet links for `<head>`. */css: string; /** JS modulepreload links for `<head>` (only when page needs JS). */
@@ -243,6 +254,15 @@ declare namespace defineHandler {
243
254
  */
244
255
  declare function defineMiddleware(handler: MiddlewareHandler<CloudEnv>): MiddlewareHandler<CloudEnv>;
245
256
  /**
257
+ * Create Basic authentication middleware for temporary site gates and
258
+ * pre-launch protection.
259
+ *
260
+ * Void internal endpoints under `/__void` are always excluded so deploy-time
261
+ * migrations, prerendering, cron/queue dispatch, and remote binding helpers
262
+ * continue to reach Void's own internal-token checks.
263
+ */
264
+ declare function basicAuth(options: BasicAuthOptions): MiddlewareHandler<CloudEnv>;
265
+ /**
246
266
  * Identity function that provides type inference for scheduled jobs.
247
267
  * At runtime it simply returns the function passed to it.
248
268
  */
@@ -263,4 +283,4 @@ declare function defineHead<P = Record<string, unknown>>(handler: (c: CloudConte
263
283
  */
264
284
  declare function defineQueue<T = unknown>(handler: QueueFn<T>): TypedQueueHandler<T>;
265
285
  //#endregion
266
- export { HandlerInput as C, ValidationError as S, runValidation as T, defineScheduled as _, QueueBatch as a, InferProps as b, RenderAssetTags as c, VoidAssetRewriteError as d, defineHandler as f, defineRender as g, defineQueue as h, CloudEnv as i, TypedHandler as l, defineMiddleware as m, CloudContext as n, QueueMessage as o, defineHead as p, CloudContextVariables as r, QueueRetryOptions as s, CloudBindings as t, TypedQueueHandler as u, Deferred as v, ValidatorSlots as w, defer as x, DeferredState as y };
286
+ export { defer as C, runValidation as D, ValidatorSlots as E, InferProps as S, HandlerInput as T, defineQueue as _, CloudEnv as a, Deferred as b, QueueRetryOptions as c, TypedQueueHandler as d, VoidAssetRewriteError as f, defineMiddleware as g, defineHead as h, CloudContextVariables as i, RenderAssetTags as l, defineHandler as m, CloudBindings as n, QueueBatch as o, basicAuth as p, CloudContext as r, QueueMessage as s, BasicAuthOptions as t, TypedHandler as u, defineRender as v, ValidationError as w, DeferredState as x, defineScheduled as y };
@@ -1,6 +1,6 @@
1
1
  import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
2
- import { a as convertRedirectsConfig, d as parseHostPrefixedSource, i as convertHeadersConfig, o as convertRewritesConfig, r as convertFallbacksConfig, s as countSplats, t as VALID_REDIRECT_STATUSES, u as isProtocolRelative } from "./config-BVEC0lti.mjs";
3
- import { i as voidWarn } from "./log-CWWZV4V1.mjs";
2
+ import { a as convertRedirectsConfig, d as parseHostPrefixedSource, i as convertHeadersConfig, o as convertRewritesConfig, r as convertFallbacksConfig, s as countSplats, t as VALID_REDIRECT_STATUSES, u as isProtocolRelative } from "./config-8dLIngKW.mjs";
3
+ import { i as voidWarn } from "./log-BdD_Fpms.mjs";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  //#region src/cli/headers.ts
6
6
  /**
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as HeadDescriptor } from "./head-BsSTGnIe.mjs";
2
2
  import { r as AuthUser } from "./auth-CDeb2XAl.mjs";
3
- import { C as HandlerInput, _ as defineScheduled, a as QueueBatch, b as InferProps, c as RenderAssetTags, d as VoidAssetRewriteError, f as defineHandler, g as defineRender, h as defineQueue, i as CloudEnv, l as TypedHandler, m as defineMiddleware, n as CloudContext, o as QueueMessage, p as defineHead, r as CloudContextVariables, s as QueueRetryOptions, u as TypedQueueHandler, v as Deferred, w as ValidatorSlots, x as defer, y as DeferredState } from "./handler-xflsMwWM.mjs";
3
+ import { C as defer, E as ValidatorSlots, S as InferProps, T as HandlerInput, _ as defineQueue, a as CloudEnv, b as Deferred, c as QueueRetryOptions, d as TypedQueueHandler, f as VoidAssetRewriteError, g as defineMiddleware, h as defineHead, i as CloudContextVariables, l as RenderAssetTags, m as defineHandler, o as QueueBatch, p as basicAuth, r as CloudContext, s as QueueMessage, t as BasicAuthOptions, u as TypedHandler, v as defineRender, x as DeferredState, y as defineScheduled } from "./handler-hm9KldPP.mjs";
4
4
  import { QueueMap } from "./runtime/queues.mjs";
5
5
  import { PluginConfig } from "@cloudflare/vite-plugin";
6
6
  import { Plugin } from "vite";
@@ -29,4 +29,4 @@ declare function voidPlugin(options?: {
29
29
  auxiliaryWorkers?: PluginConfig["auxiliaryWorkers"];
30
30
  }): Array<Plugin>;
31
31
  //#endregion
32
- export { type AuthUser, type CloudContext, type CloudContextVariables, type CloudEnv, type Deferred, type DeferredState, type HandlerInput, type HeadDescriptor, type InferProps, type QueueBatch, type QueueMap, type QueueMessage, type QueueRetryOptions, type RenderAssetTags, type TypedHandler, type TypedQueueHandler, type ValidatorSlots, VoidAssetRewriteError, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
32
+ export { type AuthUser, type BasicAuthOptions, type CloudContext, type CloudContextVariables, type CloudEnv, type Deferred, type DeferredState, type HandlerInput, type HeadDescriptor, type InferProps, type QueueBatch, type QueueMap, type QueueMessage, type QueueRetryOptions, type RenderAssetTags, type TypedHandler, type TypedQueueHandler, type ValidatorSlots, VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
package/dist/index.mjs CHANGED
@@ -1,29 +1,29 @@
1
1
  import { r as __toESM } from "./chunk-DJd-R1mw.mjs";
2
2
  import { a as join, n as dirname, s as relative } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
3
3
  import { u as require_picocolors } from "./output-DeiS4oEX.mjs";
4
- import { C as hasApiRoutes, S as resolveSandboxConfig, T as resolveAssetRoutingPolicy, _ as readWranglerCompat, a as prerenderPagesNode, b as SANDBOX_MIGRATION_TAG, c as stripInternalEnvKeys, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as readExistingLiveBindingConfig, h as normalizeWranglerCompatibilityFlags, i as prerenderPages, l as LIVE_MIGRATION_TAG, m as nextDurableObjectMigrationTag, n as resolveDistDir, o as filterLoadedEnv, p as hasDurableObjectSqliteMigration, r as resolveWorkerDirName, s as resolveRemoteMode, u as ensureWranglerCompat, v as resolveLiveBindingConfig, w as hasDocumentRoutes, x as isSandboxEnabled, y as syncWranglerBindings } from "./deploy-CRU9fGjE.mjs";
4
+ import { C as hasApiRoutes, S as resolveSandboxConfig, T as resolveAssetRoutingPolicy, _ as readWranglerCompat, a as prerenderPagesNode, b as SANDBOX_MIGRATION_TAG, c as stripInternalEnvKeys, d as ensureWranglerCompatibilityDate, f as ensureWranglerNodejsAlsFlag, g as readExistingLiveBindingConfig, h as normalizeWranglerCompatibilityFlags, i as prerenderPages, l as LIVE_MIGRATION_TAG, m as nextDurableObjectMigrationTag, n as resolveDistDir, o as filterLoadedEnv, p as hasDurableObjectSqliteMigration, r as resolveWorkerDirName, s as resolveRemoteMode, u as ensureWranglerCompat, v as resolveLiveBindingConfig, w as hasDocumentRoutes, x as isSandboxEnabled, y as syncWranglerBindings } from "./deploy-RQXpVBL-.mjs";
5
5
  import { i as resolveProjectPaths, n as readProjectPaths, t as assertNoRootSourceConventionConflicts } from "./project-paths-CCMrHYQm.mjs";
6
6
  import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
7
7
  import { c as getToken, u as isStagingMode } from "./client-DIfOFf1W.mjs";
8
8
  import { r as readProjectConfig } from "./project-CH9pdo16.mjs";
9
- import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-BVEC0lti.mjs";
10
- import { a as scanQueuesSync, i as scanWebSocketRoutesSync, n as scanRoutePatternsSync, o as scanJobsSync, r as scanRoutes, t as scanMiddlewareSync } from "./scan-BNC_1OsY.mjs";
11
- import { a as SSR_CLIENT_ENTRY_RELATIVE_PATHS, c as validateSsrEntries, f as isIdentifier, g as walk, i as inferProjectBindings, l as validateSsrEntry, m as isMemberExpression, n as FRAMEWORK_SCAN_DIRS, o as SSR_SERVER_ENTRY_RELATIVE_PATHS, p as isLiteral, r as detectFramework, t as DEFAULT_SCAN_DIRS, u as inferBindingsFromSource } from "./plugin-inference-BUBhHt_1.mjs";
12
- import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-CWWZV4V1.mjs";
13
- import { r as parseDotenvFile } from "./dotenv-Bkoqyq9r.mjs";
14
- import { i as generateDbDts, n as generateQueueTypes, r as DRIZZLE_OPERATORS, t as generateRouteTypes } from "./route-types-jxRfWuCb.mjs";
15
- import { n as ensureProjectTsconfig } from "./project-tsconfig-HAGjfY6w.mjs";
9
+ import { n as ensureProjectTsconfig, r as writeFileIfChanged } from "./project-tsconfig-BTNuNoJ0.mjs";
10
+ import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-8dLIngKW.mjs";
11
+ import { a as scanQueuesSync, i as scanWebSocketRoutesSync, n as scanRoutePatternsSync, o as scanJobsSync, r as scanRoutes, t as scanMiddlewareSync } from "./scan-B2H1Vo2C.mjs";
12
+ import { a as SSR_CLIENT_ENTRY_RELATIVE_PATHS, c as validateSsrEntries, f as isIdentifier, g as walk, i as inferProjectBindings, l as validateSsrEntry, m as isMemberExpression, n as FRAMEWORK_SCAN_DIRS, o as SSR_SERVER_ENTRY_RELATIVE_PATHS, p as isLiteral, r as detectFramework, t as DEFAULT_SCAN_DIRS, u as inferBindingsFromSource } from "./plugin-inference--7geW5Z2.mjs";
13
+ import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-BdD_Fpms.mjs";
14
+ import { r as parseDotenvFile } from "./dotenv-lS94ymhM.mjs";
15
+ import { i as generateDbDts, n as generateQueueTypes, r as DRIZZLE_OPERATORS, t as generateRouteTypes } from "./route-types-D03ryMXz.mjs";
16
16
  import { t as discoverSchema } from "./discover-C8N1I4tK.mjs";
17
17
  import { t as MagicString } from "./magic-string.es-C1Fb0uxq.mjs";
18
- import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-D6qI1ThV.mjs";
19
- import { a as loadUserEnvFile } from "./env-validation-DBJsxZLz.mjs";
20
- import { i as resolveLayoutIds } from "./scan-2YmJkYAf.mjs";
18
+ import { n as findEnvFileForPaths, r as generateEnvTypes, t as findEnvFile } from "./env-types-CaJaIRXU.mjs";
19
+ import { a as loadUserEnvFile } from "./env-validation-LH6eoyW-.mjs";
20
+ import { i as resolveLayoutIds } from "./scan-VCAM1oh3.mjs";
21
21
  import { n as STAGING_PROXY_URL, t as DEFAULT_PROXY_URL } from "./proxy-M3pxItg2.mjs";
22
- import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-Y0jshugF.mjs";
23
- import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-2fs1qTgy.mjs";
22
+ import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-VkAnACKX.mjs";
23
+ import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-DYstYz0j.mjs";
24
24
  import { t as INTERNAL_BINDING_PREFIXES } from "./env-raw-RDkMnSTC.mjs";
25
25
  import { n as defer } from "./defer-CouVukrf.mjs";
26
- import { VoidAssetRewriteError, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled } from "./runtime/handler.mjs";
26
+ import { VoidAssetRewriteError, basicAuth, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled } from "./runtime/handler.mjs";
27
27
  import { closeSync, existsSync, mkdirSync, openSync, readFileSync, readdirSync, rmSync, writeFileSync, writeSync } from "node:fs";
28
28
  import { fileURLToPath, pathToFileURL } from "node:url";
29
29
  import { cloudflare } from "@cloudflare/vite-plugin";
@@ -1058,7 +1058,7 @@ function envSchemaPlugin(root, options = {}) {
1058
1058
  if (!envFile) return;
1059
1059
  mkdirSync(outDir, { recursive: true });
1060
1060
  const { dts } = generateEnvTypes(envFile, outDir);
1061
- writeFileSync(join(outDir, "env.d.ts"), dts);
1061
+ writeFileIfChanged(join(outDir, "env.d.ts"), dts);
1062
1062
  }
1063
1063
  async function importUserEnv() {
1064
1064
  if (!envFile) return;
@@ -1686,7 +1686,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
1686
1686
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
1687
1687
  }
1688
1688
  if (auth?.enabled) {
1689
- const { runLocalVoidAuthMigrations } = await import("./node-CHWVVjO6.mjs");
1689
+ const { runLocalVoidAuthMigrations } = await import("./node-Df8UjQ2H.mjs");
1690
1690
  await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth.configPath);
1691
1691
  voidLog("Applied Better Auth migrations");
1692
1692
  }
@@ -3139,8 +3139,8 @@ window.__vite_plugin_react_preamble_installed__ = true;
3139
3139
  return lines.join("\n");
3140
3140
  }
3141
3141
  function compilePrerenderCollector(lines, scan, ssr, options) {
3142
- const staticPaths = scan.pages.pages.filter((page) => page.prerender && page.params.length === 0 && !page.catchAll).map((page) => page.pattern);
3143
- const dynamicPages = scan.pages.pages.filter((page) => page.prerender && page.hasGetPrerenderPaths && (page.params.length > 0 || page.catchAll));
3142
+ const staticPaths = scan.pages.pages.filter((page) => page.shouldPrerender && page.params.length === 0 && !page.catchAll).map((page) => page.pattern);
3143
+ const dynamicPages = scan.pages.pages.filter((page) => page.shouldPrerender && page.hasGetPrerenderPaths && (page.params.length > 0 || page.catchAll));
3144
3144
  const explicitPaths = options.explicitPrerenderPaths ?? [];
3145
3145
  lines.push(`function __voidBuildPrerenderPath(pattern, params) {`);
3146
3146
  lines.push(` let path = pattern;`);
@@ -3194,11 +3194,16 @@ function compilePrerenderCollector(lines, scan, ssr, options) {
3194
3194
  function compilePageRoutes(lines, scan, pages, options) {
3195
3195
  lines.push(`import { handlePageGet, handlePageMutation } from ${JSON.stringify(pages.protocolPath)};`);
3196
3196
  lines.push(`import { renderHeadToString, renderHtmlAttrs, renderBodyAttrs } from ${JSON.stringify(pages.headPath)};`);
3197
- lines.push(`import { renderPage } from "virtual:void-pages-renderer";`);
3197
+ lines.push(`import * as __voidPagesRenderer from "virtual:void-pages-renderer";`);
3198
3198
  if (options.dev) lines.push(`import { getVoidPagesDevCss } from "virtual:void-pages-dev-assets";`);
3199
- const hasIslandPages = scan.pages.pages.some((p) => p.island);
3199
+ const hasIslandPages = scan.pages.pages.some((p) => p.renderMode === "island");
3200
3200
  if (hasIslandPages) lines.push(`import { renderIslandPage } from "virtual:void-islands-renderer";`);
3201
3201
  lines.push("");
3202
+ lines.push(`const renderPage = __voidPagesRenderer.renderPage;`);
3203
+ lines.push(`if (typeof __voidPagesRenderer.renderPreambleScript === "string") {`);
3204
+ lines.push(` renderPage.preambleScript = __voidPagesRenderer.renderPreambleScript;`);
3205
+ lines.push(`}`);
3206
+ lines.push("");
3202
3207
  lines.push(`const __voidHeadConfig = ${JSON.stringify(pages.headConfig ?? null)};`);
3203
3208
  lines.push("");
3204
3209
  pushDefaultErrorPageHelpers(lines, options);
@@ -3447,17 +3452,17 @@ function compilePageRoutes(lines, scan, pages, options) {
3447
3452
  lines.push(`const ${headVarName} = () => (${JSON.stringify(headObj)});`);
3448
3453
  mdHeadRef = headVarName;
3449
3454
  }
3450
- const renderer = page.island ? "renderIslandPage" : "renderPage";
3451
- const assetTags = page.island && pages.islandClientEntryId ? "getIslandsAssetTags" : "getPagesAssetTags";
3452
- const islandFlag = page.island ? ", true" : "";
3455
+ const renderer = page.renderMode === "island" ? "renderIslandPage" : "renderPage";
3456
+ const assetTags = page.renderMode === "island" && pages.islandClientEntryId ? "getIslandsAssetTags" : "getPagesAssetTags";
3457
+ const renderOptions = `, ${JSON.stringify({ renderMode: page.renderMode })}`;
3453
3458
  lines.push(`app.get(${JSON.stringify(page.pattern)}, async (c) => {`);
3454
3459
  if (serverImportPath) {
3455
3460
  const loaderName = `_pload_${safeId}`;
3456
3461
  lines.push(` const mod = await ${loaderName}();`);
3457
- lines.push(` return handlePageGet(mod.loader, mod.head, c, ${JSON.stringify(page.componentId)}, ${renderer}, ${assetTags}, __voidHeadConfig${islandFlag});`);
3462
+ lines.push(` return handlePageGet(mod.loader, mod.head, c, ${JSON.stringify(page.componentId)}, ${renderer}, ${assetTags}, __voidHeadConfig${renderOptions});`);
3458
3463
  } else {
3459
3464
  const headArg = mdHeadRef ?? "undefined";
3460
- lines.push(` return handlePageGet(undefined, ${headArg}, c, ${JSON.stringify(page.componentId)}, ${renderer}, ${assetTags}, __voidHeadConfig${islandFlag});`);
3465
+ lines.push(` return handlePageGet(undefined, ${headArg}, c, ${JSON.stringify(page.componentId)}, ${renderer}, ${assetTags}, __voidHeadConfig${renderOptions});`);
3461
3466
  }
3462
3467
  lines.push(`});`);
3463
3468
  if (page.methods.includes("action") || page.methods.includes("actions")) {
@@ -3469,7 +3474,7 @@ function compilePageRoutes(lines, scan, pages, options) {
3469
3474
  lines.push(` const handler = actionName ? mod.actions?.[actionName] : mod.actions?.default;`);
3470
3475
  lines.push(` if (!handler) return new Response("Unknown action" + (actionName ? ": " + actionName : ""), { status: 404 });`);
3471
3476
  } else lines.push(` const handler = mod.action;`);
3472
- lines.push(` return handlePageMutation(handler, mod.loader, mod.head, c, ${JSON.stringify(page.componentId)}, ${renderer}, ${assetTags}, __voidHeadConfig${islandFlag});`);
3477
+ lines.push(` return handlePageMutation(handler, mod.loader, mod.head, c, ${JSON.stringify(page.componentId)}, ${renderer}, ${assetTags}, __voidHeadConfig${renderOptions});`);
3473
3478
  lines.push(`});`);
3474
3479
  }
3475
3480
  }
@@ -4241,12 +4246,12 @@ function routingPlugin(root, options) {
4241
4246
  function writeRouteTypes() {
4242
4247
  if (!scan) return;
4243
4248
  const { dts } = generateRouteTypes(scan, routesDir, outDir, pagesDir);
4244
- writeFileSync(join(outDir, "routes.d.ts"), dts);
4249
+ writeFileIfChanged(join(outDir, "routes.d.ts"), dts);
4245
4250
  }
4246
4251
  function writeQueueTypes() {
4247
4252
  if (!scan) return;
4248
4253
  const dts = generateQueueTypes(scan.queues, queuesDir, outDir);
4249
- writeFileSync(join(outDir, "queues.d.ts"), dts);
4254
+ writeFileIfChanged(join(outDir, "queues.d.ts"), dts);
4250
4255
  }
4251
4256
  async function rescan() {
4252
4257
  scan = await scanRoutes(root, {
@@ -4347,8 +4352,8 @@ function routingPlugin(root, options) {
4347
4352
  const env = loadEnv(resolvedConfig?.mode ?? "development", root, "");
4348
4353
  const schemaPath = join(outDir, "better-auth-schema.ts");
4349
4354
  const databasePath = join(outDir, "better-auth-db.ts");
4350
- writeFileSync(schemaPath, generateVoidAuthDrizzleSchema(authRuntime, env));
4351
- writeFileSync(databasePath, generateVoidAuthDatabaseModule({
4355
+ writeFileIfChanged(schemaPath, generateVoidAuthDrizzleSchema(authRuntime, env));
4356
+ writeFileIfChanged(databasePath, generateVoidAuthDatabaseModule({
4352
4357
  dialect: compileOptions.auth.dialect,
4353
4358
  schemaImportPath: schemaPath,
4354
4359
  drizzleAdapterPath
@@ -4424,9 +4429,9 @@ function routingPlugin(root, options) {
4424
4429
  const outDir = join(root, ".void");
4425
4430
  mkdirSync(outDir, { recursive: true });
4426
4431
  if (options.target) {
4427
- writeFileSync(join(outDir, "app.ts"), compileNodeApp(options.target, compileOptions.honoPath, getEnvSchemaModule()));
4428
- writeFileSync(join(outDir, "index.ts"), compileNodeServer(options.target));
4429
- } else writeFileSync(join(outDir, "entry.ts"), compileWorkerEntry(false, remote, void 0, void 0, compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4432
+ writeFileIfChanged(join(outDir, "app.ts"), compileNodeApp(options.target, compileOptions.honoPath, getEnvSchemaModule()));
4433
+ writeFileIfChanged(join(outDir, "index.ts"), compileNodeServer(options.target));
4434
+ } else writeFileIfChanged(join(outDir, "entry.ts"), compileWorkerEntry(false, remote, void 0, void 0, compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4430
4435
  bindingName: options.sandboxBindingName,
4431
4436
  className: options.sandboxClassName,
4432
4437
  runtimePath: sandboxRuntimePath
@@ -4490,9 +4495,9 @@ function routingPlugin(root, options) {
4490
4495
  }
4491
4496
  }
4492
4497
  if (options.target) {
4493
- writeFileSync(join(outDir, "app.ts"), compileNodeApp(options.target, compileOptions.honoPath, getEnvSchemaModule()));
4494
- writeFileSync(join(outDir, "index.ts"), compileNodeServer(options.target));
4495
- } else writeFileSync(join(outDir, "entry.ts"), compileWorkerEntry(scan.queues.length > 0, remote, resolvedConfig?.build.assetsDir, (scan.websockets ?? []).map((route) => route.className), compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4498
+ writeFileIfChanged(join(outDir, "app.ts"), compileNodeApp(options.target, compileOptions.honoPath, getEnvSchemaModule()));
4499
+ writeFileIfChanged(join(outDir, "index.ts"), compileNodeServer(options.target));
4500
+ } else writeFileIfChanged(join(outDir, "entry.ts"), compileWorkerEntry(scan.queues.length > 0, remote, resolvedConfig?.build.assetsDir, (scan.websockets ?? []).map((route) => route.className), compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4496
4501
  bindingName: options.sandboxBindingName,
4497
4502
  className: options.sandboxClassName,
4498
4503
  runtimePath: sandboxRuntimePath
@@ -4540,9 +4545,9 @@ function routingPlugin(root, options) {
4540
4545
  writeRouteTypes();
4541
4546
  writeQueueTypes();
4542
4547
  if (options.target) {
4543
- writeFileSync(join(outDir, "app.ts"), compileNodeApp(options.target, compileOptions.honoPath, getEnvSchemaModule()));
4544
- writeFileSync(join(outDir, "index.ts"), compileNodeServer(options.target));
4545
- } else writeFileSync(join(outDir, "entry.ts"), compileWorkerEntry(scan.queues.length > 0, remote, resolvedConfig?.build.assetsDir, (scan.websockets ?? []).map((route) => route.className), compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4548
+ writeFileIfChanged(join(outDir, "app.ts"), compileNodeApp(options.target, compileOptions.honoPath, getEnvSchemaModule()));
4549
+ writeFileIfChanged(join(outDir, "index.ts"), compileNodeServer(options.target));
4550
+ } else writeFileIfChanged(join(outDir, "entry.ts"), compileWorkerEntry(scan.queues.length > 0, remote, resolvedConfig?.build.assetsDir, (scan.websockets ?? []).map((route) => route.className), compileOptions.runtimeEnvPath, getEnvSchemaModule(), options.hasSandbox ? {
4546
4551
  bindingName: options.sandboxBindingName,
4547
4552
  className: options.sandboxClassName,
4548
4553
  runtimePath: sandboxRuntimePath
@@ -4717,7 +4722,7 @@ function generateClassATriggerWrapper(root, framework, original, isBuild, assets
4717
4722
  const outDir = join(root, ".void");
4718
4723
  mkdirSync(outDir, { recursive: true });
4719
4724
  const wrapperPath = join(outDir, `${framework}-trigger-wrapper.ts`);
4720
- writeFileSync(wrapperPath, isBuild ? `// @ts-nocheck — Auto-generated by Void for vite build. Do NOT edit.
4725
+ writeFileIfChanged(wrapperPath, isBuild ? `// @ts-nocheck — Auto-generated by Void for vite build. Do NOT edit.
4721
4726
  import original from ${JSON.stringify(original)};
4722
4727
 
4723
4728
  export default {
@@ -4747,7 +4752,7 @@ function generateVinextPagesEntry(root) {
4747
4752
  const outDir = join(root, ".void");
4748
4753
  mkdirSync(outDir, { recursive: true });
4749
4754
  const entryPath = join(outDir, "vinext-pages-entry.ts");
4750
- writeFileSync(entryPath, `// Auto-generated by Void — vinext Pages Router worker entry
4755
+ writeFileIfChanged(entryPath, `// Auto-generated by Void — vinext Pages Router worker entry
4751
4756
  // @ts-expect-error virtual module resolved by vinext at build time
4752
4757
  import { renderPage, handleApiRoute } from "virtual:vinext-server-entry";
4753
4758
 
@@ -4773,7 +4778,7 @@ function generateReactRouterEntry(root) {
4773
4778
  const outDir = join(root, ".void");
4774
4779
  mkdirSync(outDir, { recursive: true });
4775
4780
  const entryPath = join(outDir, "react-router-entry.ts");
4776
- writeFileSync(entryPath, `// Auto-generated by Void — React Router v7 worker entry
4781
+ writeFileIfChanged(entryPath, `// Auto-generated by Void — React Router v7 worker entry
4777
4782
  import { createRequestHandler } from "react-router";
4778
4783
 
4779
4784
  const requestHandler = createRequestHandler(
@@ -5555,4 +5560,4 @@ function voidPlugin(options) {
5555
5560
  ];
5556
5561
  }
5557
5562
  //#endregion
5558
- export { VoidAssetRewriteError, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
5563
+ export { VoidAssetRewriteError, basicAuth, defer, defineHandler, defineHead, defineMiddleware, defineQueue, defineRender, defineScheduled, voidPlugin };
@@ -4,16 +4,16 @@ import { n as readProjectPaths } from "./project-paths-CCMrHYQm.mjs";
4
4
  import { c as getToken, n as PlatformClient, u as isStagingMode } from "./client-DIfOFf1W.mjs";
5
5
  import { _ as me, c as R, g as ge, i as Ee, l as Re, u as Se, v as ue, x as q, y as ye } from "./dist-abzUneor.mjs";
6
6
  import { a as writeProjectConfig, r as readProjectConfig } from "./project-CH9pdo16.mjs";
7
- import { c as getDatabaseDialect, f as readConfig } from "./config-BVEC0lti.mjs";
8
- import { r as detectFramework } from "./plugin-inference-BUBhHt_1.mjs";
9
- import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-Bkoqyq9r.mjs";
10
- import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-HAGjfY6w.mjs";
7
+ import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-BTNuNoJ0.mjs";
8
+ import { c as getDatabaseDialect, f as readConfig } from "./config-8dLIngKW.mjs";
9
+ import { r as detectFramework } from "./plugin-inference--7geW5Z2.mjs";
10
+ import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-lS94ymhM.mjs";
11
11
  import { t as MagicString } from "./magic-string.es-C1Fb0uxq.mjs";
12
12
  import { n as writeDrizzleConfig } from "./config--wXmVOoe.mjs";
13
13
  import { n as getAgentById, r as getPackageDir, t as detectAgents } from "./agents-MhSzNMiC.mjs";
14
14
  import { n as promptAndCreateProject, r as promptProjectSelection } from "./create-project-DCUrFJxa.mjs";
15
15
  import { t as promptForLoginToken } from "./login-tt1OmNVg.mjs";
16
- import { r as formatProjectCommand } from "./preset-CIJG2O7a.mjs";
16
+ import { r as formatProjectCommand } from "./preset-2aBxMfY1.mjs";
17
17
  import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-0SwYgQxx.mjs";
18
18
  import { createRequire } from "node:module";
19
19
  import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, unlinkSync, writeFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  import { a as join } from "./pathe.M-eThtNZ-BrPhGF_K.mjs";
2
2
  import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-hhMYPVRT.mjs";
3
- import { f as readConfig } from "./config-BVEC0lti.mjs";
4
- import { r as resolveVoidAuthMigrationSchema } from "./drizzle-2fs1qTgy.mjs";
3
+ import { f as readConfig } from "./config-8dLIngKW.mjs";
4
+ import { r as resolveVoidAuthMigrationSchema } from "./drizzle-DYstYz0j.mjs";
5
5
  import { n as applySqliteAuthMigrations, t as applyPgAuthMigrations } from "./auth-migrations-CuQkjjWE.mjs";
6
6
  import { getMiniflareDatabasePath } from "./runner-DLZ9E_cX.mjs";
7
7
  import { loadEnv } from "vite";