@cloudflare/vite-plugin 1.52.1 → 1.53.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.
@@ -0,0 +1,48 @@
1
+ import { createRequire } from "node:module";
2
+
3
+ //#region ../runtime-types/dist/chunk-Q72B4Q5Z-CeVNOsQb.mjs
4
+ var __getOwnPropNames$1 = Object.getOwnPropertyNames;
5
+ var __commonJS$1 = (cb, mod) => function() {
6
+ return mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
7
+ };
8
+ var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
9
+ var __create = Object.create;
10
+ var __defProp = Object.defineProperty;
11
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
+ var __getOwnPropNames = Object.getOwnPropertyNames;
13
+ var __getProtoOf = Object.getPrototypeOf;
14
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
15
+ var __name = (target, value) => __defProp(target, "name", {
16
+ value,
17
+ configurable: true
18
+ });
19
+ var __require = /* @__PURE__ */ ((x) => typeof __require$1 !== "undefined" ? __require$1 : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof __require$1 !== "undefined" ? __require$1 : a)[b] }) : x)(function(x) {
20
+ if (typeof __require$1 !== "undefined") return __require$1.apply(this, arguments);
21
+ throw Error("Dynamic require of \"" + x + "\" is not supported");
22
+ });
23
+ var __commonJS = (cb, mod) => function __require2() {
24
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
25
+ };
26
+ var __export = (target, all) => {
27
+ for (var name in all) __defProp(target, name, {
28
+ get: all[name],
29
+ enumerable: true
30
+ });
31
+ };
32
+ var __copyProps = (to, from, except, desc) => {
33
+ if (from && typeof from === "object" || typeof from === "function") {
34
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
35
+ get: () => from[key],
36
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
37
+ });
38
+ }
39
+ return to;
40
+ };
41
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
42
+ value: mod,
43
+ enumerable: true
44
+ }) : target, mod));
45
+
46
+ //#endregion
47
+ export { __require as a, __name as i, __commonJS$1 as n, __require$1 as o, __export as r, __toESM as s, __commonJS as t };
48
+ //# sourceMappingURL=chunk-Q72B4Q5Z-CeVNOsQb-C-Fq2PKw.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk-Q72B4Q5Z-CeVNOsQb-C-Fq2PKw.mjs","names":[],"sources":["../../runtime-types/dist/chunk-Q72B4Q5Z-CeVNOsQb.mjs"],"sourcesContent":["import { createRequire } from \"node:module\";\n\n//#region rolldown:runtime\nvar __getOwnPropNames$1 = Object.getOwnPropertyNames;\nvar __commonJS$1 = (cb, mod) => function() {\n\treturn mod || (0, cb[__getOwnPropNames$1(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __require$1 = /* @__PURE__ */ createRequire(import.meta.url);\n\n//#endregion\n//#region ../workers-utils/dist/chunk-Q72B4Q5Z.mjs\nvar __create = Object.create;\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __getProtoOf = Object.getPrototypeOf;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __name = (target, value) => __defProp(target, \"name\", {\n\tvalue,\n\tconfigurable: true\n});\nvar __require = /* @__PURE__ */ ((x) => typeof __require$1 !== \"undefined\" ? __require$1 : typeof Proxy !== \"undefined\" ? new Proxy(x, { get: (a, b) => (typeof __require$1 !== \"undefined\" ? __require$1 : a)[b] }) : x)(function(x) {\n\tif (typeof __require$1 !== \"undefined\") return __require$1.apply(this, arguments);\n\tthrow Error(\"Dynamic require of \\\"\" + x + \"\\\" is not supported\");\n});\nvar __commonJS = (cb, mod) => function __require2() {\n\treturn mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n};\nvar __copyProps = (to, from, except, desc) => {\n\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\tfor (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {\n\t\t\tget: () => from[key],\n\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t});\n\t}\n\treturn to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\tvalue: mod,\n\tenumerable: true\n}) : target, mod));\n\n//#endregion\nexport { __toESM as a, __require as i, __export as n, __commonJS$1 as o, __name as r, __require$1 as s, __commonJS as t };"],"mappings":";;;AAGA,IAAI,sBAAsB,OAAO;AACjC,IAAI,gBAAgB,IAAI,QAAQ,WAAW;AAC1C,QAAO,QAAQ,GAAG,GAAG,oBAAoB,GAAG,CAAC,MAAM,MAAM,EAAE,SAAS,EAAE,EAAE,EAAE,SAAS,IAAI,EAAE,IAAI;;AAE9F,IAAI,cAA8B,8BAAc,OAAO,KAAK,IAAI;AAIhE,IAAI,WAAW,OAAO;AACtB,IAAI,YAAY,OAAO;AACvB,IAAI,mBAAmB,OAAO;AAC9B,IAAI,oBAAoB,OAAO;AAC/B,IAAI,eAAe,OAAO;AAC1B,IAAI,eAAe,OAAO,UAAU;AACpC,IAAI,UAAU,QAAQ,UAAU,UAAU,QAAQ,QAAQ;CACzD;CACA,cAAc;CACd,CAAC;AACF,IAAI,YAA4B,kBAAE,MAAM,OAAO,gBAAgB,cAAc,cAAc,OAAO,UAAU,cAAc,IA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 interface R2BindingOptions {
325
325
  jurisdiction?: string;
