create-cloudflare 2.74.10 → 2.74.12

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/dist/cli.js +241 -87
  2. package/package.json +6 -6
package/dist/cli.js CHANGED
@@ -27356,11 +27356,11 @@ function detectPlatformBinary({ [platform]: platformBinary }, { wsl } = {}) {
27356
27356
  }
27357
27357
  return detectArchBinary(platformBinary);
27358
27358
  }
27359
- var import_node_module12, import_node_process7, import_node_path4, import_node_url, import_node_child_process, import_promises, import_node_util2, import_node_os4, import_node_fs3, import_node_buffer, import_meta12, isDockerCached, cachedResult, hasContainerEnv, isWsl, is_wsl_default, execFile, powerShellPath, executePowerShell, execFile2, wslDrivesMountPoint, powerShellPathFromWsl, powerShellPath2, canAccessPowerShellPromise, canAccessPowerShell, wslDefaultBrowser, convertWslPathToWindows, execFileAsync, execFileAsync2, execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError, execFileAsync4, titleize, isInSsh, is_in_ssh_default, fallbackAttemptSymbol, __dirname$1, localXdgOpenPath, platform, arch, tryEachApp, baseOpen, open2, openApp, apps, open_default;
27359
+ var import_node_module14, import_node_process7, import_node_path4, import_node_url, import_node_child_process, import_promises, import_node_util2, import_node_os4, import_node_fs3, import_node_buffer, import_meta14, isDockerCached, cachedResult, hasContainerEnv, isWsl, is_wsl_default, execFile, powerShellPath, executePowerShell, execFile2, wslDrivesMountPoint, powerShellPathFromWsl, powerShellPath2, canAccessPowerShellPromise, canAccessPowerShell, wslDefaultBrowser, convertWslPathToWindows, execFileAsync, execFileAsync2, execFileAsync3, windowsBrowserProgIds, _windowsBrowserProgIdMap, UnknownBrowserError, execFileAsync4, titleize, isInSsh, is_in_ssh_default, fallbackAttemptSymbol, __dirname$1, localXdgOpenPath, platform, arch, tryEachApp, baseOpen, open2, openApp, apps, open_default;
27360
27360
  var init_open_PCXX3ZDZ = __esm({
27361
27361
  "../workers-utils/dist/open-PCXX3ZDZ.mjs"() {
27362
27362
  "use strict";
27363
- import_node_module12 = require("node:module");
27363
+ import_node_module14 = require("node:module");
27364
27364
  init_chunk_U6NEESU5();
27365
27365
  import_node_process7 = __toESM(require("node:process"), 1);
27366
27366
  import_node_path4 = __toESM(require("node:path"), 1);
@@ -27371,8 +27371,8 @@ var init_open_PCXX3ZDZ = __esm({
27371
27371
  import_node_os4 = __toESM(require("node:os"), 1);
27372
27372
  import_node_fs3 = __toESM(require("node:fs"), 1);
27373
27373
  import_node_buffer = require("node:buffer");
27374
- import_meta12 = {};
27375
- (0, import_node_module12.createRequire)(import_meta12.url || (typeof __filename === "string" ? __filename : "/"));
27374
+ import_meta14 = {};
27375
+ (0, import_node_module14.createRequire)(import_meta14.url || (typeof __filename === "string" ? __filename : "/"));
27376
27376
  __name(hasDockerEnv, "hasDockerEnv");
27377
27377
  __name(hasDockerCGroup, "hasDockerCGroup");
27378
27378
  __name(isDocker, "isDocker");
@@ -27533,7 +27533,7 @@ var init_open_PCXX3ZDZ = __esm({
27533
27533
  isInSsh = Boolean(import_node_process7.default.env.SSH_CONNECTION || import_node_process7.default.env.SSH_CLIENT || import_node_process7.default.env.SSH_TTY);
27534
27534
  is_in_ssh_default = isInSsh;
27535
27535
  fallbackAttemptSymbol = /* @__PURE__ */ Symbol("fallbackAttempt");
27536
- __dirname$1 = import_meta12.url ? import_node_path4.default.dirname((0, import_node_url.fileURLToPath)(import_meta12.url)) : "";
27536
+ __dirname$1 = import_meta14.url ? import_node_path4.default.dirname((0, import_node_url.fileURLToPath)(import_meta14.url)) : "";
27537
27537
  localXdgOpenPath = import_node_path4.default.join(__dirname$1, "xdg-open");
27538
27538
  ({ platform, arch } = import_node_process7.default);
27539
27539
  tryEachApp = /* @__PURE__ */ __name(async (apps22, opener) => {
@@ -78595,7 +78595,7 @@ var import_node_fs5 = require("node:fs");
78595
78595
  var import_node_path6 = require("node:path");
78596
78596
 
78597
78597
  // ../workers-utils/dist/index.mjs
78598
- var import_node_module13 = require("node:module");
78598
+ var import_node_module15 = require("node:module");
78599
78599
 
78600
78600
  // ../workers-utils/dist/chunk-2Q77CKVU.mjs
78601
78601
  var import_node_module4 = require("node:module");
@@ -78641,11 +78641,40 @@ function stripRedundantNodejsCompatFlags(compatibilityDate, compatibilityFlags)
78641
78641
  }
78642
78642
  __name(stripRedundantNodejsCompatFlags, "stripRedundantNodejsCompatFlags");
78643
78643
 
78644
- // ../workers-utils/dist/chunk-XEBMRQST.mjs
78644
+ // ../workers-utils/dist/chunk-K5SN2X7U.mjs
78645
78645
  var import_node_module5 = require("node:module");
78646
78646
  init_chunk_U6NEESU5();
78647
78647
  var import_meta5 = {};
78648
78648
  (0, import_node_module5.createRequire)(import_meta5.url || (typeof __filename === "string" ? __filename : "/"));
78649
+ var safeHeaders = /* @__PURE__ */ new Set([
78650
+ "accept",
78651
+ "accept-encoding",
78652
+ "content-type",
78653
+ "content-length",
78654
+ "content-encoding",
78655
+ "transfer-encoding",
78656
+ "user-agent",
78657
+ "cf-ray",
78658
+ "date",
78659
+ "server",
78660
+ "retry-after",
78661
+ "retry-after-ms"
78662
+ ]);
78663
+ function sanitizeHeaders(headers) {
78664
+ return Object.fromEntries(
78665
+ Array.from(headers, ([name3, value]) => [
78666
+ name3,
78667
+ safeHeaders.has(name3.toLowerCase()) ? value : "[REDACTED]"
78668
+ ])
78669
+ );
78670
+ }
78671
+ __name(sanitizeHeaders, "sanitizeHeaders");
78672
+
78673
+ // ../workers-utils/dist/chunk-XEBMRQST.mjs
78674
+ var import_node_module6 = require("node:module");
78675
+ init_chunk_U6NEESU5();
78676
+ var import_meta6 = {};
78677
+ (0, import_node_module6.createRequire)(import_meta6.url || (typeof __filename === "string" ? __filename : "/"));
78649
78678
  var external_exports = {};
78650
78679
  __export2(external_exports, {
78651
78680
  $brand: () => $brand,
@@ -98832,13 +98861,13 @@ function formatZodError(error62) {
98832
98861
  __name(formatZodError, "formatZodError");
98833
98862
 
98834
98863
  // ../workers-utils/dist/chunk-AAQI36FL.mjs
98835
- var import_node_module7 = require("node:module");
98864
+ var import_node_module8 = require("node:module");
98836
98865
 
98837
98866
  // ../workers-utils/dist/chunk-M3RITKR3.mjs
98838
- var import_node_module6 = require("node:module");
98867
+ var import_node_module7 = require("node:module");
98839
98868
  init_chunk_U6NEESU5();
98840
- var import_meta6 = {};
98841
- (0, import_node_module6.createRequire)(import_meta6.url || (typeof __filename === "string" ? __filename : "/"));
98869
+ var import_meta7 = {};
98870
+ (0, import_node_module7.createRequire)(import_meta7.url || (typeof __filename === "string" ? __filename : "/"));
98842
98871
  function dedent(templ) {
98843
98872
  var values = [];
98844
98873
  for (var _i = 1; _i < arguments.length; _i++) {
@@ -98884,8 +98913,8 @@ var esm_default = dedent;
98884
98913
  init_chunk_U6NEESU5();
98885
98914
  var import_node_fs = require("node:fs");
98886
98915
  var import_node_path = __toESM(require("node:path"), 1);
98887
- var import_meta7 = {};
98888
- (0, import_node_module7.createRequire)(import_meta7.url || (typeof __filename === "string" ? __filename : "/"));
98916
+ var import_meta8 = {};
98917
+ (0, import_node_module8.createRequire)(import_meta8.url || (typeof __filename === "string" ? __filename : "/"));
98889
98918
  function hasKnownExportType(entry) {
98890
98919
  const type = entry?.type;
98891
98920
  return type === "durable-object" || type === "worker" || type === "workflow";
@@ -101956,13 +101985,13 @@ function formatConfigSnippet(snippet, configPath, formatted = true) {
101956
101985
  __name(formatConfigSnippet, "formatConfigSnippet");
101957
101986
 
101958
101987
  // ../workers-utils/dist/chunk-FR75DWDU.mjs
101959
- var import_node_module11 = require("node:module");
101988
+ var import_node_module12 = require("node:module");
101960
101989
 
101961
101990
  // ../workers-utils/dist/chunk-QSRIB43D.mjs
101962
- var import_node_module8 = require("node:module");
101991
+ var import_node_module9 = require("node:module");
101963
101992
  init_chunk_U6NEESU5();
101964
- var import_meta8 = {};
101965
- (0, import_node_module8.createRequire)(import_meta8.url || (typeof __filename === "string" ? __filename : "/"));
101993
+ var import_meta9 = {};
101994
+ (0, import_node_module9.createRequire)(import_meta9.url || (typeof __filename === "string" ? __filename : "/"));
101966
101995
  function getBooleanEnvironmentVariableFactory(options) {
101967
101996
  return () => {
101968
101997
  if (!(options.variableName in process.env) || process.env[options.variableName] === void 0) {
@@ -102030,14 +102059,14 @@ var getDockerPath = getEnvironmentVariableFactory({
102030
102059
  });
102031
102060
 
102032
102061
  // ../workers-utils/dist/chunk-MV2OJK3L.mjs
102033
- var import_node_module10 = require("node:module");
102062
+ var import_node_module11 = require("node:module");
102034
102063
 
102035
102064
  // ../workers-utils/dist/chunk-MIA26B4M.mjs
102036
- var import_node_module9 = require("node:module");
102065
+ var import_node_module10 = require("node:module");
102037
102066
  init_chunk_U6NEESU5();
102038
102067
  var import_node_fs2 = __toESM(require("node:fs"), 1);
102039
- var import_meta9 = {};
102040
- (0, import_node_module9.createRequire)(import_meta9.url || (typeof __filename === "string" ? __filename : "/"));
102068
+ var import_meta10 = {};
102069
+ (0, import_node_module10.createRequire)(import_meta10.url || (typeof __filename === "string" ? __filename : "/"));
102041
102070
  function isDirectory(path9) {
102042
102071
  return import_node_fs2.default.statSync(path9, { throwIfNoEntry: false })?.isDirectory() ?? false;
102043
102072
  }
@@ -102071,8 +102100,8 @@ __name(removeDirSync, "removeDirSync");
102071
102100
  init_chunk_U6NEESU5();
102072
102101
  var import_node_os3 = __toESM(require("node:os"), 1);
102073
102102
  var import_node_path2 = __toESM(require("node:path"), 1);
102074
- var import_meta10 = {};
102075
- (0, import_node_module10.createRequire)(import_meta10.url || (typeof __filename === "string" ? __filename : "/"));
102103
+ var import_meta11 = {};
102104
+ (0, import_node_module11.createRequire)(import_meta11.url || (typeof __filename === "string" ? __filename : "/"));
102076
102105
  function isWindows() {
102077
102106
  return /^win/i.test(process.platform);
102078
102107
  }
@@ -102223,8 +102252,8 @@ __name(getGlobalWranglerCachePath, "getGlobalWranglerCachePath");
102223
102252
  // ../workers-utils/dist/chunk-FR75DWDU.mjs
102224
102253
  init_chunk_U6NEESU5();
102225
102254
  var import_node_path3 = __toESM(require("node:path"), 1);
102226
- var import_meta11 = {};
102227
- (0, import_node_module11.createRequire)(import_meta11.url || (typeof __filename === "string" ? __filename : "/"));
102255
+ var import_meta12 = {};
102256
+ (0, import_node_module12.createRequire)(import_meta12.url || (typeof __filename === "string" ? __filename : "/"));
102228
102257
  var getC3CommandFromEnv = getEnvironmentVariableFactory({
102229
102258
  variableName: "WRANGLER_C3_COMMAND",
102230
102259
  defaultValue: /* @__PURE__ */ __name(() => "create cloudflare", "defaultValue")
@@ -102401,6 +102430,80 @@ var getCloudflaredPathFromEnv = getEnvironmentVariableFactory({
102401
102430
  variableName: "CLOUDFLARED_PATH"
102402
102431
  });
102403
102432
 
102433
+ // ../workers-utils/dist/chunk-BRZKTVPN.mjs
102434
+ var import_node_module13 = require("node:module");
102435
+ init_chunk_U6NEESU5();
102436
+ var import_node_http = require("node:http");
102437
+ var import_meta13 = {};
102438
+ (0, import_node_module13.createRequire)(import_meta13.url || (typeof __filename === "string" ? __filename : "/"));
102439
+ var protectedHeaders = /* @__PURE__ */ new Set([
102440
+ "host",
102441
+ "content-type",
102442
+ "content-encoding",
102443
+ "content-length",
102444
+ "connection",
102445
+ "transfer-encoding",
102446
+ "upgrade",
102447
+ "te",
102448
+ "trailer"
102449
+ ]);
102450
+ function configurationError(message) {
102451
+ return new UserError(`CLOUDFLARE_API_HEADERS ${message}`, {
102452
+ telemetryMessage: "cfetch custom api headers invalid configuration"
102453
+ });
102454
+ }
102455
+ __name(configurationError, "configurationError");
102456
+ function getCustomApiHeaders() {
102457
+ const raw = process.env.CLOUDFLARE_API_HEADERS;
102458
+ if (!raw) {
102459
+ return {};
102460
+ }
102461
+ let parsed;
102462
+ try {
102463
+ parsed = JSON.parse(raw);
102464
+ } catch {
102465
+ throw configurationError("must be a JSON object with string values.");
102466
+ }
102467
+ if (parsed === null || typeof parsed !== "object" || Array.isArray(parsed)) {
102468
+ throw configurationError("must be a JSON object with string values.");
102469
+ }
102470
+ const headers = {};
102471
+ for (const [name3, value] of Object.entries(parsed)) {
102472
+ if (typeof value !== "string") {
102473
+ throw configurationError("must contain only string values.");
102474
+ }
102475
+ try {
102476
+ (0, import_node_http.validateHeaderName)(name3);
102477
+ (0, import_node_http.validateHeaderValue)(name3, value);
102478
+ } catch {
102479
+ throw configurationError(
102480
+ "contains an invalid HTTP header name or value."
102481
+ );
102482
+ }
102483
+ const key = name3.toLowerCase();
102484
+ if (protectedHeaders.has(key)) {
102485
+ throw configurationError(`cannot set the protected header "${name3}".`);
102486
+ }
102487
+ if (Object.hasOwn(headers, key)) {
102488
+ throw configurationError(`contains duplicate header "${name3}".`);
102489
+ }
102490
+ Object.defineProperty(headers, key, {
102491
+ value,
102492
+ enumerable: true,
102493
+ configurable: true,
102494
+ writable: true
102495
+ });
102496
+ }
102497
+ return headers;
102498
+ }
102499
+ __name(getCustomApiHeaders, "getCustomApiHeaders");
102500
+ function addCustomApiHeaders(headers) {
102501
+ for (const [name3, value] of Object.entries(getCustomApiHeaders())) {
102502
+ headers.set(name3, value);
102503
+ }
102504
+ }
102505
+ __name(addCustomApiHeaders, "addCustomApiHeaders");
102506
+
102404
102507
  // ../workers-utils/dist/index.mjs
102405
102508
  init_chunk_U6NEESU5();
102406
102509
  var import_node_fs4 = __toESM(require("node:fs"), 1);
@@ -102416,8 +102519,8 @@ var import_node_os5 = require("node:os");
102416
102519
  var import_promises2 = require("node:fs/promises");
102417
102520
  var timersPromises = __toESM(require("node:timers/promises"), 1);
102418
102521
  var import_promises3 = require("node:timers/promises");
102419
- var import_meta13 = {};
102420
- (0, import_node_module13.createRequire)(import_meta13.url || (typeof __filename === "string" ? __filename : "/"));
102522
+ var import_meta15 = {};
102523
+ (0, import_node_module15.createRequire)(import_meta15.url || (typeof __filename === "string" ? __filename : "/"));
102421
102524
  var require_vendors2 = __commonJS2({
102422
102525
  "../../node_modules/.pnpm/ci-info@4.4.0/node_modules/ci-info/vendors.json"(exports$1, module2) {
102423
102526
  module2.exports = [
@@ -110961,7 +111064,7 @@ var BINDING_LOCAL_SUPPORT = {
110961
111064
  // TODO: Miniflare currently ignores `remote: true` on queues, tracked in #13727.
110962
111065
  queue: "local-and-remote",
110963
111066
  flagship: "local-and-remote",
110964
- artifacts: "remote-default-with-local-opt-in",
111067
+ artifacts: "local-and-remote",
110965
111068
  analytics_engine: "local-and-remote",
110966
111069
  vectorize: "remote",
110967
111070
  mtls_certificate: "remote",
@@ -110991,32 +111094,17 @@ function resolveBindingRemote(type, remote, { remoteBindingsDisabled = false } =
110991
111094
  return true;
110992
111095
  case "local-only":
110993
111096
  return false;
110994
- case "remote-default-with-local-opt-in":
110995
- return !remoteBindingsDisabled && remote !== false;
110996
111097
  case "local-and-remote":
110997
111098
  case "remote":
110998
111099
  return !remoteBindingsDisabled && remote === true;
110999
111100
  }
111000
111101
  }
111001
111102
  __name(resolveBindingRemote, "resolveBindingRemote");
111002
- function validateBindingRemoteSetting(type, remote, warn2, {
111003
- binding,
111004
- remoteBindingsDisabled = false,
111005
- configFormat: configFormat2 = "wrangler"
111006
- } = {}) {
111007
- const remoteSetting = /* @__PURE__ */ __name((value) => configFormat2 === "cloudflare-config" ? `\`dev: { remote: ${value} }\`` : `\`remote: ${value}\``, "remoteSetting");
111103
+ function validateBindingRemoteSetting(type, remote, warn2) {
111008
111104
  const support = getBindingLocalSupport(type);
111009
111105
  switch (support) {
111010
111106
  case "local-and-remote":
111011
111107
  return;
111012
- case "remote-default-with-local-opt-in":
111013
- if (remote === void 0 && !remoteBindingsDisabled) {
111014
- const subject = binding === void 0 ? `${getBindingTypeFriendlyName(type)} bindings use` : `${getBindingTypeFriendlyName(type)} binding ${binding} uses`;
111015
- warn2(
111016
- `${subject} the deployed resource. Set ${remoteSetting(false)} to use the local simulator, or ${remoteSetting(true)} to silence this warning.`
111017
- );
111018
- }
111019
- return;
111020
111108
  case "local-only":
111021
111109
  if (remote === true) {
111022
111110
  throw new UserError(
@@ -111060,6 +111148,24 @@ function validateBindingRemoteSetting(type, remote, warn2, {
111060
111148
  }
111061
111149
  }
111062
111150
  __name(validateBindingRemoteSetting, "validateBindingRemoteSetting");
111151
+ function createArtifactsLocalDefaultWarner(configFormat2) {
111152
+ const remoteSetting = /* @__PURE__ */ __name((value) => configFormat2 === "cloudflare-config" ? `\`dev: { remote: ${value} }\`` : `\`remote: ${value}\``, "remoteSetting");
111153
+ const warned = /* @__PURE__ */ new Set();
111154
+ return ({ id, bindings }, warn2) => {
111155
+ for (const { name: name3, remote, worker } of bindings) {
111156
+ const key = JSON.stringify([id, worker ?? null, name3]);
111157
+ if (remote !== void 0 || warned.has(key)) {
111158
+ continue;
111159
+ }
111160
+ warned.add(key);
111161
+ const subject = worker === void 0 ? name3 : `${name3} in Worker ${worker}`;
111162
+ warn2(
111163
+ `Artifacts binding ${subject} uses the local simulator by default. Set ${remoteSetting(true)} to use deployed repos, or ${remoteSetting(false)} to silence this warning.`
111164
+ );
111165
+ }
111166
+ };
111167
+ }
111168
+ __name(createArtifactsLocalDefaultWarner, "createArtifactsLocalDefaultWarner");
111063
111169
  var supportedPagesConfigFields = [
111064
111170
  "pages_build_output_dir",
111065
111171
  "name",
@@ -111232,14 +111338,10 @@ function getInstalledPackageVersion(packageName, projectPath, opts = {}) {
111232
111338
  return void 0;
111233
111339
  }
111234
111340
  const lastDir = opts.stopAtProjectPath === true ? projectPath : void 0;
111235
- const packageJsonPath = findFileUp("package.json", packagePath, lastDir);
111236
- if (!packageJsonPath) {
111341
+ const packageJson = findPackageRootManifest(packagePath, lastDir);
111342
+ if (!packageJson) {
111237
111343
  return void 0;
111238
111344
  }
111239
- const packageJson = parsePackageJSON(
111240
- readFileSync(packageJsonPath),
111241
- packageJsonPath
111242
- );
111243
111345
  if (packageJson.name !== packageName) {
111244
111346
  const bundledVersion = packageJson.bundledVersions?.[packageName];
111245
111347
  if (bundledVersion !== void 0) {
@@ -111251,29 +111353,27 @@ function getInstalledPackageVersion(packageName, projectPath, opts = {}) {
111251
111353
  }
111252
111354
  }
111253
111355
  __name(getInstalledPackageVersion, "getInstalledPackageVersion");
111254
- function findFileUp(name3, startDir, lastDir) {
111356
+ function findPackageRootManifest(startDir, lastDir) {
111255
111357
  let dir2 = startDir;
111256
- const root = import_node_path5.default.parse(dir2).root;
111257
111358
  while (true) {
111258
- const candidate = import_node_path5.default.join(dir2, name3);
111259
- try {
111260
- if ((0, import_node_fs4.statSync)(candidate).isFile()) {
111261
- return candidate;
111359
+ const packageJsonPath = import_node_path5.default.join(dir2, "package.json");
111360
+ if ((0, import_node_fs4.statSync)(packageJsonPath, { throwIfNoEntry: false })?.isFile()) {
111361
+ const packageJson = parsePackageJSON(
111362
+ readFileSync(packageJsonPath),
111363
+ packageJsonPath
111364
+ );
111365
+ if (packageJson.name !== void 0) {
111366
+ return packageJson.version !== void 0 ? packageJson : void 0;
111262
111367
  }
111263
- } catch {
111264
- }
111265
- if (lastDir !== void 0 && dir2 === lastDir) {
111266
- break;
111267
111368
  }
111268
111369
  const parent = import_node_path5.default.dirname(dir2);
111269
- if (parent === dir2 || dir2 === root) {
111270
- break;
111370
+ if (dir2 === lastDir || parent === dir2 || import_node_path5.default.basename(parent) === "node_modules" || import_node_path5.default.basename(parent).startsWith("@") && import_node_path5.default.basename(import_node_path5.default.dirname(parent)) === "node_modules") {
111371
+ return void 0;
111271
111372
  }
111272
111373
  dir2 = parent;
111273
111374
  }
111274
- return void 0;
111275
111375
  }
111276
- __name(findFileUp, "findFileUp");
111376
+ __name(findPackageRootManifest, "findPackageRootManifest");
111277
111377
  function mapWorkerMetadataBindings(bindings) {
111278
111378
  return bindings.filter((binding) => binding.type !== "secret_text").reduce((configObj, binding) => {
111279
111379
  switch (binding.type) {
@@ -111691,7 +111791,7 @@ function mapWorkerMetadataBindings(bindings) {
111691
111791
  }, {});
111692
111792
  }
111693
111793
  __name(mapWorkerMetadataBindings, "mapWorkerMetadataBindings");
111694
- var DEFAULT_COMPAT_DATE = "2026-11-09";
111794
+ var DEFAULT_COMPAT_DATE = "2026-11-13";
111695
111795
  function constructWranglerConfig(config50) {
111696
111796
  const mappedBindings = mapWorkerMetadataBindings(config50.bindings);
111697
111797
  const durableObjectClassNames = config50.bindings.filter(
@@ -113348,6 +113448,53 @@ function getWranglerTmpDir(projectRoot, prefix, cleanup = true) {
113348
113448
  };
113349
113449
  }
113350
113450
  __name(getWranglerTmpDir, "getWranglerTmpDir");
113451
+ var MetricsRegistry = class {
113452
+ static {
113453
+ __name(this, "MetricsRegistry");
113454
+ }
113455
+ counters = [];
113456
+ /**
113457
+ * Create and register a new counter metric.
113458
+ *
113459
+ * @param name - The metric name (e.g. "service_request_total")
113460
+ * @param help - A human-readable description of the metric
113461
+ * @returns A Counter that can be incremented
113462
+ */
113463
+ createCounter(name3, help) {
113464
+ const entry = { name: name3, help, value: 0 };
113465
+ this.counters.push(entry);
113466
+ return {
113467
+ inc: /* @__PURE__ */ __name(() => {
113468
+ entry.value++;
113469
+ }, "inc"),
113470
+ add: /* @__PURE__ */ __name((amount) => {
113471
+ if (amount < 0) {
113472
+ throw new Error("Counter value cannot decrease");
113473
+ }
113474
+ entry.value += amount;
113475
+ }, "add")
113476
+ };
113477
+ }
113478
+ /**
113479
+ * Serialize all registered metrics in Prometheus text exposition format.
113480
+ *
113481
+ * @see https://prometheus.io/docs/instrumenting/exposition_formats/#text-based-format
113482
+ */
113483
+ metrics() {
113484
+ return this.counters.map((c2) => {
113485
+ let result = "";
113486
+ if (c2.help.length > 0) {
113487
+ result += `# HELP ${c2.name} ${c2.help}
113488
+ `;
113489
+ }
113490
+ result += `# TYPE ${c2.name} counter
113491
+ `;
113492
+ result += `${c2.name} ${c2.value}
113493
+ `;
113494
+ return result;
113495
+ }).join("");
113496
+ }
113497
+ };
113351
113498
  function buildDetailedError(message, ...extra) {
113352
113499
  return new ParseError({
113353
113500
  text: message,
@@ -113366,11 +113513,9 @@ function maybeThrowFriendlyError(error62) {
113366
113513
  }
113367
113514
  __name(maybeThrowFriendlyError, "maybeThrowFriendlyError");
113368
113515
  function logHeaders(headers, logger) {
113369
- const clone2 = cloneHeaders(headers);
113370
- clone2.delete("Authorization");
113371
113516
  logger.debugWithSanitization?.(
113372
113517
  "HEADERS:",
113373
- JSON.stringify(Object.fromEntries(clone2), null, 2)
113518
+ JSON.stringify(sanitizeHeaders(headers), null, 2)
113374
113519
  );
113375
113520
  }
113376
113521
  __name(logHeaders, "logHeaders");
@@ -113385,13 +113530,21 @@ async function performApiFetchBase(complianceConfig, resource, init = {}, userAg
113385
113530
  addAuthorizationHeader(headers, credentials);
113386
113531
  headers.set("User-Agent", userAgent);
113387
113532
  maybeAddTraceHeader(headers);
113533
+ addCustomApiHeaders(headers);
113388
113534
  const queryString = queryParams ? `?${queryParams.toString()}` : "";
113389
113535
  logger.debug(
113390
113536
  `-- START CF API REQUEST: ${method} ${getCloudflareApiBaseUrl(complianceConfig)}${resource}`
113391
113537
  );
113392
113538
  logger.debugWithSanitization?.("QUERY STRING:", queryString);
113393
113539
  logHeaders(headers, logger);
113394
- logger.debugWithSanitization?.("INIT:", JSON.stringify({ ...init }, null, 2));
113540
+ logger.debugWithSanitization?.(
113541
+ "INIT:",
113542
+ JSON.stringify(
113543
+ { ...init, headers: sanitizeHeaders(new import_undici.Headers(init.headers)) },
113544
+ null,
113545
+ 2
113546
+ )
113547
+ );
113395
113548
  if (logger.debugWithSanitization !== void 0 && init.body instanceof import_undici.FormData && (logger.loggerLevel === void 0 || logger.loggerLevel === "debug")) {
113396
113549
  logger.debugWithSanitization?.(
113397
113550
  "BODY:",
@@ -113719,6 +113872,7 @@ async function fetchKVGetValueBase(complianceConfig, accountId, namespaceId, key
113719
113872
  addAuthorizationHeader(headers, credentials);
113720
113873
  headers.set("User-Agent", userAgent);
113721
113874
  maybeAddTraceHeader(headers);
113875
+ addCustomApiHeaders(headers);
113722
113876
  const resource = `${getCloudflareApiBaseUrl(complianceConfig)}/accounts/${accountId}/storage/kv/namespaces/${namespaceId}/values/${key}`;
113723
113877
  logger.debug(`-- START CF API REQUEST: GET ${resource}`);
113724
113878
  logger.debug("-- END CF API REQUEST");
@@ -116982,12 +117136,12 @@ var y18n2 = (opts) => {
116982
117136
  var y18n_default = y18n2;
116983
117137
 
116984
117138
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
116985
- var import_meta14 = {};
117139
+ var import_meta16 = {};
116986
117140
  var REQUIRE_ERROR = "require is not supported by ESM";
116987
117141
  var REQUIRE_DIRECTORY_ERROR = "loading a directory of commands is not supported yet for ESM";
116988
117142
  var __dirname2;
116989
117143
  try {
116990
- __dirname2 = (0, import_url.fileURLToPath)(import_meta14.url);
117144
+ __dirname2 = (0, import_url.fileURLToPath)(import_meta16.url);
116991
117145
  } catch (e) {
116992
117146
  __dirname2 = process.cwd();
116993
117147
  }
@@ -120314,7 +120468,7 @@ var Yargs = YargsFactory(esm_default2);
120314
120468
  var yargs_default = Yargs;
120315
120469
 
120316
120470
  // package.json
120317
- var version2 = "2.74.10";
120471
+ var version2 = "2.74.12";
120318
120472
 
120319
120473
  // src/metrics.ts
120320
120474
  var import_node_async_hooks = require("node:async_hooks");
@@ -120326,9 +120480,9 @@ var import_node_fs6 = require("node:fs");
120326
120480
  var import_node_path7 = __toESM(require("node:path"));
120327
120481
 
120328
120482
  // ../workers-utils/dist/global-wrangler-config-path.mjs
120329
- var import_node_module14 = require("node:module");
120330
- var import_meta15 = {};
120331
- (0, import_node_module14.createRequire)(import_meta15.url || (typeof __filename === "string" ? __filename : "/"));
120483
+ var import_node_module16 = require("node:module");
120484
+ var import_meta17 = {};
120485
+ (0, import_node_module16.createRequire)(import_meta17.url || (typeof __filename === "string" ? __filename : "/"));
120332
120486
 
120333
120487
  // src/helpers/metrics-config.ts
120334
120488
  function writeMetricsConfig(config50) {
@@ -120451,9 +120605,9 @@ function quoteShellArgs(args) {
120451
120605
  }
120452
120606
 
120453
120607
  // ../workers-utils/dist/fs-helpers.mjs
120454
- var import_node_module15 = require("node:module");
120455
- var import_meta16 = {};
120456
- (0, import_node_module15.createRequire)(import_meta16.url || (typeof __filename === "string" ? __filename : "/"));
120608
+ var import_node_module17 = require("node:module");
120609
+ var import_meta18 = {};
120610
+ (0, import_node_module17.createRequire)(import_meta18.url || (typeof __filename === "string" ? __filename : "/"));
120457
120611
 
120458
120612
  // src/helpers/packageManagers.ts
120459
120613
  var import_semver = __toESM(require_semver2());
@@ -122580,9 +122734,9 @@ var isInSsh2 = Boolean(import_node_process13.default.env.SSH_CONNECTION || impor
122580
122734
  var is_in_ssh_default2 = isInSsh2;
122581
122735
 
122582
122736
  // ../../node_modules/.pnpm/open@11.0.0/node_modules/open/index.js
122583
- var import_meta17 = {};
122737
+ var import_meta19 = {};
122584
122738
  var fallbackAttemptSymbol2 = /* @__PURE__ */ Symbol("fallbackAttempt");
122585
- var __dirname3 = import_meta17.url ? import_node_path13.default.dirname((0, import_node_url3.fileURLToPath)(import_meta17.url)) : "";
122739
+ var __dirname3 = import_meta19.url ? import_node_path13.default.dirname((0, import_node_url3.fileURLToPath)(import_meta19.url)) : "";
122586
122740
  var localXdgOpenPath2 = import_node_path13.default.join(__dirname3, "xdg-open");
122587
122741
  var { platform: platform2, arch: arch3 } = import_node_process14.default;
122588
122742
  var tryEachApp2 = async (apps3, opener) => {
@@ -122921,20 +123075,20 @@ var WRANGLER_DEFAULTS = {
122921
123075
  };
122922
123076
 
122923
123077
  // ../shared-ast-primitives/dist/index.mjs
122924
- var import_node_module16 = require("node:module");
123078
+ var import_node_module18 = require("node:module");
122925
123079
  var import_node_fs15 = require("node:fs");
122926
123080
  var import_node_path14 = __toESM(require("node:path"), 1);
122927
123081
  var recast = __toESM(require_main2(), 1);
122928
123082
  var import_recast = __toESM(require_main2(), 1);
122929
- var esprimaParser = __toESM(require_esprima3(), 1);
123083
+ var babelParser = __toESM(require_babel2(), 1);
122930
123084
  var typescriptParser = __toESM(require_typescript2(), 1);
122931
- var import_meta18 = {};
122932
- (0, import_node_module16.createRequire)(import_meta18.url || (typeof __filename === "string" ? __filename : "/"));
123085
+ var import_meta20 = {};
123086
+ (0, import_node_module18.createRequire)(import_meta20.url || (typeof __filename === "string" ? __filename : "/"));
122933
123087
  var __defProp3 = Object.defineProperty;
122934
123088
  var __name2 = (target, value) => __defProp3(target, "name", { value, configurable: true });
122935
123089
  function parseJs(src) {
122936
123090
  try {
122937
- return recast.parse(src, { parser: esprimaParser });
123091
+ return recast.parse(src, { parser: babelParser });
122938
123092
  } catch {
122939
123093
  throw new Error("Error parsing js template.");
122940
123094
  }
@@ -122950,7 +123104,7 @@ function parseTs(src) {
122950
123104
  __name2(parseTs, "parseTs");
122951
123105
  function parseFile(filePath) {
122952
123106
  const lang = import_node_path14.default.extname(filePath).slice(1);
122953
- const parser2 = lang === "js" ? esprimaParser : typescriptParser;
123107
+ const parser2 = lang === "js" ? babelParser : typescriptParser;
122954
123108
  try {
122955
123109
  const fileContents = (0, import_node_fs15.readFileSync)(import_node_path14.default.resolve(filePath), "utf-8");
122956
123110
  if (fileContents) {
@@ -125811,7 +125965,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
125811
125965
  var import_node_assert7 = __toESM(require("node:assert"));
125812
125966
 
125813
125967
  // ../wrangler/package.json
125814
- var version3 = "4.159.0";
125968
+ var version3 = "4.162.0";
125815
125969
 
125816
125970
  // src/git.ts
125817
125971
  var offerGit = async (ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.74.10",
3
+ "version": "2.74.12",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -32,7 +32,7 @@
32
32
  "@babel/types": "^7.21.4",
33
33
  "@clack/prompts": "^1.2.0",
34
34
  "@cloudflare/vite-plugin": "npm:@cloudflare/vite-plugin@1.63.2",
35
- "@cloudflare/workers-types": "^5.20261109.1",
35
+ "@cloudflare/workers-types": "^5.20261113.1",
36
36
  "@types/command-exists": "^1.2.0",
37
37
  "@types/cross-spawn": "^6.0.2",
38
38
  "@types/deepmerge": "^2.2.0",
@@ -71,12 +71,12 @@
71
71
  "which-pm-runs": "^1.1.0",
72
72
  "wrap-ansi": "^9.0.0",
73
73
  "yargs": "^17.7.2",
74
- "@cloudflare/cli-shared-helpers": "0.3.5",
75
- "@cloudflare/mock-npm-registry": "0.0.0",
74
+ "@cloudflare/cli-shared-helpers": "0.3.8",
76
75
  "@cloudflare/shared-ast-primitives": "1.1.0",
77
76
  "@cloudflare/workers-tsconfig": "0.0.0",
78
- "@cloudflare/workers-utils": "0.52.1",
79
- "wrangler": "4.159.0"
77
+ "@cloudflare/mock-npm-registry": "0.0.0",
78
+ "@cloudflare/workers-utils": "0.54.0",
79
+ "wrangler": "4.162.0"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.0.0"