void 0.7.6 → 0.7.8

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 (77) hide show
  1. package/dist/{auth-DrfOTMmr.d.mts → auth-DmuALf16.d.mts} +4 -4
  2. package/dist/{auth-cmd-Dk0acCT5.mjs → auth-cmd-CKKnwjJr.mjs} +2 -2
  3. package/dist/{better-auth-shared-CZsIpjey.d.mts → better-auth-shared-HXlHRw02.d.mts} +15 -15
  4. package/dist/{cache-DGSZ5Bh6.mjs → cache-GQaCgNU_.mjs} +1 -1
  5. package/dist/{cancel-deploy-CrY3kt93.mjs → cancel-deploy-Lm-s-VNM.mjs} +1 -1
  6. package/dist/cli/cli.mjs +22 -22
  7. package/dist/{client-DCqnMpDt.mjs → client-BCHb449S.mjs} +13 -3
  8. package/dist/{config-BIa9HwVX.mjs → config-DqkeX_Fa.mjs} +5 -5
  9. package/dist/{create-project-Bg88Kq_I.mjs → create-project-B4_81uPO.mjs} +1 -1
  10. package/dist/{db-DvBg7Oc5.mjs → db-DEgoBwm1.mjs} +26 -22
  11. package/dist/{delete-DXcX1yQZ.mjs → delete-B3XRid-6.mjs} +1 -1
  12. package/dist/{deploy-B5rTuzXw.mjs → deploy-BVhinNvN.mjs} +35 -12
  13. package/dist/{domain-CDQhvYNZ.mjs → domain-CwjrEwk9.mjs} +25 -2
  14. package/dist/{dotenv-DwO4ti0Z.mjs → dotenv-zdFCCgFU.mjs} +26 -26
  15. package/dist/{env-helpers-CbeM_7-k.d.mts → env-helpers-Dw95CU8e.d.mts} +4 -4
  16. package/dist/{env-CnrQY2b6.mjs → env-kXobUKhc.mjs} +2 -2
  17. package/dist/{env-validation-DJKjR_8q.mjs → env-validation-Bc_aiBUm.mjs} +1 -1
  18. package/dist/{fetch-error-DflegrF3.d.mts → fetch-error-DZ868Xq4.d.mts} +4 -4
  19. package/dist/{gen-C0EY2k27.mjs → gen-CpeKIqlM.mjs} +2 -2
  20. package/dist/{handler-dKQWyF-G.d.mts → handler-DJTuxB10.d.mts} +24 -27
  21. package/dist/{head-CZGAunBV.d.mts → head-C7QW7UY1.d.mts} +5 -6
  22. package/dist/{headers-YVkHjOyq.mjs → headers-C7Yf6_CN.mjs} +1 -1
  23. package/dist/index.d.mts +3 -3
  24. package/dist/index.mjs +42 -33
  25. package/dist/{init-BiXWyKEf.mjs → init-CfdGhcG_.mjs} +5 -5
  26. package/dist/{link-eZ0aiHFK.mjs → link-sYAGQEVa.mjs} +2 -2
  27. package/dist/{list-ztyEz4TW.mjs → list-B_cMVlKj.mjs} +1 -1
  28. package/dist/{login-B5HHT32i.mjs → login-B-hYch9Z.mjs} +1 -1
  29. package/dist/{logs-J4BN0LXd.mjs → logs-JrG0_AxV.mjs} +1 -1
  30. package/dist/{mcp-Bdu9bnjR.mjs → mcp-BcssKxth.mjs} +1 -1
  31. package/dist/{node-DFqMcZR1.mjs → node-DHVCtkgt.mjs} +1 -1
  32. package/dist/pages/client.d.mts +35 -41
  33. package/dist/pages/head-client.d.mts +1 -1
  34. package/dist/pages/head.d.mts +1 -1
  35. package/dist/pages/head.mjs +4 -4
  36. package/dist/pages/index.d.mts +6 -6
  37. package/dist/pages/index.mjs +6 -6
  38. package/dist/pages/islands-plugin.d.mts +3 -3
  39. package/dist/pages/islands-plugin.mjs +1 -1
  40. package/dist/pages/prefetch.d.mts +5 -5
  41. package/dist/pages/protocol.d.mts +2 -2
  42. package/dist/pages/protocol.mjs +2 -2
  43. package/dist/{prepare-BrfiJBju.mjs → prepare-CKzO06-Z.mjs} +3 -3
  44. package/dist/{project-cmd-DKiQYdSd.mjs → project-cmd-DDDakkqn.mjs} +8 -8
  45. package/dist/{protocol-COz1NHxc.d.mts → protocol-D7r_deVZ.d.mts} +5 -5
  46. package/dist/{rollback-ZNvT8T54.mjs → rollback-_11JdPsF.mjs} +1 -1
  47. package/dist/{route-types-DReF1gUY.mjs → route-types-Cnqj_8a7.mjs} +2 -2
  48. package/dist/runtime/ai.d.mts +33 -40
  49. package/dist/runtime/auth.d.mts +1 -1
  50. package/dist/runtime/better-auth-pg.d.mts +1 -1
  51. package/dist/runtime/better-auth.d.mts +1 -1
  52. package/dist/runtime/client.d.mts +2 -2
  53. package/dist/runtime/env-helpers.d.mts +1 -1
  54. package/dist/runtime/env-helpers.mjs +3 -3
  55. package/dist/runtime/env-public-client.d.mts +3 -3
  56. package/dist/runtime/env-public.d.mts +7 -7
  57. package/dist/runtime/fetch-stream.d.mts +1 -1
  58. package/dist/runtime/fetch.d.mts +1 -1
  59. package/dist/runtime/handler.d.mts +1 -1
  60. package/dist/runtime/handler.mjs +3 -3
  61. package/dist/runtime/isr.d.mts +2 -2
  62. package/dist/runtime/kv.d.mts +12 -12
  63. package/dist/runtime/live-server.d.mts +4 -4
  64. package/dist/runtime/live.d.mts +2 -2
  65. package/dist/runtime/migration-handler.d.mts +6 -6
  66. package/dist/runtime/seed.d.mts +4 -4
  67. package/dist/runtime/validator.d.mts +1 -1
  68. package/dist/runtime/ws-server.d.mts +8 -8
  69. package/dist/runtime/ws.d.mts +21 -21
  70. package/dist/{scan-vv5u7rHu.mjs → scan-B8iEm8xn.mjs} +5 -5
  71. package/dist/{scan-Ba4hFwlH.mjs → scan-CWfLxtOe.mjs} +8 -8
  72. package/dist/{secret-BXHx515u.mjs → secret-DwG7uDho.mjs} +1 -1
  73. package/dist/{standard-schema-BfGDWXff.d.mts → standard-schema-D2qvCEYV.d.mts} +14 -14
  74. package/dist/sveltekit.d.mts +3 -5
  75. package/dist/types-DG_Ynnyd.d.mts +42 -0
  76. package/package.json +2 -2
  77. package/dist/types-D6AuY5Bf.d.mts +0 -65
