create-cloudflare 0.0.0-56a8aed96 → 0.0.0-56c4ba952

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 (38) hide show
  1. package/dist/cli.js +626 -518
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +5 -4
  4. package/templates/docusaurus/c3.ts +5 -25
  5. package/templates/docusaurus/pages/c3.ts +30 -0
  6. package/{templates-experimental/docusaurus → templates/docusaurus/workers}/c3.ts +2 -2
  7. package/templates/hello-world/js/package.json +2 -2
  8. package/templates/hello-world/ts/package.json +2 -2
  9. package/templates/react/c3.ts +5 -57
  10. package/templates/react/pages/c3.ts +62 -0
  11. package/{templates-experimental/react → templates/react/workers}/c3.ts +4 -3
  12. package/{templates-experimental/react → templates/react/workers}/ts/api/index.ts +0 -4
  13. package/{templates-experimental/react → templates/react/workers}/ts/tsconfig.worker.json +1 -1
  14. package/templates/react/workers/ts/worker-configuration.d.ts +5 -0
  15. package/templates-experimental/hello-world-with-assets/js/package.json +2 -2
  16. package/templates-experimental/hello-world-with-assets/ts/package.json +2 -2
  17. package/templates-experimental/vue/c3.ts +69 -4
  18. package/templates-experimental/vue/js/server/index.js +13 -0
  19. package/templates-experimental/vue/js/src/App.vue +107 -0
  20. package/templates-experimental/vue/js/src/components/HelloWorld.vue +47 -0
  21. package/templates-experimental/vue/js/vite.config.js +21 -0
  22. package/templates-experimental/vue/js/wrangler.jsonc +12 -0
  23. package/templates-experimental/vue/ts/server/index.ts +13 -0
  24. package/templates-experimental/vue/ts/src/App.vue +107 -0
  25. package/templates-experimental/vue/ts/src/components/HelloWorld.vue +44 -0
  26. package/templates-experimental/vue/ts/tsconfig.worker.json +8 -0
  27. package/templates-experimental/vue/ts/vite.config.ts +21 -0
  28. package/templates-experimental/vue/ts/worker-configuration.d.ts +6 -0
  29. package/templates-experimental/vue/ts/wrangler.jsonc +12 -0
  30. package/templates-experimental/vue/templates/wrangler.jsonc +0 -10
  31. /package/{templates-experimental/docusaurus → templates/docusaurus/workers}/templates/wrangler.jsonc +0 -0
  32. /package/{templates-experimental/react → templates/react/workers}/js/api/index.js +0 -0
  33. /package/{templates-experimental/react → templates/react/workers}/js/src/App.jsx +0 -0
  34. /package/{templates-experimental/react → templates/react/workers}/js/src/assets/Cloudflare_Logo.svg +0 -0
  35. /package/{templates-experimental/react/js/wrangler.json → templates/react/workers/js/wrangler.jsonc} +0 -0
  36. /package/{templates-experimental/react → templates/react/workers}/ts/src/App.tsx +0 -0
  37. /package/{templates-experimental/react → templates/react/workers}/ts/src/assets/Cloudflare_Logo.svg +0 -0
  38. /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 config28(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 config28 = 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: config28, 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 config28 = 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: config28, 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 config28 = 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: config28, 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 config28 = (0, _lodash["default"])(options, this.config);
31623
- if (config28.tokenHex === true) {
31624
- config28.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 (!config28.tokenLength)
31629
- config28.tokenLength = 0;
31628
+ if (!config30.tokenLength)
31629
+ config30.tokenLength = 0;
31630
31630
  var token = "";
31631
- for (var i = 0; i < config28.tokenLength; i++) {
31632
- token += this._randomElement(config28.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(config28.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, config28) {
40194
+ function Tokenizer2(code, config30) {
40195
40195
  this.errorHandler = new error_handler_1.ErrorHandler();
40196
- this.errorHandler.tolerant = config28 ? typeof config28.tolerant === "boolean" && config28.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 = config28 ? typeof config28.comment === "boolean" && config28.comment : false;
40199
- this.trackRange = config28 ? typeof config28.range === "boolean" && config28.range : false;
40200
- this.trackLoc = config28 ? typeof config28.loc === "boolean" && config28.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(config28) {
50023
+ var Printer = function Printer2(config30) {
50024
50024
  assert_1.default.ok(this instanceof Printer2);
50025
- var explicitTabWidth = config28 && config28.tabWidth;
50026
- config28 = options_1.normalize(config28);
50027
- config28.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 = config28.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
- config28.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, config28, options, makePrintFunctionWith(options, {
50060
+ ) : genericPrint(path6, config30, options, makePrintFunctionWith(options, {
50061
50061
  includeComments: true,
50062
50062
  avoidRootParens: false
50063
50063
  }));
50064
- config28.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(config28), util.composeSourceMaps(config28.inputSourceMap, lines.getSourceMap(config28.sourceMapName, config28.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, config28, {
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 = config28.reuseWhitespace;
50091
- config28.reuseWhitespace = false;
50092
- var pr = new PrintResult(printGenerically(path6).toString(config28));
50093
- config28.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, config28, 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, config28, 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 = (config28, value) => {
69794
- const { question, label } = config28;
69795
- if (config28.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 = config28.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 = (config28) => {
69802
- switch (config28.type) {
69801
+ var getRenderers = (config30) => {
69802
+ switch (config30.type) {
69803
69803
  case "select":
69804
- return getSelectRenderers(config28);
69804
+ return getSelectRenderers(config30);
69805
69805
  case "confirm":
69806
- return getConfirmRenderers(config28);
69806
+ return getConfirmRenderers(config30);
69807
69807
  case "text":
69808
- return getTextRenderers(config28);
69808
+ return getTextRenderers(config30);
69809
69809
  case "multiselect":
69810
- return getSelectRenderers(config28);
69810
+ return getSelectRenderers(config30);
69811
69811
  case "list":
69812
- return getSelectListRenderers(config28);
69812
+ return getSelectListRenderers(config30);
69813
69813
  }
69814
69814
  };
69815
- var getTextRenderers = (config28) => {
69816
- const { question } = config28;
69817
- const helpText = config28.helpText ?? "";
69818
- const format5 = config28.format ?? ((val) => String(val));
69819
- const defaultValue = config28.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 = (config28) => {
69839
69839
  ``
69840
69840
  // extra line for readability
69841
69841
  ],
69842
- submit: ({ value }) => renderSubmit(config28, format5(value ?? "")),
69842
+ submit: ({ value }) => renderSubmit(config30, format5(value ?? "")),
69843
69843
  cancel: activeRenderer
69844
69844
  };
69845
69845
  };
69846
- var getSelectRenderers = (config28) => {
69847
- const { options, question, helpText: _helpText } = config28;
69846
+ var getSelectRenderers = (config30) => {
69847
+ const { options, question, helpText: _helpText } = config30;
69848
69848
  const helpText = _helpText ?? "";
69849
- const maxItemsPerPage = config28.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
- config28,
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
- config28,
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 = (config28) => {
69937
- const { question, helpText: _helpText } = config28;
69938
- let options = config28.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 = (config28) => {
70016
70016
  submit: ({ value }) => {
70017
70017
  if (Array.isArray(value)) {
70018
70018
  return renderSubmit(
70019
- config28,
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
- config28,
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 = (config28) => {
70032
- const { activeText, inactiveText, question, helpText: _helpText } = config28;
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 = (config28) => {
70046
70046
  active: defaultRenderer,
70047
70047
  confirm: defaultRenderer,
70048
70048
  error: defaultRenderer,
70049
- submit: ({ value }) => renderSubmit(config28, 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 config28 = 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
- config28 = resolveConfig(resolvedConfigPath);
71024
+ config30 = resolveConfig(resolvedConfigPath);
71025
71025
  } catch (e) {
71026
- config28 = e;
71026
+ config30 = e;
71027
71027
  }
71028
- if (config28 instanceof Error) {
71029
- error2 = config28;
71028
+ if (config30 instanceof Error) {
71029
+ error2 = config30;
71030
71030
  return;
71031
71031
  }
71032
71032
  } else {
71033
- config28 = mixin2.require(resolvedConfigPath);
71033
+ config30 = mixin2.require(resolvedConfigPath);
71034
71034
  }
71035
- setConfigObject(config28);
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(config28, prev) {
71046
- Object.keys(config28).forEach(function(key) {
71047
- const value = config28[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 config28 = 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: config28
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(config28, cwd, mergeExtends, _shim) {
73426
+ function applyExtends(config30, cwd, mergeExtends, _shim) {
73427
73427
  shim2 = _shim;
73428
73428
  let defaultConfig = {};
73429
- if (Object.prototype.hasOwnProperty.call(config28, "extends")) {
73430
- if (typeof config28.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(config28.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(config28.extends);
73436
+ pathToDefault = require.resolve(config30.extends);
73437
73437
  } catch (_err) {
73438
- return config28;
73438
+ return config30;
73439
73439
  }
73440
73440
  } else {
73441
- pathToDefault = getPathToDefaultConfig(cwd, config28.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(config28.extends);
73446
- delete config28.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, config28) : Object.assign({}, defaultConfig, config28);
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, config28) {
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(config28)) {
73467
- if (isObject(config28[key]) && isObject(target[key])) {
73468
- target[key] = mergeDeep(config1[key], config28[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] = config28[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(config28) {
74232
- argsert("<object>", [config28], arguments.length);
74233
- __classPrivateFieldSet(this, _YargsInstance_parserConfig, config28, "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(config28) {
74406
- argsert("<object>", [config28], arguments.length);
74407
- __classPrivateFieldSet(this, _YargsInstance_usageConfig, config28, "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 config28 = 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, ...config28 }
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 = "0.0.0-56a8aed96";
74980
+ var version = "0.0.0-56c4ba952";
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(config28) {
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
- config28,
75029
+ config30,
75030
75030
  (_key, value) => value instanceof Date ? value.toISOString() : value,
75031
75031
  " "
75032
75032
  )
@@ -75034,9 +75034,9 @@ function writeMetricsConfig(config28) {
75034
75034
  }
75035
75035
  function readMetricsConfig() {
75036
75036
  try {
75037
- const config28 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
75037
+ const config30 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
75038
75038
  return JSON.parse(
75039
- config28,
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(config28) {
75050
- const deviceId = config28.deviceId ?? (0, import_node_crypto.randomUUID)();
75051
- if (config28.deviceId === void 0) {
75052
- writeMetricsConfig({ ...config28, 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 config28 = readMetricsConfig() ?? {};
75328
- const isFirstUsage = config28.c3permission === void 0;
75327
+ const config30 = readMetricsConfig() ?? {};
75328
+ const isFirstUsage = config30.c3permission === void 0;
75329
75329
  const isEnabled = isTelemetryEnabled();
75330
- const deviceId = getDeviceId(config28);
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(config28).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(config28 = readMetricsConfig() ?? {}) {
75470
- if (!config28.c3permission) {
75471
- config28.c3permission = initializeC3Permission();
75472
- writeMetricsConfig(config28);
75469
+ function getC3Permission(config30 = readMetricsConfig() ?? {}) {
75470
+ if (!config30.c3permission) {
75471
+ config30.c3permission = initializeC3Permission();
75472
+ writeMetricsConfig(config30);
75473
75473
  }
75474
- return config28.c3permission;
75474
+ return config30.c3permission;
75475
75475
  }
75476
75476
  function updateC3Pemission(enabled) {
75477
- const config28 = readMetricsConfig();
75478
- if (config28.c3permission?.enabled === enabled) {
75477
+ const config30 = readMetricsConfig();
75478
+ if (config30.c3permission?.enabled === enabled) {
75479
75479
  return;
75480
75480
  }
75481
- config28.c3permission = initializeC3Permission(enabled);
75482
- writeMetricsConfig(config28);
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, config28 = {}) => {
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 = config28.dev ? "-D" : "";
75534
+ saveFlag = config30.dev ? "-D" : "";
75535
75535
  break;
75536
75536
  case "bun":
75537
75537
  cmd = "add";
75538
- saveFlag = config28.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 = config28.dev ? "--save-dev" : "";
75544
+ saveFlag = config30.dev ? "--save-dev" : "";
75545
75545
  break;
75546
75546
  }
75547
75547
  await runCommand([npm24, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
75548
- ...config28,
75548
+ ...config30,
75549
75549
  silent: true
75550
75550
  });
75551
75551
  };
@@ -76016,37 +76016,9 @@ var config2 = {
76016
76016
  };
76017
76017
  var c3_default2 = config2;
76018
76018
 
76019
- // templates-experimental/docusaurus/c3.ts
76019
+ // templates-experimental/gatsby/c3.ts
76020
76020
  var { npm: npm2 } = detectPackageManager();
76021
76021
  var generate3 = async (ctx) => {
76022
- await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
76023
- };
76024
- var config3 = {
76025
- configVersion: 1,
76026
- id: "docusaurus",
76027
- frameworkCli: "create-docusaurus",
76028
- platform: "workers",
76029
- displayName: "Docusaurus",
76030
- copyFiles: {
76031
- path: "./templates"
76032
- },
76033
- path: "templates-experimental/docusaurus",
76034
- generate: generate3,
76035
- transformPackageJson: async () => ({
76036
- scripts: {
76037
- deploy: `${npm2} run build && wrangler deploy`,
76038
- preview: `${npm2} run build && wrangler dev`
76039
- }
76040
- }),
76041
- devScript: "start",
76042
- deployScript: "deploy",
76043
- previewScript: "preview"
76044
- };
76045
- var c3_default3 = config3;
76046
-
76047
- // templates-experimental/gatsby/c3.ts
76048
- var { npm: npm3 } = detectPackageManager();
76049
- var generate4 = async (ctx) => {
76050
76022
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
76051
76023
  const useTemplate = await inputPrompt({
76052
76024
  type: "confirm",
@@ -76065,7 +76037,7 @@ var generate4 = async (ctx) => {
76065
76037
  }
76066
76038
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
76067
76039
  };
76068
- var config4 = {
76040
+ var config3 = {
76069
76041
  configVersion: 1,
76070
76042
  id: "gatsby",
76071
76043
  frameworkCli: "gatsby",
@@ -76075,21 +76047,21 @@ var config4 = {
76075
76047
  path: "./templates"
76076
76048
  },
76077
76049
  path: "templates-experimental/gatsby",
76078
- generate: generate4,
76050
+ generate: generate3,
76079
76051
  transformPackageJson: async () => ({
76080
76052
  scripts: {
76081
- deploy: `${npm3} run build && wrangler deploy`,
76082
- preview: `${npm3} run build && wrangler dev`
76053
+ deploy: `${npm2} run build && wrangler deploy`,
76054
+ preview: `${npm2} run build && wrangler dev`
76083
76055
  }
76084
76056
  }),
76085
76057
  devScript: "develop",
76086
76058
  deployScript: "deploy",
76087
76059
  previewScript: "preview"
76088
76060
  };
76089
- var c3_default4 = config4;
76061
+ var c3_default3 = config3;
76090
76062
 
76091
76063
  // templates-experimental/hello-world-assets-only/c3.ts
76092
- var config5 = {
76064
+ var config4 = {
76093
76065
  configVersion: 1,
76094
76066
  id: "hello-world-assets-only",
76095
76067
  path: "templates-experimental/hello-world-assets-only",
@@ -76100,10 +76072,10 @@ var config5 = {
76100
76072
  path: "./templates"
76101
76073
  }
76102
76074
  };
76103
- var c3_default5 = config5;
76075
+ var c3_default4 = config4;
76104
76076
 
76105
76077
  // templates-experimental/hello-world-durable-object-with-assets/c3.ts
76106
- var config6 = {
76078
+ var config5 = {
76107
76079
  configVersion: 1,
76108
76080
  id: "hello-world-durable-object-with-assets",
76109
76081
  path: "templates-experimental/hello-world-durable-object-with-assets",
@@ -76121,10 +76093,10 @@ var config6 = {
76121
76093
  }
76122
76094
  }
76123
76095
  };
76124
- var c3_default6 = config6;
76096
+ var c3_default5 = config5;
76125
76097
 
76126
76098
  // templates-experimental/hello-world-with-assets/c3.ts
76127
- var c3_default7 = {
76099
+ var c3_default6 = {
76128
76100
  configVersion: 1,
76129
76101
  id: "hello-world-with-assets",
76130
76102
  path: "templates-experimental/hello-world-with-assets",
@@ -76147,7 +76119,7 @@ var c3_default7 = {
76147
76119
  };
76148
76120
 
76149
76121
  // templates-experimental/hono/c3.ts
76150
- var generate5 = async (ctx) => {
76122
+ var generate4 = async (ctx) => {
76151
76123
  const { name: pm4 } = detectPackageManager();
76152
76124
  await runFrameworkGenerator(ctx, [
76153
76125
  ctx.project.name,
@@ -76159,7 +76131,7 @@ var generate5 = async (ctx) => {
76159
76131
  ]);
76160
76132
  logRaw("");
76161
76133
  };
76162
- var config7 = {
76134
+ var config6 = {
76163
76135
  configVersion: 1,
76164
76136
  id: "hono",
76165
76137
  frameworkCli: "create-hono",
@@ -76169,7 +76141,7 @@ var config7 = {
76169
76141
  },
76170
76142
  platform: "workers",
76171
76143
  path: "templates-experimental/hono",
76172
- generate: generate5,
76144
+ generate: generate4,
76173
76145
  transformPackageJson: async () => ({
76174
76146
  scripts: {
76175
76147
  dev: "wrangler dev",
@@ -76181,10 +76153,10 @@ var config7 = {
76181
76153
  deployScript: "deploy",
76182
76154
  previewScript: "dev"
76183
76155
  };
76184
- var c3_default8 = config7;
76156
+ var c3_default7 = config6;
76185
76157
 
76186
76158
  // templates-experimental/next/c3.ts
76187
- var generate6 = async (ctx) => {
76159
+ var generate5 = async (ctx) => {
76188
76160
  await runFrameworkGenerator(ctx, [ctx.project.name]);
76189
76161
  };
76190
76162
  var configure3 = async () => {
@@ -76212,7 +76184,7 @@ var updateNextConfig = () => {
76212
76184
  writeFile2(configFile, updatedConfigFile);
76213
76185
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76214
76186
  };
76215
- var c3_default9 = {
76187
+ var c3_default8 = {
76216
76188
  configVersion: 1,
76217
76189
  id: "next",
76218
76190
  frameworkCli: "create-next-app",
@@ -76226,7 +76198,7 @@ var c3_default9 = {
76226
76198
  copyFiles: {
76227
76199
  path: "./templates"
76228
76200
  },
76229
- generate: generate6,
76201
+ generate: generate5,
76230
76202
  configure: configure3,
76231
76203
  transformPackageJson: async () => ({
76232
76204
  scripts: {
@@ -76295,14 +76267,14 @@ function getLatestTypesEntrypoint(ctx) {
76295
76267
 
76296
76268
  // templates-experimental/nuxt/c3.ts
76297
76269
  var recast3 = __toESM(require_main3());
76298
- var { npm: npm4, name: pm } = detectPackageManager();
76299
- var generate7 = async (ctx) => {
76270
+ var { npm: npm3, name: pm } = detectPackageManager();
76271
+ var generate6 = async (ctx) => {
76300
76272
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
76301
76273
  await runFrameworkGenerator(ctx, [
76302
76274
  "init",
76303
76275
  ctx.project.name,
76304
76276
  "--packageManager",
76305
- npm4,
76277
+ npm3,
76306
76278
  gitFlag
76307
76279
  ]);
76308
76280
  writeFile2("./.node-version", "18");
@@ -76316,7 +76288,7 @@ var configure4 = async (ctx) => {
76316
76288
  await installPackages(packages, {
76317
76289
  dev: true,
76318
76290
  startText: "Installing nitro module `nitro-cloudflare-dev`",
76319
- doneText: `${brandColor("installed")} ${dim(`via \`${npm4} install\``)}`
76291
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm3} install\``)}`
76320
76292
  });
76321
76293
  updateNuxtConfig();
76322
76294
  updateEnvTypes(ctx);
@@ -76367,7 +76339,7 @@ var updateNuxtConfig = () => {
76367
76339
  });
76368
76340
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76369
76341
  };
76370
- var config8 = {
76342
+ var config7 = {
76371
76343
  configVersion: 1,
76372
76344
  id: "nuxt",
76373
76345
  frameworkCli: "nuxi",
@@ -76377,12 +76349,12 @@ var config8 = {
76377
76349
  path: "./templates"
76378
76350
  },
76379
76351
  path: "templates-experimental/nuxt",
76380
- generate: generate7,
76352
+ generate: generate6,
76381
76353
  configure: configure4,
76382
76354
  transformPackageJson: async () => ({
76383
76355
  scripts: {
76384
- deploy: `${npm4} run build && wrangler deploy`,
76385
- preview: `${npm4} run build && wrangler dev`,
76356
+ deploy: `${npm3} run build && wrangler deploy`,
76357
+ preview: `${npm3} run build && wrangler dev`,
76386
76358
  "cf-typegen": `wrangler types`
76387
76359
  }
76388
76360
  }),
@@ -76390,16 +76362,16 @@ var config8 = {
76390
76362
  deployScript: "deploy",
76391
76363
  previewScript: "preview"
76392
76364
  };
76393
- var c3_default10 = config8;
76365
+ var c3_default9 = config7;
76394
76366
 
76395
76367
  // templates-experimental/qwik/c3.ts
76396
76368
  var recast4 = __toESM(require_main3());
76397
- var { npm: npm5, npx: npx2, name } = detectPackageManager();
76398
- var generate8 = async (ctx) => {
76369
+ var { npm: npm4, npx: npx2, name } = detectPackageManager();
76370
+ var generate7 = async (ctx) => {
76399
76371
  await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
76400
76372
  };
76401
76373
  var configure5 = async (ctx) => {
76402
- const cmd = [name === "pnpm" ? npm5 : npx2, "qwik", "add", "cloudflare-pages"];
76374
+ const cmd = [name === "pnpm" ? npm4 : npx2, "qwik", "add", "cloudflare-pages"];
76403
76375
  endSection(`Running ${quoteShellArgs(cmd)}`);
76404
76376
  await runCommand(cmd);
76405
76377
  removeFile("./public/_headers");
@@ -76478,7 +76450,7 @@ var populateCloudflareEnv = () => {
76478
76450
  });
76479
76451
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
76480
76452
  };
76481
- var config9 = {
76453
+ var config8 = {
76482
76454
  configVersion: 1,
76483
76455
  id: "qwik",
76484
76456
  frameworkCli: "create-qwik",
@@ -76488,12 +76460,12 @@ var config9 = {
76488
76460
  path: "./templates"
76489
76461
  },
76490
76462
  path: "templates-experimental/qwik",
76491
- generate: generate8,
76463
+ generate: generate7,
76492
76464
  configure: configure5,
76493
76465
  transformPackageJson: async () => ({
76494
76466
  scripts: {
76495
- deploy: `${npm5} run build && wrangler deploy`,
76496
- preview: `${npm5} run build && wrangler dev`,
76467
+ deploy: `${npm4} run build && wrangler deploy`,
76468
+ preview: `${npm4} run build && wrangler dev`,
76497
76469
  "cf-typegen": `wrangler types`
76498
76470
  }
76499
76471
  }),
@@ -76501,148 +76473,11 @@ var config9 = {
76501
76473
  deployScript: "deploy",
76502
76474
  previewScript: "preview"
76503
76475
  };
76504
- var c3_default11 = config9;
76505
-
76506
- // templates-experimental/react/c3.ts
76507
- var import_assert2 = __toESM(require("assert"));
76508
- var recast5 = __toESM(require_main3());
76509
- var b2 = recast5.types.builders;
76510
- var t = recast5.types.namedTypes;
76511
- var { npm: npm6 } = detectPackageManager();
76512
- var generate9 = async (ctx) => {
76513
- const variant = await getVariant();
76514
- ctx.args.lang = variant.lang;
76515
- await runFrameworkGenerator(ctx, [
76516
- ctx.project.name,
76517
- "--template",
76518
- variant.value
76519
- ]);
76520
- logRaw("");
76521
- };
76522
- var configure6 = async (ctx) => {
76523
- await installPackages(["@cloudflare/vite-plugin"], {
76524
- dev: true,
76525
- startText: "Installing the Cloudflare Vite plugin",
76526
- doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`
76527
- });
76528
- await transformViteConfig(ctx);
76529
- if (usesTypescript(ctx)) {
76530
- updateTsconfigJson();
76531
- }
76532
- };
76533
- function transformViteConfig(ctx) {
76534
- const filePath = `vite.config.${usesTypescript(ctx) ? "ts" : "js"}`;
76535
- transformFile(filePath, {
76536
- visitProgram(n) {
76537
- const lastImportIndex = n.node.body.findLastIndex(
76538
- (statement) => statement.type === "ImportDeclaration"
76539
- );
76540
- const lastImport = n.get("body", lastImportIndex);
76541
- const importAst = b2.importDeclaration(
76542
- [b2.importSpecifier(b2.identifier("cloudflare"))],
76543
- b2.stringLiteral("@cloudflare/vite-plugin")
76544
- );
76545
- lastImport.insertAfter(importAst);
76546
- return this.traverse(n);
76547
- },
76548
- visitCallExpression: function(n) {
76549
- const callee = n.node.callee;
76550
- if (callee.name !== "defineConfig") {
76551
- return this.traverse(n);
76552
- }
76553
- const config28 = n.node.arguments[0];
76554
- (0, import_assert2.default)(t.ObjectExpression.check(config28));
76555
- const pluginsProp = config28.properties.find((prop) => isPluginsProp(prop));
76556
- (0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
76557
- pluginsProp.value.elements.push(
76558
- b2.callExpression(b2.identifier("cloudflare"), [])
76559
- );
76560
- return false;
76561
- }
76562
- });
76563
- }
76564
- function isPluginsProp(prop) {
76565
- return (t.Property.check(prop) || t.ObjectProperty.check(prop)) && t.Identifier.check(prop.key) && prop.key.name === "plugins";
76566
- }
76567
- function updateTsconfigJson() {
76568
- const s = spinner();
76569
- s.start(`Updating tsconfig.json config`);
76570
- const tsconfig = readJSON("tsconfig.json");
76571
- if (tsconfig && typeof tsconfig === "object") {
76572
- tsconfig.references ??= [];
76573
- tsconfig.references.push({ path: "./tsconfig.worker.json" });
76574
- }
76575
- writeJSON("tsconfig.json", tsconfig);
76576
- s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
76577
- }
76578
- async function getVariant() {
76579
- const variantsOptions2 = [
76580
- {
76581
- value: "react-ts",
76582
- lang: "ts",
76583
- label: "TypeScript"
76584
- },
76585
- {
76586
- value: "react-swc-ts",
76587
- lang: "ts",
76588
- label: "TypeScript + SWC"
76589
- },
76590
- {
76591
- value: "react",
76592
- lang: "js",
76593
- label: "JavaScript"
76594
- },
76595
- {
76596
- value: "react-swc",
76597
- lang: "js",
76598
- label: "JavaScript + SWC"
76599
- }
76600
- ];
76601
- const value = await inputPrompt({
76602
- type: "select",
76603
- question: "Select a variant:",
76604
- label: "variant",
76605
- options: variantsOptions2,
76606
- defaultValue: variantsOptions2[0].value
76607
- });
76608
- const selected = variantsOptions2.find((variant) => variant.value === value);
76609
- (0, import_assert2.default)(selected, "Expected a variant to be selected");
76610
- return selected;
76611
- }
76612
- var config10 = {
76613
- configVersion: 1,
76614
- id: "react",
76615
- frameworkCli: "create-vite",
76616
- displayName: "React",
76617
- platform: "workers",
76618
- path: "templates-experimental/react",
76619
- copyFiles: {
76620
- variants: {
76621
- ts: {
76622
- path: "./ts"
76623
- },
76624
- js: {
76625
- path: "./js"
76626
- }
76627
- }
76628
- },
76629
- generate: generate9,
76630
- configure: configure6,
76631
- transformPackageJson: async () => ({
76632
- scripts: {
76633
- deploy: `${npm6} run build && wrangler deploy`,
76634
- preview: `${npm6} run build && vite preview`
76635
- }
76636
- }),
76637
- devScript: "dev",
76638
- deployScript: "deploy",
76639
- previewScript: "preview"
76640
- };
76641
- var c3_default12 = config10;
76476
+ var c3_default10 = config8;
76642
76477
 
76643
76478
  // templates-experimental/remix/c3.ts
76644
- var { npm: npm7 } = detectPackageManager();
76645
- var generate10 = async (ctx) => {
76479
+ var { npm: npm5 } = detectPackageManager();
76480
+ var generate8 = async (ctx) => {
76646
76481
  await runFrameworkGenerator(ctx, [
76647
76482
  ctx.project.name,
76648
76483
  "--template",
@@ -76650,14 +76485,14 @@ var generate10 = async (ctx) => {
76650
76485
  ]);
76651
76486
  logRaw("");
76652
76487
  };
76653
- var configure7 = async () => {
76488
+ var configure6 = async () => {
76654
76489
  await installPackages(["wrangler@latest"], {
76655
76490
  dev: true,
76656
76491
  startText: "Updating the Wrangler version",
76657
76492
  doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
76658
76493
  });
76659
76494
  };
76660
- var config11 = {
76495
+ var config9 = {
76661
76496
  configVersion: 1,
76662
76497
  id: "remix",
76663
76498
  frameworkCli: "create-remix",
@@ -76667,12 +76502,12 @@ var config11 = {
76667
76502
  path: "./templates"
76668
76503
  },
76669
76504
  path: "templates-experimental/remix",
76670
- generate: generate10,
76671
- configure: configure7,
76505
+ generate: generate8,
76506
+ configure: configure6,
76672
76507
  transformPackageJson: async () => ({
76673
76508
  scripts: {
76674
- deploy: `${npm7} run build && wrangler deploy`,
76675
- preview: `${npm7} run build && wrangler dev`,
76509
+ deploy: `${npm5} run build && wrangler deploy`,
76510
+ preview: `${npm5} run build && wrangler dev`,
76676
76511
  "cf-typegen": `wrangler types`
76677
76512
  }
76678
76513
  }),
@@ -76680,21 +76515,21 @@ var config11 = {
76680
76515
  deployScript: "deploy",
76681
76516
  previewScript: "preview"
76682
76517
  };
76683
- var c3_default13 = config11;
76518
+ var c3_default11 = config9;
76684
76519
 
76685
76520
  // templates-experimental/solid/c3.ts
76686
- var recast6 = __toESM(require_main3());
76687
- var { npm: npm8 } = detectPackageManager();
76688
- var generate11 = async (ctx) => {
76521
+ var recast5 = __toESM(require_main3());
76522
+ var { npm: npm6 } = detectPackageManager();
76523
+ var generate9 = async (ctx) => {
76689
76524
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
76690
76525
  logRaw("");
76691
76526
  };
76692
- var configure8 = async (ctx) => {
76527
+ var configure7 = async (ctx) => {
76693
76528
  const packages = ["nitropack"];
76694
76529
  await installPackages(packages, {
76695
76530
  dev: true,
76696
76531
  startText: "Installing nitro module `nitropack`",
76697
- doneText: `${brandColor("installed")} ${dim(`via \`${npm8} install\``)}`
76532
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
76698
76533
  });
76699
76534
  usesTypescript(ctx);
76700
76535
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
@@ -76706,7 +76541,7 @@ var configure8 = async (ctx) => {
76706
76541
  if (callee.name !== "defineConfig") {
76707
76542
  return this.traverse(n);
76708
76543
  }
76709
- const b3 = recast6.types.builders;
76544
+ const b3 = recast5.types.builders;
76710
76545
  mergeObjectProperties(
76711
76546
  n.node.arguments[0],
76712
76547
  [
@@ -76730,7 +76565,7 @@ var configure8 = async (ctx) => {
76730
76565
  }
76731
76566
  });
76732
76567
  };
76733
- var config12 = {
76568
+ var config10 = {
76734
76569
  configVersion: 1,
76735
76570
  id: "solid",
76736
76571
  frameworkCli: "create-solid",
@@ -76740,12 +76575,12 @@ var config12 = {
76740
76575
  path: "./templates"
76741
76576
  },
76742
76577
  path: "templates-experimental/solid",
76743
- generate: generate11,
76744
- configure: configure8,
76578
+ generate: generate9,
76579
+ configure: configure7,
76745
76580
  transformPackageJson: async () => ({
76746
76581
  scripts: {
76747
- preview: `${npm8} run build && npx wrangler dev`,
76748
- deploy: `${npm8} run build && wrangler deploy`
76582
+ preview: `${npm6} run build && npx wrangler dev`,
76583
+ deploy: `${npm6} run build && wrangler deploy`
76749
76584
  }
76750
76585
  }),
76751
76586
  compatibilityFlags: ["nodejs_compat"],
@@ -76753,17 +76588,17 @@ var config12 = {
76753
76588
  deployScript: "deploy",
76754
76589
  previewScript: "preview"
76755
76590
  };
76756
- var c3_default14 = config12;
76591
+ var c3_default12 = config10;
76757
76592
 
76758
76593
  // templates-experimental/svelte/c3.ts
76759
76594
  var import_node_os3 = require("node:os");
76760
- var recast7 = __toESM(require_main3());
76761
- var { npm: npm9 } = detectPackageManager();
76762
- var generate12 = async (ctx) => {
76595
+ var recast6 = __toESM(require_main3());
76596
+ var { npm: npm7 } = detectPackageManager();
76597
+ var generate10 = async (ctx) => {
76763
76598
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
76764
76599
  logRaw("");
76765
76600
  };
76766
- var configure9 = async (ctx) => {
76601
+ var configure8 = async (ctx) => {
76767
76602
  const pkg = `@sveltejs/adapter-cloudflare`;
76768
76603
  await installPackages([pkg], {
76769
76604
  dev: true,
@@ -76790,7 +76625,7 @@ var updateTypeDefinitions = (ctx) => {
76790
76625
  return;
76791
76626
  }
76792
76627
  updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
76793
- const b3 = recast7.types.builders;
76628
+ const b3 = recast6.types.builders;
76794
76629
  transformFile("src/app.d.ts", {
76795
76630
  visitTSModuleDeclaration(n) {
76796
76631
  if (n.value.id.name === "App" && n.node.body) {
@@ -76822,7 +76657,7 @@ var updateTypeDefinitions = (ctx) => {
76822
76657
  }
76823
76658
  });
76824
76659
  };
76825
- var config13 = {
76660
+ var config11 = {
76826
76661
  configVersion: 1,
76827
76662
  id: "svelte",
76828
76663
  frameworkCli: "sv",
@@ -76832,12 +76667,12 @@ var config13 = {
76832
76667
  path: "./templates"
76833
76668
  },
76834
76669
  path: "templates-experimental/svelte",
76835
- generate: generate12,
76836
- configure: configure9,
76670
+ generate: generate10,
76671
+ configure: configure8,
76837
76672
  transformPackageJson: async (original, ctx) => {
76838
76673
  let scripts = {
76839
- preview: `${npm9} run build && wrangler dev`,
76840
- deploy: `${npm9} run build && wrangler deploy`
76674
+ preview: `${npm7} run build && wrangler dev`,
76675
+ deploy: `${npm7} run build && wrangler deploy`
76841
76676
  };
76842
76677
  if (usesTypescript(ctx)) {
76843
76678
  const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
@@ -76852,40 +76687,87 @@ var config13 = {
76852
76687
  deployScript: "deploy",
76853
76688
  previewScript: "preview"
76854
76689
  };
76855
- var c3_default15 = config13;
76690
+ var c3_default13 = config11;
76856
76691
 
76857
76692
  // templates-experimental/vue/c3.ts
76858
- var { npm: npm10 } = detectPackageManager();
76859
- var generate13 = async (ctx) => {
76860
- 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("");
76861
76710
  };
76862
- var config14 = {
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 = {
76863
76733
  configVersion: 1,
76864
76734
  id: "vue",
76865
76735
  frameworkCli: "create-vue",
76866
76736
  platform: "workers",
76867
76737
  displayName: "Vue",
76738
+ path: "templates-experimental/vue",
76868
76739
  copyFiles: {
76869
- 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
+ }
76870
76751
  },
76871
- path: "templates-experimental/vue",
76872
- generate: generate13,
76873
- transformPackageJson: async () => ({
76752
+ configure: configure9,
76753
+ generate: generate11,
76754
+ transformPackageJson: async (_3, ctx) => ({
76874
76755
  scripts: {
76875
- deploy: `${npm10} run build && wrangler deploy`,
76876
- preview: `${npm10} 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` }
76877
76759
  }
76878
76760
  }),
76879
76761
  devScript: "dev",
76880
76762
  deployScript: "deploy",
76881
76763
  previewScript: "preview"
76882
76764
  };
76883
- var c3_default16 = config14;
76765
+ var c3_default14 = config12;
76884
76766
 
76885
76767
  // templates/analog/c3.ts
76886
- var recast8 = __toESM(require_main3());
76887
- var { npm: npm11, name: pm2 } = detectPackageManager();
76888
- var generate14 = async (ctx) => {
76768
+ var recast7 = __toESM(require_main3());
76769
+ var { npm: npm9, name: pm2 } = detectPackageManager();
76770
+ var generate12 = async (ctx) => {
76889
76771
  await runFrameworkGenerator(ctx, [
76890
76772
  ctx.project.name,
76891
76773
  "--template",
@@ -76903,7 +76785,7 @@ var configure10 = async (ctx) => {
76903
76785
  await installPackages(packages, {
76904
76786
  dev: true,
76905
76787
  startText: `Installing ${packages.join(", ")}`,
76906
- doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
76788
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm9} install\``)}`
76907
76789
  });
76908
76790
  }
76909
76791
  updateViteConfig(ctx);
@@ -76924,7 +76806,7 @@ var updateEnvTypes2 = (ctx) => {
76924
76806
  s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
76925
76807
  };
76926
76808
  var updateViteConfig = (ctx) => {
76927
- const b3 = recast8.types.builders;
76809
+ const b3 = recast7.types.builders;
76928
76810
  const s = spinner();
76929
76811
  const configFile = "vite.config.ts";
76930
76812
  s.start(`Updating \`${configFile}\``);
@@ -76961,7 +76843,7 @@ var updateViteConfig = (ctx) => {
76961
76843
  });
76962
76844
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76963
76845
  };
76964
- var config15 = {
76846
+ var config13 = {
76965
76847
  configVersion: 1,
76966
76848
  id: "analog",
76967
76849
  frameworkCli: "create-analog",
@@ -76970,12 +76852,12 @@ var config15 = {
76970
76852
  copyFiles: {
76971
76853
  path: "./templates"
76972
76854
  },
76973
- generate: generate14,
76855
+ generate: generate12,
76974
76856
  configure: configure10,
76975
76857
  transformPackageJson: async () => ({
76976
76858
  scripts: {
76977
- preview: `${npm11} run build && wrangler pages dev`,
76978
- deploy: `${npm11} run build && wrangler pages deploy`,
76859
+ preview: `${npm9} run build && wrangler pages dev`,
76860
+ deploy: `${npm9} run build && wrangler pages deploy`,
76979
76861
  "cf-typegen": `wrangler types`
76980
76862
  }
76981
76863
  }),
@@ -76983,12 +76865,12 @@ var config15 = {
76983
76865
  deployScript: "deploy",
76984
76866
  previewScript: "preview"
76985
76867
  };
76986
- var c3_default17 = config15;
76868
+ var c3_default15 = config13;
76987
76869
 
76988
76870
  // templates/angular/c3.ts
76989
76871
  var import_node_path4 = require("node:path");
76990
- var { npm: npm12 } = detectPackageManager();
76991
- var generate15 = async (ctx) => {
76872
+ var { npm: npm10 } = detectPackageManager();
76873
+ var generate13 = async (ctx) => {
76992
76874
  await runFrameworkGenerator(ctx, [
76993
76875
  ctx.project.name,
76994
76876
  "--ssr",
@@ -77005,7 +76887,7 @@ async function installCFWorker2() {
77005
76887
  await installPackages(["xhr2"], {
77006
76888
  dev: true,
77007
76889
  startText: "Installing additional dependencies",
77008
- doneText: `${brandColor("installed")} ${dim(`via \`${npm12} install\``)}`
76890
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
77009
76891
  });
77010
76892
  }
77011
76893
  async function updateAppCode2() {
@@ -77047,7 +76929,7 @@ function updateAngularJson2(ctx) {
77047
76929
  writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
77048
76930
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
77049
76931
  }
77050
- var config16 = {
76932
+ var config14 = {
77051
76933
  configVersion: 1,
77052
76934
  id: "angular",
77053
76935
  frameworkCli: "@angular/create",
@@ -77059,23 +76941,23 @@ var config16 = {
77059
76941
  devScript: "start",
77060
76942
  deployScript: "deploy",
77061
76943
  previewScript: "start",
77062
- generate: generate15,
76944
+ generate: generate13,
77063
76945
  configure: configure11,
77064
76946
  transformPackageJson: async () => ({
77065
76947
  scripts: {
77066
- start: `${npm12} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
77067
- build: `ng build && ${npm12} run process`,
76948
+ start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
76949
+ build: `ng build && ${npm10} run process`,
77068
76950
  process: "node ./tools/copy-files.mjs",
77069
- deploy: `${npm12} run build && wrangler pages deploy dist/cloudflare`
76951
+ deploy: `${npm10} run build && wrangler pages deploy dist/cloudflare`
77070
76952
  }
77071
76953
  })
77072
76954
  };
77073
- var c3_default18 = config16;
76955
+ var c3_default16 = config14;
77074
76956
 
77075
76957
  // templates/astro/c3.ts
77076
- var recast9 = __toESM(require_main3());
76958
+ var recast8 = __toESM(require_main3());
77077
76959
  var { npx: npx3 } = detectPackageManager();
77078
- var generate16 = async (ctx) => {
76960
+ var generate14 = async (ctx) => {
77079
76961
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
77080
76962
  logRaw("");
77081
76963
  };
@@ -77098,7 +76980,7 @@ var updateAstroConfig2 = () => {
77098
76980
  if (callee.name !== "cloudflare") {
77099
76981
  return this.traverse(n);
77100
76982
  }
77101
- const b3 = recast9.types.builders;
76983
+ const b3 = recast8.types.builders;
77102
76984
  n.node.arguments = [
77103
76985
  b3.objectExpression([
77104
76986
  b3.objectProperty(
@@ -77113,7 +76995,7 @@ var updateAstroConfig2 = () => {
77113
76995
  }
77114
76996
  });
77115
76997
  };
77116
- var config17 = {
76998
+ var config15 = {
77117
76999
  configVersion: 1,
77118
77000
  id: "astro",
77119
77001
  frameworkCli: "create-astro",
@@ -77135,7 +77017,7 @@ var config17 = {
77135
77017
  devScript: "dev",
77136
77018
  deployScript: "deploy",
77137
77019
  previewScript: "preview",
77138
- generate: generate16,
77020
+ generate: generate14,
77139
77021
  configure: configure12,
77140
77022
  transformPackageJson: async (pkgJson, ctx) => ({
77141
77023
  scripts: {
@@ -77145,10 +77027,10 @@ var config17 = {
77145
77027
  }
77146
77028
  })
77147
77029
  };
77148
- var c3_default19 = config17;
77030
+ var c3_default17 = config15;
77149
77031
 
77150
77032
  // templates/common/c3.ts
77151
- var c3_default20 = {
77033
+ var c3_default18 = {
77152
77034
  configVersion: 1,
77153
77035
  id: "common",
77154
77036
  displayName: "Example router & proxy Worker",
@@ -77167,33 +77049,69 @@ var c3_default20 = {
77167
77049
  }
77168
77050
  };
77169
77051
 
77170
- // templates/docusaurus/c3.ts
77171
- var { npm: npm13 } = detectPackageManager();
77172
- var generate17 = async (ctx) => {
77052
+ // templates/docusaurus/pages/c3.ts
77053
+ var { npm: npm11 } = detectPackageManager();
77054
+ var generate15 = async (ctx) => {
77173
77055
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
77174
77056
  };
77175
- var config18 = {
77057
+ var config16 = {
77176
77058
  configVersion: 1,
77177
77059
  id: "docusaurus",
77178
77060
  frameworkCli: "create-docusaurus",
77179
77061
  platform: "pages",
77180
77062
  displayName: "Docusaurus",
77181
- generate: generate17,
77063
+ path: "templates/docusaurus/pages",
77064
+ generate: generate15,
77182
77065
  transformPackageJson: async () => ({
77183
77066
  scripts: {
77184
- preview: `${npm13} run build && wrangler pages dev ./build`,
77185
- deploy: `${npm13} run build && wrangler pages deploy ./build`
77067
+ preview: `${npm11} run build && wrangler pages dev ./build`,
77068
+ deploy: `${npm11} run build && wrangler pages deploy ./build`
77186
77069
  }
77187
77070
  }),
77188
77071
  devScript: "preview",
77189
77072
  deployScript: "deploy",
77190
77073
  previewScript: "preview"
77191
77074
  };
77075
+ var c3_default19 = config16;
77076
+
77077
+ // templates/docusaurus/workers/c3.ts
77078
+ var { npm: npm12 } = detectPackageManager();
77079
+ var generate16 = async (ctx) => {
77080
+ await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
77081
+ };
77082
+ var config17 = {
77083
+ configVersion: 1,
77084
+ id: "docusaurus",
77085
+ frameworkCli: "create-docusaurus",
77086
+ platform: "workers",
77087
+ displayName: "Docusaurus",
77088
+ copyFiles: {
77089
+ path: "./templates"
77090
+ },
77091
+ path: "templates/docusaurus/workers",
77092
+ generate: generate16,
77093
+ transformPackageJson: async () => ({
77094
+ scripts: {
77095
+ deploy: `${npm12} run build && wrangler deploy`,
77096
+ preview: `${npm12} run build && wrangler dev`
77097
+ }
77098
+ }),
77099
+ devScript: "start",
77100
+ deployScript: "deploy",
77101
+ previewScript: "preview"
77102
+ };
77103
+ var c3_default20 = config17;
77104
+
77105
+ // templates/docusaurus/c3.ts
77106
+ var config18 = {
77107
+ displayName: "Docusaurus",
77108
+ platformVariants: { pages: c3_default19, workers: c3_default20 }
77109
+ };
77192
77110
  var c3_default21 = config18;
77193
77111
 
77194
77112
  // templates/gatsby/c3.ts
77195
- var { npm: npm14 } = detectPackageManager();
77196
- var generate18 = async (ctx) => {
77113
+ var { npm: npm13 } = detectPackageManager();
77114
+ var generate17 = async (ctx) => {
77197
77115
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
77198
77116
  const useTemplate = await inputPrompt({
77199
77117
  type: "confirm",
@@ -77218,11 +77136,11 @@ var config19 = {
77218
77136
  frameworkCli: "gatsby",
77219
77137
  platform: "pages",
77220
77138
  displayName: "Gatsby",
77221
- generate: generate18,
77139
+ generate: generate17,
77222
77140
  transformPackageJson: async () => ({
77223
77141
  scripts: {
77224
- deploy: `${npm14} run build && wrangler pages deploy ./public`,
77225
- 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`
77226
77144
  }
77227
77145
  }),
77228
77146
  devScript: "develop",
@@ -77287,7 +77205,7 @@ var c3_default24 = {
77287
77205
  };
77288
77206
 
77289
77207
  // templates/hono/c3.ts
77290
- var generate19 = async (ctx) => {
77208
+ var generate18 = async (ctx) => {
77291
77209
  const { name: pm4 } = detectPackageManager();
77292
77210
  await runFrameworkGenerator(ctx, [
77293
77211
  ctx.project.name,
@@ -77323,7 +77241,7 @@ var config20 = {
77323
77241
  path: "./templates"
77324
77242
  },
77325
77243
  platform: "workers",
77326
- generate: generate19,
77244
+ generate: generate18,
77327
77245
  configure: configure13,
77328
77246
  transformPackageJson: async () => ({
77329
77247
  scripts: {
@@ -77340,8 +77258,8 @@ var c3_default25 = config20;
77340
77258
 
77341
77259
  // templates/next/c3.ts
77342
77260
  var import_path10 = require("path");
77343
- var { npm: npm15, npx: npx4 } = detectPackageManager();
77344
- var generate20 = async (ctx) => {
77261
+ var { npm: npm14, npx: npx4 } = detectPackageManager();
77262
+ var generate19 = async (ctx) => {
77345
77263
  const projectName = ctx.project.name;
77346
77264
  await runFrameworkGenerator(ctx, [projectName]);
77347
77265
  const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
@@ -77447,7 +77365,7 @@ var c3_default26 = {
77447
77365
  frameworkCli: "create-next-app",
77448
77366
  platform: "pages",
77449
77367
  displayName: "Next.js",
77450
- generate: generate20,
77368
+ generate: generate19,
77451
77369
  configure: configure14,
77452
77370
  copyFiles: {
77453
77371
  async selectVariant(ctx) {
@@ -77479,12 +77397,12 @@ var c3_default26 = {
77479
77397
  }
77480
77398
  },
77481
77399
  transformPackageJson: async (_3, ctx) => {
77482
- const isNpm = npm15 === "npm";
77483
- const isBun = npm15 === "bun";
77400
+ const isNpm = npm14 === "npm";
77401
+ const isBun = npm14 === "bun";
77484
77402
  const isNpmOrBun = isNpm || isBun;
77485
77403
  const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
77486
77404
  const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
77487
- const pmCommand = isNpmOrBun ? npx4 : npm15;
77405
+ const pmCommand = isNpmOrBun ? npx4 : npm14;
77488
77406
  const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
77489
77407
  return {
77490
77408
  scripts: {
@@ -77504,15 +77422,15 @@ var c3_default26 = {
77504
77422
  };
77505
77423
 
77506
77424
  // templates/nuxt/c3.ts
77507
- var recast10 = __toESM(require_main3());
77508
- var { npm: npm16, name: pm3 } = detectPackageManager();
77509
- var generate21 = async (ctx) => {
77425
+ var recast9 = __toESM(require_main3());
77426
+ var { npm: npm15, name: pm3 } = detectPackageManager();
77427
+ var generate20 = async (ctx) => {
77510
77428
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
77511
77429
  await runFrameworkGenerator(ctx, [
77512
77430
  "init",
77513
77431
  ctx.project.name,
77514
77432
  "--packageManager",
77515
- npm16,
77433
+ npm15,
77516
77434
  gitFlag
77517
77435
  ]);
77518
77436
  writeFile2("./.node-version", "18");
@@ -77526,7 +77444,7 @@ var configure15 = async (ctx) => {
77526
77444
  await installPackages(packages, {
77527
77445
  dev: true,
77528
77446
  startText: "Installing nitro module `nitro-cloudflare-dev`",
77529
- doneText: `${brandColor("installed")} ${dim(`via \`${npm16} install\``)}`
77447
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm15} install\``)}`
77530
77448
  });
77531
77449
  updateNuxtConfig2();
77532
77450
  updateEnvTypes3(ctx);
@@ -77549,7 +77467,7 @@ var updateNuxtConfig2 = () => {
77549
77467
  const s = spinner();
77550
77468
  const configFile = "nuxt.config.ts";
77551
77469
  s.start(`Updating \`${configFile}\``);
77552
- const b3 = recast10.types.builders;
77470
+ const b3 = recast9.types.builders;
77553
77471
  const presetDef = b3.objectProperty(
77554
77472
  b3.identifier("nitro"),
77555
77473
  b3.objectExpression([
@@ -77586,12 +77504,12 @@ var config21 = {
77586
77504
  copyFiles: {
77587
77505
  path: "./templates"
77588
77506
  },
77589
- generate: generate21,
77507
+ generate: generate20,
77590
77508
  configure: configure15,
77591
77509
  transformPackageJson: async () => ({
77592
77510
  scripts: {
77593
- deploy: `${npm16} run build && wrangler pages deploy`,
77594
- preview: `${npm16} run build && wrangler pages dev`,
77511
+ deploy: `${npm15} run build && wrangler pages deploy`,
77512
+ preview: `${npm15} run build && wrangler pages dev`,
77595
77513
  "cf-typegen": `wrangler types`
77596
77514
  }
77597
77515
  }),
@@ -77777,7 +77695,7 @@ var c3_default29 = {
77777
77695
  })
77778
77696
  };
77779
77697
  function buildConfigure(params) {
77780
- return async function configure21(ctx) {
77698
+ return async function configure22(ctx) {
77781
77699
  const loginSuccess = await params.login(ctx);
77782
77700
  if (!loginSuccess) {
77783
77701
  throw new Error("Failed to login to Cloudflare");
@@ -77818,13 +77736,13 @@ var c3_default30 = {
77818
77736
  };
77819
77737
 
77820
77738
  // templates/qwik/c3.ts
77821
- var recast11 = __toESM(require_main3());
77822
- var { npm: npm17, npx: npx5, name: name2 } = detectPackageManager();
77823
- var generate22 = async (ctx) => {
77739
+ var recast10 = __toESM(require_main3());
77740
+ var { npm: npm16, npx: npx5, name: name2 } = detectPackageManager();
77741
+ var generate21 = async (ctx) => {
77824
77742
  await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
77825
77743
  };
77826
77744
  var configure16 = async (ctx) => {
77827
- const cmd = [name2 === "pnpm" ? npm17 : npx5, "qwik", "add", "cloudflare-pages"];
77745
+ const cmd = [name2 === "pnpm" ? npm16 : npx5, "qwik", "add", "cloudflare-pages"];
77828
77746
  endSection(`Running ${quoteShellArgs(cmd)}`);
77829
77747
  await runCommand(cmd);
77830
77748
  addBindingsProxy2(ctx);
@@ -77837,7 +77755,7 @@ var addBindingsProxy2 = (ctx) => {
77837
77755
  const s = spinner();
77838
77756
  s.start("Updating `vite.config.ts`");
77839
77757
  const snippets = loadTemplateSnippets(ctx);
77840
- const b3 = recast11.types.builders;
77758
+ const b3 = recast10.types.builders;
77841
77759
  transformFile("vite.config.ts", {
77842
77760
  // Insert the env declaration after the last import (but before the rest of the body)
77843
77761
  visitProgram: function(n) {
@@ -77879,7 +77797,7 @@ var populateCloudflareEnv2 = () => {
77879
77797
  s.start(`Updating \`${entrypointPath}\``);
77880
77798
  transformFile(entrypointPath, {
77881
77799
  visitTSInterfaceDeclaration: function(n) {
77882
- const b3 = recast11.types.builders;
77800
+ const b3 = recast10.types.builders;
77883
77801
  const id = n.node.id;
77884
77802
  if (id.name !== "QwikCityPlatform") {
77885
77803
  this.traverse(n);
@@ -77909,12 +77827,12 @@ var config22 = {
77909
77827
  copyFiles: {
77910
77828
  path: "./templates"
77911
77829
  },
77912
- generate: generate22,
77830
+ generate: generate21,
77913
77831
  configure: configure16,
77914
77832
  transformPackageJson: async () => ({
77915
77833
  scripts: {
77916
- deploy: `${npm17} run build && wrangler pages deploy`,
77917
- preview: `${npm17} run build && wrangler pages dev`,
77834
+ deploy: `${npm16} run build && wrangler pages deploy`,
77835
+ preview: `${npm16} run build && wrangler pages dev`,
77918
77836
  "cf-typegen": `wrangler types`
77919
77837
  }
77920
77838
  }),
@@ -77924,9 +77842,9 @@ var config22 = {
77924
77842
  };
77925
77843
  var c3_default31 = config22;
77926
77844
 
77927
- // templates/react/c3.ts
77928
- var { npm: npm18 } = detectPackageManager();
77929
- var generate23 = async (ctx) => {
77845
+ // templates/react/pages/c3.ts
77846
+ var { npm: npm17 } = detectPackageManager();
77847
+ var generate22 = async (ctx) => {
77930
77848
  const variant = await inputPrompt({
77931
77849
  type: "select",
77932
77850
  question: "Select a variant:",
@@ -77962,11 +77880,12 @@ var config23 = {
77962
77880
  frameworkCli: "create-vite",
77963
77881
  displayName: "React",
77964
77882
  platform: "pages",
77965
- generate: generate23,
77883
+ path: "templates/react/pages",
77884
+ generate: generate22,
77966
77885
  transformPackageJson: async () => ({
77967
77886
  scripts: {
77968
- deploy: `${npm18} run build && wrangler pages deploy ./dist`,
77969
- 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`
77970
77889
  }
77971
77890
  }),
77972
77891
  devScript: "dev",
@@ -77975,6 +77894,151 @@ var config23 = {
77975
77894
  };
77976
77895
  var c3_default32 = config23;
77977
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` }
78027
+ }
78028
+ }),
78029
+ devScript: "dev",
78030
+ deployScript: "deploy",
78031
+ previewScript: "preview"
78032
+ };
78033
+ var c3_default33 = config24;
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
+
77978
78042
  // templates/remix/c3.ts
77979
78043
  var { npm: npm19 } = detectPackageManager();
77980
78044
  var generate24 = async (ctx) => {
@@ -77985,7 +78049,7 @@ var generate24 = async (ctx) => {
77985
78049
  ]);
77986
78050
  logRaw("");
77987
78051
  };
77988
- var configure17 = async () => {
78052
+ var configure18 = async () => {
77989
78053
  const typeDefsPath = "load-context.ts";
77990
78054
  const s = spinner();
77991
78055
  s.start(`Updating \`${typeDefsPath}\``);
@@ -78000,7 +78064,7 @@ var configure17 = async () => {
78000
78064
  });
78001
78065
  s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
78002
78066
  };
78003
- var config24 = {
78067
+ var config26 = {
78004
78068
  configVersion: 1,
78005
78069
  id: "remix",
78006
78070
  frameworkCli: "create-remix",
@@ -78010,7 +78074,7 @@ var config24 = {
78010
78074
  path: "./templates"
78011
78075
  },
78012
78076
  generate: generate24,
78013
- configure: configure17,
78077
+ configure: configure18,
78014
78078
  transformPackageJson: async () => ({
78015
78079
  scripts: {
78016
78080
  deploy: `${npm19} run build && wrangler pages deploy`,
@@ -78022,10 +78086,10 @@ var config24 = {
78022
78086
  deployScript: "deploy",
78023
78087
  previewScript: "preview"
78024
78088
  };
78025
- var c3_default33 = config24;
78089
+ var c3_default35 = config26;
78026
78090
 
78027
78091
  // templates/scheduled/c3.ts
78028
- var c3_default34 = {
78092
+ var c3_default36 = {
78029
78093
  configVersion: 1,
78030
78094
  id: "scheduled",
78031
78095
  displayName: "Scheduled Worker (Cron Trigger)",
@@ -78050,7 +78114,7 @@ var generate25 = async (ctx) => {
78050
78114
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
78051
78115
  logRaw("");
78052
78116
  };
78053
- var configure18 = async (ctx) => {
78117
+ var configure19 = async (ctx) => {
78054
78118
  usesTypescript(ctx);
78055
78119
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
78056
78120
  updateStatus(`Updating configuration in ${blue(filePath)}`);
@@ -78088,7 +78152,7 @@ var configure18 = async (ctx) => {
78088
78152
  }
78089
78153
  });
78090
78154
  };
78091
- var config25 = {
78155
+ var config27 = {
78092
78156
  configVersion: 1,
78093
78157
  id: "solid",
78094
78158
  frameworkCli: "create-solid",
@@ -78098,7 +78162,7 @@ var config25 = {
78098
78162
  path: "./templates"
78099
78163
  },
78100
78164
  generate: generate25,
78101
- configure: configure18,
78165
+ configure: configure19,
78102
78166
  transformPackageJson: async () => ({
78103
78167
  scripts: {
78104
78168
  preview: `${npm20} run build && npx wrangler pages dev`,
@@ -78110,7 +78174,7 @@ var config25 = {
78110
78174
  deployScript: "deploy",
78111
78175
  previewScript: "preview"
78112
78176
  };
78113
- var c3_default35 = config25;
78177
+ var c3_default37 = config27;
78114
78178
 
78115
78179
  // templates/svelte/c3.ts
78116
78180
  var import_node_fs3 = require("node:fs");
@@ -78121,7 +78185,7 @@ var generate26 = async (ctx) => {
78121
78185
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
78122
78186
  logRaw("");
78123
78187
  };
78124
- var configure19 = async (ctx) => {
78188
+ var configure20 = async (ctx) => {
78125
78189
  const pkg = `@sveltejs/adapter-cloudflare`;
78126
78190
  await installPackages([pkg], {
78127
78191
  dev: true,
@@ -78203,7 +78267,7 @@ var updateTypeDefinitions2 = (ctx) => {
78203
78267
  }
78204
78268
  });
78205
78269
  };
78206
- var config26 = {
78270
+ var config28 = {
78207
78271
  configVersion: 1,
78208
78272
  id: "svelte",
78209
78273
  frameworkCli: "sv",
@@ -78213,7 +78277,7 @@ var config26 = {
78213
78277
  path: "./templates"
78214
78278
  },
78215
78279
  generate: generate26,
78216
- configure: configure19,
78280
+ configure: configure20,
78217
78281
  transformPackageJson: async (original, ctx) => {
78218
78282
  let scripts = {
78219
78283
  preview: `${npm21} run build && wrangler pages dev`,
@@ -78232,14 +78296,14 @@ var config26 = {
78232
78296
  deployScript: "deploy",
78233
78297
  previewScript: "preview"
78234
78298
  };
78235
- var c3_default36 = config26;
78299
+ var c3_default38 = config28;
78236
78300
 
78237
78301
  // templates/vue/c3.ts
78238
78302
  var { npm: npm22 } = detectPackageManager();
78239
78303
  var generate27 = async (ctx) => {
78240
78304
  await runFrameworkGenerator(ctx, [ctx.project.name]);
78241
78305
  };
78242
- var config27 = {
78306
+ var config29 = {
78243
78307
  configVersion: 1,
78244
78308
  id: "vue",
78245
78309
  frameworkCli: "create-vue",
@@ -78256,13 +78320,13 @@ var config27 = {
78256
78320
  deployScript: "deploy",
78257
78321
  previewScript: "preview"
78258
78322
  };
78259
- var c3_default37 = config27;
78323
+ var c3_default39 = config29;
78260
78324
 
78261
78325
  // src/git.ts
78262
78326
  var import_node_assert = __toESM(require("node:assert"));
78263
78327
 
78264
78328
  // ../wrangler/package.json
78265
- var version2 = "0.0.0-56a8aed96";
78329
+ var version2 = "0.0.0-56c4ba952";
78266
78330
 
78267
78331
  // src/git.ts
78268
78332
  var offerGit = async (ctx) => {
@@ -78525,49 +78589,47 @@ function getFrameworkMap({ experimental = false }) {
78525
78589
  return {
78526
78590
  angular: c3_default,
78527
78591
  astro: c3_default2,
78528
- docusaurus: c3_default3,
78529
- gatsby: c3_default4,
78530
- hono: c3_default8,
78531
- next: c3_default9,
78532
- nuxt: c3_default10,
78533
- qwik: c3_default11,
78534
- react: c3_default12,
78535
- remix: c3_default13,
78536
- solid: c3_default14,
78537
- svelte: c3_default15,
78538
- vue: c3_default16
78592
+ gatsby: c3_default3,
78593
+ hono: c3_default7,
78594
+ next: c3_default8,
78595
+ nuxt: c3_default9,
78596
+ qwik: c3_default10,
78597
+ remix: c3_default11,
78598
+ solid: c3_default12,
78599
+ svelte: c3_default13,
78600
+ vue: c3_default14
78539
78601
  };
78540
78602
  } else {
78541
78603
  return {
78542
- analog: c3_default17,
78543
- angular: c3_default18,
78544
- astro: c3_default19,
78604
+ analog: c3_default15,
78605
+ angular: c3_default16,
78606
+ astro: c3_default17,
78545
78607
  docusaurus: c3_default21,
78546
78608
  gatsby: c3_default22,
78547
78609
  hono: c3_default25,
78548
78610
  next: c3_default26,
78549
78611
  nuxt: c3_default27,
78550
78612
  qwik: c3_default31,
78551
- react: c3_default32,
78552
- remix: c3_default33,
78553
- solid: c3_default35,
78554
- svelte: c3_default36,
78555
- vue: c3_default37
78613
+ react: c3_default34,
78614
+ remix: c3_default35,
78615
+ solid: c3_default37,
78616
+ svelte: c3_default38,
78617
+ vue: c3_default39
78556
78618
  };
78557
78619
  }
78558
78620
  }
78559
78621
  function getTemplateMap({ experimental = false }) {
78560
78622
  if (experimental) {
78561
78623
  return {
78562
- "hello-world-assets-only": c3_default5,
78563
- "hello-world-with-assets": c3_default7,
78564
- "hello-world-durable-object-with-assets": c3_default6
78624
+ "hello-world-assets-only": c3_default4,
78625
+ "hello-world-with-assets": c3_default6,
78626
+ "hello-world-durable-object-with-assets": c3_default5
78565
78627
  };
78566
78628
  } else {
78567
78629
  return {
78568
78630
  "hello-world": c3_default24,
78569
- common: c3_default20,
78570
- scheduled: c3_default34,
78631
+ common: c3_default18,
78632
+ scheduled: c3_default36,
78571
78633
  queues: c3_default30,
78572
78634
  "hello-world-durable-object": c3_default23,
78573
78635
  openapi: c3_default28,
@@ -78631,25 +78693,25 @@ var deriveCorrelatedArgs = (args) => {
78631
78693
  };
78632
78694
  var createContext = async (args, prevArgs) => {
78633
78695
  deriveCorrelatedArgs(args);
78696
+ let linesPrinted = 0;
78634
78697
  const goBack = async (from) => {
78635
78698
  const currentArgs = { ...args };
78636
- let linesPrinted = 0;
78637
78699
  switch (from) {
78638
78700
  case "category":
78639
- linesPrinted = 6;
78640
78701
  args.projectName = void 0;
78641
78702
  break;
78642
78703
  case "type":
78643
- linesPrinted = 9;
78644
78704
  args.category = void 0;
78645
78705
  break;
78646
78706
  case "framework":
78647
- linesPrinted = 9;
78648
78707
  args.category = void 0;
78649
78708
  break;
78709
+ case "platform":
78710
+ args.framework = void 0;
78711
+ break;
78650
78712
  case "lang":
78651
- linesPrinted = 12;
78652
78713
  args.type = void 0;
78714
+ args.framework = void 0;
78653
78715
  break;
78654
78716
  }
78655
78717
  currentArgs[from] = void 0;
@@ -78709,6 +78771,7 @@ var createContext = async (args, prevArgs) => {
78709
78771
  options: categoryOptions,
78710
78772
  defaultValue: prevArgs?.category ?? C3_DEFAULTS.category
78711
78773
  });
78774
+ linesPrinted += 6;
78712
78775
  if (category === BACK_VALUE) {
78713
78776
  return goBack("category");
78714
78777
  }
@@ -78718,8 +78781,8 @@ var createContext = async (args, prevArgs) => {
78718
78781
  experimental: args.experimental
78719
78782
  });
78720
78783
  const frameworkOptions = Object.entries(frameworkMap).map(
78721
- ([key, config28]) => ({
78722
- label: config28.displayName,
78784
+ ([key, config30]) => ({
78785
+ label: config30.displayName,
78723
78786
  value: key
78724
78787
  })
78725
78788
  );
@@ -78730,13 +78793,40 @@ var createContext = async (args, prevArgs) => {
78730
78793
  options: frameworkOptions.concat(backOption),
78731
78794
  defaultValue: prevArgs?.framework ?? C3_DEFAULTS.framework
78732
78795
  });
78796
+ linesPrinted += 3;
78733
78797
  if (framework === BACK_VALUE) {
78734
78798
  return goBack("framework");
78735
78799
  }
78736
- const frameworkConfig = frameworkMap[framework];
78800
+ let frameworkConfig = frameworkMap[framework];
78737
78801
  if (!frameworkConfig) {
78738
78802
  throw new Error(`Unsupported framework: ${framework}`);
78739
78803
  }
78804
+ if ("platformVariants" in frameworkConfig) {
78805
+ const platform3 = await processArgument(args, "platform", {
78806
+ type: "select",
78807
+ label: "platform",
78808
+ question: "Select your deployment platform",
78809
+ options: [
78810
+ {
78811
+ label: "Workers with Assets (BETA)",
78812
+ value: "workers",
78813
+ description: "Take advantage of the full Developer Platform, including R2, Queues, Durable Objects and more."
78814
+ },
78815
+ {
78816
+ label: "Pages",
78817
+ value: "pages",
78818
+ description: "Great for simple websites and applications."
78819
+ },
78820
+ backOption
78821
+ ],
78822
+ defaultValue: "workers"
78823
+ });
78824
+ linesPrinted += 3;
78825
+ if (platform3 === BACK_VALUE) {
78826
+ return goBack("platform");
78827
+ }
78828
+ frameworkConfig = frameworkConfig.platformVariants[platform3];
78829
+ }
78740
78830
  template = {
78741
78831
  deployScript: "pages:deploy",
78742
78832
  devScript: "pages:dev",
@@ -78767,6 +78857,7 @@ var createContext = async (args, prevArgs) => {
78767
78857
  options: templateOptions.concat(backOption),
78768
78858
  defaultValue: prevArgs?.type ?? C3_DEFAULTS.type
78769
78859
  });
78860
+ linesPrinted += 3;
78770
78861
  if (type === BACK_VALUE) {
78771
78862
  return goBack("type");
78772
78863
  }
@@ -78795,6 +78886,7 @@ var createContext = async (args, prevArgs) => {
78795
78886
  options: languageOptions.filter((option) => languageVariants.includes(option.value)).concat(args.template ? [] : backOption),
78796
78887
  defaultValue: C3_DEFAULTS.lang
78797
78888
  });
78889
+ linesPrinted += 3;
78798
78890
  if (lang === BACK_VALUE) {
78799
78891
  return goBack("lang");
78800
78892
  }
@@ -78857,28 +78949,28 @@ var processRemoteTemplate = async (args) => {
78857
78949
  src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
78858
78950
  }
78859
78951
  const path6 = await downloadRemoteTemplate(src);
78860
- const config28 = inferTemplateConfig(path6);
78861
- validateTemplate(path6, config28);
78952
+ const config30 = inferTemplateConfig(path6);
78953
+ validateTemplate(path6, config30);
78862
78954
  updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
78863
78955
  return {
78864
78956
  path: path6,
78865
- ...config28
78957
+ ...config30
78866
78958
  };
78867
78959
  };
78868
- var validateTemplate = (path6, config28) => {
78869
- if (!config28.copyFiles) {
78960
+ var validateTemplate = (path6, config30) => {
78961
+ if (!config30.copyFiles) {
78870
78962
  return;
78871
78963
  }
78872
- if (isVariantInfo(config28.copyFiles)) {
78873
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config28.copyFiles.path), config28);
78964
+ if (isVariantInfo(config30.copyFiles)) {
78965
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config30.copyFiles.path), config30);
78874
78966
  } else {
78875
- for (const variant of Object.values(config28.copyFiles.variants)) {
78876
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config28);
78967
+ for (const variant of Object.values(config30.copyFiles.variants)) {
78968
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config30);
78877
78969
  }
78878
78970
  }
78879
78971
  };
78880
- var validateTemplateSrcDirectory = (path6, config28) => {
78881
- if (config28.platform === "workers") {
78972
+ var validateTemplateSrcDirectory = (path6, config30) => {
78973
+ if (config30.platform === "workers") {
78882
78974
  const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
78883
78975
  const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
78884
78976
  const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
@@ -79130,6 +79222,22 @@ var cliDefinition = {
79130
79222
  })
79131
79223
  )
79132
79224
  },
79225
+ {
79226
+ name: "platform",
79227
+ type: "string",
79228
+ description: `Whether the application should be deployed to Pages or Workers. This is only applicable for Frameworks templates that support both Pages and Workers.`,
79229
+ values: [
79230
+ {
79231
+ name: "pages",
79232
+ description: "Create a web application that can be deployed to Pages."
79233
+ },
79234
+ {
79235
+ name: "workers",
79236
+ description: "Create a web application that can be deployed to Workers (BETA)."
79237
+ }
79238
+ ],
79239
+ requiresArg: true
79240
+ },
79133
79241
  {
79134
79242
  name: "lang",
79135
79243
  type: "string",
@@ -80759,20 +80867,20 @@ function applyEdits(text, edits) {
80759
80867
  var import_fs12 = require("fs");
80760
80868
  var import_path14 = require("path");
80761
80869
  var import_toml2 = __toESM(require_toml());
80762
- function ensureNameExists(config28, projectName) {
80763
- config28["name"] = projectName;
80764
- return config28;
80870
+ function ensureNameExists(config30, projectName) {
80871
+ config30["name"] = projectName;
80872
+ return config30;
80765
80873
  }
80766
- async function ensureCompatDateExists(config28) {
80767
- if (typeof config28["compatibility_date"] === "string") {
80874
+ async function ensureCompatDateExists(config30) {
80875
+ if (typeof config30["compatibility_date"] === "string") {
80768
80876
  const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
80769
- if (!config28["compatibility_date"].match(validCompatDateRe)) {
80770
- config28["compatibility_date"] = await getWorkerdCompatibilityDate();
80877
+ if (!config30["compatibility_date"].match(validCompatDateRe)) {
80878
+ config30["compatibility_date"] = await getWorkerdCompatibilityDate();
80771
80879
  }
80772
80880
  } else {
80773
- config28["compatibility_date"] = await getWorkerdCompatibilityDate();
80881
+ config30["compatibility_date"] = await getWorkerdCompatibilityDate();
80774
80882
  }
80775
- return config28;
80883
+ return config30;
80776
80884
  }
80777
80885
  var updateWranglerConfig = async (ctx) => {
80778
80886
  if (wranglerJsonExists(ctx)) {
@@ -81486,8 +81594,8 @@ var renderValues = (values) => {
81486
81594
  };
81487
81595
 
81488
81596
  // src/helpers/retry.ts
81489
- var retry = async (config28, fn) => {
81490
- let { times } = config28;
81597
+ var retry = async (config30, fn) => {
81598
+ let { times } = config30;
81491
81599
  let error2 = null;
81492
81600
  while (times > 0) {
81493
81601
  try {
@@ -81495,10 +81603,10 @@ var retry = async (config28, fn) => {
81495
81603
  } catch (e) {
81496
81604
  error2 = e;
81497
81605
  times--;
81498
- if (config28.exitCondition?.(e)) {
81606
+ if (config30.exitCondition?.(e)) {
81499
81607
  break;
81500
81608
  }
81501
- await sleep(config28.sleepMs ?? 1e3);
81609
+ await sleep(config30.sleepMs ?? 1e3);
81502
81610
  }
81503
81611
  }
81504
81612
  throw error2;
@@ -81618,8 +81726,8 @@ async function addWorkersTypesToTsConfig(ctx) {
81618
81726
  }
81619
81727
  const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
81620
81728
  try {
81621
- const config28 = parse4(tsconfig);
81622
- const currentTypes = config28.compilerOptions?.types ?? [];
81729
+ const config30 = parse4(tsconfig);
81730
+ const currentTypes = config30.compilerOptions?.types ?? [];
81623
81731
  const explicitEntrypoint = currentTypes.some(
81624
81732
  (t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
81625
81733
  );
@@ -81694,7 +81802,7 @@ var runCli = async (args) => {
81694
81802
  printBanner(args);
81695
81803
  const ctx = await createContext(args);
81696
81804
  await create(ctx);
81697
- await configure20(ctx);
81805
+ await configure21(ctx);
81698
81806
  await deploy(ctx);
81699
81807
  printSummary(ctx);
81700
81808
  logRaw("");
@@ -81722,7 +81830,7 @@ var create = async (ctx) => {
81722
81830
  await rectifyPmMismatch(ctx);
81723
81831
  endSection(`Application created`);
81724
81832
  };
81725
- var configure20 = async (ctx) => {
81833
+ var configure21 = async (ctx) => {
81726
81834
  startSection("Configuring your application for Cloudflare", "Step 2 of 3");
81727
81835
  await installWrangler();
81728
81836
  await installWorkersTypes(ctx);