wrangler 3.78.5 → 3.78.7

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.
Files changed (2) hide show
  1. package/package.json +4 -4
  2. package/wrangler-dist/cli.js +181 -93
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "3.78.5",
3
+ "version": "3.78.7",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -62,12 +62,12 @@
62
62
  "resolve.exports": "^2.0.2",
63
63
  "selfsigned": "^2.0.1",
64
64
  "source-map": "^0.6.1",
65
- "unenv": "npm:unenv-nightly@2.0.0-1726478054.1e87097",
65
+ "unenv": "npm:unenv-nightly@2.0.0-20240919-125358-9a64854",
66
66
  "workerd": "1.20240909.0",
67
67
  "xxhash-wasm": "^1.0.1",
68
68
  "@cloudflare/kv-asset-handler": "0.3.4",
69
69
  "@cloudflare/workers-shared": "0.5.3",
70
- "miniflare": "3.20240909.3"
70
+ "miniflare": "3.20240909.4"
71
71
  },
72
72
  "devDependencies": {
73
73
  "@cloudflare/types": "^6.18.4",
@@ -154,7 +154,7 @@
154
154
  "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
155
155
  "@cloudflare/cli": "1.1.1",
156
156
  "@cloudflare/eslint-config-worker": "1.1.0",
157
- "@cloudflare/pages-shared": "^0.11.59",
157
+ "@cloudflare/pages-shared": "^0.11.60",
158
158
  "@cloudflare/workers-tsconfig": "0.0.0"
159
159
  },
