create-cloudflare 2.71.0 → 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) => {
@@ -103731,8 +103754,8 @@ var warn = (msg, { shape = shapes.corners.bl, multiline = false, newlineBefore =
103731
103754
  };
103732
103755
  var stripAnsi = (str) => {
103733
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("|");
103734
- const regex2 = RegExp(pattern, "g");
103735
- return str.replace(linkRegex, "$2").replace(regex2, "");
103757
+ const regex3 = RegExp(pattern, "g");
103758
+ return str.replace(linkRegex, "$2").replace(regex3, "");
103736
103759
  };
103737
103760
  var linkRegex = /\u001B\]8;;(?<url>.+)\u001B\\(?<label>.+)\u001B\]8;;\u001B\\/g;
103738
103761
  var hyperlink = (url2, label = url2) => {
@@ -104617,21 +104640,24 @@ cliCursor.toggle = (force, writableStream) => {
104617
104640
  };
104618
104641
  var cli_cursor_default = cliCursor;
104619
104642
 
104620
- // ../../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
104621
104644
  function ansiRegex({ onlyFirst = false } = {}) {
104622
- const pattern = [
104623
- "[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)",
104624
- "(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"
104625
- ].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}`;
104626
104649
  return new RegExp(pattern, onlyFirst ? void 0 : "g");
104627
104650
  }
104628
104651
 
104629
- // ../../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
104630
104653
  var regex = ansiRegex();
104631
104654
  function stripAnsi2(string4) {
104632
104655
  if (typeof string4 !== "string") {
104633
104656
  throw new TypeError(`Expected a \`string\`, got \`${typeof string4}\``);
104634
104657
  }
104658
+ if (!string4.includes("\x1B") && !string4.includes("\x9B")) {
104659
+ return string4;
104660
+ }
104635
104661
  return string4.replace(regex, "");
104636
104662
  }
104637
104663
 
@@ -105120,6 +105146,24 @@ function sliceAnsi(string4, begin, end) {
105120
105146
  return output;
105121
105147
  }
105122
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
+
105123
105167
  // ../../node_modules/.pnpm/log-update@5.0.1/node_modules/log-update/index.js
105124
105168
  var defaultTerminalHeight = 24;
105125
105169
  var getWidth = (stream) => {
@@ -105138,7 +105182,7 @@ var fitToTerminalHeight = (stream, text) => {
105138
105182
  }
105139
105183
  return sliceAnsi(
105140
105184
  text,
105141
- stripAnsi2(lines.slice(0, toRemove).join("\n")).length + 1
105185
+ stripAnsi3(lines.slice(0, toRemove).join("\n")).length + 1
105142
105186
  );
105143
105187
  };