326
326
  /** Whether the R2 bucket should be remote or not in local development. */
327
327
  remote?: boolean;
328
+ /** Settings that only apply to local development. */
329
+ localDev?: {
330
+ /** EXPERIMENTAL: credentials for the local S3-compatible endpoint. */
331
+ experimentalS3Credentials?: {
332
+ accessKeyId: string;
333
+ secretAccessKey: string;
334
+ };
335
+ };
328
336
  }
329
337
  /**
330
338
  * Binding to an R2 bucket.
@@ -526,8 +534,6 @@ interface WorkflowBindingOptions {
526
534
  workerName: string;
527
535
  /** The exported class name of the Workflow. */
528
536
  exportName: string;
529
- /** Whether the Workflow binding should be remote or not in local development. */
530
- remote?: boolean;
531
537
  }
532
538
  /**
533
539
  * Binding to a Workflow. `workerName` is the name of the Worker that defines
@@ -806,11 +812,27 @@ interface EmailTriggerOptions {
806
812
  interface EmailTrigger extends EmailTriggerOptions {
807
813
  type: "email";
808
814
  }
815
+ interface ConnectTriggerOptions {
816
+ /** The transport protocol to listen for. */
817
+ protocol: "tcp";
818
+ /** The port to listen on. */
819
+ port: number;
820
+ /** The address to bind to. Defaults to `127.0.0.1`. */
821
+ address?: string;
822
+ }
823
+ /**
824
+ * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
825
+ * handler for raw socket connections received on the configured
826
+ * protocol/port.
827
+ */
828
+ interface ConnectTrigger extends ConnectTriggerOptions {
829
+ type: "connect";
830
+ }
809
831
  /**
810
- * Event triggers — fetch routes, queue consumers, cron schedules, and Email
811
- * Routing addresses — that invoke this Worker. Construct entries with
812
- * `triggers.fetch(...)`, `triggers.queue(...)`, `triggers.scheduled(...)`, or
813
- * `triggers.email(...)`.
832
+ * Event triggers — fetch routes, queue consumers, cron schedules, Email
833
+ * Routing addresses, and raw sockets — that invoke this Worker.
834
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
835
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or `triggers.connect(...)`.
814
836
  *
815
837
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
816
838
  */
@@ -839,6 +861,12 @@ interface Triggers {
839
861
  * addresses.
840
862
  */
841
863
  email(options: EmailTriggerOptions): EmailTrigger;
864
+ /**
865
+ * Connect trigger — invokes this Worker's `connect(socket, env, ctx)`
866
+ * handler for raw socket connections received on the configured
867
+ * protocol/port.
868
+ */
869
+ connect(options: ConnectTriggerOptions): ConnectTrigger;
842
870
  }