160
160
  "peerDependencies": {
@@ -72329,7 +72329,7 @@ var init_execa = __esm({
72329
72329
  var require_depd = __commonJS({
72330
72330
  "../../node_modules/.pnpm/depd@2.0.0/node_modules/depd/index.js"(exports2, module3) {
72331
72331
  init_import_meta_url();
72332
- var relative16 = require("path").relative;
72332
+ var relative15 = require("path").relative;
72333
72333
  module3.exports = depd;
72334
72334
  var basePath = process.cwd();
72335
72335
  function containsNamespace(str, namespace) {
@@ -72535,7 +72535,7 @@ var require_depd = __commonJS({
72535
72535
  }
72536
72536
  __name(formatColor, "formatColor");
72537
72537
  function formatLocation(callSite) {
72538
- return relative16(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
72538
+ return relative15(basePath, callSite[0]) + ":" + callSite[1] + ":" + callSite[2];
72539
72539
  }
72540
72540
  __name(formatLocation, "formatLocation");
72541
72541
  function getStack() {
@@ -95511,51 +95511,51 @@ var require_uri_all = __commonJS({
95511
95511
  return uriTokens.join("");
95512
95512
  }
95513
95513
  __name(serialize, "serialize");
95514
- function resolveComponents(base2, relative16) {
95514
+ function resolveComponents(base2, relative15) {
95515
95515
  var options29 = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
95516
95516
  var skipNormalization = arguments[3];
95517
95517
  var target = {};
95518
95518
  if (!skipNormalization) {
95519
95519
  base2 = parse7(serialize(base2, options29), options29);
95520
- relative16 = parse7(serialize(relative16, options29), options29);
95520
+ relative15 = parse7(serialize(relative15, options29), options29);
95521
95521
  }
95522
95522
  options29 = options29 || {};
95523
- if (!options29.tolerant && relative16.scheme) {
95524
- target.scheme = relative16.scheme;
95525
- target.userinfo = relative16.userinfo;
95526
- target.host = relative16.host;
95527
- target.port = relative16.port;
95528
- target.path = removeDotSegments(relative16.path || "");
95529
- target.query = relative16.query;
95523
+ if (!options29.tolerant && relative15.scheme) {
95524
+ target.scheme = relative15.scheme;
95525
+ target.userinfo = relative15.userinfo;
95526
+ target.host = relative15.host;
95527
+ target.port = relative15.port;
95528
+ target.path = removeDotSegments(relative15.path || "");
95529
+ target.query = relative15.query;
95530
95530
  } else {
95531
- if (relative16.userinfo !== void 0 || relative16.host !== void 0 || relative16.port !== void 0) {
95532
- target.userinfo = relative16.userinfo;
95533
- target.host = relative16.host;
95534
- target.port = relative16.port;
95535
- target.path = removeDotSegments(relative16.path || "");
95536
- target.query = relative16.query;
95531
+ if (relative15.userinfo !== void 0 || relative15.host !== void 0 || relative15.port !== void 0) {
95532
+ target.userinfo = relative15.userinfo;
95533
+ target.host = relative15.host;
95534
+ target.port = relative15.port;
95535
+ target.path = removeDotSegments(relative15.path || "");
95536
+ target.query = relative15.query;
95537
95537
  } else {
95538
- if (!relative16.path) {
95538
+ if (!relative15.path) {
95539
95539
  target.path = base2.path;
95540
- if (relative16.query !== void 0) {
95541
- target.query = relative16.query;
95540
+ if (relative15.query !== void 0) {
95541
+ target.query = relative15.query;
95542
95542
  } else {
95543
95543
  target.query = base2.query;
95544
95544
  }
95545
95545
  } else {
95546
- if (relative16.path.charAt(0) === "/") {
95547
- target.path = removeDotSegments(relative16.path);
95546
+ if (relative15.path.charAt(0) === "/") {
95547
+ target.path = removeDotSegments(relative15.path);
95548
95548
  } else {
95549
95549
  if ((base2.userinfo !== void 0 || base2.host !== void 0 || base2.port !== void 0) && !base2.path) {
95550
- target.path = "/" + relative16.path;
95550
+ target.path = "/" + relative15.path;
95551
95551
  } else if (!base2.path) {
95552
- target.path = relative16.path;
95552
+ target.path = relative15.path;
95553
95553
  } else {
95554
- target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative16.path;
95554
+ target.path = base2.path.slice(0, base2.path.lastIndexOf("/") + 1) + relative15.path;
95555
95555
  }
95556
95556
  target.path = removeDotSegments(target.path);
95557
95557
  }
95558
- target.query = relative16.query;
95558
+ target.query = relative15.query;
95559
95559
  }
95560
95560
  target.userinfo = base2.userinfo;
95561
95561
  target.host = base2.host;
@@ -95563,7 +95563,7 @@ var require_uri_all = __commonJS({
95563
95563
  }
95564
95564
  target.scheme = base2.scheme;
95565
95565
  }
95566
- target.fragment = relative16.fragment;
95566
+ target.fragment = relative15.fragment;
95567
95567
  return target;
95568
95568
  }
95569
95569
  __name(resolveComponents, "resolveComponents");
@@ -152543,9 +152543,9 @@ function getEnvironmentVariableFactory({
152543
152543
  }) {
152544
152544
  let hasWarned = false;
152545
152545
  return () => {
152546
- if (process.env[variableName]) {
152546
+ if (variableName in process.env) {
152547
152547
  return process.env[variableName];
152548
- } else if (deprecatedName && process.env[deprecatedName]) {
152548
+ } else if (deprecatedName && deprecatedName in process.env) {
152549
152549
  if (!hasWarned) {
152550
152550
  hasWarned = true;
152551
152551
  console.warn(
@@ -152595,6 +152595,12 @@ var getOutputFilePathFromEnv = getEnvironmentVariableFactory({
152595
152595
  var getCIMatchTag = getEnvironmentVariableFactory({
152596
152596
  variableName: "WRANGLER_CI_MATCH_TAG"
152597
152597
  });
152598
+ var getBuildConditionsFromEnv = getEnvironmentVariableFactory({
152599
+ variableName: "WRANGLER_BUILD_CONDITIONS"
152600
+ });
152601
+ var getBuildPlatformFromEnv = getEnvironmentVariableFactory({
152602
+ variableName: "WRANGLER_BUILD_PLATFORM"
152603
+ });
152598
152604
 
152599
152605
  // src/utils/log-file.ts
152600
152606
  init_import_meta_url();
@@ -152876,7 +152882,7 @@ init_import_meta_url();
152876
152882
  init_import_meta_url();
152877
152883
 
152878
152884
  // package.json
152879
- var version = "3.78.5";
152885
+ var version = "3.78.7";
152880
152886
  var package_default = {
152881
152887
  name: "wrangler",
152882
152888
  version,
@@ -152963,7 +152969,7 @@ var package_default = {
152963
152969
  "resolve.exports": "^2.0.2",
152964
152970
  selfsigned: "^2.0.1",
152965
152971
  "source-map": "^0.6.1",
152966
- unenv: "npm:unenv-nightly@2.0.0-1726478054.1e87097",
152972
+ unenv: "npm:unenv-nightly@2.0.0-20240919-125358-9a64854",
152967
152973
  workerd: "1.20240909.0",
152968
152974
  "xxhash-wasm": "^1.0.1"
152969
152975
  },
@@ -160608,7 +160614,7 @@ function createModuleCollector(props) {
160608
160614
  packageJson,
160609
160615
  args.path.replace(`${packageName}/`, ""),
160610
160616
  {
160611
- conditions: BUILD_CONDITIONS
160617
+ conditions: getBuildConditions()
160612
160618
  }
160613
160619
  );
160614
160620
  if (testResolved) {
@@ -160993,7 +160999,25 @@ var COMMON_ESBUILD_OPTIONS = {
160993
160999
  target: "es2022",
160994
161000
  loader: { ".js": "jsx", ".mjs": "jsx", ".cjs": "jsx" }
160995
161001
  };
160996
- var BUILD_CONDITIONS = ["workerd", "worker", "browser"];
161002
+ function getBuildConditions() {
161003
+ const envVar = getBuildConditionsFromEnv();
161004
+ if (envVar !== void 0) {
161005
+ return envVar.split(",");
161006
+ } else {
161007
+ return ["workerd", "worker", "browser"];
161008
+ }
161009
+ }
161010
+ __name(getBuildConditions, "getBuildConditions");
161011
+ function getBuildPlatform() {
161012
+ const platform2 = getBuildPlatformFromEnv();
161013
+ if (platform2 !== void 0 && !["browser", "node", "neutral"].includes(platform2)) {
161014
+ throw new UserError(
161015
+ "Invalid esbuild platform configuration defined in the WRANGLER_BUILD_PLATFORM environment variable.\nValid platform values are: 'browser', 'node' and 'neutral'."
161016
+ );
161017
+ }
161018
+ return platform2;
161019
+ }
161020
+ __name(getBuildPlatform, "getBuildPlatform");
160997
161021
  async function bundleWorker(entry, destination, {
160998
161022
  bundle,
160999
161023
  moduleCollector = noopModuleCollector,
@@ -161162,7 +161186,8 @@ async function bundleWorker(entry, destination, {
161162
161186
  sourceRoot: destination,
161163
161187
  minify,
161164
161188
  metafile: true,
161165
- conditions: BUILD_CONDITIONS,
161189
+ conditions: getBuildConditions(),
161190
+ platform: getBuildPlatform(),
161166
161191
  ...{
161167
161192
  define: {
161168
161193
  ...defineNavigatorUserAgent ? { "navigator.userAgent": `"Cloudflare-Workers"` } : {},
@@ -166736,7 +166761,7 @@ var MAX_UPLOAD_GATEWAY_ERRORS2 = 5;
166736
166761
  var syncExperimentalAssets = /* @__PURE__ */ __name(async (accountId, scriptName, assetDirectory) => {
166737
166762
  (0, import_node_assert9.default)(accountId, "Missing accountId");
166738
166763
  logger.info("\u{1F300} Building list of assets...");
166739
- const manifest = await buildAssetsManifest(assetDirectory);
166764
+ const manifest = await buildAssetManifest(assetDirectory);
166740
166765
  logger.info("\u{1F300} Starting asset upload...");
166741
166766
  const initializeAssetsResponse = await fetchResult(
166742
166767
  `/accounts/${accountId}/workers/scripts/${scriptName}/assets-upload-session`,
@@ -166878,23 +166903,23 @@ Assets already uploaded have been saved, so the next attempt will automatically
166878
166903
  );
166879
166904
  return completionJwt;
166880
166905
  }, "syncExperimentalAssets");
166881
- var buildAssetsManifest = /* @__PURE__ */ __name(async (dir) => {
166906
+ var buildAssetManifest = /* @__PURE__ */ __name(async (dir) => {
166882
166907
  const files = await (0, import_promises8.readdir)(dir, { recursive: true });
166883
166908
  const manifest = {};
166884
166909
  let counter = 0;
166885
166910
  const ignoreFn = await createAssetIgnoreFunction(dir);
166886
166911
  await Promise.all(
166887
- files.map(async (file) => {
166888
- const filepath = path16.join(dir, file);
166889
- const relativeFilepath = path16.relative(dir, filepath);
166912
+ files.map(async (relativeFilepath) => {
166890
166913
  if (ignoreFn?.(relativeFilepath)) {
166891
166914
  logger.debug("Ignoring asset:", relativeFilepath);
166892
166915
  return;
166893
166916
  }
166917
+ const filepath = path16.join(dir, relativeFilepath);
166894
166918
  const filestat = await (0, import_promises8.stat)(filepath);
166895
166919
  if (filestat.isSymbolicLink() || filestat.isDirectory()) {
166896
166920
  return;
166897
166921
  } else {
166922
+ errorOnLegacyPagesWorkerJSAsset(relativeFilepath, !!ignoreFn);
166898
166923
  if (counter >= MAX_ASSET_COUNT2) {
166899
166924
  throw new UserError(
166900
166925
  `Maximum number of assets exceeded.
@@ -166928,7 +166953,7 @@ Ensure all assets in your assets directory "${dir}" conform with the Workers max
166928
166953
  })
166929
166954
  );
166930
166955
  return manifest;
166931
- }, "buildAssetsManifest");
166956
+ }, "buildAssetManifest");
166932
166957
  var MAX_DIFF_LINES = 100;
166933
166958
  function logAssetUpload(line, diffCount) {
166934
166959
  const level = logger.loggerLevel;
@@ -166949,38 +166974,37 @@ function getExperimentalAssetsBasePath(config, experimentalAssetsCommandLineArg)
166949
166974
  __name(getExperimentalAssetsBasePath, "getExperimentalAssetsBasePath");
166950
166975
  function processExperimentalAssetsArg(args, config) {
166951
166976
  const experimentalAssets = args.experimentalAssets ? { directory: args.experimentalAssets } : config.experimental_assets;
166952
- let experimentalAssetsOptions;
166953
- if (experimentalAssets) {
166954
- const experimentalAssetsBasePath = getExperimentalAssetsBasePath(
166955
- config,
166956
- args.experimentalAssets
166957
- );
166958
- const resolvedExperimentalAssetsPath = path16.resolve(
166959
- experimentalAssetsBasePath,
166960
- experimentalAssets.directory
166961
- );
166962
- if (!(0, import_node_fs11.existsSync)(resolvedExperimentalAssetsPath)) {
166963
- const sourceOfTruthMessage = args.experimentalAssets ? '"--experimental-assets" command line argument' : '"experimental_assets.directory" field in your configuration file';
166964
- throw new UserError(
166965
- `The directory specified by the ${sourceOfTruthMessage} does not exist:
166977
+ if (!experimentalAssets) {
166978
+ return;
166979
+ }
166980
+ const experimentalAssetsBasePath = getExperimentalAssetsBasePath(
166981
+ config,
166982
+ args.experimentalAssets
166983
+ );
166984
+ const resolvedExperimentalAssetsPath = path16.resolve(
166985
+ experimentalAssetsBasePath,
166986
+ experimentalAssets.directory
166987
+ );
166988
+ if (!(0, import_node_fs11.existsSync)(resolvedExperimentalAssetsPath)) {
166989
+ const sourceOfTruthMessage = args.experimentalAssets ? '"--experimental-assets" command line argument' : '"experimental_assets.directory" field in your configuration file';
166990
+ throw new UserError(
166991
+ `The directory specified by the ${sourceOfTruthMessage} does not exist:
166966
166992
  ${resolvedExperimentalAssetsPath}`
166967
- );
166968
- }
166969
- experimentalAssets.directory = resolvedExperimentalAssetsPath;
166970
- const routingConfig = {
166971
- has_user_worker: Boolean(args.script || config.main)
166972
- };
166973
- const assetConfig = {
166974
- html_handling: config.experimental_assets?.html_handling,
166975
- not_found_handling: config.experimental_assets?.not_found_handling
166976
- };
166977
- experimentalAssetsOptions = {
166978
- ...experimentalAssets,
166979
- routingConfig,
166980
- assetConfig
166981
- };
166993
+ );
166982
166994
  }
166983
- return experimentalAssetsOptions;
166995
+ experimentalAssets.directory = resolvedExperimentalAssetsPath;
166996
+ const routingConfig = {
166997
+ has_user_worker: Boolean(args.script || config.main)
166998
+ };
166999
+ const assetConfig = {
167000
+ html_handling: config.experimental_assets?.html_handling,
167001
+ not_found_handling: config.experimental_assets?.not_found_handling
167002
+ };
167003
+ return {
167004
+ ...experimentalAssets,
167005
+ routingConfig,
167006
+ assetConfig
167007
+ };
166984
167008
  }
166985
167009
  __name(processExperimentalAssetsArg, "processExperimentalAssetsArg");
166986
167010
  function verifyMutuallyExclusiveAssetsArgsOrConfig(args, config) {
@@ -167001,8 +167025,8 @@ function verifyMutuallyExclusiveAssetsArgsOrConfig(args, config) {
167001
167025
  }
167002
167026
  }
167003
167027
  __name(verifyMutuallyExclusiveAssetsArgsOrConfig, "verifyMutuallyExclusiveAssetsArgsOrConfig");
167028
+ var CF_ASSETS_IGNORE_FILENAME = ".assetsignore";
167004
167029
  async function createAssetIgnoreFunction(dir) {
167005
- const CF_ASSETS_IGNORE_FILENAME = ".assetsignore";
167006
167030
  const cfAssetIgnorePath = path16.resolve(dir, CF_ASSETS_IGNORE_FILENAME);
167007
167031
  if (!(0, import_node_fs11.existsSync)(cfAssetIgnorePath)) {
167008
167032
  return null;
@@ -167012,6 +167036,20 @@ async function createAssetIgnoreFunction(dir) {
167012
167036
  return createPatternMatcher(ignorePatterns, true);
167013
167037
  }
167014
167038
  __name(createAssetIgnoreFunction, "createAssetIgnoreFunction");
167039
+ function errorOnLegacyPagesWorkerJSAsset(file, hasAssetsIgnoreFile) {
167040
+ if (!hasAssetsIgnoreFile) {
167041
+ const workerJsType = file === "_worker.js" ? "file" : file.startsWith("_worker.js") ? "directory" : null;
167042
+ if (workerJsType !== null) {
167043
+ throw new UserError(dedent2`
167044
+ Uploading a Pages _worker.js ${workerJsType} as an asset.
167045
+ This could expose your private server-side code to the public Internet. Is this intended?
167046
+ If you do not want to upload this ${workerJsType}, either remove it or add an "${CF_ASSETS_IGNORE_FILENAME}" file, to the root of your asset directory, containing "_worker.js" to avoid uploading.
167047
+ If you do want to upload this ${workerJsType}, you can add an empty "${CF_ASSETS_IGNORE_FILENAME}" file, to the root of your asset directory, to hide this error.
167048
+ `);
167049
+ }
167050
+ }
167051
+ }
167052
+ __name(errorOnLegacyPagesWorkerJSAsset, "errorOnLegacyPagesWorkerJSAsset");
167015
167053
 
167016
167054
  // src/metrics/index.ts
167017
167055
  init_import_meta_url();
@@ -172587,7 +172625,10 @@ See https://developers.cloudflare.com/workers/platform/compatibility-dates for m
172587
172625
  await patchNonVersionedScriptSettings(accountId, scriptName, {
172588
172626
  tail_consumers: worker.tail_consumers,
172589
172627
  logpush: worker.logpush,
172590
- observability: worker.observability
172628
+ // If the user hasn't specified observability assume that they want it disabled if they have it on.
172629
+ // This is a no-op in the event that they don't have observability enabled, but will remove observability
172630
+ // if it has been removed from their wrangler.toml
172631
+ observability: worker.observability ?? { enabled: false }
172591
172632
  });
172592
172633
  const { available_on_subdomain } = await fetchResult(`/accounts/${accountId}/workers/scripts/${scriptName}/subdomain`);
172593
172634
  result = {
@@ -189304,26 +189345,39 @@ var import_node_path39 = __toESM(require("node:path"));
189304
189345
 
189305
189346
  // src/match-tag.ts
189306
189347
  init_import_meta_url();
189307
- async function verifyWorkerMatchesCITag(accountId, workerName) {
189348
+ async function verifyWorkerMatchesCITag(accountId, workerName, configPath) {
189308
189349
  const matchTag = getCIMatchTag();
189350
+ logger.debug(
189351
+ `Starting verifyWorkerMatchesCITag() with tag: ${matchTag}, name: ${workerName}`
189352
+ );
189309
189353
  if (!matchTag) {
189354
+ logger.debug(
189355
+ "No WRANGLER_CI_MATCH_TAG variable provided, aborting verifyWorkerMatchesCITag()"
189356
+ );
189310
189357
  return;
189311
189358
  }
189359
+ const envAccountID = getCloudflareAccountIdFromEnv();
189360
+ if (accountId !== envAccountID) {
189361
+ throw new FatalError(
189362
+ `The \`account_id\` in \`${configPath ?? "wrangler.toml"}\` must match the \`account_id\` for this account. Please update your wrangler.toml with \`account_id = "${envAccountID}"\``
189363
+ );
189364
+ }
189312
189365
  let tag;
189313
189366
  try {
189314
189367
  const worker = await fetchResult(
189315
189368
  `/accounts/${accountId}/workers/services/${workerName}`
189316
189369
  );
189317
189370
  tag = worker.default_environment.script.tag;
189371
+ logger.debug(`API returned with tag: ${tag} for worker: ${workerName}`);
189318
189372
  } catch (e3) {
189319
189373
  logger.debug(e3);
189320
189374
  if (e3.code === 10090) {
189321
189375
  throw new FatalError(
189322
- `Your Worker's name (${workerName}) does not match what is expected by the CI system`
189376
+ `The name in \`${configPath ?? "wrangler.toml"}\` (${workerName}) must match the name of your Worker. Please update the name field in your wrangler.toml.`
189323
189377
  );
189324
189378
  } else {
189325
189379
  throw new FatalError(
189326
- "Wrangler cannot validate that your Worker name matches what is expected by the CI system"
189380
+ "Wrangler cannot validate that your Worker name matches what is expected by the build system. Please retry the build."
189327
189381
  );
189328
189382
  }
189329
189383
  }
@@ -189332,7 +189386,7 @@ async function verifyWorkerMatchesCITag(accountId, workerName) {
189332
189386
  `Failed to match Worker tag. The API returned "${tag}", but the CI system expected "${matchTag}"`
189333
189387
  );
189334
189388
  throw new FatalError(
189335
- `Your Worker's name (${workerName}) does not match what is expected by the CI system`
189389
+ `The name in \`${configPath ?? "wrangler.toml"}\` (${workerName}) must match the name of your Worker. Please update the name field in your wrangler.toml.`
189336
189390
  );
189337
189391
  }
189338
189392
  }
@@ -189569,7 +189623,11 @@ Please shift to the --legacy-assets command to preserve the current functionalit
189569
189623
  );
189570
189624
  if (!args.dryRun) {
189571
189625
  (0, import_node_assert21.default)(accountId, "Missing account ID");
189572
- await verifyWorkerMatchesCITag(accountId, name);
189626
+ await verifyWorkerMatchesCITag(
189627
+ accountId,
189628
+ name,
189629
+ import_node_path39.default.relative(entry.directory, config.configPath ?? "wrangler.toml")
189630
+ );
189573
189631
  }
189574
189632
  const { sourceMapSize, versionId, workerTag, targets } = await deploy({
189575
189633
  config,
@@ -210210,7 +210268,8 @@ async function typesHandler(args) {
210210
210268
  browser: config.browser,
210211
210269
  ai: config.ai,
210212
210270
  version_metadata: config.version_metadata,
210213
- secrets
210271
+ secrets,
210272
+ experimental_assets: config.experimental_assets
210214
210273
  };
210215
210274
  await generateTypes(
210216
210275
  configBindingsWithSecrets,
@@ -210402,6 +210461,11 @@ async function generateTypes(configToDTS, config, envInterface, outputPath) {
210402
210461
  `${configToDTS.version_metadata.binding}: { id: string; tag: string };`
210403
210462
  );
210404
210463
  }
210464
+ if (configToDTS.experimental_assets?.binding) {
210465
+ envTypeStructure.push(
210466
+ constructType(configToDTS.experimental_assets.binding, "Fetcher")
210467
+ );
210468
+ }
210405
210469
  const modulesTypeStructure = [];
210406
210470
  if (configToDTS.rules) {
210407
210471
  const moduleTypeMap = {
@@ -212889,7 +212953,11 @@ async function versionsUploadHandler(args) {
212889
212953
  );
212890
212954
  if (!args.dryRun) {
212891
212955
  (0, import_node_assert23.default)(accountId, "Missing account ID");
212892
- await verifyWorkerMatchesCITag(accountId, name);
212956
+ await verifyWorkerMatchesCITag(
212957
+ accountId,
212958
+ name,
212959
+ import_node_path62.default.relative(entry.directory, config.configPath ?? "wrangler.toml")
212960
+ );
212893
212961
  }
212894
212962
  if (!args.dryRun) {
212895
212963
  await standardPricingWarning2(config);
@@ -214481,6 +214549,11 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
214481
214549
  "Cannot use Legacy Assets and Workers Sites in the same Worker."
214482
214550
  );
214483
214551
  }
214552
+ if ((args.experimentalAssets || config.experimental_assets) && args.remote) {
214553
+ throw new UserError(
214554
+ "Cannot use Experimental Assets in remote mode. Workers with assets are only supported in local mode. Please use `wrangler dev`."
214555
+ );
214556
+ }
214484
214557
  verifyMutuallyExclusiveAssetsArgsOrConfig(args, config);
214485
214558
  let experimentalAssetsOptions = processExperimentalAssetsArg(args, config);
214486
214559
  if (experimentalAssetsOptions) {
@@ -214675,12 +214748,22 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
214675
214748
  return;
214676
214749
  }
214677
214750
  logger.log(`${import_node_path63.default.basename(config.configPath)} changed...`);
214751
+ entry = await getEntry(
214752
+ {
214753
+ legacyAssets: args.legacyAssets,
214754
+ script: args.script,
214755
+ moduleRoot: args.moduleRoot,
214756
+ experimentalAssets: args.experimentalAssets
214757
+ },
214758
+ config,
214759
+ "dev"
214760
+ );
214761
+ experimentalAssetsOptions = processExperimentalAssetsArg(
214762
+ args,
214763
+ config
214764
+ );
214678
214765
  if (experimentalAssetsOptions && !args.experimentalAssets) {
214679
214766
  await assetsWatcher?.close();
214680
- experimentalAssetsOptions = processExperimentalAssetsArg(
214681
- args,
214682
- config
214683
- );
214684
214767
  if (experimentalAssetsOptions) {
214685
214768
  assetsWatcher = (0, import_chokidar6.watch)(experimentalAssetsOptions.directory, {
214686
214769
  persistent: true,
@@ -214698,8 +214781,9 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
214698
214781
  }
214699
214782
  });
214700
214783
  }
214784
+ const devServerSettings = await validateDevServerSettings(args, config);
214785
+ let { entry } = devServerSettings;
214701
214786
  const {
214702
- entry,
214703
214787
  upstreamProtocol,
214704
214788
  host,
214705
214789
  routes,
@@ -214711,7 +214795,7 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
214711
214795
  localPersistencePath,
214712
214796
  processEntrypoint,
214713
214797
  additionalModules
214714
- } = await validateDevServerSettings(args, config);
214798
+ } = devServerSettings;
214715
214799
  const nodejsCompatMode = getNodeCompatMode(
214716
214800
  args.compatibilityFlags ?? config.compatibility_flags ?? [],
214717
214801
  {
@@ -217408,15 +217492,19 @@ function unstable_getMiniflareWorkerOptions(configPath, env7) {
217408
217492
  );
217409
217493
  }
217410
217494
  if (bindings.durable_objects !== void 0) {
217495
+ const classNameToUseSQLite = getClassNamesWhichUseSQLite(config.migrations);
217411
217496
  bindingOptions.durableObjects = Object.fromEntries(
217412
- bindings.durable_objects.bindings.map((binding) => [
217413
- binding.name,
217414
- {
217415
- className: binding.class_name,
217416
- scriptName: binding.script_name,
217417
- binding
217418
- }
217419
- ])
217497
+ bindings.durable_objects.bindings.map((binding) => {
217498
+ const useSQLite = classNameToUseSQLite.get(binding.class_name);
217499
+ return [
217500
+ binding.name,
217501
+ {
217502
+ className: binding.class_name,
217503
+ scriptName: binding.script_name,
217504
+ useSQLite
217505
+ }
217506
+ ];
217507
+ })
217420
217508
  );
217421
217509
  }
217422
217510
  const legacyAssetPaths = config.legacy_assets ? getLegacyAssetPaths(config, void 0) : getSiteAssetPaths(config);