wrangler 4.26.0 → 4.26.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.
- package/package.json +10 -10
- package/wrangler-dist/cli.js +111 -50
- package/wrangler-dist/metafile-cjs.json +1 -1
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "wrangler",
|
3
|
-
"version": "4.26.
|
3
|
+
"version": "4.26.1",
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
5
5
|
"keywords": [
|
6
6
|
"wrangler",
|
@@ -53,16 +53,16 @@
|
|
53
53
|
"blake3-wasm": "2.1.5",
|
54
54
|
"esbuild": "0.25.4",
|
55
55
|
"path-to-regexp": "6.3.0",
|
56
|
-
"unenv": "2.0.0-rc.
|
57
|
-
"workerd": "1.
|
56
|
+
"unenv": "2.0.0-rc.19",
|
57
|
+
"workerd": "1.20250726.0",
|
58
58
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
59
|
-
"@cloudflare/unenv-preset": "2.
|
60
|
-
"miniflare": "4.
|
59
|
+
"@cloudflare/unenv-preset": "2.5.0",
|
60
|
+
"miniflare": "4.20250726.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.20250726.0",
|
66
66
|
"@cspotcode/source-map-support": "0.8.1",
|
67
67
|
"@iarna/toml": "^3.0.0",
|
68
68
|
"@sentry/node": "^7.86.0",
|
@@ -74,7 +74,7 @@
|
|
74
74
|
"@types/javascript-time-ago": "^2.0.3",
|
75
75
|
"@types/mime": "^3.0.4",
|
76
76
|
"@types/minimatch": "^5.1.2",
|
77
|
-
"@types/node": "^20.
|
77
|
+
"@types/node": "^20.19.9",
|
78
78
|
"@types/node-forge": "^1.3.11",
|
79
79
|
"@types/prompts": "^2.0.14",
|
80
80
|
"@types/resolve": "^1.20.6",
|
@@ -136,14 +136,14 @@
|
|
136
136
|
"xxhash-wasm": "^1.0.1",
|
137
137
|
"yargs": "^17.7.2",
|
138
138
|
"@cloudflare/cli": "1.1.1",
|
139
|
-
"@cloudflare/containers-shared": "0.2.
|
139
|
+
"@cloudflare/containers-shared": "0.2.8",
|
140
140
|
"@cloudflare/eslint-config-worker": "1.1.0",
|
141
|
-
"@cloudflare/pages-shared": "^0.13.
|
141
|
+
"@cloudflare/pages-shared": "^0.13.58",
|
142
142
|
"@cloudflare/workers-shared": "0.18.5",
|
143
143
|
"@cloudflare/workers-tsconfig": "0.0.0"
|
144
144
|
},
|
145
145
|
"peerDependencies": {
|
146
|
-
"@cloudflare/workers-types": "^4.
|
146
|
+
"@cloudflare/workers-types": "^4.20250726.0"
|
147
147
|
},
|
148
148
|
"peerDependenciesMeta": {
|
149
149
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.js
CHANGED
@@ -26191,6 +26191,37 @@ For additional information please see: https://developers.cloudflare.com/contain
|
|
26191
26191
|
function generateContainerBuildId() {
|
26192
26192
|
return (0, import_crypto.randomUUID)().slice(0, 8);
|
26193
26193
|
}
|
26194
|
+
function getDockerSocketFromContext(dockerPath) {
|
26195
|
+
try {
|
26196
|
+
const output = runDockerCmdWithOutput(dockerPath, [
|
26197
|
+
"context",
|
26198
|
+
"ls",
|
26199
|
+
"--format",
|
26200
|
+
"json"
|
26201
|
+
]);
|
26202
|
+
const lines = output.trim().split("\n");
|
26203
|
+
const contexts = lines.map((line) => JSON.parse(line));
|
26204
|
+
const currentContext = contexts.find((context2) => context2.Current === true);
|
26205
|
+
if (currentContext && currentContext.DockerEndpoint) {
|
26206
|
+
return currentContext.DockerEndpoint;
|
26207
|
+
}
|
26208
|
+
} catch {
|
26209
|
+
}
|
26210
|
+
return null;
|
26211
|
+
}
|
26212
|
+
function resolveDockerHost(dockerPath) {
|
26213
|
+
if (process.env.WRANGLER_DOCKER_HOST) {
|
26214
|
+
return process.env.WRANGLER_DOCKER_HOST;
|
26215
|
+
}
|
26216
|
+
if (process.env.DOCKER_HOST) {
|
26217
|
+
return process.env.DOCKER_HOST;
|
26218
|
+
}
|
26219
|
+
const contextSocket = getDockerSocketFromContext(dockerPath);
|
26220
|
+
if (contextSocket) {
|
26221
|
+
return contextSocket;
|
26222
|
+
}
|
26223
|
+
return process.platform === "win32" ? "//./pipe/docker_engine" : "unix:///var/run/docker.sock";
|
26224
|
+
}
|
26194
26225
|
var import_child_process3, import_crypto, import_fs6, import_path5, runDockerCmd, runDockerCmdWithOutput, verifyDockerInstalled, isDockerfile, cleanupContainers, getContainerIdsFromImage;
|
26195
26226
|
var init_utils = __esm({
|
26196
26227
|
"../containers-shared/src/utils.ts"() {
|
@@ -26242,19 +26273,15 @@ var init_utils = __esm({
|
|
26242
26273
|
then: /* @__PURE__ */ __name(async (onResolve, onReject) => ready.then(onResolve).catch(onReject), "then")
|
26243
26274
|
};
|
26244
26275
|
}, "runDockerCmd");
|
26245
|
-
runDockerCmdWithOutput = /* @__PURE__ */ __name(
|
26246
|
-
|
26247
|
-
(0, import_child_process3.
|
26248
|
-
|
26249
|
-
|
26250
|
-
|
26251
|
-
|
26252
|
-
|
26253
|
-
|
26254
|
-
}
|
26255
|
-
return resolve24(stdout2.trim());
|
26256
|
-
});
|
26257
|
-
});
|
26276
|
+
runDockerCmdWithOutput = /* @__PURE__ */ __name((dockerPath, args) => {
|
26277
|
+
try {
|
26278
|
+
const stdout2 = (0, import_child_process3.execFileSync)(dockerPath, args, { encoding: "utf8" });
|
26279
|
+
return stdout2.trim();
|
26280
|
+
} catch (error2) {
|
26281
|
+
throw new Error(
|
26282
|
+
`Failed running docker command: ${error2.message}. Command: ${dockerPath} ${args.join(" ")}`
|
26283
|
+
);
|
26284
|
+
}
|
26258
26285
|
}, "runDockerCmdWithOutput");
|
26259
26286
|
verifyDockerInstalled = /* @__PURE__ */ __name(async (dockerPath, isDev = true) => {
|
26260
26287
|
try {
|
@@ -26262,7 +26289,7 @@ var init_utils = __esm({
|
|
26262
26289
|
} catch {
|
26263
26290
|
throw new Error(
|
26264
26291
|
`The Docker CLI could not be launched. Please ensure that the Docker CLI is installed and the daemon is running.
|
26265
|
-
Other container tooling that is compatible with the Docker CLI and engine may work, but is not yet guaranteed to do so. You can specify an executable with the environment variable WRANGLER_DOCKER_BIN and a socket with
|
26292
|
+
Other container tooling that is compatible with the Docker CLI and engine may work, but is not yet guaranteed to do so. You can specify an executable with the environment variable WRANGLER_DOCKER_BIN and a socket with DOCKER_HOST.${isDev ? "\nTo suppress this error if you do not intend on triggering any container instances, set dev.enable_containers to false in your Wrangler config or passing in --enable-containers=false." : ""}`
|
26266
26293
|
);
|
26267
26294
|
}
|
26268
26295
|
}, "verifyDockerInstalled");
|
@@ -26322,7 +26349,7 @@ Other container tooling that is compatible with the Docker CLI and engine may wo
|
|
26322
26349
|
}, "cleanupContainers");
|
26323
26350
|
__name(getContainerIdsByImageTags, "getContainerIdsByImageTags");
|
26324
26351
|
getContainerIdsFromImage = /* @__PURE__ */ __name(async (dockerPath, ancestorImage) => {
|
26325
|
-
const output =
|
26352
|
+
const output = runDockerCmdWithOutput(dockerPath, [
|
26326
26353
|
"ps",
|
26327
26354
|
"-a",
|
26328
26355
|
"--filter",
|
@@ -26334,6 +26361,8 @@ Other container tooling that is compatible with the Docker CLI and engine may wo
|
|
26334
26361
|
}, "getContainerIdsFromImage");
|
26335
26362
|
__name(checkExposedPorts, "checkExposedPorts");
|
26336
26363
|
__name(generateContainerBuildId, "generateContainerBuildId");
|
26364
|
+
__name(getDockerSocketFromContext, "getDockerSocketFromContext");
|
26365
|
+
__name(resolveDockerHost, "resolveDockerHost");
|
26337
26366
|
}
|
26338
26367
|
});
|
26339
26368
|
|
@@ -32787,7 +32816,7 @@ function getComplianceRegionSubdomain(complianceConfig) {
|
|
32787
32816
|
function getStagingSubdomain() {
|
32788
32817
|
return getCloudflareApiEnvironmentFromEnv() === "staging" ? ".staging" : "";
|
32789
32818
|
}
|
32790
|
-
var import_node_path2, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getWorkersCIBranchName, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getD1ExtraLocationChoices, getDockerPath
|
32819
|
+
var import_node_path2, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getCloudflareApiEnvironmentFromEnv, COMPLIANCE_REGION_CONFIG_PUBLIC, COMPLIANCE_REGION_CONFIG_UNKNOWN, getCloudflareComplianceRegionFromEnv, getCloudflareComplianceRegion, getCloudflareApiBaseUrlFromEnv, getCloudflareApiBaseUrl, getSanitizeLogs, getOutputFileDirectoryFromEnv, getOutputFilePathFromEnv, getCIMatchTag, getCIOverrideName, getCIOverrideNetworkModeHost, getCIGeneratePreviewAlias, getWorkersCIBranchName, getBuildConditionsFromEnv, getBuildPlatformFromEnv, getRegistryPath, getD1ExtraLocationChoices, getDockerPath;
|
32791
32820
|
var init_misc_variables = __esm({
|
32792
32821
|
"src/environment-variables/misc-variables.ts"() {
|
32793
32822
|
init_import_meta_url();
|
@@ -32888,12 +32917,6 @@ var init_misc_variables = __esm({
|
|
32888
32917
|
return "docker";
|
32889
32918
|
}
|
32890
32919
|
});
|
32891
|
-
getDockerHost = getEnvironmentVariableFactory({
|
32892
|
-
variableName: "WRANGLER_DOCKER_HOST",
|
32893
|
-
defaultValue() {
|
32894
|
-
return process.platform === "win32" ? "//./pipe/docker_engine" : "unix:///var/run/docker.sock";
|
32895
|
-
}
|
32896
|
-
});
|
32897
32920
|
}
|
32898
32921
|
});
|
32899
32922
|
|
@@ -33686,7 +33709,7 @@ var name, version;
|
|
33686
33709
|
var init_package = __esm({
|
33687
33710
|
"package.json"() {
|
33688
33711
|
name = "wrangler";
|
33689
|
-
version = "4.26.
|
33712
|
+
version = "4.26.1";
|
33690
33713
|
}
|
33691
33714
|
});
|
33692
33715
|
|
@@ -57181,7 +57204,7 @@ var init_sourcemap = __esm({
|
|
57181
57204
|
return this.opts.methodName;
|
57182
57205
|
}
|
57183
57206
|
getFileName() {
|
57184
|
-
return this.opts.fileName ??
|
57207
|
+
return this.opts.fileName ?? null;
|
57185
57208
|
}
|
57186
57209
|
getScriptNameOrSourceURL() {
|
57187
57210
|
return this.opts.fileName;
|
@@ -61924,14 +61947,22 @@ var init_als_external = __esm({
|
|
61924
61947
|
});
|
61925
61948
|
|
61926
61949
|
// src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts
|
61927
|
-
function nodejsHybridPlugin(
|
61950
|
+
function nodejsHybridPlugin({
|
61951
|
+
compatibilityDate,
|
61952
|
+
compatibilityFlags
|
61953
|
+
}) {
|
61928
61954
|
return {
|
61929
61955
|
name: "hybrid-nodejs_compat",
|
61930
61956
|
async setup(build5) {
|
61931
61957
|
const { defineEnv } = await import("unenv");
|
61932
|
-
const {
|
61958
|
+
const { getCloudflarePreset } = await import("@cloudflare/unenv-preset");
|
61933
61959
|
const { alias, inject, external, polyfill: polyfill2 } = defineEnv({
|
61934
|
-
presets: [
|
61960
|
+
presets: [
|
61961
|
+
getCloudflarePreset({
|
61962
|
+
compatibilityDate,
|
61963
|
+
compatibilityFlags
|
61964
|
+
})
|
61965
|
+
],
|
61935
61966
|
npmShims: true
|
61936
61967
|
}).env;
|
61937
61968
|
errorOnServiceWorkerFormat(build5);
|
@@ -62180,7 +62211,9 @@ var init_nodejs_compat = __esm({
|
|
62180
62211
|
|
62181
62212
|
// src/deployment-bundle/esbuild-plugins/nodejs-plugins.ts
|
62182
62213
|
function getNodeJSCompatPlugins({
|
62183
|
-
mode
|
62214
|
+
mode,
|
62215
|
+
compatibilityDate,
|
62216
|
+
compatibilityFlags
|
62184
62217
|
}) {
|
62185
62218
|
switch (mode) {
|
62186
62219
|
case "als":
|
@@ -62188,7 +62221,7 @@ function getNodeJSCompatPlugins({
|
|
62188
62221
|
case "v1":
|
62189
62222
|
return [nodejsCompatPlugin(mode)];
|
62190
62223
|
case "v2":
|
62191
|
-
return [nodejsHybridPlugin()];
|
62224
|
+
return [nodejsHybridPlugin({ compatibilityDate, compatibilityFlags })];
|
62192
62225
|
case null:
|
62193
62226
|
return [nodejsCompatPlugin(mode)];
|
62194
62227
|
}
|
@@ -62235,6 +62268,8 @@ async function bundleWorker(entry, destination, {
|
|
62235
62268
|
minify,
|
62236
62269
|
keepNames,
|
62237
62270
|
nodejsCompatMode,
|
62271
|
+
compatibilityDate,
|
62272
|
+
compatibilityFlags,
|
62238
62273
|
alias,
|
62239
62274
|
define,
|
62240
62275
|
checkFetch,
|
@@ -62391,7 +62426,9 @@ async function bundleWorker(entry, destination, {
|
|
62391
62426
|
aliasPlugin,
|
62392
62427
|
moduleCollector.plugin,
|
62393
62428
|
...getNodeJSCompatPlugins({
|
62394
|
-
mode: nodejsCompatMode ?? null
|
62429
|
+
mode: nodejsCompatMode ?? null,
|
62430
|
+
compatibilityDate,
|
62431
|
+
compatibilityFlags
|
62395
62432
|
}),
|
62396
62433
|
cloudflareInternalPlugin,
|
62397
62434
|
buildResultPlugin,
|
@@ -64547,6 +64584,8 @@ function runBuild({
|
|
64547
64584
|
minify,
|
64548
64585
|
keepNames,
|
64549
64586
|
nodejsCompatMode,
|
64587
|
+
compatibilityDate,
|
64588
|
+
compatibilityFlags,
|
64550
64589
|
define,
|
64551
64590
|
alias,
|
64552
64591
|
noBundle,
|
@@ -64614,6 +64653,8 @@ function runBuild({
|
|
64614
64653
|
minify,
|
64615
64654
|
keepNames,
|
64616
64655
|
nodejsCompatMode,
|
64656
|
+
compatibilityDate,
|
64657
|
+
compatibilityFlags,
|
64617
64658
|
doBindings: durableObjects.bindings,
|
64618
64659
|
workflowBindings: workflows,
|
64619
64660
|
alias,
|
@@ -64824,6 +64865,8 @@ var init_BundlerController = __esm({
|
|
64824
64865
|
minify: config.build.minify,
|
64825
64866
|
keepNames: config.build.keepNames ?? true,
|
64826
64867
|
nodejsCompatMode: config.build.nodejsCompatMode,
|
64868
|
+
compatibilityDate: config.compatibilityDate,
|
64869
|
+
compatibilityFlags: config.compatibilityFlags,
|
64827
64870
|
define: config.build.define,
|
64828
64871
|
checkFetch: shouldCheckFetch(
|
64829
64872
|
config.compatibilityDate,
|
@@ -64937,6 +64980,8 @@ var init_BundlerController = __esm({
|
|
64937
64980
|
minify: config.build?.minify,
|
64938
64981
|
keepNames: config.build?.keepNames ?? true,
|
64939
64982
|
nodejsCompatMode: config.build.nodejsCompatMode,
|
64983
|
+
compatibilityDate: config.compatibilityDate,
|
64984
|
+
compatibilityFlags: config.compatibilityFlags,
|
64940
64985
|
define: config.build.define,
|
64941
64986
|
alias: config.build.alias,
|
64942
64987
|
noBundle: !config.build?.bundle,
|
@@ -89319,6 +89364,8 @@ function buildWorkerFromFunctions({
|
|
89319
89364
|
sourcemap,
|
89320
89365
|
watch: watch2,
|
89321
89366
|
nodejsCompatMode,
|
89367
|
+
compatibilityDate: void 0,
|
89368
|
+
compatibilityFlags: void 0,
|
89322
89369
|
define: {
|
89323
89370
|
__FALLBACK_SERVICE__: JSON.stringify(fallbackService)
|
89324
89371
|
},
|
@@ -89382,6 +89429,8 @@ function buildRawWorker({
|
|
89382
89429
|
sourcemap,
|
89383
89430
|
watch: watch2,
|
89384
89431
|
nodejsCompatMode,
|
89432
|
+
compatibilityDate: void 0,
|
89433
|
+
compatibilityFlags: void 0,
|
89385
89434
|
define: {},
|
89386
89435
|
alias: {},
|
89387
89436
|
doBindings: [],
|
@@ -89677,6 +89726,8 @@ function buildPluginFromFunctions({
|
|
89677
89726
|
// but if someone wants to publish a Plugin which does require this new `nodejs_compat` flag
|
89678
89727
|
// and they document that on their README.md, we should let them.
|
89679
89728
|
nodejsCompatMode: nodejsCompatMode ?? "v1",
|
89729
|
+
compatibilityDate: void 0,
|
89730
|
+
compatibilityFlags: void 0,
|
89680
89731
|
define: {},
|
89681
89732
|
alias: {},
|
89682
89733
|
doBindings: [],
|
@@ -146939,11 +146990,11 @@ async function generateEnvTypes(config, args, envInterface, outputPath, entrypoi
|
|
146939
146990
|
const serviceEntry = service.service !== entrypoint?.name ? serviceEntries?.get(service.service) : entrypoint;
|
146940
146991
|
const importPath = serviceEntry ? generateImportSpecifier(fullOutputPath, serviceEntry.file) : void 0;
|
146941
146992
|
const exportExists = serviceEntry?.exports?.some(
|
146942
|
-
(e7) => e7 === service.entrypoint
|
146993
|
+
(e7) => e7 === (service.entrypoint ?? "default")
|
146943
146994
|
);
|
146944
146995
|
let typeName;
|
146945
146996
|
if (importPath && exportExists) {
|
146946
|
-
typeName = `Service<import("${importPath}").${service.entrypoint ?? "default"}>`;
|
146997
|
+
typeName = `Service<typeof import("${importPath}").${service.entrypoint ?? "default"}>`;
|
146947
146998
|
} else if (service.entrypoint) {
|
146948
146999
|
typeName = `Service /* entrypoint ${service.entrypoint} from ${service.service} */`;
|
146949
147000
|
} else {
|
@@ -150849,7 +150900,9 @@ Edits that have been made via the API will be overridden by your local code and
|
|
150849
150900
|
}
|
150850
150901
|
}
|
150851
150902
|
}
|
150852
|
-
|
150903
|
+
const compatibilityDate = props.compatibilityDate || config.compatibility_date;
|
150904
|
+
const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
|
150905
|
+
if (!compatibilityDate) {
|
150853
150906
|
const compatibilityDateStr = formatCompatibilityDate(/* @__PURE__ */ new Date());
|
150854
150907
|
throw new UserError(`A compatibility_date is required when uploading a Worker Version. Add the following to your ${configFileName(config.configPath)} file:
|
150855
150908
|
\`\`\`
|
@@ -150862,13 +150915,12 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
150862
150915
|
const jsxFragment = props.jsxFragment || config.jsx_fragment;
|
150863
150916
|
const minify = props.minify ?? config.minify;
|
150864
150917
|
const nodejsCompatMode = validateNodeCompatMode(
|
150865
|
-
|
150866
|
-
|
150918
|
+
compatibilityDate,
|
150919
|
+
compatibilityFlags,
|
150867
150920
|
{
|
150868
150921
|
noBundle: props.noBundle ?? config.no_bundle
|
150869
150922
|
}
|
150870
150923
|
);
|
150871
|
-
const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
|
150872
150924
|
if (props.noBundle && minify) {
|
150873
150925
|
logger.warn(
|
150874
150926
|
"`--minify` and `--no-bundle` can't be used together. If you want to minify your Worker and disable Wrangler's bundling, please minify as part of your own bundling process."
|
@@ -150953,6 +151005,8 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
150953
151005
|
keepNames: config.keep_names ?? true,
|
150954
151006
|
sourcemap: uploadSourceMaps,
|
150955
151007
|
nodejsCompatMode,
|
151008
|
+
compatibilityDate,
|
151009
|
+
compatibilityFlags,
|
150956
151010
|
define: { ...config.define, ...props.defines },
|
150957
151011
|
alias: { ...config.alias, ...props.alias },
|
150958
151012
|
checkFetch: false,
|
@@ -150962,8 +151016,8 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
150962
151016
|
local: false,
|
150963
151017
|
projectRoot: props.projectRoot,
|
150964
151018
|
defineNavigatorUserAgent: isNavigatorDefined(
|
150965
|
-
|
150966
|
-
|
151019
|
+
compatibilityDate,
|
151020
|
+
compatibilityFlags
|
150967
151021
|
),
|
150968
151022
|
plugins: [logBuildOutput(nodejsCompatMode)],
|
150969
151023
|
// Pages specific options used by wrangler pages commands
|
@@ -151017,7 +151071,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
151017
151071
|
migrations,
|
151018
151072
|
modules,
|
151019
151073
|
sourceMaps: uploadSourceMaps ? loadSourceMaps(main2, modules, bundle) : void 0,
|
151020
|
-
compatibility_date:
|
151074
|
+
compatibility_date: compatibilityDate,
|
151021
151075
|
compatibility_flags: compatibilityFlags,
|
151022
151076
|
keepVars: false,
|
151023
151077
|
// the wrangler.toml should be the source-of-truth for vars
|
@@ -157182,7 +157236,9 @@ Edits that have been made via the script API will be overridden by your local co
|
|
157182
157236
|
}
|
157183
157237
|
}
|
157184
157238
|
}
|
157185
|
-
|
157239
|
+
const compatibilityDate = props.compatibilityDate ?? config.compatibility_date;
|
157240
|
+
const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
|
157241
|
+
if (!compatibilityDate) {
|
157186
157242
|
const compatibilityDateStr = formatCompatibilityDate(/* @__PURE__ */ new Date());
|
157187
157243
|
throw new UserError(
|
157188
157244
|
`A compatibility_date is required when publishing. Add the following to your ${configFileName(config.configPath)} file:
|
@@ -157191,7 +157247,7 @@ Edits that have been made via the script API will be overridden by your local co
|
|
157191
157247
|
\`\`\`
|
157192
157248
|
Or you could pass it in your terminal as \`--compatibility-date ${compatibilityDateStr}\`
|
157193
157249
|
See https://developers.cloudflare.com/workers/platform/compatibility-dates for more information.`,
|
157194
|
-
{ telemetryMessage: "missing
|
157250
|
+
{ telemetryMessage: "missing compatibility date when deploying" }
|
157195
157251
|
);
|
157196
157252
|
}
|
157197
157253
|
const routes = props.routes ?? config.routes ?? (config.route ? [config.route] : []) ?? [];
|
@@ -157200,8 +157256,6 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
157200
157256
|
const jsxFragment = props.jsxFragment || config.jsx_fragment;
|
157201
157257
|
const keepVars = props.keepVars || config.keep_vars;
|
157202
157258
|
const minify = props.minify ?? config.minify;
|
157203
|
-
const compatibilityDate = props.compatibilityDate ?? config.compatibility_date;
|
157204
|
-
const compatibilityFlags = props.compatibilityFlags ?? config.compatibility_flags;
|
157205
157259
|
const nodejsCompatMode = validateNodeCompatMode(
|
157206
157260
|
compatibilityDate,
|
157207
157261
|
compatibilityFlags,
|
@@ -157318,6 +157372,8 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
157318
157372
|
keepNames: config.keep_names ?? true,
|
157319
157373
|
sourcemap: uploadSourceMaps,
|
157320
157374
|
nodejsCompatMode,
|
157375
|
+
compatibilityDate,
|
157376
|
+
compatibilityFlags,
|
157321
157377
|
define: { ...config.define, ...props.defines },
|
157322
157378
|
checkFetch: false,
|
157323
157379
|
alias: config.alias,
|
@@ -157327,8 +157383,8 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
157327
157383
|
local: false,
|
157328
157384
|
projectRoot: props.projectRoot,
|
157329
157385
|
defineNavigatorUserAgent: isNavigatorDefined(
|
157330
|
-
|
157331
|
-
|
157386
|
+
compatibilityDate,
|
157387
|
+
compatibilityFlags
|
157332
157388
|
),
|
157333
157389
|
plugins: [logBuildOutput(nodejsCompatMode)],
|
157334
157390
|
// Pages specific options used by wrangler pages commands
|
@@ -157413,7 +157469,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
157413
157469
|
modules,
|
157414
157470
|
containers: config.containers ?? void 0,
|
157415
157471
|
sourceMaps: uploadSourceMaps ? loadSourceMaps(main2, modules, bundle) : void 0,
|
157416
|
-
compatibility_date:
|
157472
|
+
compatibility_date: compatibilityDate,
|
157417
157473
|
compatibility_flags: compatibilityFlags,
|
157418
157474
|
keepVars,
|
157419
157475
|
keepSecrets: keepVars,
|
@@ -158536,6 +158592,7 @@ async function resolveDevConfig(config, input) {
|
|
158536
158592
|
}
|
158537
158593
|
const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
|
158538
158594
|
const initialIpListenCheck = initialIp === "*" ? "0.0.0.0" : initialIp;
|
158595
|
+
const useContainers = config.dev.enable_containers && config.containers?.length;
|
158539
158596
|
return {
|
158540
158597
|
auth,
|
158541
158598
|
remote: input.dev?.remote,
|
@@ -158564,7 +158621,7 @@ async function resolveDevConfig(config, input) {
|
|
158564
158621
|
experimentalRemoteBindings: input.dev?.experimentalRemoteBindings ?? getFlag("REMOTE_BINDINGS"),
|
158565
158622
|
enableContainers: input.dev?.enableContainers ?? config.dev.enable_containers,
|
158566
158623
|
dockerPath: input.dev?.dockerPath ?? getDockerPath(),
|
158567
|
-
containerEngine: input.dev?.containerEngine ?? config.dev.container_engine ??
|
158624
|
+
containerEngine: useContainers ? input.dev?.containerEngine ?? config.dev.container_engine ?? resolveDockerHost(input.dev?.dockerPath ?? getDockerPath()) : void 0,
|
158568
158625
|
containerBuildId: input.dev?.containerBuildId
|
158569
158626
|
};
|
158570
158627
|
}
|
@@ -158782,6 +158839,7 @@ var init_ConfigController = __esm({
|
|
158782
158839
|
init_import_meta_url();
|
158783
158840
|
import_node_assert28 = __toESM(require("assert"));
|
158784
158841
|
import_node_path58 = __toESM(require("path"));
|
158842
|
+
init_containers_shared();
|
158785
158843
|
init_esm4();
|
158786
158844
|
init_assets();
|
158787
158845
|
init_common();
|
@@ -183317,6 +183375,7 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
183317
183375
|
});
|
183318
183376
|
const defaultLogLevel = testMode ? "warn" : "log";
|
183319
183377
|
const local = options?.local ?? true;
|
183378
|
+
const dockerPath = options?.experimental?.dockerPath ?? getDockerPath();
|
183320
183379
|
const devOptions = {
|
183321
183380
|
script,
|
183322
183381
|
inspect: false,
|
@@ -183384,8 +183443,8 @@ unstable_dev()'s behaviour will likely change in future releases`
|
|
183384
183443
|
enableIpc: options?.experimental?.enableIpc,
|
183385
183444
|
nodeCompat: void 0,
|
183386
183445
|
enableContainers: options?.experimental?.enableContainers ?? false,
|
183387
|
-
dockerPath
|
183388
|
-
containerEngine: options?.experimental?.containerEngine
|
183446
|
+
dockerPath,
|
183447
|
+
containerEngine: options?.experimental?.containerEngine
|
183389
183448
|
};
|
183390
183449
|
const devServer = await run(
|
183391
183450
|
{
|
@@ -183826,11 +183885,12 @@ function unstable_getMiniflareWorkerOptions(configOrConfigPath, env6, options) {
|
|
183826
183885
|
options?.overrides?.assets
|
183827
183886
|
);
|
183828
183887
|
const assetOptions = processedAssetOptions ? buildAssetOptions({ assets: processedAssetOptions }) : {};
|
183888
|
+
const useContainers = config.dev?.enable_containers && config.containers?.length;
|
183829
183889
|
const workerOptions = {
|
183830
183890
|
compatibilityDate: config.compatibility_date,
|
183831
183891
|
compatibilityFlags: config.compatibility_flags,
|
183832
183892
|
modulesRules,
|
183833
|
-
containerEngine: config.dev.container_engine ??
|
183893
|
+
containerEngine: useContainers ? config.dev.container_engine ?? resolveDockerHost(getDockerPath()) : void 0,
|
183834
183894
|
...bindingOptions,
|
183835
183895
|
...sitesOptions,
|
183836
183896
|
...assetOptions
|
@@ -183846,6 +183906,7 @@ var import_miniflare31;
|
|
183846
183906
|
var init_platform = __esm({
|
183847
183907
|
"src/api/integrations/platform/index.ts"() {
|
183848
183908
|
init_import_meta_url();
|
183909
|
+
init_containers_shared();
|
183849
183910
|
import_miniflare31 = require("miniflare");
|
183850
183911
|
init_assets();
|
183851
183912
|
init_config2();
|