843
871
  /**
844
872
  * Triggers builder for configuring event triggers.
@@ -854,6 +882,7 @@ interface Triggers {
854
882
  * triggers.scheduled({ schedule: "0 * * * *" }),
855
883
  * triggers.scheduled({ schedule: "30 0 * * *" }),
856
884
  * triggers.email({ addresses: ["support@example.com"] }),
885
+ * triggers.connect({ protocol: "tcp", port: 5432 }),
857
886
  * ],
858
887
  * });
859
888
  * ```
@@ -861,6 +890,27 @@ interface Triggers {
861
890
  declare const triggers: Triggers;
862
891
  //#endregion
863
892
  //#region src/exports.d.ts
893
+ /**
894
+ * Storage backend for the Durable Object.
895
+ *
896
+ * Containers are only supported on the SQLite storage engine, so `container` is
897
+ * only offered alongside `storage: "sqlite"`.
898
+ */
899
+ type DurableObjectStorageOptions = {
900
+ /**
901
+ * Selects the SQLite-backed storage engine (recommended for new
902
+ * classes).
903
+ */
904
+ storage: "sqlite";
905
+ /**
906
+ * Attach a container to this Durable Object, by container name. The
907
+ * name must match an entry in the top level `containers` array.
908
+ */
909
+ container?: string;
910
+ } | {
911
+ /** Selects the legacy key-value storage engine. */
912
+ storage: "legacy-kv";
913
+ };
864
914
  /**
865
915
  * Declares a provisioned Durable Object class exported from this Worker.
866
916
  *
@@ -869,17 +919,9 @@ declare const triggers: Triggers;
869
919
  *
870
920
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#durable-objects
871
921
  */
872
- interface DurableObjectCreatedExportOptions {
922
+ type DurableObjectCreatedExportOptions = {
873
923
  state?: "created";
874
- /**
875
- * Storage backend for the Durable Object.
876
- *
877
- * - `"sqlite"`: selects the SQLite-backed storage engine
878
- * (recommended for new classes).
879
- * - `"legacy-kv"`: selects the legacy key-value storage engine.
880
- */
881
- storage: "sqlite" | "legacy-kv";
882
- }
924
+ } & DurableObjectStorageOptions;
883
925
  /**
884
926
  * Retire a provisioned Durable Object namespace whose class has
885
927
  * been removed from code.
@@ -919,17 +961,16 @@ interface DurableObjectTransferredExportOptions {
919
961
  * Prepare to receive cross-Worker Durable Object transfer.
920
962
  * Once the source Worker's `transferred` export is deployed, this entry becomes a normal live `durable-object` export.
921
963
  */
922
- interface DurableObjectExpectingTransferExportOptions {
964
+ type DurableObjectExpectingTransferExportOptions = {
923
965
  state: "expecting-transfer";
924
- storage: "sqlite" | "legacy-kv";
925
966
  /**
926
967
  * The source Worker for the two-phase cross-Worker transfer.
927
968
  */
928
969
  transferFrom: string;
929
- }
930
- interface DurableObjectCreatedExport extends DurableObjectCreatedExportOptions {
970
+ } & DurableObjectStorageOptions;
971
+ type DurableObjectCreatedExport = DurableObjectCreatedExportOptions & {
931
972
  type: "durable-object";
932
- }
973
+ };
933
974
  interface DurableObjectDeletedExport extends DurableObjectDeletedExportOptions {
934
975
  type: "durable-object";
935
976
  }
