create-cloudflare 2.40.1 → 2.40.3

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 (33) hide show
  1. package/dist/cli.js +530 -475
  2. package/package.json +4 -4
  3. package/templates/hello-world/js/package.json +2 -2
  4. package/templates/hello-world/ts/package.json +2 -2
  5. package/templates/react/c3.ts +5 -57
  6. package/templates/react/pages/c3.ts +62 -0
  7. package/{templates-experimental/react → templates/react/workers}/c3.ts +4 -3
  8. package/{templates-experimental/react → templates/react/workers}/ts/api/index.ts +0 -4
  9. package/{templates-experimental/react → templates/react/workers}/ts/tsconfig.worker.json +1 -1
  10. package/templates/react/workers/ts/worker-configuration.d.ts +5 -0
  11. package/templates-experimental/hello-world-with-assets/js/package.json +2 -2
  12. package/templates-experimental/hello-world-with-assets/ts/package.json +2 -2
  13. package/templates-experimental/vue/c3.ts +69 -4
  14. package/templates-experimental/vue/js/server/index.js +13 -0
  15. package/templates-experimental/vue/js/src/App.vue +107 -0
  16. package/templates-experimental/vue/js/src/components/HelloWorld.vue +47 -0
  17. package/templates-experimental/vue/js/vite.config.js +21 -0
  18. package/templates-experimental/vue/js/wrangler.jsonc +12 -0
  19. package/templates-experimental/vue/ts/server/index.ts +13 -0
  20. package/templates-experimental/vue/ts/src/App.vue +107 -0
  21. package/templates-experimental/vue/ts/src/components/HelloWorld.vue +44 -0
  22. package/templates-experimental/vue/ts/tsconfig.worker.json +8 -0
  23. package/templates-experimental/vue/ts/vite.config.ts +21 -0
  24. package/templates-experimental/vue/ts/worker-configuration.d.ts +6 -0
  25. package/templates-experimental/vue/ts/wrangler.jsonc +12 -0
  26. package/templates-experimental/vue/templates/wrangler.jsonc +0 -10
  27. /package/{templates-experimental/react → templates/react/workers}/js/api/index.js +0 -0
  28. /package/{templates-experimental/react → templates/react/workers}/js/src/App.jsx +0 -0
  29. /package/{templates-experimental/react → templates/react/workers}/js/src/assets/Cloudflare_Logo.svg +0 -0
  30. /package/{templates-experimental/react/js/wrangler.json → templates/react/workers/js/wrangler.jsonc} +0 -0
  31. /package/{templates-experimental/react → templates/react/workers}/ts/src/App.tsx +0 -0
  32. /package/{templates-experimental/react → templates/react/workers}/ts/src/assets/Cloudflare_Logo.svg +0 -0
  33. /package/{templates-experimental/react/ts/wrangler.json → templates/react/workers/ts/wrangler.jsonc} +0 -0
