wrangler 4.41.0 → 4.42.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 +8 -8
- package/wrangler-dist/cli.d.ts +3 -2
- package/wrangler-dist/cli.js +105 -63
- 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.
|
|
3
|
+
"version": "4.42.1",
|
|
4
4
|
"description": "Command-line interface for all things Cloudflare Workers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"wrangler",
|
|
@@ -54,15 +54,15 @@
|
|
|
54
54
|
"esbuild": "0.25.4",
|
|
55
55
|
"path-to-regexp": "6.3.0",
|
|
56
56
|
"unenv": "2.0.0-rc.21",
|
|
57
|
-
"workerd": "1.
|
|
58
|
-
"@cloudflare/unenv-preset": "2.7.5",
|
|
57
|
+
"workerd": "1.20251004.0",
|
|
59
58
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
|
60
|
-
"miniflare": "4.
|
|
59
|
+
"miniflare": "4.20251004.0",
|
|
60
|
+
"@cloudflare/unenv-preset": "2.7.7"
|
|
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.20251004.0",
|
|
66
66
|
"@cspotcode/source-map-support": "0.8.1",
|
|
67
67
|
"@iarna/toml": "^3.0.0",
|
|
68
68
|
"@sentry/node": "^7.86.0",
|
|
@@ -139,16 +139,16 @@
|
|
|
139
139
|
"xxhash-wasm": "^1.0.1",
|
|
140
140
|
"yaml": "^2.8.1",
|
|
141
141
|
"yargs": "^17.7.2",
|
|
142
|
-
"@cloudflare/cli": "1.1.3",
|
|
143
142
|
"@cloudflare/containers-shared": "0.2.12",
|
|
144
143
|
"@cloudflare/eslint-config-shared": "1.1.0",
|
|
145
|
-
"@cloudflare/
|
|
144
|
+
"@cloudflare/cli": "1.1.3",
|
|
145
|
+
"@cloudflare/pages-shared": "^0.13.78",
|
|
146
146
|
"@cloudflare/workers-shared": "0.18.8",
|
|
147
147
|
"@cloudflare/workers-tsconfig": "0.0.0",
|
|
148
148
|
"@cloudflare/workflows-shared": "0.3.7"
|
|
149
149
|
},
|
|
150
150
|
"peerDependencies": {
|
|
151
|
-
"@cloudflare/workers-types": "^4.
|
|
151
|
+
"@cloudflare/workers-types": "^4.20251004.0"
|
|
152
152
|
},
|
|
153
153
|
"peerDependenciesMeta": {
|
|
154
154
|
"@cloudflare/workers-types": {
|
package/wrangler-dist/cli.d.ts
CHANGED
|
@@ -2543,7 +2543,9 @@ type ControllerEventMap = {
|
|
|
2543
2543
|
error: [ErrorEvent];
|
|
2544
2544
|
};
|
|
2545
2545
|
declare abstract class Controller<EventMap extends ControllerEventMap = ControllerEventMap> extends TypedEventEmitterImpl<EventMap> {
|
|
2546
|
-
|
|
2546
|
+
#private;
|
|
2547
|
+
teardown(): Promise<void>;
|
|
2548
|
+
emitErrorEvent(event: ErrorEvent): void;
|
|
2547
2549
|
}
|
|
2548
2550
|
type RuntimeControllerEventMap = ControllerEventMap & {
|
|
2549
2551
|
reloadStart: [ReloadStartEvent];
|
|
@@ -2554,7 +2556,6 @@ declare abstract class RuntimeController extends Controller<RuntimeControllerEve
|
|
|
2554
2556
|
abstract onBundleStart(_: BundleStartEvent): void;
|
|
2555
2557
|
abstract onBundleComplete(_: BundleCompleteEvent): void;
|
|
2556
2558
|
abstract onPreviewTokenExpired(_: PreviewTokenExpiredEvent): void;
|
|
2557
|
-
abstract teardown(): Promise<void>;
|
|
2558
2559
|
abstract emitReloadStartEvent(data: ReloadStartEvent): void;
|
|
2559
2560
|
abstract emitReloadCompleteEvent(data: ReloadCompleteEvent): void;
|
|
2560
2561
|
}
|
package/wrangler-dist/cli.js
CHANGED
|
@@ -31660,7 +31660,7 @@ var require_supports_colors = __commonJS({
|
|
|
31660
31660
|
"../../node_modules/.pnpm/@colors+colors@1.5.0/node_modules/@colors/colors/lib/system/supports-colors.js"(exports2, module3) {
|
|
31661
31661
|
"use strict";
|
|
31662
31662
|
init_import_meta_url();
|
|
31663
|
-
var
|
|
31663
|
+
var os10 = require("os");
|
|
31664
31664
|
var hasFlag3 = require_has_flag();
|
|
31665
31665
|
var env6 = process.env;
|
|
31666
31666
|
var forceColor = void 0;
|
|
@@ -31699,7 +31699,7 @@ var require_supports_colors = __commonJS({
|
|
|
31699
31699
|
}
|
|
31700
31700
|
var min = forceColor ? 1 : 0;
|
|
31701
31701
|
if (process.platform === "win32") {
|
|
31702
|
-
var osRelease =
|
|
31702
|
+
var osRelease = os10.release().split(".");
|
|
31703
31703
|
if (Number(process.versions.node.split(".")[0]) >= 8 && Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
31704
31704
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
31705
31705
|
}
|
|
@@ -33304,7 +33304,7 @@ var require_OSPaths = __commonJS({
|
|
|
33304
33304
|
}
|
|
33305
33305
|
__name(isEmpty, "isEmpty");
|
|
33306
33306
|
function Adapt(adapter_) {
|
|
33307
|
-
var env6 = adapter_.env,
|
|
33307
|
+
var env6 = adapter_.env, os10 = adapter_.os, path72 = adapter_.path;
|
|
33308
33308
|
var isWinOS = /^win/i.test(adapter_.process.platform);
|
|
33309
33309
|
function normalizePath2(path_) {
|
|
33310
33310
|
return path_ ? adapter_.path.normalize(adapter_.path.join(path_, ".")) : void 0;
|
|
@@ -33312,11 +33312,11 @@ var require_OSPaths = __commonJS({
|
|
|
33312
33312
|
__name(normalizePath2, "normalizePath");
|
|
33313
33313
|
function home() {
|
|
33314
33314
|
var posix2 = /* @__PURE__ */ __name(function() {
|
|
33315
|
-
return normalizePath2((typeof
|
|
33315
|
+
return normalizePath2((typeof os10.homedir === "function" ? os10.homedir() : void 0) || env6.get("HOME"));
|
|
33316
33316
|
}, "posix");
|
|
33317
33317
|
var windows = /* @__PURE__ */ __name(function() {
|
|
33318
33318
|
var priorityList = [
|
|
33319
|
-
typeof
|
|
33319
|
+
typeof os10.homedir === "function" ? os10.homedir() : void 0,
|
|
33320
33320
|
env6.get("USERPROFILE"),
|
|
33321
33321
|
env6.get("HOME"),
|
|
33322
33322
|
env6.get("HOMEDRIVE") || env6.get("HOMEPATH") ? path72.join(env6.get("HOMEDRIVE") || "", env6.get("HOMEPATH") || "") : void 0
|
|
@@ -33336,7 +33336,7 @@ var require_OSPaths = __commonJS({
|
|
|
33336
33336
|
function posix2() {
|
|
33337
33337
|
var fallback = "/tmp";
|
|
33338
33338
|
var priorityList = [
|
|
33339
|
-
typeof
|
|
33339
|
+
typeof os10.tmpdir === "function" ? os10.tmpdir() : void 0,
|
|
33340
33340
|
env6.get("TMPDIR"),
|
|
33341
33341
|
env6.get("TEMP"),
|
|
33342
33342
|
env6.get("TMP")
|
|
@@ -33349,7 +33349,7 @@ var require_OSPaths = __commonJS({
|
|
|
33349
33349
|
function windows() {
|
|
33350
33350
|
var fallback = "C:\\Temp";
|
|
33351
33351
|
var priorityListLazy = [
|
|
33352
|
-
typeof
|
|
33352
|
+
typeof os10.tmpdir === "function" ? os10.tmpdir : function() {
|
|
33353
33353
|
return void 0;
|
|
33354
33354
|
},
|
|
33355
33355
|
function() {
|
|
@@ -33436,7 +33436,7 @@ var require_node = __commonJS({
|
|
|
33436
33436
|
};
|
|
33437
33437
|
exports2.__esModule = true;
|
|
33438
33438
|
exports2.adapter = void 0;
|
|
33439
|
-
var
|
|
33439
|
+
var os10 = __importStar(require("os"));
|
|
33440
33440
|
var path72 = __importStar(require("path"));
|
|
33441
33441
|
exports2.adapter = {
|
|
33442
33442
|
atImportPermissions: { env: true },
|
|
@@ -33445,7 +33445,7 @@ var require_node = __commonJS({
|
|
|
33445
33445
|
return process.env[s6];
|
|
33446
33446
|
}, "get")
|
|
33447
33447
|
},
|
|
33448
|
-
os:
|
|
33448
|
+
os: os10,
|
|
33449
33449
|
path: path72,
|
|
33450
33450
|
process
|
|
33451
33451
|
};
|
|
@@ -33641,7 +33641,7 @@ function getComplianceRegionSubdomain(complianceConfig) {
|
|
|
33641
33641
|
function getStagingSubdomain() {
|
|
33642
33642
|
return getCloudflareApiEnvironmentFromEnv() === "staging" ? ".staging" : "";
|
|
33643
33643
|
}
|
|
33644
|
-
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, getSubdomainMixedStateCheckDisabled, getCloudflareLoadDevVarsFromDotEnv, getCloudflareIncludeProcessEnvFromEnv, getTraceHeader, getDisableConfigWatching;
|
|
33644
|
+
var import_node_path2, getC3CommandFromEnv, getWranglerSendMetricsFromEnv, getWranglerSendErrorReportsFromEnv, 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, getSubdomainMixedStateCheckDisabled, getCloudflareLoadDevVarsFromDotEnv, getCloudflareIncludeProcessEnvFromEnv, getTraceHeader, getDisableConfigWatching;
|
|
33645
33645
|
var init_misc_variables = __esm({
|
|
33646
33646
|
"src/environment-variables/misc-variables.ts"() {
|
|
33647
33647
|
init_import_meta_url();
|
|
@@ -33657,6 +33657,9 @@ var init_misc_variables = __esm({
|
|
|
33657
33657
|
getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({
|
|
33658
33658
|
variableName: "WRANGLER_SEND_METRICS"
|
|
33659
33659
|
});
|
|
33660
|
+
getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
|
|
33661
|
+
variableName: "WRANGLER_SEND_ERROR_REPORTS"
|
|
33662
|
+
});
|
|
33660
33663
|
getCloudflareApiEnvironmentFromEnv = getEnvironmentVariableFactory(
|
|
33661
33664
|
{
|
|
33662
33665
|
variableName: "WRANGLER_API_ENVIRONMENT",
|
|
@@ -73377,11 +73380,11 @@ var init_os = __esm({
|
|
|
73377
73380
|
static {
|
|
73378
73381
|
__name(this, "OS");
|
|
73379
73382
|
}
|
|
73380
|
-
get(
|
|
73383
|
+
get(os10, query = {}, options) {
|
|
73381
73384
|
if (isRequestOptions(query)) {
|
|
73382
|
-
return this.get(
|
|
73385
|
+
return this.get(os10, {}, query);
|
|
73383
73386
|
}
|
|
73384
|
-
return this._client.get(`/radar/http/top/ases/os/${
|
|
73387
|
+
return this._client.get(`/radar/http/top/ases/os/${os10}`, { query, ...options })._thenUnwrap((obj) => obj.result);
|
|
73385
73388
|
}
|
|
73386
73389
|
};
|
|
73387
73390
|
}
|
|
@@ -73622,11 +73625,11 @@ var init_os2 = __esm({
|
|
|
73622
73625
|
static {
|
|
73623
73626
|
__name(this, "OS");
|
|
73624
73627
|
}
|
|
73625
|
-
get(
|
|
73628
|
+
get(os10, query = {}, options) {
|
|
73626
73629
|
if (isRequestOptions(query)) {
|
|
73627
|
-
return this.get(
|
|
73630
|
+
return this.get(os10, {}, query);
|
|
73628
73631
|
}
|
|
73629
|
-
return this._client.get(`/radar/http/top/locations/os/${
|
|
73632
|
+
return this._client.get(`/radar/http/top/locations/os/${os10}`, { query, ...options })._thenUnwrap((obj) => obj.result);
|
|
73630
73633
|
}
|
|
73631
73634
|
};
|
|
73632
73635
|
}
|
|
@@ -93895,7 +93898,7 @@ var name, version;
|
|
|
93895
93898
|
var init_package = __esm({
|
|
93896
93899
|
"package.json"() {
|
|
93897
93900
|
name = "wrangler";
|
|
93898
|
-
version = "4.
|
|
93901
|
+
version = "4.42.1";
|
|
93899
93902
|
}
|
|
93900
93903
|
});
|
|
93901
93904
|
|
|
@@ -108974,14 +108977,14 @@ var require_is_wsl = __commonJS({
|
|
|
108974
108977
|
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports2, module3) {
|
|
108975
108978
|
"use strict";
|
|
108976
108979
|
init_import_meta_url();
|
|
108977
|
-
var
|
|
108980
|
+
var os10 = require("os");
|
|
108978
108981
|
var fs25 = require("fs");
|
|
108979
108982
|
var isDocker = require_is_docker();
|
|
108980
108983
|
var isWsl = /* @__PURE__ */ __name(() => {
|
|
108981
108984
|
if (process.platform !== "linux") {
|
|
108982
108985
|
return false;
|
|
108983
108986
|
}
|
|
108984
|
-
if (
|
|
108987
|
+
if (os10.release().toLowerCase().includes("microsoft")) {
|
|
108985
108988
|
if (isDocker()) {
|
|
108986
108989
|
return false;
|
|
108987
108990
|
}
|
|
@@ -110914,8 +110917,8 @@ var require_homedir = __commonJS({
|
|
|
110914
110917
|
"../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/homedir.js"(exports2, module3) {
|
|
110915
110918
|
"use strict";
|
|
110916
110919
|
init_import_meta_url();
|
|
110917
|
-
var
|
|
110918
|
-
module3.exports =
|
|
110920
|
+
var os10 = require("os");
|
|
110921
|
+
module3.exports = os10.homedir || /* @__PURE__ */ __name(function homedir3() {
|
|
110919
110922
|
var home = process.env.HOME;
|
|
110920
110923
|
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
110921
110924
|
if (process.platform === "win32") {
|
|
@@ -120415,7 +120418,7 @@ function logStructuredLog({ level, message }, processStream) {
|
|
|
120415
120418
|
return logger.info(message);
|
|
120416
120419
|
}
|
|
120417
120420
|
if (level === "debug") {
|
|
120418
|
-
return logger.
|
|
120421
|
+
return logger.info(message);
|
|
120419
120422
|
}
|
|
120420
120423
|
if (level === "error") {
|
|
120421
120424
|
return logger.error(getSourceMappedString(message));
|
|
@@ -121201,13 +121204,25 @@ var init_BaseController = __esm({
|
|
|
121201
121204
|
"src/api/startDevWorker/BaseController.ts"() {
|
|
121202
121205
|
init_import_meta_url();
|
|
121203
121206
|
import_node_events = require("events");
|
|
121207
|
+
init_logger();
|
|
121204
121208
|
TypedEventEmitterImpl = import_node_events.EventEmitter;
|
|
121205
121209
|
Controller = class extends TypedEventEmitterImpl {
|
|
121206
121210
|
static {
|
|
121207
121211
|
__name(this, "Controller");
|
|
121208
121212
|
}
|
|
121209
|
-
|
|
121210
|
-
|
|
121213
|
+
#tearingDown = false;
|
|
121214
|
+
async teardown() {
|
|
121215
|
+
this.#tearingDown = true;
|
|
121216
|
+
}
|
|
121217
|
+
emitErrorEvent(event) {
|
|
121218
|
+
if (this.#tearingDown) {
|
|
121219
|
+
logger.debug("Suppressing error event during teardown");
|
|
121220
|
+
logger.debug(`Error in ${event.source}: ${event.reason}
|
|
121221
|
+
`, event.cause);
|
|
121222
|
+
logger.debug("=> Error contextual data:", event.data);
|
|
121223
|
+
return;
|
|
121224
|
+
}
|
|
121225
|
+
this.emit("error", event);
|
|
121211
121226
|
}
|
|
121212
121227
|
};
|
|
121213
121228
|
RuntimeController = class extends Controller {
|
|
@@ -138432,7 +138447,7 @@ function getWranglerVersion() {
|
|
|
138432
138447
|
return version;
|
|
138433
138448
|
}
|
|
138434
138449
|
function getPlatform() {
|
|
138435
|
-
const platform3 =
|
|
138450
|
+
const platform3 = process.platform;
|
|
138436
138451
|
switch (platform3) {
|
|
138437
138452
|
case "win32":
|
|
138438
138453
|
return "Windows";
|
|
@@ -152299,7 +152314,7 @@ var require_main = __commonJS({
|
|
|
152299
152314
|
init_import_meta_url();
|
|
152300
152315
|
var fs25 = require("fs");
|
|
152301
152316
|
var path72 = require("path");
|
|
152302
|
-
var
|
|
152317
|
+
var os10 = require("os");
|
|
152303
152318
|
var crypto8 = require("crypto");
|
|
152304
152319
|
var packageJson = require_package();
|
|
152305
152320
|
var version5 = packageJson.version;
|
|
@@ -152405,7 +152420,7 @@ var require_main = __commonJS({
|
|
|
152405
152420
|
}
|
|
152406
152421
|
__name(_vaultPath, "_vaultPath");
|
|
152407
152422
|
function _resolveHome(envPath) {
|
|
152408
|
-
return envPath[0] === "~" ? path72.join(
|
|
152423
|
+
return envPath[0] === "~" ? path72.join(os10.homedir(), envPath.slice(1)) : envPath;
|
|
152409
152424
|
}
|
|
152410
152425
|
__name(_resolveHome, "_resolveHome");
|
|
152411
152426
|
function _configVault(options) {
|
|
@@ -172707,7 +172722,7 @@ var require_DocTypeReader = __commonJS({
|
|
|
172707
172722
|
i6 += 7;
|
|
172708
172723
|
[entityName, val, i6] = readEntityExp(xmlData, i6 + 1);
|
|
172709
172724
|
if (val.indexOf("&") === -1)
|
|
172710
|
-
entities[
|
|
172725
|
+
entities[validateEntityName2(entityName)] = {
|
|
172711
172726
|
regx: RegExp(`&${entityName};`, "g"),
|
|
172712
172727
|
val
|
|
172713
172728
|
};
|
|
@@ -172785,13 +172800,13 @@ var require_DocTypeReader = __commonJS({
|
|
|
172785
172800
|
return false;
|
|
172786
172801
|
}
|
|
172787
172802
|
__name(isNotation, "isNotation");
|
|
172788
|
-
function
|
|
172803
|
+
function validateEntityName2(name2) {
|
|
172789
172804
|
if (util3.isName(name2))
|
|
172790
172805
|
return name2;
|
|
172791
172806
|
else
|
|
172792
172807
|
throw new Error(`Invalid entity name ${name2}`);
|
|
172793
172808
|
}
|
|
172794
|
-
__name(
|
|
172809
|
+
__name(validateEntityName2, "validateEntityName");
|
|
172795
172810
|
module3.exports = readDocType;
|
|
172796
172811
|
}
|
|
172797
172812
|
});
|
|
@@ -200367,6 +200382,13 @@ var init_legacy_client = __esm({
|
|
|
200367
200382
|
});
|
|
200368
200383
|
|
|
200369
200384
|
// src/pipelines/validate.ts
|
|
200385
|
+
function validateEntityName(label, name2) {
|
|
200386
|
+
if (!name2.match(/^[a-zA-Z0-9_]+$/)) {
|
|
200387
|
+
throw new CommandLineArgsError(
|
|
200388
|
+
`${label} name must contain only letters, numbers, and underscores`
|
|
200389
|
+
);
|
|
200390
|
+
}
|
|
200391
|
+
}
|
|
200370
200392
|
function validateName2(label, name2) {
|
|
200371
200393
|
if (!name2.match(/^[a-zA-Z0-9-]+$/)) {
|
|
200372
200394
|
throw new UserError2(`Must provide a valid ${label}`);
|
|
@@ -200411,6 +200433,7 @@ var init_validate5 = __esm({
|
|
|
200411
200433
|
"src/pipelines/validate.ts"() {
|
|
200412
200434
|
init_import_meta_url();
|
|
200413
200435
|
init_errors();
|
|
200436
|
+
__name(validateEntityName, "validateEntityName");
|
|
200414
200437
|
__name(validateName2, "validateName");
|
|
200415
200438
|
__name(validateCorsOrigins, "validateCorsOrigins");
|
|
200416
200439
|
__name(validateInRange, "validateInRange");
|
|
@@ -200950,11 +200973,7 @@ async function setupPipelineNaming(providedName) {
|
|
|
200950
200973
|
if (!pipelineName) {
|
|
200951
200974
|
throw new UserError2("Pipeline name is required");
|
|
200952
200975
|
}
|
|
200953
|
-
|
|
200954
|
-
throw new UserError2(
|
|
200955
|
-
"Pipeline name must contain only letters, numbers, hyphens, and underscores"
|
|
200956
|
-
);
|
|
200957
|
-
}
|
|
200976
|
+
validateEntityName("pipeline", pipelineName);
|
|
200958
200977
|
const streamName = `${pipelineName}_stream`;
|
|
200959
200978
|
const sinkName = `${pipelineName}_sink`;
|
|
200960
200979
|
return {
|
|
@@ -201554,6 +201573,7 @@ var init_setup = __esm({
|
|
|
201554
201573
|
init_client7();
|
|
201555
201574
|
init_defaults();
|
|
201556
201575
|
init_pipelines2();
|
|
201576
|
+
init_validate5();
|
|
201557
201577
|
init_utils13();
|
|
201558
201578
|
pipelinesSetupCommand = createCommand({
|
|
201559
201579
|
metadata: {
|
|
@@ -201719,6 +201739,7 @@ var init_create6 = __esm({
|
|
|
201719
201739
|
init_client7();
|
|
201720
201740
|
init_defaults();
|
|
201721
201741
|
init_pipelines2();
|
|
201742
|
+
init_validate5();
|
|
201722
201743
|
init_utils14();
|
|
201723
201744
|
__name(parseSinkType, "parseSinkType");
|
|
201724
201745
|
pipelinesSinksCreateCommand = createCommand({
|
|
@@ -201802,6 +201823,7 @@ var init_create6 = __esm({
|
|
|
201802
201823
|
}
|
|
201803
201824
|
},
|
|
201804
201825
|
validateArgs: /* @__PURE__ */ __name((args) => {
|
|
201826
|
+
validateEntityName("sink", args.sink);
|
|
201805
201827
|
const sinkType = parseSinkType(args.type);
|
|
201806
201828
|
if (!isValidR2BucketName(args.bucket)) {
|
|
201807
201829
|
throw new CommandLineArgsError(
|
|
@@ -202138,6 +202160,7 @@ var init_create7 = __esm({
|
|
|
202138
202160
|
init_parse();
|
|
202139
202161
|
init_user3();
|
|
202140
202162
|
init_client7();
|
|
202163
|
+
init_validate5();
|
|
202141
202164
|
init_utils13();
|
|
202142
202165
|
pipelinesStreamsCreateCommand = createCommand({
|
|
202143
202166
|
metadata: {
|
|
@@ -202172,6 +202195,9 @@ var init_create7 = __esm({
|
|
|
202172
202195
|
array: true
|
|
202173
202196
|
}
|
|
202174
202197
|
},
|
|
202198
|
+
validateArgs: /* @__PURE__ */ __name((args) => {
|
|
202199
|
+
validateEntityName("stream", args.stream);
|
|
202200
|
+
}, "validateArgs"),
|
|
202175
202201
|
async handler(args, { config }) {
|
|
202176
202202
|
await requireAuth(config);
|
|
202177
202203
|
const streamName = args.stream;
|
|
@@ -218516,7 +218542,8 @@ function addBreadcrumb2(message, level = "log") {
|
|
|
218516
218542
|
}
|
|
218517
218543
|
async function captureGlobalException(e8) {
|
|
218518
218544
|
if (true) {
|
|
218519
|
-
|
|
218545
|
+
const sendErrorReportsEnvVar = getWranglerSendErrorReportsFromEnv();
|
|
218546
|
+
sentryReportingAllowed = sendErrorReportsEnvVar !== void 0 ? sendErrorReportsEnvVar : await confirm(
|
|
218520
218547
|
"Would you like to report this error to Cloudflare? Wrangler's output and the error details will be shared with the Wrangler team to help us diagnose and fix the issue.",
|
|
218521
218548
|
{ fallbackValue: false }
|
|
218522
218549
|
);
|
|
@@ -218542,6 +218569,7 @@ var init_sentry = __esm({
|
|
|
218542
218569
|
import_undici17 = __toESM(require_undici());
|
|
218543
218570
|
init_package();
|
|
218544
218571
|
init_dialogs();
|
|
218572
|
+
init_misc_variables();
|
|
218545
218573
|
init_logger();
|
|
218546
218574
|
sentryReportingAllowed = false;
|
|
218547
218575
|
makeSentry10Transport = /* @__PURE__ */ __name((options) => {
|
|
@@ -223513,8 +223541,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
223513
223541
|
sourceMaps: uploadSourceMaps ? loadSourceMaps(main2, modules, bundle) : void 0,
|
|
223514
223542
|
compatibility_date: compatibilityDate,
|
|
223515
223543
|
compatibility_flags: compatibilityFlags,
|
|
223516
|
-
keepVars: false,
|
|
223517
|
-
// the wrangler.toml should be the source-of-truth for vars
|
|
223544
|
+
keepVars: props.keepVars ?? false,
|
|
223518
223545
|
keepSecrets: true,
|
|
223519
223546
|
// until wrangler.toml specifies secret bindings, we need to inherit from the previous Worker Version
|
|
223520
223547
|
placement,
|
|
@@ -224042,7 +224069,7 @@ var init_upload5 = __esm({
|
|
|
224042
224069
|
outDir: args.outdir,
|
|
224043
224070
|
dryRun: args.dryRun,
|
|
224044
224071
|
noBundle: !(args.bundle ?? !config.no_bundle),
|
|
224045
|
-
keepVars:
|
|
224072
|
+
keepVars: config.keep_vars,
|
|
224046
224073
|
projectRoot: entry.projectRoot,
|
|
224047
224074
|
tag: args.tag,
|
|
224048
224075
|
message: args.message,
|
|
@@ -229599,7 +229626,7 @@ async function main(argv) {
|
|
|
229599
229626
|
logger.log(e8.message);
|
|
229600
229627
|
} else if (e8 instanceof Error && e8.message.includes("Raw mode is not supported on")) {
|
|
229601
229628
|
mayReport = false;
|
|
229602
|
-
const currentPlatform =
|
|
229629
|
+
const currentPlatform = process.platform;
|
|
229603
229630
|
const thisTerminalIsUnsupported = "This terminal doesn't support raw mode.";
|
|
229604
229631
|
const soWranglerWontWork = "Wrangler uses raw mode to read user input and write output to the terminal, and won't function correctly without it.";
|
|
229605
229632
|
const tryRunningItIn = "Try running your previous command in a terminal that supports raw mode";
|
|
@@ -229686,12 +229713,11 @@ ${tryRunningItIn}${oneOfThese}`
|
|
|
229686
229713
|
}
|
|
229687
229714
|
}
|
|
229688
229715
|
}
|
|
229689
|
-
var import_node_assert22,
|
|
229716
|
+
var import_node_assert22, import_node_path54, import_promises31, import_undici21;
|
|
229690
229717
|
var init_src2 = __esm({
|
|
229691
229718
|
"src/index.ts"() {
|
|
229692
229719
|
init_import_meta_url();
|
|
229693
229720
|
import_node_assert22 = __toESM(require("assert"));
|
|
229694
|
-
import_node_os7 = __toESM(require("os"));
|
|
229695
229721
|
import_node_path54 = require("path");
|
|
229696
229722
|
import_promises31 = require("timers/promises");
|
|
229697
229723
|
init_cli();
|
|
@@ -232847,6 +232873,7 @@ var init_BundlerController = __esm({
|
|
|
232847
232873
|
}
|
|
232848
232874
|
async teardown() {
|
|
232849
232875
|
logger.debug("BundlerController teardown beginning...");
|
|
232876
|
+
await super.teardown();
|
|
232850
232877
|
this.#customBuildAborter?.abort();
|
|
232851
232878
|
this.#tmpDir?.remove();
|
|
232852
232879
|
await Promise.all([
|
|
@@ -232983,12 +233010,12 @@ async function getPorts(options) {
|
|
|
232983
233010
|
}
|
|
232984
233011
|
throw new Error("No available ports found");
|
|
232985
233012
|
}
|
|
232986
|
-
var import_node_net,
|
|
233013
|
+
var import_node_net, import_node_os7, Locked, lockedPorts, releaseOldLockedPortsIntervalMs, timeout, getLocalHosts, checkAvailablePort, getAvailablePort, portCheckSequence;
|
|
232987
233014
|
var init_get_port = __esm({
|
|
232988
233015
|
"../../node_modules/.pnpm/get-port@7.0.0/node_modules/get-port/index.js"() {
|
|
232989
233016
|
init_import_meta_url();
|
|
232990
233017
|
import_node_net = __toESM(require("net"), 1);
|
|
232991
|
-
|
|
233018
|
+
import_node_os7 = __toESM(require("os"), 1);
|
|
232992
233019
|
Locked = class extends Error {
|
|
232993
233020
|
static {
|
|
232994
233021
|
__name(this, "Locked");
|
|
@@ -233003,7 +233030,7 @@ var init_get_port = __esm({
|
|
|
233003
233030
|
};
|
|
233004
233031
|
releaseOldLockedPortsIntervalMs = 1e3 * 15;
|
|
233005
233032
|
getLocalHosts = /* @__PURE__ */ __name(() => {
|
|
233006
|
-
const interfaces =
|
|
233033
|
+
const interfaces = import_node_os7.default.networkInterfaces();
|
|
233007
233034
|
const results = /* @__PURE__ */ new Set([void 0, "0.0.0.0"]);
|
|
233008
233035
|
for (const _interface of Object.values(interfaces)) {
|
|
233009
233036
|
for (const config of _interface) {
|
|
@@ -233411,7 +233438,6 @@ var init_ConfigController = __esm({
|
|
|
233411
233438
|
#printCurrentBindings;
|
|
233412
233439
|
#configWatcher;
|
|
233413
233440
|
#abortController;
|
|
233414
|
-
#tearingDown = false;
|
|
233415
233441
|
async #ensureWatchingConfig(configPath) {
|
|
233416
233442
|
await this.#configWatcher?.close();
|
|
233417
233443
|
if (configPath) {
|
|
@@ -233427,17 +233453,28 @@ var init_ConfigController = __esm({
|
|
|
233427
233453
|
this.latestInput,
|
|
233428
233454
|
"Cannot be watching config without having first set an input"
|
|
233429
233455
|
);
|
|
233430
|
-
|
|
233456
|
+
logger.debug("config file changed", configPath);
|
|
233457
|
+
this.#updateConfig(this.latestInput).catch((err) => {
|
|
233458
|
+
this.emitErrorEvent({
|
|
233459
|
+
type: "error",
|
|
233460
|
+
reason: "Error resolving config after change",
|
|
233461
|
+
cause: castErrorCause(err),
|
|
233462
|
+
source: "ConfigController",
|
|
233463
|
+
data: void 0
|
|
233464
|
+
});
|
|
233465
|
+
});
|
|
233431
233466
|
});
|
|
233432
233467
|
}
|
|
233433
233468
|
}
|
|
233434
233469
|
set(input, throwErrors = false) {
|
|
233470
|
+
logger.debug("setting config");
|
|
233435
233471
|
return runWithLogLevel(
|
|
233436
233472
|
input.dev?.logLevel,
|
|
233437
233473
|
() => this.#updateConfig(input, throwErrors)
|
|
233438
233474
|
);
|
|
233439
233475
|
}
|
|
233440
233476
|
patch(input) {
|
|
233477
|
+
logger.debug("patching config");
|
|
233441
233478
|
(0, import_node_assert27.default)(
|
|
233442
233479
|
this.latestInput,
|
|
233443
233480
|
"Cannot call updateConfig without previously calling setConfig"
|
|
@@ -233452,9 +233489,11 @@ var init_ConfigController = __esm({
|
|
|
233452
233489
|
);
|
|
233453
233490
|
}
|
|
233454
233491
|
async #updateConfig(input, throwErrors = false) {
|
|
233455
|
-
|
|
233456
|
-
|
|
233457
|
-
|
|
233492
|
+
logger.debug(
|
|
233493
|
+
"Updating config...",
|
|
233494
|
+
this.#abortController?.signal,
|
|
233495
|
+
this.#configWatcher?.closed
|
|
233496
|
+
);
|
|
233458
233497
|
this.#abortController?.abort();
|
|
233459
233498
|
this.#abortController = new AbortController();
|
|
233460
233499
|
const signal = this.#abortController.signal;
|
|
@@ -233476,11 +233515,8 @@ var init_ConfigController = __esm({
|
|
|
233476
233515
|
if (!getDisableConfigWatching()) {
|
|
233477
233516
|
await this.#ensureWatchingConfig(fileConfig.configPath);
|
|
233478
233517
|
}
|
|
233479
|
-
if (this.#tearingDown || signal.aborted) {
|
|
233480
|
-
return;
|
|
233481
|
-
}
|
|
233482
233518
|
const { config: resolvedConfig, printCurrentBindings } = await resolveConfig(fileConfig, input);
|
|
233483
|
-
if (
|
|
233519
|
+
if (signal.aborted) {
|
|
233484
233520
|
return;
|
|
233485
233521
|
}
|
|
233486
233522
|
this.latestConfig = resolvedConfig;
|
|
@@ -233488,9 +233524,14 @@ var init_ConfigController = __esm({
|
|
|
233488
233524
|
this.emitConfigUpdateEvent(resolvedConfig);
|
|
233489
233525
|
return this.latestConfig;
|
|
233490
233526
|
} catch (err) {
|
|
233527
|
+
logger.debug("Error updating config", err.stack);
|
|
233491
233528
|
if (throwErrors) {
|
|
233492
233529
|
throw err;
|
|
233493
233530
|
} else {
|
|
233531
|
+
if (this.#configWatcher?.closed) {
|
|
233532
|
+
logger.debug("Suppressing config error after watcher closed");
|
|
233533
|
+
return;
|
|
233534
|
+
}
|
|
233494
233535
|
this.emitErrorEvent({
|
|
233495
233536
|
type: "error",
|
|
233496
233537
|
reason: "Error resolving config",
|
|
@@ -233509,7 +233550,7 @@ var init_ConfigController = __esm({
|
|
|
233509
233550
|
}
|
|
233510
233551
|
async teardown() {
|
|
233511
233552
|
logger.debug("ConfigController teardown beginning...");
|
|
233512
|
-
|
|
233553
|
+
await super.teardown();
|
|
233513
233554
|
this.#abortController?.abort();
|
|
233514
233555
|
await this.#configWatcher?.close();
|
|
233515
233556
|
logger.debug("ConfigController teardown complete");
|
|
@@ -233773,12 +233814,11 @@ function maybeHandleNetworkLoadResource(url4, bundle, tmpDir) {
|
|
|
233773
233814
|
return (0, import_fs29.readFileSync)(filePath, "utf-8");
|
|
233774
233815
|
}
|
|
233775
233816
|
}
|
|
233776
|
-
var import_fs29,
|
|
233817
|
+
var import_fs29, import_node_url12, import_path28, import_open2, mapConsoleAPIMessageTypeToConsoleMethod, openInspector;
|
|
233777
233818
|
var init_inspect2 = __esm({
|
|
233778
233819
|
"src/dev/inspect.ts"() {
|
|
233779
233820
|
init_import_meta_url();
|
|
233780
233821
|
import_fs29 = require("fs");
|
|
233781
|
-
import_node_os9 = __toESM(require("os"));
|
|
233782
233822
|
import_node_url12 = require("url");
|
|
233783
233823
|
import_path28 = __toESM(require("path"));
|
|
233784
233824
|
import_open2 = __toESM(require_open());
|
|
@@ -233818,7 +233858,7 @@ var init_inspect2 = __esm({
|
|
|
233818
233858
|
const url4 = `https://devtools.devprod.cloudflare.dev/js_app?${query.toString()}`;
|
|
233819
233859
|
const errorMessage = "Failed to open inspector.\nInspector depends on having a Chromium-based browser installed, maybe you need to install one?";
|
|
233820
233860
|
let braveBrowser;
|
|
233821
|
-
switch (
|
|
233861
|
+
switch (process.platform) {
|
|
233822
233862
|
case "darwin":
|
|
233823
233863
|
case "win32":
|
|
233824
233864
|
braveBrowser = "Brave";
|
|
@@ -252584,6 +252624,7 @@ var init_ProxyController = __esm({
|
|
|
252584
252624
|
}
|
|
252585
252625
|
_torndown = false;
|
|
252586
252626
|
async teardown() {
|
|
252627
|
+
await super.teardown();
|
|
252587
252628
|
logger.debug("ProxyController teardown beginning...");
|
|
252588
252629
|
this._torndown = true;
|
|
252589
252630
|
const { proxyWorker } = this;
|
|
@@ -253287,6 +253328,7 @@ var init_RemoteRuntimeController = __esm({
|
|
|
253287
253328
|
notImplemented(this.onPreviewTokenExpired.name, this.constructor.name);
|
|
253288
253329
|
}
|
|
253289
253330
|
async teardown() {
|
|
253331
|
+
await super.teardown();
|
|
253290
253332
|
if (this.#session) {
|
|
253291
253333
|
logger.log(source_default.dim("\u2394 Shutting down remote preview..."));
|
|
253292
253334
|
}
|
|
@@ -253887,9 +253929,8 @@ var init_LocalRuntimeController = __esm({
|
|
|
253887
253929
|
// current container that is being built
|
|
253888
253930
|
containerBeingBuilt;
|
|
253889
253931
|
onBundleStart(_5) {
|
|
253890
|
-
process.
|
|
253891
|
-
|
|
253892
|
-
});
|
|
253932
|
+
process.off("exit", this.cleanupContainers);
|
|
253933
|
+
process.on("exit", this.cleanupContainers);
|
|
253893
253934
|
}
|
|
253894
253935
|
async #onBundleComplete(data, id) {
|
|
253895
253936
|
try {
|
|
@@ -254054,6 +254095,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
254054
254095
|
}, "cleanupContainers");
|
|
254055
254096
|
#teardown = /* @__PURE__ */ __name(async () => {
|
|
254056
254097
|
logger.debug("LocalRuntimeController teardown beginning...");
|
|
254098
|
+
process.off("exit", this.cleanupContainers);
|
|
254057
254099
|
if (this.#mf) {
|
|
254058
254100
|
logger.log(source_default.dim("\u2394 Shutting down local server..."));
|
|
254059
254101
|
}
|
|
@@ -254067,6 +254109,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
254067
254109
|
logger.debug("LocalRuntimeController teardown complete");
|
|
254068
254110
|
}, "#teardown");
|
|
254069
254111
|
async teardown() {
|
|
254112
|
+
await super.teardown();
|
|
254070
254113
|
return this.#mutex.runWith(this.#teardown);
|
|
254071
254114
|
}
|
|
254072
254115
|
// *********************
|
|
@@ -254335,6 +254378,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
|
254335
254378
|
logger.debug("MultiworkerRuntimeController teardown complete");
|
|
254336
254379
|
}, "#teardown");
|
|
254337
254380
|
async teardown() {
|
|
254381
|
+
await super.teardown();
|
|
254338
254382
|
return this.#mutex.runWith(this.#teardown);
|
|
254339
254383
|
}
|
|
254340
254384
|
};
|
|
@@ -254359,8 +254403,6 @@ var init_NoOpProxyController = __esm({
|
|
|
254359
254403
|
}
|
|
254360
254404
|
onReloadComplete(_data5) {
|
|
254361
254405
|
}
|
|
254362
|
-
async teardown() {
|
|
254363
|
-
}
|
|
254364
254406
|
};
|
|
254365
254407
|
}
|
|
254366
254408
|
});
|