@@ -939,9 +980,9 @@ interface DurableObjectRenamedExport extends DurableObjectRenamedExportOptions {
939
980
  interface DurableObjectTransferredExport extends DurableObjectTransferredExportOptions {
940
981
  type: "durable-object";
941
982
  }
942
- interface DurableObjectExpectingTransferExport extends DurableObjectExpectingTransferExportOptions {
983
+ type DurableObjectExpectingTransferExport = DurableObjectExpectingTransferExportOptions & {
943
984
  type: "durable-object";
944
- }
985
+ };
945
986
  type DurableObjectExportOptions = DurableObjectCreatedExportOptions | DurableObjectDeletedExportOptions | DurableObjectRenamedExportOptions | DurableObjectTransferredExportOptions | DurableObjectExpectingTransferExportOptions;
946
987
  type DurableObjectExports = DurableObjectCreatedExport | DurableObjectDeletedExport | DurableObjectRenamedExport | DurableObjectTransferredExport | DurableObjectExpectingTransferExport;
947
988
  interface WorkerEntrypointExportOptions {
@@ -998,6 +1039,7 @@ interface Exports {
998
1039
  * export default defineWorker({
999
1040
  * exports: {
1000
1041
  * MyDurableObject: exports.durableObject({ storage: "sqlite" }),
1042
+ * MyContainerDO: exports.durableObject({ storage: "sqlite", container: "my-container" }),
1001
1043
  * OldClass: exports.durableObject({ state: "deleted" }),
1002
1044
  * OldName: exports.durableObject({ state: "renamed", renamedTo: "NewName" }),
1003
1045
  * Outgoing: exports.durableObject({ state: "transferred", transferredTo: "target-worker" }),
@@ -1042,7 +1084,7 @@ type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamesp
1042
1084
  /**
1043
1085
  * Union of all trigger definitions accepted in `triggers`.
1044
1086
  */
1045
- type Trigger = EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
1087
+ type Trigger = ConnectTrigger | EmailTrigger | FetchTrigger | QueueConsumerTrigger | ScheduledTrigger;
1046
1088
  /**
1047
1089
  * Union of all export definitions accepted in `exports`. Worker entries
1048
1090
  * configure WorkerEntrypoint exports. Durable Object entries configure live
@@ -1123,10 +1165,11 @@ interface WorkerConfig {
1123
1165
  */
1124
1166
  domains?: string[];
1125
1167
  /**
1126
- * Event triggers — fetch routes, queue consumers, cron schedules, and Email
1127
- * Routing addresses
1128
- * — that invoke this Worker. Construct entries with `triggers.fetch(...)`,
1129
- * `triggers.queue(...)`, `triggers.scheduled(...)`, or `triggers.email(...)`.
1168
+ * Event triggers — fetch routes, queue consumers, cron schedules, Email
1169
+ * Routing addresses, and raw sockets — that invoke this Worker.
1170
+ * Construct entries with `triggers.fetch(...)`, `triggers.queue(...)`,
1171
+ * `triggers.scheduled(...)`, `triggers.email(...)`, or
1172
+ * `triggers.connect(...)`.
1130
1173
  *
1131
1174
  * For reference, see https://developers.cloudflare.com/workers/wrangler/configuration/#triggers
1132
1175
  */
@@ -1613,5 +1656,5 @@ declare function defineSettings(config: ConfigInput<SettingsConfigInput>): {
1613
1656
  };
1614
1657
  //#endregion
1615
1658
  //#endregion
1616
- export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, Bindings, BrowserBinding, ConfigContext, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
1659
+ export { AgentMemoryBinding, AiBinding, AiSearchBinding, AiSearchNamespaceBinding, AnalyticsEngineDatasetBinding, ArtifactsBinding, AssetsBinding, Bindings, BrowserBinding, ConfigContext, ConnectTrigger, D1Binding, DispatchNamespaceBinding, DurableObjectBinding, DurableObjectCreatedExport, DurableObjectDeletedExport, DurableObjectExpectingTransferExport, DurableObjectRenamedExport, DurableObjectTransferredExport, EmailTrigger, Exports, FetchTrigger, FlagshipBinding, HyperdriveBinding, ImagesBinding$1 as ImagesBinding, InferDurableNamespaces, InferEnv, InferMainModule, JsonBinding, KvBinding, LogfwdrBinding, MediaBinding$1 as MediaBinding, MtlsCertificateBinding, PipelineBinding, QueueBinding, QueueConsumerTrigger, R2Binding, RateLimitBinding, ScheduledTrigger, SecretBinding, SecretsStoreSecretBinding, SendEmailBinding, SettingsConfig, SettingsConfigInput, StreamBinding$1 as StreamBinding, TextBinding, Triggers, TypedAiBinding, TypedDurableObjectBinding, TypedKvBinding, TypedPipelineBinding, TypedQueueBinding, TypedWorkerBinding, TypedWorkerDefinition, TypedWorkflowBinding, UnsafeBinding, UnwrapConfig, VectorizeBinding, VersionMetadataBinding, VpcNetworkBinding, VpcServiceBinding, WebSearchBinding, WorkerBinding, WorkerConfig, WorkerConfigExport, WorkerConfigInput, WorkerEntrypointExport, WorkerEntrypointExportOptions, WorkerLoaderBinding, WorkflowBinding, bindings, defineSettings, defineWorker, exports, triggers };
1617
1660
  //# sourceMappingURL=experimental-config.d.mts.map