package/dist/cli.js CHANGED
@@ -573,7 +573,7 @@ var require_XDGAppPaths = __commonJS({
573
573
  XDGAppPaths.cache = function cache(dirOptions) {
574
574
  return path6.join(xdg.cache(), finalPathSegment(dirOptions));
575
575
  };
576
- XDGAppPaths.config = function config29(dirOptions) {
576
+ XDGAppPaths.config = function config30(dirOptions) {
577
577
  return path6.join(xdg.config(), finalPathSegment(dirOptions));
578
578
  };
579
579
  XDGAppPaths.data = function data(dirOptions) {
@@ -630,7 +630,7 @@ var require_XDG = __commonJS({
630
630
  var cache = function() {
631
631
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
632
632
  };
633
- var config29 = function() {
633
+ var config30 = function() {
634
634
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
635
635
  };
636
636
  var data = function() {
@@ -642,13 +642,13 @@ var require_XDG = __commonJS({
642
642
  var state = function() {
643
643
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
644
644
  };
645
- return { cache, config: config29, data, runtime, state };
645
+ return { cache, config: config30, data, runtime, state };
646
646
  };
647
647
  var macos = function() {
648
648
  var cache = function() {
649
649
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
650
650
  };
651
- var config29 = function() {
651
+ var config30 = function() {
652
652
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
653
653
  };
654
654
  var data = function() {
@@ -660,7 +660,7 @@ var require_XDG = __commonJS({
660
660
  var state = function() {
661
661
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
662
662
  };
663
- return { cache, config: config29, data, runtime, state };
663
+ return { cache, config: config30, data, runtime, state };
664
664
  };
665
665
  var windows = function() {
666
666
  function appData() {
@@ -672,7 +672,7 @@ var require_XDG = __commonJS({
672
672
  var cache = function() {
673
673
  return valOrPath(env3.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
674
674
  };
675
- var config29 = function() {
675
+ var config30 = function() {
676
676
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
677
677
  };
678
678
  var data = function() {
@@ -684,7 +684,7 @@ var require_XDG = __commonJS({
684
684
  var state = function() {
685
685
  return valOrPath(env3.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
686
686
  };
687
- return { cache, config: config29, data, runtime, state };
687
+ return { cache, config: config30, data, runtime, state };
688
688
  };
689
689
  var XDG_ = function() {
690
690
  function XDG_2() {
@@ -31619,22 +31619,22 @@ var require_dist_web = __commonJS({
31619
31619
  _createClass(Haikunator3, [{
31620
31620
  key: "haikunate",
31621
31621
  value: function haikunate(options) {
31622
- var config29 = (0, _lodash["default"])(options, this.config);
31623
- if (config29.tokenHex === true) {
31624
- config29.tokenChars = "0123456789abcdef";
31622
+ var config30 = (0, _lodash["default"])(options, this.config);
31623
+ if (config30.tokenHex === true) {
31624
+ config30.tokenChars = "0123456789abcdef";
31625
31625
  }
31626
31626
  var adjective = this._randomElement(this.adjectives);
31627
31627
  var noun = this._randomElement(this.nouns);
31628
- if (!config29.tokenLength)
31629
- config29.tokenLength = 0;
31628
+ if (!config30.tokenLength)
31629
+ config30.tokenLength = 0;
31630
31630
  var token = "";
31631
- for (var i = 0; i < config29.tokenLength; i++) {
31632
- token += this._randomElement(config29.tokenChars);
31631
+ for (var i = 0; i < config30.tokenLength; i++) {
31632
+ token += this._randomElement(config30.tokenChars);
31633
31633
  }
31634
31634
  var sections = [adjective, noun, token];
31635
31635
  return sections.filter(function(e) {
31636
31636
  return !!e;
31637
- }).join(config29.delimiter);
31637
+ }).join(config30.delimiter);
31638
31638
  }
31639
31639
  /**
31640
31640
  * Get a random element from an array/string
@@ -40191,13 +40191,13 @@ var require_esprima = __commonJS({
40191
40191
  return Reader2;
40192
40192
  }();
40193
40193
  var Tokenizer = function() {
40194
- function Tokenizer2(code, config29) {
40194
+ function Tokenizer2(code, config30) {
40195
40195
  this.errorHandler = new error_handler_1.ErrorHandler();
40196
- this.errorHandler.tolerant = config29 ? typeof config29.tolerant === "boolean" && config29.tolerant : false;
40196
+ this.errorHandler.tolerant = config30 ? typeof config30.tolerant === "boolean" && config30.tolerant : false;
40197
40197
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
40198
- this.scanner.trackComment = config29 ? typeof config29.comment === "boolean" && config29.comment : false;
40199
- this.trackRange = config29 ? typeof config29.range === "boolean" && config29.range : false;
40200
- this.trackLoc = config29 ? typeof config29.loc === "boolean" && config29.loc : false;
40198
+ this.scanner.trackComment = config30 ? typeof config30.comment === "boolean" && config30.comment : false;
40199
+ this.trackRange = config30 ? typeof config30.range === "boolean" && config30.range : false;
40200
+ this.trackLoc = config30 ? typeof config30.loc === "boolean" && config30.loc : false;
40201
40201
  this.buffer = [];
40202
40202
  this.reader = new Reader();
40203
40203
  }
@@ -50020,11 +50020,11 @@ var require_printer = __commonJS({
50020
50020
  return this.code;
50021
50021
  };
50022
50022
  var emptyPrintResult = new PrintResult("");
50023
- var Printer = function Printer2(config29) {
50023
+ var Printer = function Printer2(config30) {
50024
50024
  assert_1.default.ok(this instanceof Printer2);
50025
- var explicitTabWidth = config29 && config29.tabWidth;
50026
- config29 = options_1.normalize(config29);
50027
- config29.sourceFileName = null;
50025
+ var explicitTabWidth = config30 && config30.tabWidth;
50026
+ config30 = options_1.normalize(config30);
50027
+ config30.sourceFileName = null;
50028
50028
  function makePrintFunctionWith(options, overrides) {
50029
50029
  options = Object.assign({}, options, overrides);
50030
50030
  return function(path6) {
@@ -50039,11 +50039,11 @@ var require_printer = __commonJS({
50039
50039
  includeComments: false
50040
50040
  }));
50041
50041
  }
50042
- var oldTabWidth = config29.tabWidth;
50042
+ var oldTabWidth = config30.tabWidth;
50043
50043
  if (!explicitTabWidth) {
50044
50044
  var loc = path6.getNode().loc;
50045
50045
  if (loc && loc.lines && loc.lines.guessTabWidth) {
50046
- config29.tabWidth = loc.lines.guessTabWidth();
50046
+ config30.tabWidth = loc.lines.guessTabWidth();
50047
50047
  }
50048
50048
  }
50049
50049
  var reprinter = patcher_1.getReprinter(path6);
@@ -50057,11 +50057,11 @@ var require_printer = __commonJS({
50057
50057
  // right choice because it gives us the opportunity to reprint
50058
50058
  // such nodes using their original source.
50059
50059
  reprinter(print2)
50060
- ) : genericPrint(path6, config29, options, makePrintFunctionWith(options, {
50060
+ ) : genericPrint(path6, config30, options, makePrintFunctionWith(options, {
50061
50061
  includeComments: true,
50062
50062
  avoidRootParens: false
50063
50063
  }));
50064
- config29.tabWidth = oldTabWidth;
50064
+ config30.tabWidth = oldTabWidth;
50065
50065
  return lines;
50066
50066
  }
50067
50067
  this.print = function(ast) {
@@ -50072,7 +50072,7 @@ var require_printer = __commonJS({
50072
50072
  includeComments: true,
50073
50073
  avoidRootParens: false
50074
50074
  });
50075
- return new PrintResult(lines.toString(config29), util.composeSourceMaps(config29.inputSourceMap, lines.getSourceMap(config29.sourceMapName, config29.sourceRoot)));
50075
+ return new PrintResult(lines.toString(config30), util.composeSourceMaps(config30.inputSourceMap, lines.getSourceMap(config30.sourceMapName, config30.sourceRoot)));
50076
50076
  };
50077
50077
  this.printGenerically = function(ast) {
50078
50078
  if (!ast) {
@@ -50080,26 +50080,26 @@ var require_printer = __commonJS({
50080
50080
  }
50081
50081
  function printGenerically(path7) {
50082
50082
  return comments_1.printComments(path7, function(path8) {
50083
- return genericPrint(path8, config29, {
50083
+ return genericPrint(path8, config30, {
50084
50084
  includeComments: true,
50085
50085
  avoidRootParens: false
50086
50086
  }, printGenerically);
50087
50087
  });
50088
50088
  }
50089
50089
  var path6 = fast_path_1.default.from(ast);
50090
- var oldReuseWhitespace = config29.reuseWhitespace;
50091
- config29.reuseWhitespace = false;
50092
- var pr = new PrintResult(printGenerically(path6).toString(config29));
50093
- config29.reuseWhitespace = oldReuseWhitespace;
50090
+ var oldReuseWhitespace = config30.reuseWhitespace;
50091
+ config30.reuseWhitespace = false;
50092
+ var pr = new PrintResult(printGenerically(path6).toString(config30));
50093
+ config30.reuseWhitespace = oldReuseWhitespace;
50094
50094
  return pr;
50095
50095
  };
50096
50096
  };
50097
50097
  exports2.Printer = Printer;
50098
- function genericPrint(path6, config29, options, printPath) {
50098
+ function genericPrint(path6, config30, options, printPath) {
50099
50099
  assert_1.default.ok(path6 instanceof fast_path_1.default);
50100
50100
  var node = path6.getValue();
50101
50101
  var parts = [];
50102
- var linesWithoutParens = genericPrintNoParens(path6, config29, printPath);
50102
+ var linesWithoutParens = genericPrintNoParens(path6, config30, printPath);
50103
50103
  if (!node || linesWithoutParens.isEmpty()) {
50104
50104
  return linesWithoutParens;
50105
50105
  }
@@ -69790,33 +69790,33 @@ var inputPrompt = async (promptConfig) => {
69790
69790
  }
69791
69791
  return input;
69792
69792
  };
69793
- var renderSubmit = (config29, value) => {
69794
- const { question, label } = config29;
69795
- if (config29.type !== "confirm" && !value) {
69793
+ var renderSubmit = (config30, value) => {
69794
+ const { question, label } = config30;
69795
+ if (config30.type !== "confirm" && !value) {
69796
69796
  return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
69797
69797
  }
69798
- const content = config29.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69798
+ const content = config30.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69799
69799
  return [`${leftT} ${question}`, content, `${grayBar}`];
69800
69800
  };
69801
- var getRenderers = (config29) => {
69802
- switch (config29.type) {
69801
+ var getRenderers = (config30) => {
69802
+ switch (config30.type) {
69803
69803
  case "select":
69804
- return getSelectRenderers(config29);
69804
+ return getSelectRenderers(config30);
69805
69805
  case "confirm":
69806
- return getConfirmRenderers(config29);
69806
+ return getConfirmRenderers(config30);
69807
69807
  case "text":
69808
- return getTextRenderers(config29);
69808
+ return getTextRenderers(config30);
69809
69809
  case "multiselect":
69810
- return getSelectRenderers(config29);
69810
+ return getSelectRenderers(config30);
69811
69811
  case "list":
69812
- return getSelectListRenderers(config29);
69812
+ return getSelectListRenderers(config30);
69813
69813
  }
69814
69814
  };
69815
- var getTextRenderers = (config29) => {
69816
- const { question } = config29;
69817
- const helpText = config29.helpText ?? "";
69818
- const format5 = config29.format ?? ((val) => String(val));
69819
- const defaultValue = config29.defaultValue?.toString() ?? "";
69815
+ var getTextRenderers = (config30) => {
69816
+ const { question } = config30;
69817
+ const helpText = config30.helpText ?? "";
69818
+ const format5 = config30.format ?? ((val) => String(val));
69819
+ const defaultValue = config30.defaultValue?.toString() ?? "";
69820
69820
  const activeRenderer = ({ value }) => [
69821
69821
  `${blCorner} ${bold(question)} ${dim(helpText)}`,
69822
69822
  `${space(2)}${format5(value || dim(defaultValue))}`,
@@ -69839,14 +69839,14 @@ var getTextRenderers = (config29) => {
69839
69839
  ``
69840
69840
  // extra line for readability
69841
69841
  ],
69842
- submit: ({ value }) => renderSubmit(config29, format5(value ?? "")),
69842
+ submit: ({ value }) => renderSubmit(config30, format5(value ?? "")),
69843
69843
  cancel: activeRenderer
69844
69844
  };
69845
69845
  };
69846
- var getSelectRenderers = (config29) => {
69847
- const { options, question, helpText: _helpText } = config29;
69846
+ var getSelectRenderers = (config30) => {
69847
+ const { options, question, helpText: _helpText } = config30;
69848
69848
  const helpText = _helpText ?? "";
69849
- const maxItemsPerPage = config29.maxItemsPerPage ?? 32;
69849
+ const maxItemsPerPage = config30.maxItemsPerPage ?? 32;
69850
69850
  const defaultRenderer = ({ cursor = 0, value }) => {
69851
69851
  const renderOption = (opt, i) => {
69852
69852
  const { label: optionLabel, value: optionValue } = opt;
@@ -69921,21 +69921,21 @@ ${space(2)}${dim("...")}` : ""}`,
69921
69921
  submit: ({ value }) => {
69922
69922
  if (Array.isArray(value)) {
69923
69923
  return renderSubmit(
69924
- config29,
69924
+ config30,
69925
69925
  options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
69926
69926
  );
69927
69927
  }
69928
69928
  return renderSubmit(
69929
- config29,
69929
+ config30,
69930
69930
  options.find((o) => o.value === value)?.label
69931
69931
  );
69932
69932
  },
69933
69933
  cancel: defaultRenderer
69934
69934
  };
69935
69935
  };
69936
- var getSelectListRenderers = (config29) => {
69937
- const { question, helpText: _helpText } = config29;
69938
- let options = config29.options;
69936
+ var getSelectListRenderers = (config30) => {
69937
+ const { question, helpText: _helpText } = config30;
69938
+ let options = config30.options;
69939
69939
  const helpText = _helpText ?? "";
69940
69940
  const { rows } = stdout;
69941
69941
  const defaultRenderer = ({ cursor, value }, prompt) => {
@@ -70016,20 +70016,20 @@ var getSelectListRenderers = (config29) => {
70016
70016
  submit: ({ value }) => {
70017
70017
  if (Array.isArray(value)) {
70018
70018
  return renderSubmit(
70019
- config29,
70019
+ config30,
70020
70020
  options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
70021
70021
  );
70022
70022
  }
70023
70023
  return renderSubmit(
70024
- config29,
70024
+ config30,
70025
70025
  options.find((o) => o.value === value)?.value
70026
70026
  );
70027
70027
  },
70028
70028
  cancel: defaultRenderer
70029
70029
  };
70030
70030
  };
70031
- var getConfirmRenderers = (config29) => {
70032
- const { activeText, inactiveText, question, helpText: _helpText } = config29;
70031
+ var getConfirmRenderers = (config30) => {
70032
+ const { activeText, inactiveText, question, helpText: _helpText } = config30;
70033
70033
  const helpText = _helpText ?? "";
70034
70034
  const active = activeText || "Yes";
70035
70035
  const inactive = inactiveText || "No";
@@ -70046,7 +70046,7 @@ var getConfirmRenderers = (config29) => {
70046
70046
  active: defaultRenderer,
70047
70047
  confirm: defaultRenderer,
70048
70048
  error: defaultRenderer,
70049
- submit: ({ value }) => renderSubmit(config29, value ? "yes" : "no"),
70049
+ submit: ({ value }) => renderSubmit(config30, value ? "yes" : "no"),
70050
70050
  cancel: defaultRenderer
70051
70051
  };
70052
70052
  };
@@ -71016,23 +71016,23 @@ var YargsParser = class {
71016
71016
  const configPath = argv2[configKey] || configLookup[configKey];
71017
71017
  if (configPath) {
71018
71018
  try {
71019
- let config29 = null;
71019
+ let config30 = null;
71020
71020
  const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
71021
71021
  const resolveConfig = flags.configs[configKey];
71022
71022
  if (typeof resolveConfig === "function") {
71023
71023
  try {
71024
- config29 = resolveConfig(resolvedConfigPath);
71024
+ config30 = resolveConfig(resolvedConfigPath);
71025
71025
  } catch (e) {
71026
- config29 = e;
71026
+ config30 = e;
71027
71027
  }
71028
- if (config29 instanceof Error) {
71029
- error2 = config29;
71028
+ if (config30 instanceof Error) {
71029
+ error2 = config30;
71030
71030
  return;
71031
71031
  }
71032
71032
  } else {
71033
- config29 = mixin2.require(resolvedConfigPath);
71033
+ config30 = mixin2.require(resolvedConfigPath);
71034
71034
  }
71035
- setConfigObject(config29);
71035
+ setConfigObject(config30);
71036
71036
  } catch (ex) {
71037
71037
  if (ex.name === "PermissionDenied")
71038
71038
  error2 = ex;
@@ -71042,9 +71042,9 @@ var YargsParser = class {
71042
71042
  }
71043
71043
  });
71044
71044
  }
71045
- function setConfigObject(config29, prev) {
71046
- Object.keys(config29).forEach(function(key) {
71047
- const value = config29[key];
71045
+ function setConfigObject(config30, prev) {
71046
+ Object.keys(config30).forEach(function(key) {
71047
+ const value = config30[key];
71048
71048
  const fullKey = prev ? prev + "." + key : key;
71049
71049
  if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
71050
71050
  setConfigObject(value, fullKey);
@@ -72196,11 +72196,11 @@ var CommandInstance = class {
72196
72196
  });
72197
72197
  if (!unparsed.length)
72198
72198
  return;
72199
- const config29 = Object.assign({}, options.configuration, {
72199
+ const config30 = Object.assign({}, options.configuration, {
72200
72200
  "populate--": false
72201
72201
  });
72202
72202
  const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
72203
- configuration: config29
72203
+ configuration: config30
72204
72204
  }));
72205
72205
  if (parsed.error) {
72206
72206
  yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
@@ -73423,31 +73423,31 @@ ${customMsgs.join("\n")}` : "";
73423
73423
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
73424
73424
  var previouslyVisitedConfigs = [];
73425
73425
  var shim2;
73426
- function applyExtends(config29, cwd, mergeExtends, _shim) {
73426
+ function applyExtends(config30, cwd, mergeExtends, _shim) {
73427
73427
  shim2 = _shim;
73428
73428
  let defaultConfig = {};
73429
- if (Object.prototype.hasOwnProperty.call(config29, "extends")) {
73430
- if (typeof config29.extends !== "string")
73429
+ if (Object.prototype.hasOwnProperty.call(config30, "extends")) {
73430
+ if (typeof config30.extends !== "string")
73431
73431
  return defaultConfig;
73432
- const isPath = /\.json|\..*rc$/.test(config29.extends);
73432
+ const isPath = /\.json|\..*rc$/.test(config30.extends);
73433
73433
  let pathToDefault = null;
73434
73434
  if (!isPath) {
73435
73435
  try {
73436
- pathToDefault = require.resolve(config29.extends);
73436
+ pathToDefault = require.resolve(config30.extends);
73437
73437
  } catch (_err) {
73438
- return config29;
73438
+ return config30;
73439
73439
  }
73440
73440
  } else {
73441
- pathToDefault = getPathToDefaultConfig(cwd, config29.extends);
73441
+ pathToDefault = getPathToDefaultConfig(cwd, config30.extends);
73442
73442
  }
73443
73443
  checkForCircularExtends(pathToDefault);
73444
73444
  previouslyVisitedConfigs.push(pathToDefault);
73445
- defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config29.extends);
73446
- delete config29.extends;
73445
+ defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config30.extends);
73446
+ delete config30.extends;
73447
73447
  defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
73448
73448
  }
73449
73449
  previouslyVisitedConfigs = [];
73450
- return mergeExtends ? mergeDeep(defaultConfig, config29) : Object.assign({}, defaultConfig, config29);
73450
+ return mergeExtends ? mergeDeep(defaultConfig, config30) : Object.assign({}, defaultConfig, config30);
73451
73451
  }
73452
73452
  function checkForCircularExtends(cfgPath) {
73453
73453
  if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
@@ -73457,17 +73457,17 @@ function checkForCircularExtends(cfgPath) {
73457
73457
  function getPathToDefaultConfig(cwd, pathToExtend) {
73458
73458
  return shim2.path.resolve(cwd, pathToExtend);
73459
73459
  }
73460
- function mergeDeep(config1, config29) {
73460
+ function mergeDeep(config1, config210) {
73461
73461
  const target = {};
73462
73462
  function isObject(obj) {
73463
73463
  return obj && typeof obj === "object" && !Array.isArray(obj);
73464
73464
  }
73465
73465
  Object.assign(target, config1);
73466
- for (const key of Object.keys(config29)) {
73467
- if (isObject(config29[key]) && isObject(target[key])) {
73468
- target[key] = mergeDeep(config1[key], config29[key]);
73466
+ for (const key of Object.keys(config210)) {
73467
+ if (isObject(config210[key]) && isObject(target[key])) {
73468
+ target[key] = mergeDeep(config1[key], config210[key]);
73469
73469
  } else {
73470
- target[key] = config29[key];
73470
+ target[key] = config210[key];
73471
73471
  }
73472
73472
  }
73473
73473
  return target;
@@ -74228,9 +74228,9 @@ var YargsInstance = class {
74228
74228
  }
74229
74229
  return maybePromise;
74230
74230
  }
74231
- parserConfiguration(config29) {
74232
- argsert("<object>", [config29], arguments.length);
74233
- __classPrivateFieldSet(this, _YargsInstance_parserConfig, config29, "f");
74231
+ parserConfiguration(config30) {
74232
+ argsert("<object>", [config30], arguments.length);
74233
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config30, "f");
74234
74234
  return this;
74235
74235
  }
74236
74236
  pkgConf(key, rootPath) {
@@ -74402,9 +74402,9 @@ var YargsInstance = class {
74402
74402
  return this;
74403
74403
  }
74404
74404
  }
74405
- usageConfiguration(config29) {
74406
- argsert("<object>", [config29], arguments.length);
74407
- __classPrivateFieldSet(this, _YargsInstance_usageConfig, config29, "f");
74405
+ usageConfiguration(config30) {
74406
+ argsert("<object>", [config30], arguments.length);
74407
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config30, "f");
74408
74408
  return this;
74409
74409
  }
74410
74410
  version(opt, msg, ver) {
@@ -74810,11 +74810,11 @@ var YargsInstance = class {
74810
74810
  __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
74811
74811
  __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
74812
74812
  const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
74813
- const config29 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
74813
+ const config30 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
74814
74814
  "populate--": true
74815
74815
  });
74816
74816
  const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
74817
- configuration: { "parse-positional-numbers": false, ...config29 }
74817
+ configuration: { "parse-positional-numbers": false, ...config30 }
74818
74818
  }));
74819
74819
  const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
74820
74820
  let argvPromise = void 0;
@@ -74977,7 +74977,7 @@ var Yargs = YargsFactory(esm_default);
74977
74977
  var yargs_default = Yargs;
74978
74978
 
74979
74979
  // package.json
74980
- var version = "2.40.1";
74980
+ var version = "2.40.3";
74981
74981
 
74982
74982
  // src/metrics.ts
74983
74983
  var import_node_async_hooks = require("node:async_hooks");
@@ -75021,12 +75021,12 @@ function getGlobalWranglerConfigPath() {
75021
75021
  }
75022
75022
 
75023
75023
  // src/helpers/metrics-config.ts
75024
- function writeMetricsConfig(config29) {
75024
+ function writeMetricsConfig(config30) {
75025
75025
  (0, import_node_fs2.mkdirSync)(import_node_path2.default.dirname(getMetricsConfigPath()), { recursive: true });
75026
75026
  (0, import_node_fs2.writeFileSync)(
75027
75027
  getMetricsConfigPath(),
75028
75028
  JSON.stringify(
75029
- config29,
75029
+ config30,
75030
75030
  (_key, value) => value instanceof Date ? value.toISOString() : value,
75031
75031
  " "
75032
75032
  )
@@ -75034,9 +75034,9 @@ function writeMetricsConfig(config29) {
75034
75034
  }
75035
75035
  function readMetricsConfig() {
75036
75036
  try {
75037
- const config29 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
75037
+ const config30 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
75038
75038
  return JSON.parse(
75039
- config29,
75039
+ config30,
75040
75040
  (key, value) => key === "date" ? new Date(value) : value
75041
75041
  );
75042
75042
  } catch {
@@ -75046,10 +75046,10 @@ function readMetricsConfig() {
75046
75046
  function getMetricsConfigPath() {
75047
75047
  return import_node_path2.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
75048
75048
  }
75049
- function getDeviceId(config29) {
75050
- const deviceId = config29.deviceId ?? (0, import_node_crypto.randomUUID)();
75051
- if (config29.deviceId === void 0) {
75052
- writeMetricsConfig({ ...config29, deviceId });
75049
+ function getDeviceId(config30) {
75050
+ const deviceId = config30.deviceId ?? (0, import_node_crypto.randomUUID)();
75051
+ if (config30.deviceId === void 0) {
75052
+ writeMetricsConfig({ ...config30, deviceId });
75053
75053
  }
75054
75054
  return deviceId;
75055
75055
  }
@@ -75324,10 +75324,10 @@ function getPlatform() {
75324
75324
  function createReporter() {
75325
75325
  const events = [];
75326
75326
  const als = new import_node_async_hooks.AsyncLocalStorage();
75327
- const config29 = readMetricsConfig() ?? {};
75328
- const isFirstUsage = config29.c3permission === void 0;
75327
+ const config30 = readMetricsConfig() ?? {};
75328
+ const isFirstUsage = config30.c3permission === void 0;
75329
75329
  const isEnabled = isTelemetryEnabled();
75330
- const deviceId = getDeviceId(config29);
75330
+ const deviceId = getDeviceId(config30);
75331
75331
  const packageManager = detectPackageManager();
75332
75332
  const platform3 = getPlatform();
75333
75333
  const amplitude_session_id = Date.now();
@@ -75360,7 +75360,7 @@ function createReporter() {
75360
75360
  if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
75361
75361
  return false;
75362
75362
  }
75363
- return hasSparrowSourceKey() && getC3Permission(config29).enabled;
75363
+ return hasSparrowSourceKey() && getC3Permission(config30).enabled;
75364
75364
  }
75365
75365
  async function waitForAllEventsSettled() {
75366
75366
  await Promise.allSettled(events);
@@ -75466,20 +75466,20 @@ function initializeC3Permission(enabled = true) {
75466
75466
  date: /* @__PURE__ */ new Date()
75467
75467
  };
75468
75468
  }
75469
- function getC3Permission(config29 = readMetricsConfig() ?? {}) {
75470
- if (!config29.c3permission) {
75471
- config29.c3permission = initializeC3Permission();
75472
- writeMetricsConfig(config29);
75469
+ function getC3Permission(config30 = readMetricsConfig() ?? {}) {
75470
+ if (!config30.c3permission) {
75471
+ config30.c3permission = initializeC3Permission();
75472
+ writeMetricsConfig(config30);
75473
75473
  }
75474
- return config29.c3permission;
75474
+ return config30.c3permission;
75475
75475
  }
75476
75476
  function updateC3Pemission(enabled) {
75477
- const config29 = readMetricsConfig();
75478
- if (config29.c3permission?.enabled === enabled) {
75477
+ const config30 = readMetricsConfig();
75478
+ if (config30.c3permission?.enabled === enabled) {
75479
75479
  return;
75480
75480
  }
75481
- config29.c3permission = initializeC3Permission(enabled);
75482
- writeMetricsConfig(config29);
75481
+ config30.c3permission = initializeC3Permission(enabled);
75482
+ writeMetricsConfig(config30);
75483
75483
  }
75484
75484
  var runTelemetryCommand = (action) => {
75485
75485
  const logTelemetryStatus = (enabled) => {
@@ -75524,28 +75524,28 @@ var import_haikunator = __toESM(require_dist_web());
75524
75524
  var import_fs6 = require("fs");
75525
75525
  var import_path6 = __toESM(require("path"));
75526
75526
  var import_undici2 = __toESM(require_undici());
75527
- var installPackages = async (packages, config29 = {}) => {
75527
+ var installPackages = async (packages, config30 = {}) => {
75528
75528
  const { npm: npm24 } = detectPackageManager();
75529
75529
  let saveFlag;
75530
75530
  let cmd;
75531
75531
  switch (npm24) {
75532
75532
  case "yarn":
75533
75533
  cmd = "add";
75534
- saveFlag = config29.dev ? "-D" : "";
75534
+ saveFlag = config30.dev ? "-D" : "";
75535
75535
  break;
75536
75536
  case "bun":
75537
75537
  cmd = "add";
75538
- saveFlag = config29.dev ? "-d" : "";
75538
+ saveFlag = config30.dev ? "-d" : "";
75539
75539
  break;
75540
75540
  case "npm":
75541
75541
  case "pnpm":
75542
75542
  default:
75543
75543
  cmd = "install";
75544
- saveFlag = config29.dev ? "--save-dev" : "";
75544
+ saveFlag = config30.dev ? "--save-dev" : "";
75545
75545
  break;
75546
75546
  }
75547
75547
  await runCommand([npm24, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
75548
- ...config29,
75548
+ ...config30,
75549
75549
  silent: true
75550
75550
  });
75551
75551
  };
@@ -76475,146 +76475,9 @@ var config8 = {
76475
76475
  };
76476
76476
  var c3_default10 = config8;
76477
76477
 
76478
- // templates-experimental/react/c3.ts
76479
- var import_assert2 = __toESM(require("assert"));
76480
- var recast5 = __toESM(require_main3());
76481
- var b2 = recast5.types.builders;
76482
- var t = recast5.types.namedTypes;
76478
+ // templates-experimental/remix/c3.ts
76483
76479
  var { npm: npm5 } = detectPackageManager();
76484
76480
  var generate8 = async (ctx) => {
76485
- const variant = await getVariant();
76486
- ctx.args.lang = variant.lang;
76487
- await runFrameworkGenerator(ctx, [
76488
- ctx.project.name,
76489
- "--template",
76490
- variant.value
76491
- ]);
76492
- logRaw("");
76493
- };
76494
- var configure6 = async (ctx) => {
76495
- await installPackages(["@cloudflare/vite-plugin"], {
76496
- dev: true,
76497
- startText: "Installing the Cloudflare Vite plugin",
76498
- doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`
76499
- });
76500
- await transformViteConfig(ctx);
76501
- if (usesTypescript(ctx)) {
76502
- updateTsconfigJson();
76503
- }
76504
- };
76505
- function transformViteConfig(ctx) {
76506
- const filePath = `vite.config.${usesTypescript(ctx) ? "ts" : "js"}`;
76507
- transformFile(filePath, {
76508
- visitProgram(n) {
76509
- const lastImportIndex = n.node.body.findLastIndex(
76510
- (statement) => statement.type === "ImportDeclaration"
76511
- );
76512
- const lastImport = n.get("body", lastImportIndex);
76513
- const importAst = b2.importDeclaration(
76514
- [b2.importSpecifier(b2.identifier("cloudflare"))],
76515
- b2.stringLiteral("@cloudflare/vite-plugin")
76516
- );
76517
- lastImport.insertAfter(importAst);
76518
- return this.traverse(n);
76519
- },
76520
- visitCallExpression: function(n) {
76521
- const callee = n.node.callee;
76522
- if (callee.name !== "defineConfig") {
76523
- return this.traverse(n);
76524
- }
76525
- const config29 = n.node.arguments[0];
76526
- (0, import_assert2.default)(t.ObjectExpression.check(config29));
76527
- const pluginsProp = config29.properties.find((prop) => isPluginsProp(prop));
76528
- (0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
76529
- pluginsProp.value.elements.push(
76530
- b2.callExpression(b2.identifier("cloudflare"), [])
76531
- );
76532
- return false;
76533
- }
76534
- });
76535
- }
76536
- function isPluginsProp(prop) {
76537
- return (t.Property.check(prop) || t.ObjectProperty.check(prop)) && t.Identifier.check(prop.key) && prop.key.name === "plugins";
76538
- }
76539
- function updateTsconfigJson() {
76540
- const s = spinner();
76541
- s.start(`Updating tsconfig.json config`);
76542
- const tsconfig = readJSON("tsconfig.json");
76543
- if (tsconfig && typeof tsconfig === "object") {
76544
- tsconfig.references ??= [];
76545
- tsconfig.references.push({ path: "./tsconfig.worker.json" });
76546
- }
76547
- writeJSON("tsconfig.json", tsconfig);
76548
- s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
76549
- }
76550
- async function getVariant() {
76551
- const variantsOptions2 = [
76552
- {
76553
- value: "react-ts",
76554
- lang: "ts",
76555
- label: "TypeScript"
76556
- },
76557
- {
76558
- value: "react-swc-ts",
76559
- lang: "ts",
76560
- label: "TypeScript + SWC"
76561
- },
76562
- {
76563
- value: "react",
76564
- lang: "js",
76565
- label: "JavaScript"
76566
- },
76567
- {
76568
- value: "react-swc",
76569
- lang: "js",
76570
- label: "JavaScript + SWC"
76571
- }
76572
- ];
76573
- const value = await inputPrompt({
76574
- type: "select",
76575
- question: "Select a variant:",
76576
- label: "variant",
76577
- options: variantsOptions2,
76578
- defaultValue: variantsOptions2[0].value
76579
- });
76580
- const selected = variantsOptions2.find((variant) => variant.value === value);
76581
- (0, import_assert2.default)(selected, "Expected a variant to be selected");
76582
- return selected;
76583
- }
76584
- var config9 = {
76585
- configVersion: 1,
76586
- id: "react",
76587
- frameworkCli: "create-vite",
76588
- displayName: "React",
76589
- platform: "workers",
76590
- path: "templates-experimental/react",
76591
- copyFiles: {
76592
- variants: {
76593
- ts: {
76594
- path: "./ts"
76595
- },
76596
- js: {
76597
- path: "./js"
76598
- }
76599
- }
76600
- },
76601
- generate: generate8,
76602
- configure: configure6,
76603
- transformPackageJson: async () => ({
76604
- scripts: {
76605
- deploy: `${npm5} run build && wrangler deploy`,
76606
- preview: `${npm5} run build && vite preview`
76607
- }
76608
- }),
76609
- devScript: "dev",
76610
- deployScript: "deploy",
76611
- previewScript: "preview"
76612
- };
76613
- var c3_default11 = config9;
76614
-
76615
- // templates-experimental/remix/c3.ts
76616
- var { npm: npm6 } = detectPackageManager();
76617
- var generate9 = async (ctx) => {
76618
76481
  await runFrameworkGenerator(ctx, [
76619
76482
  ctx.project.name,
76620
76483
  "--template",
@@ -76622,14 +76485,14 @@ var generate9 = async (ctx) => {
76622
76485
  ]);
76623
76486
  logRaw("");
76624
76487
  };
76625
- var configure7 = async () => {
76488
+ var configure6 = async () => {
76626
76489
  await installPackages(["wrangler@latest"], {
76627
76490
  dev: true,
76628
76491
  startText: "Updating the Wrangler version",
76629
76492
  doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
76630
76493
  });
76631
76494
  };
76632
- var config10 = {
76495
+ var config9 = {
76633
76496
  configVersion: 1,
76634
76497
  id: "remix",
76635
76498
  frameworkCli: "create-remix",
@@ -76639,12 +76502,12 @@ var config10 = {
76639
76502
  path: "./templates"
76640
76503
  },
76641
76504
  path: "templates-experimental/remix",
76642
- generate: generate9,
76643
- configure: configure7,
76505
+ generate: generate8,
76506
+ configure: configure6,
76644
76507
  transformPackageJson: async () => ({
76645
76508
  scripts: {
76646
- deploy: `${npm6} run build && wrangler deploy`,
76647
- preview: `${npm6} run build && wrangler dev`,
76509
+ deploy: `${npm5} run build && wrangler deploy`,
76510
+ preview: `${npm5} run build && wrangler dev`,
76648
76511
  "cf-typegen": `wrangler types`
76649
76512
  }
76650
76513
  }),
@@ -76652,21 +76515,21 @@ var config10 = {
76652
76515
  deployScript: "deploy",
76653
76516
  previewScript: "preview"
76654
76517
  };
76655
- var c3_default12 = config10;
76518
+ var c3_default11 = config9;
76656
76519
 
76657
76520
  // templates-experimental/solid/c3.ts
76658
- var recast6 = __toESM(require_main3());
76659
- var { npm: npm7 } = detectPackageManager();
76660
- var generate10 = async (ctx) => {
76521
+ var recast5 = __toESM(require_main3());
76522
+ var { npm: npm6 } = detectPackageManager();
76523
+ var generate9 = async (ctx) => {
76661
76524
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
76662
76525
  logRaw("");
76663
76526
  };
76664
- var configure8 = async (ctx) => {
76527
+ var configure7 = async (ctx) => {
76665
76528
  const packages = ["nitropack"];
76666
76529
  await installPackages(packages, {
76667
76530
  dev: true,
76668
76531
  startText: "Installing nitro module `nitropack`",
76669
- doneText: `${brandColor("installed")} ${dim(`via \`${npm7} install\``)}`
76532
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
76670
76533
  });
76671
76534
  usesTypescript(ctx);
76672
76535
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
@@ -76678,7 +76541,7 @@ var configure8 = async (ctx) => {
76678
76541
  if (callee.name !== "defineConfig") {
76679
76542
  return this.traverse(n);
76680
76543
  }
76681
- const b3 = recast6.types.builders;
76544
+ const b3 = recast5.types.builders;
76682
76545
  mergeObjectProperties(
76683
76546
  n.node.arguments[0],
76684
76547
  [
@@ -76702,7 +76565,7 @@ var configure8 = async (ctx) => {
76702
76565
  }
76703
76566
  });
76704
76567
  };
76705
- var config11 = {
76568
+ var config10 = {
76706
76569
  configVersion: 1,
76707
76570
  id: "solid",
76708
76571
  frameworkCli: "create-solid",
@@ -76712,12 +76575,12 @@ var config11 = {
76712
76575
  path: "./templates"
76713
76576
  },
76714
76577
  path: "templates-experimental/solid",
76715
- generate: generate10,
76716
- configure: configure8,
76578
+ generate: generate9,
76579
+ configure: configure7,
76717
76580
  transformPackageJson: async () => ({
76718
76581
  scripts: {
76719
- preview: `${npm7} run build && npx wrangler dev`,
76720
- deploy: `${npm7} run build && wrangler deploy`
76582
+ preview: `${npm6} run build && npx wrangler dev`,
76583
+ deploy: `${npm6} run build && wrangler deploy`
76721
76584
  }
76722
76585
  }),
76723
76586
  compatibilityFlags: ["nodejs_compat"],
@@ -76725,17 +76588,17 @@ var config11 = {
76725
76588
  deployScript: "deploy",
76726
76589
  previewScript: "preview"
76727
76590
  };
76728
- var c3_default13 = config11;
76591
+ var c3_default12 = config10;
76729
76592
 
76730
76593
  // templates-experimental/svelte/c3.ts
76731
76594
  var import_node_os3 = require("node:os");
76732
- var recast7 = __toESM(require_main3());
76733
- var { npm: npm8 } = detectPackageManager();
76734
- var generate11 = async (ctx) => {
76595
+ var recast6 = __toESM(require_main3());
76596
+ var { npm: npm7 } = detectPackageManager();
76597
+ var generate10 = async (ctx) => {
76735
76598
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
76736
76599
  logRaw("");
76737
76600
  };
76738
- var configure9 = async (ctx) => {
76601
+ var configure8 = async (ctx) => {
76739
76602
  const pkg = `@sveltejs/adapter-cloudflare`;
76740
76603
  await installPackages([pkg], {
76741
76604
  dev: true,
@@ -76762,7 +76625,7 @@ var updateTypeDefinitions = (ctx) => {
76762
76625
  return;
76763
76626
  }
76764
76627
  updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
76765
- const b3 = recast7.types.builders;
76628
+ const b3 = recast6.types.builders;
76766
76629
  transformFile("src/app.d.ts", {
76767
76630
  visitTSModuleDeclaration(n) {
76768
76631
  if (n.value.id.name === "App" && n.node.body) {
@@ -76794,7 +76657,7 @@ var updateTypeDefinitions = (ctx) => {
76794
76657
  }
76795
76658
  });
76796
76659
  };
76797
- var config12 = {
76660
+ var config11 = {
76798
76661
  configVersion: 1,
76799
76662
  id: "svelte",
76800
76663
  frameworkCli: "sv",
@@ -76804,12 +76667,12 @@ var config12 = {
76804
76667
  path: "./templates"
76805
76668
  },
76806
76669
  path: "templates-experimental/svelte",
76807
- generate: generate11,
76808
- configure: configure9,
76670
+ generate: generate10,
76671
+ configure: configure8,
76809
76672
  transformPackageJson: async (original, ctx) => {
76810
76673
  let scripts = {
76811
- preview: `${npm8} run build && wrangler dev`,
76812
- deploy: `${npm8} run build && wrangler deploy`
76674
+ preview: `${npm7} run build && wrangler dev`,
76675
+ deploy: `${npm7} run build && wrangler deploy`
76813
76676
  };
76814
76677
  if (usesTypescript(ctx)) {
76815
76678
  const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
@@ -76824,40 +76687,87 @@ var config12 = {
76824
76687
  deployScript: "deploy",
76825
76688
  previewScript: "preview"
76826
76689
  };
76827
- var c3_default14 = config12;
76690
+ var c3_default13 = config11;
76828
76691
 
76829
76692
  // templates-experimental/vue/c3.ts
76830
- var { npm: npm9 } = detectPackageManager();
76831
- var generate12 = async (ctx) => {
76832
- await runFrameworkGenerator(ctx, [ctx.project.name]);
76693
+ var { npm: npm8 } = detectPackageManager();
76694
+ var generate11 = async (ctx) => {
76695
+ const lang = ctx.args.lang ?? await inputPrompt({
76696
+ type: "select",
76697
+ question: "Would you like to use TypeScript?",
76698
+ label: "Language",
76699
+ options: [
76700
+ { label: "TypeScript", value: "ts" },
76701
+ { label: "JavaScript", value: "js" }
76702
+ ]
76703
+ });
76704
+ await runFrameworkGenerator(ctx, [
76705
+ ctx.project.name,
76706
+ "--router",
76707
+ lang === "ts" ? "--ts" : ""
76708
+ ]);
76709
+ logRaw("");
76833
76710
  };
76834
- var config13 = {
76711
+ var configure9 = async (ctx) => {
76712
+ await installPackages(["@cloudflare/vite-plugin"], {
76713
+ dev: true,
76714
+ startText: "Installing the Cloudflare Vite plugin",
76715
+ doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`
76716
+ });
76717
+ if (usesTypescript(ctx)) {
76718
+ updateTsconfigJson();
76719
+ }
76720
+ };
76721
+ function updateTsconfigJson() {
76722
+ const s = spinner();
76723
+ s.start(`Updating tsconfig.json config`);
76724
+ const tsconfig = readJSON("tsconfig.json");
76725
+ if (tsconfig && typeof tsconfig === "object") {
76726
+ tsconfig.references ??= [];
76727
+ tsconfig.references.push({ path: "./tsconfig.worker.json" });
76728
+ }
76729
+ writeJSON("tsconfig.json", tsconfig);
76730
+ s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
76731
+ }
76732
+ var config12 = {
76835
76733
  configVersion: 1,
76836
76734
  id: "vue",
76837
76735
  frameworkCli: "create-vue",
76838
76736
  platform: "workers",
76839
76737
  displayName: "Vue",
76738
+ path: "templates-experimental/vue",
76840
76739
  copyFiles: {
76841
- path: "./templates"
76740
+ async selectVariant(ctx) {
76741
+ return usesTypescript(ctx) ? "ts" : "js";
76742
+ },
76743
+ variants: {
76744
+ ts: {
76745
+ path: "./ts"
76746
+ },
76747
+ js: {
76748
+ path: "./js"
76749
+ }
76750
+ }
76842
76751
  },
76843
- path: "templates-experimental/vue",
76844
- generate: generate12,
76845
- transformPackageJson: async () => ({
76752
+ configure: configure9,
76753
+ generate: generate11,
76754
+ transformPackageJson: async (_3, ctx) => ({
76846
76755
  scripts: {
76847
- deploy: `${npm9} run build && wrangler deploy`,
76848
- preview: `${npm9} run build && wrangler dev`
76756
+ deploy: `${npm8} run build && wrangler deploy`,
76757
+ preview: `${npm8} run build && wrangler dev`,
76758
+ ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
76849
76759
  }
76850
76760
  }),
76851
76761
  devScript: "dev",
76852
76762
  deployScript: "deploy",
76853
76763
  previewScript: "preview"
76854
76764
  };
76855
- var c3_default15 = config13;
76765
+ var c3_default14 = config12;
76856
76766
 
76857
76767
  // templates/analog/c3.ts
76858
- var recast8 = __toESM(require_main3());
76859
- var { npm: npm10, name: pm2 } = detectPackageManager();
76860
- var generate13 = async (ctx) => {
76768
+ var recast7 = __toESM(require_main3());
76769
+ var { npm: npm9, name: pm2 } = detectPackageManager();
76770
+ var generate12 = async (ctx) => {
76861
76771
  await runFrameworkGenerator(ctx, [
76862
76772
  ctx.project.name,
76863
76773
  "--template",
@@ -76875,7 +76785,7 @@ var configure10 = async (ctx) => {
76875
76785
  await installPackages(packages, {
76876
76786
  dev: true,
76877
76787
  startText: `Installing ${packages.join(", ")}`,
76878
- doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
76788
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm9} install\``)}`
76879
76789
  });
76880
76790
  }
76881
76791
  updateViteConfig(ctx);
@@ -76896,7 +76806,7 @@ var updateEnvTypes2 = (ctx) => {
76896
76806
  s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
76897
76807
  };
76898
76808
  var updateViteConfig = (ctx) => {
76899
- const b3 = recast8.types.builders;
76809
+ const b3 = recast7.types.builders;
76900
76810
  const s = spinner();
76901
76811
  const configFile = "vite.config.ts";
76902
76812
  s.start(`Updating \`${configFile}\``);
@@ -76933,7 +76843,7 @@ var updateViteConfig = (ctx) => {
76933
76843
  });
76934
76844
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76935
76845
  };
76936
- var config14 = {
76846
+ var config13 = {
76937
76847
  configVersion: 1,
76938
76848
  id: "analog",
76939
76849
  frameworkCli: "create-analog",
@@ -76942,12 +76852,12 @@ var config14 = {
76942
76852
  copyFiles: {
76943
76853
  path: "./templates"
76944
76854
  },
76945
- generate: generate13,
76855
+ generate: generate12,
76946
76856
  configure: configure10,
76947
76857
  transformPackageJson: async () => ({
76948
76858
  scripts: {
76949
- preview: `${npm10} run build && wrangler pages dev`,
76950
- deploy: `${npm10} run build && wrangler pages deploy`,
76859
+ preview: `${npm9} run build && wrangler pages dev`,
76860
+ deploy: `${npm9} run build && wrangler pages deploy`,
76951
76861
  "cf-typegen": `wrangler types`
76952
76862
  }
76953
76863
  }),
@@ -76955,12 +76865,12 @@ var config14 = {
76955
76865
  deployScript: "deploy",
76956
76866
  previewScript: "preview"
76957
76867
  };
76958
- var c3_default16 = config14;
76868
+ var c3_default15 = config13;
76959
76869
 
76960
76870
  // templates/angular/c3.ts
76961
76871
  var import_node_path4 = require("node:path");
76962
- var { npm: npm11 } = detectPackageManager();
76963
- var generate14 = async (ctx) => {
76872
+ var { npm: npm10 } = detectPackageManager();
76873
+ var generate13 = async (ctx) => {
76964
76874
  await runFrameworkGenerator(ctx, [
76965
76875
  ctx.project.name,
76966
76876
  "--ssr",
@@ -76977,7 +76887,7 @@ async function installCFWorker2() {
76977
76887
  await installPackages(["xhr2"], {
76978
76888
  dev: true,
76979
76889
  startText: "Installing additional dependencies",
76980
- doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
76890
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
76981
76891
  });
76982
76892
  }
76983
76893
  async function updateAppCode2() {
@@ -77019,7 +76929,7 @@ function updateAngularJson2(ctx) {
77019
76929
  writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
77020
76930
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
77021
76931
  }
77022
- var config15 = {
76932
+ var config14 = {
77023
76933
  configVersion: 1,
77024
76934
  id: "angular",
77025
76935
  frameworkCli: "@angular/create",
@@ -77031,23 +76941,23 @@ var config15 = {
77031
76941
  devScript: "start",
77032
76942
  deployScript: "deploy",
77033
76943
  previewScript: "start",
77034
- generate: generate14,
76944
+ generate: generate13,
77035
76945
  configure: configure11,
77036
76946
  transformPackageJson: async () => ({
77037
76947
  scripts: {
77038
- start: `${npm11} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
77039
- build: `ng build && ${npm11} run process`,
76948
+ start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
76949
+ build: `ng build && ${npm10} run process`,
77040
76950
  process: "node ./tools/copy-files.mjs",
77041
- deploy: `${npm11} run build && wrangler pages deploy dist/cloudflare`
76951
+ deploy: `${npm10} run build && wrangler pages deploy dist/cloudflare`
77042
76952
  }
77043
76953
  })
77044
76954
  };
77045
- var c3_default17 = config15;
76955
+ var c3_default16 = config14;
77046
76956
 
77047
76957
  // templates/astro/c3.ts
77048
- var recast9 = __toESM(require_main3());
76958
+ var recast8 = __toESM(require_main3());
77049
76959
  var { npx: npx3 } = detectPackageManager();
77050
- var generate15 = async (ctx) => {
76960
+ var generate14 = async (ctx) => {
77051
76961
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
77052
76962
  logRaw("");
77053
76963
  };
@@ -77070,7 +76980,7 @@ var updateAstroConfig2 = () => {
77070
76980
  if (callee.name !== "cloudflare") {
77071
76981
  return this.traverse(n);
77072
76982
  }
77073
- const b3 = recast9.types.builders;
76983
+ const b3 = recast8.types.builders;
77074
76984
  n.node.arguments = [
77075
76985
  b3.objectExpression([
77076
76986
  b3.objectProperty(
@@ -77085,7 +76995,7 @@ var updateAstroConfig2 = () => {
77085
76995
  }
77086
76996
  });
77087
76997
  };
77088
- var config16 = {
76998
+ var config15 = {
77089
76999
  configVersion: 1,
77090
77000
  id: "astro",
77091
77001
  frameworkCli: "create-astro",
@@ -77107,7 +77017,7 @@ var config16 = {
77107
77017
  devScript: "dev",
77108
77018
  deployScript: "deploy",
77109
77019
  previewScript: "preview",
77110
- generate: generate15,
77020
+ generate: generate14,
77111
77021
  configure: configure12,
77112
77022
  transformPackageJson: async (pkgJson, ctx) => ({
77113
77023
  scripts: {
@@ -77117,10 +77027,10 @@ var config16 = {
77117
77027
  }
77118
77028
  })
77119
77029
  };
77120
- var c3_default18 = config16;
77030
+ var c3_default17 = config15;
77121
77031
 
77122
77032
  // templates/common/c3.ts
77123
- var c3_default19 = {
77033
+ var c3_default18 = {
77124
77034
  configVersion: 1,
77125
77035
  id: "common",
77126
77036
  displayName: "Example router & proxy Worker",
@@ -77140,36 +77050,36 @@ var c3_default19 = {
77140
77050
  };
77141
77051
 
77142
77052
  // templates/docusaurus/pages/c3.ts
77143
- var { npm: npm12 } = detectPackageManager();
77144
- var generate16 = async (ctx) => {
77053
+ var { npm: npm11 } = detectPackageManager();
77054
+ var generate15 = async (ctx) => {
77145
77055
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
77146
77056
  };
77147
- var config17 = {
77057
+ var config16 = {
77148
77058
  configVersion: 1,
77149
77059
  id: "docusaurus",
77150
77060
  frameworkCli: "create-docusaurus",
77151
77061
  platform: "pages",
77152
77062
  displayName: "Docusaurus",
77153
77063
  path: "templates/docusaurus/pages",
77154
- generate: generate16,
77064
+ generate: generate15,
77155
77065
  transformPackageJson: async () => ({
77156
77066
  scripts: {
77157
- preview: `${npm12} run build && wrangler pages dev ./build`,
77158
- deploy: `${npm12} run build && wrangler pages deploy ./build`
77067
+ preview: `${npm11} run build && wrangler pages dev ./build`,
77068
+ deploy: `${npm11} run build && wrangler pages deploy ./build`
77159
77069
  }
77160
77070
  }),
77161
77071
  devScript: "preview",
77162
77072
  deployScript: "deploy",
77163
77073
  previewScript: "preview"
77164
77074
  };
77165
- var c3_default20 = config17;
77075
+ var c3_default19 = config16;
77166
77076
 
77167
77077
  // templates/docusaurus/workers/c3.ts
77168
- var { npm: npm13 } = detectPackageManager();
77169
- var generate17 = async (ctx) => {
77078
+ var { npm: npm12 } = detectPackageManager();
77079
+ var generate16 = async (ctx) => {
77170
77080
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
77171
77081
  };
77172
- var config18 = {
77082
+ var config17 = {
77173
77083
  configVersion: 1,
77174
77084
  id: "docusaurus",
77175
77085
  frameworkCli: "create-docusaurus",
@@ -77179,29 +77089,29 @@ var config18 = {
77179
77089
  path: "./templates"
77180
77090
  },
77181
77091
  path: "templates/docusaurus/workers",
77182
- generate: generate17,
77092
+ generate: generate16,
77183
77093
  transformPackageJson: async () => ({
77184
77094
  scripts: {
77185
- deploy: `${npm13} run build && wrangler deploy`,
77186
- preview: `${npm13} run build && wrangler dev`
77095
+ deploy: `${npm12} run build && wrangler deploy`,
77096
+ preview: `${npm12} run build && wrangler dev`
77187
77097
  }
77188
77098
  }),
77189
77099
  devScript: "start",
77190
77100
  deployScript: "deploy",
77191
77101
  previewScript: "preview"
77192
77102
  };
77193
- var c3_default21 = config18;
77103
+ var c3_default20 = config17;
77194
77104
 
77195
77105
  // templates/docusaurus/c3.ts
77196
- var config19 = {
77106
+ var config18 = {
77197
77107
  displayName: "Docusaurus",
77198
- platformVariants: { pages: c3_default20, workers: c3_default21 }
77108
+ platformVariants: { pages: c3_default19, workers: c3_default20 }
77199
77109
  };
77200
- var c3_default22 = config19;
77110
+ var c3_default21 = config18;
77201
77111
 
77202
77112
  // templates/gatsby/c3.ts
77203
- var { npm: npm14 } = detectPackageManager();
77204
- var generate18 = async (ctx) => {
77113
+ var { npm: npm13 } = detectPackageManager();
77114
+ var generate17 = async (ctx) => {
77205
77115
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
77206
77116
  const useTemplate = await inputPrompt({
77207
77117
  type: "confirm",
@@ -77220,27 +77130,27 @@ var generate18 = async (ctx) => {
77220
77130
  }
77221
77131
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
77222
77132
  };
77223
- var config20 = {
77133
+ var config19 = {
77224
77134
  configVersion: 1,
77225
77135
  id: "gatsby",
77226
77136
  frameworkCli: "gatsby",
77227
77137
  platform: "pages",
77228
77138
  displayName: "Gatsby",
77229
- generate: generate18,
77139
+ generate: generate17,
77230
77140
  transformPackageJson: async () => ({
77231
77141
  scripts: {
77232
- deploy: `${npm14} run build && wrangler pages deploy ./public`,
77233
- preview: `${npm14} run build && wrangler pages dev ./public`
77142
+ deploy: `${npm13} run build && wrangler pages deploy ./public`,
77143
+ preview: `${npm13} run build && wrangler pages dev ./public`
77234
77144
  }
77235
77145
  }),
77236
77146
  devScript: "develop",
77237
77147
  deployScript: "deploy",
77238
77148
  previewScript: "preview"
77239
77149
  };
77240
- var c3_default23 = config20;
77150
+ var c3_default22 = config19;
77241
77151
 
77242
77152
  // templates/hello-world-durable-object/c3.ts
77243
- var c3_default24 = {
77153
+ var c3_default23 = {
77244
77154
  configVersion: 1,
77245
77155
  id: "hello-world-durable-object",
77246
77156
  displayName: "Hello World Worker Using Durable Objects",
@@ -77261,7 +77171,7 @@ var c3_default24 = {
77261
77171
  // templates/hello-world/c3.ts
77262
77172
  var import_promises2 = require("node:fs/promises");
77263
77173
  var import_node_path5 = require("node:path");
77264
- var c3_default25 = {
77174
+ var c3_default24 = {
77265
77175
  configVersion: 1,
77266
77176
  id: "hello-world",
77267
77177
  displayName: "Hello World Worker",
@@ -77295,7 +77205,7 @@ var c3_default25 = {
77295
77205
  };
77296
77206
 
77297
77207
  // templates/hono/c3.ts
77298
- var generate19 = async (ctx) => {
77208
+ var generate18 = async (ctx) => {
77299
77209
  const { name: pm4 } = detectPackageManager();
77300
77210
  await runFrameworkGenerator(ctx, [
77301
77211
  ctx.project.name,
@@ -77322,7 +77232,7 @@ var configure13 = async (ctx) => {
77322
77232
  });
77323
77233
  s.stop(`${brandColor("updated")} \`${dim(indexFile)}\``);
77324
77234
  };
77325
- var config21 = {
77235
+ var config20 = {
77326
77236
  configVersion: 1,
77327
77237
  id: "hono",
77328
77238
  frameworkCli: "create-hono",
@@ -77331,7 +77241,7 @@ var config21 = {
77331
77241
  path: "./templates"
77332
77242
  },
77333
77243
  platform: "workers",
77334
- generate: generate19,
77244
+ generate: generate18,
77335
77245
  configure: configure13,
77336
77246
  transformPackageJson: async () => ({
77337
77247
  scripts: {
@@ -77344,12 +77254,12 @@ var config21 = {
77344
77254
  deployScript: "deploy",
77345
77255
  previewScript: "dev"
77346
77256
  };
77347
- var c3_default26 = config21;
77257
+ var c3_default25 = config20;
77348
77258
 
77349
77259
  // templates/next/c3.ts
77350
77260
  var import_path10 = require("path");
77351
- var { npm: npm15, npx: npx4 } = detectPackageManager();
77352
- var generate20 = async (ctx) => {
77261
+ var { npm: npm14, npx: npx4 } = detectPackageManager();
77262
+ var generate19 = async (ctx) => {
77353
77263
  const projectName = ctx.project.name;
77354
77264
  await runFrameworkGenerator(ctx, [projectName]);
77355
77265
  const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
@@ -77449,13 +77359,13 @@ var addDevDependencies = async (installEslintPlugin) => {
77449
77359
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
77450
77360
  });
77451
77361
  };
77452
- var c3_default27 = {
77362
+ var c3_default26 = {
77453
77363
  configVersion: 1,
77454
77364
  id: "next",
77455
77365
  frameworkCli: "create-next-app",
77456
77366
  platform: "pages",
77457
77367
  displayName: "Next.js",
77458
- generate: generate20,
77368
+ generate: generate19,
77459
77369
  configure: configure14,
77460
77370
  copyFiles: {
77461
77371
  async selectVariant(ctx) {
@@ -77487,12 +77397,12 @@ var c3_default27 = {
77487
77397
  }
77488
77398
  },
77489
77399
  transformPackageJson: async (_3, ctx) => {
77490
- const isNpm = npm15 === "npm";
77491
- const isBun = npm15 === "bun";
77400
+ const isNpm = npm14 === "npm";
77401
+ const isBun = npm14 === "bun";
77492
77402
  const isNpmOrBun = isNpm || isBun;
77493
77403
  const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
77494
77404
  const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
77495
- const pmCommand = isNpmOrBun ? npx4 : npm15;
77405
+ const pmCommand = isNpmOrBun ? npx4 : npm14;
77496
77406
  const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
77497
77407
  return {
77498
77408
  scripts: {
@@ -77512,15 +77422,15 @@ var c3_default27 = {
77512
77422
  };
77513
77423
 
77514
77424
  // templates/nuxt/c3.ts
77515
- var recast10 = __toESM(require_main3());
77516
- var { npm: npm16, name: pm3 } = detectPackageManager();
77517
- var generate21 = async (ctx) => {
77425
+ var recast9 = __toESM(require_main3());
77426
+ var { npm: npm15, name: pm3 } = detectPackageManager();
77427
+ var generate20 = async (ctx) => {
77518
77428
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
77519
77429
  await runFrameworkGenerator(ctx, [
77520
77430
  "init",
77521
77431
  ctx.project.name,
77522
77432
  "--packageManager",
77523
- npm16,
77433
+ npm15,
77524
77434
  gitFlag
77525
77435
  ]);
77526
77436
  writeFile2("./.node-version", "18");
@@ -77534,7 +77444,7 @@ var configure15 = async (ctx) => {
77534
77444
  await installPackages(packages, {
77535
77445
  dev: true,
77536
77446
  startText: "Installing nitro module `nitro-cloudflare-dev`",
77537
- doneText: `${brandColor("installed")} ${dim(`via \`${npm16} install\``)}`
77447
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm15} install\``)}`
77538
77448
  });
77539
77449
  updateNuxtConfig2();
77540
77450
  updateEnvTypes3(ctx);
@@ -77557,7 +77467,7 @@ var updateNuxtConfig2 = () => {
77557
77467
  const s = spinner();
77558
77468
  const configFile = "nuxt.config.ts";
77559
77469
  s.start(`Updating \`${configFile}\``);
77560
- const b3 = recast10.types.builders;
77470
+ const b3 = recast9.types.builders;
77561
77471
  const presetDef = b3.objectProperty(
77562
77472
  b3.identifier("nitro"),
77563
77473
  b3.objectExpression([
@@ -77585,7 +77495,7 @@ var updateNuxtConfig2 = () => {
77585
77495
  });
77586
77496
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
77587
77497
  };
77588
- var config22 = {
77498
+ var config21 = {
77589
77499
  configVersion: 1,
77590
77500
  id: "nuxt",
77591
77501
  frameworkCli: "nuxi",
@@ -77594,12 +77504,12 @@ var config22 = {
77594
77504
  copyFiles: {
77595
77505
  path: "./templates"
77596
77506
  },
77597
- generate: generate21,
77507
+ generate: generate20,
77598
77508
  configure: configure15,
77599
77509
  transformPackageJson: async () => ({
77600
77510
  scripts: {
77601
- deploy: `${npm16} run build && wrangler pages deploy`,
77602
- preview: `${npm16} run build && wrangler pages dev`,
77511
+ deploy: `${npm15} run build && wrangler pages deploy`,
77512
+ preview: `${npm15} run build && wrangler pages dev`,
77603
77513
  "cf-typegen": `wrangler types`
77604
77514
  }
77605
77515
  }),
@@ -77607,10 +77517,10 @@ var config22 = {
77607
77517
  deployScript: "deploy",
77608
77518
  previewScript: "preview"
77609
77519
  };
77610
- var c3_default28 = config22;
77520
+ var c3_default27 = config21;
77611
77521
 
77612
77522
  // templates/openapi/c3.ts
77613
- var c3_default29 = {
77523
+ var c3_default28 = {
77614
77524
  configVersion: 1,
77615
77525
  id: "openapi",
77616
77526
  displayName: "API starter (OpenAPI compliant)",
@@ -77769,7 +77679,7 @@ async function copyExistingWorkerFiles(ctx) {
77769
77679
  (0, import_path11.join)(ctx.project.path, "wrangler.toml")
77770
77680
  );
77771
77681
  }
77772
- var c3_default30 = {
77682
+ var c3_default29 = {
77773
77683
  configVersion: 1,
77774
77684
  id: "pre-existing",
77775
77685
  displayName: "Pre-existing Worker (from Dashboard)",
@@ -77785,7 +77695,7 @@ var c3_default30 = {
77785
77695
  })
77786
77696
  };
77787
77697
  function buildConfigure(params) {
77788
- return async function configure21(ctx) {
77698
+ return async function configure22(ctx) {
77789
77699
  const loginSuccess = await params.login(ctx);
77790
77700
  if (!loginSuccess) {
77791
77701
  throw new Error("Failed to login to Cloudflare");
@@ -77797,7 +77707,7 @@ function buildConfigure(params) {
77797
77707
  }
77798
77708
 
77799
77709
  // templates/queues/c3.ts
77800
- var c3_default31 = {
77710
+ var c3_default30 = {
77801
77711
  configVersion: 1,
77802
77712
  id: "queues",
77803
77713
  displayName: "Queue consumer & producer Worker",
@@ -77826,13 +77736,13 @@ var c3_default31 = {
77826
77736
  };
77827
77737
 
77828
77738
  // templates/qwik/c3.ts
77829
- var recast11 = __toESM(require_main3());
77830
- var { npm: npm17, npx: npx5, name: name2 } = detectPackageManager();
77831
- var generate22 = async (ctx) => {
77739
+ var recast10 = __toESM(require_main3());
77740
+ var { npm: npm16, npx: npx5, name: name2 } = detectPackageManager();
77741
+ var generate21 = async (ctx) => {
77832
77742
  await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
77833
77743
  };
77834
77744
  var configure16 = async (ctx) => {
77835
- const cmd = [name2 === "pnpm" ? npm17 : npx5, "qwik", "add", "cloudflare-pages"];
77745
+ const cmd = [name2 === "pnpm" ? npm16 : npx5, "qwik", "add", "cloudflare-pages"];
77836
77746
  endSection(`Running ${quoteShellArgs(cmd)}`);
77837
77747
  await runCommand(cmd);
77838
77748
  addBindingsProxy2(ctx);
@@ -77845,7 +77755,7 @@ var addBindingsProxy2 = (ctx) => {
77845
77755
  const s = spinner();
77846
77756
  s.start("Updating `vite.config.ts`");
77847
77757
  const snippets = loadTemplateSnippets(ctx);
77848
- const b3 = recast11.types.builders;
77758
+ const b3 = recast10.types.builders;
77849
77759
  transformFile("vite.config.ts", {
77850
77760
  // Insert the env declaration after the last import (but before the rest of the body)
77851
77761
  visitProgram: function(n) {
@@ -77887,7 +77797,7 @@ var populateCloudflareEnv2 = () => {
77887
77797
  s.start(`Updating \`${entrypointPath}\``);
77888
77798
  transformFile(entrypointPath, {
77889
77799
  visitTSInterfaceDeclaration: function(n) {
77890
- const b3 = recast11.types.builders;
77800
+ const b3 = recast10.types.builders;
77891
77801
  const id = n.node.id;
77892
77802
  if (id.name !== "QwikCityPlatform") {
77893
77803
  this.traverse(n);
@@ -77908,7 +77818,7 @@ var populateCloudflareEnv2 = () => {
77908
77818
  });
77909
77819
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
77910
77820
  };
77911
- var config23 = {
77821
+ var config22 = {
77912
77822
  configVersion: 1,
77913
77823
  id: "qwik",
77914
77824
  frameworkCli: "create-qwik",
@@ -77917,12 +77827,12 @@ var config23 = {
77917
77827
  copyFiles: {
77918
77828
  path: "./templates"
77919
77829
  },
77920
- generate: generate22,
77830
+ generate: generate21,
77921
77831
  configure: configure16,
77922
77832
  transformPackageJson: async () => ({
77923
77833
  scripts: {
77924
- deploy: `${npm17} run build && wrangler pages deploy`,
77925
- preview: `${npm17} run build && wrangler pages dev`,
77834
+ deploy: `${npm16} run build && wrangler pages deploy`,
77835
+ preview: `${npm16} run build && wrangler pages dev`,
77926
77836
  "cf-typegen": `wrangler types`
77927
77837
  }
77928
77838
  }),
@@ -77930,11 +77840,11 @@ var config23 = {
77930
77840
  deployScript: "deploy",
77931
77841
  previewScript: "preview"
77932
77842
  };
77933
- var c3_default32 = config23;
77843
+ var c3_default31 = config22;
77934
77844
 
77935
- // templates/react/c3.ts
77936
- var { npm: npm18 } = detectPackageManager();
77937
- var generate23 = async (ctx) => {
77845
+ // templates/react/pages/c3.ts
77846
+ var { npm: npm17 } = detectPackageManager();
77847
+ var generate22 = async (ctx) => {
77938
77848
  const variant = await inputPrompt({
77939
77849
  type: "select",
77940
77850
  question: "Select a variant:",
@@ -77963,18 +77873,157 @@ var variantsOptions = [
77963
77873
  label: "JavaScript + SWC"
77964
77874
  }
77965
77875
  ];
77966
- var config24 = {
77876
+ var config23 = {
77967
77877
  configVersion: 1,
77968
77878
  id: "react",
77969
77879
  // React's documentation now recommends using create-vite.
77970
77880
  frameworkCli: "create-vite",
77971
77881
  displayName: "React",
77972
77882
  platform: "pages",
77973
- generate: generate23,
77883
+ path: "templates/react/pages",
77884
+ generate: generate22,
77974
77885
  transformPackageJson: async () => ({
77975
77886
  scripts: {
77976
- deploy: `${npm18} run build && wrangler pages deploy ./dist`,
77977
- preview: `${npm18} run build && wrangler pages dev ./dist`
77887
+ deploy: `${npm17} run build && wrangler pages deploy ./dist`,
77888
+ preview: `${npm17} run build && wrangler pages dev ./dist`
77889
+ }
77890
+ }),
77891
+ devScript: "dev",
77892
+ deployScript: "deploy",
77893
+ previewScript: "preview"
77894
+ };
77895
+ var c3_default32 = config23;
77896
+
77897
+ // templates/react/workers/c3.ts
77898
+ var import_assert2 = __toESM(require("assert"));
77899
+ var recast11 = __toESM(require_main3());
77900
+ var b2 = recast11.types.builders;
77901
+ var t = recast11.types.namedTypes;
77902
+ var { npm: npm18 } = detectPackageManager();
77903
+ var generate23 = async (ctx) => {
77904
+ const variant = await getVariant();
77905
+ ctx.args.lang = variant.lang;
77906
+ await runFrameworkGenerator(ctx, [
77907
+ ctx.project.name,
77908
+ "--template",
77909
+ variant.value
77910
+ ]);
77911
+ logRaw("");
77912
+ };
77913
+ var configure17 = async (ctx) => {
77914
+ await installPackages(["@cloudflare/vite-plugin"], {
77915
+ dev: true,
77916
+ startText: "Installing the Cloudflare Vite plugin",
77917
+ doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`
77918
+ });
77919
+ await transformViteConfig(ctx);
77920
+ if (usesTypescript(ctx)) {
77921
+ updateTsconfigJson2();
77922
+ }
77923
+ };
77924
+ function transformViteConfig(ctx) {
77925
+ const filePath = `vite.config.${usesTypescript(ctx) ? "ts" : "js"}`;
77926
+ transformFile(filePath, {
77927
+ visitProgram(n) {
77928
+ const lastImportIndex = n.node.body.findLastIndex(
77929
+ (statement) => statement.type === "ImportDeclaration"
77930
+ );
77931
+ const lastImport = n.get("body", lastImportIndex);
77932
+ const importAst = b2.importDeclaration(
77933
+ [b2.importSpecifier(b2.identifier("cloudflare"))],
77934
+ b2.stringLiteral("@cloudflare/vite-plugin")
77935
+ );
77936
+ lastImport.insertAfter(importAst);
77937
+ return this.traverse(n);
77938
+ },
77939
+ visitCallExpression: function(n) {
77940
+ const callee = n.node.callee;
77941
+ if (callee.name !== "defineConfig") {
77942
+ return this.traverse(n);
77943
+ }
77944
+ const config30 = n.node.arguments[0];
77945
+ (0, import_assert2.default)(t.ObjectExpression.check(config30));
77946
+ const pluginsProp = config30.properties.find((prop) => isPluginsProp(prop));
77947
+ (0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
77948
+ pluginsProp.value.elements.push(
77949
+ b2.callExpression(b2.identifier("cloudflare"), [])
77950
+ );
77951
+ return false;
77952
+ }
77953
+ });
77954
+ }
77955
+ function isPluginsProp(prop) {
77956
+ return (t.Property.check(prop) || t.ObjectProperty.check(prop)) && t.Identifier.check(prop.key) && prop.key.name === "plugins";
77957
+ }
77958
+ function updateTsconfigJson2() {
77959
+ const s = spinner();
77960
+ s.start(`Updating tsconfig.json config`);
77961
+ const tsconfig = readJSON("tsconfig.json");
77962
+ if (tsconfig && typeof tsconfig === "object") {
77963
+ tsconfig.references ??= [];
77964
+ tsconfig.references.push({ path: "./tsconfig.worker.json" });
77965
+ }
77966
+ writeJSON("tsconfig.json", tsconfig);
77967
+ s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
77968
+ }
77969
+ async function getVariant() {
77970
+ const variantsOptions2 = [
77971
+ {
77972
+ value: "react-ts",
77973
+ lang: "ts",
77974
+ label: "TypeScript"
77975
+ },
77976
+ {
77977
+ value: "react-swc-ts",
77978
+ lang: "ts",
77979
+ label: "TypeScript + SWC"
77980
+ },
77981
+ {
77982
+ value: "react",
77983
+ lang: "js",
77984
+ label: "JavaScript"
77985
+ },
77986
+ {
77987
+ value: "react-swc",
77988
+ lang: "js",
77989
+ label: "JavaScript + SWC"
77990
+ }
77991
+ ];
77992
+ const value = await inputPrompt({
77993
+ type: "select",
77994
+ question: "Select a variant:",
77995
+ label: "variant",
77996
+ options: variantsOptions2,
77997
+ defaultValue: variantsOptions2[0].value
77998
+ });
77999
+ const selected = variantsOptions2.find((variant) => variant.value === value);
78000
+ (0, import_assert2.default)(selected, "Expected a variant to be selected");
78001
+ return selected;
78002
+ }
78003
+ var config24 = {
78004
+ configVersion: 1,
78005
+ id: "react",
78006
+ frameworkCli: "create-vite",
78007
+ displayName: "React",
78008
+ platform: "workers",
78009
+ path: "templates/react/workers",
78010
+ copyFiles: {
78011
+ variants: {
78012
+ ts: {
78013
+ path: "./ts"
78014
+ },
78015
+ js: {
78016
+ path: "./js"
78017
+ }
78018
+ }
78019
+ },
78020
+ generate: generate23,
78021
+ configure: configure17,
78022
+ transformPackageJson: async (_3, ctx) => ({
78023
+ scripts: {
78024
+ deploy: `${npm18} run build && wrangler deploy`,
78025
+ preview: `${npm18} run build && vite preview`,
78026
+ ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
77978
78027
  }
77979
78028
  }),
77980
78029
  devScript: "dev",
@@ -77983,6 +78032,13 @@ var config24 = {
77983
78032
  };
77984
78033
  var c3_default33 = config24;
77985
78034
 
78035
+ // templates/react/c3.ts
78036
+ var config25 = {
78037
+ displayName: "React",
78038
+ platformVariants: { pages: c3_default32, workers: c3_default33 }
78039
+ };
78040
+ var c3_default34 = config25;
78041
+
77986
78042
  // templates/remix/c3.ts
77987
78043
  var { npm: npm19 } = detectPackageManager();
77988
78044
  var generate24 = async (ctx) => {
@@ -77993,7 +78049,7 @@ var generate24 = async (ctx) => {
77993
78049
  ]);
77994
78050
  logRaw("");
77995
78051
  };
77996
- var configure17 = async () => {
78052
+ var configure18 = async () => {
77997
78053
  const typeDefsPath = "load-context.ts";
77998
78054
  const s = spinner();
77999
78055
  s.start(`Updating \`${typeDefsPath}\``);
@@ -78008,7 +78064,7 @@ var configure17 = async () => {
78008
78064
  });
78009
78065
  s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
78010
78066
  };
78011
- var config25 = {
78067
+ var config26 = {
78012
78068
  configVersion: 1,
78013
78069
  id: "remix",
78014
78070
  frameworkCli: "create-remix",
@@ -78018,7 +78074,7 @@ var config25 = {
78018
78074
  path: "./templates"
78019
78075
  },
78020
78076
  generate: generate24,
78021
- configure: configure17,
78077
+ configure: configure18,
78022
78078
  transformPackageJson: async () => ({
78023
78079
  scripts: {
78024
78080
  deploy: `${npm19} run build && wrangler pages deploy`,
@@ -78030,10 +78086,10 @@ var config25 = {
78030
78086
  deployScript: "deploy",
78031
78087
  previewScript: "preview"
78032
78088
  };
78033
- var c3_default34 = config25;
78089
+ var c3_default35 = config26;
78034
78090
 
78035
78091
  // templates/scheduled/c3.ts
78036
- var c3_default35 = {
78092
+ var c3_default36 = {
78037
78093
  configVersion: 1,
78038
78094
  id: "scheduled",
78039
78095
  displayName: "Scheduled Worker (Cron Trigger)",
@@ -78058,7 +78114,7 @@ var generate25 = async (ctx) => {
78058
78114
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
78059
78115
  logRaw("");
78060
78116
  };
78061
- var configure18 = async (ctx) => {
78117
+ var configure19 = async (ctx) => {
78062
78118
  usesTypescript(ctx);
78063
78119
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
78064
78120
  updateStatus(`Updating configuration in ${blue(filePath)}`);
@@ -78096,7 +78152,7 @@ var configure18 = async (ctx) => {
78096
78152
  }
78097
78153
  });
78098
78154
  };
78099
- var config26 = {
78155
+ var config27 = {
78100
78156
  configVersion: 1,
78101
78157
  id: "solid",
78102
78158
  frameworkCli: "create-solid",
@@ -78106,7 +78162,7 @@ var config26 = {
78106
78162
  path: "./templates"
78107
78163
  },
78108
78164
  generate: generate25,
78109
- configure: configure18,
78165
+ configure: configure19,
78110
78166
  transformPackageJson: async () => ({
78111
78167
  scripts: {
78112
78168
  preview: `${npm20} run build && npx wrangler pages dev`,
@@ -78118,7 +78174,7 @@ var config26 = {
78118
78174
  deployScript: "deploy",
78119
78175
  previewScript: "preview"
78120
78176
  };
78121
- var c3_default36 = config26;
78177
+ var c3_default37 = config27;
78122
78178
 
78123
78179
  // templates/svelte/c3.ts
78124
78180
  var import_node_fs3 = require("node:fs");
@@ -78129,7 +78185,7 @@ var generate26 = async (ctx) => {
78129
78185
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
78130
78186
  logRaw("");
78131
78187
  };
78132
- var configure19 = async (ctx) => {
78188
+ var configure20 = async (ctx) => {
78133
78189
  const pkg = `@sveltejs/adapter-cloudflare`;
78134
78190
  await installPackages([pkg], {
78135
78191
  dev: true,
@@ -78211,7 +78267,7 @@ var updateTypeDefinitions2 = (ctx) => {
78211
78267
  }
78212
78268
  });
78213
78269
  };
78214
- var config27 = {
78270
+ var config28 = {
78215
78271
  configVersion: 1,
78216
78272
  id: "svelte",
78217
78273
  frameworkCli: "sv",
@@ -78221,7 +78277,7 @@ var config27 = {
78221
78277
  path: "./templates"
78222
78278
  },
78223
78279
  generate: generate26,
78224
- configure: configure19,
78280
+ configure: configure20,
78225
78281
  transformPackageJson: async (original, ctx) => {
78226
78282
  let scripts = {
78227
78283
  preview: `${npm21} run build && wrangler pages dev`,
@@ -78240,14 +78296,14 @@ var config27 = {
78240
78296
  deployScript: "deploy",
78241
78297
  previewScript: "preview"
78242
78298
  };
78243
- var c3_default37 = config27;
78299
+ var c3_default38 = config28;
78244
78300
 
78245
78301
  // templates/vue/c3.ts
78246
78302
  var { npm: npm22 } = detectPackageManager();
78247
78303
  var generate27 = async (ctx) => {
78248
78304
  await runFrameworkGenerator(ctx, [ctx.project.name]);
78249
78305
  };
78250
- var config28 = {
78306
+ var config29 = {
78251
78307
  configVersion: 1,
78252
78308
  id: "vue",
78253
78309
  frameworkCli: "create-vue",
@@ -78264,13 +78320,13 @@ var config28 = {
78264
78320
  deployScript: "deploy",
78265
78321
  previewScript: "preview"
78266
78322
  };
78267
- var c3_default38 = config28;
78323
+ var c3_default39 = config29;
78268
78324
 
78269
78325
  // src/git.ts
78270
78326
  var import_node_assert = __toESM(require("node:assert"));
78271
78327
 
78272
78328
  // ../wrangler/package.json
78273
- var version2 = "3.113.0";
78329
+ var version2 = "3.114.0";
78274
78330
 
78275
78331
  // src/git.ts
78276
78332
  var offerGit = async (ctx) => {
@@ -78538,28 +78594,27 @@ function getFrameworkMap({ experimental = false }) {
78538
78594
  next: c3_default8,
78539
78595
  nuxt: c3_default9,
78540
78596
  qwik: c3_default10,
78541
- react: c3_default11,
78542
- remix: c3_default12,
78543
- solid: c3_default13,
78544
- svelte: c3_default14,
78545
- vue: c3_default15
78597
+ remix: c3_default11,
78598
+ solid: c3_default12,
78599
+ svelte: c3_default13,
78600
+ vue: c3_default14
78546
78601
  };
78547
78602
  } else {
78548
78603
  return {
78549
- analog: c3_default16,
78550
- angular: c3_default17,
78551
- astro: c3_default18,
78552
- docusaurus: c3_default22,
78553
- gatsby: c3_default23,
78554
- hono: c3_default26,
78555
- next: c3_default27,
78556
- nuxt: c3_default28,
78557
- qwik: c3_default32,
78558
- react: c3_default33,
78559
- remix: c3_default34,
78560
- solid: c3_default36,
78561
- svelte: c3_default37,
78562
- vue: c3_default38
78604
+ analog: c3_default15,
78605
+ angular: c3_default16,
78606
+ astro: c3_default17,
78607
+ docusaurus: c3_default21,
78608
+ gatsby: c3_default22,
78609
+ hono: c3_default25,
78610
+ next: c3_default26,
78611
+ nuxt: c3_default27,
78612
+ qwik: c3_default31,
78613
+ react: c3_default34,
78614
+ remix: c3_default35,
78615
+ solid: c3_default37,
78616
+ svelte: c3_default38,
78617
+ vue: c3_default39
78563
78618
  };
78564
78619
  }
78565
78620
  }
@@ -78572,13 +78627,13 @@ function getTemplateMap({ experimental = false }) {
78572
78627
  };
78573
78628
  } else {
78574
78629
  return {
78575
- "hello-world": c3_default25,
78576
- common: c3_default19,
78577
- scheduled: c3_default35,
78578
- queues: c3_default31,
78579
- "hello-world-durable-object": c3_default24,
78580
- openapi: c3_default29,
78581
- "pre-existing": c3_default30
78630
+ "hello-world": c3_default24,
78631
+ common: c3_default18,
78632
+ scheduled: c3_default36,
78633
+ queues: c3_default30,
78634
+ "hello-world-durable-object": c3_default23,
78635
+ openapi: c3_default28,
78636
+ "pre-existing": c3_default29
78582
78637
  };
78583
78638
  }
78584
78639
  }
@@ -78726,8 +78781,8 @@ var createContext = async (args, prevArgs) => {
78726
78781
  experimental: args.experimental
78727
78782
  });
78728
78783
  const frameworkOptions = Object.entries(frameworkMap).map(
78729
- ([key, config29]) => ({
78730
- label: config29.displayName,
78784
+ ([key, config30]) => ({
78785
+ label: config30.displayName,
78731
78786
  value: key
78732
78787
  })
78733
78788
  );
@@ -78894,28 +78949,28 @@ var processRemoteTemplate = async (args) => {
78894
78949
  src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
78895
78950
  }
78896
78951
  const path6 = await downloadRemoteTemplate(src);
78897
- const config29 = inferTemplateConfig(path6);
78898
- validateTemplate(path6, config29);
78952
+ const config30 = inferTemplateConfig(path6);
78953
+ validateTemplate(path6, config30);
78899
78954
  updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
78900
78955
  return {
78901
78956
  path: path6,
78902
- ...config29
78957
+ ...config30
78903
78958
  };
78904
78959
  };
78905
- var validateTemplate = (path6, config29) => {
78906
- if (!config29.copyFiles) {
78960
+ var validateTemplate = (path6, config30) => {
78961
+ if (!config30.copyFiles) {
78907
78962
  return;
78908
78963
  }
78909
- if (isVariantInfo(config29.copyFiles)) {
78910
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config29.copyFiles.path), config29);
78964
+ if (isVariantInfo(config30.copyFiles)) {
78965
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config30.copyFiles.path), config30);
78911
78966
  } else {
78912
- for (const variant of Object.values(config29.copyFiles.variants)) {
78913
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config29);
78967
+ for (const variant of Object.values(config30.copyFiles.variants)) {
78968
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config30);
78914
78969
  }
78915
78970
  }
78916
78971
  };
78917
- var validateTemplateSrcDirectory = (path6, config29) => {
78918
- if (config29.platform === "workers") {
78972
+ var validateTemplateSrcDirectory = (path6, config30) => {
78973
+ if (config30.platform === "workers") {
78919
78974
  const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
78920
78975
  const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
78921
78976
  const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
@@ -80812,20 +80867,20 @@ function applyEdits(text, edits) {
80812
80867
  var import_fs12 = require("fs");
80813
80868
  var import_path14 = require("path");
80814
80869
  var import_toml2 = __toESM(require_toml());
80815
- function ensureNameExists(config29, projectName) {
80816
- config29["name"] = projectName;
80817
- return config29;
80870
+ function ensureNameExists(config30, projectName) {
80871
+ config30["name"] = projectName;
80872
+ return config30;
80818
80873
  }
80819
- async function ensureCompatDateExists(config29) {
80820
- if (typeof config29["compatibility_date"] === "string") {
80874
+ async function ensureCompatDateExists(config30) {
80875
+ if (typeof config30["compatibility_date"] === "string") {
80821
80876
  const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
80822
- if (!config29["compatibility_date"].match(validCompatDateRe)) {
80823
- config29["compatibility_date"] = await getWorkerdCompatibilityDate();
80877
+ if (!config30["compatibility_date"].match(validCompatDateRe)) {
80878
+ config30["compatibility_date"] = await getWorkerdCompatibilityDate();
80824
80879
  }
80825
80880
  } else {
80826
- config29["compatibility_date"] = await getWorkerdCompatibilityDate();
80881
+ config30["compatibility_date"] = await getWorkerdCompatibilityDate();
80827
80882
  }
80828
- return config29;
80883
+ return config30;
80829
80884
  }
80830
80885
  var updateWranglerConfig = async (ctx) => {
80831
80886
  if (wranglerJsonExists(ctx)) {
@@ -81539,8 +81594,8 @@ var renderValues = (values) => {
81539
81594
  };
81540
81595
 
81541
81596
  // src/helpers/retry.ts
81542
- var retry = async (config29, fn) => {
81543
- let { times } = config29;
81597
+ var retry = async (config30, fn) => {
81598
+ let { times } = config30;
81544
81599
  let error2 = null;
81545
81600
  while (times > 0) {
81546
81601
  try {
@@ -81548,10 +81603,10 @@ var retry = async (config29, fn) => {
81548
81603
  } catch (e) {
81549
81604
  error2 = e;
81550
81605
  times--;
81551
- if (config29.exitCondition?.(e)) {
81606
+ if (config30.exitCondition?.(e)) {
81552
81607
  break;
81553
81608
  }
81554
- await sleep(config29.sleepMs ?? 1e3);
81609
+ await sleep(config30.sleepMs ?? 1e3);
81555
81610
  }
81556
81611
  }
81557
81612
  throw error2;
@@ -81671,8 +81726,8 @@ async function addWorkersTypesToTsConfig(ctx) {
81671
81726
  }
81672
81727
  const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
81673
81728
  try {
81674
- const config29 = parse4(tsconfig);
81675
- const currentTypes = config29.compilerOptions?.types ?? [];
81729
+ const config30 = parse4(tsconfig);
81730
+ const currentTypes = config30.compilerOptions?.types ?? [];
81676
81731
  const explicitEntrypoint = currentTypes.some(
81677
81732
  (t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
81678
81733
  );
@@ -81747,7 +81802,7 @@ var runCli = async (args) => {
81747
81802
  printBanner(args);
81748
81803
  const ctx = await createContext(args);
81749
81804
  await create(ctx);
81750
- await configure20(ctx);
81805
+ await configure21(ctx);
81751
81806
  await deploy(ctx);
81752
81807
  printSummary(ctx);
81753
81808
  logRaw("");
@@ -81775,7 +81830,7 @@ var create = async (ctx) => {
81775
81830
  await rectifyPmMismatch(ctx);
81776
81831
  endSection(`Application created`);
81777
81832
  };
81778
- var configure20 = async (ctx) => {
81833
+ var configure21 = async (ctx) => {
81779
81834
  startSection("Configuring your application for Cloudflare", "Step 2 of 3");
81780
81835
  await installWrangler();
81781
81836
  await installWorkersTypes(ctx);