create-cloudflare 2.70.18 → 2.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -47008,30 +47008,30 @@ var require_esprima = __commonJS({
47008
47008
  };
47009
47009
  Reader2.prototype.isRegexStart = function() {
47010
47010
  var previous = this.values[this.values.length - 1];
47011
- var regex2 = previous !== null;
47011
+ var regex3 = previous !== null;
47012
47012
  switch (previous) {
47013
47013
  case "this":
47014
47014
  case "]":
47015
- regex2 = false;
47015
+ regex3 = false;
47016
47016
  break;
47017
47017
  case ")":
47018
47018
  var keyword = this.values[this.paren - 1];
47019
- regex2 = keyword === "if" || keyword === "while" || keyword === "for" || keyword === "with";
47019
+ regex3 = keyword === "if" || keyword === "while" || keyword === "for" || keyword === "with";
47020
47020
  break;
47021
47021
  case "}":
47022
- regex2 = false;
47022
+ regex3 = false;
47023
47023
  if (this.values[this.curly - 3] === "function") {
47024
47024
  var check2 = this.values[this.curly - 4];
47025
- regex2 = check2 ? !this.beforeFunctionExpression(check2) : false;
47025
+ regex3 = check2 ? !this.beforeFunctionExpression(check2) : false;
47026
47026
  } else if (this.values[this.curly - 4] === "function") {
47027
47027
  var check2 = this.values[this.curly - 5];
47028
- regex2 = check2 ? !this.beforeFunctionExpression(check2) : true;
47028
+ regex3 = check2 ? !this.beforeFunctionExpression(check2) : true;
47029
47029
  }
47030
47030
  break;
47031
47031
  default:
47032
47032
  break;
47033
47033
  }
47034
- return regex2;
47034
+ return regex3;
47035
47035
  };
47036
47036
  Reader2.prototype.push = function(token) {
47037
47037
  if (token.type === 7 || token.type === 4) {
@@ -59904,12 +59904,12 @@ var require_lib = __commonJS({
59904
59904
  pattern,
59905
59905
  flags
59906
59906
  }) {
59907
- let regex2 = null;
59907
+ let regex3 = null;
59908
59908
  try {
59909
- regex2 = new RegExp(pattern, flags);
59909
+ regex3 = new RegExp(pattern, flags);
59910
59910
  } catch (_) {
59911
59911
  }
59912
- const node = this.estreeParseLiteral(regex2);
59912
+ const node = this.estreeParseLiteral(regex3);
59913
59913
  node.regex = {
59914
59914
  pattern,
59915
59915
  flags
@@ -75341,7 +75341,7 @@ var stderr = process.stderr;
75341
75341
  // ../cli/dist/check-macos-version.mjs
75342
75342
  var import_node_os5 = __toESM(require("node:os"), 1);
75343
75343
 
75344
- // ../workers-utils/dist/chunk-J6JRMPLM.mjs
75344
+ // ../workers-utils/dist/chunk-NMPHTL5R.mjs
75345
75345
  init_chunk_Q72B4Q5Z();
75346
75346
  var import_node_assert = __toESM(require("node:assert"), 1);
75347
75347
  function isCompatDate(str) {
@@ -75358,6 +75358,29 @@ function getTodaysCompatDate() {
75358
75358
  return formatCompatibilityDate(/* @__PURE__ */ new Date());
75359
75359
  }
75360
75360
  __name(getTodaysCompatDate, "getTodaysCompatDate");
75361
+ var NODEJS_COMPAT_DEFAULT_ON_DATE = "2026-08-04";
75362
+ function isNodejsCompatDefaultOn(compatibilityDate) {
75363
+ return compatibilityDate !== void 0 && compatibilityDate >= NODEJS_COMPAT_DEFAULT_ON_DATE;
75364
+ }
75365
+ __name(isNodejsCompatDefaultOn, "isNodejsCompatDefaultOn");
75366
+ var NODEJS_COMPAT_V2_SWITCH_OVER_DATE = "2024-09-23";
75367
+ function resolveNodejsCompat(compatibilityDate, compatibilityFlags) {
75368
+ const isDefaultOn = isNodejsCompatDefaultOn(compatibilityDate);
75369
+ const isNodejsCompatEnabled = compatibilityFlags.includes("nodejs_compat") || isDefaultOn && !compatibilityFlags.includes("no_nodejs_compat");
75370
+ const isNodejsCompatV2Enabled = compatibilityFlags.includes("nodejs_compat_v2") || !compatibilityFlags.includes("no_nodejs_compat_v2") && (isDefaultOn || isNodejsCompatEnabled && compatibilityDate >= NODEJS_COMPAT_V2_SWITCH_OVER_DATE);
75371
+ return { isNodejsCompatEnabled, isNodejsCompatV2Enabled };
75372
+ }
75373
+ __name(resolveNodejsCompat, "resolveNodejsCompat");
75374
+ function stripRedundantNodejsCompatFlags(compatibilityDate, compatibilityFlags) {
75375
+ if (!isNodejsCompatDefaultOn(compatibilityDate)) {
75376
+ return compatibilityFlags;
75377
+ }
75378
+ const redundantFlags = ["nodejs_compat", "nodejs_compat_v2"].filter(
75379
+ (flag) => !compatibilityFlags.includes(`no_${flag}`)
75380
+ );
75381
+ return compatibilityFlags.filter((flag) => !redundantFlags.includes(flag));
75382
+ }
75383
+ __name(stripRedundantNodejsCompatFlags, "stripRedundantNodejsCompatFlags");
75361
75384
  function assertNever(_value) {
75362
75385
  }
75363
75386
  __name(assertNever, "assertNever");
@@ -82300,8 +82323,8 @@ var dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][
82300
82323
  var date = /* @__PURE__ */ new RegExp(`^${dateSource}$`);
82301
82324
  function timeSource(args) {
82302
82325
  const hhmm = `(?:[01]\\d|2[0-3]):[0-5]\\d`;
82303
- const regex2 = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
82304
- return regex2;
82326
+ const regex3 = typeof args.precision === "number" ? args.precision === -1 ? `${hhmm}` : args.precision === 0 ? `${hhmm}:[0-5]\\d` : `${hhmm}:[0-5]\\d\\.\\d{${args.precision}}` : `${hhmm}(?::[0-5]\\d(?:\\.\\d+)?)?`;
82327
+ return regex3;
82305
82328
  }
82306
82329
  __name(timeSource, "timeSource");
82307
82330
  function time(args) {
@@ -82320,8 +82343,8 @@ function datetime(args) {
82320
82343
  }
82321
82344
  __name(datetime, "datetime");
82322
82345
  var string = /* @__PURE__ */ __name((params) => {
82323
- const regex2 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
82324
- return new RegExp(`^${regex2}$`);
82346
+ const regex3 = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
82347
+ return new RegExp(`^${regex3}$`);
82325
82348
  }, "string");
82326
82349
  var bigint = /^-?\d+n?$/;
82327
82350
  var integer = /^-?\d+$/;
@@ -92610,9 +92633,9 @@ var stringProcessor = /* @__PURE__ */ __name((schema, ctx, _json, _params) => {
92610
92633
  json2.pattern = regexes[0].source;
92611
92634
  else if (regexes.length > 1) {
92612
92635
  json2.allOf = [
92613
- ...regexes.map((regex2) => ({
92636
+ ...regexes.map((regex3) => ({
92614
92637
  ...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
92615
- pattern: regex2.source
92638
+ pattern: regex3.source
92616
92639
  }))
92617
92640
  ];
92618
92641
  }
@@ -93952,10 +93975,10 @@ __name(hex2, "hex");
93952
93975
  function hash(alg, params) {
93953
93976
  const enc = params?.enc ?? "hex";
93954
93977
  const format22 = `${alg}_${enc}`;
93955
- const regex2 = regexes_exports[format22];
93956
- if (!regex2)
93978
+ const regex3 = regexes_exports[format22];
93979
+ if (!regex3)
93957
93980
  throw new Error(`Unrecognized hash format: ${format22}`);
93958
- return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, format22, regex2, params);
93981
+ return /* @__PURE__ */ _stringFormat(ZodCustomStringFormat, format22, regex3, params);
93959
93982
  }
93960
93983
  __name(hash, "hash");
93961
93984
  var ZodNumber = /* @__PURE__ */ $constructor("ZodNumber", (inst, def) => {
@@ -95499,9 +95522,24 @@ var getC3CommandFromEnv = getEnvironmentVariableFactory({
95499
95522
  variableName: "WRANGLER_C3_COMMAND",
95500
95523
  defaultValue: /* @__PURE__ */ __name(() => "create cloudflare", "defaultValue")
95501
95524
  });
95502
- var getWranglerSendMetricsFromEnv = getBooleanEnvironmentVariableFactory({
95525
+ var getDoNotTrackFromEnv = getEnvironmentVariableFactory({
95526
+ variableName: "DO_NOT_TRACK"
95527
+ });
95528
+ function isDoNotTrackEnabled() {
95529
+ const value = getDoNotTrackFromEnv()?.toLowerCase();
95530
+ return value === "1" || value === "true";
95531
+ }
95532
+ __name(isDoNotTrackEnabled, "isDoNotTrackEnabled");
95533
+ var getWranglerSendMetricsVariableFromEnv = getBooleanEnvironmentVariableFactory({
95503
95534
  variableName: "WRANGLER_SEND_METRICS"
95504
95535
  });
95536
+ function getWranglerSendMetricsFromEnv() {
95537
+ if (isDoNotTrackEnabled()) {
95538
+ return false;
95539
+ }
95540
+ return getWranglerSendMetricsVariableFromEnv();
95541
+ }
95542
+ __name(getWranglerSendMetricsFromEnv, "getWranglerSendMetricsFromEnv");
95505
95543
  var getWranglerSendErrorReportsFromEnv = getBooleanEnvironmentVariableFactory({
95506
95544
  variableName: "WRANGLER_SEND_ERROR_REPORTS",
95507
95545
  defaultValue: false
@@ -103716,8 +103754,8 @@ var warn = (msg, { shape = shapes.corners.bl, multiline = false, newlineBefore =
103716
103754
  };
103717
103755
  var stripAnsi = (str) => {
103718
103756
  const pattern = ["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)", "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");
103719
- const regex2 = RegExp(pattern, "g");
103720
- return str.replace(linkRegex, "$2").replace(regex2, "");
103757
+ const regex3 = RegExp(pattern, "g");
103758
+ return str.replace(linkRegex, "$2").replace(regex3, "");
103721
103759
  };
103722
103760
  var linkRegex = /\u001B\]8;;(?<url>.+)\u001B\\(?<label>.+)\u001B\]8;;\u001B\\/g;
103723
103761
  var hyperlink = (url2, label = url2) => {
@@ -104602,21 +104640,24 @@ cliCursor.toggle = (force, writableStream) => {
104602
104640
  };
104603
104641
  var cli_cursor_default = cliCursor;
104604
104642
 
104605
- // ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
104643
+ // ../../node_modules/.pnpm/ansi-regex@6.2.2/node_modules/ansi-regex/index.js
104606
104644
  function ansiRegex({ onlyFirst = false } = {}) {
104607
- const pattern = [
104608
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
104609
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
104610
- ].join("|");
104645
+ const ST = "(?:\\u0007|\\u001B\\u005C|\\u009C)";
104646
+ const osc = `(?:\\u001B\\][\\s\\S]*?${ST})`;
104647
+ const csi = "[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]";
104648
+ const pattern = `${osc}|${csi}`;
104611
104649
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
104612
104650
  }
104613
104651
 
104614
- // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
104652
+ // ../../node_modules/.pnpm/strip-ansi@7.2.0/node_modules/strip-ansi/index.js
104615
104653
  var regex = ansiRegex();
104616
104654
  function stripAnsi2(string4) {
104617
104655
  if (typeof string4 !== "string") {
104618
104656
  throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
104619
104657
  }
104658
+ if (!string4.includes("\x1B") && !string4.includes("\x9B")) {
104659
+ return string4;
104660
+ }
104620
104661
  return string4.replace(regex, "");
104621
104662
  }
104622
104663
 
@@ -105105,6 +105146,24 @@ function sliceAnsi(string4, begin, end) {
105105
105146
  return output;
105106
105147
  }
105107
105148
 
105149
+ // ../../node_modules/.pnpm/ansi-regex@6.0.1/node_modules/ansi-regex/index.js
105150
+ function ansiRegex2({ onlyFirst = false } = {}) {
105151
+ const pattern = [
105152
+ "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
105153
+ "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
105154
+ ].join("|");
105155
+ return new RegExp(pattern, onlyFirst ? void 0 : "g");
105156
+ }
105157
+
105158
+ // ../../node_modules/.pnpm/strip-ansi@7.1.0/node_modules/strip-ansi/index.js
105159
+ var regex2 = ansiRegex2();
105160
+ function stripAnsi3(string4) {
105161
+ if (typeof string4 !== "string") {
105162
+ throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
105163
+ }
105164
+ return string4.replace(regex2, "");
105165
+ }
105166
+
105108
105167
  // ../../node_modules/.pnpm/log-update@5.0.1/node_modules/log-update/index.js
105109
105168
  var defaultTerminalHeight = 24;
105110
105169
  var getWidth = (stream) => {
@@ -105123,7 +105182,7 @@ var fitToTerminalHeight = (stream, text) => {
105123
105182
  }
105124
105183
  return sliceAnsi(
105125
105184
  text,
105126
- stripAnsi2(lines.slice(0, toRemove).join("\n")).length + 1
105185
+ stripAnsi3(lines.slice(0, toRemove).join("\n")).length + 1
105127
105186
  );
105128
105187
  };
105129
105188
  function createLogUpdate(stream, { showCursor: showCursor2 = false } = {}) {
@@ -105877,12 +105936,12 @@ function cliui(opts, _mixin) {
105877
105936
 
105878
105937
  // ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/string-utils.js
105879
105938
  var ansi = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
105880
- function stripAnsi3(str) {
105939
+ function stripAnsi4(str) {
105881
105940
  return str.replace(ansi, "");
105882
105941
  }
105883
105942
  function wrap(str, width) {
105884
105943
  const [start, end] = str.match(ansi) || ["", ""];
105885
- str = stripAnsi3(str);
105944
+ str = stripAnsi4(str);
105886
105945
  let wrapped = "";
105887
105946
  for (let i = 0; i < str.length; i++) {
105888
105947
  if (i !== 0 && i % width === 0) {
@@ -105902,7 +105961,7 @@ function ui(opts) {
105902
105961
  stringWidth: (str) => {
105903
105962
  return [...str].length;
105904
105963
  },
105905
- stripAnsi: stripAnsi3,
105964
+ stripAnsi: stripAnsi4,
105906
105965
  wrap
105907
105966
  });
105908
105967
  }
@@ -110467,7 +110526,7 @@ var Yargs = YargsFactory(esm_default2);
110467
110526
  var yargs_default = Yargs;
110468
110527
 
110469
110528
  // package.json
110470
- var version2 = "2.70.18";
110529
+ var version2 = "2.71.1";
110471
110530
 
110472
110531
  // src/metrics.ts
110473
110532
  var import_node_async_hooks = require("node:async_hooks");
@@ -110789,12 +110848,24 @@ function getPlatform() {
110789
110848
  return `Others: ${platform3}`;
110790
110849
  }
110791
110850
  }
110851
+ function resolveTelemetryStatus() {
110852
+ if (isDoNotTrackEnabled()) {
110853
+ return { enabled: false, source: "DO_NOT_TRACK" };
110854
+ }
110855
+ if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
110856
+ return {
110857
+ enabled: false,
110858
+ source: "CREATE_CLOUDFLARE_TELEMETRY_DISABLED"
110859
+ };
110860
+ }
110861
+ return void 0;
110862
+ }
110792
110863
  function createReporter() {
110793
110864
  const events = [];
110794
110865
  const als = new import_node_async_hooks.AsyncLocalStorage();
110795
110866
  const config50 = readMetricsConfig() ?? {};
110796
110867
  const isFirstUsage = config50.c3permission === void 0;
110797
- const isEnabled = isTelemetryEnabled();
110868
+ const isEnabled = resolveTelemetryStatus()?.enabled ?? (hasSparrowSourceKey() && getC3Permission(config50).enabled);
110798
110869
  const deviceId = getDeviceId(config50);
110799
110870
  const packageManager = detectPackageManager();
110800
110871
  const platform3 = getPlatform();
@@ -110824,12 +110895,6 @@ function createReporter() {
110824
110895
  );
110825
110896
  events.push(request2);
110826
110897
  }
110827
- function isTelemetryEnabled() {
110828
- if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
110829
- return false;
110830
- }
110831
- return hasSparrowSourceKey() && getC3Permission(config50).enabled;
110832
- }
110833
110898
  async function waitForAllEventsSettled() {
110834
110899
  await Promise.allSettled(events);
110835
110900
  }
@@ -110946,18 +111011,27 @@ function updateC3Permission(enabled) {
110946
111011
  config50.c3permission = initializeC3Permission(enabled);
110947
111012
  writeMetricsConfig(config50);
110948
111013
  }
110949
- function logTelemetryStatus(enabled) {
110950
- logRaw(`Status: ${enabled ? "Enabled" : "Disabled"}`);
111014
+ function logTelemetryStatus(enabled, source) {
111015
+ const sourceMessage = source === void 0 ? "" : ` (set by ${source})`;
111016
+ logRaw(`Status: ${enabled ? "Enabled" : "Disabled"}${sourceMessage}`);
110951
111017
  logRaw("");
110952
111018
  }
110953
111019
  var runTelemetryCommand = (action) => {
110954
111020
  switch (action) {
110955
111021
  case "enable": {
110956
111022
  updateC3Permission(true);
110957
- logTelemetryStatus(true);
110958
- logRaw(
110959
- "Create-Cloudflare is now collecting telemetry about your usage. Thank you for helping us improve the experience!"
110960
- );
111023
+ const telemetry = resolveTelemetryStatus();
111024
+ if (telemetry === void 0) {
111025
+ logTelemetryStatus(true);
111026
+ logRaw(
111027
+ "Create-Cloudflare is now collecting telemetry about your usage. Thank you for helping us improve the experience!"
111028
+ );
111029
+ } else {
111030
+ logTelemetryStatus(telemetry.enabled, telemetry.source);
111031
+ logRaw(
111032
+ `Telemetry has been enabled in Create-Cloudflare's global configuration, but remains disabled while ${telemetry.source} is set.`
111033
+ );
111034
+ }
110961
111035
  break;
110962
111036
  }
110963
111037
  case "disable": {
@@ -110967,8 +111041,9 @@ var runTelemetryCommand = (action) => {
110967
111041
  break;
110968
111042
  }
110969
111043
  case "status": {
110970
- const telemetry = getC3Permission();
110971
- logTelemetryStatus(telemetry.enabled);
111044
+ const telemetry = resolveTelemetryStatus();
111045
+ const enabled = telemetry?.enabled ?? getC3Permission().enabled;
111046
+ logTelemetryStatus(enabled, telemetry?.source);
110972
111047
  break;
110973
111048
  }
110974
111049
  }
@@ -113036,18 +113111,18 @@ __name2(getPropertyName, "getPropertyName");
113036
113111
  var package_default = {
113037
113112
  name: "frameworks_clis_info",
113038
113113
  dependencies: {
113039
- "@angular/create": "22.1.2",
113040
- "@tanstack/cli": "0.70.1",
113114
+ "@angular/create": "22.1.3",
113115
+ "@tanstack/cli": "0.70.2",
113041
113116
  "create-analog": "2.6.4",
113042
113117
  "create-astro": "5.2.3",
113043
113118
  "create-docusaurus": "3.10.2",
113044
113119
  "create-hono": "0.19.4",
113045
- "create-next-app": "16.2.12",
113120
+ "create-next-app": "16.3.0",
113046
113121
  "create-qwik": "1.20.0",
113047
113122
  "create-react-router": "8.3.0",
113048
113123
  "create-rwsdk": "3.1.3",
113049
- "create-solid": "0.8.0",
113050
- "create-vike": "0.0.671",
113124
+ "create-solid": "0.8.1",
113125
+ "create-vike": "0.0.673",
113051
113126
  "create-vite": "9.1.2",
113052
113127
  "create-vue": "3.23.0",
113053
113128
  "create-waku": "0.12.5-1.0.0-alpha.10-0",
@@ -115557,7 +115632,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
115557
115632
  var import_node_assert6 = __toESM(require("node:assert"));
115558
115633
 
115559
115634
  // ../wrangler/package.json
115560
- var version3 = "4.120.0";
115635
+ var version3 = "4.122.0";
115561
115636
 
115562
115637
  // src/git.ts
115563
115638
  var offerGit = async (ctx) => {
@@ -115821,8 +115896,8 @@ var isAllowedExistingFile = (file3) => {
115821
115896
  /^yarn-debug\.log/,
115822
115897
  /^yarn-error\.log/
115823
115898
  ];
115824
- for (const regex2 of allowedExistingPatters) {
115825
- if (regex2.test(file3)) {
115899
+ for (const regex3 of allowedExistingPatters) {
115900
+ if (regex3.test(file3)) {
115826
115901
  return true;
115827
115902
  }
115828
115903
  }
@@ -116983,14 +117058,15 @@ var updateWranglerConfig = async (ctx) => {
116983
117058
  "$schema",
116984
117059
  "node_modules/wrangler/config-schema.json"
116985
117060
  );
117061
+ const compatibilityDate = await getCompatibilityDate(
117062
+ wranglerJson.compatibility_date,
117063
+ ctx.project.path
117064
+ );
116986
117065
  wranglerJson = appendJSONProperty(wranglerJson, "name", ctx.project.name);
116987
117066
  wranglerJson = appendJSONProperty(
116988
117067
  wranglerJson,
116989
117068
  "compatibility_date",
116990
- await getCompatibilityDate(
116991
- wranglerJson.compatibility_date,
116992
- ctx.project.path
116993
- )
117069
+ compatibilityDate
116994
117070
  );
116995
117071
  wranglerJson = appendJSONProperty(wranglerJson, "observability", {
116996
117072
  enabled: true
@@ -117001,7 +117077,7 @@ var updateWranglerConfig = async (ctx) => {
117001
117077
  "upload_source_maps",
117002
117078
  true
117003
117079
  );
117004
- wranglerJson = addNodejsCompatFlag(wranglerJson);
117080
+ wranglerJson = applyNodejsCompatFlags(wranglerJson, compatibilityDate);
117005
117081
  }
117006
117082
  addHintsAsJsonComments(wranglerJson);
117007
117083
  writeWranglerJsonOrJsonc(ctx, wranglerJson);
@@ -117012,15 +117088,16 @@ var updateWranglerConfig = async (ctx) => {
117012
117088
  strToml = strToml.replaceAll(key, value);
117013
117089
  }
117014
117090
  const wranglerToml = dist_default4.parse(strToml);
117015
- wranglerToml.name = ctx.project.name;
117016
- wranglerToml.compatibility_date = await getCompatibilityDate(
117091
+ const compatibilityDate = await getCompatibilityDate(
117017
117092
  wranglerToml.compatibility_date,
117018
117093
  ctx.project.path
117019
117094
  );
117095
+ wranglerToml.name = ctx.project.name;
117096
+ wranglerToml.compatibility_date = compatibilityDate;
117020
117097
  wranglerToml.observability ??= { enabled: true };
117021
117098
  if (ctx.args.lang !== "python") {
117022
117099
  wranglerToml.upload_source_maps ??= true;
117023
- addNodejsCompatFlagToToml(wranglerToml);
117100
+ applyNodejsCompatFlagsToToml(wranglerToml, compatibilityDate);
117024
117101
  }
117025
117102
  writeWranglerToml(
117026
117103
  ctx,
@@ -117164,22 +117241,42 @@ function generateHintsAsTomlComments(wranglerConfig) {
117164
117241
  }
117165
117242
  return commentLines.join("\n");
117166
117243
  }
117167
- function addNodejsCompatFlag(wranglerConfig) {
117244
+ var DEFAULT_ON_NODEJS_COMPAT_FLAGS = ["nodejs_compat", "nodejs_compat_v2"];
117245
+ function reconcileNodejsCompatFlags(compatibilityDate, existingFlags) {
117246
+ if (isNodejsCompatDefaultOn(compatibilityDate)) {
117247
+ const flags = existingFlags.filter(
117248
+ (flag) => !DEFAULT_ON_NODEJS_COMPAT_FLAGS.includes(flag)
117249
+ );
117250
+ return flags.length === existingFlags.length ? void 0 : flags;
117251
+ }
117252
+ const alreadyConfigured = existingFlags.some(
117253
+ (flag) => [...DEFAULT_ON_NODEJS_COMPAT_FLAGS, "no_nodejs_compat"].includes(flag)
117254
+ );
117255
+ return alreadyConfigured ? void 0 : ["nodejs_compat", ...existingFlags];
117256
+ }
117257
+ function applyNodejsCompatFlags(wranglerConfig, compatibilityDate) {
117168
117258
  const existingFlags = Array.isArray(wranglerConfig.compatibility_flags) ? wranglerConfig.compatibility_flags : [];
117169
- if (existingFlags.includes("nodejs_compat") || existingFlags.includes("nodejs_compat_v2") || existingFlags.includes("no_nodejs_compat")) {
117259
+ const flags = reconcileNodejsCompatFlags(compatibilityDate, existingFlags);
117260
+ if (flags === void 0) {
117170
117261
  return wranglerConfig;
117171
117262
  }
117172
- return appendJSONProperty(wranglerConfig, "compatibility_flags", [
117173
- "nodejs_compat",
117174
- ...existingFlags
117175
- ]);
117263
+ if (flags.length === 0) {
117264
+ delete wranglerConfig.compatibility_flags;
117265
+ return wranglerConfig;
117266
+ }
117267
+ return appendJSONProperty(wranglerConfig, "compatibility_flags", flags);
117176
117268
  }
117177
- function addNodejsCompatFlagToToml(wranglerConfig) {
117269
+ function applyNodejsCompatFlagsToToml(wranglerConfig, compatibilityDate) {
117178
117270
  const existingFlags = Array.isArray(wranglerConfig.compatibility_flags) ? wranglerConfig.compatibility_flags : [];
117179
- if (existingFlags.includes("nodejs_compat") || existingFlags.includes("nodejs_compat_v2") || existingFlags.includes("no_nodejs_compat")) {
117271
+ const flags = reconcileNodejsCompatFlags(compatibilityDate, existingFlags);
117272
+ if (flags === void 0) {
117273
+ return;
117274
+ }
117275
+ if (flags.length === 0) {
117276
+ delete wranglerConfig.compatibility_flags;
117180
117277
  return;
117181
117278
  }
117182
- wranglerConfig.compatibility_flags = ["nodejs_compat", ...existingFlags];
117279
+ wranglerConfig.compatibility_flags = flags;
117183
117280
  }
117184
117281
 
117185
117282
  // src/deploy.ts
@@ -117419,8 +117516,8 @@ function indentString(string4, count = 1, options = {}) {
117419
117516
  if (count === 0) {
117420
117517
  return string4;
117421
117518
  }
117422
- const regex2 = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
117423
- return string4.replace(regex2, indent2.repeat(count));
117519
+ const regex3 = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
117520
+ return string4.replace(regex3, indent2.repeat(count));
117424
117521
  }
117425
117522
 
117426
117523
  // ../../node_modules/.pnpm/get-east-asian-width@1.2.0/node_modules/get-east-asian-width/lookup.js
@@ -117506,7 +117603,7 @@ var wrapWord3 = (rows, word, columns) => {
117506
117603
  const characters = [...word];
117507
117604
  let isInsideEscape = false;
117508
117605
  let isInsideLinkEscape = false;
117509
- let visible = stringWidth2(stripAnsi2(rows.at(-1)));
117606
+ let visible = stringWidth2(stripAnsi3(rows.at(-1)));
117510
117607
  for (const [index, character] of characters.entries()) {
117511
117608
  const characterLength = stringWidth2(character);
117512
117609
  if (visible + characterLength <= columns) {
@@ -119179,8 +119276,12 @@ var maybeInstallNodeTypes = async (ctx, npm24) => {
119179
119276
  const wranglerTomlStr = readWranglerToml(ctx);
119180
119277
  parsedConfig = dist_default4.parse(wranglerTomlStr);
119181
119278
  }
119182
- const compatibilityFlags = Array.isArray(parsedConfig["compatibility_flags"]) ? parsedConfig["compatibility_flags"] : [];
119183
- if (compatibilityFlags.includes("nodejs_compat") || compatibilityFlags.includes("nodejs_compat_v2")) {
119279
+ const compatibilityFlags = Array.isArray(
119280
+ parsedConfig["compatibility_flags"]
119281
+ ) ? parsedConfig["compatibility_flags"] : [];
119282
+ const compatibilityDate = typeof parsedConfig["compatibility_date"] === "string" ? parsedConfig["compatibility_date"] : "";
119283
+ const { isNodejsCompatEnabled, isNodejsCompatV2Enabled } = resolveNodejsCompat(compatibilityDate, compatibilityFlags);
119284
+ if (isNodejsCompatEnabled || isNodejsCompatV2Enabled) {
119184
119285
  await installPackages2(["@types/node"], {
119185
119286
  dev: true,
119186
119287
  startText: "Installing @types/node",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.70.18",
3
+ "version": "2.71.1",
4
4
  "description": "A CLI for creating and deploying new applications to Cloudflare.",
5
5
  "keywords": [
6
6
  "cloudflare",
@@ -31,7 +31,7 @@
31
31
  "@babel/parser": "^7.21.3",
32
32
  "@babel/types": "^7.21.4",
33
33
  "@clack/prompts": "^1.2.0",
34
- "@cloudflare/workers-types": "^5.20260801.1",
34
+ "@cloudflare/workers-types": "^5.20260811.1",
35
35
  "@types/command-exists": "^1.2.0",
36
36
  "@types/cross-spawn": "^6.0.2",
37
37
  "@types/deepmerge": "^2.2.0",
@@ -71,13 +71,13 @@
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.1.23",
74
75
  "@cloudflare/codemod": "1.1.0",
75
76
  "@cloudflare/mock-npm-registry": "0.0.0",
76
- "@cloudflare/cli-shared-helpers": "0.1.21",
77
- "@cloudflare/vite-plugin": "1.51.1",
77
+ "@cloudflare/vite-plugin": "1.52.0",
78
78
  "@cloudflare/workers-tsconfig": "0.0.0",
79
- "@cloudflare/workers-utils": "0.31.2",
80
- "wrangler": "4.120.0"
79
+ "@cloudflare/workers-utils": "0.33.0",
80
+ "wrangler": "4.122.0"
81
81
  },
82
82
  "engines": {
83
83
  "node": ">=22.0.0"
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "name": "<WORKER_NAME>",
3
3
  "compatibility_date": "<COMPATIBILITY_DATE>",
4
- "compatibility_flags": [
5
- "nodejs_compat"
6
- ],
7
4
  "pages_build_output_dir": "./dist"
8
5
  }
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "name": "<WORKER_NAME>",
3
3
  "compatibility_date": "<COMPATIBILITY_DATE>",
4
- "compatibility_flags": [
5
- "nodejs_compat"
6
- ],
7
4
  "pages_build_output_dir": "./dist"
8
5
  }
@@ -3,7 +3,6 @@
3
3
  "main": "src/index.js",
4
4
  "compatibility_date": "<COMPATIBILITY_DATE>",
5
5
  "compatibility_flags": [
6
- "nodejs_compat",
7
6
  "global_fetch_strictly_public"
8
7
  ],
9
8
  "assets": {
@@ -1,8 +1,5 @@
1
1
  {
2
2
  "name": "<WORKER_NAME>",
3
3
  "compatibility_date": "<COMPATIBILITY_DATE>",
4
- "compatibility_flags": [
5
- "nodejs_compat"
6
- ],
7
4
  "pages_build_output_dir": "./dist"
8
5
  }
@@ -3,7 +3,6 @@
3
3
  "main": "./dist/_worker.js",
4
4
  "compatibility_date": "<COMPATIBILITY_DATE>",
5
5
  "compatibility_flags": [
6
- "nodejs_compat",
7
6
  "global_fetch_strictly_public"
8
7
  ],
9
8
  "assets": {
@@ -1,9 +1,6 @@
1
1
  {
2
2
  "name": "<WORKER_NAME>",
3
3
  "compatibility_date": "<COMPATIBILITY_DATE>",
4
- "compatibility_flags": [
5
- "nodejs_compat"
6
- ],
7
4
  "observability": {
8
5
  "enabled": true
9
6
  }