wrangler 3.99.0 → 3.100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +9 -9
- package/wrangler-dist/cli.js +214 -205
- package/wrangler-dist/cli.js.map +7 -0
package/wrangler-dist/cli.js
CHANGED
@@ -17534,7 +17534,7 @@ var require_XDG = __commonJS({
|
|
17534
17534
|
exports2.__esModule = true;
|
17535
17535
|
exports2.Adapt = void 0;
|
17536
17536
|
function Adapt(adapter_) {
|
17537
|
-
var
|
17537
|
+
var env5 = adapter_.env, osPaths = adapter_.osPaths, path70 = adapter_.path;
|
17538
17538
|
var isMacOS = /^darwin$/i.test(adapter_.process.platform);
|
17539
17539
|
var isWinOS = /^win/i.test(adapter_.process.platform);
|
17540
17540
|
function baseDir() {
|
@@ -17547,63 +17547,63 @@ var require_XDG = __commonJS({
|
|
17547
17547
|
__name(valOrPath, "valOrPath");
|
17548
17548
|
var linux = /* @__PURE__ */ __name(function() {
|
17549
17549
|
var cache2 = /* @__PURE__ */ __name(function() {
|
17550
|
-
return valOrPath(
|
17550
|
+
return valOrPath(env5.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
|
17551
17551
|
}, "cache");
|
17552
17552
|
var config = /* @__PURE__ */ __name(function() {
|
17553
|
-
return valOrPath(
|
17553
|
+
return valOrPath(env5.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
|
17554
17554
|
}, "config");
|
17555
17555
|
var data = /* @__PURE__ */ __name(function() {
|
17556
|
-
return valOrPath(
|
17556
|
+
return valOrPath(env5.get("XDG_DATA_HOME"), [baseDir(), ".local", "share"]);
|
17557
17557
|
}, "data");
|
17558
17558
|
var runtime = /* @__PURE__ */ __name(function() {
|
17559
|
-
return
|
17559
|
+
return env5.get("XDG_RUNTIME_DIR") || void 0;
|
17560
17560
|
}, "runtime");
|
17561
17561
|
var state = /* @__PURE__ */ __name(function() {
|
17562
|
-
return valOrPath(
|
17562
|
+
return valOrPath(env5.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
|
17563
17563
|
}, "state");
|
17564
17564
|
return { cache: cache2, config, data, runtime, state };
|
17565
17565
|
}, "linux");
|
17566
17566
|
var macos = /* @__PURE__ */ __name(function() {
|
17567
17567
|
var cache2 = /* @__PURE__ */ __name(function() {
|
17568
|
-
return valOrPath(
|
17568
|
+
return valOrPath(env5.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
|
17569
17569
|
}, "cache");
|
17570
17570
|
var config = /* @__PURE__ */ __name(function() {
|
17571
|
-
return valOrPath(
|
17571
|
+
return valOrPath(env5.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
|
17572
17572
|
}, "config");
|
17573
17573
|
var data = /* @__PURE__ */ __name(function() {
|
17574
|
-
return valOrPath(
|
17574
|
+
return valOrPath(env5.get("XDG_DATA_HOME"), [baseDir(), "Library", "Application Support"]);
|
17575
17575
|
}, "data");
|
17576
17576
|
var runtime = /* @__PURE__ */ __name(function() {
|
17577
|
-
return
|
17577
|
+
return env5.get("XDG_RUNTIME_DIR") || void 0;
|
17578
17578
|
}, "runtime");
|
17579
17579
|
var state = /* @__PURE__ */ __name(function() {
|
17580
|
-
return valOrPath(
|
17580
|
+
return valOrPath(env5.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
|
17581
17581
|
}, "state");
|
17582
17582
|
return { cache: cache2, config, data, runtime, state };
|
17583
17583
|
}, "macos");
|
17584
17584
|
var windows = /* @__PURE__ */ __name(function() {
|
17585
17585
|
function appData() {
|
17586
|
-
return valOrPath(
|
17586
|
+
return valOrPath(env5.get("APPDATA"), [baseDir(), "AppData", "Roaming"]);
|
17587
17587
|
}
|
17588
17588
|
__name(appData, "appData");
|
17589
17589
|
function localAppData() {
|
17590
|
-
return valOrPath(
|
17590
|
+
return valOrPath(env5.get("LOCALAPPDATA"), [baseDir(), "AppData", "Local"]);
|
17591
17591
|
}
|
17592
17592
|
__name(localAppData, "localAppData");
|
17593
17593
|
var cache2 = /* @__PURE__ */ __name(function() {
|
17594
|
-
return valOrPath(
|
17594
|
+
return valOrPath(env5.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
|
17595
17595
|
}, "cache");
|
17596
17596
|
var config = /* @__PURE__ */ __name(function() {
|
17597
|
-
return valOrPath(
|
17597
|
+
return valOrPath(env5.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
|
17598
17598
|
}, "config");
|
17599
17599
|
var data = /* @__PURE__ */ __name(function() {
|
17600
|
-
return valOrPath(
|
17600
|
+
return valOrPath(env5.get("XDG_DATA_HOME"), [appData(), "xdg.data"]);
|
17601
17601
|
}, "data");
|
17602
17602
|
var runtime = /* @__PURE__ */ __name(function() {
|
17603
|
-
return
|
17603
|
+
return env5.get("XDG_RUNTIME_DIR") || void 0;
|
17604
17604
|
}, "runtime");
|
17605
17605
|
var state = /* @__PURE__ */ __name(function() {
|
17606
|
-
return valOrPath(
|
17606
|
+
return valOrPath(env5.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
|
17607
17607
|
}, "state");
|
17608
17608
|
return { cache: cache2, config, data, runtime, state };
|
17609
17609
|
}, "windows");
|
@@ -17620,11 +17620,11 @@ var require_XDG = __commonJS({
|
|
17620
17620
|
XDG.runtime = extension.runtime;
|
17621
17621
|
XDG.state = extension.state;
|
17622
17622
|
XDG.configDirs = /* @__PURE__ */ __name(function configDirs() {
|
17623
|
-
var pathList =
|
17623
|
+
var pathList = env5.get("XDG_CONFIG_DIRS");
|
17624
17624
|
return __spreadArray([extension.config()], pathList ? pathList.split(path70.delimiter) : []);
|
17625
17625
|
}, "configDirs");
|
17626
17626
|
XDG.dataDirs = /* @__PURE__ */ __name(function dataDirs() {
|
17627
|
-
var pathList =
|
17627
|
+
var pathList = env5.get("XDG_DATA_DIRS");
|
17628
17628
|
return __spreadArray([extension.data()], pathList ? pathList.split(path70.delimiter) : []);
|
17629
17629
|
}, "dataDirs");
|
17630
17630
|
return XDG;
|
@@ -17656,7 +17656,7 @@ var require_OSPaths = __commonJS({
|
|
17656
17656
|
}
|
17657
17657
|
__name(isEmpty, "isEmpty");
|
17658
17658
|
function Adapt(adapter_) {
|
17659
|
-
var
|
17659
|
+
var env5 = adapter_.env, os13 = adapter_.os, path70 = adapter_.path;
|
17660
17660
|
var isWinOS = /^win/i.test(adapter_.process.platform);
|
17661
17661
|
function normalizePath(path_) {
|
17662
17662
|
return path_ ? adapter_.path.normalize(adapter_.path.join(path_, ".")) : void 0;
|
@@ -17664,14 +17664,14 @@ var require_OSPaths = __commonJS({
|
|
17664
17664
|
__name(normalizePath, "normalizePath");
|
17665
17665
|
function home() {
|
17666
17666
|
var posix2 = /* @__PURE__ */ __name(function() {
|
17667
|
-
return normalizePath((typeof os13.homedir === "function" ? os13.homedir() : void 0) ||
|
17667
|
+
return normalizePath((typeof os13.homedir === "function" ? os13.homedir() : void 0) || env5.get("HOME"));
|
17668
17668
|
}, "posix");
|
17669
17669
|
var windows = /* @__PURE__ */ __name(function() {
|
17670
17670
|
var priorityList = [
|
17671
17671
|
typeof os13.homedir === "function" ? os13.homedir() : void 0,
|
17672
|
-
|
17673
|
-
|
17674
|
-
|
17672
|
+
env5.get("USERPROFILE"),
|
17673
|
+
env5.get("HOME"),
|
17674
|
+
env5.get("HOMEDRIVE") || env5.get("HOMEPATH") ? path70.join(env5.get("HOMEDRIVE") || "", env5.get("HOMEPATH") || "") : void 0
|
17675
17675
|
];
|
17676
17676
|
return normalizePath(priorityList.find(function(v2) {
|
17677
17677
|
return !isEmpty(v2);
|
@@ -17689,9 +17689,9 @@ var require_OSPaths = __commonJS({
|
|
17689
17689
|
var fallback = "/tmp";
|
17690
17690
|
var priorityList = [
|
17691
17691
|
typeof os13.tmpdir === "function" ? os13.tmpdir() : void 0,
|
17692
|
-
|
17693
|
-
|
17694
|
-
|
17692
|
+
env5.get("TMPDIR"),
|
17693
|
+
env5.get("TEMP"),
|
17694
|
+
env5.get("TMP")
|
17695
17695
|
];
|
17696
17696
|
return normalizePath(priorityList.find(function(v2) {
|
17697
17697
|
return !isEmpty(v2);
|
@@ -17705,28 +17705,28 @@ var require_OSPaths = __commonJS({
|
|
17705
17705
|
return void 0;
|
17706
17706
|
},
|
17707
17707
|
function() {
|
17708
|
-
return
|
17708
|
+
return env5.get("TEMP");
|
17709
17709
|
},
|
17710
17710
|
function() {
|
17711
|
-
return
|
17711
|
+
return env5.get("TMP");
|
17712
17712
|
},
|
17713
17713
|
function() {
|
17714
|
-
return joinPathToBase(
|
17714
|
+
return joinPathToBase(env5.get("LOCALAPPDATA"), ["Temp"]);
|
17715
17715
|
},
|
17716
17716
|
function() {
|
17717
17717
|
return joinPathToBase(home(), ["AppData", "Local", "Temp"]);
|
17718
17718
|
},
|
17719
17719
|
function() {
|
17720
|
-
return joinPathToBase(
|
17720
|
+
return joinPathToBase(env5.get("ALLUSERSPROFILE"), ["Temp"]);
|
17721
17721
|
},
|
17722
17722
|
function() {
|
17723
|
-
return joinPathToBase(
|
17723
|
+
return joinPathToBase(env5.get("SystemRoot"), ["Temp"]);
|
17724
17724
|
},
|
17725
17725
|
function() {
|
17726
|
-
return joinPathToBase(
|
17726
|
+
return joinPathToBase(env5.get("windir"), ["Temp"]);
|
17727
17727
|
},
|
17728
17728
|
function() {
|
17729
|
-
return joinPathToBase(
|
17729
|
+
return joinPathToBase(env5.get("SystemDrive"), ["\\", "Temp"]);
|
17730
17730
|
}
|
17731
17731
|
];
|
17732
17732
|
var v2 = priorityListLazy.find(function(v3) {
|
@@ -18502,15 +18502,15 @@ var require_supports_colors = __commonJS({
|
|
18502
18502
|
init_import_meta_url();
|
18503
18503
|
var os13 = require("os");
|
18504
18504
|
var hasFlag3 = require_has_flag();
|
18505
|
-
var
|
18505
|
+
var env5 = process.env;
|
18506
18506
|
var forceColor = void 0;
|
18507
18507
|
if (hasFlag3("no-color") || hasFlag3("no-colors") || hasFlag3("color=false")) {
|
18508
18508
|
forceColor = false;
|
18509
18509
|
} else if (hasFlag3("color") || hasFlag3("colors") || hasFlag3("color=true") || hasFlag3("color=always")) {
|
18510
18510
|
forceColor = true;
|
18511
18511
|
}
|
18512
|
-
if ("FORCE_COLOR" in
|
18513
|
-
forceColor =
|
18512
|
+
if ("FORCE_COLOR" in env5) {
|
18513
|
+
forceColor = env5.FORCE_COLOR.length === 0 || parseInt(env5.FORCE_COLOR, 10) !== 0;
|
18514
18514
|
}
|
18515
18515
|
function translateLevel3(level) {
|
18516
18516
|
if (level === 0) {
|
@@ -18545,20 +18545,20 @@ var require_supports_colors = __commonJS({
|
|
18545
18545
|
}
|
18546
18546
|
return 1;
|
18547
18547
|
}
|
18548
|
-
if ("CI" in
|
18548
|
+
if ("CI" in env5) {
|
18549
18549
|
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI"].some(function(sign) {
|
18550
|
-
return sign in
|
18551
|
-
}) ||
|
18550
|
+
return sign in env5;
|
18551
|
+
}) || env5.CI_NAME === "codeship") {
|
18552
18552
|
return 1;
|
18553
18553
|
}
|
18554
18554
|
return min;
|
18555
18555
|
}
|
18556
|
-
if ("TEAMCITY_VERSION" in
|
18557
|
-
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(
|
18556
|
+
if ("TEAMCITY_VERSION" in env5) {
|
18557
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env5.TEAMCITY_VERSION) ? 1 : 0;
|
18558
18558
|
}
|
18559
|
-
if ("TERM_PROGRAM" in
|
18560
|
-
var version4 = parseInt((
|
18561
|
-
switch (
|
18559
|
+
if ("TERM_PROGRAM" in env5) {
|
18560
|
+
var version4 = parseInt((env5.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
18561
|
+
switch (env5.TERM_PROGRAM) {
|
18562
18562
|
case "iTerm.app":
|
18563
18563
|
return version4 >= 3 ? 3 : 2;
|
18564
18564
|
case "Hyper":
|
@@ -18567,16 +18567,16 @@ var require_supports_colors = __commonJS({
|
|
18567
18567
|
return 2;
|
18568
18568
|
}
|
18569
18569
|
}
|
18570
|
-
if (/-256(color)?$/i.test(
|
18570
|
+
if (/-256(color)?$/i.test(env5.TERM)) {
|
18571
18571
|
return 2;
|
18572
18572
|
}
|
18573
|
-
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(
|
18573
|
+
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env5.TERM)) {
|
18574
18574
|
return 1;
|
18575
18575
|
}
|
18576
|
-
if ("COLORTERM" in
|
18576
|
+
if ("COLORTERM" in env5) {
|
18577
18577
|
return 1;
|
18578
18578
|
}
|
18579
|
-
if (
|
18579
|
+
if (env5.TERM === "dumb") {
|
18580
18580
|
return min;
|
18581
18581
|
}
|
18582
18582
|
return min;
|
@@ -22930,8 +22930,8 @@ var require_picocolors = __commonJS({
|
|
22930
22930
|
"../../node_modules/.pnpm/picocolors@1.0.1/node_modules/picocolors/picocolors.js"(exports2, module3) {
|
22931
22931
|
init_import_meta_url();
|
22932
22932
|
var argv = process.argv || [];
|
22933
|
-
var
|
22934
|
-
var isColorSupported = !("NO_COLOR" in
|
22933
|
+
var env5 = process.env;
|
22934
|
+
var isColorSupported = !("NO_COLOR" in env5 || argv.includes("--no-color")) && ("FORCE_COLOR" in env5 || argv.includes("--color") || process.platform === "win32" || require != null && require("tty").isatty(1) && env5.TERM !== "dumb" || "CI" in env5);
|
22935
22935
|
var formatter = /* @__PURE__ */ __name((open3, close2, replace = open3) => (input) => {
|
22936
22936
|
let string = "" + input;
|
22937
22937
|
let index = string.indexOf(close2, open3.length);
|
@@ -23469,7 +23469,7 @@ var require_ci_info = __commonJS({
|
|
23469
23469
|
"use strict";
|
23470
23470
|
init_import_meta_url();
|
23471
23471
|
var vendors = require_vendors();
|
23472
|
-
var
|
23472
|
+
var env5 = process.env;
|
23473
23473
|
Object.defineProperty(exports2, "_vendors", {
|
23474
23474
|
value: vendors.map(function(v2) {
|
23475
23475
|
return v2.constant;
|
@@ -23489,14 +23489,14 @@ var require_ci_info = __commonJS({
|
|
23489
23489
|
exports2.name = vendor.name;
|
23490
23490
|
switch (typeof vendor.pr) {
|
23491
23491
|
case "string":
|
23492
|
-
exports2.isPR = !!
|
23492
|
+
exports2.isPR = !!env5[vendor.pr];
|
23493
23493
|
break;
|
23494
23494
|
case "object":
|
23495
23495
|
if ("env" in vendor.pr) {
|
23496
|
-
exports2.isPR = vendor.pr.env in
|
23496
|
+
exports2.isPR = vendor.pr.env in env5 && env5[vendor.pr.env] !== vendor.pr.ne;
|
23497
23497
|
} else if ("any" in vendor.pr) {
|
23498
23498
|
exports2.isPR = vendor.pr.any.some(function(key) {
|
23499
|
-
return !!
|
23499
|
+
return !!env5[key];
|
23500
23500
|
});
|
23501
23501
|
} else {
|
23502
23502
|
exports2.isPR = checkEnv(vendor.pr);
|
@@ -23506,30 +23506,30 @@ var require_ci_info = __commonJS({
|
|
23506
23506
|
exports2.isPR = null;
|
23507
23507
|
}
|
23508
23508
|
});
|
23509
|
-
exports2.isCI = !!(
|
23510
|
-
(
|
23511
|
-
|
23512
|
-
|
23513
|
-
|
23514
|
-
|
23515
|
-
|
23516
|
-
|
23517
|
-
|
23518
|
-
|
23509
|
+
exports2.isCI = !!(env5.CI !== "false" && // Bypass all checks if CI env is explicitly set to 'false'
|
23510
|
+
(env5.BUILD_ID || // Jenkins, Cloudbees
|
23511
|
+
env5.BUILD_NUMBER || // Jenkins, TeamCity
|
23512
|
+
env5.CI || // Travis CI, CircleCI, Cirrus CI, Gitlab CI, Appveyor, CodeShip, dsari
|
23513
|
+
env5.CI_APP_ID || // Appflow
|
23514
|
+
env5.CI_BUILD_ID || // Appflow
|
23515
|
+
env5.CI_BUILD_NUMBER || // Appflow
|
23516
|
+
env5.CI_NAME || // Codeship and others
|
23517
|
+
env5.CONTINUOUS_INTEGRATION || // Travis CI, Cirrus CI
|
23518
|
+
env5.RUN_ID || // TaskCluster, dsari
|
23519
23519
|
exports2.name || false));
|
23520
23520
|
function checkEnv(obj) {
|
23521
23521
|
if (typeof obj === "string")
|
23522
|
-
return !!
|
23522
|
+
return !!env5[obj];
|
23523
23523
|
if ("env" in obj) {
|
23524
|
-
return
|
23524
|
+
return env5[obj.env] && env5[obj.env].includes(obj.includes);
|
23525
23525
|
}
|
23526
23526
|
if ("any" in obj) {
|
23527
23527
|
return obj.any.some(function(k2) {
|
23528
|
-
return !!
|
23528
|
+
return !!env5[k2];
|
23529
23529
|
});
|
23530
23530
|
}
|
23531
23531
|
return Object.keys(obj).every(function(k2) {
|
23532
|
-
return
|
23532
|
+
return env5[k2] === obj[k2];
|
23533
23533
|
});
|
23534
23534
|
}
|
23535
23535
|
__name(checkEnv, "checkEnv");
|
@@ -30615,11 +30615,11 @@ var require_utils3 = __commonJS({
|
|
30615
30615
|
var content = file.apply(null, arguments);
|
30616
30616
|
return content ? parse6(content) : null;
|
30617
30617
|
};
|
30618
|
-
var
|
30619
|
-
|
30618
|
+
var env5 = exports2.env = function(prefix, env6) {
|
30619
|
+
env6 = env6 || process.env;
|
30620
30620
|
var obj = {};
|
30621
30621
|
var l2 = prefix.length;
|
30622
|
-
for (var k2 in
|
30622
|
+
for (var k2 in env6) {
|
30623
30623
|
if (k2.toLowerCase().indexOf(prefix.toLowerCase()) === 0) {
|
30624
30624
|
var keypath = k2.substring(l2).split("__");
|
30625
30625
|
var _emptyStringIndex;
|
@@ -30631,7 +30631,7 @@ var require_utils3 = __commonJS({
|
|
30631
30631
|
if (!_subkey || typeof cursor !== "object")
|
30632
30632
|
return;
|
30633
30633
|
if (i === keypath.length - 1)
|
30634
|
-
cursor[_subkey] =
|
30634
|
+
cursor[_subkey] = env6[k2];
|
30635
30635
|
if (cursor[_subkey] === void 0)
|
30636
30636
|
cursor[_subkey] = {};
|
30637
30637
|
cursor = cursor[_subkey];
|
@@ -30977,7 +30977,7 @@ var require_rc = __commonJS({
|
|
30977
30977
|
argv = require_minimist()(process.argv.slice(2));
|
30978
30978
|
defaults = ("string" === typeof defaults ? cc.json(defaults) : defaults) || {};
|
30979
30979
|
parse6 = parse6 || cc.parse;
|
30980
|
-
var
|
30980
|
+
var env5 = cc.env(name2 + "_");
|
30981
30981
|
var configs = [defaults];
|
30982
30982
|
var configFiles = [];
|
30983
30983
|
function addConfigFile(file) {
|
@@ -31003,12 +31003,12 @@ var require_rc = __commonJS({
|
|
31003
31003
|
join17(home, "." + name2 + "rc")
|
31004
31004
|
].forEach(addConfigFile);
|
31005
31005
|
addConfigFile(cc.find("." + name2 + "rc"));
|
31006
|
-
if (
|
31007
|
-
addConfigFile(
|
31006
|
+
if (env5.config)
|
31007
|
+
addConfigFile(env5.config);
|
31008
31008
|
if (argv.config)
|
31009
31009
|
addConfigFile(argv.config);
|
31010
31010
|
return deepExtend.apply(null, configs.concat([
|
31011
|
-
|
31011
|
+
env5,
|
31012
31012
|
argv,
|
31013
31013
|
configFiles.length ? { configs: configFiles, config: configFiles[configFiles.length - 1] } : void 0
|
31014
31014
|
]));
|
@@ -35838,7 +35838,7 @@ var require_resolveCommand = __commonJS({
|
|
35838
35838
|
var which = require_which();
|
35839
35839
|
var getPathKey = require_path_key();
|
35840
35840
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
35841
|
-
const
|
35841
|
+
const env5 = parsed.options.env || process.env;
|
35842
35842
|
const cwd2 = process.cwd();
|
35843
35843
|
const hasCustomCwd = parsed.options.cwd != null;
|
35844
35844
|
const shouldSwitchCwd = hasCustomCwd && process.chdir !== void 0 && !process.chdir.disabled;
|
@@ -35851,7 +35851,7 @@ var require_resolveCommand = __commonJS({
|
|
35851
35851
|
let resolved;
|
35852
35852
|
try {
|
35853
35853
|
resolved = which.sync(parsed.command, {
|
35854
|
-
path:
|
35854
|
+
path: env5[getPathKey({ env: env5 })],
|
35855
35855
|
pathExt: withoutPathExt ? path70.delimiter : void 0
|
35856
35856
|
});
|
35857
35857
|
} catch (e3) {
|
@@ -36129,13 +36129,13 @@ var init_strip_final_newline = __esm({
|
|
36129
36129
|
// ../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js
|
36130
36130
|
function pathKey(options30 = {}) {
|
36131
36131
|
const {
|
36132
|
-
env:
|
36132
|
+
env: env5 = process.env,
|
36133
36133
|
platform: platform2 = process.platform
|
36134
36134
|
} = options30;
|
36135
36135
|
if (platform2 !== "win32") {
|
36136
36136
|
return "PATH";
|
36137
36137
|
}
|
36138
|
-
return Object.keys(
|
36138
|
+
return Object.keys(env5).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
|
36139
36139
|
}
|
36140
36140
|
var init_path_key = __esm({
|
36141
36141
|
"../../node_modules/.pnpm/path-key@4.0.0/node_modules/path-key/index.js"() {
|
@@ -36163,12 +36163,12 @@ function npmRunPath(options30 = {}) {
|
|
36163
36163
|
result.push(import_node_path22.default.resolve(cwdString, execPath, ".."));
|
36164
36164
|
return [...result, path_].join(import_node_path22.default.delimiter);
|
36165
36165
|
}
|
36166
|
-
function npmRunPathEnv({ env:
|
36167
|
-
|
36168
|
-
const path70 = pathKey({ env:
|
36169
|
-
options30.path =
|
36170
|
-
|
36171
|
-
return
|
36166
|
+
function npmRunPathEnv({ env: env5 = import_node_process8.default.env, ...options30 } = {}) {
|
36167
|
+
env5 = { ...env5 };
|
36168
|
+
const path70 = pathKey({ env: env5 });
|
36169
|
+
options30.path = env5[path70];
|
36170
|
+
env5[path70] = npmRunPath(options30);
|
36171
|
+
return env5;
|
36172
36172
|
}
|
36173
36173
|
var import_node_process8, import_node_path22, import_node_url9;
|
36174
36174
|
var init_npm_run_path = __esm({
|
@@ -37308,11 +37308,11 @@ var init_execa = __esm({
|
|
37308
37308
|
init_command();
|
37309
37309
|
DEFAULT_MAX_BUFFER = 1e3 * 1e3 * 100;
|
37310
37310
|
getEnv = /* @__PURE__ */ __name(({ env: envOption, extendEnv, preferLocal, localDir, execPath }) => {
|
37311
|
-
const
|
37311
|
+
const env5 = extendEnv ? { ...import_node_process9.default.env, ...envOption } : envOption;
|
37312
37312
|
if (preferLocal) {
|
37313
|
-
return npmRunPathEnv({ env:
|
37313
|
+
return npmRunPathEnv({ env: env5, cwd: localDir, execPath });
|
37314
37314
|
}
|
37315
|
-
return
|
37315
|
+
return env5;
|
37316
37316
|
}, "getEnv");
|
37317
37317
|
handleArguments = /* @__PURE__ */ __name((file, args, options30 = {}) => {
|
37318
37318
|
const parsed = import_cross_spawn.default._parse(file, args, options30);
|
@@ -37425,8 +37425,8 @@ var require_parse4 = __commonJS({
|
|
37425
37425
|
return matches;
|
37426
37426
|
}
|
37427
37427
|
__name(matchAll, "matchAll");
|
37428
|
-
function getVar(
|
37429
|
-
var r3 = typeof
|
37428
|
+
function getVar(env5, pre, key) {
|
37429
|
+
var r3 = typeof env5 === "function" ? env5(key) : env5[key];
|
37430
37430
|
if (typeof r3 === "undefined" && key != "") {
|
37431
37431
|
r3 = "";
|
37432
37432
|
} else if (typeof r3 === "undefined") {
|
@@ -37438,7 +37438,7 @@ var require_parse4 = __commonJS({
|
|
37438
37438
|
return pre + r3;
|
37439
37439
|
}
|
37440
37440
|
__name(getVar, "getVar");
|
37441
|
-
function parseInternal(string,
|
37441
|
+
function parseInternal(string, env5, opts) {
|
37442
37442
|
if (!opts) {
|
37443
37443
|
opts = {};
|
37444
37444
|
}
|
@@ -37453,8 +37453,8 @@ var require_parse4 = __commonJS({
|
|
37453
37453
|
if (matches.length === 0) {
|
37454
37454
|
return [];
|
37455
37455
|
}
|
37456
|
-
if (!
|
37457
|
-
|
37456
|
+
if (!env5) {
|
37457
|
+
env5 = {};
|
37458
37458
|
}
|
37459
37459
|
var commented = false;
|
37460
37460
|
return matches.map(function(match2) {
|
@@ -37500,7 +37500,7 @@ var require_parse4 = __commonJS({
|
|
37500
37500
|
i2 += varend.index - 1;
|
37501
37501
|
}
|
37502
37502
|
}
|
37503
|
-
return getVar(
|
37503
|
+
return getVar(env5, "", varname);
|
37504
37504
|
}
|
37505
37505
|
__name(parseEnvVar, "parseEnvVar");
|
37506
37506
|
for (i2 = 0; i2 < s.length; i2++) {
|
@@ -37557,9 +37557,9 @@ var require_parse4 = __commonJS({
|
|
37557
37557
|
}, []);
|
37558
37558
|
}
|
37559
37559
|
__name(parseInternal, "parseInternal");
|
37560
|
-
module3.exports = /* @__PURE__ */ __name(function parse6(s,
|
37561
|
-
var mapped = parseInternal(s,
|
37562
|
-
if (typeof
|
37560
|
+
module3.exports = /* @__PURE__ */ __name(function parse6(s, env5, opts) {
|
37561
|
+
var mapped = parseInternal(s, env5, opts);
|
37562
|
+
if (typeof env5 !== "function") {
|
37563
37563
|
return mapped;
|
37564
37564
|
}
|
37565
37565
|
return mapped.reduce(function(acc, s2) {
|
@@ -38674,7 +38674,7 @@ var require_ms = __commonJS({
|
|
38674
38674
|
var require_common = __commonJS({
|
38675
38675
|
"../../node_modules/.pnpm/debug@4.3.6_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) {
|
38676
38676
|
init_import_meta_url();
|
38677
|
-
function setup(
|
38677
|
+
function setup(env5) {
|
38678
38678
|
createDebug.debug = createDebug;
|
38679
38679
|
createDebug.default = createDebug;
|
38680
38680
|
createDebug.coerce = coerce2;
|
@@ -38683,8 +38683,8 @@ var require_common = __commonJS({
|
|
38683
38683
|
createDebug.enabled = enabled;
|
38684
38684
|
createDebug.humanize = require_ms();
|
38685
38685
|
createDebug.destroy = destroy;
|
38686
|
-
Object.keys(
|
38687
|
-
createDebug[key] =
|
38686
|
+
Object.keys(env5).forEach((key) => {
|
38687
|
+
createDebug[key] = env5[key];
|
38688
38688
|
});
|
38689
38689
|
createDebug.names = [];
|
38690
38690
|
createDebug.skips = [];
|
@@ -39789,7 +39789,7 @@ var require_ms2 = __commonJS({
|
|
39789
39789
|
var require_common2 = __commonJS({
|
39790
39790
|
"../../node_modules/.pnpm/debug@4.3.7_supports-color@9.2.2/node_modules/debug/src/common.js"(exports2, module3) {
|
39791
39791
|
init_import_meta_url();
|
39792
|
-
function setup(
|
39792
|
+
function setup(env5) {
|
39793
39793
|
createDebug.debug = createDebug;
|
39794
39794
|
createDebug.default = createDebug;
|
39795
39795
|
createDebug.coerce = coerce2;
|
@@ -39798,8 +39798,8 @@ var require_common2 = __commonJS({
|
|
39798
39798
|
createDebug.enabled = enabled;
|
39799
39799
|
createDebug.humanize = require_ms2();
|
39800
39800
|
createDebug.destroy = destroy;
|
39801
|
-
Object.keys(
|
39802
|
-
createDebug[key] =
|
39801
|
+
Object.keys(env5).forEach((key) => {
|
39802
|
+
createDebug[key] = env5[key];
|
39803
39803
|
});
|
39804
39804
|
createDebug.names = [];
|
39805
39805
|
createDebug.skips = [];
|
@@ -57778,7 +57778,7 @@ var require_finalhandler = __commonJS({
|
|
57778
57778
|
module3.exports = finalhandler;
|
57779
57779
|
function finalhandler(req, res, options30) {
|
57780
57780
|
var opts = options30 || {};
|
57781
|
-
var
|
57781
|
+
var env5 = opts.env || "production";
|
57782
57782
|
var onerror = opts.onerror;
|
57783
57783
|
return function(err) {
|
57784
57784
|
var headers;
|
@@ -57795,7 +57795,7 @@ var require_finalhandler = __commonJS({
|
|
57795
57795
|
} else {
|
57796
57796
|
headers = getErrorHeaders(err);
|
57797
57797
|
}
|
57798
|
-
msg = getErrorMessage2(err, status2,
|
57798
|
+
msg = getErrorMessage2(err, status2, env5);
|
57799
57799
|
} else {
|
57800
57800
|
status2 = 404;
|
57801
57801
|
msg = "Cannot " + req.method + " " + encodeUrl(getResourceName(req));
|
@@ -57826,9 +57826,9 @@ var require_finalhandler = __commonJS({
|
|
57826
57826
|
return headers;
|
57827
57827
|
}
|
57828
57828
|
__name(getErrorHeaders, "getErrorHeaders");
|
57829
|
-
function getErrorMessage2(err, status2,
|
57829
|
+
function getErrorMessage2(err, status2, env5) {
|
57830
57830
|
var msg;
|
57831
|
-
if (
|
57831
|
+
if (env5 !== "production") {
|
57832
57832
|
msg = err.stack;
|
57833
57833
|
if (!msg && typeof err.toString === "function") {
|
57834
57834
|
msg = err.toString();
|
@@ -60891,10 +60891,10 @@ var require_application = __commonJS({
|
|
60891
60891
|
this.defaultConfiguration();
|
60892
60892
|
}, "init");
|
60893
60893
|
app.defaultConfiguration = /* @__PURE__ */ __name(function defaultConfiguration() {
|
60894
|
-
var
|
60894
|
+
var env5 = "production";
|
60895
60895
|
this.enable("x-powered-by");
|
60896
60896
|
this.set("etag", "weak");
|
60897
|
-
this.set("env",
|
60897
|
+
this.set("env", env5);
|
60898
60898
|
this.set("query parser", "extended");
|
60899
60899
|
this.set("subdomain offset", 2);
|
60900
60900
|
this.set("trust proxy", false);
|
@@ -60902,7 +60902,7 @@ var require_application = __commonJS({
|
|
60902
60902
|
configurable: true,
|
60903
60903
|
value: true
|
60904
60904
|
});
|
60905
|
-
debug("booting in %s mode",
|
60905
|
+
debug("booting in %s mode", env5);
|
60906
60906
|
this.on("mount", /* @__PURE__ */ __name(function onmount(parent) {
|
60907
60907
|
if (this.settings[trustProxyDefaultSymbol] === true && typeof parent.settings["trust proxy fn"] === "function") {
|
60908
60908
|
delete this.settings["trust proxy"];
|
@@ -60919,7 +60919,7 @@ var require_application = __commonJS({
|
|
60919
60919
|
this.set("view", View);
|
60920
60920
|
this.set("views", resolve22("views"));
|
60921
60921
|
this.set("jsonp callback name", "callback");
|
60922
|
-
if (
|
60922
|
+
if (env5 === "production") {
|
60923
60923
|
this.enable("view cache");
|
60924
60924
|
}
|
60925
60925
|
Object.defineProperty(this, "router", {
|
@@ -104836,19 +104836,19 @@ Make sure "${service}" is mounted so Miniflare knows where to find it.`);
|
|
104836
104836
|
}
|
104837
104837
|
config.build = { cwd: configDir, upload: { dir: "" } };
|
104838
104838
|
(0, import_assert32.default)(config.build.upload);
|
104839
|
-
const
|
104839
|
+
const env5 = configEnv ? ` --env ${configEnv}` : "";
|
104840
104840
|
if (config.type === "webpack") {
|
104841
104841
|
let packageDir = "";
|
104842
104842
|
if (config.site) {
|
104843
104843
|
packageDir = config.site["entry-point"] ?? "workers-site";
|
104844
104844
|
}
|
104845
|
-
config.build.command = `wrangler build${
|
104845
|
+
config.build.command = `wrangler build${env5}`;
|
104846
104846
|
config.build.upload.main = import_path32.default.join(packageDir, "worker", "script.js");
|
104847
104847
|
config.miniflare ??= {};
|
104848
104848
|
config.miniflare.build_watch_dirs = ["src", "index.js"];
|
104849
104849
|
} else if (config.type === "rust") {
|
104850
104850
|
const rustScript = import_path32.default.join(__dirname, "plugins", "rust.js");
|
104851
|
-
config.build.command = `wrangler build${
|
104851
|
+
config.build.command = `wrangler build${env5} && ${process.execPath} ${rustScript}`;
|
104852
104852
|
config.build.upload.main = import_path32.default.join("worker", "generated", "script.js");
|
104853
104853
|
config.wasm_modules ??= {};
|
104854
104854
|
config.wasm_modules.wasm = import_path32.default.join(configDir, "worker", "generated", "script.wasm");
|
@@ -109105,8 +109105,8 @@ var YargsParser = class {
|
|
109105
109105
|
if (typeof envPrefix === "undefined")
|
109106
109106
|
return;
|
109107
109107
|
const prefix = typeof envPrefix === "string" ? envPrefix : "";
|
109108
|
-
const
|
109109
|
-
Object.keys(
|
109108
|
+
const env5 = mixin.env();
|
109109
|
+
Object.keys(env5).forEach(function(envVar) {
|
109110
109110
|
if (prefix === "" || envVar.lastIndexOf(prefix, 0) === 0) {
|
109111
109111
|
const keys = envVar.split("__").map(function(key, i) {
|
109112
109112
|
if (i === 0) {
|
@@ -109115,7 +109115,7 @@ var YargsParser = class {
|
|
109115
109115
|
return camelCase(key);
|
109116
109116
|
});
|
109117
109117
|
if ((configOnly && flags2.configs[keys.join(".")] || !configOnly) && !hasKey2(argv2, keys)) {
|
109118
|
-
setArg(keys.join("."),
|
109118
|
+
setArg(keys.join("."), env5[envVar]);
|
109119
109119
|
}
|
109120
109120
|
}
|
109121
109121
|
});
|
@@ -110614,7 +110614,7 @@ var import_undici3 = __toESM(require_undici());
|
|
110614
110614
|
|
110615
110615
|
// package.json
|
110616
110616
|
var name = "wrangler";
|
110617
|
-
var version = "3.
|
110617
|
+
var version = "3.100.0";
|
110618
110618
|
|
110619
110619
|
// src/environment-variables/misc-variables.ts
|
110620
110620
|
init_import_meta_url();
|
@@ -117231,11 +117231,11 @@ function tryLoadDotEnv(path70) {
|
|
117231
117231
|
}
|
117232
117232
|
}
|
117233
117233
|
__name(tryLoadDotEnv, "tryLoadDotEnv");
|
117234
|
-
function loadDotEnv(path70,
|
117235
|
-
if (
|
117234
|
+
function loadDotEnv(path70, env5) {
|
117235
|
+
if (env5 === void 0) {
|
117236
117236
|
return tryLoadDotEnv(path70);
|
117237
117237
|
} else {
|
117238
|
-
return tryLoadDotEnv(`${path70}.${
|
117238
|
+
return tryLoadDotEnv(`${path70}.${env5}`) ?? tryLoadDotEnv(path70);
|
117239
117239
|
}
|
117240
117240
|
}
|
117241
117241
|
__name(loadDotEnv, "loadDotEnv");
|
@@ -119482,11 +119482,11 @@ var getRevokeUrlFromEnv = getEnvironmentVariableFactory({
|
|
119482
119482
|
defaultValue: () => `https://${getAuthDomainFromEnv()}/oauth2/revoke`
|
119483
119483
|
});
|
119484
119484
|
var getCloudflareAccessToken = /* @__PURE__ */ __name(async () => {
|
119485
|
-
const
|
119485
|
+
const env5 = getEnvironmentVariableFactory({
|
119486
119486
|
variableName: "WRANGLER_CF_AUTHORIZATION_TOKEN"
|
119487
119487
|
})();
|
119488
|
-
if (
|
119489
|
-
return
|
119488
|
+
if (env5 !== void 0) {
|
119489
|
+
return env5;
|
119490
119490
|
}
|
119491
119491
|
return getAccessToken(getAuthDomainFromEnv());
|
119492
119492
|
}, "getCloudflareAccessToken");
|
@@ -133531,7 +133531,7 @@ function renderDeploymentConfiguration(action, {
|
|
133531
133531
|
memory,
|
133532
133532
|
environmentVariables,
|
133533
133533
|
labels,
|
133534
|
-
env:
|
133534
|
+
env: env5,
|
133535
133535
|
network
|
133536
133536
|
}) {
|
133537
133537
|
let environmentVariablesText = "[]";
|
@@ -133541,7 +133541,7 @@ function renderDeploymentConfiguration(action, {
|
|
133541
133541
|
}
|
133542
133542
|
} else if (action === "create") {
|
133543
133543
|
environmentVariablesText = `
|
133544
|
-
No environment variables added! You can set some under [${
|
133544
|
+
No environment variables added! You can set some under [${env5 ? "env." + env5 + "." : ""}vars] and via command line`;
|
133545
133545
|
}
|
133546
133546
|
let labelsText = "[]";
|
133547
133547
|
if (labels !== void 0 && labels.length !== 0) {
|
@@ -133625,11 +133625,11 @@ function collectEnvironmentVariables(deploymentEnv, config, envArgs) {
|
|
133625
133625
|
if (envMap.size === 0) {
|
133626
133626
|
return void 0;
|
133627
133627
|
}
|
133628
|
-
const
|
133628
|
+
const env5 = Array.from(envMap).map(
|
133629
133629
|
([name2, value]) => ({ name: name2, value })
|
133630
133630
|
);
|
133631
|
-
sortEnvironmentVariables(
|
133632
|
-
return
|
133631
|
+
sortEnvironmentVariables(env5);
|
133632
|
+
return env5;
|
133633
133633
|
}
|
133634
133634
|
__name(collectEnvironmentVariables, "collectEnvironmentVariables");
|
133635
133635
|
async function promptForEnvironmentVariables(environmentVariables, initiallySelected, allowSkipping) {
|
@@ -142582,6 +142582,7 @@ function getMetricsDispatcher(options30) {
|
|
142582
142582
|
isPagesCI: isPagesCI(),
|
142583
142583
|
isWorkersCI: isWorkersCI(),
|
142584
142584
|
isInteractive: isInteractive2(),
|
142585
|
+
hasAssets: options30.hasAssets ?? false,
|
142585
142586
|
argsUsed,
|
142586
142587
|
argsCombination
|
142587
142588
|
};
|
@@ -143216,13 +143217,23 @@ var import_unenv = require("unenv");
|
|
143216
143217
|
var REQUIRED_NODE_BUILT_IN_NAMESPACE = "node-built-in-modules";
|
143217
143218
|
var REQUIRED_UNENV_ALIAS_NAMESPACE = "required-unenv-alias";
|
143218
143219
|
var nodejsHybridPlugin = /* @__PURE__ */ __name(() => {
|
143219
|
-
const {
|
143220
|
+
const { env: env5 } = (0, import_unenv.defineEnv)({
|
143221
|
+
nodeCompat: true,
|
143222
|
+
presets: [import_unenv.cloudflare],
|
143223
|
+
resolve: true
|
143224
|
+
});
|
143225
|
+
const { alias, inject, external } = env5;
|
143226
|
+
const unresolvedAlias = (0, import_unenv.defineEnv)({
|
143227
|
+
nodeCompat: true,
|
143228
|
+
presets: [import_unenv.cloudflare],
|
143229
|
+
resolve: false
|
143230
|
+
}).env.alias;
|
143220
143231
|
return {
|
143221
143232
|
name: "hybrid-nodejs_compat",
|
143222
143233
|
setup(build5) {
|
143223
143234
|
errorOnServiceWorkerFormat(build5);
|
143224
143235
|
handleRequireCallsToNodeJSBuiltins(build5);
|
143225
|
-
handleUnenvAliasedPackages(build5, alias, external);
|
143236
|
+
handleUnenvAliasedPackages(build5, unresolvedAlias, alias, external);
|
143226
143237
|
handleNodeJSGlobals(build5, inject);
|
143227
143238
|
}
|
143228
143239
|
};
|
@@ -143279,28 +143290,19 @@ function handleRequireCallsToNodeJSBuiltins(build5) {
|
|
143279
143290
|
);
|
143280
143291
|
}
|
143281
143292
|
__name(handleRequireCallsToNodeJSBuiltins, "handleRequireCallsToNodeJSBuiltins");
|
143282
|
-
function handleUnenvAliasedPackages(build5, alias, external) {
|
143283
|
-
const
|
143284
|
-
for (const [module3, unresolvedAlias] of Object.entries(alias)) {
|
143285
|
-
try {
|
143286
|
-
aliasAbsolute[module3] = require.resolve(unresolvedAlias).replace(/\.cjs$/, ".mjs");
|
143287
|
-
} catch (e3) {
|
143288
|
-
}
|
143289
|
-
}
|
143290
|
-
const UNENV_ALIAS_RE = new RegExp(
|
143291
|
-
`^(${Object.keys(aliasAbsolute).join("|")})$`
|
143292
|
-
);
|
143293
|
+
function handleUnenvAliasedPackages(build5, unresolvedAlias, alias, external) {
|
143294
|
+
const UNENV_ALIAS_RE = new RegExp(`^(${Object.keys(alias).join("|")})$`);
|
143293
143295
|
build5.onResolve({ filter: UNENV_ALIAS_RE }, (args) => {
|
143294
|
-
const
|
143295
|
-
if (args.kind === "require-call" && (
|
143296
|
+
const unresolved = unresolvedAlias[args.path];
|
143297
|
+
if (args.kind === "require-call" && (unresolved.startsWith("unenv/runtime/npm/") || unresolved.startsWith("unenv/runtime/mock/"))) {
|
143296
143298
|
return {
|
143297
143299
|
path: args.path,
|
143298
143300
|
namespace: REQUIRED_UNENV_ALIAS_NAMESPACE
|
143299
143301
|
};
|
143300
143302
|
}
|
143301
143303
|
return {
|
143302
|
-
path:
|
143303
|
-
external: external.includes(
|
143304
|
+
path: alias[args.path],
|
143305
|
+
external: external.includes(unresolved)
|
143304
143306
|
};
|
143305
143307
|
});
|
143306
143308
|
build5.initialOptions.banner = { js: "", ...build5.initialOptions.banner };
|
@@ -145045,11 +145047,11 @@ var quote = /* @__PURE__ */ __name(function(args) {
|
|
145045
145047
|
const stringArgs = args.map((arg) => String(arg));
|
145046
145048
|
return import_shell_quote.default.quote(stringArgs);
|
145047
145049
|
}, "quote");
|
145048
|
-
function parse4(cmd,
|
145050
|
+
function parse4(cmd, env5) {
|
145049
145051
|
if (process.platform === "win32") {
|
145050
145052
|
cmd = cmd.replaceAll("\\", "\\\\");
|
145051
145053
|
}
|
145052
|
-
const entries = import_shell_quote.default.parse(cmd,
|
145054
|
+
const entries = import_shell_quote.default.parse(cmd, env5);
|
145053
145055
|
const argv = [];
|
145054
145056
|
for (const entry of entries) {
|
145055
145057
|
if (typeof entry === "string") {
|
@@ -150857,11 +150859,11 @@ async function deploy2({
|
|
150857
150859
|
if (branch) {
|
150858
150860
|
isProduction = project.production_branch === branch;
|
150859
150861
|
}
|
150860
|
-
const
|
150861
|
-
const deploymentConfig = project.deployment_configs[
|
150862
|
+
const env5 = isProduction ? "production" : "preview";
|
150863
|
+
const deploymentConfig = project.deployment_configs[env5];
|
150862
150864
|
let config;
|
150863
150865
|
try {
|
150864
|
-
config = readPagesConfig({ ...args, env:
|
150866
|
+
config = readPagesConfig({ ...args, env: env5 });
|
150865
150867
|
} catch (err) {
|
150866
150868
|
if (!(err instanceof FatalError && err.code === EXIT_CODE_INVALID_PAGES_CONFIG)) {
|
150867
150869
|
throw err;
|
@@ -151954,12 +151956,12 @@ __name(prettifyOutcome, "prettifyOutcome");
|
|
151954
151956
|
|
151955
151957
|
// src/tail/createTail.ts
|
151956
151958
|
var TRACE_VERSION = "trace-v1";
|
151957
|
-
function makeCreateTailUrl(accountId, workerName,
|
151958
|
-
return
|
151959
|
+
function makeCreateTailUrl(accountId, workerName, env5) {
|
151960
|
+
return env5 ? `/accounts/${accountId}/workers/services/${workerName}/environments/${env5}/tails` : `/accounts/${accountId}/workers/scripts/${workerName}/tails`;
|
151959
151961
|
}
|
151960
151962
|
__name(makeCreateTailUrl, "makeCreateTailUrl");
|
151961
|
-
function makeDeleteTailUrl(accountId, workerName, tailId,
|
151962
|
-
return
|
151963
|
+
function makeDeleteTailUrl(accountId, workerName, tailId, env5) {
|
151964
|
+
return env5 ? `/accounts/${accountId}/workers/services/${workerName}/environments/${env5}/tails/${tailId}` : `/accounts/${accountId}/workers/scripts/${workerName}/tails/${tailId}`;
|
151963
151965
|
}
|
151964
151966
|
__name(makeDeleteTailUrl, "makeDeleteTailUrl");
|
151965
151967
|
async function createPagesTail({
|
@@ -152003,8 +152005,8 @@ async function createPagesTail({
|
|
152003
152005
|
return { tail, deleteTail, expiration: tailRecord.expires_at };
|
152004
152006
|
}
|
152005
152007
|
__name(createPagesTail, "createPagesTail");
|
152006
|
-
async function createTail(accountId, workerName, filters, debug,
|
152007
|
-
const createTailUrl = makeCreateTailUrl(accountId, workerName,
|
152008
|
+
async function createTail(accountId, workerName, filters, debug, env5) {
|
152009
|
+
const createTailUrl = makeCreateTailUrl(accountId, workerName, env5);
|
152008
152010
|
const {
|
152009
152011
|
id: tailId,
|
152010
152012
|
url: websocketUrl,
|
@@ -152013,7 +152015,7 @@ async function createTail(accountId, workerName, filters, debug, env6) {
|
|
152013
152015
|
method: "POST",
|
152014
152016
|
body: JSON.stringify(filters)
|
152015
152017
|
});
|
152016
|
-
const deleteUrl = makeDeleteTailUrl(accountId, workerName, tailId,
|
152018
|
+
const deleteUrl = makeDeleteTailUrl(accountId, workerName, tailId, env5);
|
152017
152019
|
async function deleteTail() {
|
152018
152020
|
await fetchResult(deleteUrl, { method: "DELETE" });
|
152019
152021
|
}
|
@@ -153504,15 +153506,15 @@ function readFromStdin() {
|
|
153504
153506
|
__name(readFromStdin, "readFromStdin");
|
153505
153507
|
|
153506
153508
|
// src/pages/secret/index.ts
|
153507
|
-
function isPagesEnv(
|
153508
|
-
return ["production", "preview"].includes(
|
153509
|
+
function isPagesEnv(env5) {
|
153510
|
+
return ["production", "preview"].includes(env5);
|
153509
153511
|
}
|
153510
153512
|
__name(isPagesEnv, "isPagesEnv");
|
153511
|
-
async function pagesProject(
|
153512
|
-
|
153513
|
-
if (!isPagesEnv(
|
153513
|
+
async function pagesProject(env5, cliProjectName) {
|
153514
|
+
env5 ??= "production";
|
153515
|
+
if (!isPagesEnv(env5)) {
|
153514
153516
|
throw new FatalError(
|
153515
|
-
`Pages does not support the "${
|
153517
|
+
`Pages does not support the "${env5}" named environment. Please specify "production" (default) or "preview"`,
|
153516
153518
|
1
|
153517
153519
|
);
|
153518
153520
|
}
|
@@ -153553,7 +153555,7 @@ Ignoring configuration file for now.`
|
|
153553
153555
|
} else {
|
153554
153556
|
throw new FatalError("Must specify a project name.", 1);
|
153555
153557
|
}
|
153556
|
-
return { env:
|
153558
|
+
return { env: env5, project, accountId, config };
|
153557
153559
|
}
|
153558
153560
|
__name(pagesProject, "pagesProject");
|
153559
153561
|
var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
@@ -153572,7 +153574,7 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153572
153574
|
},
|
153573
153575
|
async (args) => {
|
153574
153576
|
await printWranglerBanner();
|
153575
|
-
const { env:
|
153577
|
+
const { env: env5, project, accountId, config } = await pagesProject(
|
153576
153578
|
args.env,
|
153577
153579
|
args.projectName
|
153578
153580
|
);
|
@@ -153580,7 +153582,7 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153580
153582
|
isInteractive2() ? await prompt("Enter a secret value:", { isSecret: true }) : await readFromStdin()
|
153581
153583
|
);
|
153582
153584
|
logger.log(
|
153583
|
-
`\u{1F300} Creating the secret for the Pages project "${project.name}" (${
|
153585
|
+
`\u{1F300} Creating the secret for the Pages project "${project.name}" (${env5})`
|
153584
153586
|
);
|
153585
153587
|
await fetchResult(
|
153586
153588
|
`/accounts/${accountId}/pages/projects/${project.name}`,
|
@@ -153588,14 +153590,14 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153588
153590
|
method: "PATCH",
|
153589
153591
|
body: JSON.stringify({
|
153590
153592
|
deployment_configs: {
|
153591
|
-
[
|
153593
|
+
[env5]: {
|
153592
153594
|
env_vars: {
|
153593
153595
|
[args.key]: {
|
153594
153596
|
value: secretValue,
|
153595
153597
|
type: "secret_text"
|
153596
153598
|
}
|
153597
153599
|
},
|
153598
|
-
wrangler_config_hash: project.deployment_configs[
|
153600
|
+
wrangler_config_hash: project.deployment_configs[env5].wrangler_config_hash
|
153599
153601
|
}
|
153600
153602
|
}
|
153601
153603
|
})
|
@@ -153621,12 +153623,12 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153621
153623
|
},
|
153622
153624
|
async (args) => {
|
153623
153625
|
await printWranglerBanner();
|
153624
|
-
const { env:
|
153626
|
+
const { env: env5, project, accountId } = await pagesProject(
|
153625
153627
|
args.env,
|
153626
153628
|
args.projectName
|
153627
153629
|
);
|
153628
153630
|
logger.log(
|
153629
|
-
`\u{1F300} Creating the secrets for the Pages project "${project.name}" (${
|
153631
|
+
`\u{1F300} Creating the secrets for the Pages project "${project.name}" (${env5})`
|
153630
153632
|
);
|
153631
153633
|
let content;
|
153632
153634
|
if (args.json) {
|
@@ -153672,11 +153674,11 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153672
153674
|
method: "PATCH",
|
153673
153675
|
body: JSON.stringify({
|
153674
153676
|
deployment_configs: {
|
153675
|
-
[
|
153677
|
+
[env5]: {
|
153676
153678
|
env_vars: {
|
153677
153679
|
...upsertBindings
|
153678
153680
|
},
|
153679
|
-
wrangler_config_hash: project.deployment_configs[
|
153681
|
+
wrangler_config_hash: project.deployment_configs[env5].wrangler_config_hash
|
153680
153682
|
}
|
153681
153683
|
}
|
153682
153684
|
})
|
@@ -153709,15 +153711,15 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153709
153711
|
},
|
153710
153712
|
async (args) => {
|
153711
153713
|
await printWranglerBanner();
|
153712
|
-
const { env:
|
153714
|
+
const { env: env5, project, accountId, config } = await pagesProject(
|
153713
153715
|
args.env,
|
153714
153716
|
args.projectName
|
153715
153717
|
);
|
153716
153718
|
if (await confirm(
|
153717
|
-
`Are you sure you want to permanently delete the secret ${args.key} on the Pages project ${project.name} (${
|
153719
|
+
`Are you sure you want to permanently delete the secret ${args.key} on the Pages project ${project.name} (${env5})?`
|
153718
153720
|
)) {
|
153719
153721
|
logger.log(
|
153720
|
-
`\u{1F300} Deleting the secret ${args.key} on the Pages project ${project.name} (${
|
153722
|
+
`\u{1F300} Deleting the secret ${args.key} on the Pages project ${project.name} (${env5})`
|
153721
153723
|
);
|
153722
153724
|
await fetchResult(
|
153723
153725
|
`/accounts/${accountId}/pages/projects/${project.name}`,
|
@@ -153725,11 +153727,11 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153725
153727
|
method: "PATCH",
|
153726
153728
|
body: JSON.stringify({
|
153727
153729
|
deployment_configs: {
|
153728
|
-
[
|
153730
|
+
[env5]: {
|
153729
153731
|
env_vars: {
|
153730
153732
|
[args.key]: null
|
153731
153733
|
},
|
153732
|
-
wrangler_config_hash: project.deployment_configs[
|
153734
|
+
wrangler_config_hash: project.deployment_configs[env5].wrangler_config_hash
|
153733
153735
|
}
|
153734
153736
|
}
|
153735
153737
|
})
|
@@ -153753,16 +153755,16 @@ var secret = /* @__PURE__ */ __name((secretYargs, subHelp) => {
|
|
153753
153755
|
},
|
153754
153756
|
async (args) => {
|
153755
153757
|
await printWranglerBanner();
|
153756
|
-
const { env:
|
153758
|
+
const { env: env5, project, config } = await pagesProject(
|
153757
153759
|
args.env,
|
153758
153760
|
args.projectName
|
153759
153761
|
);
|
153760
153762
|
const secrets = Object.entries(
|
153761
|
-
project.deployment_configs[
|
153763
|
+
project.deployment_configs[env5].env_vars ?? {}
|
153762
153764
|
).filter(([_3, val]) => val?.type === "secret_text");
|
153763
153765
|
const message = [
|
153764
153766
|
`The "${source_default.blue(
|
153765
|
-
|
153767
|
+
env5
|
153766
153768
|
)}" environment of your Pages project "${source_default.blue(
|
153767
153769
|
project.name
|
153768
153770
|
)}" has access to the following secrets:`,
|
@@ -163613,17 +163615,17 @@ var BaseClient = class {
|
|
163613
163615
|
*/
|
163614
163616
|
sendEvent(event, hint = {}) {
|
163615
163617
|
this.emit("beforeSendEvent", event, hint);
|
163616
|
-
let
|
163618
|
+
let env5 = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);
|
163617
163619
|
for (const attachment of hint.attachments || []) {
|
163618
|
-
|
163619
|
-
|
163620
|
+
env5 = addItemToEnvelope(
|
163621
|
+
env5,
|
163620
163622
|
createAttachmentEnvelopeItem(
|
163621
163623
|
attachment,
|
163622
163624
|
this._options.transportOptions && this._options.transportOptions.textEncoder
|
163623
163625
|
)
|
163624
163626
|
);
|
163625
163627
|
}
|
163626
|
-
const promise = this._sendEnvelope(
|
163628
|
+
const promise = this._sendEnvelope(env5);
|
163627
163629
|
if (promise) {
|
163628
163630
|
promise.then((sendResponse) => this.emit("afterSendEvent", event, sendResponse), null);
|
163629
163631
|
}
|
@@ -163632,8 +163634,8 @@ var BaseClient = class {
|
|
163632
163634
|
* @inheritDoc
|
163633
163635
|
*/
|
163634
163636
|
sendSession(session) {
|
163635
|
-
const
|
163636
|
-
void this._sendEnvelope(
|
163637
|
+
const env5 = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);
|
163638
|
+
void this._sendEnvelope(env5);
|
163637
163639
|
}
|
163638
163640
|
/**
|
163639
163641
|
* @inheritDoc
|
@@ -168664,10 +168666,10 @@ var import_miniflare20 = require("miniflare");
|
|
168664
168666
|
// src/dev/dev-vars.ts
|
168665
168667
|
init_import_meta_url();
|
168666
168668
|
var path58 = __toESM(require("node:path"));
|
168667
|
-
function getVarsForDev(config,
|
168669
|
+
function getVarsForDev(config, env5, silent = false) {
|
168668
168670
|
const configDir = path58.resolve(path58.dirname(config.configPath ?? "."));
|
168669
168671
|
const devVarsPath = path58.resolve(configDir, ".dev.vars");
|
168670
|
-
const loaded = loadDotEnv(devVarsPath,
|
168672
|
+
const loaded = loadDotEnv(devVarsPath, env5);
|
168671
168673
|
if (loaded !== void 0) {
|
168672
168674
|
const devVarsRelativePath = path58.relative(process.cwd(), loaded.path);
|
168673
168675
|
if (!silent) {
|
@@ -175352,6 +175354,7 @@ async function main(argv) {
|
|
175352
175354
|
const { rawConfig, configPath } = experimental_readRawConfig(args);
|
175353
175355
|
dispatcher = getMetricsDispatcher({
|
175354
175356
|
sendMetrics: rawConfig.send_metrics,
|
175357
|
+
hasAssets: !!rawConfig.assets?.directory,
|
175355
175358
|
configPath
|
175356
175359
|
});
|
175357
175360
|
} catch (e3) {
|
@@ -178262,7 +178265,7 @@ function getResolvedLegacyAssetPaths(args, configParam) {
|
|
178262
178265
|
return legacyAssetPaths;
|
178263
178266
|
}
|
178264
178267
|
__name(getResolvedLegacyAssetPaths, "getResolvedLegacyAssetPaths");
|
178265
|
-
function getBindings2(configParam,
|
178268
|
+
function getBindings2(configParam, env5, local, args) {
|
178266
178269
|
const kvConfig = (configParam.kv_namespaces || []).map(
|
178267
178270
|
({ binding, preview_id, id }) => {
|
178268
178271
|
if (!preview_id && !local) {
|
@@ -178357,7 +178360,7 @@ function getBindings2(configParam, env6, local, args) {
|
|
178357
178360
|
// non-inheritable fields
|
178358
178361
|
vars: {
|
178359
178362
|
// Use a copy of combinedVars since we're modifying it later
|
178360
|
-
...getVarsForDev(configParam,
|
178363
|
+
...getVarsForDev(configParam, env5),
|
178361
178364
|
...args.vars
|
178362
178365
|
},
|
178363
178366
|
durable_objects: {
|
@@ -179389,6 +179392,11 @@ async function resolveConfig(config, input) {
|
|
179389
179392
|
"Cannot use legacy assets and Workers Sites in the same Worker."
|
179390
179393
|
);
|
179391
179394
|
}
|
179395
|
+
if (extractBindingsOfType("browser", resolved.bindings).length && !resolved.dev.remote) {
|
179396
|
+
throw new UserError(
|
179397
|
+
"Browser Rendering is not supported locally. Please use `wrangler dev --remote` instead."
|
179398
|
+
);
|
179399
|
+
}
|
179392
179400
|
validateAssetsArgsAndConfig(resolved);
|
179393
179401
|
const services = extractBindingsOfType("service", resolved.bindings);
|
179394
179402
|
if (services && services.length > 0 && resolved.dev?.remote) {
|
@@ -180387,10 +180395,10 @@ __name(maybeGetRegisteredWorkers, "maybeGetRegisteredWorkers");
|
|
180387
180395
|
|
180388
180396
|
// src/api/integrations/platform/index.ts
|
180389
180397
|
async function getPlatformProxy(options30 = {}) {
|
180390
|
-
const
|
180398
|
+
const env5 = options30.environment;
|
180391
180399
|
const rawConfig = readConfig({
|
180392
180400
|
config: options30.configPath,
|
180393
|
-
env:
|
180401
|
+
env: env5
|
180394
180402
|
});
|
180395
180403
|
const miniflareOptions = await run(
|
180396
180404
|
{
|
@@ -180398,7 +180406,7 @@ async function getPlatformProxy(options30 = {}) {
|
|
180398
180406
|
MULTIWORKER: false,
|
180399
180407
|
RESOURCES_PROVISION: false
|
180400
180408
|
},
|
180401
|
-
() => getMiniflareOptionsFromConfig(rawConfig,
|
180409
|
+
() => getMiniflareOptionsFromConfig(rawConfig, env5, options30)
|
180402
180410
|
);
|
180403
180411
|
const mf = new import_miniflare25.Miniflare({
|
180404
180412
|
script: "",
|
@@ -180406,7 +180414,7 @@ async function getPlatformProxy(options30 = {}) {
|
|
180406
180414
|
...miniflareOptions
|
180407
180415
|
});
|
180408
180416
|
const bindings = await mf.getBindings();
|
180409
|
-
const vars = getVarsForDev(rawConfig,
|
180417
|
+
const vars = getVarsForDev(rawConfig, env5);
|
180410
180418
|
const cf = await mf.getCf();
|
180411
180419
|
deepFreeze(cf);
|
180412
180420
|
return {
|
@@ -180421,8 +180429,8 @@ async function getPlatformProxy(options30 = {}) {
|
|
180421
180429
|
};
|
180422
180430
|
}
|
180423
180431
|
__name(getPlatformProxy, "getPlatformProxy");
|
180424
|
-
async function getMiniflareOptionsFromConfig(rawConfig,
|
180425
|
-
const bindings = getBindings2(rawConfig,
|
180432
|
+
async function getMiniflareOptionsFromConfig(rawConfig, env5, options30) {
|
180433
|
+
const bindings = getBindings2(rawConfig, env5, true, {});
|
180426
180434
|
const workerDefinitions = await getBoundRegisteredWorkers({
|
180427
180435
|
name: rawConfig.name,
|
180428
180436
|
services: bindings.services,
|
@@ -180487,14 +180495,14 @@ function deepFreeze(obj) {
|
|
180487
180495
|
});
|
180488
180496
|
}
|
180489
180497
|
__name(deepFreeze, "deepFreeze");
|
180490
|
-
function unstable_getMiniflareWorkerOptions(configOrConfigPath,
|
180491
|
-
const config = typeof configOrConfigPath === "string" ? readConfig({ config: configOrConfigPath, env:
|
180498
|
+
function unstable_getMiniflareWorkerOptions(configOrConfigPath, env5) {
|
180499
|
+
const config = typeof configOrConfigPath === "string" ? readConfig({ config: configOrConfigPath, env: env5 }) : configOrConfigPath;
|
180492
180500
|
const modulesRules = config.rules.concat(DEFAULT_MODULE_RULES).map((rule) => ({
|
180493
180501
|
type: rule.type,
|
180494
180502
|
include: rule.globs,
|
180495
180503
|
fallthrough: rule.fallthrough
|
180496
180504
|
}));
|
180497
|
-
const bindings = getBindings2(config,
|
180505
|
+
const bindings = getBindings2(config, env5, true, {});
|
180498
180506
|
const { bindingOptions } = buildMiniflareBindingOptions({
|
180499
180507
|
name: void 0,
|
180500
180508
|
bindings,
|
@@ -180550,9 +180558,9 @@ init_import_meta_url();
|
|
180550
180558
|
// src/api/integrations/deprecated/getBindingsProxy.ts
|
180551
180559
|
init_import_meta_url();
|
180552
180560
|
async function getBindingsProxy(options30 = {}) {
|
180553
|
-
const { env:
|
180561
|
+
const { env: env5, ...restOfPlatformProxy } = await getPlatformProxy(options30);
|
180554
180562
|
return {
|
180555
|
-
bindings:
|
180563
|
+
bindings: env5,
|
180556
180564
|
...restOfPlatformProxy
|
180557
180565
|
};
|
180558
180566
|
}
|
@@ -181176,3 +181184,4 @@ yargs-parser/build/lib/index.js:
|
|
181176
181184
|
* SPDX-License-Identifier: ISC
|
181177
181185
|
*)
|
181178
181186
|
*/
|
181187
|
+
//# sourceMappingURL=cli.js.map
|