@vite-hub/queue 0.5.0 → 0.5.1

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 (48) hide show
  1. package/dist/{client-DYE_ZV8c.js → client-CwoCdKct.js} +9 -11
  2. package/dist/{cloudflare-GosJefIK.js → cloudflare-BMc35cBD.js} +2 -4
  3. package/dist/{cloudflare-client-BasaJ68s.js → cloudflare-client-xWteD-su.js} +6 -8
  4. package/dist/{cloudflare-resource-name-BUNNqgkg.js → cloudflare-resource-name-Bv8Z7nDU.js} +3 -4
  5. package/dist/{config-YEuaeQVq.js → config-Bzp1xmdh.js} +4 -7
  6. package/dist/{definition-BL_3WHNu.js → definition-CIiFfst2.js} +3 -4
  7. package/dist/durability.d.ts +1 -3
  8. package/dist/durability.js +1 -2
  9. package/dist/{duration-CshzgSSx.js → duration-C5w_-Rf4.js} +4 -7
  10. package/dist/{error-diagnostics-DukggGP6.js → error-diagnostics-Dv6nKZQW.js} +1 -2
  11. package/dist/{error-diagnostics-C0KyI408.js → error-diagnostics-kKXseq8d.js} +5 -2
  12. package/dist/{handler-response-ChtAjPNo.js → handler-response-CchTXVjm.js} +3 -5
  13. package/dist/index.d.ts +1 -9
  14. package/dist/index.js +5 -6
  15. package/dist/{inspect-PeuckaC3.js → inspect-CwdWUhPj.js} +1 -2
  16. package/dist/internal/runtime/cloudflare-client.d.ts +2 -4
  17. package/dist/internal/runtime/cloudflare-client.js +1 -2
  18. package/dist/internal/runtime/cloudflare-vite.d.ts +2 -9
  19. package/dist/internal/runtime/cloudflare-vite.js +11 -15
  20. package/dist/internal/runtime/local-client.d.ts +4 -6
  21. package/dist/internal/runtime/local-client.js +5 -6
  22. package/dist/internal/runtime/postgres-client.d.ts +4 -7
  23. package/dist/internal/runtime/postgres-client.js +8 -10
  24. package/dist/internal/runtime/state.d.ts +3 -5
  25. package/dist/internal/runtime/state.js +1 -2
  26. package/dist/internal/runtime/vercel-client.d.ts +2 -4
  27. package/dist/internal/runtime/vercel-client.js +5 -7
  28. package/dist/internal/runtime/worker-client.d.ts +3 -5
  29. package/dist/internal/runtime/worker-client.js +2 -3
  30. package/dist/{invariant-D8_xBqmZ.js → invariant-CmdvZ3vp.js} +1 -2
  31. package/dist/{local-DAL5ZgDg.d.ts → local-B72WRWkS.d.ts} +1 -3
  32. package/dist/{local-CnBd5jdm.js → local-RX10a_Sq.js} +3 -4
  33. package/dist/{object-D8pRdprI.js → object-DRSmpe04.js} +1 -2
  34. package/dist/{operation-definition-CI2PJGqu.d.ts → operation-definition-CqZkx1Rm.d.ts} +0 -4
  35. package/dist/{operations-BL0b9pte.js → operations-CoEXxfUW.js} +6 -7
  36. package/dist/operations.d.ts +3 -7
  37. package/dist/operations.js +9 -15
  38. package/dist/runtime/hosted.d.ts +2 -4
  39. package/dist/runtime/hosted.js +4 -5
  40. package/dist/{scan-module-BbqyaLl6.js → scan-module-BaqBao0J.js} +2 -4
  41. package/dist/{state-ER1YdCBF.js → state-DqxeV11k.js} +5 -8
  42. package/dist/{types-D6hDNcMY.d.ts → types-BevEYrUV.d.ts} +1 -3
  43. package/dist/{types-klaR79hV.d.ts → types-BzPGPV9z.d.ts} +0 -2
  44. package/dist/{vercel-region-DOciq2kx.js → vercel-region-DEsR1YJQ.js} +2 -3
  45. package/dist/{vercel-C_4vqxcl.js → vercel-sUJOxFBB.js} +2 -3
  46. package/dist/vite.d.ts +2 -28
  47. package/dist/vite.js +31 -51
  48. package/package.json +10 -10
@@ -1,7 +1,7 @@
1
- import { t as queueErrorDiagnostics } from "../../error-diagnostics-DukggGP6.js";
2
- import { c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, l as queueUnsupportedOptionsError, s as queueProviderResult, t as readQueueTimes, u as createQueueMessageId } from "../../duration-CshzgSSx.js";
3
- import { t as resolveVercelQueueRegion } from "../../vercel-region-DOciq2kx.js";
4
- //#region src/providers/vercel.ts
1
+ import { c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, l as queueUnsupportedOptionsError, s as queueProviderResult, t as readQueueTimes, u as createQueueMessageId } from "../../duration-C5w_-Rf4.js";
2
+ import { t as queueErrorDiagnostics } from "../../error-diagnostics-Dv6nKZQW.js";
3
+ import { t as resolveVercelQueueRegion } from "../../vercel-region-DEsR1YJQ.js";
4
+ // src/providers/vercel.ts
5
5
  function invalidVercelSendResponse(cause) {
6
6
  return [queueErrorDiagnostics.QUEUE_PROVIDER_INVALID_RESPONSE({ cause }), void 0];
7
7
  }
