void 0.8.1 → 0.8.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/cli/cli.mjs CHANGED
@@ -1516,7 +1516,7 @@ else if (command === "deploy") {
1516
1516
  R.error(err instanceof Error ? err.message : String(err));
1517
1517
  process.exit(1);
1518
1518
  }
1519
- import("../deploy-DbmbcKID.mjs").then((n) => n.t).then(({ runDeploy }) => {
1519
+ import("../deploy-BlXg0sMS.mjs").then((n) => n.t).then(({ runDeploy }) => {
1520
1520
  runDeploy(root, {
1521
1521
  projectSlug: deployArgs.projectSlug,
1522
1522
  dir: deployArgs.dir,
@@ -1532,7 +1532,7 @@ else if (command === "deploy") {
1532
1532
  else if (command === "project") runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (root, parsed) => import("../project-cmd-JQUzv3qF.mjs").then(({ runProjectCommand }) => runProjectCommand(root, parsed)));
1533
1533
  else if (command === "secret") runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (root, parsed) => import("../secret-mz8t_CML.mjs").then(({ runSecretCommand }) => runSecretCommand(root, parsed)));
1534
1534
  else if (command === "domain") runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (root, parsed) => import("../domain-UfLrp2vc.mjs").then(({ runDomainCommand }) => runDomainCommand(root, parsed)));
1535
- else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-CT5Xg6ds.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
1535
+ else if (command === "db") runSubcommandGroup("db", dbSubcommands, parseDbArgs, (root, parsed) => import("../db-BvKxda3n.mjs").then(({ runDbCommand }) => runDbCommand(root, parsed)));
1536
1536
  else if (command === "env") runSubcommandGroup("env", envSubcommands, parseEnvArgs, (root, parsed) => import("../env-Cvdbbm_N.mjs").then(({ runEnvCommand }) => runEnvCommand(root, parsed)));
1537
1537
  else if (command === "gen") runSubcommandGroup("gen", genSubcommands, parseGenArgs, (root, parsed) => import("../gen-Cn2hZ8RR.mjs").then(({ runGenCommand }) => runGenCommand(root, parsed)));
1538
1538
  else if (command === "prepare") {
@@ -1646,7 +1646,7 @@ else if (command === "-v" || command === "--version") {
1646
1646
  return;
1647
1647
  }
1648
1648
  case "deploy": {
1649
- const { runDeploy } = await import("../deploy-DbmbcKID.mjs").then((n) => n.t);
1649
+ const { runDeploy } = await import("../deploy-BlXg0sMS.mjs").then((n) => n.t);
1650
1650
  await runDeploy(root);
1651
1651
  return;
1652
1652
  }
@@ -1659,7 +1659,7 @@ else if (command === "-v" || command === "--version") {
1659
1659
  case "project": return runSubcommandGroup("project", projectSubcommands, parseProjectArgs, (r, p) => import("../project-cmd-JQUzv3qF.mjs").then(({ runProjectCommand }) => runProjectCommand(r, p)));
1660
1660
  case "secret": return runSubcommandGroup("secret", secretSubcommands, parseSecretArgs, (r, p) => import("../secret-mz8t_CML.mjs").then(({ runSecretCommand }) => runSecretCommand(r, p)));
1661
1661
  case "domain": return runSubcommandGroup("domain", domainSubcommands, parseDomainArgs, (r, p) => import("../domain-UfLrp2vc.mjs").then(({ runDomainCommand }) => runDomainCommand(r, p)));
1662
- case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-CT5Xg6ds.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
1662
+ case "db": return runSubcommandGroup("db", dbSubcommands, parseDbArgs, (r, p) => import("../db-BvKxda3n.mjs").then(({ runDbCommand }) => runDbCommand(r, p)));
1663
1663
  case "env": return runSubcommandGroup("env", envSubcommands, parseEnvArgs, (r, p) => import("../env-Cvdbbm_N.mjs").then(({ runEnvCommand }) => runEnvCommand(r, p)));
1664
1664
  case "gen": return runSubcommandGroup("gen", genSubcommands, parseGenArgs, (r, p) => import("../gen-Cn2hZ8RR.mjs").then(({ runGenCommand }) => runGenCommand(r, p)));
1665
1665
  case "prepare": {
@@ -315,6 +315,10 @@ async function runMigrate(root, dialect, remote) {
315
315
  process.exit(1);
316
316
  }
317
317
  if (remote) {
318
+ if (dialect === "postgresql") {
319
+ R.error("db: `void db migrate --remote` is only supported for D1 projects. PostgreSQL remote migrations run during `void deploy` through the project Hyperdrive binding.");
320
+ process.exit(1);
321
+ }
318
322
  const token = getToken(root);
319
323
  if (!token) {
320
324
  R.error("Not logged in. Run `void auth login` first.");
@@ -2442,6 +2442,9 @@ function applyDeployEvent(event, s) {
2442
2442
  case "provisioning":
2443
2443
  s.message(`Provisioning ${event.bindings.join(", ")}`);
2444
2444
  return { kind: "continue" };
2445
+ case "worker_readiness":
2446
+ s.message("Waiting for worker to become reachable...");
2447
+ return { kind: "continue" };
2445
2448
  case "migration_start":
2446
2449
  s.message(`Running ${event.pending} migration${event.pending > 1 ? "s" : ""}...`);
2447
2450
  return { kind: "continue" };
@@ -3107,7 +3110,7 @@ async function runFullDeploy(root, config, client, fwPreset, skipBuild, gitMetad
3107
3110
  hasPages,
3108
3111
  hasDocumentRoutes: hasDocumentRoutes$1,
3109
3112
  hasMiddleware,
3110
- hasWebSockets,
3113
+ hasWebSockets: hasDocumentRoutes(webSockets),
3111
3114
  authEnabled,
3112
3115
  liveEnabled: liveConfig !== void 0
3113
3116
  });
package/dist/index.mjs CHANGED
@@ -1,7 +1,7 @@
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 isSandboxEnabled, E as resolveAssetRoutingPolicy, S as SANDBOX_MIGRATION_TAG, T as hasDocumentRoutes, _ as normalizeWranglerCompatibilityFlags, a as prerenderPagesNode, b as resolveLiveBindingConfig, c as filterLoadedEnv, d as LIVE_MIGRATION_TAG, f as ensureWranglerCompat, g as nextDurableObjectMigrationTag, h as hasDurableObjectSqliteMigration, i as prerenderPages, l as resolveRemoteMode, m as ensureWranglerNodejsAlsFlag, n as resolveDistDir, o as DEFAULT_PROXY_URL, p as ensureWranglerCompatibilityDate, r as resolveWorkerDirName, s as STAGING_PROXY_URL, u as stripInternalEnvKeys, v as readExistingLiveBindingConfig, w as resolveSandboxConfig, x as syncWranglerBindings, y as readWranglerCompat } from "./deploy-DbmbcKID.mjs";
4
+ import { C as isSandboxEnabled, E as resolveAssetRoutingPolicy, S as SANDBOX_MIGRATION_TAG, T as hasDocumentRoutes, _ as normalizeWranglerCompatibilityFlags, a as prerenderPagesNode, b as resolveLiveBindingConfig, c as filterLoadedEnv, d as LIVE_MIGRATION_TAG, f as ensureWranglerCompat, g as nextDurableObjectMigrationTag, h as hasDurableObjectSqliteMigration, i as prerenderPages, l as resolveRemoteMode, m as ensureWranglerNodejsAlsFlag, n as resolveDistDir, o as DEFAULT_PROXY_URL, p as ensureWranglerCompatibilityDate, r as resolveWorkerDirName, s as STAGING_PROXY_URL, u as stripInternalEnvKeys, v as readExistingLiveBindingConfig, w as resolveSandboxConfig, x as syncWranglerBindings, y as readWranglerCompat } from "./deploy-BlXg0sMS.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-C-nH6yz3.mjs";
@@ -3983,9 +3983,16 @@ function compileHeaderMiddleware(lines, rules) {
3983
3983
  lines.push(" for (const rule of __headerRules) {");
3984
3984
  lines.push(" if (__matchPattern(rule.pattern, pathname)) matched.push(...rule.headers);");
3985
3985
  lines.push(" }");
3986
+ lines.push(" if (matched.length === 0) return;");
3987
+ lines.push(" const headers = new Headers(c.res.headers);");
3986
3988
  lines.push(" for (const [name, value] of matched) {");
3987
- lines.push(" c.res.headers.set(name, value);");
3989
+ lines.push(" headers.set(name, value);");
3988
3990
  lines.push(" }");
3991
+ lines.push(" c.res = new Response(c.res.body, {");
3992
+ lines.push(" headers,");
3993
+ lines.push(" status: c.res.status,");
3994
+ lines.push(" statusText: c.res.statusText,");
3995
+ lines.push(" });");
3989
3996
  lines.push("});");
3990
3997
  lines.push("");
3991
3998
  }
@@ -4256,7 +4263,7 @@ function routingPlugin(root, options) {
4256
4263
  hasPages: scan.pages.pages.length > 0,
4257
4264
  hasDocumentRoutes: hasDocumentRoutes(scan.routes),
4258
4265
  hasMiddleware: scan.middleware.length > 0,
4259
- hasWebSockets: (scan.websockets?.length ?? 0) > 0,
4266
+ hasWebSockets: hasDocumentRoutes(scan.websockets ?? []),
4260
4267
  authEnabled: compileOptions.auth !== null,
4261
4268
  liveEnabled: options.live !== void 0
4262
4269
  });
@@ -5301,7 +5308,7 @@ function voidPlugin(options) {
5301
5308
  hasPages,
5302
5309
  hasDocumentRoutes: hasDocumentRoutes$1,
5303
5310
  hasMiddleware,
5304
- hasWebSockets: websocketRoutes.length > 0,
5311
+ hasWebSockets: hasDocumentRoutes(websocketRoutes),
5305
5312
  authEnabled,
5306
5313
  liveEnabled: liveConfig !== void 0
5307
5314
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "void",
3
- "version": "0.8.1",
3
+ "version": "0.8.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/voidzero-dev/void.git",
@@ -333,7 +333,7 @@
333
333
  "valibot": ">=1.0.0-beta.7",
334
334
  "vite": "^8.0.0",
335
335
  "zod": "^3.25.0 || ^4.0.0",
336
- "@void/md": "0.8.1"
336
+ "@void/md": "0.8.3"
337
337
  },
338
338
  "peerDependenciesMeta": {
339
339
  "@void/md": {