wrangler 4.14.4 → 4.15.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/config-schema.json +44 -0
- package/package.json +9 -9
- package/templates/mixedMode/proxyServerWorker/index.ts +24 -3
- package/wrangler-dist/cli.d.ts +25 -7
- package/wrangler-dist/cli.js +20500 -20305
package/config-schema.json
CHANGED
@@ -321,6 +321,10 @@
|
|
321
321
|
"preview_id": {
|
322
322
|
"type": "string",
|
323
323
|
"description": "The ID of the KV namespace used during `wrangler dev`"
|
324
|
+
},
|
325
|
+
"remote": {
|
326
|
+
"type": "boolean",
|
327
|
+
"description": "Whether the KV namespace should be remote or not (only available under `--x-mixed-mode`)"
|
324
328
|
}
|
325
329
|
},
|
326
330
|
"required": [
|
@@ -379,6 +383,10 @@
|
|
379
383
|
"delivery_delay": {
|
380
384
|
"type": "number",
|
381
385
|
"description": "The number of seconds to wait before delivering a message"
|
386
|
+
},
|
387
|
+
"remote": {
|
388
|
+
"type": "boolean",
|
389
|
+
"description": "Whether the Queue producer should be remote or not (only available under `--x-mixed-mode`)"
|
382
390
|
}
|
383
391
|
},
|
384
392
|
"required": [
|
@@ -469,6 +477,10 @@
|
|
469
477
|
"jurisdiction": {
|
470
478
|
"type": "string",
|
471
479
|
"description": "The jurisdiction that the bucket exists in. Default if not present."
|
480
|
+
},
|
481
|
+
"remote": {
|
482
|
+
"type": "boolean",
|
483
|
+
"description": "Whether the R2 bucket should be remote or not (only available under `--x-mixed-mode`)"
|
472
484
|
}
|
473
485
|
},
|
474
486
|
"required": [
|
@@ -511,6 +523,10 @@
|
|
511
523
|
"database_internal_env": {
|
512
524
|
"type": "string",
|
513
525
|
"description": "Internal use only."
|
526
|
+
},
|
527
|
+
"remote": {
|
528
|
+
"type": "boolean",
|
529
|
+
"description": "Whether the D1 database should be remote or not (only available under `--x-mixed-mode`)"
|
514
530
|
}
|
515
531
|
},
|
516
532
|
"required": [
|
@@ -596,6 +612,10 @@
|
|
596
612
|
"type": "object",
|
597
613
|
"additionalProperties": {},
|
598
614
|
"description": "Optional properties that will be made available to the service via ctx.props."
|
615
|
+
},
|
616
|
+
"remote": {
|
617
|
+
"type": "boolean",
|
618
|
+
"description": "Whether the service binding should be remote or not (only available under `--x-mixed-mode`)"
|
599
619
|
}
|
600
620
|
},
|
601
621
|
"required": [
|
@@ -1258,6 +1278,10 @@
|
|
1258
1278
|
"preview_id": {
|
1259
1279
|
"type": "string",
|
1260
1280
|
"description": "The ID of the KV namespace used during `wrangler dev`"
|
1281
|
+
},
|
1282
|
+
"remote": {
|
1283
|
+
"type": "boolean",
|
1284
|
+
"description": "Whether the KV namespace should be remote or not (only available under `--x-mixed-mode`)"
|
1261
1285
|
}
|
1262
1286
|
},
|
1263
1287
|
"required": [
|
@@ -1316,6 +1340,10 @@
|
|
1316
1340
|
"delivery_delay": {
|
1317
1341
|
"type": "number",
|
1318
1342
|
"description": "The number of seconds to wait before delivering a message"
|
1343
|
+
},
|
1344
|
+
"remote": {
|
1345
|
+
"type": "boolean",
|
1346
|
+
"description": "Whether the Queue producer should be remote or not (only available under `--x-mixed-mode`)"
|
1319
1347
|
}
|
1320
1348
|
},
|
1321
1349
|
"required": [
|
@@ -1406,6 +1434,10 @@
|
|
1406
1434
|
"jurisdiction": {
|
1407
1435
|
"type": "string",
|
1408
1436
|
"description": "The jurisdiction that the bucket exists in. Default if not present."
|
1437
|
+
},
|
1438
|
+
"remote": {
|
1439
|
+
"type": "boolean",
|
1440
|
+
"description": "Whether the R2 bucket should be remote or not (only available under `--x-mixed-mode`)"
|
1409
1441
|
}
|
1410
1442
|
},
|
1411
1443
|
"required": [
|
@@ -1448,6 +1480,10 @@
|
|
1448
1480
|
"database_internal_env": {
|
1449
1481
|
"type": "string",
|
1450
1482
|
"description": "Internal use only."
|
1483
|
+
},
|
1484
|
+
"remote": {
|
1485
|
+
"type": "boolean",
|
1486
|
+
"description": "Whether the D1 database should be remote or not (only available under `--x-mixed-mode`)"
|
1451
1487
|
}
|
1452
1488
|
},
|
1453
1489
|
"required": [
|
@@ -1533,6 +1569,10 @@
|
|
1533
1569
|
"type": "object",
|
1534
1570
|
"additionalProperties": {},
|
1535
1571
|
"description": "Optional properties that will be made available to the service via ctx.props."
|
1572
|
+
},
|
1573
|
+
"remote": {
|
1574
|
+
"type": "boolean",
|
1575
|
+
"description": "Whether the service binding should be remote or not (only available under `--x-mixed-mode`)"
|
1536
1576
|
}
|
1537
1577
|
},
|
1538
1578
|
"required": [
|
@@ -2125,6 +2165,10 @@
|
|
2125
2165
|
"script_name": {
|
2126
2166
|
"type": "string",
|
2127
2167
|
"description": "The script where the Workflow is defined (if it's external to this Worker)"
|
2168
|
+
},
|
2169
|
+
"remote": {
|
2170
|
+
"type": "boolean",
|
2171
|
+
"description": "Whether the Workflow should be remote or not (only available under `--x-mixed-mode`)"
|
2128
2172
|
}
|
2129
2173
|
},
|
2130
2174
|
"required": [
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.
|
3
|
+
"version": "4.15.0",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -55,14 +55,14 @@
|
|
55
55
|
"esbuild": "0.25.4",
|
56
56
|
"path-to-regexp": "6.3.0",
|
57
57
|
"unenv": "2.0.0-rc.15",
|
58
|
-
"workerd": "1.
|
59
|
-
"
|
60
|
-
"
|
58
|
+
"workerd": "1.20250508.0",
|
59
|
+
"@cloudflare/kv-asset-handler": "0.4.0",
|
60
|
+
"miniflare": "4.20250508.0"
|
61
61
|
},
|
62
62
|
"devDependencies": {
|
63
63
|
"@aws-sdk/client-s3": "^3.721.0",
|
64
64
|
"@cloudflare/types": "6.18.4",
|
65
|
-
"@cloudflare/workers-types": "^4.
|
65
|
+
"@cloudflare/workers-types": "^4.20250508.0",
|
66
66
|
"@cspotcode/source-map-support": "0.8.1",
|
67
67
|
"@iarna/toml": "^3.0.0",
|
68
68
|
"@microsoft/api-extractor": "^7.47.0",
|
@@ -135,14 +135,14 @@
|
|
135
135
|
"xdg-app-paths": "^8.3.0",
|
136
136
|
"xxhash-wasm": "^1.0.1",
|
137
137
|
"yargs": "^17.7.2",
|
138
|
-
"@cloudflare/cli": "1.1.1",
|
139
138
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
140
|
-
"@cloudflare/pages-shared": "^0.13.36",
|
141
139
|
"@cloudflare/workers-shared": "0.17.5",
|
142
|
-
"@cloudflare/workers-tsconfig": "0.0.0"
|
140
|
+
"@cloudflare/workers-tsconfig": "0.0.0",
|
141
|
+
"@cloudflare/pages-shared": "^0.13.37",
|
142
|
+
"@cloudflare/cli": "1.1.1"
|
143
143
|
},
|
144
144
|
"peerDependencies": {
|
145
|
-
"@cloudflare/workers-types": "^4.
|
145
|
+
"@cloudflare/workers-types": "^4.20250508.0"
|
146
146
|
},
|
147
147
|
"peerDependenciesMeta": {
|
148
148
|
"@cloudflare/workers-types": {
|
@@ -1,5 +1,26 @@
|
|
1
1
|
export default {
|
2
|
-
fetch() {
|
3
|
-
|
2
|
+
async fetch(request, env) {
|
3
|
+
const targetBinding = request.headers.get("MF-Binding");
|
4
|
+
|
5
|
+
if (targetBinding) {
|
6
|
+
const originalHeaders = new Headers();
|
7
|
+
for (const [name, value] of request.headers) {
|
8
|
+
if (name.startsWith("mf-header-")) {
|
9
|
+
originalHeaders.set(name.slice("mf-header-".length), value);
|
10
|
+
} else if (name === "upgrade") {
|
11
|
+
// The `Upgrade` header needs to be special-cased to prevent:
|
12
|
+
// TypeError: Worker tried to return a WebSocket in a response to a request which did not contain the header "Upgrade: websocket"
|
13
|
+
originalHeaders.set(name, value);
|
14
|
+
}
|
15
|
+
}
|
16
|
+
return env[targetBinding].fetch(
|
17
|
+
request.headers.get("MF-URL")!,
|
18
|
+
new Request(request, {
|
19
|
+
redirect: "manual",
|
20
|
+
headers: originalHeaders,
|
21
|
+
})
|
22
|
+
);
|
23
|
+
}
|
24
|
+
return new Response("Provide a binding", { status: 400 });
|
4
25
|
},
|
5
|
-
}
|
26
|
+
} satisfies ExportedHandler<Record<string, Fetcher>>;
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -13,6 +13,7 @@ import type { MessagePort as MessagePort_2 } from 'worker_threads';
|
|
13
13
|
import type { Metafile } from 'esbuild';
|
14
14
|
import { Miniflare } from 'miniflare';
|
15
15
|
import type { MiniflareOptions } from 'miniflare';
|
16
|
+
import type { MixedModeConnectionString } from 'miniflare';
|
16
17
|
import type { ModuleRule } from 'miniflare';
|
17
18
|
import { Mutex } from 'miniflare';
|
18
19
|
import type { NodeJSCompatMode } from 'miniflare';
|
@@ -30,8 +31,6 @@ import type { WorkerOptions } from 'miniflare';
|
|
30
31
|
import { Writable } from 'stream';
|
31
32
|
import { z } from 'zod';
|
32
33
|
|
33
|
-
declare const __brand: unique symbol;
|
34
|
-
|
35
34
|
declare type AbortSignal_2 = unknown;
|
36
35
|
|
37
36
|
declare interface AddEventListenerOptions extends EventListenerOptions {
|
@@ -588,6 +587,7 @@ declare interface CfD1Database {
|
|
588
587
|
database_internal_env?: string;
|
589
588
|
migrations_table?: string;
|
590
589
|
migrations_dir?: string;
|
590
|
+
remote?: boolean;
|
591
591
|
}
|
592
592
|
|
593
593
|
declare interface CfDispatchNamespace {
|
@@ -622,6 +622,7 @@ declare interface CfHyperdrive {
|
|
622
622
|
declare interface CfKvNamespace {
|
623
623
|
binding: string;
|
624
624
|
id?: string | typeof INHERIT_SYMBOL;
|
625
|
+
remote?: boolean;
|
625
626
|
}
|
626
627
|
|
627
628
|
declare interface CfLogfwdrBinding {
|
@@ -693,12 +694,14 @@ declare interface CfQueue {
|
|
693
694
|
binding: string;
|
694
695
|
queue_name: string;
|
695
696
|
delivery_delay?: number;
|
697
|
+
remote?: boolean;
|
696
698
|
}
|
697
699
|
|
698
700
|
declare interface CfR2Bucket {
|
699
701
|
binding: string;
|
700
702
|
bucket_name?: string | typeof INHERIT_SYMBOL;
|
701
703
|
jurisdiction?: string;
|
704
|
+
remote?: boolean;
|
702
705
|
}
|
703
706
|
|
704
707
|
/**
|
@@ -729,6 +732,7 @@ declare interface CfService {
|
|
729
732
|
environment?: string;
|
730
733
|
entrypoint?: string;
|
731
734
|
props?: Record<string, unknown>;
|
735
|
+
remote?: boolean;
|
732
736
|
}
|
733
737
|
|
734
738
|
declare interface CfTailConsumer {
|
@@ -785,6 +789,7 @@ declare interface CfWorkflow {
|
|
785
789
|
class_name: string;
|
786
790
|
binding: string;
|
787
791
|
script_name?: string;
|
792
|
+
remote?: boolean;
|
788
793
|
}
|
789
794
|
|
790
795
|
/**
|
@@ -2010,6 +2015,8 @@ declare interface EnvironmentNonInheritable {
|
|
2010
2015
|
id?: string;
|
2011
2016
|
/** The ID of the KV namespace used during `wrangler dev` */
|
2012
2017
|
preview_id?: string;
|
2018
|
+
/** Whether the KV namespace should be remote or not (only available under `--x-mixed-mode`) */
|
2019
|
+
remote?: boolean;
|
2013
2020
|
}[];
|
2014
2021
|
/**
|
2015
2022
|
* These specify bindings to send email from inside your Worker.
|
@@ -2046,6 +2053,8 @@ declare interface EnvironmentNonInheritable {
|
|
2046
2053
|
queue: string;
|
2047
2054
|
/** The number of seconds to wait before delivering a message */
|
2048
2055
|
delivery_delay?: number;
|
2056
|
+
/** Whether the Queue producer should be remote or not (only available under `--x-mixed-mode`) */
|
2057
|
+
remote?: boolean;
|
2049
2058
|
}[];
|
2050
2059
|
/** Consumer configuration */
|
2051
2060
|
consumers?: {
|
@@ -2087,6 +2096,8 @@ declare interface EnvironmentNonInheritable {
|
|
2087
2096
|
preview_bucket_name?: string;
|
2088
2097
|
/** The jurisdiction that the bucket exists in. Default if not present. */
|
2089
2098
|
jurisdiction?: string;
|
2099
|
+
/** Whether the R2 bucket should be remote or not (only available under `--x-mixed-mode`) */
|
2100
|
+
remote?: boolean;
|
2090
2101
|
}[];
|
2091
2102
|
/**
|
2092
2103
|
* Specifies D1 databases that are bound to this Worker environment.
|
@@ -2112,6 +2123,8 @@ declare interface EnvironmentNonInheritable {
|
|
2112
2123
|
migrations_dir?: string;
|
2113
2124
|
/** Internal use only. */
|
2114
2125
|
database_internal_env?: string;
|
2126
|
+
/** Whether the D1 database should be remote or not (only available under `--x-mixed-mode`) */
|
2127
|
+
remote?: boolean;
|
2115
2128
|
}[];
|
2116
2129
|
/**
|
2117
2130
|
* Specifies Vectorize indexes that are bound to this Worker environment.
|
@@ -2165,6 +2178,8 @@ declare interface EnvironmentNonInheritable {
|
|
2165
2178
|
entrypoint?: string;
|
2166
2179
|
/** Optional properties that will be made available to the service via ctx.props. */
|
2167
2180
|
props?: Record<string, unknown>;
|
2181
|
+
/** Whether the service binding should be remote or not (only available under `--x-mixed-mode`) */
|
2182
|
+
remote?: boolean;
|
2168
2183
|
}[] | undefined;
|
2169
2184
|
/**
|
2170
2185
|
* Specifies analytics engine datasets that are bound to this Worker environment.
|
@@ -2557,7 +2572,9 @@ export declare const experimental_readRawConfig: (args: ReadConfigCommandArgs, o
|
|
2557
2572
|
userConfigPath: string | undefined;
|
2558
2573
|
};
|
2559
2574
|
|
2560
|
-
export declare function experimental_startMixedModeSession(bindings: BindingsOpt
|
2575
|
+
export declare function experimental_startMixedModeSession(bindings: BindingsOpt, options?: {
|
2576
|
+
auth: NonNullable<StartDevWorkerInput["dev"]>["auth"];
|
2577
|
+
}): Promise<MixedModeSession>;
|
2561
2578
|
|
2562
2579
|
declare function fetch_2 (
|
2563
2580
|
input: RequestInfo,
|
@@ -2932,10 +2949,6 @@ declare interface MIMEType {
|
|
2932
2949
|
|
2933
2950
|
declare type MiniflareWorker = Awaited<ReturnType<Miniflare["getWorker"]>>;
|
2934
2951
|
|
2935
|
-
declare type MixedModeConnectionString = Awaited<Worker["url"]> & {
|
2936
|
-
[__brand]: "MixedModeConnectionString";
|
2937
|
-
};
|
2938
|
-
|
2939
2952
|
declare type MixedModeSession = Pick<Worker, "ready" | "dispose"> & {
|
2940
2953
|
["setConfig"]: (bindings: BindingsOpt) => Promise<void>;
|
2941
2954
|
["mixedModeConnectionString"]: MixedModeConnectionString;
|
@@ -26535,6 +26548,7 @@ export declare interface Unstable_DevOptions {
|
|
26535
26548
|
binding: string;
|
26536
26549
|
id?: string;
|
26537
26550
|
preview_id?: string;
|
26551
|
+
remote?: boolean;
|
26538
26552
|
}[];
|
26539
26553
|
durableObjects?: {
|
26540
26554
|
name: string;
|
@@ -26547,11 +26561,13 @@ export declare interface Unstable_DevOptions {
|
|
26547
26561
|
service: string;
|
26548
26562
|
environment?: string | undefined;
|
26549
26563
|
entrypoint?: string | undefined;
|
26564
|
+
remote?: boolean;
|
26550
26565
|
}[];
|
26551
26566
|
r2?: {
|
26552
26567
|
binding: string;
|
26553
26568
|
bucket_name?: string;
|
26554
26569
|
preview_bucket_name?: string;
|
26570
|
+
remote?: boolean;
|
26555
26571
|
}[];
|
26556
26572
|
ai?: {
|
26557
26573
|
binding: string;
|
@@ -26766,6 +26782,8 @@ declare type WorkflowBinding = {
|
|
26766
26782
|
class_name: string;
|
26767
26783
|
/** The script where the Workflow is defined (if it's external to this Worker) */
|
26768
26784
|
script_name?: string;
|
26785
|
+
/** Whether the Workflow should be remote or not (only available under `--x-mixed-mode`) */
|
26786
|
+
remote?: boolean;
|
26769
26787
|
};
|
26770
26788
|
|
26771
26789
|
declare type ZoneIdRoute = {
|