@@ -169,8 +169,7 @@ async function createVercelQueueClient(provider) {
169
169
  callback: client.handleCallback.bind(client)
170
170
  };
171
171
  }
172
- //#endregion
173
- //#region src/internal/runtime/vercel-client.ts
172
+ // src/internal/runtime/vercel-client.ts
174
173
  async function createVercelQueueRuntimeClient(options) {
175
174
  if (options.driver !== "vercel") throw queueErrorDiagnostics.QUEUE_DRIVER_MISMATCH({
176
175
  driver: options.driver,
@@ -178,5 +177,4 @@ async function createVercelQueueRuntimeClient(options) {
178
177
  });
179
178
  return await createVercelQueueClient(options);
180
179
  }
181
- //#endregion
182
180
  export { createVercelQueueRuntimeClient };
@@ -1,6 +1,4 @@
1
- import { b as QueueClient } from "../../types-klaR79hV.js";
2
- import { t as QueueRuntimeDriverOptions } from "../../types-D6hDNcMY.js";
3
- //#region src/internal/runtime/worker-client.d.ts
1
+ import { b as QueueClient } from "../../types-BzPGPV9z.js";
2
+ import { t as QueueRuntimeDriverOptions } from "../../types-BevEYrUV.js";
4
3
  /** Worker package conditions keep the Node driver and its optional peer outside the build graph. */
5
- export declare function createPostgresQueueRuntimeClient(options: QueueRuntimeDriverOptions): Promise<QueueClient>;
6
- //#endregion
4
+ export declare function createPostgresQueueRuntimeClient(options: QueueRuntimeDriverOptions): Promise<QueueClient>;
@@ -1,5 +1,5 @@
1
- import { t as queueErrorDiagnostics } from "../../error-diagnostics-DukggGP6.js";
2
- //#region src/internal/runtime/worker-client.ts
1
+ import { t as queueErrorDiagnostics } from "../../error-diagnostics-Dv6nKZQW.js";
2
+ // src/internal/runtime/worker-client.ts
3
3
  /** Worker package conditions keep the Node driver and its optional peer outside the build graph. */
4
4
  async function createPostgresQueueRuntimeClient(options) {
5
5
  throw queueErrorDiagnostics.QUEUE_DRIVER_MISMATCH({
@@ -7,5 +7,4 @@ async function createPostgresQueueRuntimeClient(options) {
7
7
  expected: "cloudflare"
8
8
  });
9
9
  }
10
- //#endregion
11
10
  export { createPostgresQueueRuntimeClient };
@@ -1,5 +1,5 @@
1
1
  import { defineDiagnostics } from "nostics";
2
- //#region ../internal/src/invariant.ts
2
+ // ../internal/src/invariant.ts
3
3
  const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
4
4
  docsBase: "https://vitehub.dev/docs/development/diagnostics",
5
5
  codes: { INTERNAL_INVARIANT_FAILED: {
@@ -18,5 +18,4 @@ function invariantError(what) {
18
18
  function invariant(condition, what) {
19
19
  if (!condition) throw invariantError(what);
20
20
  }
21
- //#endregion
22
21
  export { invariant as t };
@@ -1,5 +1,4 @@
1
- import { A as QueueJobStore } from "./types-klaR79hV.js";
2
- //#region src/providers/local.d.ts
1
+ import { A as QueueJobStore } from "./types-BzPGPV9z.js";
3
2
  /** One job for the engine. `vite dev` and the clients read `delay` and `retention` into seconds first. */
4
3
  interface LocalQueueEntry {
5
4
  delaySeconds?: number;
@@ -19,5 +18,4 @@ interface LocalQueueEngine extends QueueJobStore {
19
18
  /** Reads the stored jobs and starts their delivery. Later calls return the same promise. */
20
19
  start: () => Promise<void>;
21
20
  }
22
- //#endregion
23
21
  export { LocalQueueEngine as t };
@@ -1,6 +1,6 @@
1
- import { t as queueErrorDiagnostics } from "./error-diagnostics-DukggGP6.js";
2
- import { c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, i as localUnsupportedEnqueueOptions, l as queueUnsupportedOptionsError, n as cloudflareUnsupportedEnqueueOptions, o as postgresUnsupportedEnqueueOptions, s as queueProviderResult, t as readQueueTimes, u as createQueueMessageId } from "./duration-CshzgSSx.js";
3
- import { i as reportQueueDeliveryError, n as createQueueDeliveryErrorReport, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "./handler-response-ChtAjPNo.js";
1
+ import { c as queueRemovedOptionsError, d as normalizeQueueEnqueueInput, i as localUnsupportedEnqueueOptions, l as queueUnsupportedOptionsError, n as cloudflareUnsupportedEnqueueOptions, o as postgresUnsupportedEnqueueOptions, s as queueProviderResult, t as readQueueTimes, u as createQueueMessageId } from "./duration-C5w_-Rf4.js";
2
+ import { i as reportQueueDeliveryError, n as createQueueDeliveryErrorReport, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "./handler-response-CchTXVjm.js";
3
+ import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
4
4
  import { mkdir, readFile, readdir, rename, rm, writeFile } from "node:fs/promises";
5
5
  import { join, resolve } from "pathe";
6
6
  import { randomUUID } from "node:crypto";
@@ -555,5 +555,4 @@ function createLocalQueueClient(engine, queue) {
555
555
  }
556
556
  };
557
557
  }
558
- //#endregion
559
558
  export { localQueueDeliveryRules as i, createLocalQueueEngine as n, delayMs as r, createLocalQueueClient as t };
@@ -1,4 +1,4 @@
1
- //#region ../internal/src/object.ts
1
+ // ../internal/src/object.ts
2
2
  /** A non-null object that is not an array. Functions do not pass. */
3
3
  function isRecord(value) {
4
4
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -11,5 +11,4 @@ function isRecordOrFunction(value) {
11
11
  function cloneRecord(value) {
12
12
  return value && typeof value === "object" && !Array.isArray(value) ? { ...value } : {};
13
13
  }
14
- //#endregion
15
14
  export { isRecord as n, isRecordOrFunction as r, cloneRecord as t };
@@ -1,4 +1,3 @@
1
- //#region ../../node_modules/.pnpm/@standard-schema+spec@1.1.0/node_modules/@standard-schema/spec/dist/index.d.ts
2
1
  /** The Standard Typed interface. This is a base type extended by other specs. */
3
2
  interface StandardTypedV1<Input = unknown, Output = Input> {
4
3
  /** The Standard properties. */
@@ -74,8 +73,6 @@ declare namespace StandardSchemaV1 {
74
73
  /** Infers the output type of a Standard. */
75
74
  type InferOutput<Schema extends StandardTypedV1> = StandardTypedV1.InferOutput<Schema>;
76
75
  }
77
- //#endregion
78
- //#region ../internal/src/operation-definition.d.ts
79
76
  /** `read` never changes state. `write` changes state. `destructive` deletes or publishes. */
80
77
  type OperationKind = "read" | "write" | "destructive";
81
78
  /** The signed-in user of a call. */
@@ -241,5 +238,4 @@ interface OperationContributionEntry {
241
238
  /** `false`: the app already has these operations at runtime. Only tools such as the CLI and `vitehub inspect` read the entry. */
242
239
  runtime?: false;
243
240
  }
244
- //#endregion
245
241
  export { OperationContributionEntry as n, AnyOperation as t };
@@ -1,10 +1,10 @@
1
- import { t as queueErrorDiagnostics } from "./error-diagnostics-DukggGP6.js";
2
- import { a as normalizePublicQueueIdentifier, r as isQueueError } from "./duration-CshzgSSx.js";
3
- import { i as getQueueRuntimeConfig, o as getQueueRuntimeJobStore, s as listQueueDefinitionNames } from "./state-ER1YdCBF.js";
4
- import { n as dynamicQueue } from "./client-DYE_ZV8c.js";
5
- import { t as redactInspectionText } from "./inspect-PeuckaC3.js";
1
+ import { t as redactInspectionText } from "./inspect-CwdWUhPj.js";
2
+ import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
3
+ import { a as normalizePublicQueueIdentifier, r as isQueueError } from "./duration-C5w_-Rf4.js";
4
+ import { i as getQueueRuntimeConfig, o as getQueueRuntimeJobStore, s as listQueueDefinitionNames } from "./state-DqxeV11k.js";
5
+ import { n as dynamicQueue } from "./client-CwoCdKct.js";
6
6
  import { runtimeErrorDiagnostics } from "@vite-hub/runtime/internal/error-diagnostics";
7
- //#region src/runtime/operations.ts
7
+ // src/runtime/operations.ts
8
8
  const statuses = {
9
9
  QUEUE_DEFINITION_NAME_INVALID: 400,
10
10
  QUEUE_DEFINITION_NOT_FOUND: 404,
@@ -119,5 +119,4 @@ async function retryQueueJob(id) {
119
119
  async function clearQueueJobs(input) {
120
120
  return { cleared: await (await localJobs()).clear(input) };
121
121
  }
122
- //#endregion
123
122
  export { clearQueueJobs, listQueueJobs, listQueues, retryQueueJob, sendToQueue, showQueueJob };
@@ -1,7 +1,6 @@
1
- import { A as QueueJobStore, d as LocalQueueJob, f as LocalQueueJobDetail, h as LocalQueueStatus, p as LocalQueueRules, w as QueueDriver } from "./types-klaR79hV.js";
2
- import "./local-DAL5ZgDg.js";
3
- import { t as AnyOperation } from "./operation-definition-CI2PJGqu.js";
4
- //#region src/runtime/operations.d.ts
1
+ import { t as AnyOperation } from "./operation-definition-CqZkx1Rm.js";
2
+ import "./local-B72WRWkS.js";
3
+ import { A as QueueJobStore, d as LocalQueueJob, f as LocalQueueJobDetail, h as LocalQueueStatus, p as LocalQueueRules, w as QueueDriver } from "./types-BzPGPV9z.js";
5
4
  interface QueueListResult {
6
5
  /** `undefined` when the runtime has not installed a Queue configuration. */
7
6
  provider?: QueueDriver;
@@ -58,13 +57,10 @@ interface QueueSendOperationInput {
58
57
  payload: unknown;
59
58
  queue: string;
60
59
  }
61
- //#endregion
62
- //#region src/operations.d.ts
63
60
  /**
64
61
  * The `queue.*` operations: list and send, and the stored jobs of the local and postgres providers. `vite dev` runs
65
62
  * every job with the local provider. Cloudflare and Vercel do not let a producer read their queue, so the job
66
63
  * operations fail there.
67
64
  */
68
65
  export declare const queueOperations: readonly AnyOperation[];
69
- //#endregion
70
66
  export type { LocalQueueJob, LocalQueueJobDetail, QueueJobsClearInput, QueueJobsListInput, QueueJobsListResult, QueueListResult, QueueSendOperationInput, QueueSendOperationResult };
@@ -1,6 +1,6 @@
1
- import { r as isRecordOrFunction } from "./object-D8pRdprI.js";
2
- import { t as internalErrorDiagnostics } from "./error-diagnostics-C0KyI408.js";
3
- //#region ../internal/src/standard-schema.ts
1
+ import { r as isRecordOrFunction } from "./object-DRSmpe04.js";
2
+ import { t as internalErrorDiagnostics } from "./error-diagnostics-kKXseq8d.js";
3
+ // ../internal/src/standard-schema.ts
4
4
  function readOwn(value, key) {
5
5
  if (value === null || Object(value) !== value) return;
6
6
  try {
@@ -29,8 +29,7 @@ function standardJsonSchema(schema, direction, target = "draft-2020-12", library
29
29
  return;
30
30
  }
31
31
  }
32
- //#endregion
33
- //#region ../../node_modules/.pnpm/@valibot+to-json-schema@1.8.0_valibot@1.5.0_typescript@6.0.3_/node_modules/@valibot/to-json-schema/dist/index.mjs
32
+ // ../../node_modules/.pnpm/@valibot+to-json-schema@1.8.0_valibot@1.5.0_typescript@6.0.3_/node_modules/@valibot/to-json-schema/dist/index.mjs
34
33
  /**
35
34
  * Adds an error message to the errors array.
36
35
  *
@@ -712,8 +711,7 @@ function toJsonSchema(schema, config) {
712
711
  if (context.referenceMap.size) jsonSchema.$defs = context.definitions;
713
712
  return jsonSchema;
714
713
  }
715
- //#endregion
716
- //#region ../internal/src/valibot.ts
714
+ // ../internal/src/valibot.ts
717
715
  const valibotTargets = /* @__PURE__ */ new Set([
718
716
  "draft-07",
719
717
  "draft-2020-12",
@@ -754,8 +752,7 @@ function withValibotJsonSchema(schema, options = {}) {
754
752
  }
755
753
  };
756
754
  }
757
- //#endregion
758
- //#region ../internal/src/operation-definition.ts
755
+ // ../internal/src/operation-definition.ts
759
756
  const nameFormat = /^[a-z][a-z0-9-]*\.[a-z][a-z0-9-]*$/;
760
757
  const kinds = /* @__PURE__ */ new Set([
761
758
  "read",
@@ -815,8 +812,7 @@ function isSectionId(section) {
815
812
  function operationInputJsonSchema(operation) {
816
813
  return standardJsonSchema(operation.input, "input") ?? { type: "object" };
817
814
  }
818
- //#endregion
819
- //#region ../internal/src/operations.ts
815
+ // ../internal/src/operations.ts
820
816
  /** Align rows of text cells in columns for CLI output. The last column is not padded. */
821
817
  function table(rows) {
822
818
  const widths = rows[0].map((_, column) => Math.max(...rows.map((row) => row[column].length)));
@@ -1161,9 +1157,8 @@ function pipe(...pipe$1) {
1161
1157
  }
1162
1158
  });
1163
1159
  }
1164
- //#endregion
1165
- //#region src/operations.ts
1166
- const runtime = () => import("./operations-BL0b9pte.js");
1160
+ // src/operations.ts
1161
+ const runtime = () => import("./operations-CoEXxfUW.js");
1167
1162
  function defineQueueOperation(definition) {
1168
1163
  return defineOperation({
1169
1164
  ...definition,
@@ -1308,5 +1303,4 @@ const queueOperations = [
1308
1303
  run: async (input) => (await runtime()).clearQueueJobs(input)
1309
1304
  })
1310
1305
  ];
1311
- //#endregion
1312
1306
  export { queueOperations };
@@ -1,6 +1,4 @@
1
- import { x as QueueDefinition } from "../types-klaR79hV.js";
2
- //#region src/runtime/hosted.d.ts
1
+ import { x as QueueDefinition } from "../types-BzPGPV9z.js";
3
2
  export declare const hostedVercelWaitUntil: (promise: Promise<unknown>) => void | undefined;
4
3
  /** Handle one Vercel Queue delivery. The generated consumer route is a Fetchable module that passes its Request here. */
5
- export declare function handleHostedVercelQueueCallback(request: Request, name: string, definition: QueueDefinition): Promise<Response>;
6
- //#endregion
4
+ export declare function handleHostedVercelQueueCallback(request: Request, name: string, definition: QueueDefinition): Promise<Response>;
@@ -1,9 +1,9 @@
1
- import { t as queueErrorDiagnostics } from "../error-diagnostics-DukggGP6.js";
2
- import { n as dynamicQueue } from "../client-DYE_ZV8c.js";
3
- import { i as reportQueueDeliveryError, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "../handler-response-ChtAjPNo.js";
1
+ import { t as queueErrorDiagnostics } from "../error-diagnostics-Dv6nKZQW.js";
2
+ import { i as reportQueueDeliveryError, r as isNonRetryableQueueError, t as checkQueueHandlerResponse } from "../handler-response-CchTXVjm.js";
3
+ import { n as dynamicQueue } from "../client-CwoCdKct.js";
4
4
  import { runInRunScopes } from "@vite-hub/runtime/internal/run-scope";
5
5
  import { waitUntil } from "@vercel/functions";
6
- //#region src/runtime/hosted.ts
6
+ // src/runtime/hosted.ts
7
7
  const hostedVercelWaitUntil = waitUntil;
8
8
  function createVercelJobHandler(definition) {
9
9
  return async (payload, metadata) => {
@@ -47,5 +47,4 @@ async function handleHostedVercelQueueCallback(request, name, definition) {
47
47
  if (result instanceof Response) return result;
48
48
  return result === void 0 ? new Response(null, { status: 204 }) : Response.json(result);
49
49
  }
50
- //#endregion
51
50
  export { handleHostedVercelQueueCallback, hostedVercelWaitUntil };
@@ -1,5 +1,5 @@
1
1
  import { parseSync } from "vite";
2
- //#region ../internal/src/build/ast-walk.ts
2
+ // ../internal/src/build/ast-walk.ts
3
3
  /** The oxc parser grammar for a file, from its extension. Defaults to TypeScript. */
4
4
  function moduleLanguage(file) {
5
5
  if (/\.(?:c|m)?tsx$/i.test(file)) return "tsx";
@@ -22,8 +22,7 @@ function walk(node, visit, parent) {
22
22
  } else if (isNode(child)) walk(child, visit, node);
23
23
  }
24
24
  }
25
- //#endregion
26
- //#region ../internal/src/build/scan-module.ts
25
+ // ../internal/src/build/scan-module.ts
27
26
  /**
28
27
  * Reads facts from JavaScript and TypeScript modules at build and dev time. The scanner parses each module once with
29
28
  * the oxc parser that Vite ships through Rolldown, and never runs it. Values that are not static literals read as
@@ -307,5 +306,4 @@ function templateExpressionSources(template) {
307
306
  if (literal.type !== "TemplateLiteral") return [];
308
307
  return literal.expressions.map((_node, index) => module.source.slice(literal.quasis[index]?.end ?? 0, literal.quasis[index + 1]?.start ?? 0));
309
308
  }
310
- //#endregion
311
309
  export { argumentExpression, defaultExportExpression, dynamic, exportNames, findCalls, findDefaultExportCall, findProperty, maskLiterals, moduleTokens, nodeText, objectProperties, scanModule, staticString, staticValue, templateExpressionSources, unwrapExpression, walk };
@@ -1,7 +1,7 @@
1
- import { n as isRecord } from "./object-D8pRdprI.js";
2
- import { t as queueErrorDiagnostics } from "./error-diagnostics-DukggGP6.js";
1
+ import { n as isRecord } from "./object-DRSmpe04.js";
2
+ import { t as queueErrorDiagnostics } from "./error-diagnostics-Dv6nKZQW.js";
3
3
  import { AsyncLocalStorage } from "node:async_hooks";
4
- //#region ../internal/src/runtime/cloudflare-env-lookup.ts
4
+ // ../internal/src/runtime/cloudflare-env-lookup.ts
5
5
  /** The key of the AsyncLocalStorage store on `globalThis`. Every bundled copy of this module shares the store. */
6
6
  const activeEnvStorageKey = Symbol.for("vitehub.cloudflare.env-storage");
7
7
  let activeEnv;
@@ -41,8 +41,7 @@ function getCloudflareEnv(event, options = {}) {
41
41
  for (const candidate of [ownValue(target, "env"), ...cloudflareOwners(target).map((owner) => ownValue(owner, "env"))]) if (candidate) return candidate;
42
42
  return options.fallback === false ? void 0 : getActiveCloudflareEnv();
43
43
  }
44
- //#endregion
45
- //#region ../internal/src/runtime/cloudflare-env.ts
44
+ // ../internal/src/runtime/cloudflare-env.ts
46
45
  const runtimeGlobal = globalThis;
47
46
  const activeEnvStorage = runtimeGlobal[activeEnvStorageKey] ||= new AsyncLocalStorage();
48
47
  const globalEnvProbe = Symbol("vitehub.cloudflare.global-env-probe");
@@ -113,8 +112,7 @@ function createCloudflareRuntimeEvent(env, context) {
113
112
  waitUntil
114
113
  };
115
114
  }
116
- //#endregion
117
- //#region src/internal/runtime/state.ts
115
+ // src/internal/runtime/state.ts
118
116
  let runtimeConfig;
119
117
  let runtimeClientFactory;
120
118
  let registryOverride;
@@ -192,5 +190,4 @@ async function loadQueueDefinition(name) {
192
190
  if (isQueueDefinition(loaded)) return loaded;
193
191
  if (isRecord(loaded) && Object.hasOwn(loaded, "default") && isQueueDefinition(loaded.default)) return loaded.default;
194
192
  }
195
- //#endregion
196
193
  export { runWithActiveCloudflareEnv as _, getQueueRuntimeEvent as a, loadQueueDefinition as c, setQueueRuntimeConfig as d, setQueueRuntimeEventDefaults as f, resolveWaitUntil as g, createCloudflareRuntimeEvent as h, getQueueRuntimeConfig as i, missingQueueDefinitionError as l, setQueueRuntimeRegistry as m, getOrCreateQueueClient as n, getQueueRuntimeJobStore as o, setQueueRuntimeJobStore as p, getQueueRuntimeClientFactory as r, listQueueDefinitionNames as s, enterQueueRuntimeEvent as t, runWithQueueRuntimeEvent as u, getCloudflareEnv as v };
@@ -1,9 +1,7 @@
1
- import { R as ResolvedQueueOptions, T as QueueDriverOptions } from "./types-klaR79hV.js";
2
- //#region src/internal/runtime/types.d.ts
1
+ import { R as ResolvedQueueOptions, T as QueueDriverOptions } from "./types-BzPGPV9z.js";
3
2
  interface QueueDevelopmentOptions {
4
3
  development?: boolean;
5
4
  }
6
5
  type QueueRuntimeOptions = ResolvedQueueOptions & QueueDevelopmentOptions;
7
6
  type QueueRuntimeDriverOptions = QueueDriverOptions & QueueDevelopmentOptions;
8
- //#endregion
9
7
  export { QueueRuntimeOptions as n, QueueRuntimeDriverOptions as t };
@@ -1,5 +1,4 @@
1
1
  import { Duration, Result } from "@vite-hub/runtime";
2
- //#region src/types.d.ts
3
2
  type QueueDriver = "cloudflare" | "local" | "postgres" | "vercel";
4
3
  /** The Queue drivers that run jobs in a Node server process. */
5
4
  type NodeQueueDriver = "local" | "postgres";
@@ -442,5 +441,4 @@ interface QueueJobStore {
442
441
  readonly rules: LocalQueueDeliveryRules;
443
442
  status: () => Promise<LocalQueueStatus>;
444
443
  }
445
- //#endregion
446
444
  export { QueueJobStore as A, VercelQueueCallbackOptions as B, QueueDefinitionRegistry as C, QueueErrorCode as D, QueueEnqueueOptions as E, QueueRegistry as F, VercelQueueSendBatchMessage as G, VercelQueueErrorCode as H, QueueSendResult as I, VercelQueueSendBatchOptions as K, ResolvedLocalQueueOptions as L, QueueName as M, QueueOptions as N, QueueHandler as O, QueuePayload as P, ResolvedQueueOptions as R, QueueDefinitionOptions as S, QueueDriverOptions as T, VercelQueueRetryDirective as U, VercelQueueClient as V, VercelQueueRetryHandler as W, PostgresQueueClient as _, CloudflareQueueMessageBatch as a, QueueClient as b, LocalQueueClient as c, LocalQueueJob as d, LocalQueueJobDetail as f, NodeQueueDriver as g, LocalQueueStatus as h, CloudflareQueueMessage as i, QueueModuleDriverOptions as j, QueueJob as k, LocalQueueDriverOptions as l, LocalQueueSendBatchMessage as m, CloudflareQueueClient as n, CloudflareQueueSendBatchItem as o, LocalQueueRules as p, VercelQueueSendResult as q, CloudflareQueueErrorCode as r, DiscoveredQueueDefinition as s, CloudflareQueueBatchHandlerOptions as t, LocalQueueErrorCode as u, PostgresQueueDriverOptions as v, QueueDriver as w, QueueDefinition as x, PostgresQueueErrorCode as y, VercelQueueBatchSendResult as z };
@@ -1,5 +1,5 @@
1
- import { a as getQueueRuntimeEvent } from "./state-ER1YdCBF.js";
2
- //#region src/internal/vercel-region.ts
1
+ import { a as getQueueRuntimeEvent } from "./state-DqxeV11k.js";
2
+ // src/internal/vercel-region.ts
3
3
  function readHeader(headers, name) {
4
4
  const get = headers?.get;
5
5
  const value = typeof get === "function" ? get.call(headers, name) : headers?.[name];
@@ -22,5 +22,4 @@ function resolveVercelQueueRegion(explicitRegion) {
22
22
  requestScoped: event !== void 0
23
23
  };
24
24
  }
25
- //#endregion
26
25
  export { resolveVercelQueueRegion as t };
@@ -1,8 +1,7 @@
1
- import { r as encodeNameHex } from "./cloudflare-GosJefIK.js";
2
- //#region src/integrations/vercel.ts
1
+ import { r as encodeNameHex } from "./cloudflare-BMc35cBD.js";
2
+ // src/integrations/vercel.ts
3
3
  const vercelQueueTopicPrefix = "topic--";
4
4
  function getVercelQueueTopicName(name) {
5
5
  return `${vercelQueueTopicPrefix}${encodeNameHex(name)}`;
6
6
  }
7
- //#endregion
8
7
  export { getVercelQueueTopicName as t };
package/dist/vite.d.ts CHANGED
@@ -1,12 +1,9 @@
1
- import { N as QueueOptions, s as DiscoveredQueueDefinition } from "./types-klaR79hV.js";
2
- import { n as OperationContributionEntry } from "./operation-definition-CI2PJGqu.js";
1
+ import { N as QueueOptions, s as DiscoveredQueueDefinition } from "./types-BzPGPV9z.js";
2
+ import { n as OperationContributionEntry } from "./operation-definition-CqZkx1Rm.js";
3
3
  import "nostics";
4
4
  import { Plugin, UserConfig } from "vite";
5
- //#region ../internal/src/deployment.d.ts
6
5
  /** The host that ViteHub builds for: the `host` option of `vitehub()` and the value of `VITEHUB_HOST`. */
7
6
  type ViteHubHost = "cloudflare" | "deno" | "netlify" | "node" | "vercel";
8
- //#endregion
9
- //#region ../internal/src/inspect.d.ts
10
7
  interface ViteHubDefinitionField {
11
8
  label: string;
12
9
  value: string;
@@ -64,8 +61,6 @@ interface ViteHubInspectionContributor {
64
61
  providerOutput?: readonly ViteHubProviderOutputEntry[];
65
62
  resources?: () => readonly ViteHubResourceSummary[] | Promise<readonly ViteHubResourceSummary[]>;
66
63
  }
67
- //#endregion
68
- //#region ../internal/src/build/deployment-plan-output.d.ts
69
64
  /**
70
65
  * One set of host variables that the deployed app reads, as `deployment.json` lists it: a Server Env declaration, or
71
66
  * a variable that a primitive reads itself, such as `VITEHUB_SECRET` or `BLOB_READ_WRITE_TOKEN`.
@@ -95,8 +90,6 @@ interface DeploymentEnvContext {
95
90
  * Return names only, never values.
96
91
  */
97
92
  type DeploymentEnvContribution = (context: DeploymentEnvContext) => readonly DeploymentEnvEntry[];
98
- //#endregion
99
- //#region ../internal/src/durability.d.ts
100
93
  /**
101
94
  * One durability reporter that a primitive's Vite plugin contributes through `vitehub.durability`. The Node server
102
95
  * imports `export` from `module` at boot and calls it with `input` and the server environment. It returns the
@@ -119,8 +112,6 @@ interface DurabilityPluginMetadata {
119
112
  /** Called after Vite resolves the config. Return an empty list when the primitive is off. */
120
113
  durability?: () => readonly DurabilityContribution[];
121
114
  }
122
- //#endregion
123
- //#region ../internal/src/host-credentials.d.ts
124
115
  interface HostCliRunResult {
125
116
  exitCode: number | null;
126
117
  stdout: string;
@@ -132,8 +123,6 @@ type HostCliRun = (command: string, args: readonly string[], options: {
132
123
  env: NodeJS.ProcessEnv;
133
124
  signal?: AbortSignal;
134
125
  }) => Promise<HostCliRunResult>;
135
- //#endregion
136
- //#region ../internal/src/provision.d.ts
137
126
  type ProvisionProvider = "cloudflare" | "vercel";
138
127
  interface ProvisionLogger {
139
128
  log: (message: string) => void;
@@ -185,8 +174,6 @@ interface ProvisionStep {
185
174
  /** Describes the Provision State this step records. Runs without network access, also without credentials. */
186
175
  recordedState?: (context: Pick<ProvisionContext, "env">) => ProvisionStateCategory[];
187
176
  }
188
- //#endregion
189
- //#region ../internal/src/cli.d.ts
190
177
  interface ViteHubCliStreams {
191
178
  stderr: {
192
179
  write: (chunk: string | Uint8Array, encoding?: BufferEncoding | StdoutWriteCallback, callback?: StdoutWriteCallback) => unknown;
@@ -277,8 +264,6 @@ interface ViteHubCliContributor {
277
264
  publicUrl?: string;
278
265
  }
279
266
  type StdoutWriteCallback = (error?: Error | null) => void;
280
- //#endregion
281
- //#region ../internal/src/contributions.d.ts
282
267
  /** Module and export that hold a contributed Definition. */
283
268
  interface ContributionDefinition {
284
269
  /**
@@ -333,8 +318,6 @@ interface CollectedContribution {
333
318
  /** Name of the contributing Vite plugin. */
334
319
  plugin: string;
335
320
  }
336
- //#endregion
337
- //#region src/contributions.d.ts
338
321
  /**
339
322
  * A Queue Definition that another package adds from its Vite plugin. The Queue plugin merges it with the discovered
340
323
  * files, so the registry, the generated types, Cloudflare bindings, Vercel consumers, inspection, and provisioning
@@ -356,8 +339,6 @@ type CollectedQueueContribution = CollectedContribution;
356
339
  * `QUEUE_DEFINITION_DUPLICATE`. Invalid entries fail with `QUEUE_CONTRIBUTION_INVALID`.
357
340
  */
358
341
  export declare function collectQueueContributions(plugins: readonly unknown[] | undefined, context: QueueContributionContext): Promise<CollectedQueueContribution[]>;
359
- //#endregion
360
- //#region src/discovery.d.ts
361
342
  /** Discovery source of Queue Definitions that Vite plugins contribute through `vitehub.queues`. */
362
343
  export declare const contributedQueueSource = "vite-plugin-contribution";
363
344
  interface QueueContributionOptions {
@@ -373,8 +354,6 @@ export declare function discoverQueueDefinitions(options: QueueContributionOptio
373
354
  mode: "server-queues";
374
355
  scanDirs: string[];
375
356
  }): DiscoveredQueueDefinition[];
376
- //#endregion
377
- //#region ../internal/src/console.d.ts
378
357
  type MaybePromise<T> = T | Promise<T>;
379
358
  /** Lists discovered Definitions in a sidebar and shows the selected Definition's fields. */
380
359
  interface ViteHubConsoleDefinitionCatalogView {
@@ -706,8 +685,6 @@ interface ViteHubConsoleDocumentSetup {
706
685
  */
707
686
  schedule?: ViteHubConsoleDocumentHint;
708
687
  }
709
- //#endregion
710
- //#region src/inspect.d.ts
711
688
  interface QueueInspectionOptions {
712
689
  /** Queue Definitions that Vite plugins contribute through `vitehub.queues`. */
713
690
  contributions?: readonly CollectedQueueContribution[];
@@ -719,8 +696,6 @@ interface QueueInspectionOptions {
719
696
  export declare function inspectQueueDefinitions(options: QueueInspectionOptions, definitions?: readonly DiscoveredQueueDefinition[]): ViteHubDefinitionSummary[];
720
697
  /** Console section that lists discovered Queue Definitions. `vitehub inspect definitions` reads the same data. */
721
698
  export declare const queueConsoleSection: ViteHubConsoleSectionContribution<QueueInspectionOptions>;
722
- //#endregion
723
- //#region src/vite.d.ts
724
699
  interface QueueProvisionContributingPlugin {
725
700
  vitehub?: {
726
701
  cli?: () => Promise<ViteHubCliContributor>;
@@ -759,5 +734,4 @@ export interface QueueVitePluginInternalOptions {
759
734
  }
760
735
  export declare function createQueueNitroConfig(plugin: QueueVitePlugin, options: QueueNitroConfigOptions): Promise<Record<string, unknown>>;
761
736
  export declare function hubQueue(options?: QueueOptions, internalOptions?: QueueVitePluginInternalOptions): QueueVitePlugin;
762
- //#endregion
763
737
  export type { CollectedQueueContribution, QueueContributingPlugin, QueueContribution, QueueContributionContext, QueueContributionFactory, QueueInspectionOptions };