wrangler 3.67.1 → 3.68.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/wrangler-dist/cli.js
CHANGED
@@ -22039,10 +22039,10 @@ var require_lodash = __commonJS({
|
|
22039
22039
|
};
|
22040
22040
|
}
|
22041
22041
|
__name(negate, "negate");
|
22042
|
-
function
|
22042
|
+
function once2(func) {
|
22043
22043
|
return before(2, func);
|
22044
22044
|
}
|
22045
|
-
__name(
|
22045
|
+
__name(once2, "once");
|
22046
22046
|
var overArgs = castRest(function(func, transforms) {
|
22047
22047
|
transforms = transforms.length == 1 && isArray(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee()));
|
22048
22048
|
var funcsLength = transforms.length;
|
@@ -23291,7 +23291,7 @@ var require_lodash = __commonJS({
|
|
23291
23291
|
lodash.nthArg = nthArg;
|
23292
23292
|
lodash.omit = omit;
|
23293
23293
|
lodash.omitBy = omitBy;
|
23294
|
-
lodash.once =
|
23294
|
+
lodash.once = once2;
|
23295
23295
|
lodash.orderBy = orderBy;
|
23296
23296
|
lodash.over = over;
|
23297
23297
|
lodash.overArgs = overArgs;
|
@@ -125409,12 +125409,12 @@ var require_set_cookie = __commonJS({
|
|
125409
125409
|
map: false,
|
125410
125410
|
silent: false
|
125411
125411
|
};
|
125412
|
-
function
|
125412
|
+
function isNonEmptyString2(str) {
|
125413
125413
|
return typeof str === "string" && !!str.trim();
|
125414
125414
|
}
|
125415
|
-
__name(
|
125415
|
+
__name(isNonEmptyString2, "isNonEmptyString");
|
125416
125416
|
function parseString(setCookieValue, options21) {
|
125417
|
-
var parts = setCookieValue.split(";").filter(
|
125417
|
+
var parts = setCookieValue.split(";").filter(isNonEmptyString2);
|
125418
125418
|
var nameValuePairStr = parts.shift();
|
125419
125419
|
var parsed = parseNameValuePair(nameValuePairStr);
|
125420
125420
|
var name = parsed.name;
|
@@ -125497,12 +125497,12 @@ var require_set_cookie = __commonJS({
|
|
125497
125497
|
}
|
125498
125498
|
options21 = options21 ? Object.assign({}, defaultParseOptions, options21) : defaultParseOptions;
|
125499
125499
|
if (!options21.map) {
|
125500
|
-
return input.filter(
|
125500
|
+
return input.filter(isNonEmptyString2).map(function(str) {
|
125501
125501
|
return parseString(str, options21);
|
125502
125502
|
});
|
125503
125503
|
} else {
|
125504
125504
|
var cookies = {};
|
125505
|
-
return input.filter(
|
125505
|
+
return input.filter(isNonEmptyString2).reduce(function(cookies2, str) {
|
125506
125506
|
var cookie = parseString(str, options21);
|
125507
125507
|
cookies2[cookie.name] = cookie;
|
125508
125508
|
return cookies2;
|
@@ -135302,21 +135302,21 @@ Make sure "${service}" is mounted so Miniflare knows where to find it.`);
|
|
135302
135302
|
getEventListeners: () => getEventListeners,
|
135303
135303
|
listenerCount: () => listenerCount,
|
135304
135304
|
on: () => on,
|
135305
|
-
once: () =>
|
135305
|
+
once: () => once2,
|
135306
135306
|
setMaxListeners: () => setMaxListeners
|
135307
135307
|
});
|
135308
|
-
var
|
135309
|
-
var events_default =
|
135310
|
-
var EventEmitter5 =
|
135311
|
-
var EventEmitterAsyncResource =
|
135312
|
-
var captureRejectionSymbol =
|
135313
|
-
var defaultMaxListeners =
|
135314
|
-
var errorMonitor =
|
135315
|
-
var getEventListeners =
|
135316
|
-
var listenerCount =
|
135317
|
-
var on =
|
135318
|
-
var
|
135319
|
-
var setMaxListeners =
|
135308
|
+
var import_node_events7 = __toModule(require("node:events"));
|
135309
|
+
var events_default = import_node_events7.default;
|
135310
|
+
var EventEmitter5 = import_node_events7.default.EventEmitter;
|
135311
|
+
var EventEmitterAsyncResource = import_node_events7.default.EventEmitterAsyncResource;
|
135312
|
+
var captureRejectionSymbol = import_node_events7.default.captureRejectionSymbol;
|
135313
|
+
var defaultMaxListeners = import_node_events7.default.defaultMaxListeners;
|
135314
|
+
var errorMonitor = import_node_events7.default.errorMonitor;
|
135315
|
+
var getEventListeners = import_node_events7.default.getEventListeners;
|
135316
|
+
var listenerCount = import_node_events7.default.listenerCount;
|
135317
|
+
var on = import_node_events7.default.on;
|
135318
|
+
var once2 = import_node_events7.default.once;
|
135319
|
+
var setMaxListeners = import_node_events7.default.setMaxListeners;
|
135320
135320
|
var util_exports = {};
|
135321
135321
|
__export2(util_exports, {
|
135322
135322
|
_extend: () => import_node_util4._extend,
|
@@ -142444,17 +142444,17 @@ var require_eventemitter3 = __commonJS({
|
|
142444
142444
|
if (!new Events().__proto__)
|
142445
142445
|
prefix = false;
|
142446
142446
|
}
|
142447
|
-
function EE(fn2, context2,
|
142447
|
+
function EE(fn2, context2, once2) {
|
142448
142448
|
this.fn = fn2;
|
142449
142449
|
this.context = context2;
|
142450
|
-
this.once =
|
142450
|
+
this.once = once2 || false;
|
142451
142451
|
}
|
142452
142452
|
__name(EE, "EE");
|
142453
|
-
function addListener(emitter, event, fn2, context2,
|
142453
|
+
function addListener(emitter, event, fn2, context2, once2) {
|
142454
142454
|
if (typeof fn2 !== "function") {
|
142455
142455
|
throw new TypeError("The listener must be a function");
|
142456
142456
|
}
|
142457
|
-
var listener = new EE(fn2, context2 || emitter,
|
142457
|
+
var listener = new EE(fn2, context2 || emitter, once2), evt = prefix ? prefix + event : event;
|
142458
142458
|
if (!emitter._events[evt])
|
142459
142459
|
emitter._events[evt] = listener, emitter._eventsCount++;
|
142460
142460
|
else if (!emitter._events[evt].fn)
|
@@ -142566,10 +142566,10 @@ var require_eventemitter3 = __commonJS({
|
|
142566
142566
|
EventEmitter5.prototype.on = /* @__PURE__ */ __name(function on(event, fn2, context2) {
|
142567
142567
|
return addListener(this, event, fn2, context2, false);
|
142568
142568
|
}, "on");
|
142569
|
-
EventEmitter5.prototype.once = /* @__PURE__ */ __name(function
|
142569
|
+
EventEmitter5.prototype.once = /* @__PURE__ */ __name(function once2(event, fn2, context2) {
|
142570
142570
|
return addListener(this, event, fn2, context2, true);
|
142571
142571
|
}, "once");
|
142572
|
-
EventEmitter5.prototype.removeListener = /* @__PURE__ */ __name(function removeListener(event, fn2, context2,
|
142572
|
+
EventEmitter5.prototype.removeListener = /* @__PURE__ */ __name(function removeListener(event, fn2, context2, once2) {
|
142573
142573
|
var evt = prefix ? prefix + event : event;
|
142574
142574
|
if (!this._events[evt])
|
142575
142575
|
return this;
|
@@ -142579,12 +142579,12 @@ var require_eventemitter3 = __commonJS({
|
|
142579
142579
|
}
|
142580
142580
|
var listeners = this._events[evt];
|
142581
142581
|
if (listeners.fn) {
|
142582
|
-
if (listeners.fn === fn2 && (!
|
142582
|
+
if (listeners.fn === fn2 && (!once2 || listeners.once) && (!context2 || listeners.context === context2)) {
|
142583
142583
|
clearEvent(this, evt);
|
142584
142584
|
}
|
142585
142585
|
} else {
|
142586
142586
|
for (var i = 0, events4 = [], length = listeners.length; i < length; i++) {
|
142587
|
-
if (listeners[i].fn !== fn2 ||
|
142587
|
+
if (listeners[i].fn !== fn2 || once2 && !listeners[i].once || context2 && listeners[i].context !== context2) {
|
142588
142588
|
events4.push(listeners[i]);
|
142589
142589
|
}
|
142590
142590
|
}
|
@@ -151168,8 +151168,7 @@ var import_undici25 = __toESM(require_undici());
|
|
151168
151168
|
// src/dev.tsx
|
151169
151169
|
init_import_meta_url();
|
151170
151170
|
var import_node_assert21 = __toESM(require("node:assert"));
|
151171
|
-
var
|
151172
|
-
var import_node_fs35 = require("node:fs");
|
151171
|
+
var import_node_events3 = __toESM(require("node:events"));
|
151173
151172
|
var import_node_path63 = __toESM(require("node:path"));
|
151174
151173
|
var import_node_util3 = __toESM(require("node:util"));
|
151175
151174
|
var import_env2 = __toESM(require_dist());
|
@@ -151351,8 +151350,8 @@ function convertCfWorkerInitBindingstoBindings(inputBindings) {
|
|
151351
151350
|
break;
|
151352
151351
|
}
|
151353
151352
|
case "unsafe": {
|
151354
|
-
for (const { type: unsafeType, name } of info.bindings ?? []) {
|
151355
|
-
output[name] = { type: `unsafe_${unsafeType}
|
151353
|
+
for (const { type: unsafeType, name, ...data } of info.bindings ?? []) {
|
151354
|
+
output[name] = { type: `unsafe_${unsafeType}`, ...data };
|
151356
151355
|
}
|
151357
151356
|
break;
|
151358
151357
|
}
|
@@ -151464,9 +151463,11 @@ async function convertBindingsToCfWorkerInitBindings(inputBindings) {
|
|
151464
151463
|
metadata: void 0,
|
151465
151464
|
capnp: void 0
|
151466
151465
|
};
|
151466
|
+
const { type, ...data } = binding;
|
151467
151467
|
bindings.unsafe.bindings?.push({
|
151468
|
-
type:
|
151469
|
-
name
|
151468
|
+
type: type.slice("unsafe_".length),
|
151469
|
+
name,
|
151470
|
+
...data
|
151470
151471
|
});
|
151471
151472
|
}
|
151472
151473
|
}
|
@@ -152671,7 +152672,7 @@ init_import_meta_url();
|
|
152671
152672
|
init_import_meta_url();
|
152672
152673
|
|
152673
152674
|
// package.json
|
152674
|
-
var version = "3.
|
152675
|
+
var version = "3.68.0";
|
152675
152676
|
var package_default = {
|
152676
152677
|
name: "wrangler",
|
152677
152678
|
version,
|
@@ -152758,7 +152759,7 @@ var package_default = {
|
|
152758
152759
|
selfsigned: "^2.0.1",
|
152759
152760
|
"source-map": "^0.6.1",
|
152760
152761
|
unenv: "npm:unenv-nightly@1.10.0-1717606461.a117952",
|
152761
|
-
workerd: "1.
|
152762
|
+
workerd: "1.20240725.0",
|
152762
152763
|
"xxhash-wasm": "^1.0.1"
|
152763
152764
|
},
|
152764
152765
|
devDependencies: {
|
@@ -152767,7 +152768,7 @@ var package_default = {
|
|
152767
152768
|
"@cloudflare/pages-shared": "workspace:^",
|
152768
152769
|
"@cloudflare/types": "^6.18.4",
|
152769
152770
|
"@cloudflare/workers-tsconfig": "workspace:*",
|
152770
|
-
"@cloudflare/workers-types": "^4.
|
152771
|
+
"@cloudflare/workers-types": "^4.20240725.0",
|
152771
152772
|
"@cspotcode/source-map-support": "0.8.1",
|
152772
152773
|
"@iarna/toml": "^3.0.0",
|
152773
152774
|
"@microsoft/api-extractor": "^7.47.0",
|
@@ -152838,7 +152839,6 @@ var package_default = {
|
|
152838
152839
|
"strip-ansi": "^7.1.0",
|
152839
152840
|
"supports-color": "^9.2.2",
|
152840
152841
|
"timeago.js": "^4.0.2",
|
152841
|
-
"tree-kill": "^1.2.2",
|
152842
152842
|
"ts-dedent": "^2.2.0",
|
152843
152843
|
"ts-json-schema-generator": "^1.5.0",
|
152844
152844
|
undici: "^5.28.4",
|
@@ -152851,7 +152851,7 @@ var package_default = {
|
|
152851
152851
|
"yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz"
|
152852
152852
|
},
|
152853
152853
|
peerDependencies: {
|
152854
|
-
"@cloudflare/workers-types": "^4.
|
152854
|
+
"@cloudflare/workers-types": "^4.20240725.0"
|
152855
152855
|
},
|
152856
152856
|
peerDependenciesMeta: {
|
152857
152857
|
"@cloudflare/workers-types": {
|
@@ -154379,6 +154379,16 @@ var isString = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
|
154379
154379
|
}
|
154380
154380
|
return true;
|
154381
154381
|
}, "isString");
|
154382
|
+
var isNonEmptyString = /* @__PURE__ */ __name((diagnostics, field, value, topLevelEnv) => {
|
154383
|
+
if (!isString(diagnostics, field, value, topLevelEnv)) {
|
154384
|
+
return false;
|
154385
|
+
}
|
154386
|
+
if (value?.trim() === "") {
|
154387
|
+
diagnostics.errors.push(`Expected "${field}" to be a non-empty string.`);
|
154388
|
+
return false;
|
154389
|
+
}
|
154390
|
+
return true;
|
154391
|
+
}, "isNonEmptyString");
|
154382
154392
|
var isValidName = /* @__PURE__ */ __name((diagnostics, field, value) => {
|
154383
154393
|
if (typeof value === "string" && /^$|^[a-z0-9_ ][a-z0-9-_ ]*$/.test(value) || value === void 0) {
|
154384
154394
|
return true;
|
@@ -156151,6 +156161,12 @@ var validateAssetsConfig = /* @__PURE__ */ __name((diagnostics, field, value) =>
|
|
156151
156161
|
value.directory,
|
156152
156162
|
"string"
|
156153
156163
|
) && isValid;
|
156164
|
+
isValid = isNonEmptyString(
|
156165
|
+
diagnostics,
|
156166
|
+
`${field}.directory`,
|
156167
|
+
value.directory,
|
156168
|
+
void 0
|
156169
|
+
) && isValid;
|
156154
156170
|
isValid = validateOptionalProperty(
|
156155
156171
|
diagnostics,
|
156156
156172
|
field,
|
@@ -158970,7 +158986,7 @@ async function bundleWorker(entry, destination, {
|
|
158970
158986
|
bundle,
|
158971
158987
|
moduleCollector = noopModuleCollector,
|
158972
158988
|
additionalModules = [],
|
158973
|
-
|
158989
|
+
serveLegacyAssetsFromWorker,
|
158974
158990
|
doBindings,
|
158975
158991
|
jsxFactory,
|
158976
158992
|
jsxFragment,
|
@@ -159021,7 +159037,7 @@ async function bundleWorker(entry, destination, {
|
|
159021
159037
|
supports: ["modules", "service-worker"]
|
159022
159038
|
});
|
159023
159039
|
}
|
159024
|
-
if (
|
159040
|
+
if (serveLegacyAssetsFromWorker) {
|
159025
159041
|
middlewareToLoad.push({
|
159026
159042
|
name: "serve-static-assets",
|
159027
159043
|
path: "templates/middleware/middleware-serve-static-assets.ts",
|
@@ -162788,10 +162804,10 @@ function buildPersistOptions(localPersistencePath) {
|
|
162788
162804
|
}
|
162789
162805
|
__name(buildPersistOptions, "buildPersistOptions");
|
162790
162806
|
function buildSitesOptions({
|
162791
|
-
|
162807
|
+
legacyAssetPaths
|
162792
162808
|
}) {
|
162793
|
-
if (
|
162794
|
-
const { baseDirectory, assetDirectory, includePatterns, excludePatterns } =
|
162809
|
+
if (legacyAssetPaths !== void 0) {
|
162810
|
+
const { baseDirectory, assetDirectory, includePatterns, excludePatterns } = legacyAssetPaths;
|
162795
162811
|
return {
|
162796
162812
|
sitePath: import_node_path22.default.join(baseDirectory, assetDirectory),
|
162797
162813
|
siteInclude: includePatterns.length > 0 ? includePatterns : void 0,
|
@@ -163024,7 +163040,7 @@ async function localPropsToConfigBundle(props) {
|
|
163024
163040
|
inspectorPort: props.runtimeInspectorPort,
|
163025
163041
|
bindings: props.bindings,
|
163026
163042
|
workerDefinitions: props.workerDefinitions,
|
163027
|
-
|
163043
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
163028
163044
|
initialPort: props.initialPort,
|
163029
163045
|
initialIp: props.initialIp,
|
163030
163046
|
rules: props.rules,
|
@@ -177879,16 +177895,39 @@ __name(checkAndConfirmForceDeleteIfNecessary, "checkAndConfirmForceDeleteIfNeces
|
|
177879
177895
|
|
177880
177896
|
// src/deploy/index.ts
|
177881
177897
|
init_import_meta_url();
|
177882
|
-
var import_node_fs20 = require("node:fs");
|
177883
177898
|
var import_node_path34 = __toESM(require("node:path"));
|
177884
177899
|
|
177885
177900
|
// src/experimental-assets.ts
|
177886
177901
|
init_import_meta_url();
|
177902
|
+
var import_node_fs20 = require("node:fs");
|
177887
177903
|
var import_node_path33 = __toESM(require("node:path"));
|
177888
|
-
function getExperimentalAssetsBasePath(config,
|
177889
|
-
return
|
177904
|
+
function getExperimentalAssetsBasePath(config, experimentalAssetsCommandLineArg) {
|
177905
|
+
return experimentalAssetsCommandLineArg ? process.cwd() : import_node_path33.default.resolve(import_node_path33.default.dirname(config.configPath ?? "wrangler.toml"));
|
177890
177906
|
}
|
177891
177907
|
__name(getExperimentalAssetsBasePath, "getExperimentalAssetsBasePath");
|
177908
|
+
function processExperimentalAssetsArg(args, config) {
|
177909
|
+
const experimentalAssets = args.experimentalAssets ? { directory: args.experimentalAssets } : config.experimental_assets;
|
177910
|
+
if (experimentalAssets) {
|
177911
|
+
const experimentalAssetsBasePath = getExperimentalAssetsBasePath(
|
177912
|
+
config,
|
177913
|
+
args.experimentalAssets
|
177914
|
+
);
|
177915
|
+
const resolvedExperimentalAssetsPath = import_node_path33.default.resolve(
|
177916
|
+
experimentalAssetsBasePath,
|
177917
|
+
experimentalAssets.directory
|
177918
|
+
);
|
177919
|
+
if (!(0, import_node_fs20.existsSync)(resolvedExperimentalAssetsPath)) {
|
177920
|
+
const sourceOfTruthMessage = args.experimentalAssets ? '"--experimental-assets" command line argument' : '"experimental_assets.directory" field in your configuration file';
|
177921
|
+
throw new UserError(
|
177922
|
+
`The directory specified by the ${sourceOfTruthMessage} does not exist:
|
177923
|
+
${resolvedExperimentalAssetsPath}`
|
177924
|
+
);
|
177925
|
+
}
|
177926
|
+
experimentalAssets.directory = resolvedExperimentalAssetsPath;
|
177927
|
+
}
|
177928
|
+
return experimentalAssets;
|
177929
|
+
}
|
177930
|
+
__name(processExperimentalAssetsArg, "processExperimentalAssetsArg");
|
177892
177931
|
|
177893
177932
|
// src/sites.ts
|
177894
177933
|
init_import_meta_url();
|
@@ -178228,7 +178267,7 @@ function urlSafe(filePath) {
|
|
178228
178267
|
return filePath.replace(/\\/g, "/");
|
178229
178268
|
}
|
178230
178269
|
__name(urlSafe, "urlSafe");
|
178231
|
-
function
|
178270
|
+
function getLegacyAssetPaths(config, assetDirectory) {
|
178232
178271
|
const baseDirectory = assetDirectory ? process.cwd() : path40.resolve(path40.dirname(config.configPath ?? "wrangler.toml"));
|
178233
178272
|
assetDirectory ??= typeof config.legacy_assets === "string" ? config.legacy_assets : config.legacy_assets !== void 0 ? config.legacy_assets.bucket : void 0;
|
178234
178273
|
const includePatterns = typeof config.legacy_assets !== "string" && config.legacy_assets?.include || [];
|
@@ -178240,7 +178279,7 @@ function getAssetPaths(config, assetDirectory) {
|
|
178240
178279
|
excludePatterns
|
178241
178280
|
} : void 0;
|
178242
178281
|
}
|
178243
|
-
__name(
|
178282
|
+
__name(getLegacyAssetPaths, "getLegacyAssetPaths");
|
178244
178283
|
function getSiteAssetPaths(config, assetDirectory, includePatterns = config.site?.include ?? [], excludePatterns = config.site?.exclude ?? []) {
|
178245
178284
|
const baseDirectory = assetDirectory ? process.cwd() : path40.resolve(path40.dirname(config.configPath ?? "wrangler.toml"));
|
178246
178285
|
assetDirectory ??= config.site?.bucket;
|
@@ -178482,30 +178521,12 @@ Please shift to the --legacy-assets command to preserve the current functionalit
|
|
178482
178521
|
"Cannot use Assets and Workers Sites in the same Worker."
|
178483
178522
|
);
|
178484
178523
|
}
|
178485
|
-
const experimentalAssets = args.experimentalAssets ? { directory: args.experimentalAssets } : config.experimental_assets;
|
178486
|
-
if (experimentalAssets) {
|
178487
|
-
const experimentalAssetsBasePath = getExperimentalAssetsBasePath(
|
178488
|
-
config,
|
178489
|
-
args.experimentalAssets
|
178490
|
-
);
|
178491
|
-
const resolvedExperimentalAssetsPath = import_node_path34.default.resolve(
|
178492
|
-
experimentalAssetsBasePath,
|
178493
|
-
experimentalAssets.directory
|
178494
|
-
);
|
178495
|
-
if (!(0, import_node_fs20.existsSync)(resolvedExperimentalAssetsPath)) {
|
178496
|
-
const sourceOfTruthMessage = args.experimentalAssets ? '"--experimental-assets" command line argument' : '"experimental_assets.directory" field in your configuration file';
|
178497
|
-
throw new UserError(
|
178498
|
-
`The directory specified by the ${sourceOfTruthMessage} does not exist:
|
178499
|
-
${resolvedExperimentalAssetsPath}`
|
178500
|
-
);
|
178501
|
-
}
|
178502
|
-
experimentalAssets.directory = resolvedExperimentalAssetsPath;
|
178503
|
-
}
|
178504
178524
|
if (args.assets) {
|
178505
178525
|
logger.warn(
|
178506
178526
|
"The --assets argument is experimental and may change or break at any time"
|
178507
178527
|
);
|
178508
178528
|
}
|
178529
|
+
const experimentalAssets = processExperimentalAssetsArg(args, config);
|
178509
178530
|
if (args.latest) {
|
178510
178531
|
logger.warn(
|
178511
178532
|
"Using the latest version of the Workers runtime. To silence this warning, please choose a specific version of the runtime with --compatibility-date, or add a compatibility_date to your wrangler.toml.\n"
|
@@ -178515,7 +178536,7 @@ ${resolvedExperimentalAssetsPath}`
|
|
178515
178536
|
const cliDefines = collectKeyValues(args.define);
|
178516
178537
|
const cliAlias = collectKeyValues(args.alias);
|
178517
178538
|
const accountId = args.dryRun ? void 0 : await requireAuth(config);
|
178518
|
-
const
|
178539
|
+
const legacyAssetPaths = args.legacyAssets || config.legacy_assets ? getLegacyAssetPaths(config, args.legacyAssets) : getSiteAssetPaths(
|
178519
178540
|
config,
|
178520
178541
|
args.site,
|
178521
178542
|
args.siteInclude,
|
@@ -178543,7 +178564,7 @@ ${resolvedExperimentalAssetsPath}`
|
|
178543
178564
|
tsconfig: args.tsconfig,
|
178544
178565
|
routes: args.routes,
|
178545
178566
|
experimentalAssets: experimentalAssets?.directory,
|
178546
|
-
|
178567
|
+
legacyAssetPaths,
|
178547
178568
|
legacyEnv: isLegacyEnv(config),
|
178548
178569
|
minify: args.minify,
|
178549
178570
|
nodeCompat: args.nodeCompat,
|
@@ -180720,7 +180741,7 @@ function buildWorkerFromFunctions({
|
|
180720
180741
|
}
|
180721
180742
|
],
|
180722
180743
|
isOutfile: !outdir,
|
180723
|
-
|
180744
|
+
serveLegacyAssetsFromWorker: false,
|
180724
180745
|
checkFetch: local,
|
180725
180746
|
targetConsumer: local ? "dev" : "deploy",
|
180726
180747
|
forPages: true,
|
@@ -180790,7 +180811,7 @@ function buildRawWorker({
|
|
180790
180811
|
] : []
|
180791
180812
|
],
|
180792
180813
|
isOutfile: !outdir,
|
180793
|
-
|
180814
|
+
serveLegacyAssetsFromWorker: false,
|
180794
180815
|
checkFetch: local,
|
180795
180816
|
targetConsumer: local ? "dev" : "deploy",
|
180796
180817
|
forPages: true,
|
@@ -181008,7 +181029,7 @@ function buildPluginFromFunctions({
|
|
181008
181029
|
}
|
181009
181030
|
}
|
181010
181031
|
],
|
181011
|
-
|
181032
|
+
serveLegacyAssetsFromWorker: false,
|
181012
181033
|
checkFetch: local,
|
181013
181034
|
targetConsumer: local ? "dev" : "deploy",
|
181014
181035
|
forPages: true,
|
@@ -184614,6 +184635,12 @@ function Options14(yargs) {
|
|
184614
184635
|
describe: "Show interactive dev session (defaults to true if the terminal supports interactivity)",
|
184615
184636
|
type: "boolean"
|
184616
184637
|
},
|
184638
|
+
"experimental-dev-env": {
|
184639
|
+
alias: ["x-dev-env"],
|
184640
|
+
type: "boolean",
|
184641
|
+
describe: "Use the experimental DevEnv instantiation (unified across wrangler dev and unstable_dev)",
|
184642
|
+
default: false
|
184643
|
+
},
|
184617
184644
|
"experimental-registry": {
|
184618
184645
|
alias: ["x-registry"],
|
184619
184646
|
type: "boolean",
|
@@ -185017,7 +185044,8 @@ ${JSON.stringify(defaultRoutesJSONSpec, null, 2)}`
|
|
185017
185044
|
showInteractiveDevSession: args.showInteractiveDevSession,
|
185018
185045
|
testMode: false,
|
185019
185046
|
watch: true,
|
185020
|
-
fileBasedRegistry: args.experimentalRegistry
|
185047
|
+
fileBasedRegistry: args.experimentalRegistry,
|
185048
|
+
devEnv: args.experimentalDevEnv
|
185021
185049
|
}
|
185022
185050
|
});
|
185023
185051
|
await sendMetricsEvent("run pages dev");
|
@@ -200627,7 +200655,7 @@ async function parseModules(accountId, scriptName, versionId) {
|
|
200627
200655
|
const formData = await contentRes.formData();
|
200628
200656
|
if (formData.get("__STATIC_CONTENT_MANIFEST") !== null) {
|
200629
200657
|
throw new UserError(
|
200630
|
-
"Workers Sites
|
200658
|
+
"Workers Sites and Legacy Assets do not support updating secrets through `wrangler versions secret put`. You must use `wrangler secret put` instead."
|
200631
200659
|
);
|
200632
200660
|
}
|
200633
200661
|
const entrypoint = contentRes.headers.get("cf-entrypoint");
|
@@ -200641,7 +200669,7 @@ async function parseModules(accountId, scriptName, versionId) {
|
|
200641
200669
|
const mainModule = {
|
200642
200670
|
name: entrypointPart.name,
|
200643
200671
|
filePath: "",
|
200644
|
-
content: await entrypointPart.
|
200672
|
+
content: Buffer.from(await entrypointPart.arrayBuffer()),
|
200645
200673
|
type: fromMimeType(entrypointPart.type)
|
200646
200674
|
};
|
200647
200675
|
const modules = await Promise.all(
|
@@ -200651,7 +200679,7 @@ async function parseModules(accountId, scriptName, versionId) {
|
|
200651
200679
|
async ([name, file]) => ({
|
200652
200680
|
name,
|
200653
200681
|
filePath: "",
|
200654
|
-
content: await file.
|
200682
|
+
content: Buffer.from(await file.arrayBuffer()),
|
200655
200683
|
type: fromMimeType(file.type)
|
200656
200684
|
})
|
200657
200685
|
)
|
@@ -200911,7 +200939,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
200911
200939
|
bundle: true,
|
200912
200940
|
additionalModules: [],
|
200913
200941
|
moduleCollector,
|
200914
|
-
|
200942
|
+
serveLegacyAssetsFromWorker: false,
|
200915
200943
|
doBindings: config.durable_objects.bindings,
|
200916
200944
|
jsxFactory,
|
200917
200945
|
jsxFragment,
|
@@ -201356,20 +201384,39 @@ function versionsUploadOptions(yargs) {
|
|
201356
201384
|
describe: "Use the latest version of the worker runtime",
|
201357
201385
|
type: "boolean",
|
201358
201386
|
default: false
|
201387
|
+
}).option("legacy-assets", {
|
201388
|
+
describe: "(Experimental) Static assets to be served",
|
201389
|
+
type: "string",
|
201390
|
+
requiresArg: true,
|
201391
|
+
hidden: true
|
201392
|
+
}).option("assets", {
|
201393
|
+
describe: "(Experimental) Static assets to be served",
|
201394
|
+
type: "string",
|
201395
|
+
requiresArg: true,
|
201396
|
+
hidden: true
|
201397
|
+
}).option("experimental-assets", {
|
201398
|
+
describe: "Static assets to be served",
|
201399
|
+
type: "string",
|
201400
|
+
alias: "x-assets",
|
201401
|
+
requiresArg: true,
|
201402
|
+
hidden: true
|
201359
201403
|
}).option("site", {
|
201360
201404
|
describe: "Root folder of static assets for Workers Sites",
|
201361
201405
|
type: "string",
|
201362
|
-
requiresArg: true
|
201406
|
+
requiresArg: true,
|
201407
|
+
hidden: true
|
201363
201408
|
}).option("site-include", {
|
201364
201409
|
describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Only matched items will be uploaded.",
|
201365
201410
|
type: "string",
|
201366
201411
|
requiresArg: true,
|
201367
|
-
array: true
|
201412
|
+
array: true,
|
201413
|
+
hidden: true
|
201368
201414
|
}).option("site-exclude", {
|
201369
201415
|
describe: "Array of .gitignore-style patterns that match file or directory names from the sites directory. Matched items will not be uploaded.",
|
201370
201416
|
type: "string",
|
201371
201417
|
requiresArg: true,
|
201372
|
-
array: true
|
201418
|
+
array: true,
|
201419
|
+
hidden: true
|
201373
201420
|
}).option("var", {
|
201374
201421
|
describe: "A key-value pair to be injected into the script as a variable",
|
201375
201422
|
type: "string",
|
@@ -201425,7 +201472,7 @@ async function versionsUploadHandler(args) {
|
|
201425
201472
|
const configPath = args.config || args.script && findWranglerToml(import_node_path57.default.dirname(args.script));
|
201426
201473
|
const projectRoot = configPath && import_node_path57.default.dirname(configPath);
|
201427
201474
|
const config = readConfig(configPath, args);
|
201428
|
-
const entry = await getEntry(args, config, "
|
201475
|
+
const entry = await getEntry(args, config, "versions upload");
|
201429
201476
|
await sendMetricsEvent(
|
201430
201477
|
"upload worker version",
|
201431
201478
|
{
|
@@ -201435,6 +201482,18 @@ async function versionsUploadHandler(args) {
|
|
201435
201482
|
sendMetrics: config.send_metrics
|
201436
201483
|
}
|
201437
201484
|
);
|
201485
|
+
args.legacyAssets = args.legacyAssets ?? args.assets;
|
201486
|
+
if (args.site || config.site) {
|
201487
|
+
throw new UserError(
|
201488
|
+
"Workers Sites does not support uploading versions through `wrangler versions upload`. You must use `wrangler deploy` instead."
|
201489
|
+
);
|
201490
|
+
}
|
201491
|
+
if (args.legacyAssets || config.legacy_assets) {
|
201492
|
+
throw new UserError(
|
201493
|
+
"Legacy Assets does not support uploading versions through `wrangler versions upload`. You must use `wrangler deploy` instead."
|
201494
|
+
);
|
201495
|
+
}
|
201496
|
+
const experimentalAssets = processExperimentalAssetsArg(args, config);
|
201438
201497
|
if (args.latest) {
|
201439
201498
|
logger.warn(
|
201440
201499
|
"Using the latest version of the Workers runtime. To silence this warning, please choose a specific version of the runtime with --compatibility-date, or add a compatibility_date to your wrangler.toml.\n"
|
@@ -201461,6 +201520,7 @@ async function versionsUploadHandler(args) {
|
|
201461
201520
|
jsxFactory: args.jsxFactory,
|
201462
201521
|
jsxFragment: args.jsxFragment,
|
201463
201522
|
tsconfig: args.tsconfig,
|
201523
|
+
experimentalAssets: experimentalAssets?.directory,
|
201464
201524
|
minify: args.minify,
|
201465
201525
|
uploadSourceMaps: args.uploadSourceMaps,
|
201466
201526
|
nodeCompat: args.nodeCompat,
|
@@ -204224,7 +204284,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
204224
204284
|
return {};
|
204225
204285
|
}
|
204226
204286
|
}
|
204227
|
-
if (!props.isWorkersSite && Boolean(props.
|
204287
|
+
if (!props.isWorkersSite && Boolean(props.legacyAssetPaths) && format10 === "service-worker") {
|
204228
204288
|
throw new UserError(
|
204229
204289
|
"You cannot use the service-worker format with an `assets` directory yet. For information on how to migrate to the module-worker format, see: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/"
|
204230
204290
|
);
|
@@ -204281,7 +204341,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
204281
204341
|
bundle: true,
|
204282
204342
|
additionalModules: [],
|
204283
204343
|
moduleCollector,
|
204284
|
-
|
204344
|
+
serveLegacyAssetsFromWorker: !props.isWorkersSite && Boolean(props.legacyAssetPaths),
|
204285
204345
|
doBindings: config.durable_objects.bindings,
|
204286
204346
|
jsxFactory,
|
204287
204347
|
jsxFragment,
|
@@ -204332,7 +204392,7 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
204332
204392
|
// include it in the kv namespace name regardless (since there's no
|
204333
204393
|
// concept of service environments for kv namespaces yet).
|
204334
204394
|
scriptName + (!props.legacyEnv && props.env ? `-${props.env}` : ""),
|
204335
|
-
props.
|
204395
|
+
props.legacyAssetPaths,
|
204336
204396
|
false,
|
204337
204397
|
props.dryRun,
|
204338
204398
|
props.oldAssetTtl
|
@@ -204425,9 +204485,11 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
204425
204485
|
maskedVars[key] = "(hidden)";
|
204426
204486
|
}
|
204427
204487
|
}
|
204428
|
-
|
204429
|
-
|
204488
|
+
if (props.dryRun) {
|
204489
|
+
printBindings({ ...withoutStaticAssets, vars: maskedVars });
|
204490
|
+
} else {
|
204430
204491
|
await ensureQueuesExistByConfig(config);
|
204492
|
+
let bindingsPrinted = false;
|
204431
204493
|
try {
|
204432
204494
|
const result = await fetchResult(
|
204433
204495
|
workerUrl,
|
@@ -204443,6 +204505,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
204443
204505
|
excludeScript: "true"
|
204444
204506
|
})
|
204445
204507
|
);
|
204508
|
+
logger.log("Worker Startup Time:", result.startup_time_ms, "ms");
|
204509
|
+
bindingsPrinted = true;
|
204510
|
+
printBindings({ ...withoutStaticAssets, vars: maskedVars });
|
204446
204511
|
deploymentId = addHyphens(result.deployment_id) ?? result.deployment_id;
|
204447
204512
|
if (config.first_party_worker) {
|
204448
204513
|
if (result.id) {
|
@@ -204462,6 +204527,9 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
|
|
204462
204527
|
}
|
204463
204528
|
}
|
204464
204529
|
} catch (err) {
|
204530
|
+
if (!bindingsPrinted) {
|
204531
|
+
printBindings({ ...withoutStaticAssets, vars: maskedVars });
|
204532
|
+
}
|
204465
204533
|
helpIfErrorIsSizeOrScriptStartup2(err, dependencies);
|
204466
204534
|
if (err instanceof APIError && "code" in err && err.code === 10021 && err.notes.length > 0) {
|
204467
204535
|
err.preventReport();
|
@@ -205475,7 +205543,7 @@ function Remote(props) {
|
|
205475
205543
|
modules: props.bundle ? props.bundle.modules : [],
|
205476
205544
|
accountId: props.accountId,
|
205477
205545
|
bindings: props.bindings,
|
205478
|
-
|
205546
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
205479
205547
|
isWorkersSite: props.isWorkersSite,
|
205480
205548
|
compatibilityDate: props.compatibilityDate,
|
205481
205549
|
compatibilityFlags: props.compatibilityFlags,
|
@@ -205597,7 +205665,7 @@ function useWorker(props) {
|
|
205597
205665
|
legacyEnv: props.legacyEnv,
|
205598
205666
|
env: props.env,
|
205599
205667
|
isWorkersSite: props.isWorkersSite,
|
205600
|
-
|
205668
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
205601
205669
|
format: props.format,
|
205602
205670
|
bindings: props.bindings,
|
205603
205671
|
compatibilityDate: props.compatibilityDate,
|
@@ -205672,7 +205740,7 @@ function useWorker(props) {
|
|
205672
205740
|
props.bundle,
|
205673
205741
|
props.format,
|
205674
205742
|
props.accountId,
|
205675
|
-
props.
|
205743
|
+
props.legacyAssetPaths,
|
205676
205744
|
props.isWorkersSite,
|
205677
205745
|
props.compatibilityDate,
|
205678
205746
|
props.compatibilityFlags,
|
@@ -205720,7 +205788,7 @@ async function startRemoteServer(props) {
|
|
205720
205788
|
}
|
205721
205789
|
const previewServer = await startPreviewServer({
|
205722
205790
|
previewToken,
|
205723
|
-
assetDirectory: props.isWorkersSite ? void 0 : props.
|
205791
|
+
assetDirectory: props.isWorkersSite ? void 0 : props.legacyAssetPaths?.assetDirectory,
|
205724
205792
|
localProtocol: props.localProtocol,
|
205725
205793
|
customHttpsKeyPath: props.httpsKeyPath,
|
205726
205794
|
customHttpsCertPath: props.httpsCertPath,
|
@@ -205801,7 +205869,7 @@ async function getRemotePreviewToken(props) {
|
|
205801
205869
|
legacyEnv: props.legacyEnv,
|
205802
205870
|
env: props.env,
|
205803
205871
|
isWorkersSite: props.isWorkersSite,
|
205804
|
-
|
205872
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
205805
205873
|
format: props.format,
|
205806
205874
|
bindings: props.bindings,
|
205807
205875
|
compatibilityDate: props.compatibilityDate,
|
@@ -205849,7 +205917,7 @@ async function createRemoteWorkerInit(props) {
|
|
205849
205917
|
// include it in the kv namespace name regardless (since there's no
|
205850
205918
|
// concept of service environments for kv namespaces yet).
|
205851
205919
|
props.name + (!props.legacyEnv && props.env ? `-${props.env}` : ""),
|
205852
|
-
props.isWorkersSite ? props.
|
205920
|
+
props.isWorkersSite ? props.legacyAssetPaths : void 0,
|
205853
205921
|
true,
|
205854
205922
|
false,
|
205855
205923
|
void 0
|
@@ -205991,7 +206059,7 @@ function runBuild({
|
|
205991
206059
|
additionalModules,
|
205992
206060
|
rules,
|
205993
206061
|
legacyAssets,
|
205994
|
-
|
206062
|
+
serveLegacyAssetsFromWorker,
|
205995
206063
|
tsconfig,
|
205996
206064
|
minify,
|
205997
206065
|
nodejsCompatMode,
|
@@ -206081,7 +206149,7 @@ function runBuild({
|
|
206081
206149
|
bundle: !noBundle,
|
206082
206150
|
moduleCollector,
|
206083
206151
|
additionalModules: newAdditionalModules,
|
206084
|
-
|
206152
|
+
serveLegacyAssetsFromWorker,
|
206085
206153
|
jsxFactory,
|
206086
206154
|
jsxFragment,
|
206087
206155
|
watch: true,
|
@@ -206148,7 +206216,7 @@ function useEsbuild({
|
|
206148
206216
|
additionalModules,
|
206149
206217
|
rules,
|
206150
206218
|
legacyAssets,
|
206151
|
-
|
206219
|
+
serveLegacyAssetsFromWorker,
|
206152
206220
|
tsconfig,
|
206153
206221
|
minify,
|
206154
206222
|
nodejsCompatMode,
|
@@ -206178,7 +206246,7 @@ function useEsbuild({
|
|
206178
206246
|
additionalModules,
|
206179
206247
|
rules,
|
206180
206248
|
legacyAssets,
|
206181
|
-
|
206249
|
+
serveLegacyAssetsFromWorker,
|
206182
206250
|
tsconfig,
|
206183
206251
|
minify,
|
206184
206252
|
nodejsCompatMode,
|
@@ -206205,7 +206273,7 @@ function useEsbuild({
|
|
206205
206273
|
destination,
|
206206
206274
|
jsxFactory,
|
206207
206275
|
jsxFragment,
|
206208
|
-
|
206276
|
+
serveLegacyAssetsFromWorker,
|
206209
206277
|
processEntrypoint,
|
206210
206278
|
additionalModules,
|
206211
206279
|
rules,
|
@@ -206238,7 +206306,7 @@ __name(useEsbuild, "useEsbuild");
|
|
206238
206306
|
// src/dev/validate-dev-props.ts
|
206239
206307
|
init_import_meta_url();
|
206240
206308
|
function validateDevProps(props) {
|
206241
|
-
if (!props.isWorkersSite && props.
|
206309
|
+
if (!props.isWorkersSite && props.legacyAssetPaths && props.entry.format === "service-worker") {
|
206242
206310
|
throw new UserError(
|
206243
206311
|
"You cannot use the service-worker format with an `assets` directory yet. For information on how to migrate to the module-worker format, see: https://developers.cloudflare.com/workers/learning/migrating-to-module-workers/"
|
206244
206312
|
);
|
@@ -206540,15 +206608,15 @@ function DevSession(props) {
|
|
206540
206608
|
persist: ""
|
206541
206609
|
},
|
206542
206610
|
legacy: {
|
206543
|
-
site: props.isWorkersSite && props.
|
206611
|
+
site: props.isWorkersSite && props.legacyAssetPaths ? {
|
206544
206612
|
bucket: path66.join(
|
206545
|
-
props.
|
206546
|
-
props.
|
206613
|
+
props.legacyAssetPaths.baseDirectory,
|
206614
|
+
props.legacyAssetPaths?.assetDirectory
|
206547
206615
|
),
|
206548
|
-
include: props.
|
206549
|
-
exclude: props.
|
206616
|
+
include: props.legacyAssetPaths.includePatterns,
|
206617
|
+
exclude: props.legacyAssetPaths.excludePatterns
|
206550
206618
|
} : void 0,
|
206551
|
-
legacyAssets: props.
|
206619
|
+
legacyAssets: props.legacyAssetsConfig,
|
206552
206620
|
enableServiceEnvironments: !props.legacyEnv
|
206553
206621
|
},
|
206554
206622
|
unsafe: {
|
@@ -206565,10 +206633,10 @@ function DevSession(props) {
|
|
206565
206633
|
props.compatibilityFlags,
|
206566
206634
|
props.bindings,
|
206567
206635
|
props.entry,
|
206568
|
-
props.
|
206636
|
+
props.legacyAssetPaths,
|
206569
206637
|
props.isWorkersSite,
|
206570
206638
|
props.local,
|
206571
|
-
props.
|
206639
|
+
props.legacyAssetsConfig,
|
206572
206640
|
props.processEntrypoint,
|
206573
206641
|
props.additionalModules,
|
206574
206642
|
props.env,
|
@@ -206646,8 +206714,8 @@ function DevSession(props) {
|
|
206646
206714
|
additionalModules: props.additionalModules,
|
206647
206715
|
rules: props.rules,
|
206648
206716
|
jsxFragment: props.jsxFragment,
|
206649
|
-
|
206650
|
-
props.
|
206717
|
+
serveLegacyAssetsFromWorker: Boolean(
|
206718
|
+
props.legacyAssetPaths && !props.isWorkersSite && props.local
|
206651
206719
|
),
|
206652
206720
|
tsconfig: props.tsconfig,
|
206653
206721
|
minify: props.minify,
|
@@ -206656,7 +206724,7 @@ function DevSession(props) {
|
|
206656
206724
|
alias: props.alias,
|
206657
206725
|
noBundle: props.noBundle,
|
206658
206726
|
findAdditionalModules: props.findAdditionalModules,
|
206659
|
-
legacyAssets: props.
|
206727
|
+
legacyAssets: props.legacyAssetsConfig,
|
206660
206728
|
durableObjects: props.bindings.durable_objects || { bindings: [] },
|
206661
206729
|
local: props.local,
|
206662
206730
|
// Enable the bundling to know whether we are using dev or deploy
|
@@ -206721,7 +206789,7 @@ function DevSession(props) {
|
|
206721
206789
|
usageModel: props.usageModel,
|
206722
206790
|
bindings: props.bindings,
|
206723
206791
|
workerDefinitions,
|
206724
|
-
|
206792
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
206725
206793
|
initialPort: void 0,
|
206726
206794
|
initialIp: "127.0.0.1",
|
206727
206795
|
rules: props.rules,
|
@@ -206749,7 +206817,7 @@ function DevSession(props) {
|
|
206749
206817
|
bundle,
|
206750
206818
|
format: props.entry.format,
|
206751
206819
|
bindings: props.bindings,
|
206752
|
-
|
206820
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
206753
206821
|
isWorkersSite: props.isWorkersSite,
|
206754
206822
|
port: props.initialPort,
|
206755
206823
|
ip: props.initialIp,
|
@@ -207132,6 +207200,7 @@ __name(registerDevHotKeys, "registerDevHotKeys");
|
|
207132
207200
|
|
207133
207201
|
// src/dev/start-server.ts
|
207134
207202
|
init_import_meta_url();
|
207203
|
+
var import_node_events2 = require("node:events");
|
207135
207204
|
var import_promises25 = require("node:fs/promises");
|
207136
207205
|
var path67 = __toESM(require("node:path"));
|
207137
207206
|
var util3 = __toESM(require("node:util"));
|
@@ -207172,7 +207241,15 @@ async function startDevServer(props) {
|
|
207172
207241
|
const devEnv = props.devEnv;
|
207173
207242
|
const startDevWorkerOptions = {
|
207174
207243
|
name: props.name ?? "worker",
|
207244
|
+
config: props.rawConfig.configPath,
|
207175
207245
|
entrypoint: props.entry.file,
|
207246
|
+
compatibilityDate: props.compatibilityDate,
|
207247
|
+
compatibilityFlags: props.compatibilityFlags,
|
207248
|
+
triggers: props.routes?.map((r3) => ({
|
207249
|
+
type: "route",
|
207250
|
+
...typeof r3 === "string" ? { pattern: r3 } : r3
|
207251
|
+
})),
|
207252
|
+
bindings: convertCfWorkerInitBindingstoBindings(props.bindings),
|
207176
207253
|
dev: {
|
207177
207254
|
server: {
|
207178
207255
|
hostname: props.initialIp,
|
@@ -207186,10 +207263,10 @@ async function startDevServer(props) {
|
|
207186
207263
|
},
|
207187
207264
|
origin: {
|
207188
207265
|
secure: props.upstreamProtocol === "https",
|
207189
|
-
hostname: props.localUpstream
|
207266
|
+
hostname: props.host ?? props.localUpstream
|
207190
207267
|
},
|
207191
207268
|
liveReload: props.liveReload,
|
207192
|
-
remote: !props.local,
|
207269
|
+
remote: !props.forceLocal && !props.local,
|
207193
207270
|
auth: async () => {
|
207194
207271
|
let accountId = props.accountId;
|
207195
207272
|
if (accountId === void 0) {
|
@@ -207207,24 +207284,71 @@ async function startDevServer(props) {
|
|
207207
207284
|
}
|
207208
207285
|
}
|
207209
207286
|
return { accountId, apiToken: requireApiToken() };
|
207210
|
-
}
|
207287
|
+
},
|
207288
|
+
persist: props.localPersistencePath ?? void 0,
|
207289
|
+
testScheduled: props.testScheduled,
|
207290
|
+
registry: workerDefinitions
|
207211
207291
|
},
|
207212
207292
|
build: {
|
207213
|
-
|
207293
|
+
bundle: !props.noBundle,
|
207294
|
+
define: props.define,
|
207295
|
+
jsxFactory: props.jsxFactory,
|
207296
|
+
jsxFragment: props.jsxFragment,
|
207297
|
+
tsconfig: props.tsconfig,
|
207298
|
+
minify: props.minify,
|
207299
|
+
processEntrypoint: props.processEntrypoint,
|
207300
|
+
additionalModules: props.additionalModules,
|
207214
207301
|
moduleRoot: props.entry.moduleRoot,
|
207215
|
-
|
207302
|
+
moduleRules: props.rules,
|
207303
|
+
nodejsCompatMode: props.nodejsCompatMode
|
207216
207304
|
}
|
207217
207305
|
};
|
207218
|
-
if (
|
207219
|
-
devEnv.
|
207220
|
-
|
207221
|
-
|
207222
|
-
|
207223
|
-
|
207224
|
-
|
207225
|
-
config: fakeResolvedInput(startDevWorkerOptions)
|
207306
|
+
if (props.experimentalDevEnv) {
|
207307
|
+
devEnv.runtimes.forEach((runtime) => {
|
207308
|
+
runtime.on("reloadComplete", async (ev) => {
|
207309
|
+
const { proxyWorker } = await devEnv.proxy.ready.promise;
|
207310
|
+
const url4 = await proxyWorker.ready;
|
207311
|
+
props.onReady?.(url4.hostname, parseInt(url4.port), ev.proxyData);
|
207312
|
+
});
|
207226
207313
|
});
|
207314
|
+
await devEnv.config.set(startDevWorkerOptions);
|
207315
|
+
const stop = /* @__PURE__ */ __name(async () => {
|
207316
|
+
await Promise.allSettled([stopWorkerRegistry(), devEnv.teardown()]);
|
207317
|
+
}, "stop");
|
207318
|
+
try {
|
207319
|
+
await Promise.all([
|
207320
|
+
// adhere to unstable_dev contract:
|
207321
|
+
// - only resolve when UserWorker is ready
|
207322
|
+
// - reject if UserWorker fails to start
|
207323
|
+
Promise.race(
|
207324
|
+
devEnv.runtimes.flatMap((runtime) => [
|
207325
|
+
(0, import_node_events2.once)(runtime, "reloadComplete"),
|
207326
|
+
(0, import_node_events2.once)(runtime, "error").then((err) => Promise.reject(err))
|
207327
|
+
])
|
207328
|
+
),
|
207329
|
+
// adhere to unstable_dev contract:
|
207330
|
+
// - only resolve when _perceived_ UserWorker is ready
|
207331
|
+
// - throw if _perceived_ UserWorker fails to start
|
207332
|
+
// to the eyeball, the ProxyWorker is the _perceived_ UserWorker
|
207333
|
+
Promise.race([
|
207334
|
+
devEnv.proxy.ready.promise,
|
207335
|
+
(0, import_node_events2.once)(devEnv.proxy, "error").then((err) => Promise.reject(err))
|
207336
|
+
])
|
207337
|
+
]);
|
207338
|
+
} catch (err) {
|
207339
|
+
await stop();
|
207340
|
+
throw err;
|
207341
|
+
}
|
207342
|
+
return { stop };
|
207227
207343
|
}
|
207344
|
+
devEnv.proxy.onConfigUpdate({
|
207345
|
+
type: "configUpdate",
|
207346
|
+
config: fakeResolvedInput(startDevWorkerOptions)
|
207347
|
+
});
|
207348
|
+
devEnv.proxy.onBundleStart({
|
207349
|
+
type: "bundleStart",
|
207350
|
+
config: fakeResolvedInput(startDevWorkerOptions)
|
207351
|
+
});
|
207228
207352
|
const bundle = await runEsbuild({
|
207229
207353
|
entry: props.entry,
|
207230
207354
|
destination: directory,
|
@@ -207233,8 +207357,8 @@ async function startDevServer(props) {
|
|
207233
207357
|
additionalModules: props.additionalModules,
|
207234
207358
|
rules: props.rules,
|
207235
207359
|
jsxFragment: props.jsxFragment,
|
207236
|
-
|
207237
|
-
props.
|
207360
|
+
serveLegacyAssetsFromWorker: Boolean(
|
207361
|
+
props.legacyAssetPaths && !props.isWorkersSite && props.local
|
207238
207362
|
),
|
207239
207363
|
tsconfig: props.tsconfig,
|
207240
207364
|
minify: props.minify,
|
@@ -207243,7 +207367,7 @@ async function startDevServer(props) {
|
|
207243
207367
|
noBundle: props.noBundle,
|
207244
207368
|
findAdditionalModules: props.findAdditionalModules,
|
207245
207369
|
alias: props.alias,
|
207246
|
-
legacyAssets: props.
|
207370
|
+
legacyAssets: props.legacyAssetsConfig,
|
207247
207371
|
testScheduled: props.testScheduled,
|
207248
207372
|
local: props.local,
|
207249
207373
|
doBindings: props.bindings.durable_objects?.bindings ?? [],
|
@@ -207253,15 +207377,6 @@ async function startDevServer(props) {
|
|
207253
207377
|
props.compatibilityFlags
|
207254
207378
|
)
|
207255
207379
|
});
|
207256
|
-
if (props.experimentalDevEnv) {
|
207257
|
-
devEnv.runtimes.forEach((runtime) => {
|
207258
|
-
runtime.on("reloadComplete", async (ev) => {
|
207259
|
-
const { proxyWorker } = await devEnv.proxy.ready.promise;
|
207260
|
-
const url4 = await proxyWorker.ready;
|
207261
|
-
props.onReady?.(url4.hostname, parseInt(url4.port), ev.proxyData);
|
207262
|
-
});
|
207263
|
-
});
|
207264
|
-
}
|
207265
207380
|
if (props.local) {
|
207266
207381
|
devEnv.proxy.onReloadStart({
|
207267
207382
|
type: "reloadStart",
|
@@ -207275,7 +207390,7 @@ async function startDevServer(props) {
|
|
207275
207390
|
compatibilityDate: props.compatibilityDate,
|
207276
207391
|
compatibilityFlags: props.compatibilityFlags,
|
207277
207392
|
bindings: props.bindings,
|
207278
|
-
|
207393
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
207279
207394
|
initialPort: void 0,
|
207280
207395
|
// hard-code for userworker, DevEnv-ProxyWorker now uses this prop value
|
207281
207396
|
initialIp: "127.0.0.1",
|
@@ -207337,7 +207452,7 @@ async function startDevServer(props) {
|
|
207337
207452
|
format: props.entry.format,
|
207338
207453
|
accountId: props.accountId,
|
207339
207454
|
bindings: props.bindings,
|
207340
|
-
|
207455
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
207341
207456
|
isWorkersSite: props.isWorkersSite,
|
207342
207457
|
port: props.initialPort,
|
207343
207458
|
ip: props.initialIp,
|
@@ -207408,7 +207523,7 @@ async function runEsbuild({
|
|
207408
207523
|
rules,
|
207409
207524
|
alias,
|
207410
207525
|
legacyAssets,
|
207411
|
-
|
207526
|
+
serveLegacyAssetsFromWorker,
|
207412
207527
|
tsconfig,
|
207413
207528
|
minify,
|
207414
207529
|
nodejsCompatMode,
|
@@ -207441,7 +207556,7 @@ async function runEsbuild({
|
|
207441
207556
|
bundle: !noBundle,
|
207442
207557
|
additionalModules,
|
207443
207558
|
moduleCollector,
|
207444
|
-
|
207559
|
+
serveLegacyAssetsFromWorker,
|
207445
207560
|
jsxFactory,
|
207446
207561
|
jsxFragment,
|
207447
207562
|
tsconfig,
|
@@ -207955,7 +208070,7 @@ Please shift to the --legacy-assets command to preserve the current functionalit
|
|
207955
208070
|
);
|
207956
208071
|
if (args.experimentalDevEnv) {
|
207957
208072
|
(0, import_node_assert21.default)(devInstance instanceof DevEnv);
|
207958
|
-
await
|
208073
|
+
await import_node_events3.default.once(devInstance, "teardown");
|
207959
208074
|
} else {
|
207960
208075
|
(0, import_node_assert21.default)(!(devInstance instanceof DevEnv));
|
207961
208076
|
watcher = devInstance.watcher;
|
@@ -207988,7 +208103,7 @@ async function updateDevEnvRegistry(devEnv, registry) {
|
|
207988
208103
|
boundWorkers = void 0;
|
207989
208104
|
}
|
207990
208105
|
if (!devEnv.config.latestConfig) {
|
207991
|
-
await
|
208106
|
+
await import_node_events3.default.once(devEnv, "configUpdate");
|
207992
208107
|
}
|
207993
208108
|
if (import_node_util3.default.isDeepStrictEqual(
|
207994
208109
|
boundWorkers,
|
@@ -208004,6 +208119,21 @@ async function updateDevEnvRegistry(devEnv, registry) {
|
|
208004
208119
|
});
|
208005
208120
|
}
|
208006
208121
|
__name(updateDevEnvRegistry, "updateDevEnvRegistry");
|
208122
|
+
async function getPagesAssetsFetcher(options21) {
|
208123
|
+
if (options21 !== void 0) {
|
208124
|
+
const generateASSETSBinding3 = (init_assets(), __toCommonJS(assets_exports)).default;
|
208125
|
+
return {
|
208126
|
+
ASSETS: {
|
208127
|
+
type: "fetcher",
|
208128
|
+
fetcher: await generateASSETSBinding3({
|
208129
|
+
log: logger,
|
208130
|
+
...options21
|
208131
|
+
})
|
208132
|
+
}
|
208133
|
+
};
|
208134
|
+
}
|
208135
|
+
}
|
208136
|
+
__name(getPagesAssetsFetcher, "getPagesAssetsFetcher");
|
208007
208137
|
async function startDev(args) {
|
208008
208138
|
let watcher;
|
208009
208139
|
let rerender;
|
@@ -208118,6 +208248,9 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
208118
208248
|
})
|
208119
208249
|
},
|
208120
208250
|
bindings: {
|
208251
|
+
...await getPagesAssetsFetcher(
|
208252
|
+
args.enablePagesAssetsServiceBinding
|
208253
|
+
),
|
208121
208254
|
...collectPlainTextVars(args.var),
|
208122
208255
|
...convertCfWorkerInitBindingstoBindings({
|
208123
208256
|
kv_namespaces: args.kv,
|
@@ -208179,14 +208312,17 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
208179
208312
|
},
|
208180
208313
|
legacy: {
|
208181
208314
|
site: (configParam) => {
|
208182
|
-
const
|
208183
|
-
|
208315
|
+
const legacyAssetPaths = getResolvedLegacyAssetPaths(
|
208316
|
+
args,
|
208317
|
+
configParam
|
208318
|
+
);
|
208319
|
+
return Boolean(args.site || configParam.site) && legacyAssetPaths ? {
|
208184
208320
|
bucket: import_node_path63.default.join(
|
208185
|
-
|
208186
|
-
|
208321
|
+
legacyAssetPaths.baseDirectory,
|
208322
|
+
legacyAssetPaths?.assetDirectory
|
208187
208323
|
),
|
208188
|
-
include:
|
208189
|
-
exclude:
|
208324
|
+
include: legacyAssetPaths.includePatterns,
|
208325
|
+
exclude: legacyAssetPaths.excludePatterns
|
208190
208326
|
} : void 0;
|
208191
208327
|
},
|
208192
208328
|
legacyAssets: (configParam) => configParam.legacy_assets,
|
@@ -208219,24 +208355,8 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
|
|
208219
208355
|
}
|
208220
208356
|
});
|
208221
208357
|
}
|
208222
|
-
const experimentalAssets = args
|
208358
|
+
const experimentalAssets = processExperimentalAssetsArg(args, config);
|
208223
208359
|
if (experimentalAssets) {
|
208224
|
-
const experimentalAssetsBasePath = getExperimentalAssetsBasePath(
|
208225
|
-
config,
|
208226
|
-
args.experimentalAssets
|
208227
|
-
);
|
208228
|
-
const resolvedExperimentalAssetsPath = import_node_path63.default.resolve(
|
208229
|
-
experimentalAssetsBasePath,
|
208230
|
-
experimentalAssets.directory
|
208231
|
-
);
|
208232
|
-
if (!(0, import_node_fs35.existsSync)(resolvedExperimentalAssetsPath)) {
|
208233
|
-
const sourceOfTruthMessage = args.experimentalAssets ? '"--experimental-assets" command line argument' : '"experimental_assets.directory" field in your configuration file';
|
208234
|
-
throw new UserError(
|
208235
|
-
`The directory specified by the ${sourceOfTruthMessage} does not exist:
|
208236
|
-
${resolvedExperimentalAssetsPath}`
|
208237
|
-
);
|
208238
|
-
}
|
208239
|
-
experimentalAssets.directory = resolvedExperimentalAssetsPath;
|
208240
208360
|
args.forceLocal = true;
|
208241
208361
|
}
|
208242
208362
|
const {
|
@@ -208267,7 +208387,7 @@ ${resolvedExperimentalAssetsPath}`
|
|
208267
208387
|
{ sendMetrics: config.send_metrics, offline: !args.remote }
|
208268
208388
|
);
|
208269
208389
|
async function getDevReactElement(configParam) {
|
208270
|
-
const {
|
208390
|
+
const { legacyAssetPaths, bindings } = getBindingsAndLegacyAssetPaths(
|
208271
208391
|
args,
|
208272
208392
|
configParam
|
208273
208393
|
);
|
@@ -208302,8 +208422,8 @@ ${resolvedExperimentalAssetsPath}`
|
|
208302
208422
|
localPersistencePath,
|
208303
208423
|
liveReload: args.liveReload || false,
|
208304
208424
|
accountId: args.accountId ?? configParam.account_id ?? getAccountFromCache()?.id,
|
208305
|
-
|
208306
|
-
|
208425
|
+
legacyAssetPaths,
|
208426
|
+
legacyAssetsConfig: configParam.legacy_assets,
|
208307
208427
|
initialPort: args.port ?? configParam.dev.port ?? await getLocalPort2(),
|
208308
208428
|
initialIp: args.ip || configParam.dev.ip,
|
208309
208429
|
inspectorPort: args.inspectorPort ?? configParam.dev.inspector_port ?? await getInspectorPort2(),
|
@@ -208406,7 +208526,7 @@ async function startApiDev(args) {
|
|
208406
208526
|
});
|
208407
208527
|
}
|
208408
208528
|
async function getDevServer(configParam) {
|
208409
|
-
const {
|
208529
|
+
const { legacyAssetPaths, bindings } = getBindingsAndLegacyAssetPaths(
|
208410
208530
|
args,
|
208411
208531
|
configParam
|
208412
208532
|
);
|
@@ -208441,8 +208561,8 @@ async function startApiDev(args) {
|
|
208441
208561
|
localPersistencePath,
|
208442
208562
|
liveReload: args.liveReload ?? false,
|
208443
208563
|
accountId: args.accountId ?? configParam.account_id ?? getAccountFromCache()?.id,
|
208444
|
-
|
208445
|
-
|
208564
|
+
legacyAssetPaths,
|
208565
|
+
legacyAssetsConfig: configParam.legacy_assets,
|
208446
208566
|
//port can be 0, which means to use a random port
|
208447
208567
|
initialPort: args.port ?? configParam.dev.port ?? await getLocalPort2(),
|
208448
208568
|
initialIp: args.ip ?? configParam.dev.ip,
|
@@ -208627,23 +208747,23 @@ function getResolvedBindings(args, configParam) {
|
|
208627
208747
|
return bindings;
|
208628
208748
|
}
|
208629
208749
|
__name(getResolvedBindings, "getResolvedBindings");
|
208630
|
-
function
|
208631
|
-
const
|
208750
|
+
function getResolvedLegacyAssetPaths(args, configParam) {
|
208751
|
+
const legacyAssetPaths = args.legacyAssets || configParam.legacy_assets ? getLegacyAssetPaths(configParam, args.legacyAssets) : getSiteAssetPaths(
|
208632
208752
|
configParam,
|
208633
208753
|
args.site,
|
208634
208754
|
args.siteInclude,
|
208635
208755
|
args.siteExclude
|
208636
208756
|
);
|
208637
|
-
return
|
208757
|
+
return legacyAssetPaths;
|
208638
208758
|
}
|
208639
|
-
__name(
|
208640
|
-
function
|
208759
|
+
__name(getResolvedLegacyAssetPaths, "getResolvedLegacyAssetPaths");
|
208760
|
+
function getBindingsAndLegacyAssetPaths(args, configParam) {
|
208641
208761
|
return {
|
208642
208762
|
bindings: getResolvedBindings(args, configParam),
|
208643
|
-
|
208763
|
+
legacyAssetPaths: getResolvedLegacyAssetPaths(args, configParam)
|
208644
208764
|
};
|
208645
208765
|
}
|
208646
|
-
__name(
|
208766
|
+
__name(getBindingsAndLegacyAssetPaths, "getBindingsAndLegacyAssetPaths");
|
208647
208767
|
function getBindings(configParam, env7, local, args) {
|
208648
208768
|
const kvConfig = (configParam.kv_namespaces || []).map(
|
208649
208769
|
({ binding, preview_id, id }) => {
|
@@ -208971,7 +209091,7 @@ init_import_meta_url();
|
|
208971
209091
|
// src/api/startDevWorker/DevEnv.ts
|
208972
209092
|
init_import_meta_url();
|
208973
209093
|
var import_node_assert24 = __toESM(require("node:assert"));
|
208974
|
-
var
|
209094
|
+
var import_node_events6 = require("node:events");
|
208975
209095
|
|
208976
209096
|
// src/api/startDevWorker/BundlerController.ts
|
208977
209097
|
init_import_meta_url();
|
@@ -208982,8 +209102,8 @@ var import_chokidar7 = require("chokidar");
|
|
208982
209102
|
|
208983
209103
|
// src/api/startDevWorker/BaseController.ts
|
208984
209104
|
init_import_meta_url();
|
208985
|
-
var
|
208986
|
-
var TypedEventEmitterImpl =
|
209105
|
+
var import_node_events4 = require("node:events");
|
209106
|
+
var TypedEventEmitterImpl = import_node_events4.EventEmitter;
|
208987
209107
|
var Controller = class extends TypedEventEmitterImpl {
|
208988
209108
|
emitErrorEvent(data) {
|
208989
209109
|
this.emit("error", data);
|
@@ -209068,7 +209188,7 @@ var BundlerController = class extends Controller {
|
|
209068
209188
|
bundle: true,
|
209069
209189
|
additionalModules: [],
|
209070
209190
|
moduleCollector,
|
209071
|
-
|
209191
|
+
serveLegacyAssetsFromWorker: Boolean(
|
209072
209192
|
config.legacy?.legacyAssets && !config.dev?.remote
|
209073
209193
|
),
|
209074
209194
|
doBindings: bindings?.durable_objects?.bindings ?? [],
|
@@ -209168,7 +209288,7 @@ var BundlerController = class extends Controller {
|
|
209168
209288
|
additionalModules: config.build?.additionalModules ?? [],
|
209169
209289
|
rules: config.build.moduleRules,
|
209170
209290
|
legacyAssets: config.legacy?.legacyAssets,
|
209171
|
-
|
209291
|
+
serveLegacyAssetsFromWorker: Boolean(
|
209172
209292
|
config.legacy?.legacyAssets && !config.dev?.remote
|
209173
209293
|
),
|
209174
209294
|
tsconfig: config.build?.tsconfig,
|
@@ -209594,7 +209714,7 @@ async function convertToConfigBundle(event) {
|
|
209594
209714
|
compatibilityFlags: event.config.compatibilityFlags,
|
209595
209715
|
bindings,
|
209596
209716
|
workerDefinitions: event.config.dev?.registry,
|
209597
|
-
|
209717
|
+
legacyAssetPaths: event.config.legacy?.site?.bucket ? {
|
209598
209718
|
baseDirectory: event.config.legacy?.site?.bucket,
|
209599
209719
|
assetDirectory: "",
|
209600
209720
|
excludePatterns: event.config.legacy?.site?.exclude ?? [],
|
@@ -209679,7 +209799,8 @@ var LocalRuntimeController = class extends RuntimeController {
|
|
209679
209799
|
},
|
209680
209800
|
userWorkerInnerUrlOverrides: {
|
209681
209801
|
protocol: data.config?.dev?.origin?.secure ? "https:" : "http:",
|
209682
|
-
hostname: data.config?.dev?.origin?.hostname
|
209802
|
+
hostname: data.config?.dev?.origin?.hostname,
|
209803
|
+
port: data.config?.dev?.origin?.hostname ? "" : void 0
|
209683
209804
|
},
|
209684
209805
|
headers: {
|
209685
209806
|
// Passing this signature from Proxy Worker allows the User Worker to trust the request.
|
@@ -209744,7 +209865,7 @@ __name(LocalRuntimeController, "LocalRuntimeController");
|
|
209744
209865
|
init_import_meta_url();
|
209745
209866
|
var import_node_assert23 = __toESM(require("node:assert"));
|
209746
209867
|
var import_node_crypto9 = require("node:crypto");
|
209747
|
-
var
|
209868
|
+
var import_node_events5 = __toESM(require("node:events"));
|
209748
209869
|
var import_node_path67 = __toESM(require("node:path"));
|
209749
209870
|
var import_miniflare20 = require("miniflare");
|
209750
209871
|
|
@@ -209927,7 +210048,7 @@ var ProxyController = class extends Controller {
|
|
209927
210048
|
}
|
209928
210049
|
void this.reconnectInspectorProxyWorker();
|
209929
210050
|
});
|
209930
|
-
await
|
210051
|
+
await import_node_events5.default.once(webSocket, "open");
|
209931
210052
|
this.inspectorProxyWorkerWebSocket?.resolve(webSocket);
|
209932
210053
|
return webSocket;
|
209933
210054
|
}
|
@@ -209938,12 +210059,12 @@ var ProxyController = class extends Controller {
|
|
209938
210059
|
}
|
209939
210060
|
try {
|
209940
210061
|
await this.runtimeMessageMutex.runWith(async () => {
|
209941
|
-
|
209942
|
-
const ready = await
|
210062
|
+
const { proxyWorker } = await this.ready.promise;
|
210063
|
+
const ready = await proxyWorker.ready.catch(() => void 0);
|
209943
210064
|
if (!ready) {
|
209944
210065
|
return;
|
209945
210066
|
}
|
209946
|
-
return
|
210067
|
+
return proxyWorker.dispatchFetch(
|
209947
210068
|
`http://dummy/cdn-cgi/ProxyWorker/${message.type}`,
|
209948
210069
|
{
|
209949
210070
|
headers: { Authorization: this.secret },
|
@@ -210221,7 +210342,7 @@ var RemoteRuntimeController = class extends RuntimeController {
|
|
210221
210342
|
legacyEnv: props.legacyEnv,
|
210222
210343
|
env: props.env,
|
210223
210344
|
isWorkersSite: props.isWorkersSite,
|
210224
|
-
|
210345
|
+
legacyAssetPaths: props.legacyAssetPaths,
|
210225
210346
|
format: props.format,
|
210226
210347
|
bindings: props.bindings,
|
210227
210348
|
compatibilityDate: props.compatibilityDate,
|
@@ -210299,7 +210420,7 @@ var RemoteRuntimeController = class extends RuntimeController {
|
|
210299
210420
|
legacyEnv: !config.legacy?.enableServiceEnvironments,
|
210300
210421
|
env: config.env,
|
210301
210422
|
isWorkersSite: config.legacy?.site !== void 0,
|
210302
|
-
|
210423
|
+
legacyAssetPaths: config.legacy?.site?.bucket ? {
|
210303
210424
|
baseDirectory: config.legacy?.site?.bucket,
|
210304
210425
|
assetDirectory: "",
|
210305
210426
|
excludePatterns: config.legacy?.site?.exclude ?? [],
|
@@ -210400,7 +210521,7 @@ var RemoteRuntimeController = class extends RuntimeController {
|
|
210400
210521
|
__name(RemoteRuntimeController, "RemoteRuntimeController");
|
210401
210522
|
|
210402
210523
|
// src/api/startDevWorker/DevEnv.ts
|
210403
|
-
var DevEnv = class extends
|
210524
|
+
var DevEnv = class extends import_node_events6.EventEmitter {
|
210404
210525
|
config;
|
210405
210526
|
bundler;
|
210406
210527
|
runtimes;
|
@@ -210841,8 +210962,8 @@ function unstable_getMiniflareWorkerOptions(configPath, env7) {
|
|
210841
210962
|
])
|
210842
210963
|
);
|
210843
210964
|
}
|
210844
|
-
const
|
210845
|
-
const sitesOptions = buildSitesOptions({
|
210965
|
+
const legacyAssetPaths = config.legacy_assets ? getLegacyAssetPaths(config, void 0) : getSiteAssetPaths(config);
|
210966
|
+
const sitesOptions = buildSitesOptions({ legacyAssetPaths });
|
210846
210967
|
const workerOptions = {
|
210847
210968
|
compatibilityDate: config.compatibility_date,
|
210848
210969
|
compatibilityFlags: config.compatibility_flags,
|