wrangler 3.57.2 → 3.58.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.
@@ -1003,38 +1003,45 @@
1003
1003
  "type": "array"
1004
1004
  },
1005
1005
  "assets": {
1006
- "additionalProperties": false,
1007
- "description": "Serve a folder of static assets with your Worker, without any additional code. This can either be a string, or an object with additional config fields.",
1008
- "properties": {
1009
- "browser_TTL": {
1010
- "type": "number"
1011
- },
1012
- "bucket": {
1013
- "type": "string"
1014
- },
1015
- "exclude": {
1016
- "items": {
1017
- "type": "string"
1018
- },
1019
- "type": "array"
1020
- },
1021
- "include": {
1022
- "items": {
1023
- "type": "string"
1006
+ "anyOf": [
1007
+ {
1008
+ "additionalProperties": false,
1009
+ "properties": {
1010
+ "browser_TTL": {
1011
+ "type": "number"
1012
+ },
1013
+ "bucket": {
1014
+ "type": "string"
1015
+ },
1016
+ "exclude": {
1017
+ "items": {
1018
+ "type": "string"
1019
+ },
1020
+ "type": "array"
1021
+ },
1022
+ "include": {
1023
+ "items": {
1024
+ "type": "string"
1025
+ },
1026
+ "type": "array"
1027
+ },
1028
+ "serve_single_page_app": {
1029
+ "type": "boolean"
1030
+ }
1024
1031
  },
1025
- "type": "array"
1032
+ "required": [
1033
+ "bucket",
1034
+ "include",
1035
+ "exclude",
1036
+ "serve_single_page_app"
1037
+ ],
1038
+ "type": "object"
1026
1039
  },
1027
- "serve_single_page_app": {
1028
- "type": "boolean"
1040
+ {
1041
+ "type": "string"
1029
1042
  }
1030
- },
1031
- "required": [
1032
- "bucket",
1033
- "include",
1034
- "exclude",
1035
- "serve_single_page_app"
1036
1043
  ],
1037
- "type": "object"
1044
+ "description": "Serve a folder of static assets with your Worker, without any additional code. This can either be a string, or an object with additional config fields."
1038
1045
  },
1039
1046
  "base_dir": {
1040
1047
  "description": "The directory in which module rules should be evaluated when including additional files into a Worker deployment. This defaults to the directory containing the `main` entry point of the Worker if not specified.",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wrangler",
3
- "version": "3.57.2",
3
+ "version": "3.58.0",
4
4
  "description": "Command-line interface for all things Cloudflare Workers",
5
5
  "keywords": [
6
6
  "wrangler",
@@ -63,7 +63,7 @@
63
63
  "source-map": "0.6.1",
64
64
  "xxhash-wasm": "^1.0.1",
65
65
  "@cloudflare/kv-asset-handler": "0.3.2",
66
- "miniflare": "3.20240524.0"
66
+ "miniflare": "3.20240524.1"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@cloudflare/types": "^6.18.4",
@@ -148,10 +148,10 @@
148
148
  "xdg-app-paths": "^8.3.0",
149
149
  "yargs": "^17.7.2",
150
150
  "yoga-layout": "file:../../vendor/yoga-layout-2.0.0-beta.1.tgz",
151
- "@cloudflare/eslint-config-worker": "1.1.0",
152
151
  "@cloudflare/cli": "1.1.1",
153
- "@cloudflare/workers-tsconfig": "0.0.0",
154
- "@cloudflare/pages-shared": "^0.11.39"
152
+ "@cloudflare/eslint-config-worker": "1.1.0",
153
+ "@cloudflare/pages-shared": "^0.11.40",
154
+ "@cloudflare/workers-tsconfig": "0.0.0"
155
155
  },
156
156
  "optionalDependencies": {
157
157
  "fsevents": "~2.3.2"
@@ -658,7 +658,7 @@ declare interface ConfigFields<Dev extends RawDevConfig> {
658
658
  exclude: string[];
659
659
  browser_TTL: number | undefined;
660
660
  serve_single_page_app: boolean;
661
- } | undefined;
661
+ } | string | undefined;
662
662
  /**
663
663
  * A list of wasm modules that your worker should be bound to. This is
664
664
  * the "legacy" way of binding to a wasm module. ES module workers should
@@ -152654,7 +152654,7 @@ init_import_meta_url();
152654
152654
  init_import_meta_url();
152655
152655
 
152656
152656
  // package.json
152657
- var version = "3.57.2";
152657
+ var version = "3.58.0";
152658
152658
  var package_default = {
152659
152659
  name: "wrangler",
152660
152660
  version,
@@ -154591,7 +154591,7 @@ function getAuthFromEnv() {
154591
154591
  }
154592
154592
  }
154593
154593
  __name(getAuthFromEnv, "getAuthFromEnv");
154594
- var USER_AUTH_CONFIG_FILE = "config/default.toml";
154594
+ var USER_AUTH_CONFIG_PATH = "config";
154595
154595
  var DefaultScopes = {
154596
154596
  "account:read": "See your account info such as account details, analytics, and memberships.",
154597
154597
  "user:read": "See your user info such as name, email address, and account memberships.",
@@ -154990,28 +154990,25 @@ async function generatePKCECodes() {
154990
154990
  return { codeChallenge, codeVerifier };
154991
154991
  }
154992
154992
  __name(generatePKCECodes, "generatePKCECodes");
154993
+ function getAuthConfigFilePath() {
154994
+ const environment = getCloudflareApiEnvironmentFromEnv();
154995
+ const filePath = `${USER_AUTH_CONFIG_PATH}/${environment === "production" ? "default.toml" : `${environment}.toml`}`;
154996
+ return import_node_path6.default.join(getGlobalWranglerConfigPath(), filePath);
154997
+ }
154998
+ __name(getAuthConfigFilePath, "getAuthConfigFilePath");
154993
154999
  function writeAuthConfigFile(config) {
154994
- const authConfigFilePath = import_node_path6.default.join(
154995
- getGlobalWranglerConfigPath(),
154996
- USER_AUTH_CONFIG_FILE
154997
- );
154998
- (0, import_node_fs3.mkdirSync)(import_node_path6.default.dirname(authConfigFilePath), {
155000
+ const configPath = getAuthConfigFilePath();
155001
+ (0, import_node_fs3.mkdirSync)(import_node_path6.default.dirname(configPath), {
154999
155002
  recursive: true
155000
155003
  });
155001
- (0, import_node_fs3.writeFileSync)(
155002
- import_node_path6.default.join(authConfigFilePath),
155003
- import_toml2.default.stringify(config),
155004
- { encoding: "utf-8" }
155005
- );
155004
+ (0, import_node_fs3.writeFileSync)(import_node_path6.default.join(configPath), import_toml2.default.stringify(config), {
155005
+ encoding: "utf-8"
155006
+ });
155006
155007
  reinitialiseAuthTokens();
155007
155008
  }
155008
155009
  __name(writeAuthConfigFile, "writeAuthConfigFile");
155009
155010
  function readAuthConfigFile() {
155010
- const authConfigFilePath = import_node_path6.default.join(
155011
- getGlobalWranglerConfigPath(),
155012
- USER_AUTH_CONFIG_FILE
155013
- );
155014
- const toml = parseTOML(readFileSync5(authConfigFilePath));
155011
+ const toml = parseTOML(readFileSync5(getAuthConfigFilePath()));
155015
155012
  return toml;
155016
155013
  }
155017
155014
  __name(readAuthConfigFile, "readAuthConfigFile");
@@ -155176,7 +155173,7 @@ async function logout() {
155176
155173
  }
155177
155174
  });
155178
155175
  await response.text();
155179
- (0, import_node_fs3.rmSync)(import_node_path6.default.join(getGlobalWranglerConfigPath(), USER_AUTH_CONFIG_FILE));
155176
+ (0, import_node_fs3.rmSync)(getAuthConfigFilePath());
155180
155177
  logger.log(`Successfully logged out.`);
155181
155178
  }
155182
155179
  __name(logout, "logout");
@@ -198482,7 +198479,7 @@ async function generateTypes(configToDTS, config, envInterface, outputPath) {
198482
198479
  );
198483
198480
  }
198484
198481
  if (configToDTS.ai) {
198485
- envTypeStructure.push(constructType(configToDTS.ai.binding, "unknown"));
198482
+ envTypeStructure.push(constructType(configToDTS.ai.binding, "Ai"));
198486
198483
  }
198487
198484
  if (configToDTS.version_metadata) {
198488
198485
  envTypeStructure.push(
@@ -207395,7 +207392,8 @@ function unstable_getMiniflareWorkerOptions(configPath, environment) {
207395
207392
  if (bindings.services !== void 0) {
207396
207393
  bindingOptions.serviceBindings = Object.fromEntries(
207397
207394
  bindings.services.map((binding) => {
207398
- return [binding.binding, binding.service];
207395
+ const name = binding.service === config.name ? import_miniflare18.kCurrentWorker : binding.service;
207396
+ return [binding.binding, { name, entrypoint: binding.entrypoint }];
207399
207397
  })
207400
207398
  );
207401
207399
  }
@@ -208077,3 +208075,4 @@ yargs-parser/build/lib/index.js:
208077
208075
  * SPDX-License-Identifier: ISC
208078
208076
  *)
208079
208077
  */
208078
+ //# sourceMappingURL=cli.js.map