105144
105188
  function createLogUpdate(stream, { showCursor: showCursor2 = false } = {}) {
@@ -105892,12 +105936,12 @@ function cliui(opts, _mixin) {
105892
105936
 
105893
105937
  // ../../node_modules/.pnpm/cliui@8.0.1/node_modules/cliui/build/lib/string-utils.js
105894
105938
  var ansi = new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)", "g");
105895
- function stripAnsi3(str) {
105939
+ function stripAnsi4(str) {
105896
105940
  return str.replace(ansi, "");
105897
105941
  }
105898
105942
  function wrap(str, width) {
105899
105943
  const [start, end] = str.match(ansi) || ["", ""];
105900
- str = stripAnsi3(str);
105944
+ str = stripAnsi4(str);
105901
105945
  let wrapped = "";
105902
105946
  for (let i = 0; i < str.length; i++) {
105903
105947
  if (i !== 0 && i % width === 0) {
@@ -105917,7 +105961,7 @@ function ui(opts) {
105917
105961
  stringWidth: (str) => {
105918
105962
  return [...str].length;
105919
105963
  },
105920
- stripAnsi: stripAnsi3,
105964
+ stripAnsi: stripAnsi4,
105921
105965
  wrap
105922
105966
  });
105923
105967
  }
@@ -110482,7 +110526,7 @@ var Yargs = YargsFactory(esm_default2);
110482
110526
  var yargs_default = Yargs;
110483
110527
 
110484
110528
  // package.json
110485
- var version2 = "2.71.0";
110529
+ var version2 = "2.71.1";
110486
110530
 
110487
110531
  // src/metrics.ts
110488
110532
  var import_node_async_hooks = require("node:async_hooks");
@@ -115588,7 +115632,7 @@ If the application uses Durable Objects or Workflows, refer to the relevant best
115588
115632
  var import_node_assert6 = __toESM(require("node:assert"));
115589
115633
 
115590
115634
  // ../wrangler/package.json
115591
- var version3 = "4.121.0";
115635
+ var version3 = "4.122.0";
115592
115636
 
115593
115637
  // src/git.ts
115594
115638
  var offerGit = async (ctx) => {
@@ -115852,8 +115896,8 @@ var isAllowedExistingFile = (file3) => {
115852
115896
  /^yarn-debug\.log/,
115853
115897
  /^yarn-error\.log/
115854
115898
  ];
115855
- for (const regex2 of allowedExistingPatters) {
115856
- if (regex2.test(file3)) {
115899
+ for (const regex3 of allowedExistingPatters) {
115900
+ if (regex3.test(file3)) {
115857
115901
  return true;
115858
115902
  }
115859
115903
  }
@@ -117014,14 +117058,15 @@ var updateWranglerConfig = async (ctx) => {
117014
117058
  "$schema",
117015
117059
  "node_modules/wrangler/config-schema.json"
117016
117060
  );
117061
+ const compatibilityDate = await getCompatibilityDate(
117062
+ wranglerJson.compatibility_date,
117063
+ ctx.project.path
117064
+ );
117017
117065
  wranglerJson = appendJSONProperty(wranglerJson, "name", ctx.project.name);
117018
117066
  wranglerJson = appendJSONProperty(
117019
117067
  wranglerJson,
117020
117068
  "compatibility_date",
117021
- await getCompatibilityDate(
117022
- wranglerJson.compatibility_date,
117023
- ctx.project.path
117024
- )
117069
+ compatibilityDate
117025
117070
  );
117026
117071
  wranglerJson = appendJSONProperty(wranglerJson, "observability", {
117027
117072
  enabled: true
@@ -117032,7 +117077,7 @@ var updateWranglerConfig = async (ctx) => {
117032
117077
  "upload_source_maps",
117033
117078
  true
117034
117079
  );
117035
- wranglerJson = addNodejsCompatFlag(wranglerJson);
117080
+ wranglerJson = applyNodejsCompatFlags(wranglerJson, compatibilityDate);
117036
117081
  }
117037
117082
  addHintsAsJsonComments(wranglerJson);
117038
117083
  writeWranglerJsonOrJsonc(ctx, wranglerJson);
@@ -117043,15 +117088,16 @@ var updateWranglerConfig = async (ctx) => {
117043
117088
  strToml = strToml.replaceAll(key, value);
117044
117089
  }
117045
117090
  const wranglerToml = dist_default4.parse(strToml);
117046
- wranglerToml.name = ctx.project.name;
117047
- wranglerToml.compatibility_date = await getCompatibilityDate(
117091
+ const compatibilityDate = await getCompatibilityDate(
117048
117092
  wranglerToml.compatibility_date,
117049
117093
  ctx.project.path
117050
117094
  );
117095
+ wranglerToml.name = ctx.project.name;
117096
+ wranglerToml.compatibility_date = compatibilityDate;
117051
117097
  wranglerToml.observability ??= { enabled: true };
117052
117098
  if (ctx.args.lang !== "python") {
117053
117099
  wranglerToml.upload_source_maps ??= true;
117054
- addNodejsCompatFlagToToml(wranglerToml);
117100
+ applyNodejsCompatFlagsToToml(wranglerToml, compatibilityDate);
117055
117101
  }
117056
117102
  writeWranglerToml(
117057
117103
  ctx,
@@ -117195,22 +117241,42 @@ function generateHintsAsTomlComments(wranglerConfig) {
117195
117241
  }
117196
117242
  return commentLines.join("\n");
117197
117243
  }
117198
- 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) {
117199
117258
  const existingFlags = Array.isArray(wranglerConfig.compatibility_flags) ? wranglerConfig.compatibility_flags : [];
117200
- 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) {
117201
117261
  return wranglerConfig;
117202
117262
  }
117203
- return appendJSONProperty(wranglerConfig, "compatibility_flags", [
117204
- "nodejs_compat",
117205
- ...existingFlags
117206
- ]);
117263
+ if (flags.length === 0) {
117264
+ delete wranglerConfig.compatibility_flags;
117265
+ return wranglerConfig;
117266
+ }
117267
+ return appendJSONProperty(wranglerConfig, "compatibility_flags", flags);
117207
117268
  }
117208
- function addNodejsCompatFlagToToml(wranglerConfig) {
117269
+ function applyNodejsCompatFlagsToToml(wranglerConfig, compatibilityDate) {
117209
117270
  const existingFlags = Array.isArray(wranglerConfig.compatibility_flags) ? wranglerConfig.compatibility_flags : [];
117210
- 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;
117211
117277
  return;
117212
117278
  }
117213
- wranglerConfig.compatibility_flags = ["nodejs_compat", ...existingFlags];
117279
+ wranglerConfig.compatibility_flags = flags;
117214
117280
  }
117215
117281
 
117216
117282
  // src/deploy.ts
@@ -117450,8 +117516,8 @@ function indentString(string4, count = 1, options = {}) {
117450
117516
  if (count === 0) {
117451
117517
  return string4;
117452
117518
  }
117453
- const regex2 = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
117454
- return string4.replace(regex2, indent2.repeat(count));
117519
+ const regex3 = includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
117520
+ return string4.replace(regex3, indent2.repeat(count));
117455
117521
  }
117456
117522
 
117457
117523
  // ../../node_modules/.pnpm/get-east-asian-width@1.2.0/node_modules/get-east-asian-width/lookup.js
@@ -117537,7 +117603,7 @@ var wrapWord3 = (rows, word, columns) => {
117537
117603
  const characters = [...word];
117538
117604
  let isInsideEscape = false;
117539
117605
  let isInsideLinkEscape = false;
117540
- let visible = stringWidth2(stripAnsi2(rows.at(-1)));
117606
+ let visible = stringWidth2(stripAnsi3(rows.at(-1)));
117541
117607
  for (const [index, character] of characters.entries()) {
117542
117608
  const characterLength = stringWidth2(character);
117543
117609
  if (visible + characterLength <= columns) {
@@ -119210,8 +119276,12 @@ var maybeInstallNodeTypes = async (ctx, npm24) => {
119210
119276
  const wranglerTomlStr = readWranglerToml(ctx);
119211
119277
  parsedConfig = dist_default4.parse(wranglerTomlStr);
119212
119278
  }
119213
- const compatibilityFlags = Array.isArray(parsedConfig["compatibility_flags"]) ? parsedConfig["compatibility_flags"] : [];
119214
- 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) {
119215
119285
  await installPackages2(["@types/node"], {
119216
119286
  dev: true,
119217
119287
  startText: "Installing @types/node",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-cloudflare",
3
- "version": "2.71.0",
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.20260804.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.22",
74
+ "@cloudflare/cli-shared-helpers": "0.1.23",
75
75
  "@cloudflare/codemod": "1.1.0",
76
76
  "@cloudflare/mock-npm-registry": "0.0.0",
77
- "@cloudflare/vite-plugin": "1.51.3",
77
+ "@cloudflare/vite-plugin": "1.52.0",
78
78
  "@cloudflare/workers-tsconfig": "0.0.0",
79
- "@cloudflare/workers-utils": "0.32.0",
80
- "wrangler": "4.121.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
  }