wrangler 4.42.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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wrangler",
|
|
3
|
-
"version": "4.42.
|
|
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.
|
|
57
|
+
"workerd": "1.20251004.0",
|
|
58
58
|
"@cloudflare/kv-asset-handler": "0.4.0",
|
|
59
|
-
"
|
|
60
|
-
"
|
|
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
|
};
|
|
@@ -73380,11 +73380,11 @@ var init_os = __esm({
|
|
|
73380
73380
|
static {
|
|
73381
73381
|
__name(this, "OS");
|
|
73382
73382
|
}
|
|
73383
|
-
get(
|
|
73383
|
+
get(os10, query = {}, options) {
|
|
73384
73384
|
if (isRequestOptions(query)) {
|
|
73385
|
-
return this.get(
|
|
73385
|
+
return this.get(os10, {}, query);
|
|
73386
73386
|
}
|
|
73387
|
-
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);
|
|
73388
73388
|
}
|
|
73389
73389
|
};
|
|
73390
73390
|
}
|
|
@@ -73625,11 +73625,11 @@ var init_os2 = __esm({
|
|
|
73625
73625
|
static {
|
|
73626
73626
|
__name(this, "OS");
|
|
73627
73627
|
}
|
|
73628
|
-
get(
|
|
73628
|
+
get(os10, query = {}, options) {
|
|
73629
73629
|
if (isRequestOptions(query)) {
|
|
73630
|
-
return this.get(
|
|
73630
|
+
return this.get(os10, {}, query);
|
|
73631
73631
|
}
|
|
73632
|
-
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);
|
|
73633
73633
|
}
|
|
73634
73634
|
};
|
|
73635
73635
|
}
|
|
@@ -93898,7 +93898,7 @@ var name, version;
|
|
|
93898
93898
|
var init_package = __esm({
|
|
93899
93899
|
"package.json"() {
|
|
93900
93900
|
name = "wrangler";
|
|
93901
|
-
version = "4.42.
|
|
93901
|
+
version = "4.42.1";
|
|
93902
93902
|
}
|
|
93903
93903
|
});
|
|
93904
93904
|
|
|
@@ -108977,14 +108977,14 @@ var require_is_wsl = __commonJS({
|
|
|
108977
108977
|
"../../node_modules/.pnpm/is-wsl@2.2.0/node_modules/is-wsl/index.js"(exports2, module3) {
|
|
108978
108978
|
"use strict";
|
|
108979
108979
|
init_import_meta_url();
|
|
108980
|
-
var
|
|
108980
|
+
var os10 = require("os");
|
|
108981
108981
|
var fs25 = require("fs");
|
|
108982
108982
|
var isDocker = require_is_docker();
|
|
108983
108983
|
var isWsl = /* @__PURE__ */ __name(() => {
|
|
108984
108984
|
if (process.platform !== "linux") {
|
|
108985
108985
|
return false;
|
|
108986
108986
|
}
|
|
108987
|
-
if (
|
|
108987
|
+
if (os10.release().toLowerCase().includes("microsoft")) {
|
|
108988
108988
|
if (isDocker()) {
|
|
108989
108989
|
return false;
|
|
108990
108990
|
}
|
|
@@ -110917,8 +110917,8 @@ var require_homedir = __commonJS({
|
|
|
110917
110917
|
"../../node_modules/.pnpm/resolve@1.22.8/node_modules/resolve/lib/homedir.js"(exports2, module3) {
|
|
110918
110918
|
"use strict";
|
|
110919
110919
|
init_import_meta_url();
|
|
110920
|
-
var
|
|
110921
|
-
module3.exports =
|
|
110920
|
+
var os10 = require("os");
|
|
110921
|
+
module3.exports = os10.homedir || /* @__PURE__ */ __name(function homedir3() {
|
|
110922
110922
|
var home = process.env.HOME;
|
|
110923
110923
|
var user = process.env.LOGNAME || process.env.USER || process.env.LNAME || process.env.USERNAME;
|
|
110924
110924
|
if (process.platform === "win32") {
|
|
@@ -121204,13 +121204,25 @@ var init_BaseController = __esm({
|
|
|
121204
121204
|
"src/api/startDevWorker/BaseController.ts"() {
|
|
121205
121205
|
init_import_meta_url();
|
|
121206
121206
|
import_node_events = require("events");
|
|
121207
|
+
init_logger();
|
|
121207
121208
|
TypedEventEmitterImpl = import_node_events.EventEmitter;
|
|
121208
121209
|
Controller = class extends TypedEventEmitterImpl {
|
|
121209
121210
|
static {
|
|
121210
121211
|
__name(this, "Controller");
|
|
121211
121212
|
}
|
|
121212
|
-
|
|
121213
|
-
|
|
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);
|
|
121214
121226
|
}
|
|
121215
121227
|
};
|
|
121216
121228
|
RuntimeController = class extends Controller {
|
|
@@ -138435,7 +138447,7 @@ function getWranglerVersion() {
|
|
|
138435
138447
|
return version;
|
|
138436
138448
|
}
|
|
138437
138449
|
function getPlatform() {
|
|
138438
|
-
const platform3 =
|
|
138450
|
+
const platform3 = process.platform;
|
|
138439
138451
|
switch (platform3) {
|
|
138440
138452
|
case "win32":
|
|
138441
138453
|
return "Windows";
|
|
@@ -152302,7 +152314,7 @@ var require_main = __commonJS({
|
|
|
152302
152314
|
init_import_meta_url();
|
|
152303
152315
|
var fs25 = require("fs");
|
|
152304
152316
|
var path72 = require("path");
|
|
152305
|
-
var
|
|
152317
|
+
var os10 = require("os");
|
|
152306
152318
|
var crypto8 = require("crypto");
|
|
152307
152319
|
var packageJson = require_package();
|
|
152308
152320
|
var version5 = packageJson.version;
|
|
@@ -152408,7 +152420,7 @@ var require_main = __commonJS({
|
|
|
152408
152420
|
}
|
|
152409
152421
|
__name(_vaultPath, "_vaultPath");
|
|
152410
152422
|
function _resolveHome(envPath) {
|
|
152411
|
-
return envPath[0] === "~" ? path72.join(
|
|
152423
|
+
return envPath[0] === "~" ? path72.join(os10.homedir(), envPath.slice(1)) : envPath;
|
|
152412
152424
|
}
|
|
152413
152425
|
__name(_resolveHome, "_resolveHome");
|
|
152414
152426
|
function _configVault(options) {
|
|
@@ -172710,7 +172722,7 @@ var require_DocTypeReader = __commonJS({
|
|
|
172710
172722
|
i6 += 7;
|
|
172711
172723
|
[entityName, val, i6] = readEntityExp(xmlData, i6 + 1);
|
|
172712
172724
|
if (val.indexOf("&") === -1)
|
|
172713
|
-
entities[
|
|
172725
|
+
entities[validateEntityName2(entityName)] = {
|
|
172714
172726
|
regx: RegExp(`&${entityName};`, "g"),
|
|
172715
172727
|
val
|
|
172716
172728
|
};
|
|
@@ -172788,13 +172800,13 @@ var require_DocTypeReader = __commonJS({
|
|
|
172788
172800
|
return false;
|
|
172789
172801
|
}
|
|
172790
172802
|
__name(isNotation, "isNotation");
|
|
172791
|
-
function
|
|
172803
|
+
function validateEntityName2(name2) {
|
|
172792
172804
|
if (util3.isName(name2))
|
|
172793
172805
|
return name2;
|
|
172794
172806
|
else
|
|
172795
172807
|
throw new Error(`Invalid entity name ${name2}`);
|
|
172796
172808
|
}
|
|
172797
|
-
__name(
|
|
172809
|
+
__name(validateEntityName2, "validateEntityName");
|
|
172798
172810
|
module3.exports = readDocType;
|
|
172799
172811
|
}
|
|
172800
172812
|
});
|
|
@@ -200370,6 +200382,13 @@ var init_legacy_client = __esm({
|
|
|
200370
200382
|
});
|
|
200371
200383
|
|
|
200372
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
|
+
}
|
|
200373
200392
|
function validateName2(label, name2) {
|
|
200374
200393
|
if (!name2.match(/^[a-zA-Z0-9-]+$/)) {
|
|
200375
200394
|
throw new UserError2(`Must provide a valid ${label}`);
|
|
@@ -200414,6 +200433,7 @@ var init_validate5 = __esm({
|
|
|
200414
200433
|
"src/pipelines/validate.ts"() {
|
|
200415
200434
|
init_import_meta_url();
|
|
200416
200435
|
init_errors();
|
|
200436
|
+
__name(validateEntityName, "validateEntityName");
|
|
200417
200437
|
__name(validateName2, "validateName");
|
|
200418
200438
|
__name(validateCorsOrigins, "validateCorsOrigins");
|
|
200419
200439
|
__name(validateInRange, "validateInRange");
|
|
@@ -200953,11 +200973,7 @@ async function setupPipelineNaming(providedName) {
|
|
|
200953
200973
|
if (!pipelineName) {
|
|
200954
200974
|
throw new UserError2("Pipeline name is required");
|
|
200955
200975
|
}
|
|
200956
|
-
|
|
200957
|
-
throw new UserError2(
|
|
200958
|
-
"Pipeline name must contain only letters, numbers, hyphens, and underscores"
|
|
200959
|
-
);
|
|
200960
|
-
}
|
|
200976
|
+
validateEntityName("pipeline", pipelineName);
|
|
200961
200977
|
const streamName = `${pipelineName}_stream`;
|
|
200962
200978
|
const sinkName = `${pipelineName}_sink`;
|
|
200963
200979
|
return {
|
|
@@ -201557,6 +201573,7 @@ var init_setup = __esm({
|
|
|
201557
201573
|
init_client7();
|
|
201558
201574
|
init_defaults();
|
|
201559
201575
|
init_pipelines2();
|
|
201576
|
+
init_validate5();
|
|
201560
201577
|
init_utils13();
|
|
201561
201578
|
pipelinesSetupCommand = createCommand({
|
|
201562
201579
|
metadata: {
|
|
@@ -201722,6 +201739,7 @@ var init_create6 = __esm({
|
|
|
201722
201739
|
init_client7();
|
|
201723
201740
|
init_defaults();
|
|
201724
201741
|
init_pipelines2();
|
|
201742
|
+
init_validate5();
|
|
201725
201743
|
init_utils14();
|
|
201726
201744
|
__name(parseSinkType, "parseSinkType");
|
|
201727
201745
|
pipelinesSinksCreateCommand = createCommand({
|
|
@@ -201805,6 +201823,7 @@ var init_create6 = __esm({
|
|
|
201805
201823
|
}
|
|
201806
201824
|
},
|
|
201807
201825
|
validateArgs: /* @__PURE__ */ __name((args) => {
|
|
201826
|
+
validateEntityName("sink", args.sink);
|
|
201808
201827
|
const sinkType = parseSinkType(args.type);
|
|
201809
201828
|
if (!isValidR2BucketName(args.bucket)) {
|
|
201810
201829
|
throw new CommandLineArgsError(
|
|
@@ -202141,6 +202160,7 @@ var init_create7 = __esm({
|
|
|
202141
202160
|
init_parse();
|
|
202142
202161
|
init_user3();
|
|
202143
202162
|
init_client7();
|
|
202163
|
+
init_validate5();
|
|
202144
202164
|
init_utils13();
|
|
202145
202165
|
pipelinesStreamsCreateCommand = createCommand({
|
|
202146
202166
|
metadata: {
|
|
@@ -202175,6 +202195,9 @@ var init_create7 = __esm({
|
|
|
202175
202195
|
array: true
|
|
202176
202196
|
}
|
|
202177
202197
|
},
|
|
202198
|
+
validateArgs: /* @__PURE__ */ __name((args) => {
|
|
202199
|
+
validateEntityName("stream", args.stream);
|
|
202200
|
+
}, "validateArgs"),
|
|
202178
202201
|
async handler(args, { config }) {
|
|
202179
202202
|
await requireAuth(config);
|
|
202180
202203
|
const streamName = args.stream;
|
|
@@ -223518,8 +223541,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
|
223518
223541
|
sourceMaps: uploadSourceMaps ? loadSourceMaps(main2, modules, bundle) : void 0,
|
|
223519
223542
|
compatibility_date: compatibilityDate,
|
|
223520
223543
|
compatibility_flags: compatibilityFlags,
|
|
223521
|
-
keepVars: false,
|
|
223522
|
-
// the wrangler.toml should be the source-of-truth for vars
|
|
223544
|
+
keepVars: props.keepVars ?? false,
|
|
223523
223545
|
keepSecrets: true,
|
|
223524
223546
|
// until wrangler.toml specifies secret bindings, we need to inherit from the previous Worker Version
|
|
223525
223547
|
placement,
|
|
@@ -224047,7 +224069,7 @@ var init_upload5 = __esm({
|
|
|
224047
224069
|
outDir: args.outdir,
|
|
224048
224070
|
dryRun: args.dryRun,
|
|
224049
224071
|
noBundle: !(args.bundle ?? !config.no_bundle),
|
|
224050
|
-
keepVars:
|
|
224072
|
+
keepVars: config.keep_vars,
|
|
224051
224073
|
projectRoot: entry.projectRoot,
|
|
224052
224074
|
tag: args.tag,
|
|
224053
224075
|
message: args.message,
|
|
@@ -229604,7 +229626,7 @@ async function main(argv) {
|
|
|
229604
229626
|
logger.log(e8.message);
|
|
229605
229627
|
} else if (e8 instanceof Error && e8.message.includes("Raw mode is not supported on")) {
|
|
229606
229628
|
mayReport = false;
|
|
229607
|
-
const currentPlatform =
|
|
229629
|
+
const currentPlatform = process.platform;
|
|
229608
229630
|
const thisTerminalIsUnsupported = "This terminal doesn't support raw mode.";
|
|
229609
229631
|
const soWranglerWontWork = "Wrangler uses raw mode to read user input and write output to the terminal, and won't function correctly without it.";
|
|
229610
229632
|
const tryRunningItIn = "Try running your previous command in a terminal that supports raw mode";
|
|
@@ -229691,12 +229713,11 @@ ${tryRunningItIn}${oneOfThese}`
|
|
|
229691
229713
|
}
|
|
229692
229714
|
}
|
|
229693
229715
|
}
|
|
229694
|
-
var import_node_assert22,
|
|
229716
|
+
var import_node_assert22, import_node_path54, import_promises31, import_undici21;
|
|
229695
229717
|
var init_src2 = __esm({
|
|
229696
229718
|
"src/index.ts"() {
|
|
229697
229719
|
init_import_meta_url();
|
|
229698
229720
|
import_node_assert22 = __toESM(require("assert"));
|
|
229699
|
-
import_node_os7 = __toESM(require("os"));
|
|
229700
229721
|
import_node_path54 = require("path");
|
|
229701
229722
|
import_promises31 = require("timers/promises");
|
|
229702
229723
|
init_cli();
|
|
@@ -232852,6 +232873,7 @@ var init_BundlerController = __esm({
|
|
|
232852
232873
|
}
|
|
232853
232874
|
async teardown() {
|
|
232854
232875
|
logger.debug("BundlerController teardown beginning...");
|
|
232876
|
+
await super.teardown();
|
|
232855
232877
|
this.#customBuildAborter?.abort();
|
|
232856
232878
|
this.#tmpDir?.remove();
|
|
232857
232879
|
await Promise.all([
|
|
@@ -232988,12 +233010,12 @@ async function getPorts(options) {
|
|
|
232988
233010
|
}
|
|
232989
233011
|
throw new Error("No available ports found");
|
|
232990
233012
|
}
|
|
232991
|
-
var import_node_net,
|
|
233013
|
+
var import_node_net, import_node_os7, Locked, lockedPorts, releaseOldLockedPortsIntervalMs, timeout, getLocalHosts, checkAvailablePort, getAvailablePort, portCheckSequence;
|
|
232992
233014
|
var init_get_port = __esm({
|
|
232993
233015
|
"../../node_modules/.pnpm/get-port@7.0.0/node_modules/get-port/index.js"() {
|
|
232994
233016
|
init_import_meta_url();
|
|
232995
233017
|
import_node_net = __toESM(require("net"), 1);
|
|
232996
|
-
|
|
233018
|
+
import_node_os7 = __toESM(require("os"), 1);
|
|
232997
233019
|
Locked = class extends Error {
|
|
232998
233020
|
static {
|
|
232999
233021
|
__name(this, "Locked");
|
|
@@ -233008,7 +233030,7 @@ var init_get_port = __esm({
|
|
|
233008
233030
|
};
|
|
233009
233031
|
releaseOldLockedPortsIntervalMs = 1e3 * 15;
|
|
233010
233032
|
getLocalHosts = /* @__PURE__ */ __name(() => {
|
|
233011
|
-
const interfaces =
|
|
233033
|
+
const interfaces = import_node_os7.default.networkInterfaces();
|
|
233012
233034
|
const results = /* @__PURE__ */ new Set([void 0, "0.0.0.0"]);
|
|
233013
233035
|
for (const _interface of Object.values(interfaces)) {
|
|
233014
233036
|
for (const config of _interface) {
|
|
@@ -233416,7 +233438,6 @@ var init_ConfigController = __esm({
|
|
|
233416
233438
|
#printCurrentBindings;
|
|
233417
233439
|
#configWatcher;
|
|
233418
233440
|
#abortController;
|
|
233419
|
-
#tearingDown = false;
|
|
233420
233441
|
async #ensureWatchingConfig(configPath) {
|
|
233421
233442
|
await this.#configWatcher?.close();
|
|
233422
233443
|
if (configPath) {
|
|
@@ -233432,17 +233453,28 @@ var init_ConfigController = __esm({
|
|
|
233432
233453
|
this.latestInput,
|
|
233433
233454
|
"Cannot be watching config without having first set an input"
|
|
233434
233455
|
);
|
|
233435
|
-
|
|
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
|
+
});
|
|
233436
233466
|
});
|
|
233437
233467
|
}
|
|
233438
233468
|
}
|
|
233439
233469
|
set(input, throwErrors = false) {
|
|
233470
|
+
logger.debug("setting config");
|
|
233440
233471
|
return runWithLogLevel(
|
|
233441
233472
|
input.dev?.logLevel,
|
|
233442
233473
|
() => this.#updateConfig(input, throwErrors)
|
|
233443
233474
|
);
|
|
233444
233475
|
}
|
|
233445
233476
|
patch(input) {
|
|
233477
|
+
logger.debug("patching config");
|
|
233446
233478
|
(0, import_node_assert27.default)(
|
|
233447
233479
|
this.latestInput,
|
|
233448
233480
|
"Cannot call updateConfig without previously calling setConfig"
|
|
@@ -233457,9 +233489,11 @@ var init_ConfigController = __esm({
|
|
|
233457
233489
|
);
|
|
233458
233490
|
}
|
|
233459
233491
|
async #updateConfig(input, throwErrors = false) {
|
|
233460
|
-
|
|
233461
|
-
|
|
233462
|
-
|
|
233492
|
+
logger.debug(
|
|
233493
|
+
"Updating config...",
|
|
233494
|
+
this.#abortController?.signal,
|
|
233495
|
+
this.#configWatcher?.closed
|
|
233496
|
+
);
|
|
233463
233497
|
this.#abortController?.abort();
|
|
233464
233498
|
this.#abortController = new AbortController();
|
|
233465
233499
|
const signal = this.#abortController.signal;
|
|
@@ -233481,11 +233515,8 @@ var init_ConfigController = __esm({
|
|
|
233481
233515
|
if (!getDisableConfigWatching()) {
|
|
233482
233516
|
await this.#ensureWatchingConfig(fileConfig.configPath);
|
|
233483
233517
|
}
|
|
233484
|
-
if (this.#tearingDown || signal.aborted) {
|
|
233485
|
-
return;
|
|
233486
|
-
}
|
|
233487
233518
|
const { config: resolvedConfig, printCurrentBindings } = await resolveConfig(fileConfig, input);
|
|
233488
|
-
if (
|
|
233519
|
+
if (signal.aborted) {
|
|
233489
233520
|
return;
|
|
233490
233521
|
}
|
|
233491
233522
|
this.latestConfig = resolvedConfig;
|
|
@@ -233493,9 +233524,14 @@ var init_ConfigController = __esm({
|
|
|
233493
233524
|
this.emitConfigUpdateEvent(resolvedConfig);
|
|
233494
233525
|
return this.latestConfig;
|
|
233495
233526
|
} catch (err) {
|
|
233527
|
+
logger.debug("Error updating config", err.stack);
|
|
233496
233528
|
if (throwErrors) {
|
|
233497
233529
|
throw err;
|
|
233498
233530
|
} else {
|
|
233531
|
+
if (this.#configWatcher?.closed) {
|
|
233532
|
+
logger.debug("Suppressing config error after watcher closed");
|
|
233533
|
+
return;
|
|
233534
|
+
}
|
|
233499
233535
|
this.emitErrorEvent({
|
|
233500
233536
|
type: "error",
|
|
233501
233537
|
reason: "Error resolving config",
|
|
@@ -233514,7 +233550,7 @@ var init_ConfigController = __esm({
|
|
|
233514
233550
|
}
|
|
233515
233551
|
async teardown() {
|
|
233516
233552
|
logger.debug("ConfigController teardown beginning...");
|
|
233517
|
-
|
|
233553
|
+
await super.teardown();
|
|
233518
233554
|
this.#abortController?.abort();
|
|
233519
233555
|
await this.#configWatcher?.close();
|
|
233520
233556
|
logger.debug("ConfigController teardown complete");
|
|
@@ -233778,12 +233814,11 @@ function maybeHandleNetworkLoadResource(url4, bundle, tmpDir) {
|
|
|
233778
233814
|
return (0, import_fs29.readFileSync)(filePath, "utf-8");
|
|
233779
233815
|
}
|
|
233780
233816
|
}
|
|
233781
|
-
var import_fs29,
|
|
233817
|
+
var import_fs29, import_node_url12, import_path28, import_open2, mapConsoleAPIMessageTypeToConsoleMethod, openInspector;
|
|
233782
233818
|
var init_inspect2 = __esm({
|
|
233783
233819
|
"src/dev/inspect.ts"() {
|
|
233784
233820
|
init_import_meta_url();
|
|
233785
233821
|
import_fs29 = require("fs");
|
|
233786
|
-
import_node_os9 = __toESM(require("os"));
|
|
233787
233822
|
import_node_url12 = require("url");
|
|
233788
233823
|
import_path28 = __toESM(require("path"));
|
|
233789
233824
|
import_open2 = __toESM(require_open());
|
|
@@ -233823,7 +233858,7 @@ var init_inspect2 = __esm({
|
|
|
233823
233858
|
const url4 = `https://devtools.devprod.cloudflare.dev/js_app?${query.toString()}`;
|
|
233824
233859
|
const errorMessage = "Failed to open inspector.\nInspector depends on having a Chromium-based browser installed, maybe you need to install one?";
|
|
233825
233860
|
let braveBrowser;
|
|
233826
|
-
switch (
|
|
233861
|
+
switch (process.platform) {
|
|
233827
233862
|
case "darwin":
|
|
233828
233863
|
case "win32":
|
|
233829
233864
|
braveBrowser = "Brave";
|
|
@@ -252589,6 +252624,7 @@ var init_ProxyController = __esm({
|
|
|
252589
252624
|
}
|
|
252590
252625
|
_torndown = false;
|
|
252591
252626
|
async teardown() {
|
|
252627
|
+
await super.teardown();
|
|
252592
252628
|
logger.debug("ProxyController teardown beginning...");
|
|
252593
252629
|
this._torndown = true;
|
|
252594
252630
|
const { proxyWorker } = this;
|
|
@@ -253292,6 +253328,7 @@ var init_RemoteRuntimeController = __esm({
|
|
|
253292
253328
|
notImplemented(this.onPreviewTokenExpired.name, this.constructor.name);
|
|
253293
253329
|
}
|
|
253294
253330
|
async teardown() {
|
|
253331
|
+
await super.teardown();
|
|
253295
253332
|
if (this.#session) {
|
|
253296
253333
|
logger.log(source_default.dim("\u2394 Shutting down remote preview..."));
|
|
253297
253334
|
}
|
|
@@ -253892,9 +253929,8 @@ var init_LocalRuntimeController = __esm({
|
|
|
253892
253929
|
// current container that is being built
|
|
253893
253930
|
containerBeingBuilt;
|
|
253894
253931
|
onBundleStart(_5) {
|
|
253895
|
-
process.
|
|
253896
|
-
|
|
253897
|
-
});
|
|
253932
|
+
process.off("exit", this.cleanupContainers);
|
|
253933
|
+
process.on("exit", this.cleanupContainers);
|
|
253898
253934
|
}
|
|
253899
253935
|
async #onBundleComplete(data, id) {
|
|
253900
253936
|
try {
|
|
@@ -254059,6 +254095,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
254059
254095
|
}, "cleanupContainers");
|
|
254060
254096
|
#teardown = /* @__PURE__ */ __name(async () => {
|
|
254061
254097
|
logger.debug("LocalRuntimeController teardown beginning...");
|
|
254098
|
+
process.off("exit", this.cleanupContainers);
|
|
254062
254099
|
if (this.#mf) {
|
|
254063
254100
|
logger.log(source_default.dim("\u2394 Shutting down local server..."));
|
|
254064
254101
|
}
|
|
@@ -254072,6 +254109,7 @@ var init_LocalRuntimeController = __esm({
|
|
|
254072
254109
|
logger.debug("LocalRuntimeController teardown complete");
|
|
254073
254110
|
}, "#teardown");
|
|
254074
254111
|
async teardown() {
|
|
254112
|
+
await super.teardown();
|
|
254075
254113
|
return this.#mutex.runWith(this.#teardown);
|
|
254076
254114
|
}
|
|
254077
254115
|
// *********************
|
|
@@ -254340,6 +254378,7 @@ var init_MultiworkerRuntimeController = __esm({
|
|
|
254340
254378
|
logger.debug("MultiworkerRuntimeController teardown complete");
|
|
254341
254379
|
}, "#teardown");
|
|
254342
254380
|
async teardown() {
|
|
254381
|
+
await super.teardown();
|
|
254343
254382
|
return this.#mutex.runWith(this.#teardown);
|
|
254344
254383
|
}
|
|
254345
254384
|
};
|
|
@@ -254364,8 +254403,6 @@ var init_NoOpProxyController = __esm({
|
|
|
254364
254403
|
}
|
|
254365
254404
|
onReloadComplete(_data5) {
|
|
254366
254405
|
}
|
|
254367
|
-
async teardown() {
|
|
254368
|
-
}
|
|
254369
254406
|
};
|
|
254370
254407
|
}
|
|
254371
254408
|
});
|