@cloudflare/vite-plugin 1.60.1 → 1.61.0
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/chunk-U6NEESU5-BzWFpRaS.mjs +44 -0
- package/dist/chunk-U6NEESU5-BzWFpRaS.mjs.map +1 -0
- package/dist/experimental-config.d.mts +24 -11
- package/dist/experimental-config.d.mts.map +1 -1
- package/dist/experimental-config.mjs +6 -2
- package/dist/experimental-config.mjs.map +1 -1
- package/dist/index.mjs +441 -322
- package/dist/index.mjs.map +1 -1
- package/dist/{open-PBXRGS4R-CR0exOIH.mjs → open-PCXX3ZDZ-BXBWVkHI.mjs} +5 -3
- package/dist/open-PCXX3ZDZ-BXBWVkHI.mjs.map +1 -0
- package/dist/{package-BRgKu3HY.mjs → package-DeMvRYfk.mjs} +2 -2
- package/dist/{package-BRgKu3HY.mjs.map → package-DeMvRYfk.mjs.map} +1 -1
- package/package.json +12 -12
- package/dist/chunk-Q72B4Q5Z-izl5Qmnx.mjs +0 -70
- package/dist/chunk-Q72B4Q5Z-izl5Qmnx.mjs.map +0 -1
- package/dist/open-PBXRGS4R-CR0exOIH.mjs.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
|
|
3
|
+
//#region ../workers-utils/dist/chunk-U6NEESU5.mjs
|
|
4
|
+
const require$1 = createRequire(import.meta.url || (typeof __filename === "string" ? __filename : "/"));
|
|
5
|
+
var __create = Object.create;
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
8
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
9
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
10
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
+
var __name = (target, value) => __defProp(target, "name", {
|
|
12
|
+
value,
|
|
13
|
+
configurable: true
|
|
14
|
+
});
|
|
15
|
+
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) {
|
|
16
|
+
if (typeof require$1 !== "undefined") return require$1.apply(this, arguments);
|
|
17
|
+
throw Error("Dynamic require of \"" + x + "\" is not supported");
|
|
18
|
+
});
|
|
19
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
20
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
21
|
+
};
|
|
22
|
+
var __export = (target, all) => {
|
|
23
|
+
for (var name in all) __defProp(target, name, {
|
|
24
|
+
get: all[name],
|
|
25
|
+
enumerable: true
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
var __copyProps = (to, from, except, desc) => {
|
|
29
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
30
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
31
|
+
get: () => from[key],
|
|
32
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
return to;
|
|
36
|
+
};
|
|
37
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
38
|
+
value: mod,
|
|
39
|
+
enumerable: true
|
|
40
|
+
}) : target, mod));
|
|
41
|
+
|
|
42
|
+
//#endregion
|
|
43
|
+
export { __toESM as a, __require as i, __export as n, __name as r, __commonJS as t };
|
|
44
|
+
//# sourceMappingURL=chunk-U6NEESU5-BzWFpRaS.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-U6NEESU5-BzWFpRaS.mjs","names":[],"sources":["../../workers-utils/dist/chunk-U6NEESU5.mjs"],"sourcesContent":["import { createRequire } from 'node:module';\n\nconst require$1 = createRequire(import.meta.url || (typeof __filename === \"string\" ? __filename : \"/\"));\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\", { value, configurable: true });\nvar __require = /* @__PURE__ */ ((x) => typeof require$1 !== \"undefined\" ? require$1 : typeof Proxy !== \"undefined\" ? new Proxy(x, {\n get: (a, b) => (typeof require$1 !== \"undefined\" ? require$1 : a)[b]\n}) : x)(function(x) {\n if (typeof require$1 !== \"undefined\") return require$1.apply(this, arguments);\n throw Error('Dynamic require of \"' + x + '\" is not supported');\n});\nvar __commonJS = (cb, mod) => function __require2() {\n return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;\n};\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(\n // If the importer is in node compatibility mode or this is not an ESM\n // file that has been converted to a CommonJS file using a Babel-\n // compatible transform (i.e. \"__esModule\" has not been set), then set\n // \"default\" to the CommonJS \"module.exports\" for node compatibility.\n isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", { value: mod, enumerable: true }) : target,\n mod\n));\n\nexport { __commonJS, __export, __name, __require, __toESM };\n"],"mappings":";;;AAEA,MAAM,YAAY,cAAc,OAA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O,SAAS,aAAa,IAAI,CAAC,GAAG,EAAE,EAAE,YAKnG,cAAc,CAAC,OAAO,CAAC,IAAI,aAAa,UAAU,QAAQ,WAAW;CAAE,OAAO;CAAK,YAAY;CAAM,CAAC,GAAG,QACzG,IACD"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Pipeline, PipelineRecord } from "cloudflare:pipelines";
|
|
2
2
|
|
|
3
|
-
//#region ../config/dist/public-
|
|
3
|
+
//#region ../config/dist/public-DA8eKvPJ.d.mts
|
|
4
4
|
|
|
5
5
|
//#region src/exports.d.ts
|
|
6
6
|
/**
|
|
@@ -127,11 +127,11 @@ interface WorkflowExportOptions {
|
|
|
127
127
|
* does not set its own retention. Accepts milliseconds or a duration string
|
|
128
128
|
* such as `"3 days"`.
|
|
129
129
|
*/
|
|
130
|
-
|
|
130
|
+
defaultRetention?: {
|
|
131
131
|
/** How long to retain instances that completed successfully or were terminated. */
|
|
132
|
-
|
|
132
|
+
successRetention?: number | string;
|
|
133
133
|
/** How long to retain errored instances. */
|
|
134
|
-
|
|
134
|
+
errorRetention?: number | string;
|
|
135
135
|
};
|
|
136
136
|
}
|
|
137
137
|
interface WorkflowExport extends WorkflowExportOptions {
|
|
@@ -611,7 +611,7 @@ interface CloudflareConfig extends Settings {
|
|
|
611
611
|
/**
|
|
612
612
|
* Union of all binding definitions accepted in `env`.
|
|
613
613
|
*/
|
|
614
|
-
type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding;
|
|
614
|
+
type Binding = AgentMemoryBinding | AiBinding | AiSearchBinding | AiSearchNamespaceBinding | AnalyticsEngineDatasetBinding | ArtifactsBinding | AssetsBinding | BrowserBinding | D1Binding | DispatchNamespaceBinding | DurableObjectBinding | FlagshipBinding | HyperdriveBinding | ImagesBinding$1 | JsonBinding | KvBinding | LogfwdrBinding | MediaBinding$1 | MtlsCertificateBinding | PipelineBinding | QueueBinding | R2Binding | RateLimitBinding | SecretBinding | SecretsStoreSecretBinding | SendEmailBinding | StreamBinding$1 | TextBinding | UnsafeBinding | VectorizeBinding | VersionMetadataBinding | VpcNetworkBinding | VpcServiceBinding | WorkerBinding | WorkerLoaderBinding | WorkflowBinding;
|
|
615
615
|
/**
|
|
616
616
|
* Union of all trigger definitions accepted in `triggers`.
|
|
617
617
|
*/
|
|
@@ -1087,6 +1087,11 @@ interface ConfigContext {
|
|
|
1087
1087
|
* another context before they are used.
|
|
1088
1088
|
*/
|
|
1089
1089
|
type ConfigInput<T$1> = T$1 | Promise<T$1> | ((ctx: ConfigContext) => T$1 | Promise<T$1>);
|
|
1090
|
+
/** Recursively apply declared config properties without expanding open records. */
|
|
1091
|
+
type ContextualProperties<TInput extends object, TConfig> = TInput extends readonly unknown[] ? TConfig extends readonly (infer TElement)[] ? { [K in keyof TInput]: ContextualConfig<TInput[K], TElement> } : TConfig : string extends keyof TConfig ? TConfig : { [K in keyof TConfig]: K extends keyof TInput ? ContextualConfig<TInput[K], TConfig[K]> : TConfig[K] };
|
|
1092
|
+
type ContextualConfig<TInput, TConfig> = TInput extends Promise<infer TValue> ? Promise<ContextualConfig<TValue, TConfig>> : TInput extends ((ctx: ConfigContext) => infer TResult) ? (ctx: ConfigContext) => ContextualConfig<TResult, TConfig> : TConfig extends unknown ? TInput extends TConfig ? TInput & (TInput extends object ? ContextualProperties<TInput, TConfig> : TConfig) : never : never;
|
|
1093
|
+
/** Create a type-safe identity helper for a configuration value or factory. */
|
|
1094
|
+
|
|
1090
1095
|
type ContainerDefinition<T$1 extends ContainerConfig = ContainerConfig> = ConfigInput<T$1>;
|
|
1091
1096
|
type WorkerDefinition<T$1 extends WorkerConfig = WorkerConfig> = ConfigInput<T$1>;
|
|
1092
1097
|
/** A Worker name, value, promise, or context-aware factory. */
|
|
@@ -1106,7 +1111,7 @@ type WorkerReference = string | WorkerDefinition;
|
|
|
1106
1111
|
* });
|
|
1107
1112
|
* ```
|
|
1108
1113
|
*/
|
|
1109
|
-
declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput) => TInput;
|
|
1114
|
+
declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>(config: TInput & ContextualConfig<TInput, CloudflareConfig>) => TInput;
|
|
1110
1115
|
/**
|
|
1111
1116
|
* Define a Container.
|
|
1112
1117
|
*
|
|
@@ -1120,7 +1125,7 @@ declare const defineConfig: <const TInput extends ConfigInput<CloudflareConfig>>
|
|
|
1120
1125
|
* });
|
|
1121
1126
|
* ```
|
|
1122
1127
|
*/
|
|
1123
|
-
declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput) => TInput;
|
|
1128
|
+
declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig>>(config: TInput & ContextualConfig<TInput, ContainerConfig>) => TInput;
|
|
1124
1129
|
/**
|
|
1125
1130
|
* Define a Worker.
|
|
1126
1131
|
*
|
|
@@ -1134,7 +1139,7 @@ declare const defineContainer: <const TInput extends ConfigInput<ContainerConfig
|
|
|
1134
1139
|
* });
|
|
1135
1140
|
* ```
|
|
1136
1141
|
*/
|
|
1137
|
-
declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput) => TInput;
|
|
1142
|
+
declare const defineWorker: <const TInput extends ConfigInput<WorkerConfig>>(config: TInput & ContextualConfig<TInput, WorkerConfig>) => TInput;
|
|
1138
1143
|
//#endregion
|
|
1139
1144
|
//#region src/utils.d.ts
|
|
1140
1145
|
/**
|
|
@@ -1648,15 +1653,17 @@ interface WorkerLoaderBinding {
|
|
|
1648
1653
|
type: "worker-loader";
|
|
1649
1654
|
}
|
|
1650
1655
|
interface WorkflowBindingOptions<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> {
|
|
1656
|
+
/** The name of the Workflow. */
|
|
1657
|
+
name: string;
|
|
1651
1658
|
/** The name or config of the Worker that defines the Workflow. */
|
|
1652
1659
|
worker: TWorker$1;
|
|
1653
1660
|
/** The exported class name of the Workflow. */
|
|
1654
1661
|
exportName: TExportName$1;
|
|
1655
1662
|
}
|
|
1656
1663
|
/**
|
|
1657
|
-
* Binding to a Workflow. `
|
|
1658
|
-
*
|
|
1659
|
-
* class name.
|
|
1664
|
+
* Binding to a Workflow. `name` identifies the Workflow, `worker` is the name
|
|
1665
|
+
* or config of the Worker that defines it, and `exportName` is the exported
|
|
1666
|
+
* `WorkflowEntrypoint` class name.
|
|
1660
1667
|
*/
|
|
1661
1668
|
interface WorkflowBinding<TWorker$1 extends WorkerReference = WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1> = WorkflowExportName<TWorker$1>> extends WorkflowBindingOptions<TWorker$1, TExportName$1> {
|
|
1662
1669
|
type: "workflow";
|
|
@@ -1826,6 +1833,12 @@ interface Bindings {
|
|
|
1826
1833
|
worker<TWorker$1 extends WorkerReference, TExportName$1 extends WorkerEntrypointExportName<TWorker$1> | undefined = undefined>(options: WorkerBindingOptions<TWorker$1, TExportName$1>): WorkerBinding<TWorker$1, NoInfer<TExportName$1>>;
|
|
1827
1834
|
/** Binding to a Worker Loader. */
|
|
1828
1835
|
workerLoader(): WorkerLoaderBinding;
|
|
1836
|
+
/**
|
|
1837
|
+
* Create a Workflow binding.
|
|
1838
|
+
* `worker` may be a Worker config reference or a Worker name.
|
|
1839
|
+
* `exportName` must be a valid `WorkflowEntrypoint` export for the given Worker.
|
|
1840
|
+
*/
|
|
1841
|
+
workflow<TWorker$1 extends WorkerReference, TExportName$1 extends WorkflowExportName<TWorker$1>>(options: WorkflowBindingOptions<TWorker$1, TExportName$1>): WorkflowBinding<TWorker$1, NoInfer<TExportName$1>>;
|
|
1829
1842
|
}
|
|
1830
1843
|
declare const bindings: Bindings;
|
|
1831
1844
|
//#endregion
|