wrangler 4.19.0 → 4.19.2
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 +17 -0
- package/package.json +7 -7
- package/wrangler-dist/cli.d.ts +20 -0
- package/wrangler-dist/cli.js +203 -62
- package/wrangler-dist/metafile-cjs.json +1 -1
package/config-schema.json
CHANGED
@@ -2335,6 +2335,18 @@
|
|
2335
2335
|
],
|
2336
2336
|
"additionalProperties": false
|
2337
2337
|
}
|
2338
|
+
},
|
2339
|
+
"disk": {
|
2340
|
+
"type": "object",
|
2341
|
+
"properties": {
|
2342
|
+
"size": {
|
2343
|
+
"type": "string"
|
2344
|
+
}
|
2345
|
+
},
|
2346
|
+
"required": [
|
2347
|
+
"size"
|
2348
|
+
],
|
2349
|
+
"additionalProperties": false
|
2338
2350
|
}
|
2339
2351
|
},
|
2340
2352
|
"required": [
|
@@ -2485,6 +2497,11 @@
|
|
2485
2497
|
"host": {
|
2486
2498
|
"type": "string",
|
2487
2499
|
"description": "Host to forward requests to, defaults to the host of the first route of project"
|
2500
|
+
},
|
2501
|
+
"enable_containers": {
|
2502
|
+
"type": "boolean",
|
2503
|
+
"description": "When developing, whether to build and connect to containers. This requires a Docker daemon to be running. Defaults to `true`.",
|
2504
|
+
"default": true
|
2488
2505
|
}
|
2489
2506
|
},
|
2490
2507
|
"additionalProperties": false
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.19.
|
3
|
+
"version": "4.19.2",
|
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.17",
|
58
|
-
"workerd": "1.
|
58
|
+
"workerd": "1.20250604.0",
|
59
59
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
60
|
-
"miniflare": "4.
|
60
|
+
"miniflare": "4.20250604.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.20250604.0",
|
66
66
|
"@cspotcode/source-map-support": "0.8.1",
|
67
67
|
"@iarna/toml": "^3.0.0",
|
68
68
|
"@sentry/node": "^7.86.0",
|
@@ -137,12 +137,12 @@
|
|
137
137
|
"yargs": "^17.7.2",
|
138
138
|
"@cloudflare/cli": "1.1.1",
|
139
139
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
140
|
-
"@cloudflare/pages-shared": "^0.13.
|
141
|
-
"@cloudflare/workers-shared": "0.17.
|
140
|
+
"@cloudflare/pages-shared": "^0.13.44",
|
141
|
+
"@cloudflare/workers-shared": "0.17.6",
|
142
142
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
143
143
|
},
|
144
144
|
"peerDependencies": {
|
145
|
-
"@cloudflare/workers-types": "^4.
|
145
|
+
"@cloudflare/workers-types": "^4.20250604.0"
|
146
146
|
},
|
147
147
|
"peerDependenciesMeta": {
|
148
148
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.d.ts
CHANGED
@@ -78,6 +78,9 @@ type ContainerApp = {
|
|
78
78
|
type: "env";
|
79
79
|
secret: string;
|
80
80
|
}[];
|
81
|
+
disk?: {
|
82
|
+
size: string;
|
83
|
+
};
|
81
84
|
};
|
82
85
|
/** Scheduling constraints */
|
83
86
|
constraints?: {
|
@@ -1162,6 +1165,14 @@ interface DevConfig {
|
|
1162
1165
|
* Host to forward requests to, defaults to the host of the first route of project
|
1163
1166
|
*/
|
1164
1167
|
host: string | undefined;
|
1168
|
+
/**
|
1169
|
+
* When developing, whether to build and connect to containers. This requires a Docker daemon to be running.
|
1170
|
+
* Defaults to `true`.
|
1171
|
+
*
|
1172
|
+
* @inheritable
|
1173
|
+
* @default true
|
1174
|
+
*/
|
1175
|
+
enable_containers: boolean;
|
1165
1176
|
}
|
1166
1177
|
type RawDevConfig = Partial<DevConfig>;
|
1167
1178
|
interface EnvironmentMap {
|
@@ -1195,6 +1206,7 @@ type NormalizeAndValidateConfigArgs = {
|
|
1195
1206
|
localProtocol?: string;
|
1196
1207
|
upstreamProtocol?: string;
|
1197
1208
|
script?: string;
|
1209
|
+
enableContainers?: boolean;
|
1198
1210
|
};
|
1199
1211
|
|
1200
1212
|
type ReadConfigCommandArgs = NormalizeAndValidateConfigArgs & {
|
@@ -1514,6 +1526,8 @@ interface Unstable_DevOptions {
|
|
1514
1526
|
vectorizeBindToProd?: boolean;
|
1515
1527
|
imagesLocalMode?: boolean;
|
1516
1528
|
enableIpc?: boolean;
|
1529
|
+
enableContainers?: boolean;
|
1530
|
+
dockerPath?: string;
|
1517
1531
|
};
|
1518
1532
|
}
|
1519
1533
|
interface Unstable_DevWorker {
|
@@ -1898,6 +1912,12 @@ interface StartDevWorkerInput {
|
|
1898
1912
|
imagesLocalMode?: boolean;
|
1899
1913
|
/** Treat this as the primary worker in a multiworker setup (i.e. the first Worker in Miniflare's options) */
|
1900
1914
|
multiworkerPrimary?: boolean;
|
1915
|
+
/** Whether the experimental mixed mode feature should be enabled */
|
1916
|
+
experimentalMixedMode?: boolean;
|
1917
|
+
/** Whether to build and connect to containers during local dev. Requires Docker daemon to be running. Defaults to true. */
|
1918
|
+
enableContainers?: boolean;
|
1919
|
+
/** Path to the docker executable. Defaults to 'docker' */
|
1920
|
+
dockerPath?: string;
|
1901
1921
|
};
|
1902
1922
|
legacy?: {
|
1903
1923
|
site?: Hook<Config["site"], [Config]>;
|
package/wrangler-dist/cli.js
CHANGED
@@ -26901,7 +26901,7 @@ var name, version;
|
|
26901
26901
|
var init_package = __esm({
|
26902
26902
|
"package.json"() {
|
26903
26903
|
name = "wrangler";
|
26904
|
-
version = "4.19.
|
26904
|
+
version = "4.19.2";
|
26905
26905
|
}
|
26906
26906
|
});
|
26907
26907
|
|
@@ -30778,7 +30778,7 @@ var init_lib4 = __esm({
|
|
30778
30778
|
});
|
30779
30779
|
|
30780
30780
|
// ../workers-shared/utils/types.ts
|
30781
|
-
var InternalConfigSchema, RouterConfigSchema, MetadataStaticRedirectEntry, MetadataRedirectEntry, MetadataStaticRedirects, MetadataRedirects, MetadataHeaderEntry, MetadataHeaders, RedirectsSchema, HeadersSchema, AssetConfigSchema;
|
30781
|
+
var InternalConfigSchema, StaticRoutingSchema, RouterConfigSchema, MetadataStaticRedirectEntry, MetadataRedirectEntry, MetadataStaticRedirects, MetadataRedirects, MetadataHeaderEntry, MetadataHeaders, RedirectsSchema, HeadersSchema, AssetConfigSchema;
|
30782
30782
|
var init_types = __esm({
|
30783
30783
|
"../workers-shared/utils/types.ts"() {
|
30784
30784
|
init_import_meta_url();
|
@@ -30788,8 +30788,13 @@ var init_types = __esm({
|
|
30788
30788
|
script_id: z.number().optional(),
|
30789
30789
|
debug: z.boolean().optional()
|
30790
30790
|
});
|
30791
|
+
StaticRoutingSchema = z.object({
|
30792
|
+
user_worker: z.array(z.string()),
|
30793
|
+
asset_worker: z.array(z.string()).optional()
|
30794
|
+
});
|
30791
30795
|
RouterConfigSchema = z.object({
|
30792
30796
|
invoke_user_worker_ahead_of_assets: z.boolean().optional(),
|
30797
|
+
static_routing: StaticRoutingSchema.optional(),
|
30793
30798
|
has_user_worker: z.boolean().optional(),
|
30794
30799
|
...InternalConfigSchema.shape
|
30795
30800
|
});
|
@@ -30830,6 +30835,7 @@ var init_types = __esm({
|
|
30830
30835
|
not_found_handling: z.enum(["single-page-application", "404-page", "none"]).optional(),
|
30831
30836
|
redirects: RedirectsSchema,
|
30832
30837
|
headers: HeadersSchema,
|
30838
|
+
has_static_routing: z.boolean().optional(),
|
30833
30839
|
...InternalConfigSchema.shape
|
30834
30840
|
});
|
30835
30841
|
}
|
@@ -35120,7 +35126,8 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
35120
35126
|
const {
|
35121
35127
|
localProtocol: localProtocolArg,
|
35122
35128
|
upstreamProtocol: upstreamProtocolArg,
|
35123
|
-
remote: remoteArg
|
35129
|
+
remote: remoteArg,
|
35130
|
+
enableContainers: enableContainersArg
|
35124
35131
|
} = args;
|
35125
35132
|
(0, import_node_assert.default)(
|
35126
35133
|
localProtocolArg === void 0 || localProtocolArg === "http" || localProtocolArg === "https"
|
@@ -35129,6 +35136,9 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
35129
35136
|
upstreamProtocolArg === void 0 || upstreamProtocolArg === "http" || upstreamProtocolArg === "https"
|
35130
35137
|
);
|
35131
35138
|
(0, import_node_assert.default)(remoteArg === void 0 || typeof remoteArg === "boolean");
|
35139
|
+
(0, import_node_assert.default)(
|
35140
|
+
enableContainersArg === void 0 || typeof enableContainersArg === "boolean"
|
35141
|
+
);
|
35132
35142
|
const {
|
35133
35143
|
// On Windows, when specifying `localhost` as the socket hostname, `workerd`
|
35134
35144
|
// will only listen on the IPv4 loopback `127.0.0.1`, not the IPv6 `::1`:
|
@@ -35144,6 +35154,7 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
35144
35154
|
// In remote mode upstream_protocol must be https, otherwise it defaults to local_protocol.
|
35145
35155
|
upstream_protocol = upstreamProtocolArg ?? remoteArg ? "https" : local_protocol,
|
35146
35156
|
host,
|
35157
|
+
enable_containers = enableContainersArg ?? true,
|
35147
35158
|
...rest
|
35148
35159
|
} = rawDev;
|
35149
35160
|
validateAdditionalProperties(diagnostics, "dev", Object.keys(rest), []);
|
@@ -35173,7 +35184,22 @@ function normalizeAndValidateDev(diagnostics, rawDev, args) {
|
|
35173
35184
|
["http", "https"]
|
35174
35185
|
);
|
35175
35186
|
validateOptionalProperty(diagnostics, "dev", "host", host, "string");
|
35176
|
-
|
35187
|
+
validateOptionalProperty(
|
35188
|
+
diagnostics,
|
35189
|
+
"dev",
|
35190
|
+
"enable_containers",
|
35191
|
+
enable_containers,
|
35192
|
+
"boolean"
|
35193
|
+
);
|
35194
|
+
return {
|
35195
|
+
ip,
|
35196
|
+
port,
|
35197
|
+
inspector_port,
|
35198
|
+
local_protocol,
|
35199
|
+
upstream_protocol,
|
35200
|
+
host,
|
35201
|
+
enable_containers
|
35202
|
+
};
|
35177
35203
|
}
|
35178
35204
|
function normalizeAndValidateAssets(diagnostics, topLevelEnv, rawEnv) {
|
35179
35205
|
return inheritable(
|
@@ -37703,7 +37729,9 @@ var init_config = __esm({
|
|
37703
37729
|
// the default of 9229 is set at runtime
|
37704
37730
|
local_protocol: "http",
|
37705
37731
|
upstream_protocol: "http",
|
37706
|
-
host: void 0
|
37732
|
+
host: void 0,
|
37733
|
+
// Note this one is also workers only
|
37734
|
+
enable_containers: true
|
37707
37735
|
},
|
37708
37736
|
/** INHERITABLE ENVIRONMENT FIELDS **/
|
37709
37737
|
name: void 0,
|
@@ -51962,6 +51990,8 @@ async function buildMiniflareOptions(log2, config, proxyToUserWorkerAuthenticati
|
|
51962
51990
|
// Instead of hiding all logs from this Miniflare instance, we specifically hide the request logs,
|
51963
51991
|
// allowing other logs to be shown to the user (such as details about emails being triggered)
|
51964
51992
|
logRequests: false,
|
51993
|
+
dockerPath: config.dockerPath,
|
51994
|
+
enableContainers: config.enableContainers,
|
51965
51995
|
log: log2,
|
51966
51996
|
verbose: logger.loggerLevel === "debug",
|
51967
51997
|
handleRuntimeStdio,
|
@@ -59311,6 +59341,13 @@ function resolveMemory(args, config) {
|
|
59311
59341
|
}
|
59312
59342
|
return void 0;
|
59313
59343
|
}
|
59344
|
+
function resolveAppDiskSize(account, app) {
|
59345
|
+
if (app === void 0) {
|
59346
|
+
return void 0;
|
59347
|
+
}
|
59348
|
+
const disk = app.configuration.disk?.size ?? "2GB";
|
59349
|
+
return Math.round(parseByteSize(disk));
|
59350
|
+
}
|
59314
59351
|
var import_promises12, imageRe;
|
59315
59352
|
var init_common = __esm({
|
59316
59353
|
"src/cloudchamber/common.ts"() {
|
@@ -59359,6 +59396,7 @@ var init_common = __esm({
|
|
59359
59396
|
__name(collectLabels, "collectLabels");
|
59360
59397
|
__name(promptForLabels, "promptForLabels");
|
59361
59398
|
__name(resolveMemory, "resolveMemory");
|
59399
|
+
__name(resolveAppDiskSize, "resolveAppDiskSize");
|
59362
59400
|
}
|
59363
59401
|
});
|
59364
59402
|
|
@@ -60125,6 +60163,9 @@ var init_apply = __esm({
|
|
60125
60163
|
});
|
60126
60164
|
|
60127
60165
|
// src/cloudchamber/build.ts
|
60166
|
+
function getDefaultRegistry() {
|
60167
|
+
return domain;
|
60168
|
+
}
|
60128
60169
|
async function dockerLoginManagedRegistry(options) {
|
60129
60170
|
const dockerPath = options.pathToDocker ?? "docker";
|
60130
60171
|
const expirationMinutes = 15;
|
@@ -60182,7 +60223,7 @@ function dockerBuild(options) {
|
|
60182
60223
|
const buildExec = options.buildCmd.split(" ").shift();
|
60183
60224
|
const child = (0, import_child_process2.spawn)(String(buildExec), buildCmd, {
|
60184
60225
|
stdio: [
|
60185
|
-
options.dockerfile !== void 0 ? "pipe" :
|
60226
|
+
options.dockerfile !== void 0 ? "pipe" : "inherit",
|
60186
60227
|
"inherit",
|
60187
60228
|
"inherit"
|
60188
60229
|
]
|
@@ -60289,6 +60330,18 @@ async function build(args) {
|
|
60289
60330
|
args: args.args
|
60290
60331
|
});
|
60291
60332
|
await dockerBuild({ buildCmd: bc2, dockerfile: args.dockerfileContents });
|
60333
|
+
const account = await loadAccount();
|
60334
|
+
const { size, layers } = await runDockerInspect(
|
60335
|
+
getDefaultRegistry() + "/" + args.tag,
|
60336
|
+
args.pathToDocker ?? "docker"
|
60337
|
+
);
|
60338
|
+
const MiB = 1024 * 1024;
|
60339
|
+
const requiredSize = Math.ceil(size * 1.1 + layers * 16 * MiB);
|
60340
|
+
await ensureDiskLimits({
|
60341
|
+
requiredSize,
|
60342
|
+
account,
|
60343
|
+
containerApp: args.container
|
60344
|
+
});
|
60292
60345
|
if (args.push) {
|
60293
60346
|
await dockerLoginManagedRegistry({
|
60294
60347
|
pathToDocker: args.pathToDocker
|
@@ -60303,13 +60356,17 @@ async function build(args) {
|
|
60303
60356
|
throw new UserError("An unknown error occurred");
|
60304
60357
|
}
|
60305
60358
|
}
|
60306
|
-
async function buildCommand(args,
|
60307
|
-
|
60308
|
-
|
60309
|
-
|
60310
|
-
|
60311
|
-
|
60312
|
-
|
60359
|
+
async function buildCommand(args, config) {
|
60360
|
+
const containers2 = config.containers ?? [void 0];
|
60361
|
+
for (const container of containers2.length > 0 ? containers2 : [void 0]) {
|
60362
|
+
await build({
|
60363
|
+
container,
|
60364
|
+
tag: args.tag,
|
60365
|
+
pathToDockerfileDirectory: args.PATH,
|
60366
|
+
pathToDocker: args.pathToDocker,
|
60367
|
+
push: args.push
|
60368
|
+
});
|
60369
|
+
}
|
60313
60370
|
}
|
60314
60371
|
async function pushCommand(args, _4) {
|
60315
60372
|
try {
|
@@ -60325,6 +60382,57 @@ async function pushCommand(args, _4) {
|
|
60325
60382
|
throw new UserError("An unknown error occurred");
|
60326
60383
|
}
|
60327
60384
|
}
|
60385
|
+
async function ensureDiskLimits(options) {
|
60386
|
+
const MB = 1e3 * 1e3;
|
60387
|
+
const MiB = 1024 * 1024;
|
60388
|
+
const appDiskSize = resolveAppDiskSize(options.account, options.containerApp);
|
60389
|
+
const accountDiskSize = (options.account.limits.disk_mb_per_deployment ?? 2e3) * MB;
|
60390
|
+
if (appDiskSize && appDiskSize > accountDiskSize) {
|
60391
|
+
throw new UserError(
|
60392
|
+
`Exceeded account limits: Your container is configured to use a disk size of ${appDiskSize / MB} MB. However, that exceeds the account limit of ${accountDiskSize / MB}`
|
60393
|
+
);
|
60394
|
+
}
|
60395
|
+
const maxAllowedImageSizeBytes = appDiskSize ?? accountDiskSize;
|
60396
|
+
logger.debug(
|
60397
|
+
`Disk size limits when building the container: appDiskSize:${appDiskSize}, accountDiskSize:${accountDiskSize}, maxAllowedImageSizeBytes=${maxAllowedImageSizeBytes}(${maxAllowedImageSizeBytes / MB} MB), requiredSized=${options.requiredSize}(${Math.ceil(options.requiredSize / MiB)}MiB)`
|
60398
|
+
);
|
60399
|
+
if (maxAllowedImageSizeBytes < options.requiredSize) {
|
60400
|
+
throw new UserError(
|
60401
|
+
`Image too large: needs ${Math.ceil(options.requiredSize / MB)} MB, but your app is limited to images with size ${maxAllowedImageSizeBytes / MB} MB. Your account needs more disk size per instance to run this container. The default disk size is 2GB.`
|
60402
|
+
);
|
60403
|
+
}
|
60404
|
+
}
|
60405
|
+
async function runDockerInspect(image, dockerPath) {
|
60406
|
+
return new Promise((resolve24, reject) => {
|
60407
|
+
const proc = (0, import_child_process2.spawn)(
|
60408
|
+
dockerPath,
|
60409
|
+
[
|
60410
|
+
"image",
|
60411
|
+
"inspect",
|
60412
|
+
image,
|
60413
|
+
"--format",
|
60414
|
+
"{{ .Size }} {{ len .RootFS.Layers }}"
|
60415
|
+
],
|
60416
|
+
{
|
60417
|
+
stdio: ["ignore", "pipe", "pipe"]
|
60418
|
+
}
|
60419
|
+
);
|
60420
|
+
let stdout2 = "";
|
60421
|
+
let stderr2 = "";
|
60422
|
+
proc.stdout.on("data", (chunk) => stdout2 += chunk);
|
60423
|
+
proc.stderr.on("data", (chunk) => stderr2 += chunk);
|
60424
|
+
proc.on("close", (code) => {
|
60425
|
+
if (code !== 0) {
|
60426
|
+
return reject(
|
60427
|
+
new Error(`failed inspecting image locally: ${stderr2.trim()}`)
|
60428
|
+
);
|
60429
|
+
}
|
60430
|
+
const [sizeStr, layerStr] = stdout2.trim().split(" ");
|
60431
|
+
resolve24({ size: parseInt(sizeStr, 10), layers: parseInt(layerStr, 10) });
|
60432
|
+
});
|
60433
|
+
proc.on("error", (err) => reject(err));
|
60434
|
+
});
|
60435
|
+
}
|
60328
60436
|
var import_child_process2, import_promises13, domain;
|
60329
60437
|
var init_build = __esm({
|
60330
60438
|
"src/cloudchamber/build.ts"() {
|
@@ -60333,8 +60441,12 @@ var init_build = __esm({
|
|
60333
60441
|
import_promises13 = require("fs/promises");
|
60334
60442
|
init_misc_variables();
|
60335
60443
|
init_errors();
|
60444
|
+
init_logger();
|
60336
60445
|
init_client2();
|
60446
|
+
init_common();
|
60447
|
+
init_locations();
|
60337
60448
|
domain = "registry.cloudchamber.cfdata.org";
|
60449
|
+
__name(getDefaultRegistry, "getDefaultRegistry");
|
60338
60450
|
__name(dockerLoginManagedRegistry, "dockerLoginManagedRegistry");
|
60339
60451
|
__name(constructBuildCommand, "constructBuildCommand");
|
60340
60452
|
__name(dockerBuild, "dockerBuild");
|
@@ -60346,6 +60458,8 @@ var init_build = __esm({
|
|
60346
60458
|
__name(build, "build");
|
60347
60459
|
__name(buildCommand, "buildCommand");
|
60348
60460
|
__name(pushCommand, "pushCommand");
|
60461
|
+
__name(ensureDiskLimits, "ensureDiskLimits");
|
60462
|
+
__name(runDockerInspect, "runDockerInspect");
|
60349
60463
|
}
|
60350
60464
|
});
|
60351
60465
|
|
@@ -60459,7 +60573,8 @@ function getBuildArguments(container, idForImageTag, dryRun) {
|
|
60459
60573
|
push: !dryRun,
|
60460
60574
|
dockerfileContents: dockerfile,
|
60461
60575
|
isDockerImage: true,
|
60462
|
-
args: container.image_vars
|
60576
|
+
args: container.image_vars,
|
60577
|
+
container
|
60463
60578
|
};
|
60464
60579
|
return buildOptions;
|
60465
60580
|
}
|
@@ -77547,7 +77662,7 @@ var init_supports_color2 = __esm({
|
|
77547
77662
|
|
77548
77663
|
// src/wrangler-banner.ts
|
77549
77664
|
async function printWranglerBanner(performUpdateCheck = true) {
|
77550
|
-
let text = ` \u26C5\uFE0F wrangler ${version}`;
|
77665
|
+
let text = typeof WRANGLER_PRERELEASE_LABEL === "undefined" ? ` \u26C5\uFE0F wrangler ${version}` : ` \u26C5\uFE0F wrangler ${version} (${source_default.blue(WRANGLER_PRERELEASE_LABEL)})`;
|
77551
77666
|
let maybeNewVersion;
|
77552
77667
|
if (performUpdateCheck) {
|
77553
77668
|
maybeNewVersion = await updateCheck();
|
@@ -80754,7 +80869,7 @@ var init_deploy3 = __esm({
|
|
80754
80869
|
coerce: /* @__PURE__ */ __name((v7) => !v7 ? true : v7, "coerce")
|
80755
80870
|
},
|
80756
80871
|
"keep-vars": {
|
80757
|
-
describe: "
|
80872
|
+
describe: "When not used (or set to false), Wrangler will delete all vars before setting those found in the Wrangler configuration.\nWhen used (and set to true), the environment variables are not deleted before the deployment.\nIf you set variables via the dashboard you probably want to use this flag.\nNote that secrets are never deleted by deployments.",
|
80758
80873
|
default: false,
|
80759
80874
|
type: "boolean"
|
80760
80875
|
},
|
@@ -89394,7 +89509,8 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
89394
89509
|
config: Array.isArray(args.config) ? args.config : void 0,
|
89395
89510
|
site: void 0,
|
89396
89511
|
siteInclude: void 0,
|
89397
|
-
siteExclude: void 0
|
89512
|
+
siteExclude: void 0,
|
89513
|
+
enableContainers: false
|
89398
89514
|
})
|
89399
89515
|
);
|
89400
89516
|
sendMetricsEvent("run pages dev");
|
@@ -145043,7 +145159,7 @@ function generatePreviewAlias(scriptName) {
|
|
145043
145159
|
);
|
145044
145160
|
return void 0;
|
145045
145161
|
}
|
145046
|
-
const sanitizedAlias = branchName.replace(/[^a-zA-Z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
|
145162
|
+
const sanitizedAlias = branchName.replace(/[^a-zA-Z0-9-]/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "").toLowerCase();
|
145047
145163
|
const maxDnsLabelLength = 63;
|
145048
145164
|
const available = maxDnsLabelLength - scriptName.length - 1;
|
145049
145165
|
if (sanitizedAlias.length > available) {
|
@@ -145323,7 +145439,7 @@ var init_upload2 = __esm({
|
|
145323
145439
|
{ telemetryMessage: true }
|
145324
145440
|
);
|
145325
145441
|
}
|
145326
|
-
const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() ? generatePreviewAlias(name2) : void 0);
|
145442
|
+
const previewAlias = args.previewAlias ?? (getCIGeneratePreviewAlias() === "true" ? generatePreviewAlias(name2) : void 0);
|
145327
145443
|
if (!args.dryRun) {
|
145328
145444
|
(0, import_node_assert20.default)(accountId, "Missing account ID");
|
145329
145445
|
await verifyWorkerMatchesCITag(
|
@@ -152433,31 +152549,40 @@ async function resolveDevConfig(config, input) {
|
|
152433
152549
|
registry: input.dev?.registry,
|
152434
152550
|
bindVectorizeToProd: input.dev?.bindVectorizeToProd ?? false,
|
152435
152551
|
multiworkerPrimary: input.dev?.multiworkerPrimary,
|
152436
|
-
imagesLocalMode: input.dev?.imagesLocalMode ?? false
|
152552
|
+
imagesLocalMode: input.dev?.imagesLocalMode ?? false,
|
152553
|
+
experimentalMixedMode: input.dev?.experimentalMixedMode ?? getFlag("MIXED_MODE"),
|
152554
|
+
enableContainers: input.dev?.enableContainers ?? config.dev.enable_containers,
|
152555
|
+
dockerPath: input.dev?.dockerPath ?? getDockerPath()
|
152437
152556
|
};
|
152438
152557
|
}
|
152439
152558
|
async function resolveBindings(config, input) {
|
152440
|
-
const bindings = getBindings2(
|
152441
|
-
|
152442
|
-
|
152443
|
-
|
152444
|
-
|
152445
|
-
|
152446
|
-
|
152447
|
-
|
152448
|
-
|
152449
|
-
|
152450
|
-
|
152451
|
-
|
152452
|
-
|
152453
|
-
|
152454
|
-
|
152455
|
-
|
152456
|
-
|
152457
|
-
"
|
152458
|
-
input.bindings
|
152459
|
-
|
152460
|
-
|
152559
|
+
const bindings = getBindings2(
|
152560
|
+
config,
|
152561
|
+
input.env,
|
152562
|
+
!input.dev?.remote,
|
152563
|
+
{
|
152564
|
+
kv: extractBindingsOfType("kv_namespace", input.bindings),
|
152565
|
+
vars: Object.fromEntries(
|
152566
|
+
extractBindingsOfType("plain_text", input.bindings).map((b6) => [
|
152567
|
+
b6.binding,
|
152568
|
+
b6.value
|
152569
|
+
])
|
152570
|
+
),
|
152571
|
+
durableObjects: extractBindingsOfType(
|
152572
|
+
"durable_object_namespace",
|
152573
|
+
input.bindings
|
152574
|
+
),
|
152575
|
+
r2: extractBindingsOfType("r2_bucket", input.bindings),
|
152576
|
+
services: extractBindingsOfType("service", input.bindings),
|
152577
|
+
d1Databases: extractBindingsOfType("d1", input.bindings),
|
152578
|
+
ai: extractBindingsOfType("ai", input.bindings)?.[0],
|
152579
|
+
version_metadata: extractBindingsOfType(
|
152580
|
+
"version_metadata",
|
152581
|
+
input.bindings
|
152582
|
+
)?.[0]
|
152583
|
+
},
|
152584
|
+
input.dev?.experimentalMixedMode
|
152585
|
+
);
|
152461
152586
|
const maskedVars = maskVars(bindings, config);
|
152462
152587
|
printBindings(
|
152463
152588
|
{
|
@@ -152655,6 +152780,7 @@ var init_ConfigController = __esm({
|
|
152655
152780
|
init_dev2();
|
152656
152781
|
init_class_names_sqlite();
|
152657
152782
|
init_get_local_persistence_path();
|
152783
|
+
init_misc_variables();
|
152658
152784
|
init_errors();
|
152659
152785
|
init_experimental_flags();
|
152660
152786
|
init_logger();
|
@@ -172882,7 +173008,9 @@ async function convertToConfigBundle(event) {
|
|
172882
173008
|
imagesLocalMode: event.config.dev?.imagesLocalMode ?? false,
|
172883
173009
|
testScheduled: !!event.config.dev.testScheduled,
|
172884
173010
|
tails: event.config.tailConsumers,
|
172885
|
-
containers: event.config.containers ?? {}
|
173011
|
+
containers: event.config.containers ?? {},
|
173012
|
+
enableContainers: event.config.dev.enableContainers ?? true,
|
173013
|
+
dockerPath: event.config.dev.dockerPath ?? "docker"
|
172886
173014
|
};
|
172887
173015
|
}
|
172888
173016
|
async function maybeStartOrUpdateMixedModeSession(configBundle, mixedModeSession) {
|
@@ -172913,7 +173041,6 @@ var init_LocalRuntimeController = __esm({
|
|
172913
173041
|
init_source();
|
172914
173042
|
import_miniflare24 = require("miniflare");
|
172915
173043
|
init_miniflare();
|
172916
|
-
init_experimental_flags();
|
172917
173044
|
init_logger();
|
172918
173045
|
init_BaseController();
|
172919
173046
|
init_events();
|
@@ -172946,7 +173073,8 @@ var init_LocalRuntimeController = __esm({
|
|
172946
173073
|
async #onBundleComplete(data, id) {
|
172947
173074
|
try {
|
172948
173075
|
const configBundle = await convertToConfigBundle(data);
|
172949
|
-
|
173076
|
+
const experimentalMixedMode = data.config.dev.experimentalMixedMode ?? false;
|
173077
|
+
if (experimentalMixedMode && !data.config.dev?.remote) {
|
172950
173078
|
this.#mixedModeSession = await maybeStartOrUpdateMixedModeSession(
|
172951
173079
|
configBundle,
|
172952
173080
|
this.#mixedModeSession
|
@@ -172957,7 +173085,7 @@ var init_LocalRuntimeController = __esm({
|
|
172957
173085
|
configBundle,
|
172958
173086
|
this.#proxyToUserWorkerAuthenticationSecret,
|
172959
173087
|
this.#mixedModeSession?.mixedModeConnectionString,
|
172960
|
-
!!
|
173088
|
+
!!experimentalMixedMode
|
172961
173089
|
);
|
172962
173090
|
options.liveReload = false;
|
172963
173091
|
if (this.#mf === void 0) {
|
@@ -173097,7 +173225,6 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173097
173225
|
init_source();
|
173098
173226
|
import_miniflare25 = require("miniflare");
|
173099
173227
|
init_miniflare();
|
173100
|
-
init_experimental_flags();
|
173101
173228
|
init_logger();
|
173102
173229
|
init_events();
|
173103
173230
|
init_LocalRuntimeController();
|
@@ -173149,7 +173276,8 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173149
173276
|
async #onBundleComplete(data, id) {
|
173150
173277
|
try {
|
173151
173278
|
const configBundle = await convertToConfigBundle(data);
|
173152
|
-
|
173279
|
+
const experimentalMixedMode = data.config.dev.experimentalMixedMode;
|
173280
|
+
if (experimentalMixedMode && !data.config.dev?.remote) {
|
173153
173281
|
const mixedModeSession = await maybeStartOrUpdateMixedModeSession(
|
173154
173282
|
configBundle,
|
173155
173283
|
this.#mixedModeSessions.get(data.config.name)
|
@@ -173161,7 +173289,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
173161
173289
|
await convertToConfigBundle(data),
|
173162
173290
|
this.#proxyToUserWorkerAuthenticationSecret,
|
173163
173291
|
this.#mixedModeSessions.get(data.config.name)?.mixedModeConnectionString,
|
173164
|
-
!!
|
173292
|
+
!!experimentalMixedMode
|
173165
173293
|
);
|
173166
173294
|
this.#options.set(data.config.name, {
|
173167
173295
|
options,
|
@@ -174945,7 +175073,7 @@ var init_handler2 = __esm({
|
|
174945
175073
|
});
|
174946
175074
|
|
174947
175075
|
// ../workers-shared/asset-worker/src/utils/rules-engine.ts
|
174948
|
-
var ESCAPE_REGEX_CHARACTERS2, escapeRegex2, HOST_PLACEHOLDER_REGEX, PLACEHOLDER_REGEX2, replacer, generateRulesMatcher;
|
175076
|
+
var ESCAPE_REGEX_CHARACTERS2, escapeRegex2, HOST_PLACEHOLDER_REGEX, PLACEHOLDER_REGEX2, replacer, generateRuleRegExp, generateRulesMatcher;
|
174949
175077
|
var init_rules_engine = __esm({
|
174950
175078
|
"../workers-shared/asset-worker/src/utils/rules-engine.ts"() {
|
174951
175079
|
init_import_meta_url();
|
@@ -174962,24 +175090,27 @@ var init_rules_engine = __esm({
|
|
174962
175090
|
}
|
174963
175091
|
return str;
|
174964
175092
|
}, "replacer");
|
175093
|
+
generateRuleRegExp = /* @__PURE__ */ __name((rule) => {
|
175094
|
+
rule = rule.split("*").map(escapeRegex2).join("(?<splat>.*)");
|
175095
|
+
const host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);
|
175096
|
+
for (const host_match of host_matches) {
|
175097
|
+
rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);
|
175098
|
+
}
|
175099
|
+
const path_matches = rule.matchAll(PLACEHOLDER_REGEX2);
|
175100
|
+
for (const path_match of path_matches) {
|
175101
|
+
rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);
|
175102
|
+
}
|
175103
|
+
rule = "^" + rule + "$";
|
175104
|
+
return RegExp(rule);
|
175105
|
+
}, "generateRuleRegExp");
|
174965
175106
|
generateRulesMatcher = /* @__PURE__ */ __name((rules, replacerFn = (match2) => match2) => {
|
174966
175107
|
if (!rules) {
|
174967
175108
|
return () => [];
|
174968
175109
|
}
|
174969
175110
|
const compiledRules = Object.entries(rules).map(([rule, match2]) => {
|
174970
175111
|
const crossHost = rule.startsWith("https://");
|
174971
|
-
rule = rule.split("*").map(escapeRegex2).join("(?<splat>.*)");
|
174972
|
-
const host_matches = rule.matchAll(HOST_PLACEHOLDER_REGEX);
|
174973
|
-
for (const host_match of host_matches) {
|
174974
|
-
rule = rule.split(host_match[0]).join(`(?<${host_match[1]}>[^/.]+)`);
|
174975
|
-
}
|
174976
|
-
const path_matches = rule.matchAll(PLACEHOLDER_REGEX2);
|
174977
|
-
for (const path_match of path_matches) {
|
174978
|
-
rule = rule.split(path_match[0]).join(`(?<${path_match[1]}>[^/]+)`);
|
174979
|
-
}
|
174980
|
-
rule = "^" + rule + "$";
|
174981
175112
|
try {
|
174982
|
-
const regExp =
|
175113
|
+
const regExp = generateRuleRegExp(rule);
|
174983
175114
|
return [{ crossHost, regExp }, match2];
|
174984
175115
|
} catch {
|
174985
175116
|
}
|
@@ -176108,7 +176239,9 @@ async function setupDevEnv(devEnv, configPath, auth, args) {
|
|
176108
176239
|
registry: args.disableDevRegistry ? null : devEnv.config.latestConfig?.dev.registry,
|
176109
176240
|
bindVectorizeToProd: args.experimentalVectorizeBindToProd,
|
176110
176241
|
imagesLocalMode: args.experimentalImagesLocalMode,
|
176111
|
-
multiworkerPrimary: args.multiworkerPrimary
|
176242
|
+
multiworkerPrimary: args.multiworkerPrimary,
|
176243
|
+
enableContainers: args.enableContainers,
|
176244
|
+
dockerPath: args.dockerPath
|
176112
176245
|
},
|
176113
176246
|
legacy: {
|
176114
176247
|
site: /* @__PURE__ */ __name((configParam) => {
|
@@ -176608,6 +176741,11 @@ var init_dev2 = __esm({
|
|
176608
176741
|
type: "string",
|
176609
176742
|
describe: "Host to act as origin in local mode, defaults to dev.host or route"
|
176610
176743
|
},
|
176744
|
+
"enable-containers": {
|
176745
|
+
type: "boolean",
|
176746
|
+
describe: "Whether to build and enable containers during development",
|
176747
|
+
hidden: true
|
176748
|
+
},
|
176611
176749
|
site: {
|
176612
176750
|
describe: "Root folder of static assets for Workers Sites",
|
176613
176751
|
type: "string",
|
@@ -176885,7 +177023,9 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
176885
177023
|
experimentalVectorizeBindToProd: vectorizeBindToProd ?? false,
|
176886
177024
|
experimentalImagesLocalMode: imagesLocalMode ?? false,
|
176887
177025
|
enableIpc: options?.experimental?.enableIpc,
|
176888
|
-
nodeCompat: void 0
|
177026
|
+
nodeCompat: void 0,
|
177027
|
+
enableContainers: options?.experimental?.enableContainers ?? false,
|
177028
|
+
dockerPath: options?.experimental?.dockerPath ?? getDockerPath()
|
176889
177029
|
};
|
176890
177030
|
const devServer = await run(
|
176891
177031
|
{
|
@@ -176939,6 +177079,7 @@ var init_dev3 = __esm({
|
|
176939
177079
|
import_node_events7 = __toESM(require("events"));
|
176940
177080
|
import_undici25 = __toESM(require_undici());
|
176941
177081
|
init_dev2();
|
177082
|
+
init_misc_variables();
|
176942
177083
|
init_experimental_flags();
|
176943
177084
|
init_logger();
|
176944
177085
|
__name(unstable_dev, "unstable_dev");
|