@@ -36,10 +36,10 @@ const VALID_KEY = /^[A-Za-z_][A-Za-z0-9_]*$/;
36
36
  function parseDotenvLine(line) {
37
37
  const trimmed = line.trim();
38
38
  if (!trimmed || trimmed.startsWith("#")) return null;
39
- const eq = trimmed.indexOf("=");
40
- if (eq === -1) return null;
41
- const key = trimmed.slice(0, eq).trim();
42
- let value = trimmed.slice(eq + 1).trim();
39
+ const equalsIndex = trimmed.indexOf("=");
40
+ if (equalsIndex === -1) return null;
41
+ const key = trimmed.slice(0, equalsIndex).trim();
42
+ let value = trimmed.slice(equalsIndex + 1).trim();
43
43
  if (value.startsWith("\"") && value.endsWith("\"") || value.startsWith("'") && value.endsWith("'")) value = value.slice(1, -1);
44
44
  return {
45
45
  key,
@@ -118,43 +118,43 @@ function expandDotenv(input, options = {}) {
118
118
  */
119
119
  function expandValue(value, resolve) {
120
120
  let result = "";
121
- let i = 0;
122
- while (i < value.length) {
123
- const ch = value[i];
124
- if (ch === "\\" && i + 1 < value.length && value[i + 1] === "$") {
121
+ let cursor = 0;
122
+ while (cursor < value.length) {
123
+ const character = value[cursor];
124
+ if (character === "\\" && cursor + 1 < value.length && value[cursor + 1] === "$") {
125
125
  result += "$";
126
- i += 2;
126
+ cursor += 2;
127
127
  continue;
128
128
  }
129
- if (ch !== "$") {
130
- result += ch;
131
- i++;
129
+ if (character !== "$") {
130
+ result += character;
131
+ cursor++;
132
132
  continue;
133
133
  }
134
- const next = value[i + 1];
134
+ const next = value[cursor + 1];
135
135
  if (next === "{") {
136
- const end = value.indexOf("}", i + 2);
137
- if (end === -1) {
138
- result += ch;
139
- i++;
136
+ const endIndex = value.indexOf("}", cursor + 2);
137
+ if (endIndex === -1) {
138
+ result += character;
139
+ cursor++;
140
140
  continue;
141
141
  }
142
- const key = value.slice(i + 2, end);
142
+ const key = value.slice(cursor + 2, endIndex);
143
143
  if (VALID_KEY.test(key)) result += resolve(key);
144
- else result += value.slice(i, end + 1);
145
- i = end + 1;
144
+ else result += value.slice(cursor, endIndex + 1);
145
+ cursor = endIndex + 1;
146
146
  continue;
147
147
  }
148
148
  if (next && /[A-Za-z_]/.test(next)) {
149
- let j = i + 1;
150
- while (j < value.length && /[A-Za-z0-9_]/.test(value[j])) j++;
151
- const key = value.slice(i + 1, j);
149
+ let keyEndIndex = cursor + 1;
150
+ while (keyEndIndex < value.length && /[A-Za-z0-9_]/.test(value[keyEndIndex])) keyEndIndex++;
151
+ const key = value.slice(cursor + 1, keyEndIndex);
152
152
  result += resolve(key);
153
- i = j;
153
+ cursor = keyEndIndex;
154
154
  continue;
155
155
  }
156
- result += ch;
157
- i++;
156
+ result += character;
157
+ cursor++;
158
158
  }
159
159
  return result;
160
160
  }
@@ -1,4 +1,4 @@
1
- import { t as StandardSchemaV1 } from "./standard-schema-BfGDWXff.mjs";
1
+ import { t as StandardSchemaV1 } from "./standard-schema-D2qvCEYV.mjs";
2
2
 
3
3
  //#region src/shared/env-mask.d.ts
4
4
  /** Per-key override set by `.secret()` / `.public()` on built-in helpers. */
@@ -20,7 +20,7 @@ declare const SECRET_OVERRIDE_SYMBOL: unique symbol;
20
20
  declare function getSecretOverride(validator: {
21
21
  [SECRET_OVERRIDE_SYMBOL]?: SecretOverride;
22
22
  } | unknown): SecretOverride;
23
- interface EnvSchema<T> extends StandardSchemaV1<unknown, T> {
23
+ type EnvSchema<T> = StandardSchemaV1<unknown, T> & {
24
24
  optional(): EnvSchema<T | undefined>;
25
25
  default(value: NonNullable<T>): EnvSchema<NonNullable<T>>;
26
26
  /**
@@ -33,7 +33,7 @@ interface EnvSchema<T> extends StandardSchemaV1<unknown, T> {
33
33
  * titles) that happens to match the heuristic (`PUBLIC_KEY`, `…_TOKEN_URL`).
34
34
  */
35
35
  public(): EnvSchema<T>;
36
- }
36
+ };
37
37
  /** Required string env value. */
38
38
  declare function string(): EnvSchema<string>;
39
39
  /** Numeric env value. Parses with `Number(raw)`; rejects NaN. */
@@ -45,7 +45,7 @@ declare function url(): EnvSchema<string>;
45
45
  /** Email string — basic shape validation. */
46
46
  declare function email(): EnvSchema<string>;
47
47
  /** One of a fixed set of literal string values. */
48
- declare function oneOf<const Values extends ReadonlyArray<string>>(values: Values): EnvSchema<Values[number]>;
48
+ declare function oneOf<const Values extends Array<string>>(values: Values): EnvSchema<Values[number]>;
49
49
  /** JSON-parsed env value. Specify `T` to type the parsed result. */
50
50
  declare function json<T = unknown>(): EnvSchema<T>;
51
51
  //#endregion
@@ -2,9 +2,9 @@ import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
2
  import { n as cliTitle } from "./output-BwlcIYSR.mjs";
3
3
  import { c as R, g as ge, u as Se, y as ye } from "./dist-Dayj3gCK.mjs";
4
4
  import { r as readProjectConfig } from "./project-TqORyHn8.mjs";
5
- import { c as getToken, n as PlatformClient } from "./client-DCqnMpDt.mjs";
5
+ import { c as getToken, n as PlatformClient } from "./client-BCHb449S.mjs";
6
6
  import { n as generateEnvTypes, t as findEnvFile } from "./env-types-DknSA4SO.mjs";
7
- import { a as loadUserEnvFile, i as validateProdEnv, n as formatEnvReport, t as fetchRemoteSecretNames } from "./env-validation-DJKjR_8q.mjs";
7
+ import { a as loadUserEnvFile, i as validateProdEnv, n as formatEnvReport, t as fetchRemoteSecretNames } from "./env-validation-Bc_aiBUm.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 { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
2
  import { i as voidWarn } from "./log-DXdqnmhF.mjs";
3
- import { n as mergeAndExpand, r as parseDotenvFile } from "./dotenv-DwO4ti0Z.mjs";
3
+ import { n as mergeAndExpand, r as parseDotenvFile } from "./dotenv-zdFCCgFU.mjs";
4
4
  import { t as findEnvFile } from "./env-types-DknSA4SO.mjs";
5
5
  import { pathToFileURL } from "node:url";
6
6
  //#region src/host/load-user-env.ts
@@ -1,8 +1,8 @@
1
1
  //#region src/runtime/fetch-error.d.ts
2
- interface FetchResponse<T = unknown> extends Response {
2
+ type FetchResponse<T = unknown> = Response & {
3
3
  _data?: T;
4
- }
5
- interface FetchError<T = unknown> extends Error {
4
+ };
5
+ type FetchError<T = unknown> = Error & {
6
6
  request?: RequestInfo;
7
7
  options?: RequestInit & Record<string, unknown>;
8
8
  response?: FetchResponse<T>;
@@ -11,7 +11,7 @@ interface FetchError<T = unknown> extends Error {
11
11
  statusText?: string;
12
12
  statusCode?: number;
13
13
  statusMessage?: string;
14
- }
14
+ };
15
15
  type FetchErrorConstructor = new <T = unknown>(message: string, opts?: {
16
16
  cause: unknown;
17
17
  }) => FetchError<T>;
@@ -1,7 +1,7 @@
1
1
  import { a as join, n as dirname, o as relative } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
2
  import { n as cliTitle } from "./output-BwlcIYSR.mjs";
3
3
  import { _ as me, c as R, g as ge, i as Ee, x as q, y as ye } from "./dist-Dayj3gCK.mjs";
4
- import { c as getDatabaseDialect, f as readConfig } from "./config-BIa9HwVX.mjs";
4
+ import { c as getDatabaseDialect, f as readConfig } from "./config-DqkeX_Fa.mjs";
5
5
  import { n as ensureProjectTsconfig } from "./project-tsconfig-DfkESbDL.mjs";
6
6
  import { n as writeDrizzleConfig } from "./config-BzM9Dy7T.mjs";
7
7
  import { r as readJournal, t as collectMigrations } from "./collect-CjeZgz5D.mjs";
@@ -535,7 +535,7 @@ export default defineScheduled(async (controller, env) => {
535
535
  function runQueue(root, name) {
536
536
  writeIfNotExists(join(root, "queues", name + ".ts"), `import { defineQueue } from "void";
537
537
 
538
- interface Message {}
538
+ type Message = {};
539
539
 
540
540
  // export const maxBatchSize = 10;
541
541
  // export const maxBatchTimeout = 5;
@@ -1,24 +1,24 @@
1
- import { n as HeadDescriptor } from "./head-CZGAunBV.mjs";
2
- import { r as AuthUser, t as AuthSession } from "./auth-DrfOTMmr.mjs";
3
- import { t as StandardSchemaV1 } from "./standard-schema-BfGDWXff.mjs";
1
+ import { n as HeadDescriptor } from "./head-C7QW7UY1.mjs";
2
+ import { r as AuthUser, t as AuthSession } from "./auth-DmuALf16.mjs";
3
+ import { t as StandardSchemaV1 } from "./standard-schema-D2qvCEYV.mjs";
4
4
  import * as _$_cloudflare_sandbox0 from "@cloudflare/sandbox";
5
5
  import { Context, Env, MiddlewareHandler } from "hono";
6
6
  import { RewriteDestination } from "void/routes";
7
7
 
8
8
  //#region src/runtime/validator.d.ts
9
- interface ValidatorSlots {
9
+ type ValidatorSlots = {
10
10
  body?: StandardSchemaV1;
11
11
  query?: StandardSchemaV1;
12
12
  params?: StandardSchemaV1;
13
- }
14
- interface ValidationSuccess<V extends ValidatorSlots> {
13
+ };
14
+ type ValidationSuccess<V extends ValidatorSlots> = {
15
15
  ok: true;
16
16
  input: HandlerInput<V>;
17
- }
18
- interface ValidationFailure {
17
+ };
18
+ type ValidationFailure = {
19
19
  ok: false;
20
20
  response: Response;
21
- }
21
+ };
22
22
  type HandlerInput<V extends ValidatorSlots> = { [K in keyof V as V[K] extends StandardSchemaV1 ? K : never]: V[K] extends StandardSchemaV1 ? StandardSchemaV1.InferOutput<V[K]> : never };
23
23
  declare function runValidation<V extends ValidatorSlots>(validators: V, c: CloudContext): Promise<ValidationSuccess<V> | ValidationFailure>;
24
24
  //#endregion
@@ -98,10 +98,10 @@ interface CloudBindings {
98
98
  SANDBOX: DurableObjectNamespace<_$_cloudflare_sandbox0.Sandbox>;
99
99
  [key: string]: unknown;
100
100
  }
101
- interface CloudEnv extends Env {
101
+ type CloudEnv = Env & {
102
102
  Bindings: CloudBindings;
103
103
  Variables: CloudContextVariables;
104
- }
104
+ };
105
105
  declare module "hono" {
106
106
  interface Context {
107
107
  /**
@@ -163,14 +163,11 @@ type CloudContext = Context<CloudEnv>;
163
163
  type HandlerFn = (c: CloudContext) => unknown | Promise<unknown>;
164
164
  type MiddlewareFn = MiddlewareHandler<CloudEnv>;
165
165
  /** Pre-rendered asset tags injected by the SSR build. */
166
- interface RenderAssetTags {
167
- /** CSS stylesheet links for `<head>`. */
168
- css: string;
169
- /** JS modulepreload links for `<head>` (only when page needs JS). */
170
- preloads: string;
171
- /** Script tags for `</body>` (only when page needs JS). */
166
+ type RenderAssetTags = {
167
+ /** CSS stylesheet links for `<head>`. */css: string; /** JS modulepreload links for `<head>` (only when page needs JS). */
168
+ preloads: string; /** Script tags for `</body>` (only when page needs JS). */
172
169
  body: string;
173
- }
170
+ };
174
171
  type RenderFn = (c: CloudContext, assetTags: RenderAssetTags) => Response | Promise<Response>;
175
172
  type JobController = ScheduledController;
176
173
  type JobExecutionContext = ExecutionContext;
@@ -200,20 +197,20 @@ type QueueFn<T = unknown> = (batch: QueueBatch<T>, env: CloudEnv["Bindings"]) =>
200
197
  * `__payload` exists at the type level only —
201
198
  * TypeScript's `typeof import(...)` reads it for codegen.
202
199
  */
203
- interface TypedQueueHandler<T = unknown> {
200
+ type TypedQueueHandler<T = unknown> = {
204
201
  (batch: QueueBatch<T>, env: CloudEnv["Bindings"]): void | Promise<void>;
205
202
  readonly __payload: T;
206
- }
203
+ };
207
204
  /**
208
205
  * A typed handler with phantom type carriers for validators and return type.
209
206
  * `__validators` and `__output` exist at the type level only —
210
207
  * TypeScript's `typeof import(...)` reads them for codegen.
211
208
  */
212
- interface TypedHandler<V extends ValidatorSlots = {}, R = unknown> {
209
+ type TypedHandler<V extends ValidatorSlots = {}, R = unknown> = {
213
210
  (c: CloudContext): Promise<Response> | Response | unknown | Promise<unknown>;
214
211
  readonly __validators: V;
215
212
  readonly __output: R;
216
- }
213
+ };
217
214
  /**
218
215
  * Define a route handler, optionally composed with per-route middleware.
219
216
  *
@@ -221,11 +218,11 @@ interface TypedHandler<V extends ValidatorSlots = {}, R = unknown> {
221
218
  * Multiple arguments: middleware chain + final handler, composed at runtime.
222
219
  */
223
220
  declare function defineHandler<R>(handler: (c: CloudContext) => R | Response | Promise<R | Response>): TypedHandler<{}, Exclude<Awaited<R>, Response>>;
224
- declare function defineHandler(m1: MiddlewareFn, handler: HandlerFn): TypedHandler;
225
- declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, handler: HandlerFn): TypedHandler;
226
- declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, m3: MiddlewareFn, handler: HandlerFn): TypedHandler;
227
- declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, m3: MiddlewareFn, m4: MiddlewareFn, handler: HandlerFn): TypedHandler;
228
- declare function defineHandler(m1: MiddlewareFn, m2: MiddlewareFn, m3: MiddlewareFn, m4: MiddlewareFn, m5: MiddlewareFn, handler: HandlerFn): TypedHandler;
221
+ declare function defineHandler(firstMiddleware: MiddlewareFn, handler: HandlerFn): TypedHandler;
222
+ declare function defineHandler(firstMiddleware: MiddlewareFn, secondMiddleware: MiddlewareFn, handler: HandlerFn): TypedHandler;
223
+ declare function defineHandler(firstMiddleware: MiddlewareFn, secondMiddleware: MiddlewareFn, thirdMiddleware: MiddlewareFn, handler: HandlerFn): TypedHandler;
224
+ declare function defineHandler(firstMiddleware: MiddlewareFn, secondMiddleware: MiddlewareFn, thirdMiddleware: MiddlewareFn, fourthMiddleware: MiddlewareFn, handler: HandlerFn): TypedHandler;
225
+ declare function defineHandler(firstMiddleware: MiddlewareFn, secondMiddleware: MiddlewareFn, thirdMiddleware: MiddlewareFn, fourthMiddleware: MiddlewareFn, fifthMiddleware: MiddlewareFn, handler: HandlerFn): TypedHandler;
229
226
  /**
230
227
  * Create a handler with input validation using Standard Schema validators.
231
228
  *
@@ -1,6 +1,6 @@
1
1
  //#region src/pages/head.d.ts
2
2
  /** Shape of a single page's head metadata. */
3
- interface HeadDescriptor {
3
+ type HeadDescriptor = {
4
4
  title?: string;
5
5
  meta?: Array<{
6
6
  name?: string;
@@ -20,12 +20,11 @@ interface HeadDescriptor {
20
20
  }>;
21
21
  htmlAttrs?: Record<string, string>;
22
22
  bodyAttrs?: Record<string, string>;
23
- }
23
+ };
24
24
  /** Extended head config with template support (used in void.json). */
25
- interface HeadConfig extends HeadDescriptor {
26
- /** Title template — `%s` is replaced with the page title. */
27
- titleTemplate?: string;
28
- }
25
+ type HeadConfig = HeadDescriptor & {
26
+ /** Title template — `%s` is replaced with the page title. */titleTemplate?: string;
27
+ };
29
28
  /**
30
29
  * Merge head descriptors with precedence: page > middleware > config.
31
30
  *
@@ -1,5 +1,5 @@
1
1
  import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.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-BIa9HwVX.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-DqkeX_Fa.mjs";
3
3
  import { i as voidWarn } from "./log-DXdqnmhF.mjs";
4
4
  import { existsSync, readFileSync } from "node:fs";
5
5
  //#region src/cli/headers.ts
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { n as HeadDescriptor } from "./head-CZGAunBV.mjs";
2
- import { r as AuthUser } from "./auth-DrfOTMmr.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-dKQWyF-G.mjs";
1
+ import { n as HeadDescriptor } from "./head-C7QW7UY1.mjs";
2
+ import { r as AuthUser } from "./auth-DmuALf16.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-DJTuxB10.mjs";
4
4
  import { QueueMap } from "./runtime/queues.mjs";
5
5
  import { PluginConfig } from "@cloudflare/vite-plugin";
6
6
  import { Plugin } from "vite";
package/dist/index.mjs CHANGED
@@ -3,21 +3,21 @@ import { a as join, n as dirname, o as relative } from "./pathe.M-eThtNZ-D-kmWkC
3
3
  import { u as require_picocolors } from "./output-BwlcIYSR.mjs";
4
4
  import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-CvHtTM0q.mjs";
5
5
  import { r as readProjectConfig } from "./project-TqORyHn8.mjs";
6
- import { c as getToken, u as isStagingMode } from "./client-DCqnMpDt.mjs";
7
- import { C as isSandboxEnabled, S as SANDBOX_MIGRATION_TAG, _ 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-B5rTuzXw.mjs";
8
- import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-BIa9HwVX.mjs";
9
- import { i as scanJobsSync, n as scanWebSocketRoutesSync, r as scanQueuesSync, t as scanRoutes } from "./scan-vv5u7rHu.mjs";
6
+ import { c as getToken, u as isStagingMode } from "./client-BCHb449S.mjs";
7
+ import { C as isSandboxEnabled, S as SANDBOX_MIGRATION_TAG, _ 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-BVhinNvN.mjs";
8
+ import { c as getDatabaseDialect, f as readConfig, l as isNodeTarget, p as resolveBindingNames } from "./config-DqkeX_Fa.mjs";
9
+ import { i as scanJobsSync, n as scanWebSocketRoutesSync, r as scanQueuesSync, t as scanRoutes } from "./scan-B8iEm8xn.mjs";
10
10
  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-CXUuq0aC.mjs";
11
11
  import { i as voidWarn, n as voidError, r as voidLog, t as setShowTimestamp } from "./log-DXdqnmhF.mjs";
12
- import { r as parseDotenvFile } from "./dotenv-DwO4ti0Z.mjs";
13
- import { i as generateDbDts, n as generateQueueTypes, r as DRIZZLE_OPERATORS, t as generateRouteTypes } from "./route-types-DReF1gUY.mjs";
12
+ import { r as parseDotenvFile } from "./dotenv-zdFCCgFU.mjs";
13
+ import { i as generateDbDts, n as generateQueueTypes, r as DRIZZLE_OPERATORS, t as generateRouteTypes } from "./route-types-Cnqj_8a7.mjs";
14
14
  import { n as ensureProjectTsconfig } from "./project-tsconfig-DfkESbDL.mjs";
15
15
  import { t as discoverSchema } from "./discover-B7FkXBLB.mjs";
16
16
  import { t as MagicString } from "./magic-string.es-D6g9UnIy.mjs";
17
17
  import { n as generateEnvTypes, t as findEnvFile } from "./env-types-DknSA4SO.mjs";
18
- import { a as loadUserEnvFile } from "./env-validation-DJKjR_8q.mjs";
19
- import { i as resolveLayoutIds } from "./scan-Ba4hFwlH.mjs";
20
- import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-YVkHjOyq.mjs";
18
+ import { a as loadUserEnvFile } from "./env-validation-Bc_aiBUm.mjs";
19
+ import { i as resolveLayoutIds } from "./scan-CWfLxtOe.mjs";
20
+ import { n as lintDuplicateSources, r as mergeRoutingRules, t as lintDestinationSplats } from "./headers-C7Yf6_CN.mjs";
21
21
  import { n as generateVoidAuthDrizzleSchema, t as generateVoidAuthDatabaseModule } from "./drizzle-C-NRqGhx.mjs";
22
22
  import { t as INTERNAL_BINDING_PREFIXES } from "./env-raw-DtfQ9E31.mjs";
23
23
  import { n as defer } from "./defer-2ARBu8Et.mjs";
@@ -794,17 +794,17 @@ function buildOffsetIndex(code) {
794
794
  return { lineStarts };
795
795
  }
796
796
  function offsetToLineCol(index, offset) {
797
- const arr = index.lineStarts;
798
- let lo = 0;
799
- let hi = arr.length - 1;
800
- while (lo < hi) {
801
- const mid = lo + hi + 1 >>> 1;
802
- if (arr[mid] <= offset) lo = mid;
803
- else hi = mid - 1;
797
+ const lineStarts = index.lineStarts;
798
+ let lowerBound = 0;
799
+ let upperBound = lineStarts.length - 1;
800
+ while (lowerBound < upperBound) {
801
+ const midpoint = lowerBound + upperBound + 1 >>> 1;
802
+ if (lineStarts[midpoint] <= offset) lowerBound = midpoint;
803
+ else upperBound = midpoint - 1;
804
804
  }
805
805
  return {
806
- line: lo + 1,
807
- column: offset - arr[lo] + 1
806
+ line: lowerBound + 1,
807
+ column: offset - lineStarts[lowerBound] + 1
808
808
  };
809
809
  }
810
810
  /**
@@ -1097,10 +1097,10 @@ function frameworkTriggersPlugin(root, options) {
1097
1097
  };
1098
1098
  }
1099
1099
  function generateModule(root, jobs, queues, devTriggerToken) {
1100
- const jobImports = jobs.map((j, i) => `import __job${i} from ${JSON.stringify(join(root, "crons", j.filePath))};`).join("\n");
1101
- const queueImports = queues.map((q, i) => `import __queue${i} from ${JSON.stringify(join(root, "queues", q.filePath))};`).join("\n");
1102
- const jobTable = jobs.map((j, i) => ` { crons: ${JSON.stringify(j.crons)}, handler: __job${i} }`).join(",\n");
1103
- const queueTable = queues.map((q, i) => ` { name: ${JSON.stringify(q.name)}, handler: __queue${i} }`).join(",\n");
1100
+ const jobImports = jobs.map((job, jobIndex) => `import __job${jobIndex} from ${JSON.stringify(join(root, "crons", job.filePath))};`).join("\n");
1101
+ const queueImports = queues.map((queue, queueIndex) => `import __queue${queueIndex} from ${JSON.stringify(join(root, "queues", queue.filePath))};`).join("\n");
1102
+ const jobTable = jobs.map((job, jobIndex) => ` { crons: ${JSON.stringify(job.crons)}, handler: __job${jobIndex} }`).join(",\n");
1103
+ const queueTable = queues.map((queue, queueIndex) => ` { name: ${JSON.stringify(queue.name)}, handler: __queue${queueIndex} }`).join(",\n");
1104
1104
  return `// @ts-nocheck — Auto-generated by Void in dev. Do NOT edit. Regenerated on every config load.
1105
1105
  ${jobImports}
1106
1106
  ${queueImports}
@@ -1357,11 +1357,11 @@ export default defineEventHandler(async (event) => {
1357
1357
  */
1358
1358
  function analogDevTriggerInjectPlugin(root) {
1359
1359
  const routeDir = join(root, ANALOG_ROUTE_DIR_RELATIVE);
1360
- const routePaths = ANALOG_TRIGGERS.map((t) => ({
1361
- ...t,
1362
- path: join(routeDir, `${t.file}.ts`)
1360
+ const routePaths = ANALOG_TRIGGERS.map((trigger) => ({
1361
+ ...trigger,
1362
+ path: join(routeDir, `${trigger.file}.ts`)
1363
1363
  }));
1364
- const gitignoreLines = ANALOG_TRIGGERS.map((t) => `${ANALOG_ROUTE_DIR_RELATIVE}/${t.file}.ts`);
1364
+ const gitignoreLines = ANALOG_TRIGGERS.map((trigger) => `${ANALOG_ROUTE_DIR_RELATIVE}/${trigger.file}.ts`);
1365
1365
  const dispatchPath = frameworkTriggersDispatchPath(root);
1366
1366
  const ensureFiles = () => {
1367
1367
  mkdirSync(routeDir, { recursive: true });
@@ -1392,7 +1392,7 @@ function analogDevTriggerInjectPlugin(root) {
1392
1392
  return;
1393
1393
  }
1394
1394
  const path = req.url ?? "";
1395
- const match = ANALOG_TRIGGERS.find((t) => path === `/__void/${t.user}`);
1395
+ const match = ANALOG_TRIGGERS.find((trigger) => path === `/__void/${trigger.user}`);
1396
1396
  if (!match) {
1397
1397
  next();
1398
1398
  return;
@@ -1402,8 +1402,8 @@ function analogDevTriggerInjectPlugin(root) {
1402
1402
  for await (const chunk of req) chunks.push(chunk);
1403
1403
  const body = Buffer.concat(chunks);
1404
1404
  const headers = new Headers();
1405
- for (const [k, v] of Object.entries(req.headers)) if (typeof v === "string") headers.set(k, v);
1406
- else if (Array.isArray(v)) headers.set(k, v.join(", "));
1405
+ for (const [key, value] of Object.entries(req.headers)) if (typeof value === "string") headers.set(key, value);
1406
+ else if (Array.isArray(value)) headers.set(key, value.join(", "));
1407
1407
  const host = req.headers.host ?? "localhost";
1408
1408
  const upstream = await fetch(`http://${host}/api/__void/${match.file}`, {
1409
1409
  method: "POST",
@@ -1411,7 +1411,7 @@ function analogDevTriggerInjectPlugin(root) {
1411
1411
  body
1412
1412
  });
1413
1413
  res.statusCode = upstream.status;
1414
- upstream.headers.forEach((v, k) => res.setHeader(k, v));
1414
+ upstream.headers.forEach((value, key) => res.setHeader(key, value));
1415
1415
  res.end(Buffer.from(await upstream.arrayBuffer()));
1416
1416
  } catch (err) {
1417
1417
  next(err);
@@ -1568,7 +1568,7 @@ function migrationPlugin(root, dialect, databaseId = "local", persistRoot = join
1568
1568
  if (applied.length > 0) voidLog(`Applied ${applied.length} migration(s): ${applied.join(", ")}`);
1569
1569
  }
1570
1570
  if (auth?.enabled) {
1571
- const { runLocalVoidAuthMigrations } = await import("./node-DFqMcZR1.mjs");
1571
+ const { runLocalVoidAuthMigrations } = await import("./node-DHVCtkgt.mjs");
1572
1572
  await runLocalVoidAuthMigrations(root, dialect, persistRoot, databaseId, auth.configPath);
1573
1573
  voidLog("Applied Better Auth migrations");
1574
1574
  }
@@ -4498,6 +4498,15 @@ const SANDBOX_SDK_IMPORT = "@cloudflare/sandbox";
4498
4498
  const SANDBOX_SDK_IMPORT_FILTER = /^@cloudflare\/sandbox$/;
4499
4499
  const DEFAULT_WORKER_ENVIRONMENT_NAME = "void_worker";
4500
4500
  const DEFAULT_WORKER_OUT_DIR = "dist/ssr";
4501
+ const DEV_ASSET_ROUTING_EXCLUSIONS = [
4502
+ "!/@vite/*",
4503
+ "!/@id/*",
4504
+ "!/@fs/*",
4505
+ "!/@react-refresh",
4506
+ "!/@svelte/*",
4507
+ "!/node_modules/*",
4508
+ "!/__uno.css"
4509
+ ];
4501
4510
  function resolveSandboxSdkEntry() {
4502
4511
  return fileURLToPath(import.meta.resolve(SANDBOX_SDK_IMPORT));
4503
4512
  }
@@ -4588,7 +4597,7 @@ const STAGING_API_URL = "https://api.staging.void.cloud";
4588
4597
  */
4589
4598
  async function runAiSetupPrompt(root, token, staging, server) {
4590
4599
  const { select, text, isCancel, log } = await import("./dist-Dayj3gCK.mjs").then((n) => n.p);
4591
- const { PlatformClient } = await import("./client-DCqnMpDt.mjs").then((n) => n.r);
4600
+ const { PlatformClient } = await import("./client-BCHb449S.mjs").then((n) => n.r);
4592
4601
  const { writeProjectConfig } = await import("./project-TqORyHn8.mjs").then((n) => n.n);
4593
4602
  const { inferDefaultSlug } = await import("./resolve-project-DdjLQ2tB.mjs").then((n) => n.i);
4594
4603
  const client = new PlatformClient(token, staging ? STAGING_API_URL : DEFAULT_API_URL);
@@ -4920,7 +4929,7 @@ function voidPlugin(options) {
4920
4929
  ...env
4921
4930
  };
4922
4931
  const assets = workerConfig.assets;
4923
- if (command === "serve" && assets) delete assets.run_worker_first;
4932
+ if (command === "serve" && assets?.run_worker_first) assets.run_worker_first = [...DEV_ASSET_ROUTING_EXCLUSIONS, "/**"];
4924
4933
  const watchConfig = { server: { watch: { ignored } } };
4925
4934
  if (!isNodeTarget(config.target) && config.output !== "static") {
4926
4935
  const envNames = framework === "vinext-app" ? ["rsc", "ssr"] : ["ssr"];
@@ -2,16 +2,16 @@ import { a as join, i as isAbsolute, n as dirname, o as relative, s as resolve,
2
2
  import { n as cliTitle } from "./output-BwlcIYSR.mjs";
3
3
  import { _ as me, c as R, g as ge, i as Ee, u as Se, v as ue, x as q, y as ye } from "./dist-Dayj3gCK.mjs";
4
4
  import { a as writeProjectConfig, r as readProjectConfig } from "./project-TqORyHn8.mjs";
5
- import { c as getToken, n as PlatformClient, u as isStagingMode } from "./client-DCqnMpDt.mjs";
6
- import { c as getDatabaseDialect, f as readConfig } from "./config-BIa9HwVX.mjs";
5
+ import { c as getToken, n as PlatformClient, u as isStagingMode } from "./client-BCHb449S.mjs";
6
+ import { c as getDatabaseDialect, f as readConfig } from "./config-DqkeX_Fa.mjs";
7
7
  import { r as detectFramework } from "./plugin-inference-CXUuq0aC.mjs";
8
- import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-DwO4ti0Z.mjs";
8
+ import { r as parseDotenvFile, t as expandDotenv } from "./dotenv-zdFCCgFU.mjs";
9
9
  import { n as ensureProjectTsconfig, t as createProjectTsconfig } from "./project-tsconfig-DfkESbDL.mjs";
10
10
  import { t as MagicString } from "./magic-string.es-D6g9UnIy.mjs";
11
11
  import { n as writeDrizzleConfig } from "./config-BzM9Dy7T.mjs";
12
12
  import { n as getAgentById, r as getPackageDir, t as detectAgents } from "./agents-DqkFfc2c.mjs";
13
- import { n as promptProjectSelection, t as promptAndCreateProject } from "./create-project-Bg88Kq_I.mjs";
14
- import { t as promptForLoginToken } from "./login-B5HHT32i.mjs";
13
+ import { n as promptProjectSelection, t as promptAndCreateProject } from "./create-project-B4_81uPO.mjs";
14
+ import { t as promptForLoginToken } from "./login-B-hYch9Z.mjs";
15
15
  import { r as formatProjectCommand } from "./preset-BhnZpb7t.mjs";
16
16
  import { n as findInstalledYarnPnpRuntime, r as hasLocalLockfile, t as buildDrizzleKitSpawnEnv } from "./yarn-pnp-6LD6_3Ej.mjs";
17
17
  import { createRequire } from "node:module";
@@ -1,8 +1,8 @@
1
1
  import { n as cliTitle, s as import_picocolors } from "./output-BwlcIYSR.mjs";
2
2
  import { _ as me, c as R, g as ge, y as ye } from "./dist-Dayj3gCK.mjs";
3
3
  import { a as writeProjectConfig, r as readProjectConfig } from "./project-TqORyHn8.mjs";
4
- import { c as getToken, n as PlatformClient, s as getSiteDomain } from "./client-DCqnMpDt.mjs";
5
- import { n as promptProjectSelection, t as promptAndCreateProject } from "./create-project-Bg88Kq_I.mjs";
4
+ import { c as getToken, n as PlatformClient, s as getSiteDomain } from "./client-BCHb449S.mjs";
5
+ import { n as promptProjectSelection, t as promptAndCreateProject } from "./create-project-B4_81uPO.mjs";
6
6
  //#region src/cli/link.ts
7
7
  async function runLink(root, slug) {
8
8
  console.log();
@@ -1,7 +1,7 @@
1
1
  import { a as ensureUtc, i as dim, l as tablePrefix, n as cliTitle, s as import_picocolors } from "./output-BwlcIYSR.mjs";
2
2
  import { c as R, g as ge, y as ye } from "./dist-Dayj3gCK.mjs";
3
3
  import { r as readProjectConfig } from "./project-TqORyHn8.mjs";
4
- import { c as getToken, n as PlatformClient } from "./client-DCqnMpDt.mjs";
4
+ import { c as getToken, n as PlatformClient } from "./client-BCHb449S.mjs";
5
5
  import { r as resolveProjectBySlug } from "./resolve-project-DdjLQ2tB.mjs";
6
6
  //#region src/cli/list.ts
7
7
  async function runListCommand(root, slug) {
@@ -1,6 +1,6 @@
1
1
  import { n as cliTitle, r as createSpinner, s as import_picocolors } from "./output-BwlcIYSR.mjs";
2
2
  import { _ as me, c as R, g as ge, i as Ee, x as q, y as ye } from "./dist-Dayj3gCK.mjs";
3
- import { a as isExpiredTokenError, c as getToken, d as removeToken, f as runLogin, l as getTokenSource, n as PlatformClient, p as saveToken, u as isStagingMode } from "./client-DCqnMpDt.mjs";
3
+ import { a as isExpiredTokenError, c as getToken, d as removeToken, f as runLogin, l as getTokenSource, n as PlatformClient, p as saveToken, u as isStagingMode } from "./client-BCHb449S.mjs";
4
4
  //#region src/cli/login.ts
5
5
  async function promptForLoginToken(root = process.cwd()) {
6
6
  const provider = await Ee({
@@ -1,7 +1,7 @@
1
1
  import { i as dim, n as cliTitle, s as import_picocolors } from "./output-BwlcIYSR.mjs";
2
2
  import { c as R, g as ge, y as ye } from "./dist-Dayj3gCK.mjs";
3
3
  import { r as readProjectConfig } from "./project-TqORyHn8.mjs";
4
- import { c as getToken, n as PlatformClient } from "./client-DCqnMpDt.mjs";
4
+ import { c as getToken, n as PlatformClient } from "./client-BCHb449S.mjs";
5
5
  //#region src/cli/logs.ts
6
6
  async function runLogsCommand(root, filter, range, deployment, level) {
7
7
  console.log();
@@ -1,6 +1,6 @@
1
1
  import { a as join, n as dirname } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
2
  import { a as writeProjectConfig } from "./project-TqORyHn8.mjs";
3
- import { c as getToken, n as PlatformClient } from "./client-DCqnMpDt.mjs";
3
+ import { c as getToken, n as PlatformClient } from "./client-BCHb449S.mjs";
4
4
  import { existsSync, readFileSync, readdirSync } from "node:fs";
5
5
  import { fileURLToPath } from "node:url";
6
6
  import { createInterface } from "node:readline";
@@ -1,6 +1,6 @@
1
1
  import { a as join } from "./pathe.M-eThtNZ-D-kmWkCS.mjs";
2
2
  import { n as loadVoidAuthConfig, t as findVoidAuthConfig } from "./config-CvHtTM0q.mjs";
3
- import { f as readConfig } from "./config-BIa9HwVX.mjs";
3
+ import { f as readConfig } from "./config-DqkeX_Fa.mjs";
4
4
  import { r as resolveVoidAuthMigrationSchema } from "./drizzle-C-NRqGhx.mjs";
5
5
  import { n as applySqliteAuthMigrations, t as applyPgAuthMigrations } from "./auth-migrations-BwLPwRgH.mjs";
6
6
  import { getMiniflareDatabasePath } from "./runner-BUPRnMFN.mjs";