create-cloudflare 0.0.0-6a958df17 → 0.0.0-6ae158397

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 (108) hide show
  1. package/dist/cli.js +645 -546
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +7 -7
  4. package/templates/angular/pages/c3.ts +1 -0
  5. package/templates/astro/pages/c3.ts +1 -0
  6. package/templates/astro/workers/templates/ts/wrangler.jsonc +1 -1
  7. package/templates/common/c3.ts +5 -1
  8. package/templates/docusaurus/pages/c3.ts +1 -0
  9. package/templates/gatsby/pages/c3.ts +1 -0
  10. package/templates/hello-world/js/package.json +1 -1
  11. package/templates/hello-world/py/README.md +2 -2
  12. package/templates/hello-world/py/pyproject.toml +1 -1
  13. package/templates/hello-world/py/src/entry.py +3 -2
  14. package/templates/hello-world/ts/package.json +1 -1
  15. package/templates/hello-world/ts/test/env.d.ts +3 -0
  16. package/templates/hello-world/ts/worker-configuration.d.ts +6 -2
  17. package/templates/hello-world-assets-only/c3.ts +2 -2
  18. package/templates/hello-world-durable-object/c3.ts +7 -1
  19. package/templates/hello-world-durable-object/py/.python-version +1 -0
  20. package/templates/hello-world-durable-object/py/README.md +23 -0
  21. package/templates/hello-world-durable-object/py/__dot__gitignore +68 -0
  22. package/templates/hello-world-durable-object/py/package.json +13 -0
  23. package/templates/hello-world-durable-object/py/pyproject.toml +9 -0
  24. package/templates/hello-world-durable-object/py/src/entry.py +66 -0
  25. package/templates/hello-world-durable-object/py/uv.lock +22 -0
  26. package/templates/hello-world-durable-object/py/wrangler.jsonc +27 -0
  27. package/templates/hello-world-durable-object-with-assets/c3.ts +3 -0
  28. package/templates/hello-world-durable-object-with-assets/py/.python-version +1 -0
  29. package/templates/hello-world-durable-object-with-assets/py/README.md +23 -0
  30. package/templates/hello-world-durable-object-with-assets/py/__dot__gitignore +68 -0
  31. package/templates/hello-world-durable-object-with-assets/py/package.json +13 -0
  32. package/templates/hello-world-durable-object-with-assets/py/public/index.html +19 -0
  33. package/templates/hello-world-durable-object-with-assets/py/pyproject.toml +9 -0
  34. package/templates/hello-world-durable-object-with-assets/py/src/entry.py +66 -0
  35. package/templates/hello-world-durable-object-with-assets/py/uv.lock +22 -0
  36. package/templates/hello-world-durable-object-with-assets/py/wrangler.jsonc +31 -0
  37. package/templates/hello-world-with-assets/c3.ts +7 -3
  38. package/templates/hello-world-with-assets/js/package.json +1 -1
  39. package/templates/hello-world-with-assets/js/public/index.html +2 -2
  40. package/templates/hello-world-with-assets/py/.python-version +1 -0
  41. package/templates/hello-world-with-assets/py/README.md +23 -0
  42. package/templates/hello-world-with-assets/py/public/index.html +2 -2
  43. package/templates/hello-world-with-assets/py/pyproject.toml +9 -0
  44. package/templates/hello-world-with-assets/py/src/entry.py +9 -7
  45. package/templates/hello-world-with-assets/py/uv.lock +22 -0
  46. package/templates/hello-world-with-assets/ts/package.json +1 -1
  47. package/templates/hello-world-with-assets/ts/public/index.html +2 -2
  48. package/templates/hello-world-with-assets/ts/test/env.d.ts +3 -0
  49. package/templates/hello-world-with-assets/ts/test/tsconfig.json +1 -1
  50. package/templates/hello-world-with-assets/ts/worker-configuration.d.ts +6 -3
  51. package/templates/hono/pages/c3.ts +3 -1
  52. package/templates/hono/pages/templates/wrangler.jsonc +1 -2
  53. package/templates/next/c3.ts +7 -221
  54. package/templates/next/pages/c3.ts +225 -0
  55. package/{templates-experimental/next → templates/next/workers}/c3.ts +7 -13
  56. package/templates/next/workers/templates/open-next.config.ts +9 -0
  57. package/{templates-experimental/next → templates/next/workers}/templates/wrangler.jsonc +3 -2
  58. package/templates/nuxt/pages/c3.ts +2 -0
  59. package/templates/nuxt/workers/c3.ts +1 -0
  60. package/templates/openapi/c3.ts +5 -1
  61. package/templates/openapi/ts/__dot__gitignore +1 -0
  62. package/templates/openapi/ts/package.json +7 -6
  63. package/templates/openapi/ts/src/endpoints/taskCreate.ts +2 -2
  64. package/templates/openapi/ts/src/endpoints/taskDelete.ts +2 -2
  65. package/templates/openapi/ts/src/endpoints/taskFetch.ts +2 -2
  66. package/templates/openapi/ts/src/endpoints/taskList.ts +2 -2
  67. package/templates/openapi/ts/src/index.ts +4 -1
  68. package/templates/openapi/ts/src/types.ts +3 -0
  69. package/templates/openapi/ts/tsconfig.json +18 -20
  70. package/templates/pre-existing/c3.ts +6 -2
  71. package/templates/queues/c3.ts +5 -1
  72. package/templates/qwik/pages/c3.ts +1 -0
  73. package/templates/qwik/workers/c3.ts +2 -4
  74. package/templates/react/pages/c3.ts +1 -0
  75. package/templates/react/workers/c3.ts +1 -1
  76. package/templates/react/workers/js/src/App.jsx +1 -1
  77. package/templates/react/workers/js/{api → worker}/index.js +1 -1
  78. package/templates/react/workers/js/wrangler.jsonc +2 -2
  79. package/templates/react/workers/ts/src/App.tsx +1 -1
  80. package/templates/react/workers/ts/tsconfig.worker.json +2 -2
  81. package/templates/react/workers/ts/{api → worker}/index.ts +2 -3
  82. package/templates/react/workers/ts/wrangler.jsonc +2 -2
  83. package/templates/react-router/c3.ts +53 -0
  84. package/templates/react-router/templates/worker-configuration.d.ts +8 -0
  85. package/templates/remix/c3.ts +1 -0
  86. package/templates/remix/pages/c3.ts +1 -0
  87. package/templates/remix/workers/templates/wrangler.toml +1 -1
  88. package/templates/scheduled/c3.ts +5 -1
  89. package/templates/scheduled/ts/src/index.ts +7 -0
  90. package/templates/svelte/pages/c3.ts +1 -0
  91. package/templates/vue/pages/c3.ts +1 -0
  92. package/templates/vue/workers/js/server/index.js +2 -2
  93. package/templates/vue/workers/js/wrangler.jsonc +0 -1
  94. package/templates/vue/workers/ts/server/index.ts +2 -3
  95. package/templates/vue/workers/ts/wrangler.jsonc +0 -1
  96. package/templates-experimental/next/templates/open-next.config.ts +0 -6
  97. /package/templates/next/{README.md → pages/README.md} +0 -0
  98. /package/templates/next/{app → pages/app}/js/app/api/hello/route.js +0 -0
  99. /package/templates/next/{app → pages/app}/js/app/not-found.js +0 -0
  100. /package/templates/next/{app → pages/app}/ts/app/api/hello/route.ts +0 -0
  101. /package/templates/next/{app → pages/app}/ts/app/not-found.tsx +0 -0
  102. /package/templates/next/{env.d.ts → pages/env.d.ts} +0 -0
  103. /package/templates/next/pages/{js → pages/js}/pages/api/hello.js +0 -0
  104. /package/templates/next/pages/{ts → pages/ts}/pages/api/hello.ts +0 -0
  105. /package/templates/next/{wrangler.jsonc → pages/wrangler.jsonc} +0 -0
  106. /package/{templates-experimental/next → templates/next/workers}/templates/.dev.vars +0 -0
  107. /package/{templates-experimental/next → templates/next/workers}/templates/__dot__gitignore +0 -0
  108. /package/{templates-experimental/next → templates/next/workers}/templates/cloudflare-env.d.ts +0 -0
package/dist/cli.js CHANGED
@@ -568,7 +568,7 @@ var require_XDGAppPaths = __commonJS({
568
568
  XDGAppPaths.cache = function cache(dirOptions) {
569
569
  return path6.join(xdg.cache(), finalPathSegment(dirOptions));
570
570
  };
571
- XDGAppPaths.config = function config39(dirOptions) {
571
+ XDGAppPaths.config = function config48(dirOptions) {
572
572
  return path6.join(xdg.config(), finalPathSegment(dirOptions));
573
573
  };
574
574
  XDGAppPaths.data = function data(dirOptions) {
@@ -625,7 +625,7 @@ var require_XDG = __commonJS({
625
625
  var cache = function() {
626
626
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
627
627
  };
628
- var config39 = function() {
628
+ var config48 = function() {
629
629
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
630
630
  };
631
631
  var data = function() {
@@ -637,13 +637,13 @@ var require_XDG = __commonJS({
637
637
  var state = function() {
638
638
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
639
639
  };
640
- return { cache, config: config39, data, runtime, state };
640
+ return { cache, config: config48, data, runtime, state };
641
641
  };
642
642
  var macos = function() {
643
643
  var cache = function() {
644
644
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
645
645
  };
646
- var config39 = function() {
646
+ var config48 = function() {
647
647
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
648
648
  };
649
649
  var data = function() {
@@ -655,7 +655,7 @@ var require_XDG = __commonJS({
655
655
  var state = function() {
656
656
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
657
657
  };
658
- return { cache, config: config39, data, runtime, state };
658
+ return { cache, config: config48, data, runtime, state };
659
659
  };
660
660
  var windows = function() {
661
661
  function appData() {
@@ -667,7 +667,7 @@ var require_XDG = __commonJS({
667
667
  var cache = function() {
668
668
  return valOrPath(env3.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
669
669
  };
670
- var config39 = function() {
670
+ var config48 = function() {
671
671
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
672
672
  };
673
673
  var data = function() {
@@ -679,7 +679,7 @@ var require_XDG = __commonJS({
679
679
  var state = function() {
680
680
  return valOrPath(env3.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
681
681
  };
682
- return { cache, config: config39, data, runtime, state };
682
+ return { cache, config: config48, data, runtime, state };
683
683
  };
684
684
  var XDG_ = /* @__PURE__ */ function() {
685
685
  function XDG_2() {
@@ -31509,21 +31509,21 @@ var require_dist_web = __commonJS({
31509
31509
  _createClass(Haikunator3, [{
31510
31510
  key: "haikunate",
31511
31511
  value: function haikunate(options) {
31512
- var config39 = (0, _lodash["default"])(options, this.config);
31513
- if (config39.tokenHex === true) {
31514
- config39.tokenChars = "0123456789abcdef";
31512
+ var config48 = (0, _lodash["default"])(options, this.config);
31513
+ if (config48.tokenHex === true) {
31514
+ config48.tokenChars = "0123456789abcdef";
31515
31515
  }
31516
31516
  var adjective = this._randomElement(this.adjectives);
31517
31517
  var noun = this._randomElement(this.nouns);
31518
- if (!config39.tokenLength) config39.tokenLength = 0;
31518
+ if (!config48.tokenLength) config48.tokenLength = 0;
31519
31519
  var token = "";
31520
- for (var i = 0; i < config39.tokenLength; i++) {
31521
- token += this._randomElement(config39.tokenChars);
31520
+ for (var i = 0; i < config48.tokenLength; i++) {
31521
+ token += this._randomElement(config48.tokenChars);
31522
31522
  }
31523
31523
  var sections = [adjective, noun, token];
31524
31524
  return sections.filter(function(e) {
31525
31525
  return !!e;
31526
- }).join(config39.delimiter);
31526
+ }).join(config48.delimiter);
31527
31527
  }
31528
31528
  /**
31529
31529
  * Get a random element from an array/string
@@ -40036,13 +40036,13 @@ var require_esprima = __commonJS({
40036
40036
  return Reader2;
40037
40037
  }();
40038
40038
  var Tokenizer = function() {
40039
- function Tokenizer2(code, config39) {
40039
+ function Tokenizer2(code, config48) {
40040
40040
  this.errorHandler = new error_handler_1.ErrorHandler();
40041
- this.errorHandler.tolerant = config39 ? typeof config39.tolerant === "boolean" && config39.tolerant : false;
40041
+ this.errorHandler.tolerant = config48 ? typeof config48.tolerant === "boolean" && config48.tolerant : false;
40042
40042
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
40043
- this.scanner.trackComment = config39 ? typeof config39.comment === "boolean" && config39.comment : false;
40044
- this.trackRange = config39 ? typeof config39.range === "boolean" && config39.range : false;
40045
- this.trackLoc = config39 ? typeof config39.loc === "boolean" && config39.loc : false;
40043
+ this.scanner.trackComment = config48 ? typeof config48.comment === "boolean" && config48.comment : false;
40044
+ this.trackRange = config48 ? typeof config48.range === "boolean" && config48.range : false;
40045
+ this.trackLoc = config48 ? typeof config48.loc === "boolean" && config48.loc : false;
40046
40046
  this.buffer = [];
40047
40047
  this.reader = new Reader();
40048
40048
  }
@@ -49803,11 +49803,11 @@ var require_printer = __commonJS({
49803
49803
  return this.code;
49804
49804
  };
49805
49805
  var emptyPrintResult = new PrintResult("");
49806
- var Printer = function Printer2(config39) {
49806
+ var Printer = function Printer2(config48) {
49807
49807
  assert_1.default.ok(this instanceof Printer2);
49808
- var explicitTabWidth = config39 && config39.tabWidth;
49809
- config39 = options_1.normalize(config39);
49810
- config39.sourceFileName = null;
49808
+ var explicitTabWidth = config48 && config48.tabWidth;
49809
+ config48 = options_1.normalize(config48);
49810
+ config48.sourceFileName = null;
49811
49811
  function makePrintFunctionWith(options, overrides) {
49812
49812
  options = Object.assign({}, options, overrides);
49813
49813
  return function(path6) {
@@ -49822,11 +49822,11 @@ var require_printer = __commonJS({
49822
49822
  includeComments: false
49823
49823
  }));
49824
49824
  }
49825
- var oldTabWidth = config39.tabWidth;
49825
+ var oldTabWidth = config48.tabWidth;
49826
49826
  if (!explicitTabWidth) {
49827
49827
  var loc = path6.getNode().loc;
49828
49828
  if (loc && loc.lines && loc.lines.guessTabWidth) {
49829
- config39.tabWidth = loc.lines.guessTabWidth();
49829
+ config48.tabWidth = loc.lines.guessTabWidth();
49830
49830
  }
49831
49831
  }
49832
49832
  var reprinter = patcher_1.getReprinter(path6);
@@ -49840,11 +49840,11 @@ var require_printer = __commonJS({
49840
49840
  // right choice because it gives us the opportunity to reprint
49841
49841
  // such nodes using their original source.
49842
49842
  reprinter(print2)
49843
- ) : genericPrint(path6, config39, options, makePrintFunctionWith(options, {
49843
+ ) : genericPrint(path6, config48, options, makePrintFunctionWith(options, {
49844
49844
  includeComments: true,
49845
49845
  avoidRootParens: false
49846
49846
  }));
49847
- config39.tabWidth = oldTabWidth;
49847
+ config48.tabWidth = oldTabWidth;
49848
49848
  return lines;
49849
49849
  }
49850
49850
  this.print = function(ast) {
@@ -49855,7 +49855,7 @@ var require_printer = __commonJS({
49855
49855
  includeComments: true,
49856
49856
  avoidRootParens: false
49857
49857
  });
49858
- return new PrintResult(lines.toString(config39), util.composeSourceMaps(config39.inputSourceMap, lines.getSourceMap(config39.sourceMapName, config39.sourceRoot)));
49858
+ return new PrintResult(lines.toString(config48), util.composeSourceMaps(config48.inputSourceMap, lines.getSourceMap(config48.sourceMapName, config48.sourceRoot)));
49859
49859
  };
49860
49860
  this.printGenerically = function(ast) {
49861
49861
  if (!ast) {
@@ -49863,26 +49863,26 @@ var require_printer = __commonJS({
49863
49863
  }
49864
49864
  function printGenerically(path7) {
49865
49865
  return comments_1.printComments(path7, function(path8) {
49866
- return genericPrint(path8, config39, {
49866
+ return genericPrint(path8, config48, {
49867
49867
  includeComments: true,
49868
49868
  avoidRootParens: false
49869
49869
  }, printGenerically);
49870
49870
  });
49871
49871
  }
49872
49872
  var path6 = fast_path_1.default.from(ast);
49873
- var oldReuseWhitespace = config39.reuseWhitespace;
49874
- config39.reuseWhitespace = false;
49875
- var pr = new PrintResult(printGenerically(path6).toString(config39));
49876
- config39.reuseWhitespace = oldReuseWhitespace;
49873
+ var oldReuseWhitespace = config48.reuseWhitespace;
49874
+ config48.reuseWhitespace = false;
49875
+ var pr = new PrintResult(printGenerically(path6).toString(config48));
49876
+ config48.reuseWhitespace = oldReuseWhitespace;
49877
49877
  return pr;
49878
49878
  };
49879
49879
  };
49880
49880
  exports2.Printer = Printer;
49881
- function genericPrint(path6, config39, options, printPath) {
49881
+ function genericPrint(path6, config48, options, printPath) {
49882
49882
  assert_1.default.ok(path6 instanceof fast_path_1.default);
49883
49883
  var node = path6.getValue();
49884
49884
  var parts = [];
49885
- var linesWithoutParens = genericPrintNoParens(path6, config39, printPath);
49885
+ var linesWithoutParens = genericPrintNoParens(path6, config48, printPath);
49886
49886
  if (!node || linesWithoutParens.isEmpty()) {
49887
49887
  return linesWithoutParens;
49888
49888
  }
@@ -69380,33 +69380,33 @@ var inputPrompt = async (promptConfig) => {
69380
69380
  }
69381
69381
  return input;
69382
69382
  };
69383
- var renderSubmit = (config39, value) => {
69384
- const { question, label } = config39;
69385
- if (config39.type !== "confirm" && !value) {
69383
+ var renderSubmit = (config48, value) => {
69384
+ const { question, label } = config48;
69385
+ if (config48.type !== "confirm" && !value) {
69386
69386
  return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
69387
69387
  }
69388
- const content = config39.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69388
+ const content = config48.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69389
69389
  return [`${leftT} ${question}`, content, `${grayBar}`];
69390
69390
  };
69391
- var getRenderers = (config39) => {
69392
- switch (config39.type) {
69391
+ var getRenderers = (config48) => {
69392
+ switch (config48.type) {
69393
69393
  case "select":
69394
- return getSelectRenderers(config39);
69394
+ return getSelectRenderers(config48);
69395
69395
  case "confirm":
69396
- return getConfirmRenderers(config39);
69396
+ return getConfirmRenderers(config48);
69397
69397
  case "text":
69398
- return getTextRenderers(config39);
69398
+ return getTextRenderers(config48);
69399
69399
  case "multiselect":
69400
- return getSelectRenderers(config39);
69400
+ return getSelectRenderers(config48);
69401
69401
  case "list":
69402
- return getSelectListRenderers(config39);
69402
+ return getSelectListRenderers(config48);
69403
69403
  }
69404
69404
  };
69405
- var getTextRenderers = (config39) => {
69406
- const { question } = config39;
69407
- const helpText = config39.helpText ?? "";
69408
- const format5 = config39.format ?? ((val) => String(val));
69409
- const defaultValue = config39.defaultValue?.toString() ?? "";
69405
+ var getTextRenderers = (config48) => {
69406
+ const { question } = config48;
69407
+ const helpText = config48.helpText ?? "";
69408
+ const format5 = config48.format ?? ((val) => String(val));
69409
+ const defaultValue = config48.defaultValue?.toString() ?? "";
69410
69410
  const activeRenderer = ({ value }) => [
69411
69411
  `${blCorner} ${bold(question)} ${dim(helpText)}`,
69412
69412
  `${space(2)}${format5(value || dim(defaultValue))}`,
@@ -69429,14 +69429,14 @@ var getTextRenderers = (config39) => {
69429
69429
  ``
69430
69430
  // extra line for readability
69431
69431
  ],
69432
- submit: ({ value }) => renderSubmit(config39, format5(value ?? "")),
69432
+ submit: ({ value }) => renderSubmit(config48, format5(value ?? "")),
69433
69433
  cancel: activeRenderer
69434
69434
  };
69435
69435
  };
69436
- var getSelectRenderers = (config39) => {
69437
- const { options, question, helpText: _helpText } = config39;
69436
+ var getSelectRenderers = (config48) => {
69437
+ const { options, question, helpText: _helpText } = config48;
69438
69438
  const helpText = _helpText ?? "";
69439
- const maxItemsPerPage = config39.maxItemsPerPage ?? 32;
69439
+ const maxItemsPerPage = config48.maxItemsPerPage ?? 32;
69440
69440
  const defaultRenderer = ({ cursor = 0, value }) => {
69441
69441
  const renderOption = (opt, i) => {
69442
69442
  const { label: optionLabel, value: optionValue } = opt;
@@ -69511,21 +69511,21 @@ ${space(2)}${dim("...")}` : ""}`,
69511
69511
  submit: ({ value }) => {
69512
69512
  if (Array.isArray(value)) {
69513
69513
  return renderSubmit(
69514
- config39,
69514
+ config48,
69515
69515
  options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
69516
69516
  );
69517
69517
  }
69518
69518
  return renderSubmit(
69519
- config39,
69519
+ config48,
69520
69520
  options.find((o) => o.value === value)?.label
69521
69521
  );
69522
69522
  },
69523
69523
  cancel: defaultRenderer
69524
69524
  };
69525
69525
  };
69526
- var getSelectListRenderers = (config39) => {
69527
- const { question, helpText: _helpText } = config39;
69528
- let options = config39.options;
69526
+ var getSelectListRenderers = (config48) => {
69527
+ const { question, helpText: _helpText } = config48;
69528
+ let options = config48.options;
69529
69529
  const helpText = _helpText ?? "";
69530
69530
  const { rows } = stdout;
69531
69531
  const defaultRenderer = ({ cursor, value }, prompt) => {
@@ -69606,20 +69606,20 @@ var getSelectListRenderers = (config39) => {
69606
69606
  submit: ({ value }) => {
69607
69607
  if (Array.isArray(value)) {
69608
69608
  return renderSubmit(
69609
- config39,
69609
+ config48,
69610
69610
  options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
69611
69611
  );
69612
69612
  }
69613
69613
  return renderSubmit(
69614
- config39,
69614
+ config48,
69615
69615
  options.find((o) => o.value === value)?.value
69616
69616
  );
69617
69617
  },
69618
69618
  cancel: defaultRenderer
69619
69619
  };
69620
69620
  };
69621
- var getConfirmRenderers = (config39) => {
69622
- const { activeText, inactiveText, question, helpText: _helpText } = config39;
69621
+ var getConfirmRenderers = (config48) => {
69622
+ const { activeText, inactiveText, question, helpText: _helpText } = config48;
69623
69623
  const helpText = _helpText ?? "";
69624
69624
  const active = activeText || "Yes";
69625
69625
  const inactive = inactiveText || "No";
@@ -69636,7 +69636,7 @@ var getConfirmRenderers = (config39) => {
69636
69636
  active: defaultRenderer,
69637
69637
  confirm: defaultRenderer,
69638
69638
  error: defaultRenderer,
69639
- submit: ({ value }) => renderSubmit(config39, value ? "yes" : "no"),
69639
+ submit: ({ value }) => renderSubmit(config48, value ? "yes" : "no"),
69640
69640
  cancel: defaultRenderer
69641
69641
  };
69642
69642
  };
@@ -70604,23 +70604,23 @@ var YargsParser = class {
70604
70604
  const configPath = argv2[configKey] || configLookup[configKey];
70605
70605
  if (configPath) {
70606
70606
  try {
70607
- let config39 = null;
70607
+ let config48 = null;
70608
70608
  const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
70609
70609
  const resolveConfig = flags.configs[configKey];
70610
70610
  if (typeof resolveConfig === "function") {
70611
70611
  try {
70612
- config39 = resolveConfig(resolvedConfigPath);
70612
+ config48 = resolveConfig(resolvedConfigPath);
70613
70613
  } catch (e) {
70614
- config39 = e;
70614
+ config48 = e;
70615
70615
  }
70616
- if (config39 instanceof Error) {
70617
- error2 = config39;
70616
+ if (config48 instanceof Error) {
70617
+ error2 = config48;
70618
70618
  return;
70619
70619
  }
70620
70620
  } else {
70621
- config39 = mixin2.require(resolvedConfigPath);
70621
+ config48 = mixin2.require(resolvedConfigPath);
70622
70622
  }
70623
- setConfigObject(config39);
70623
+ setConfigObject(config48);
70624
70624
  } catch (ex) {
70625
70625
  if (ex.name === "PermissionDenied")
70626
70626
  error2 = ex;
@@ -70630,9 +70630,9 @@ var YargsParser = class {
70630
70630
  }
70631
70631
  });
70632
70632
  }
70633
- function setConfigObject(config39, prev) {
70634
- Object.keys(config39).forEach(function(key) {
70635
- const value = config39[key];
70633
+ function setConfigObject(config48, prev) {
70634
+ Object.keys(config48).forEach(function(key) {
70635
+ const value = config48[key];
70636
70636
  const fullKey = prev ? prev + "." + key : key;
70637
70637
  if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
70638
70638
  setConfigObject(value, fullKey);
@@ -71784,11 +71784,11 @@ var CommandInstance = class {
71784
71784
  });
71785
71785
  if (!unparsed.length)
71786
71786
  return;
71787
- const config39 = Object.assign({}, options.configuration, {
71787
+ const config48 = Object.assign({}, options.configuration, {
71788
71788
  "populate--": false
71789
71789
  });
71790
71790
  const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
71791
- configuration: config39
71791
+ configuration: config48
71792
71792
  }));
71793
71793
  if (parsed.error) {
71794
71794
  yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
@@ -73011,31 +73011,31 @@ ${customMsgs.join("\n")}` : "";
73011
73011
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
73012
73012
  var previouslyVisitedConfigs = [];
73013
73013
  var shim2;
73014
- function applyExtends(config39, cwd, mergeExtends, _shim) {
73014
+ function applyExtends(config48, cwd, mergeExtends, _shim) {
73015
73015
  shim2 = _shim;
73016
73016
  let defaultConfig = {};
73017
- if (Object.prototype.hasOwnProperty.call(config39, "extends")) {
73018
- if (typeof config39.extends !== "string")
73017
+ if (Object.prototype.hasOwnProperty.call(config48, "extends")) {
73018
+ if (typeof config48.extends !== "string")
73019
73019
  return defaultConfig;
73020
- const isPath = /\.json|\..*rc$/.test(config39.extends);
73020
+ const isPath = /\.json|\..*rc$/.test(config48.extends);
73021
73021
  let pathToDefault = null;
73022
73022
  if (!isPath) {
73023
73023
  try {
73024
- pathToDefault = require.resolve(config39.extends);
73024
+ pathToDefault = require.resolve(config48.extends);
73025
73025
  } catch (_err) {
73026
- return config39;
73026
+ return config48;
73027
73027
  }
73028
73028
  } else {
73029
- pathToDefault = getPathToDefaultConfig(cwd, config39.extends);
73029
+ pathToDefault = getPathToDefaultConfig(cwd, config48.extends);
73030
73030
  }
73031
73031
  checkForCircularExtends(pathToDefault);
73032
73032
  previouslyVisitedConfigs.push(pathToDefault);
73033
- defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config39.extends);
73034
- delete config39.extends;
73033
+ defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config48.extends);
73034
+ delete config48.extends;
73035
73035
  defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
73036
73036
  }
73037
73037
  previouslyVisitedConfigs = [];
73038
- return mergeExtends ? mergeDeep(defaultConfig, config39) : Object.assign({}, defaultConfig, config39);
73038
+ return mergeExtends ? mergeDeep(defaultConfig, config48) : Object.assign({}, defaultConfig, config48);
73039
73039
  }
73040
73040
  function checkForCircularExtends(cfgPath) {
73041
73041
  if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
@@ -73811,9 +73811,9 @@ var YargsInstance = class {
73811
73811
  }
73812
73812
  return maybePromise;
73813
73813
  }
73814
- parserConfiguration(config39) {
73815
- argsert("<object>", [config39], arguments.length);
73816
- __classPrivateFieldSet(this, _YargsInstance_parserConfig, config39, "f");
73814
+ parserConfiguration(config48) {
73815
+ argsert("<object>", [config48], arguments.length);
73816
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config48, "f");
73817
73817
  return this;
73818
73818
  }
73819
73819
  pkgConf(key, rootPath) {
@@ -73985,9 +73985,9 @@ var YargsInstance = class {
73985
73985
  return this;
73986
73986
  }
73987
73987
  }
73988
- usageConfiguration(config39) {
73989
- argsert("<object>", [config39], arguments.length);
73990
- __classPrivateFieldSet(this, _YargsInstance_usageConfig, config39, "f");
73988
+ usageConfiguration(config48) {
73989
+ argsert("<object>", [config48], arguments.length);
73990
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config48, "f");
73991
73991
  return this;
73992
73992
  }
73993
73993
  version(opt, msg, ver) {
@@ -74393,11 +74393,11 @@ var YargsInstance = class {
74393
74393
  __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
74394
74394
  __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
74395
74395
  const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
74396
- const config39 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
74396
+ const config48 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
74397
74397
  "populate--": true
74398
74398
  });
74399
74399
  const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
74400
- configuration: { "parse-positional-numbers": false, ...config39 }
74400
+ configuration: { "parse-positional-numbers": false, ...config48 }
74401
74401
  }));
74402
74402
  const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
74403
74403
  let argvPromise = void 0;
@@ -74560,7 +74560,7 @@ var Yargs = YargsFactory(esm_default);
74560
74560
  var yargs_default = Yargs;
74561
74561
 
74562
74562
  // package.json
74563
- var version = "0.0.0-6a958df17";
74563
+ var version = "0.0.0-6ae158397";
74564
74564
 
74565
74565
  // src/metrics.ts
74566
74566
  var import_node_async_hooks = require("node:async_hooks");
@@ -74604,12 +74604,12 @@ function getGlobalWranglerConfigPath() {
74604
74604
  }
74605
74605
 
74606
74606
  // src/helpers/metrics-config.ts
74607
- function writeMetricsConfig(config39) {
74607
+ function writeMetricsConfig(config48) {
74608
74608
  (0, import_node_fs2.mkdirSync)(import_node_path2.default.dirname(getMetricsConfigPath()), { recursive: true });
74609
74609
  (0, import_node_fs2.writeFileSync)(
74610
74610
  getMetricsConfigPath(),
74611
74611
  JSON.stringify(
74612
- config39,
74612
+ config48,
74613
74613
  (_key, value) => value instanceof Date ? value.toISOString() : value,
74614
74614
  " "
74615
74615
  )
@@ -74617,9 +74617,9 @@ function writeMetricsConfig(config39) {
74617
74617
  }
74618
74618
  function readMetricsConfig() {
74619
74619
  try {
74620
- const config39 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
74620
+ const config48 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
74621
74621
  return JSON.parse(
74622
- config39,
74622
+ config48,
74623
74623
  (key, value) => key === "date" ? new Date(value) : value
74624
74624
  );
74625
74625
  } catch {
@@ -74629,10 +74629,10 @@ function readMetricsConfig() {
74629
74629
  function getMetricsConfigPath() {
74630
74630
  return import_node_path2.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
74631
74631
  }
74632
- function getDeviceId(config39) {
74633
- const deviceId = config39.deviceId ?? (0, import_node_crypto.randomUUID)();
74634
- if (config39.deviceId === void 0) {
74635
- writeMetricsConfig({ ...config39, deviceId });
74632
+ function getDeviceId(config48) {
74633
+ const deviceId = config48.deviceId ?? (0, import_node_crypto.randomUUID)();
74634
+ if (config48.deviceId === void 0) {
74635
+ writeMetricsConfig({ ...config48, deviceId });
74636
74636
  }
74637
74637
  return deviceId;
74638
74638
  }
@@ -74817,7 +74817,7 @@ var detectPackageManager = () => {
74817
74817
  }
74818
74818
  };
74819
74819
  var rectifyPmMismatch = async (ctx) => {
74820
- const { npm: npm24 } = detectPackageManager();
74820
+ const { npm: npm25 } = detectPackageManager();
74821
74821
  if (!detectPmMismatch(ctx)) {
74822
74822
  return;
74823
74823
  }
@@ -74829,17 +74829,17 @@ var rectifyPmMismatch = async (ctx) => {
74829
74829
  if ((0, import_fs5.existsSync)(lockfilePath)) {
74830
74830
  (0, import_fs5.rmSync)(lockfilePath);
74831
74831
  }
74832
- await runCommand([npm24, "install"], {
74832
+ await runCommand([npm25, "install"], {
74833
74833
  silent: true,
74834
74834
  cwd: ctx.project.path,
74835
74835
  startText: "Installing dependencies",
74836
- doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
74836
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
74837
74837
  });
74838
74838
  };
74839
74839
  var detectPmMismatch = (ctx) => {
74840
- const { npm: npm24 } = detectPackageManager();
74840
+ const { npm: npm25 } = detectPackageManager();
74841
74841
  const projectPath = ctx.project.path;
74842
- switch (npm24) {
74842
+ switch (npm25) {
74843
74843
  case "npm":
74844
74844
  return false;
74845
74845
  case "yarn":
@@ -74907,10 +74907,10 @@ function getPlatform() {
74907
74907
  function createReporter() {
74908
74908
  const events = [];
74909
74909
  const als = new import_node_async_hooks.AsyncLocalStorage();
74910
- const config39 = readMetricsConfig() ?? {};
74911
- const isFirstUsage = config39.c3permission === void 0;
74910
+ const config48 = readMetricsConfig() ?? {};
74911
+ const isFirstUsage = config48.c3permission === void 0;
74912
74912
  const isEnabled = isTelemetryEnabled();
74913
- const deviceId = getDeviceId(config39);
74913
+ const deviceId = getDeviceId(config48);
74914
74914
  const packageManager = detectPackageManager();
74915
74915
  const platform3 = getPlatform();
74916
74916
  const amplitude_session_id = Date.now();
@@ -74943,7 +74943,7 @@ function createReporter() {
74943
74943
  if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
74944
74944
  return false;
74945
74945
  }
74946
- return hasSparrowSourceKey() && getC3Permission(config39).enabled;
74946
+ return hasSparrowSourceKey() && getC3Permission(config48).enabled;
74947
74947
  }
74948
74948
  async function waitForAllEventsSettled() {
74949
74949
  await Promise.allSettled(events);
@@ -75049,20 +75049,20 @@ function initializeC3Permission(enabled = true) {
75049
75049
  date: /* @__PURE__ */ new Date()
75050
75050
  };
75051
75051
  }
75052
- function getC3Permission(config39 = readMetricsConfig() ?? {}) {
75053
- if (!config39.c3permission) {
75054
- config39.c3permission = initializeC3Permission();
75055
- writeMetricsConfig(config39);
75052
+ function getC3Permission(config48 = readMetricsConfig() ?? {}) {
75053
+ if (!config48.c3permission) {
75054
+ config48.c3permission = initializeC3Permission();
75055
+ writeMetricsConfig(config48);
75056
75056
  }
75057
- return config39.c3permission;
75057
+ return config48.c3permission;
75058
75058
  }
75059
75059
  function updateC3Pemission(enabled) {
75060
- const config39 = readMetricsConfig();
75061
- if (config39.c3permission?.enabled === enabled) {
75060
+ const config48 = readMetricsConfig();
75061
+ if (config48.c3permission?.enabled === enabled) {
75062
75062
  return;
75063
75063
  }
75064
- config39.c3permission = initializeC3Permission(enabled);
75065
- writeMetricsConfig(config39);
75064
+ config48.c3permission = initializeC3Permission(enabled);
75065
+ writeMetricsConfig(config48);
75066
75066
  }
75067
75067
  var runTelemetryCommand = (action) => {
75068
75068
  const logTelemetryStatus = (enabled) => {
@@ -75107,39 +75107,39 @@ var import_haikunator = __toESM(require_dist_web());
75107
75107
  var import_fs6 = require("fs");
75108
75108
  var import_path6 = __toESM(require("path"));
75109
75109
  var import_undici2 = __toESM(require_undici());
75110
- var installPackages = async (packages, config39 = {}) => {
75111
- const { npm: npm24 } = detectPackageManager();
75110
+ var installPackages = async (packages, config48 = {}) => {
75111
+ const { npm: npm25 } = detectPackageManager();
75112
75112
  let saveFlag;
75113
75113
  let cmd;
75114
- switch (npm24) {
75114
+ switch (npm25) {
75115
75115
  case "yarn":
75116
75116
  cmd = "add";
75117
- saveFlag = config39.dev ? "-D" : "";
75117
+ saveFlag = config48.dev ? "-D" : "";
75118
75118
  break;
75119
75119
  case "bun":
75120
75120
  cmd = "add";
75121
- saveFlag = config39.dev ? "-d" : "";
75121
+ saveFlag = config48.dev ? "-d" : "";
75122
75122
  break;
75123
75123
  case "npm":
75124
75124
  case "pnpm":
75125
75125
  default:
75126
75126
  cmd = "install";
75127
- saveFlag = config39.dev ? "--save-dev" : "";
75127
+ saveFlag = config48.dev ? "--save-dev" : "";
75128
75128
  break;
75129
75129
  }
75130
75130
  await runCommand(
75131
75131
  [
75132
- npm24,
75132
+ npm25,
75133
75133
  cmd,
75134
75134
  ...saveFlag ? [saveFlag] : [],
75135
75135
  ...packages,
75136
75136
  // Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
75137
75137
  // frameworks that haven't updated their peer dependency for Wrangler v4
75138
75138
  // TODO: Remove this once Wrangler v4 has been released and framework templates are updated
75139
- ...npm24 === "npm" ? ["--legacy-peer-deps"] : []
75139
+ ...npm25 === "npm" ? ["--legacy-peer-deps"] : []
75140
75140
  ],
75141
75141
  {
75142
- ...config39,
75142
+ ...config48,
75143
75143
  silent: true
75144
75144
  }
75145
75145
  );
@@ -75149,16 +75149,16 @@ var npmInstall = async (ctx) => {
75149
75149
  if ((0, import_fs6.existsSync)(nodeModulesPath)) {
75150
75150
  return;
75151
75151
  }
75152
- const { npm: npm24 } = detectPackageManager();
75152
+ const { npm: npm25 } = detectPackageManager();
75153
75153
  await runCommand(
75154
75154
  // Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
75155
75155
  // frameworks that haven't updated their peer dependency for Wrangler v4
75156
75156
  // TODO: Remove this once Wrangler v4 has been released and framework templates are updated
75157
- [npm24, "install", ...npm24 === "npm" ? ["--legacy-peer-deps"] : []],
75157
+ [npm25, "install", ...npm25 === "npm" ? ["--legacy-peer-deps"] : []],
75158
75158
  {
75159
75159
  silent: true,
75160
75160
  startText: "Installing dependencies",
75161
- doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
75161
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
75162
75162
  }
75163
75163
  );
75164
75164
  };
@@ -75168,14 +75168,14 @@ async function getLatestPackageVersion(packageSpecifier) {
75168
75168
  return npmInfo["dist-tags"].latest;
75169
75169
  }
75170
75170
  var installWrangler = async () => {
75171
- const { npm: npm24 } = detectPackageManager();
75171
+ const { npm: npm25 } = detectPackageManager();
75172
75172
  await installPackages([`wrangler@latest`], {
75173
75173
  dev: true,
75174
75174
  startText: `Installing wrangler ${dim(
75175
75175
  "A command line tool for building Cloudflare Workers"
75176
75176
  )}`,
75177
75177
  doneText: `${brandColor("installed")} ${dim(
75178
- `via \`${npm24} install wrangler --save-dev\``
75178
+ `via \`${npm25} install wrangler --save-dev\``
75179
75179
  )}`
75180
75180
  });
75181
75181
  };
@@ -75335,20 +75335,21 @@ var package_default = {
75335
75335
  "so that we can use dependabot to update these dependencies automatically."
75336
75336
  ],
75337
75337
  dependencies: {
75338
- "create-astro": "4.11.0",
75338
+ "create-astro": "4.11.3",
75339
75339
  "create-analog": "1.8.1",
75340
- "@angular/create": "19.1.6",
75340
+ "@angular/create": "19.2.9",
75341
75341
  "create-docusaurus": "3.7.0",
75342
- "create-hono": "0.15.3",
75343
- "create-next-app": "15.2.1",
75344
- "create-qwik": "1.12.0",
75345
- "create-vite": "6.1.1",
75346
- "create-remix": "2.15.3",
75347
- "create-solid": "0.6.1",
75348
- "create-vue": "3.14.2",
75349
- gatsby: "5.14.1",
75350
- sv: "0.6.23",
75351
- nuxi: "3.21.1"
75342
+ "create-hono": "0.18.0",
75343
+ "create-next-app": "15.3.1",
75344
+ "create-qwik": "1.13.0",
75345
+ "create-vite": "6.4.1",
75346
+ "create-remix": "2.16.5",
75347
+ "create-react-router": "7.5.2",
75348
+ "create-solid": "0.6.2",
75349
+ "create-vue": "3.16.4",
75350
+ gatsby: "5.14.3",
75351
+ sv: "0.8.3",
75352
+ nuxi: "3.25.0"
75352
75353
  }
75353
75354
  };
75354
75355
 
@@ -75363,9 +75364,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
75363
75364
  };
75364
75365
  var runFrameworkGenerator = async (ctx, args) => {
75365
75366
  const cli = getFrameworkCli(ctx, true);
75366
- const { npm: npm24, dlx } = detectPackageManager();
75367
- const cmd = [...npm24 === "yarn" ? ["npx"] : dlx, cli, ...args];
75368
- const env3 = npm24 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
75367
+ const { npm: npm25, dlx } = detectPackageManager();
75368
+ const cmd = [...npm25 === "yarn" ? ["npx"] : dlx, cli, ...args];
75369
+ const env3 = npm25 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
75369
75370
  if (ctx.args.additionalArgs?.length) {
75370
75371
  cmd.push(...ctx.args.additionalArgs);
75371
75372
  }
@@ -75378,63 +75379,6 @@ var runFrameworkGenerator = async (ctx, args) => {
75378
75379
  await runCommand(cmd, { env: env3 });
75379
75380
  };
75380
75381
 
75381
- // templates-experimental/next/c3.ts
75382
- var generate = async (ctx) => {
75383
- await runFrameworkGenerator(ctx, [ctx.project.name]);
75384
- };
75385
- var configure = async (ctx) => {
75386
- const packages = [
75387
- "@opennextjs/cloudflare@0.5.x",
75388
- "@cloudflare/workers-types"
75389
- ];
75390
- await installPackages(packages, {
75391
- dev: true,
75392
- startText: "Adding the Cloudflare adapter",
75393
- doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
75394
- });
75395
- const usesTs = usesTypescript(ctx);
75396
- updateNextConfig(usesTs);
75397
- };
75398
- var updateNextConfig = (usesTs) => {
75399
- const s = spinner();
75400
- const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
75401
- s.start(`Updating \`${configFile}\``);
75402
- const configContent = readFile(configFile);
75403
- const updatedConfigFile = configContent + `
75404
- // added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
75405
- import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
75406
- initOpenNextCloudflareForDev();
75407
- `.replace(/\n\t*/g, "\n");
75408
- writeFile2(configFile, updatedConfigFile);
75409
- s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
75410
- };
75411
- var c3_default = {
75412
- configVersion: 1,
75413
- id: "next",
75414
- frameworkCli: "create-next-app",
75415
- // TODO: Stop using a pinned version when the template graduates.
75416
- frameworkCliPinnedVersion: "~15.2.2",
75417
- platform: "workers",
75418
- displayName: "Next.js (using Node.js compat + Workers Assets)",
75419
- path: "templates-experimental/next",
75420
- copyFiles: {
75421
- path: "./templates"
75422
- },
75423
- generate,
75424
- configure,
75425
- transformPackageJson: async () => ({
75426
- scripts: {
75427
- deploy: `opennextjs-cloudflare && wrangler deploy`,
75428
- preview: `opennextjs-cloudflare && wrangler dev`,
75429
- "cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
75430
- }
75431
- }),
75432
- devScript: "dev",
75433
- previewScript: "preview",
75434
- deployScript: "deploy",
75435
- compatibilityFlags: ["nodejs_compat"]
75436
- };
75437
-
75438
75382
  // src/helpers/codemod.ts
75439
75383
  var import_fs8 = require("fs");
75440
75384
  var import_path8 = __toESM(require("path"));
@@ -75565,11 +75509,11 @@ function getLatestTypesEntrypoint(ctx) {
75565
75509
  // templates-experimental/solid/c3.ts
75566
75510
  var recast2 = __toESM(require_main3());
75567
75511
  var { npm } = detectPackageManager();
75568
- var generate2 = async (ctx) => {
75512
+ var generate = async (ctx) => {
75569
75513
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
75570
75514
  logRaw("");
75571
75515
  };
75572
- var configure2 = async (ctx) => {
75516
+ var configure = async (ctx) => {
75573
75517
  const packages = ["nitropack"];
75574
75518
  await installPackages(packages, {
75575
75519
  dev: true,
@@ -75620,8 +75564,8 @@ var config = {
75620
75564
  path: "./templates"
75621
75565
  },
75622
75566
  path: "templates-experimental/solid",
75623
- generate: generate2,
75624
- configure: configure2,
75567
+ generate,
75568
+ configure,
75625
75569
  transformPackageJson: async () => ({
75626
75570
  scripts: {
75627
75571
  preview: `${npm} run build && npx wrangler dev`,
@@ -75633,12 +75577,12 @@ var config = {
75633
75577
  deployScript: "deploy",
75634
75578
  previewScript: "preview"
75635
75579
  };
75636
- var c3_default2 = config;
75580
+ var c3_default = config;
75637
75581
 
75638
75582
  // templates/analog/c3.ts
75639
75583
  var recast3 = __toESM(require_main3());
75640
75584
  var { npm: npm2, name: pm } = detectPackageManager();
75641
- var generate3 = async (ctx) => {
75585
+ var generate2 = async (ctx) => {
75642
75586
  await runFrameworkGenerator(ctx, [
75643
75587
  ctx.project.name,
75644
75588
  "--template",
@@ -75646,7 +75590,7 @@ var generate3 = async (ctx) => {
75646
75590
  ]);
75647
75591
  logRaw("");
75648
75592
  };
75649
- var configure3 = async (ctx) => {
75593
+ var configure2 = async (ctx) => {
75650
75594
  if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
75651
75595
  const packages = [];
75652
75596
  packages.push("nitropack");
@@ -75723,8 +75667,8 @@ var config2 = {
75723
75667
  copyFiles: {
75724
75668
  path: "./templates"
75725
75669
  },
75726
- generate: generate3,
75727
- configure: configure3,
75670
+ generate: generate2,
75671
+ configure: configure2,
75728
75672
  transformPackageJson: async () => ({
75729
75673
  scripts: {
75730
75674
  preview: `${npm2} run build && wrangler pages dev`,
@@ -75736,12 +75680,12 @@ var config2 = {
75736
75680
  deployScript: "deploy",
75737
75681
  previewScript: "preview"
75738
75682
  };
75739
- var c3_default3 = config2;
75683
+ var c3_default2 = config2;
75740
75684
 
75741
75685
  // templates/angular/pages/c3.ts
75742
75686
  var import_node_path3 = require("node:path");
75743
75687
  var { npm: npm3 } = detectPackageManager();
75744
- var generate4 = async (ctx) => {
75688
+ var generate3 = async (ctx) => {
75745
75689
  await runFrameworkGenerator(ctx, [
75746
75690
  ctx.project.name,
75747
75691
  "--ssr",
@@ -75749,7 +75693,7 @@ var generate4 = async (ctx) => {
75749
75693
  ]);
75750
75694
  logRaw("");
75751
75695
  };
75752
- var configure4 = async (ctx) => {
75696
+ var configure3 = async (ctx) => {
75753
75697
  updateAngularJson(ctx);
75754
75698
  await updateAppCode();
75755
75699
  await installCFWorker();
@@ -75806,6 +75750,7 @@ var config3 = {
75806
75750
  frameworkCli: "@angular/create",
75807
75751
  displayName: "Angular",
75808
75752
  platform: "pages",
75753
+ hidden: true,
75809
75754
  copyFiles: {
75810
75755
  path: "./templates"
75811
75756
  },
@@ -75813,8 +75758,8 @@ var config3 = {
75813
75758
  devScript: "start",
75814
75759
  deployScript: "deploy",
75815
75760
  previewScript: "start",
75816
- generate: generate4,
75817
- configure: configure4,
75761
+ generate: generate3,
75762
+ configure: configure3,
75818
75763
  transformPackageJson: async () => ({
75819
75764
  scripts: {
75820
75765
  start: `${npm3} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
@@ -75824,12 +75769,12 @@ var config3 = {
75824
75769
  }
75825
75770
  })
75826
75771
  };
75827
- var c3_default4 = config3;
75772
+ var c3_default3 = config3;
75828
75773
 
75829
75774
  // templates/angular/workers/c3.ts
75830
75775
  var import_node_path4 = require("node:path");
75831
75776
  var { npm: npm4 } = detectPackageManager();
75832
- var generate5 = async (ctx) => {
75777
+ var generate4 = async (ctx) => {
75833
75778
  await runFrameworkGenerator(ctx, [
75834
75779
  ctx.project.name,
75835
75780
  "--ssr",
@@ -75837,7 +75782,7 @@ var generate5 = async (ctx) => {
75837
75782
  ]);
75838
75783
  logRaw("");
75839
75784
  };
75840
- var configure5 = async (ctx) => {
75785
+ var configure4 = async (ctx) => {
75841
75786
  updateAngularJson2(ctx);
75842
75787
  await updateAppCode2();
75843
75788
  await installCFWorker2();
@@ -75900,8 +75845,8 @@ var config4 = {
75900
75845
  devScript: "start",
75901
75846
  deployScript: "deploy",
75902
75847
  previewScript: "start",
75903
- generate: generate5,
75904
- configure: configure5,
75848
+ generate: generate4,
75849
+ configure: configure4,
75905
75850
  transformPackageJson: async () => ({
75906
75851
  scripts: {
75907
75852
  start: `${npm4} run build && wrangler dev`,
@@ -75910,23 +75855,23 @@ var config4 = {
75910
75855
  }
75911
75856
  })
75912
75857
  };
75913
- var c3_default5 = config4;
75858
+ var c3_default4 = config4;
75914
75859
 
75915
75860
  // templates/angular/c3.ts
75916
75861
  var config5 = {
75917
75862
  displayName: "Angular",
75918
- platformVariants: { pages: c3_default4, workers: c3_default5 }
75863
+ platformVariants: { pages: c3_default3, workers: c3_default4 }
75919
75864
  };
75920
- var c3_default6 = config5;
75865
+ var c3_default5 = config5;
75921
75866
 
75922
75867
  // templates/astro/pages/c3.ts
75923
75868
  var recast4 = __toESM(require_main3());
75924
75869
  var { npx } = detectPackageManager();
75925
- var generate6 = async (ctx) => {
75870
+ var generate5 = async (ctx) => {
75926
75871
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
75927
75872
  logRaw("");
75928
75873
  };
75929
- var configure6 = async () => {
75874
+ var configure5 = async () => {
75930
75875
  await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
75931
75876
  silent: true,
75932
75877
  startText: "Installing adapter",
@@ -75965,6 +75910,7 @@ var config6 = {
75965
75910
  id: "astro",
75966
75911
  frameworkCli: "create-astro",
75967
75912
  platform: "pages",
75913
+ hidden: true,
75968
75914
  displayName: "Astro",
75969
75915
  path: "templates/astro/pages",
75970
75916
  copyFiles: {
@@ -75983,8 +75929,8 @@ var config6 = {
75983
75929
  devScript: "dev",
75984
75930
  deployScript: "deploy",
75985
75931
  previewScript: "preview",
75986
- generate: generate6,
75987
- configure: configure6,
75932
+ generate: generate5,
75933
+ configure: configure5,
75988
75934
  transformPackageJson: async (pkgJson, ctx) => ({
75989
75935
  scripts: {
75990
75936
  deploy: `astro build && wrangler pages deploy`,
@@ -75993,16 +75939,16 @@ var config6 = {
75993
75939
  }
75994
75940
  })
75995
75941
  };
75996
- var c3_default7 = config6;
75942
+ var c3_default6 = config6;
75997
75943
 
75998
75944
  // templates/astro/workers/c3.ts
75999
75945
  var recast5 = __toESM(require_main3());
76000
75946
  var { npx: npx2 } = detectPackageManager();
76001
- var generate7 = async (ctx) => {
75947
+ var generate6 = async (ctx) => {
76002
75948
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
76003
75949
  logRaw("");
76004
75950
  };
76005
- var configure7 = async () => {
75951
+ var configure6 = async () => {
76006
75952
  await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
76007
75953
  silent: true,
76008
75954
  startText: "Installing adapter",
@@ -76059,8 +76005,8 @@ var config7 = {
76059
76005
  deployScript: "deploy",
76060
76006
  previewScript: "preview",
76061
76007
  path: "templates/astro/workers",
76062
- generate: generate7,
76063
- configure: configure7,
76008
+ generate: generate6,
76009
+ configure: configure6,
76064
76010
  transformPackageJson: async (pkgJson, ctx) => ({
76065
76011
  scripts: {
76066
76012
  deploy: `astro build && wrangler deploy`,
@@ -76069,17 +76015,17 @@ var config7 = {
76069
76015
  }
76070
76016
  })
76071
76017
  };
76072
- var c3_default8 = config7;
76018
+ var c3_default7 = config7;
76073
76019
 
76074
76020
  // templates/astro/c3.ts
76075
76021
  var config8 = {
76076
76022
  displayName: "Astro",
76077
- platformVariants: { pages: c3_default7, workers: c3_default8 }
76023
+ platformVariants: { pages: c3_default6, workers: c3_default7 }
76078
76024
  };
76079
- var c3_default9 = config8;
76025
+ var c3_default8 = config8;
76080
76026
 
76081
76027
  // templates/common/c3.ts
76082
- var c3_default10 = {
76028
+ var config9 = {
76083
76029
  configVersion: 1,
76084
76030
  id: "common",
76085
76031
  displayName: "Example router & proxy Worker",
@@ -76097,20 +76043,22 @@ var c3_default10 = {
76097
76043
  }
76098
76044
  }
76099
76045
  };
76046
+ var c3_default9 = config9;
76100
76047
 
76101
76048
  // templates/docusaurus/pages/c3.ts
76102
76049
  var { npm: npm5 } = detectPackageManager();
76103
- var generate8 = async (ctx) => {
76050
+ var generate7 = async (ctx) => {
76104
76051
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
76105
76052
  };
76106
- var config9 = {
76053
+ var config10 = {
76107
76054
  configVersion: 1,
76108
76055
  id: "docusaurus",
76109
76056
  frameworkCli: "create-docusaurus",
76110
76057
  platform: "pages",
76058
+ hidden: true,
76111
76059
  displayName: "Docusaurus",
76112
76060
  path: "templates/docusaurus/pages",
76113
- generate: generate8,
76061
+ generate: generate7,
76114
76062
  transformPackageJson: async () => ({
76115
76063
  scripts: {
76116
76064
  preview: `${npm5} run build && wrangler pages dev ./build`,
@@ -76121,14 +76069,14 @@ var config9 = {
76121
76069
  deployScript: "deploy",
76122
76070
  previewScript: "preview"
76123
76071
  };
76124
- var c3_default11 = config9;
76072
+ var c3_default10 = config10;
76125
76073
 
76126
76074
  // templates/docusaurus/workers/c3.ts
76127
76075
  var { npm: npm6 } = detectPackageManager();
76128
- var generate9 = async (ctx) => {
76076
+ var generate8 = async (ctx) => {
76129
76077
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
76130
76078
  };
76131
- var config10 = {
76079
+ var config11 = {
76132
76080
  configVersion: 1,
76133
76081
  id: "docusaurus",
76134
76082
  frameworkCli: "create-docusaurus",
@@ -76138,7 +76086,7 @@ var config10 = {
76138
76086
  path: "./templates"
76139
76087
  },
76140
76088
  path: "templates/docusaurus/workers",
76141
- generate: generate9,
76089
+ generate: generate8,
76142
76090
  transformPackageJson: async () => ({
76143
76091
  scripts: {
76144
76092
  deploy: `${npm6} run build && wrangler deploy`,
@@ -76149,18 +76097,18 @@ var config10 = {
76149
76097
  deployScript: "deploy",
76150
76098
  previewScript: "preview"
76151
76099
  };
76152
- var c3_default12 = config10;
76100
+ var c3_default11 = config11;
76153
76101
 
76154
76102
  // templates/docusaurus/c3.ts
76155
- var config11 = {
76103
+ var config12 = {
76156
76104
  displayName: "Docusaurus",
76157
- platformVariants: { pages: c3_default11, workers: c3_default12 }
76105
+ platformVariants: { pages: c3_default10, workers: c3_default11 }
76158
76106
  };
76159
- var c3_default13 = config11;
76107
+ var c3_default12 = config12;
76160
76108
 
76161
76109
  // templates/gatsby/pages/c3.ts
76162
76110
  var { npm: npm7 } = detectPackageManager();
76163
- var generate10 = async (ctx) => {
76111
+ var generate9 = async (ctx) => {
76164
76112
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
76165
76113
  const useTemplate = await inputPrompt({
76166
76114
  type: "confirm",
@@ -76179,14 +76127,15 @@ var generate10 = async (ctx) => {
76179
76127
  }
76180
76128
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
76181
76129
  };
76182
- var config12 = {
76130
+ var config13 = {
76183
76131
  configVersion: 1,
76184
76132
  id: "gatsby",
76185
76133
  frameworkCli: "gatsby",
76186
76134
  platform: "pages",
76135
+ hidden: true,
76187
76136
  displayName: "Gatsby",
76188
76137
  path: "templates/gatsby/pages",
76189
- generate: generate10,
76138
+ generate: generate9,
76190
76139
  transformPackageJson: async () => ({
76191
76140
  scripts: {
76192
76141
  deploy: `${npm7} run build && wrangler pages deploy ./public`,
@@ -76197,11 +76146,11 @@ var config12 = {
76197
76146
  deployScript: "deploy",
76198
76147
  previewScript: "preview"
76199
76148
  };
76200
- var c3_default14 = config12;
76149
+ var c3_default13 = config13;
76201
76150
 
76202
76151
  // templates/gatsby/workers/c3.ts
76203
76152
  var { npm: npm8 } = detectPackageManager();
76204
- var generate11 = async (ctx) => {
76153
+ var generate10 = async (ctx) => {
76205
76154
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
76206
76155
  const useTemplate = await inputPrompt({
76207
76156
  type: "confirm",
@@ -76220,7 +76169,7 @@ var generate11 = async (ctx) => {
76220
76169
  }
76221
76170
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
76222
76171
  };
76223
- var config13 = {
76172
+ var config14 = {
76224
76173
  configVersion: 1,
76225
76174
  id: "gatsby",
76226
76175
  frameworkCli: "gatsby",
@@ -76230,7 +76179,7 @@ var config13 = {
76230
76179
  path: "./templates"
76231
76180
  },
76232
76181
  path: "templates/gatsby/workers",
76233
- generate: generate11,
76182
+ generate: generate10,
76234
76183
  transformPackageJson: async () => ({
76235
76184
  scripts: {
76236
76185
  deploy: `${npm8} run build && wrangler deploy`,
@@ -76241,31 +76190,31 @@ var config13 = {
76241
76190
  deployScript: "deploy",
76242
76191
  previewScript: "preview"
76243
76192
  };
76244
- var c3_default15 = config13;
76193
+ var c3_default14 = config14;
76245
76194
 
76246
76195
  // templates/gatsby/c3.ts
76247
- var config14 = {
76196
+ var config15 = {
76248
76197
  displayName: "Gatsby",
76249
- platformVariants: { pages: c3_default14, workers: c3_default15 }
76198
+ platformVariants: { pages: c3_default13, workers: c3_default14 }
76250
76199
  };
76251
- var c3_default16 = config14;
76200
+ var c3_default15 = config15;
76252
76201
 
76253
76202
  // templates/hello-world-assets-only/c3.ts
76254
- var config15 = {
76203
+ var config16 = {
76255
76204
  configVersion: 1,
76256
76205
  id: "hello-world-assets-only",
76257
76206
  path: "templates/hello-world-assets-only",
76258
- displayName: "Assets only",
76259
- description: "For static sites (including SPAs) or when using your own backend",
76207
+ displayName: "Static site",
76208
+ description: "For static sites or when using your own backend. Uses Workers Static Assets.",
76260
76209
  platform: "workers",
76261
76210
  copyFiles: {
76262
76211
  path: "./templates"
76263
76212
  }
76264
76213
  };
76265
- var c3_default17 = config15;
76214
+ var c3_default16 = config16;
76266
76215
 
76267
76216
  // templates/hello-world-durable-object-with-assets/c3.ts
76268
- var config16 = {
76217
+ var config17 = {
76269
76218
  configVersion: 1,
76270
76219
  id: "hello-world-durable-object-with-assets",
76271
76220
  path: "templates/hello-world-durable-object-with-assets",
@@ -76279,14 +76228,17 @@ var config16 = {
76279
76228
  },
76280
76229
  ts: {
76281
76230
  path: "./ts"
76231
+ },
76232
+ python: {
76233
+ path: "./py"
76282
76234
  }
76283
76235
  }
76284
76236
  }
76285
76237
  };
76286
- var c3_default18 = config16;
76238
+ var c3_default17 = config17;
76287
76239
 
76288
76240
  // templates/hello-world-durable-object/c3.ts
76289
- var c3_default19 = {
76241
+ var config18 = {
76290
76242
  configVersion: 1,
76291
76243
  id: "hello-world-durable-object",
76292
76244
  displayName: "Worker + Durable Objects",
@@ -76299,18 +76251,22 @@ var c3_default19 = {
76299
76251
  },
76300
76252
  ts: {
76301
76253
  path: "./ts"
76254
+ },
76255
+ python: {
76256
+ path: "./py"
76302
76257
  }
76303
76258
  }
76304
76259
  }
76305
76260
  };
76261
+ var c3_default18 = config18;
76306
76262
 
76307
76263
  // templates/hello-world-with-assets/c3.ts
76308
- var c3_default20 = {
76264
+ var config19 = {
76309
76265
  configVersion: 1,
76310
76266
  id: "hello-world-with-assets",
76311
76267
  path: "templates/hello-world-with-assets",
76312
- displayName: "Worker + Assets",
76313
- description: "For static sites with an API or server-side rendering (SSR)",
76268
+ displayName: "SSR / full-stack app",
76269
+ description: "For sites with a backend API, or server-side rendering (SSR). Uses Static Assets with a Worker.",
76314
76270
  platform: "workers",
76315
76271
  copyFiles: {
76316
76272
  variants: {
@@ -76326,11 +76282,12 @@ var c3_default20 = {
76326
76282
  }
76327
76283
  }
76328
76284
  };
76285
+ var c3_default19 = config19;
76329
76286
 
76330
76287
  // templates/hello-world/c3.ts
76331
76288
  var import_promises2 = require("node:fs/promises");
76332
76289
  var import_node_path5 = require("node:path");
76333
- var c3_default21 = {
76290
+ var c3_default20 = {
76334
76291
  configVersion: 1,
76335
76292
  id: "hello-world",
76336
76293
  displayName: "Worker only",
@@ -76364,7 +76321,7 @@ var c3_default21 = {
76364
76321
  };
76365
76322
 
76366
76323
  // templates/hono/pages/c3.ts
76367
- var generate12 = async (ctx) => {
76324
+ var generate11 = async (ctx) => {
76368
76325
  const { name: pm4 } = detectPackageManager();
76369
76326
  await runFrameworkGenerator(ctx, [
76370
76327
  ctx.project.name,
@@ -76376,7 +76333,7 @@ var generate12 = async (ctx) => {
76376
76333
  ]);
76377
76334
  logRaw("");
76378
76335
  };
76379
- var config17 = {
76336
+ var config20 = {
76380
76337
  configVersion: 1,
76381
76338
  id: "hono",
76382
76339
  frameworkCli: "create-hono",
@@ -76386,20 +76343,22 @@ var config17 = {
76386
76343
  },
76387
76344
  path: "templates/hono/pages",
76388
76345
  platform: "pages",
76389
- generate: generate12,
76346
+ hidden: true,
76347
+ generate: generate11,
76390
76348
  transformPackageJson: async () => ({
76391
76349
  scripts: {
76392
- "cf-typegen": "wrangler types --env-interface CloudflareBindings"
76350
+ "cf-typegen": "wrangler types --env-interface CloudflareBindings",
76351
+ preview: "vite build && wrangler pages dev"
76393
76352
  }
76394
76353
  }),
76395
76354
  devScript: "dev",
76396
76355
  deployScript: "deploy",
76397
- previewScript: "dev"
76356
+ previewScript: "preview"
76398
76357
  };
76399
- var c3_default22 = config17;
76358
+ var c3_default21 = config20;
76400
76359
 
76401
76360
  // templates/hono/workers/c3.ts
76402
- var generate13 = async (ctx) => {
76361
+ var generate12 = async (ctx) => {
76403
76362
  const { name: pm4 } = detectPackageManager();
76404
76363
  await runFrameworkGenerator(ctx, [
76405
76364
  ctx.project.name,
@@ -76411,7 +76370,7 @@ var generate13 = async (ctx) => {
76411
76370
  ]);
76412
76371
  logRaw("");
76413
76372
  };
76414
- var config18 = {
76373
+ var config21 = {
76415
76374
  configVersion: 1,
76416
76375
  id: "hono",
76417
76376
  frameworkCli: "create-hono",
@@ -76421,7 +76380,7 @@ var config18 = {
76421
76380
  },
76422
76381
  platform: "workers",
76423
76382
  path: "templates/hono/workers",
76424
- generate: generate13,
76383
+ generate: generate12,
76425
76384
  transformPackageJson: async () => ({
76426
76385
  scripts: {
76427
76386
  "cf-typegen": "wrangler types --env-interface CloudflareBindings"
@@ -76431,26 +76390,26 @@ var config18 = {
76431
76390
  deployScript: "deploy",
76432
76391
  previewScript: "dev"
76433
76392
  };
76434
- var c3_default23 = config18;
76393
+ var c3_default22 = config21;
76435
76394
 
76436
76395
  // templates/hono/c3.ts
76437
- var config19 = {
76396
+ var config22 = {
76438
76397
  displayName: "Hono",
76439
- platformVariants: { pages: c3_default22, workers: c3_default23 }
76398
+ platformVariants: { pages: c3_default21, workers: c3_default22 }
76440
76399
  };
76441
- var c3_default24 = config19;
76400
+ var c3_default23 = config22;
76442
76401
 
76443
- // templates/next/c3.ts
76402
+ // templates/next/pages/c3.ts
76444
76403
  var import_path10 = require("path");
76445
76404
  var { npm: npm9, npx: npx3 } = detectPackageManager();
76446
- var generate14 = async (ctx) => {
76405
+ var generate13 = async (ctx) => {
76447
76406
  const projectName = ctx.project.name;
76448
76407
  await runFrameworkGenerator(ctx, [projectName]);
76449
76408
  const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
76450
76409
  writeFile2((0, import_path10.join)(ctx.project.path, "wrangler.jsonc"), wranglerConfig);
76451
76410
  updateStatus("Created wrangler.jsonc file");
76452
76411
  };
76453
- var updateNextConfig2 = (usesTs) => {
76412
+ var updateNextConfig = (usesTs) => {
76454
76413
  const s = spinner();
76455
76414
  const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
76456
76415
  s.start(`Updating \`${configFile}\``);
@@ -76468,7 +76427,7 @@ var updateNextConfig2 = (usesTs) => {
76468
76427
  writeFile2(configFile, updatedConfigFile);
76469
76428
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76470
76429
  };
76471
- var configure8 = async (ctx) => {
76430
+ var configure7 = async (ctx) => {
76472
76431
  const projectPath = ctx.project.path;
76473
76432
  const path6 = probePaths([
76474
76433
  `${projectPath}/pages/api`,
@@ -76493,7 +76452,7 @@ var configure8 = async (ctx) => {
76493
76452
  if (installEslintPlugin) {
76494
76453
  await writeEslintrc(ctx);
76495
76454
  }
76496
- updateNextConfig2(usesTs);
76455
+ updateNextConfig(usesTs);
76497
76456
  copyFile(
76498
76457
  (0, import_path10.join)(getTemplatePath(ctx), "README.md"),
76499
76458
  (0, import_path10.join)(projectPath, "README.md")
@@ -76543,14 +76502,16 @@ var addDevDependencies = async (installEslintPlugin) => {
76543
76502
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
76544
76503
  });
76545
76504
  };
76546
- var c3_default25 = {
76505
+ var c3_default24 = {
76547
76506
  configVersion: 1,
76548
76507
  id: "next",
76549
76508
  frameworkCli: "create-next-app",
76550
76509
  platform: "pages",
76510
+ hidden: true,
76551
76511
  displayName: "Next.js",
76552
- generate: generate14,
76553
- configure: configure8,
76512
+ path: "templates/next/pages",
76513
+ generate: generate13,
76514
+ configure: configure7,
76554
76515
  copyFiles: {
76555
76516
  async selectVariant(ctx) {
76556
76517
  const isApp = probePaths([
@@ -76605,6 +76566,64 @@ var c3_default25 = {
76605
76566
  compatibilityFlags: ["nodejs_compat"]
76606
76567
  };
76607
76568
 
76569
+ // templates/next/workers/c3.ts
76570
+ var generate14 = async (ctx) => {
76571
+ await runFrameworkGenerator(ctx, [ctx.project.name]);
76572
+ };
76573
+ var configure8 = async (ctx) => {
76574
+ await installPackages(["@opennextjs/cloudflare@~1.0.0-beta.0 || ^1.0.0"], {
76575
+ startText: "Adding the Cloudflare adapter",
76576
+ doneText: `${brandColor(`installed`)} @opennextjs/cloudflare)}`
76577
+ });
76578
+ const usesTs = usesTypescript(ctx);
76579
+ updateNextConfig2(usesTs);
76580
+ };
76581
+ var updateNextConfig2 = (usesTs) => {
76582
+ const s = spinner();
76583
+ const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
76584
+ s.start(`Updating \`${configFile}\``);
76585
+ const configContent = readFile(configFile);
76586
+ const updatedConfigFile = configContent + `
76587
+ // added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
76588
+ import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
76589
+ initOpenNextCloudflareForDev();
76590
+ `.replace(/\n\t*/g, "\n");
76591
+ writeFile2(configFile, updatedConfigFile);
76592
+ s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76593
+ };
76594
+ var c3_default25 = {
76595
+ configVersion: 1,
76596
+ id: "next",
76597
+ frameworkCli: "create-next-app",
76598
+ frameworkCliPinnedVersion: "~15.3.0",
76599
+ platform: "workers",
76600
+ displayName: "Next.js (using Node.js compat + Workers Assets)",
76601
+ path: "templates/next/workers",
76602
+ copyFiles: {
76603
+ path: "./templates"
76604
+ },
76605
+ generate: generate14,
76606
+ configure: configure8,
76607
+ transformPackageJson: async () => ({
76608
+ scripts: {
76609
+ deploy: `opennextjs-cloudflare build && opennextjs-cloudflare deploy`,
76610
+ preview: `opennextjs-cloudflare build && opennextjs-cloudflare preview`,
76611
+ "cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
76612
+ }
76613
+ }),
76614
+ devScript: "dev",
76615
+ previewScript: "preview",
76616
+ deployScript: "deploy",
76617
+ compatibilityFlags: ["nodejs_compat"]
76618
+ };
76619
+
76620
+ // templates/next/c3.ts
76621
+ var config23 = {
76622
+ displayName: "Next.js",
76623
+ platformVariants: { pages: c3_default24, workers: c3_default25 }
76624
+ };
76625
+ var c3_default26 = config23;
76626
+
76608
76627
  // templates/nuxt/pages/c3.ts
76609
76628
  var recast6 = __toESM(require_main3());
76610
76629
  var { npm: npm10, name: pm2 } = detectPackageManager();
@@ -76615,6 +76634,7 @@ var generate15 = async (ctx) => {
76615
76634
  ctx.project.name,
76616
76635
  "--packageManager",
76617
76636
  npm10,
76637
+ "--no-install",
76618
76638
  gitFlag
76619
76639
  ]);
76620
76640
  writeFile2("./.node-version", "18");
@@ -76689,11 +76709,12 @@ var updateNuxtConfig = () => {
76689
76709
  });
76690
76710
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76691
76711
  };
76692
- var config20 = {
76712
+ var config24 = {
76693
76713
  configVersion: 1,
76694
76714
  id: "nuxt",
76695
76715
  frameworkCli: "nuxi",
76696
76716
  platform: "pages",
76717
+ hidden: true,
76697
76718
  displayName: "Nuxt",
76698
76719
  copyFiles: {
76699
76720
  path: "./templates"
@@ -76712,7 +76733,7 @@ var config20 = {
76712
76733
  deployScript: "deploy",
76713
76734
  previewScript: "preview"
76714
76735
  };
76715
- var c3_default26 = config20;
76736
+ var c3_default27 = config24;
76716
76737
 
76717
76738
  // templates/nuxt/workers/c3.ts
76718
76739
  var recast7 = __toESM(require_main3());
@@ -76724,6 +76745,7 @@ var generate16 = async (ctx) => {
76724
76745
  ctx.project.name,
76725
76746
  "--packageManager",
76726
76747
  npm11,
76748
+ "--no-install",
76727
76749
  gitFlag
76728
76750
  ]);
76729
76751
  writeFile2("./.node-version", "18");
@@ -76798,7 +76820,7 @@ var updateNuxtConfig2 = () => {
76798
76820
  });
76799
76821
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76800
76822
  };
76801
- var config21 = {
76823
+ var config25 = {
76802
76824
  configVersion: 1,
76803
76825
  id: "nuxt",
76804
76826
  frameworkCli: "nuxi",
@@ -76821,17 +76843,17 @@ var config21 = {
76821
76843
  deployScript: "deploy",
76822
76844
  previewScript: "preview"
76823
76845
  };
76824
- var c3_default27 = config21;
76846
+ var c3_default28 = config25;
76825
76847
 
76826
76848
  // templates/nuxt/c3.ts
76827
- var config22 = {
76849
+ var config26 = {
76828
76850
  displayName: "Nuxt",
76829
- platformVariants: { pages: c3_default26, workers: c3_default27 }
76851
+ platformVariants: { pages: c3_default27, workers: c3_default28 }
76830
76852
  };
76831
- var c3_default28 = config22;
76853
+ var c3_default29 = config26;
76832
76854
 
76833
76855
  // templates/openapi/c3.ts
76834
- var c3_default29 = {
76856
+ var config27 = {
76835
76857
  configVersion: 1,
76836
76858
  id: "openapi",
76837
76859
  displayName: "API starter (OpenAPI compliant)",
@@ -76841,6 +76863,7 @@ var c3_default29 = {
76841
76863
  path: "./ts"
76842
76864
  }
76843
76865
  };
76866
+ var c3_default30 = config27;
76844
76867
 
76845
76868
  // templates/pre-existing/c3.ts
76846
76869
  var import_promises3 = require("fs/promises");
@@ -76962,7 +76985,7 @@ async function copyExistingWorkerFiles(ctx) {
76962
76985
  await runCommand(
76963
76986
  [
76964
76987
  ...dlx,
76965
- "wrangler@3",
76988
+ "wrangler@latest",
76966
76989
  "init",
76967
76990
  "--from-dash",
76968
76991
  ctx.args.existingScript,
@@ -76990,10 +77013,11 @@ async function copyExistingWorkerFiles(ctx) {
76990
77013
  (0, import_path11.join)(ctx.project.path, "wrangler.toml")
76991
77014
  );
76992
77015
  }
76993
- var c3_default30 = {
77016
+ var config28 = {
76994
77017
  configVersion: 1,
76995
77018
  id: "pre-existing",
76996
77019
  displayName: "Pre-existing Worker (from Dashboard)",
77020
+ description: "Fetch a Worker initialized from the Cloudflare dashboard.",
76997
77021
  platform: "workers",
76998
77022
  hidden: true,
76999
77023
  copyFiles: {
@@ -77005,6 +77029,7 @@ var c3_default30 = {
77005
77029
  copyFiles: copyExistingWorkerFiles
77006
77030
  })
77007
77031
  };
77032
+ var c3_default31 = config28;
77008
77033
  function buildConfigure(params) {
77009
77034
  return async function configure21(ctx) {
77010
77035
  const loginSuccess = await params.login(ctx);
@@ -77018,7 +77043,7 @@ function buildConfigure(params) {
77018
77043
  }
77019
77044
 
77020
77045
  // templates/queues/c3.ts
77021
- var c3_default31 = {
77046
+ var config29 = {
77022
77047
  configVersion: 1,
77023
77048
  id: "queues",
77024
77049
  displayName: "Queue consumer & producer Worker",
@@ -77045,6 +77070,7 @@ var c3_default31 = {
77045
77070
  ]
77046
77071
  }
77047
77072
  };
77073
+ var c3_default32 = config29;
77048
77074
 
77049
77075
  // templates/qwik/pages/c3.ts
77050
77076
  var recast8 = __toESM(require_main3());
@@ -77129,12 +77155,13 @@ var populateCloudflareEnv = () => {
77129
77155
  });
77130
77156
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
77131
77157
  };
77132
- var config23 = {
77158
+ var config30 = {
77133
77159
  configVersion: 1,
77134
77160
  id: "qwik",
77135
77161
  frameworkCli: "create-qwik",
77136
77162
  displayName: "Qwik",
77137
77163
  platform: "pages",
77164
+ hidden: true,
77138
77165
  copyFiles: {
77139
77166
  path: "./templates"
77140
77167
  },
@@ -77152,7 +77179,7 @@ var config23 = {
77152
77179
  deployScript: "deploy",
77153
77180
  previewScript: "preview"
77154
77181
  };
77155
- var c3_default32 = config23;
77182
+ var c3_default33 = config30;
77156
77183
 
77157
77184
  // templates/qwik/workers/c3.ts
77158
77185
  var recast9 = __toESM(require_main3());
@@ -77164,8 +77191,6 @@ var configure12 = async (ctx) => {
77164
77191
  const cmd = [name2 === "pnpm" ? npm13 : npx5, "qwik", "add", "cloudflare-pages"];
77165
77192
  endSection(`Running ${quoteShellArgs(cmd)}`);
77166
77193
  await runCommand(cmd);
77167
- removeFile("./public/_headers");
77168
- removeFile("./public/_redirects");
77169
77194
  removeFile("./public/_routes.json");
77170
77195
  addBindingsProxy2(ctx);
77171
77196
  populateCloudflareEnv2();
@@ -77205,7 +77230,7 @@ var addBindingsProxy2 = (ctx) => {
77205
77230
  return false;
77206
77231
  }
77207
77232
  if (configArgument.type !== "ObjectExpression") {
77208
- crash("Failed to update `vite.config.ts`");
77233
+ throw new Error("Failed to update `vite.config.ts`");
77209
77234
  }
77210
77235
  configArgument.properties.push(platformPropery);
77211
77236
  return false;
@@ -77240,7 +77265,7 @@ var populateCloudflareEnv2 = () => {
77240
77265
  });
77241
77266
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
77242
77267
  };
77243
- var config24 = {
77268
+ var config31 = {
77244
77269
  configVersion: 1,
77245
77270
  id: "qwik",
77246
77271
  frameworkCli: "create-qwik",
@@ -77263,18 +77288,55 @@ var config24 = {
77263
77288
  deployScript: "deploy",
77264
77289
  previewScript: "preview"
77265
77290
  };
77266
- var c3_default33 = config24;
77291
+ var c3_default34 = config31;
77267
77292
 
77268
77293
  // templates/qwik/c3.ts
77269
- var config25 = {
77294
+ var config32 = {
77270
77295
  displayName: "Qwik",
77271
- platformVariants: { pages: c3_default32, workers: c3_default33 }
77296
+ platformVariants: { pages: c3_default33, workers: c3_default34 }
77272
77297
  };
77273
- var c3_default34 = config25;
77298
+ var c3_default35 = config32;
77274
77299
 
77275
- // templates/react/pages/c3.ts
77300
+ // templates/react-router/c3.ts
77276
77301
  var { npm: npm14 } = detectPackageManager();
77277
77302
  var generate19 = async (ctx) => {
77303
+ await runFrameworkGenerator(ctx, [
77304
+ ctx.project.name,
77305
+ "--template",
77306
+ "https://github.com/remix-run/react-router-templates/tree/main/cloudflare",
77307
+ // to prevent asking about git twice, just let c3 do it
77308
+ "--no-git-init",
77309
+ "--no-install"
77310
+ ]);
77311
+ logRaw("");
77312
+ };
77313
+ var config33 = {
77314
+ configVersion: 1,
77315
+ id: "react-router",
77316
+ platform: "workers",
77317
+ frameworkCli: "create-react-router",
77318
+ displayName: "React Router (formerly Remix)",
77319
+ copyFiles: {
77320
+ path: "./templates"
77321
+ },
77322
+ generate: generate19,
77323
+ // configure,
77324
+ transformPackageJson: async () => ({
77325
+ scripts: {
77326
+ deploy: `${npm14} run build && wrangler deploy`,
77327
+ preview: `${npm14} run build && vite preview`,
77328
+ "cf-typegen": `wrangler types`
77329
+ }
77330
+ }),
77331
+ devScript: "dev",
77332
+ deployScript: "deploy",
77333
+ previewScript: "preview"
77334
+ };
77335
+ var c3_default36 = config33;
77336
+
77337
+ // templates/react/pages/c3.ts
77338
+ var { npm: npm15 } = detectPackageManager();
77339
+ var generate20 = async (ctx) => {
77278
77340
  const variant = await inputPrompt({
77279
77341
  type: "select",
77280
77342
  question: "Select a variant:",
@@ -77303,34 +77365,35 @@ var variantsOptions = [
77303
77365
  label: "JavaScript + SWC"
77304
77366
  }
77305
77367
  ];
77306
- var config26 = {
77368
+ var config34 = {
77307
77369
  configVersion: 1,
77308
77370
  id: "react",
77309
77371
  // React's documentation now recommends using create-vite.
77310
77372
  frameworkCli: "create-vite",
77311
77373
  displayName: "React",
77312
77374
  platform: "pages",
77375
+ hidden: true,
77313
77376
  path: "templates/react/pages",
77314
- generate: generate19,
77377
+ generate: generate20,
77315
77378
  transformPackageJson: async () => ({
77316
77379
  scripts: {
77317
- deploy: `${npm14} run build && wrangler pages deploy ./dist`,
77318
- preview: `${npm14} run build && wrangler pages dev ./dist`
77380
+ deploy: `${npm15} run build && wrangler pages deploy ./dist`,
77381
+ preview: `${npm15} run build && wrangler pages dev ./dist`
77319
77382
  }
77320
77383
  }),
77321
77384
  devScript: "dev",
77322
77385
  deployScript: "deploy",
77323
77386
  previewScript: "preview"
77324
77387
  };
77325
- var c3_default35 = config26;
77388
+ var c3_default37 = config34;
77326
77389
 
77327
77390
  // templates/react/workers/c3.ts
77328
77391
  var import_assert2 = __toESM(require("assert"));
77329
77392
  var recast10 = __toESM(require_main3());
77330
77393
  var b2 = recast10.types.builders;
77331
77394
  var t = recast10.types.namedTypes;
77332
- var { npm: npm15 } = detectPackageManager();
77333
- var generate20 = async (ctx) => {
77395
+ var { npm: npm16 } = detectPackageManager();
77396
+ var generate21 = async (ctx) => {
77334
77397
  const variant = await getVariant();
77335
77398
  ctx.args.lang = variant.lang;
77336
77399
  await runFrameworkGenerator(ctx, [
@@ -77346,7 +77409,7 @@ var configure13 = async (ctx) => {
77346
77409
  startText: "Installing the Cloudflare Vite plugin",
77347
77410
  doneText: `${brandColor(`installed`)} ${dim("@cloudflare/vite-plugin")}`
77348
77411
  });
77349
- await transformViteConfig(ctx);
77412
+ transformViteConfig(ctx);
77350
77413
  if (usesTypescript(ctx)) {
77351
77414
  updateTsconfigJson();
77352
77415
  }
@@ -77371,9 +77434,9 @@ function transformViteConfig(ctx) {
77371
77434
  if (callee.name !== "defineConfig") {
77372
77435
  return this.traverse(n);
77373
77436
  }
77374
- const config39 = n.node.arguments[0];
77375
- (0, import_assert2.default)(t.ObjectExpression.check(config39));
77376
- const pluginsProp = config39.properties.find((prop) => isPluginsProp(prop));
77437
+ const config48 = n.node.arguments[0];
77438
+ (0, import_assert2.default)(t.ObjectExpression.check(config48));
77439
+ const pluginsProp = config48.properties.find((prop) => isPluginsProp(prop));
77377
77440
  (0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
77378
77441
  pluginsProp.value.elements.push(
77379
77442
  b2.callExpression(b2.identifier("cloudflare"), [])
@@ -77430,7 +77493,7 @@ async function getVariant() {
77430
77493
  (0, import_assert2.default)(selected, "Expected a variant to be selected");
77431
77494
  return selected;
77432
77495
  }
77433
- var config27 = {
77496
+ var config35 = {
77434
77497
  configVersion: 1,
77435
77498
  id: "react",
77436
77499
  frameworkCli: "create-vite",
@@ -77447,12 +77510,12 @@ var config27 = {
77447
77510
  }
77448
77511
  }
77449
77512
  },
77450
- generate: generate20,
77513
+ generate: generate21,
77451
77514
  configure: configure13,
77452
77515
  transformPackageJson: async (_3, ctx) => ({
77453
77516
  scripts: {
77454
- deploy: `${npm15} run build && wrangler deploy`,
77455
- preview: `${npm15} run build && vite preview`,
77517
+ deploy: `${npm16} run build && wrangler deploy`,
77518
+ preview: `${npm16} run build && vite preview`,
77456
77519
  ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
77457
77520
  }
77458
77521
  }),
@@ -77460,18 +77523,18 @@ var config27 = {
77460
77523
  deployScript: "deploy",
77461
77524
  previewScript: "preview"
77462
77525
  };
77463
- var c3_default36 = config27;
77526
+ var c3_default38 = config35;
77464
77527
 
77465
77528
  // templates/react/c3.ts
77466
- var config28 = {
77529
+ var config36 = {
77467
77530
  displayName: "React",
77468
- platformVariants: { pages: c3_default35, workers: c3_default36 }
77531
+ platformVariants: { pages: c3_default37, workers: c3_default38 }
77469
77532
  };
77470
- var c3_default37 = config28;
77533
+ var c3_default39 = config36;
77471
77534
 
77472
77535
  // templates/remix/pages/c3.ts
77473
- var { npm: npm16 } = detectPackageManager();
77474
- var generate21 = async (ctx) => {
77536
+ var { npm: npm17 } = detectPackageManager();
77537
+ var generate22 = async (ctx) => {
77475
77538
  await runFrameworkGenerator(ctx, [
77476
77539
  ctx.project.name,
77477
77540
  "--template",
@@ -77494,22 +77557,23 @@ var configure14 = async () => {
77494
77557
  });
77495
77558
  s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
77496
77559
  };
77497
- var config29 = {
77560
+ var config37 = {
77498
77561
  configVersion: 1,
77499
77562
  id: "remix",
77500
77563
  frameworkCli: "create-remix",
77501
77564
  platform: "pages",
77565
+ hidden: true,
77502
77566
  displayName: "Remix",
77503
77567
  copyFiles: {
77504
77568
  path: "./templates"
77505
77569
  },
77506
77570
  path: "templates/remix/pages",
77507
- generate: generate21,
77571
+ generate: generate22,
77508
77572
  configure: configure14,
77509
77573
  transformPackageJson: async () => ({
77510
77574
  scripts: {
77511
- deploy: `${npm16} run build && wrangler pages deploy`,
77512
- preview: `${npm16} run build && wrangler pages dev`,
77575
+ deploy: `${npm17} run build && wrangler pages deploy`,
77576
+ preview: `${npm17} run build && wrangler pages dev`,
77513
77577
  "cf-typegen": `wrangler types`
77514
77578
  }
77515
77579
  }),
@@ -77517,11 +77581,11 @@ var config29 = {
77517
77581
  deployScript: "deploy",
77518
77582
  previewScript: "preview"
77519
77583
  };
77520
- var c3_default38 = config29;
77584
+ var c3_default40 = config37;
77521
77585
 
77522
77586
  // templates/remix/workers/c3.ts
77523
- var { npm: npm17 } = detectPackageManager();
77524
- var generate22 = async (ctx) => {
77587
+ var { npm: npm18 } = detectPackageManager();
77588
+ var generate23 = async (ctx) => {
77525
77589
  await runFrameworkGenerator(ctx, [
77526
77590
  ctx.project.name,
77527
77591
  "--template",
@@ -77536,7 +77600,7 @@ var configure15 = async () => {
77536
77600
  doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
77537
77601
  });
77538
77602
  };
77539
- var config30 = {
77603
+ var config38 = {
77540
77604
  configVersion: 1,
77541
77605
  id: "remix",
77542
77606
  frameworkCli: "create-remix",
@@ -77546,12 +77610,12 @@ var config30 = {
77546
77610
  path: "./templates"
77547
77611
  },
77548
77612
  path: "templates/remix/workers",
77549
- generate: generate22,
77613
+ generate: generate23,
77550
77614
  configure: configure15,
77551
77615
  transformPackageJson: async () => ({
77552
77616
  scripts: {
77553
- deploy: `${npm17} run build && wrangler deploy`,
77554
- preview: `${npm17} run build && wrangler dev`,
77617
+ deploy: `${npm18} run build && wrangler deploy`,
77618
+ preview: `${npm18} run build && wrangler dev`,
77555
77619
  "cf-typegen": `wrangler types`
77556
77620
  }
77557
77621
  }),
@@ -77559,17 +77623,18 @@ var config30 = {
77559
77623
  deployScript: "deploy",
77560
77624
  previewScript: "preview"
77561
77625
  };
77562
- var c3_default39 = config30;
77626
+ var c3_default41 = config38;
77563
77627
 
77564
77628
  // templates/remix/c3.ts
77565
- var config31 = {
77629
+ var config39 = {
77566
77630
  displayName: "Remix",
77567
- platformVariants: { pages: c3_default38, workers: c3_default39 }
77631
+ platformVariants: { pages: c3_default40, workers: c3_default41 },
77632
+ hidden: true
77568
77633
  };
77569
- var c3_default40 = config31;
77634
+ var c3_default42 = config39;
77570
77635
 
77571
77636
  // templates/scheduled/c3.ts
77572
- var c3_default41 = {
77637
+ var config40 = {
77573
77638
  configVersion: 1,
77574
77639
  id: "scheduled",
77575
77640
  displayName: "Scheduled Worker (Cron Trigger)",
@@ -77586,11 +77651,12 @@ var c3_default41 = {
77586
77651
  }
77587
77652
  }
77588
77653
  };
77654
+ var c3_default43 = config40;
77589
77655
 
77590
77656
  // templates/solid/c3.ts
77591
77657
  var recast11 = __toESM(require_main3());
77592
- var { npm: npm18 } = detectPackageManager();
77593
- var generate23 = async (ctx) => {
77658
+ var { npm: npm19 } = detectPackageManager();
77659
+ var generate24 = async (ctx) => {
77594
77660
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
77595
77661
  logRaw("");
77596
77662
  };
@@ -77632,7 +77698,7 @@ var configure16 = async (ctx) => {
77632
77698
  }
77633
77699
  });
77634
77700
  };
77635
- var config32 = {
77701
+ var config41 = {
77636
77702
  configVersion: 1,
77637
77703
  id: "solid",
77638
77704
  frameworkCli: "create-solid",
@@ -77641,12 +77707,12 @@ var config32 = {
77641
77707
  copyFiles: {
77642
77708
  path: "./templates"
77643
77709
  },
77644
- generate: generate23,
77710
+ generate: generate24,
77645
77711
  configure: configure16,
77646
77712
  transformPackageJson: async () => ({
77647
77713
  scripts: {
77648
- preview: `${npm18} run build && npx wrangler pages dev`,
77649
- deploy: `${npm18} run build && wrangler pages deploy`
77714
+ preview: `${npm19} run build && npx wrangler pages dev`,
77715
+ deploy: `${npm19} run build && wrangler pages deploy`
77650
77716
  }
77651
77717
  }),
77652
77718
  compatibilityFlags: ["nodejs_compat"],
@@ -77654,14 +77720,14 @@ var config32 = {
77654
77720
  deployScript: "deploy",
77655
77721
  previewScript: "preview"
77656
77722
  };
77657
- var c3_default42 = config32;
77723
+ var c3_default44 = config41;
77658
77724
 
77659
77725
  // templates/svelte/pages/c3.ts
77660
77726
  var import_node_fs3 = require("node:fs");
77661
77727
  var import_node_os3 = require("node:os");
77662
77728
  var recast12 = __toESM(require_main3());
77663
- var { npm: npm19 } = detectPackageManager();
77664
- var generate24 = async (ctx) => {
77729
+ var { npm: npm20 } = detectPackageManager();
77730
+ var generate25 = async (ctx) => {
77665
77731
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
77666
77732
  logRaw("");
77667
77733
  };
@@ -77747,22 +77813,23 @@ var updateTypeDefinitions = (ctx) => {
77747
77813
  }
77748
77814
  });
77749
77815
  };
77750
- var config33 = {
77816
+ var config42 = {
77751
77817
  configVersion: 1,
77752
77818
  id: "svelte",
77753
77819
  frameworkCli: "sv",
77754
77820
  displayName: "SvelteKit",
77755
77821
  platform: "pages",
77822
+ hidden: true,
77756
77823
  copyFiles: {
77757
77824
  path: "./templates"
77758
77825
  },
77759
77826
  path: "templates/svelte/pages",
77760
- generate: generate24,
77827
+ generate: generate25,
77761
77828
  configure: configure17,
77762
77829
  transformPackageJson: async (original, ctx) => {
77763
77830
  let scripts = {
77764
- preview: `${npm19} run build && wrangler pages dev`,
77765
- deploy: `${npm19} run build && wrangler pages deploy`
77831
+ preview: `${npm20} run build && wrangler pages dev`,
77832
+ deploy: `${npm20} run build && wrangler pages deploy`
77766
77833
  };
77767
77834
  if (usesTypescript(ctx)) {
77768
77835
  const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
@@ -77777,13 +77844,13 @@ var config33 = {
77777
77844
  deployScript: "deploy",
77778
77845
  previewScript: "preview"
77779
77846
  };
77780
- var c3_default43 = config33;
77847
+ var c3_default45 = config42;
77781
77848
 
77782
77849
  // templates/svelte/workers/c3.ts
77783
77850
  var import_node_os4 = require("node:os");
77784
77851
  var recast13 = __toESM(require_main3());
77785
- var { npm: npm20 } = detectPackageManager();
77786
- var generate25 = async (ctx) => {
77852
+ var { npm: npm21 } = detectPackageManager();
77853
+ var generate26 = async (ctx) => {
77787
77854
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
77788
77855
  logRaw("");
77789
77856
  };
@@ -77846,7 +77913,7 @@ var updateTypeDefinitions2 = (ctx) => {
77846
77913
  }
77847
77914
  });
77848
77915
  };
77849
- var config34 = {
77916
+ var config43 = {
77850
77917
  configVersion: 1,
77851
77918
  id: "svelte",
77852
77919
  frameworkCli: "sv",
@@ -77856,12 +77923,12 @@ var config34 = {
77856
77923
  path: "./templates"
77857
77924
  },
77858
77925
  path: "templates/svelte/workers",
77859
- generate: generate25,
77926
+ generate: generate26,
77860
77927
  configure: configure18,
77861
77928
  transformPackageJson: async (original, ctx) => {
77862
77929
  let scripts = {
77863
- preview: `${npm20} run build && wrangler dev`,
77864
- deploy: `${npm20} run build && wrangler deploy`
77930
+ preview: `${npm21} run build && wrangler dev`,
77931
+ deploy: `${npm21} run build && wrangler deploy`
77865
77932
  };
77866
77933
  if (usesTypescript(ctx)) {
77867
77934
  const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
@@ -77876,43 +77943,44 @@ var config34 = {
77876
77943
  deployScript: "deploy",
77877
77944
  previewScript: "preview"
77878
77945
  };
77879
- var c3_default44 = config34;
77946
+ var c3_default46 = config43;
77880
77947
 
77881
77948
  // templates/svelte/c3.ts
77882
- var config35 = {
77949
+ var config44 = {
77883
77950
  displayName: "SvelteKit",
77884
- platformVariants: { pages: c3_default43, workers: c3_default44 }
77951
+ platformVariants: { pages: c3_default45, workers: c3_default46 }
77885
77952
  };
77886
- var c3_default45 = config35;
77953
+ var c3_default47 = config44;
77887
77954
 
77888
77955
  // templates/vue/pages/c3.ts
77889
- var { npm: npm21 } = detectPackageManager();
77890
- var generate26 = async (ctx) => {
77956
+ var { npm: npm22 } = detectPackageManager();
77957
+ var generate27 = async (ctx) => {
77891
77958
  await runFrameworkGenerator(ctx, [ctx.project.name]);
77892
77959
  };
77893
- var config36 = {
77960
+ var config45 = {
77894
77961
  configVersion: 1,
77895
77962
  id: "vue",
77896
77963
  frameworkCli: "create-vue",
77897
77964
  displayName: "Vue",
77898
77965
  platform: "pages",
77966
+ hidden: true,
77899
77967
  path: "templates/pages/vue",
77900
- generate: generate26,
77968
+ generate: generate27,
77901
77969
  transformPackageJson: async () => ({
77902
77970
  scripts: {
77903
- deploy: `${npm21} run build && wrangler pages deploy ./dist`,
77904
- preview: `${npm21} run build && wrangler pages dev ./dist`
77971
+ deploy: `${npm22} run build && wrangler pages deploy ./dist`,
77972
+ preview: `${npm22} run build && wrangler pages dev ./dist`
77905
77973
  }
77906
77974
  }),
77907
77975
  devScript: "dev",
77908
77976
  deployScript: "deploy",
77909
77977
  previewScript: "preview"
77910
77978
  };
77911
- var c3_default46 = config36;
77979
+ var c3_default48 = config45;
77912
77980
 
77913
77981
  // templates/vue/workers/c3.ts
77914
- var { npm: npm22 } = detectPackageManager();
77915
- var generate27 = async (ctx) => {
77982
+ var { npm: npm23 } = detectPackageManager();
77983
+ var generate28 = async (ctx) => {
77916
77984
  const lang = ctx.args.lang ?? await inputPrompt({
77917
77985
  type: "select",
77918
77986
  question: "Would you like to use TypeScript?",
@@ -77950,7 +78018,7 @@ function updateTsconfigJson2() {
77950
78018
  writeJSON("tsconfig.json", tsconfig);
77951
78019
  s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
77952
78020
  }
77953
- var config37 = {
78021
+ var config46 = {
77954
78022
  configVersion: 1,
77955
78023
  id: "vue",
77956
78024
  frameworkCli: "create-vue",
@@ -77971,11 +78039,11 @@ var config37 = {
77971
78039
  }
77972
78040
  },
77973
78041
  configure: configure19,
77974
- generate: generate27,
78042
+ generate: generate28,
77975
78043
  transformPackageJson: async (_3, ctx) => ({
77976
78044
  scripts: {
77977
- deploy: `${npm22} run build && wrangler deploy`,
77978
- preview: `${npm22} run build && wrangler dev`,
78045
+ deploy: `${npm23} run build && wrangler deploy`,
78046
+ preview: `${npm23} run build && wrangler dev`,
77979
78047
  ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
77980
78048
  }
77981
78049
  }),
@@ -77983,20 +78051,20 @@ var config37 = {
77983
78051
  deployScript: "deploy",
77984
78052
  previewScript: "preview"
77985
78053
  };
77986
- var c3_default47 = config37;
78054
+ var c3_default49 = config46;
77987
78055
 
77988
78056
  // templates/vue/c3.ts
77989
- var config38 = {
78057
+ var config47 = {
77990
78058
  displayName: "Vue",
77991
- platformVariants: { pages: c3_default46, workers: c3_default47 }
78059
+ platformVariants: { pages: c3_default48, workers: c3_default49 }
77992
78060
  };
77993
- var c3_default48 = config38;
78061
+ var c3_default50 = config47;
77994
78062
 
77995
78063
  // src/git.ts
77996
78064
  var import_node_assert = __toESM(require("node:assert"));
77997
78065
 
77998
78066
  // ../wrangler/package.json
77999
- var version2 = "0.0.0-6a958df17";
78067
+ var version2 = "0.0.0-6ae158397";
78000
78068
 
78001
78069
  // src/git.ts
78002
78070
  var offerGit = async (ctx) => {
@@ -78257,43 +78325,60 @@ var defaultSelectVariant = async (ctx) => {
78257
78325
  function getFrameworkMap({ experimental = false }) {
78258
78326
  if (experimental) {
78259
78327
  return {
78260
- next: c3_default,
78261
- solid: c3_default2
78328
+ solid: c3_default
78262
78329
  };
78263
78330
  } else {
78264
78331
  return {
78265
- analog: c3_default3,
78266
- angular: c3_default6,
78267
- astro: c3_default9,
78268
- docusaurus: c3_default13,
78269
- gatsby: c3_default16,
78270
- hono: c3_default24,
78271
- next: c3_default25,
78272
- nuxt: c3_default28,
78273
- qwik: c3_default34,
78274
- react: c3_default37,
78275
- remix: c3_default40,
78276
- solid: c3_default42,
78277
- svelte: c3_default45,
78278
- vue: c3_default48
78332
+ analog: c3_default2,
78333
+ angular: c3_default5,
78334
+ astro: c3_default8,
78335
+ docusaurus: c3_default12,
78336
+ gatsby: c3_default15,
78337
+ hono: c3_default23,
78338
+ next: c3_default26,
78339
+ nuxt: c3_default29,
78340
+ qwik: c3_default35,
78341
+ react: c3_default39,
78342
+ "react-router": c3_default36,
78343
+ remix: c3_default42,
78344
+ solid: c3_default44,
78345
+ svelte: c3_default47,
78346
+ vue: c3_default50
78279
78347
  };
78280
78348
  }
78281
78349
  }
78282
- function getTemplateMap({ experimental = false }) {
78350
+ function getOtherTemplateMap({
78351
+ experimental = false
78352
+ }) {
78283
78353
  if (experimental) {
78284
78354
  return {};
78285
78355
  } else {
78286
78356
  return {
78287
- "hello-world": c3_default21,
78288
- "hello-world-assets-only": c3_default17,
78289
- "hello-world-with-assets": c3_default20,
78290
- "hello-world-durable-object": c3_default19,
78291
- "hello-world-durable-object-with-assets": c3_default18,
78292
- common: c3_default10,
78293
- scheduled: c3_default41,
78294
- queues: c3_default31,
78295
- openapi: c3_default29,
78296
- "pre-existing": c3_default30
78357
+ common: c3_default9,
78358
+ scheduled: c3_default43,
78359
+ queues: c3_default32,
78360
+ openapi: c3_default30,
78361
+ "pre-existing": c3_default31
78362
+ };
78363
+ }
78364
+ }
78365
+ function getHelloWorldTemplateMap({
78366
+ experimental = false
78367
+ }) {
78368
+ if (experimental) {
78369
+ return {};
78370
+ } else {
78371
+ return {
78372
+ "hello-world": c3_default20,
78373
+ "hello-world-assets-only": c3_default16,
78374
+ "hello-world-with-assets": c3_default19,
78375
+ "hello-world-durable-object": c3_default18,
78376
+ "hello-world-durable-object-with-assets": c3_default17,
78377
+ common: c3_default9,
78378
+ scheduled: c3_default43,
78379
+ queues: c3_default32,
78380
+ openapi: c3_default30,
78381
+ "pre-existing": c3_default31
78297
78382
  };
78298
78383
  }
78299
78384
  }
@@ -78353,6 +78438,12 @@ var deriveCorrelatedArgs = (args) => {
78353
78438
  };
78354
78439
  var createContext = async (args, prevArgs) => {
78355
78440
  deriveCorrelatedArgs(args);
78441
+ const experimental = args.experimental;
78442
+ const frameworkMap = getFrameworkMap({ experimental });
78443
+ const helloWorldTemplateMap = getHelloWorldTemplateMap({
78444
+ experimental
78445
+ });
78446
+ const otherTemplateMap = getOtherTemplateMap({ experimental });
78356
78447
  let linesPrinted = 0;
78357
78448
  const goBack = async (from) => {
78358
78449
  const currentArgs = { ...args };
@@ -78399,22 +78490,29 @@ var createContext = async (args, prevArgs) => {
78399
78490
  validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName, args),
78400
78491
  format: (val) => `./${val}`
78401
78492
  });
78402
- const categoryOptions = [
78403
- {
78404
- label: "Hello World Starter",
78493
+ const categoryOptions = [];
78494
+ if (Object.keys(helloWorldTemplateMap).length) {
78495
+ categoryOptions.push({
78496
+ label: "Hello World example",
78405
78497
  value: "hello-world",
78406
- description: "Select from basic scaffolds to get started with Workers, Assets and Durable Objects"
78407
- },
78408
- {
78498
+ description: "Select from barebones examples to get started with Workers"
78499
+ });
78500
+ }
78501
+ if (Object.keys(frameworkMap).length) {
78502
+ categoryOptions.push({
78409
78503
  label: "Framework Starter",
78410
78504
  value: "web-framework",
78411
78505
  description: "Select from the most popular full-stack web frameworks"
78412
- },
78413
- {
78506
+ });
78507
+ }
78508
+ if (Object.keys(otherTemplateMap).length) {
78509
+ categoryOptions.push({
78414
78510
  label: "Application Starter",
78415
78511
  value: "demo",
78416
78512
  description: "Select from a range of starter applications using various Cloudflare products"
78417
- },
78513
+ });
78514
+ }
78515
+ categoryOptions.push(
78418
78516
  {
78419
78517
  label: "Template from a GitHub repo",
78420
78518
  value: "remote-template",
@@ -78423,7 +78521,7 @@ var createContext = async (args, prevArgs) => {
78423
78521
  // This is used only if the type is `pre-existing`
78424
78522
  { label: "Others", value: "others", hidden: true },
78425
78523
  backOption
78426
- ];
78524
+ );
78427
78525
  const category = await processArgument(args, "category", {
78428
78526
  type: "select",
78429
78527
  question: "What would you like to start with?",
@@ -78437,14 +78535,17 @@ var createContext = async (args, prevArgs) => {
78437
78535
  }
78438
78536
  let template;
78439
78537
  if (category === "web-framework") {
78440
- const frameworkMap = getFrameworkMap({
78441
- experimental: args.experimental
78442
- });
78443
- const frameworkOptions = Object.entries(frameworkMap).map(
78444
- ([key, config39]) => ({
78445
- label: config39.displayName,
78446
- value: key
78447
- })
78538
+ const frameworkOptions = Object.entries(frameworkMap).reduce(
78539
+ (acc, [key, config48]) => {
78540
+ if (!config48.hidden || args.framework) {
78541
+ acc.push({
78542
+ label: config48.displayName,
78543
+ value: key
78544
+ });
78545
+ }
78546
+ return acc;
78547
+ },
78548
+ []
78448
78549
  );
78449
78550
  const framework = await processArgument(args, "framework", {
78450
78551
  type: "select",
@@ -78462,21 +78563,31 @@ var createContext = async (args, prevArgs) => {
78462
78563
  throw new Error(`Unsupported framework: ${framework}`);
78463
78564
  }
78464
78565
  if ("platformVariants" in frameworkConfig) {
78566
+ const availableVariants = Object.entries(
78567
+ frameworkConfig.platformVariants
78568
+ ).filter(([, config48]) => !config48.hidden);
78569
+ if (availableVariants.length === 1) {
78570
+ args.platform ??= availableVariants[0][0];
78571
+ }
78465
78572
  const platform3 = await processArgument(args, "platform", {
78466
78573
  type: "select",
78467
78574
  label: "platform",
78468
78575
  question: "Select your deployment platform",
78469
78576
  options: [
78470
- {
78471
- label: "Workers with Assets (BETA)",
78472
- value: "workers",
78473
- description: "Take advantage of the full Developer Platform, including R2, Queues, Durable Objects and more."
78474
- },
78475
- {
78476
- label: "Pages",
78477
- value: "pages",
78478
- description: "Great for simple websites and applications."
78479
- },
78577
+ ...args.platform === "workers" || !frameworkConfig.platformVariants.workers.hidden ? [
78578
+ {
78579
+ label: "Workers with Assets",
78580
+ value: "workers",
78581
+ description: "Take advantage of the full Developer Platform, including R2, Queues, Durable Objects and more."
78582
+ }
78583
+ ] : [],
78584
+ ...args.platform === "pages" || !frameworkConfig.platformVariants.pages.hidden ? [
78585
+ {
78586
+ label: "Pages",
78587
+ value: "pages",
78588
+ description: "Great for simple websites and applications."
78589
+ }
78590
+ ] : [],
78480
78591
  backOption
78481
78592
  ],
78482
78593
  defaultValue: "workers"
@@ -78495,18 +78606,14 @@ var createContext = async (args, prevArgs) => {
78495
78606
  } else if (category === "remote-template") {
78496
78607
  template = await processRemoteTemplate(args);
78497
78608
  } else {
78498
- const templateMap = await getTemplateMap({
78499
- experimental: args.experimental
78500
- });
78609
+ const templateMap = category === "hello-world" ? helloWorldTemplateMap : otherTemplateMap;
78501
78610
  const templateOptions = Object.entries(templateMap).map(
78502
78611
  ([value, { displayName, description, hidden: hidden2 }]) => {
78503
- const isHelloWorldExample = value.startsWith("hello-world");
78504
- const isCategoryMatched = category === "hello-world" ? isHelloWorldExample : !isHelloWorldExample;
78505
78612
  return {
78506
78613
  value,
78507
78614
  label: displayName,
78508
78615
  description,
78509
- hidden: hidden2 || !isCategoryMatched
78616
+ hidden: hidden2
78510
78617
  };
78511
78618
  }
78512
78619
  );
@@ -78585,7 +78692,7 @@ async function copyTemplateFiles(ctx) {
78585
78692
  }
78586
78693
  srcdir = (0, import_path13.join)(getTemplatePath(ctx), variantInfo.path);
78587
78694
  }
78588
- const copyDestDir = await getCopyFilesDestinationDir(ctx);
78695
+ const copyDestDir = getCopyFilesDestinationDir(ctx);
78589
78696
  const destdir = (0, import_path13.join)(ctx.project.path, ...copyDestDir ? [copyDestDir] : []);
78590
78697
  const s = spinner();
78591
78698
  s.start(`Copying template files`);
@@ -78608,29 +78715,29 @@ var processRemoteTemplate = async (args) => {
78608
78715
  if (src.startsWith("https://github.com/") && src.includes("/tree/main/")) {
78609
78716
  src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
78610
78717
  }
78611
- const path6 = await downloadRemoteTemplate(src);
78612
- const config39 = inferTemplateConfig(path6);
78613
- validateTemplate(path6, config39);
78718
+ const path6 = await downloadRemoteTemplate(src, args.templateMode);
78719
+ const config48 = inferTemplateConfig(path6);
78720
+ validateTemplate(path6, config48);
78614
78721
  updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
78615
78722
  return {
78616
78723
  path: path6,
78617
- ...config39
78724
+ ...config48
78618
78725
  };
78619
78726
  };
78620
- var validateTemplate = (path6, config39) => {
78621
- if (!config39.copyFiles) {
78727
+ var validateTemplate = (path6, config48) => {
78728
+ if (!config48.copyFiles) {
78622
78729
  return;
78623
78730
  }
78624
- if (isVariantInfo(config39.copyFiles)) {
78625
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config39.copyFiles.path), config39);
78731
+ if (isVariantInfo(config48.copyFiles)) {
78732
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config48.copyFiles.path), config48);
78626
78733
  } else {
78627
- for (const variant of Object.values(config39.copyFiles.variants)) {
78628
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config39);
78734
+ for (const variant of Object.values(config48.copyFiles.variants)) {
78735
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config48);
78629
78736
  }
78630
78737
  }
78631
78738
  };
78632
- var validateTemplateSrcDirectory = (path6, config39) => {
78633
- if (config39.platform === "workers") {
78739
+ var validateTemplateSrcDirectory = (path6, config48) => {
78740
+ if (config48.platform === "workers") {
78634
78741
  const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
78635
78742
  const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
78636
78743
  const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
@@ -78667,13 +78774,14 @@ var inferCopyFilesDefinition = (path6) => {
78667
78774
  const copyFiles = Object.keys(variants).length !== 0 ? { variants } : { path: "." };
78668
78775
  return copyFiles;
78669
78776
  };
78670
- var downloadRemoteTemplate = async (src) => {
78777
+ var downloadRemoteTemplate = async (src, mode) => {
78671
78778
  try {
78672
78779
  updateStatus(`Cloning template from: ${blue(src)}`);
78673
78780
  const emitter = (0, import_degit.default)(src, {
78674
78781
  cache: false,
78675
78782
  verbose: false,
78676
- force: true
78783
+ force: true,
78784
+ mode
78677
78785
  });
78678
78786
  const tmpDir = await (0, import_promises4.mkdtemp)((0, import_path13.join)((0, import_os2.tmpdir)(), "c3-template"));
78679
78787
  await emitter.clone(tmpDir);
@@ -78803,10 +78911,7 @@ var cliDefinition = {
78803
78911
  values(args) {
78804
78912
  const experimental = Boolean(args?.["experimental"]);
78805
78913
  if (experimental) {
78806
- return [
78807
- { name: "hello-world", description: "Hello World Starter" },
78808
- { name: "web-framework", description: "Framework Starter" }
78809
- ];
78914
+ return [{ name: "web-framework", description: "Framework Starter" }];
78810
78915
  } else {
78811
78916
  return [
78812
78917
  { name: "hello-world", description: "Hello World Starter" },
@@ -78832,40 +78937,10 @@ var cliDefinition = {
78832
78937
  `,
78833
78938
  values(args) {
78834
78939
  const experimental = Boolean(args?.["experimental"]);
78835
- if (experimental) {
78836
- return getNamesAndDescriptions(getTemplateMap({ experimental }));
78837
- } else {
78838
- return [
78839
- {
78840
- name: "hello-world",
78841
- description: "A basic \u201CHello World\u201D Cloudflare Worker."
78842
- },
78843
- {
78844
- name: "hello-world-durable-object",
78845
- description: "A basic \u201CHello World\u201D Cloudflare Worker with a Durable Worker."
78846
- },
78847
- {
78848
- name: "common",
78849
- description: "A Cloudflare Worker which implements a common example of routing/proxying functionalities."
78850
- },
78851
- {
78852
- name: "scheduled",
78853
- description: "A scheduled Cloudflare Worker (triggered via Cron Triggers)."
78854
- },
78855
- {
78856
- name: "queues",
78857
- description: "A Cloudflare Worker which is both a consumer and produced of Queues."
78858
- },
78859
- {
78860
- name: "openapi",
78861
- description: "A Worker implementing an OpenAPI REST endpoint."
78862
- },
78863
- {
78864
- name: "pre-existing",
78865
- description: "Fetch a Worker initialized from the Cloudflare dashboard."
78866
- }
78867
- ];
78868
- }
78940
+ return getNamesAndDescriptions({
78941
+ ...getHelloWorldTemplateMap({ experimental }),
78942
+ ...getOtherTemplateMap({ experimental })
78943
+ });
78869
78944
  }
78870
78945
  },
78871
78946
  {
@@ -78880,7 +78955,7 @@ var cliDefinition = {
78880
78955
  You may specify additional arguments to be passed directly to these underlying tools by adding them after a "--" argument, like so:
78881
78956
 
78882
78957
  npm create cloudflare -- --framework next -- --ts
78883
- pnpm create clouldfare --framework next -- --ts
78958
+ pnpm create cloudflare --framework next -- --ts
78884
78959
  `,
78885
78960
  values: (args) => getNamesAndDescriptions(
78886
78961
  getFrameworkMap({
@@ -78894,12 +78969,12 @@ var cliDefinition = {
78894
78969
  description: `Whether the application should be deployed to Pages or Workers. This is only applicable for Frameworks templates that support both Pages and Workers.`,
78895
78970
  values: [
78896
78971
  {
78897
- name: "pages",
78898
- description: "Create a web application that can be deployed to Pages."
78972
+ name: "workers",
78973
+ description: "Create a web application that can be deployed to Workers."
78899
78974
  },
78900
78975
  {
78901
- name: "workers",
78902
- description: "Create a web application that can be deployed to Workers (BETA)."
78976
+ name: "pages",
78977
+ description: "Create a web application that can be deployed to Pages."
78903
78978
  }
78904
78979
  ],
78905
78980
  requiresArg: true
@@ -78961,6 +79036,27 @@ var cliDefinition = {
78961
79036
  npm create cloudflare -- --template https://github.com/cloudflare/workers-sdk/templates/worker-r2
78962
79037
  `
78963
79038
  },
79039
+ {
79040
+ name: "template-mode",
79041
+ type: "string",
79042
+ requiresArg: true,
79043
+ description: `The mechanism to use when fetching the template.
79044
+
79045
+ Can be either "git" or "tar". "tar" does not support fetching from private
79046
+ repositories. By default, degit will use "tar" if the template is hosted on GitHub, BitBucket, GitLab, or git.sr.ht.
79047
+ Otherwise, it will use "git".
79048
+ `,
79049
+ values: [
79050
+ {
79051
+ name: "git",
79052
+ description: "Use git to fetch the template. Supports private repositories."
79053
+ },
79054
+ {
79055
+ name: "tar",
79056
+ description: "Use tar to fetch the template. Only supported on public repositories hosted on GitHub, BitBucket, GitLab, or git.sr.ht."
79057
+ }
79058
+ ]
79059
+ },
78964
79060
  {
78965
79061
  name: "accept-defaults",
78966
79062
  alias: "y",
@@ -80541,20 +80637,20 @@ function applyEdits(text, edits) {
80541
80637
  var import_fs12 = require("fs");
80542
80638
  var import_path14 = require("path");
80543
80639
  var import_toml2 = __toESM(require_toml());
80544
- function ensureNameExists(config39, projectName) {
80545
- config39["name"] = projectName;
80546
- return config39;
80640
+ function ensureNameExists(config48, projectName) {
80641
+ config48["name"] = projectName;
80642
+ return config48;
80547
80643
  }
80548
- async function ensureCompatDateExists(config39) {
80549
- if (typeof config39["compatibility_date"] === "string") {
80644
+ async function ensureCompatDateExists(config48) {
80645
+ if (typeof config48["compatibility_date"] === "string") {
80550
80646
  const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
80551
- if (!config39["compatibility_date"].match(validCompatDateRe)) {
80552
- config39["compatibility_date"] = await getWorkerdCompatibilityDate();
80647
+ if (!config48["compatibility_date"].match(validCompatDateRe)) {
80648
+ config48["compatibility_date"] = await getWorkerdCompatibilityDate();
80553
80649
  }
80554
80650
  } else {
80555
- config39["compatibility_date"] = await getWorkerdCompatibilityDate();
80651
+ config48["compatibility_date"] = await getWorkerdCompatibilityDate();
80556
80652
  }
80557
- return config39;
80653
+ return config48;
80558
80654
  }
80559
80655
  var updateWranglerConfig = async (ctx) => {
80560
80656
  if (wranglerJsonExists(ctx)) {
@@ -80565,12 +80661,15 @@ var updateWranglerConfig = async (ctx) => {
80565
80661
  const modified = await ensureCompatDateExists(
80566
80662
  ensureNameExists(parsed, ctx.project.name)
80567
80663
  );
80568
- const comment = `/**
80664
+ let comment = `/**
80569
80665
  * For more details on how to configure Wrangler, refer to:
80570
80666
  * https://developers.cloudflare.com/workers/wrangler/configuration/
80571
80667
  */
80572
- {
80668
+ {`;
80669
+ if (!modified["$schema"]) {
80670
+ comment += `
80573
80671
  "$schema": "node_modules/wrangler/config-schema.json",`;
80672
+ }
80574
80673
  if (!modified["observability"]) {
80575
80674
  modified["observability"] = { enabled: true };
80576
80675
  }
@@ -80725,7 +80824,7 @@ var addVscodeConfig = (ctx) => {
80725
80824
 
80726
80825
  // src/deploy.ts
80727
80826
  var offerToDeploy = async (ctx) => {
80728
- const { npm: npm24 } = detectPackageManager();
80827
+ const { npm: npm25 } = detectPackageManager();
80729
80828
  startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
80730
80829
  if (!await isDeployable(ctx)) {
80731
80830
  ctx.args.deploy = false;
@@ -80736,7 +80835,7 @@ var offerToDeploy = async (ctx) => {
80736
80835
  );
80737
80836
  }
80738
80837
  const label = `deploy via \`${quoteShellArgs([
80739
- npm24,
80838
+ npm25,
80740
80839
  "run",
80741
80840
  ctx.template.deployScript ?? "deploy"
80742
80841
  ])}\``;
@@ -80773,11 +80872,11 @@ var readWranglerConfig = (ctx) => {
80773
80872
  return import_toml3.default.parse(wranglerTomlStr.replace(/\r\n/g, "\n"));
80774
80873
  };
80775
80874
  var runDeploy = async (ctx) => {
80776
- const { npm: npm24, name: pm4 } = detectPackageManager();
80875
+ const { npm: npm25, name: pm4 } = detectPackageManager();
80777
80876
  if (!ctx.account?.id) {
80778
80877
  throw new Error("Failed to read Cloudflare account.");
80779
80878
  }
80780
- const baseDeployCmd = [npm24, "run", ctx.template.deployScript ?? "deploy"];
80879
+ const baseDeployCmd = [npm25, "run", ctx.template.deployScript ?? "deploy"];
80781
80880
  const insideGitRepo = await isInsideGitRepo(ctx.project.path);
80782
80881
  const deployCmd = [
80783
80882
  ...baseDeployCmd,
@@ -80893,14 +80992,14 @@ var printSummary = (ctx) => {
80893
80992
  const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
80894
80993
  const relativePath = (0, import_path15.relative)(ctx.originalCWD, ctx.project.path);
80895
80994
  const cdCommand = relativePath ? `cd ${relativePath}` : null;
80896
- const { npm: npm24 } = detectPackageManager();
80995
+ const { npm: npm25 } = detectPackageManager();
80897
80996
  const devServerCommand = quoteShellArgs([
80898
- npm24,
80997
+ npm25,
80899
80998
  "run",
80900
80999
  ctx.template.devScript ?? "start"
80901
81000
  ]);
80902
81001
  const deployCommand = quoteShellArgs([
80903
- npm24,
81002
+ npm25,
80904
81003
  "run",
80905
81004
  ctx.template.deployScript ?? "deploy"
80906
81005
  ]);
@@ -81268,8 +81367,8 @@ var renderValues = (values) => {
81268
81367
  };
81269
81368
 
81270
81369
  // src/helpers/retry.ts
81271
- var retry = async (config39, fn) => {
81272
- let { times } = config39;
81370
+ var retry = async (config48, fn) => {
81371
+ let { times } = config48;
81273
81372
  let error2 = null;
81274
81373
  while (times > 0) {
81275
81374
  try {
@@ -81277,10 +81376,10 @@ var retry = async (config39, fn) => {
81277
81376
  } catch (e) {
81278
81377
  error2 = e;
81279
81378
  times--;
81280
- if (config39.exitCondition?.(e)) {
81379
+ if (config48.exitCondition?.(e)) {
81281
81380
  break;
81282
81381
  }
81283
- await sleep(config39.sleepMs ?? 1e3);
81382
+ await sleep(config48.sleepMs ?? 1e3);
81284
81383
  }
81285
81384
  }
81286
81385
  throw error2;
@@ -81370,14 +81469,14 @@ var createProject = async (ctx) => {
81370
81469
  var import_fs13 = require("fs");
81371
81470
  var import_path16 = require("path");
81372
81471
  async function installWorkersTypes(ctx) {
81373
- const { npm: npm24 } = detectPackageManager();
81472
+ const { npm: npm25 } = detectPackageManager();
81374
81473
  if (!usesTypescript(ctx)) {
81375
81474
  return;
81376
81475
  }
81377
81476
  await installPackages(["@cloudflare/workers-types"], {
81378
81477
  dev: true,
81379
81478
  startText: "Installing @cloudflare/workers-types",
81380
- doneText: `${brandColor("installed")} ${dim(`via ${npm24}`)}`
81479
+ doneText: `${brandColor("installed")} ${dim(`via ${npm25}`)}`
81381
81480
  });
81382
81481
  await addWorkersTypesToTsConfig(ctx);
81383
81482
  }
@@ -81400,8 +81499,8 @@ async function addWorkersTypesToTsConfig(ctx) {
81400
81499
  }
81401
81500
  const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
81402
81501
  try {
81403
- const config39 = parse4(tsconfig);
81404
- const currentTypes = config39.compilerOptions?.types ?? [];
81502
+ const config48 = parse4(tsconfig);
81503
+ const currentTypes = config48.compilerOptions?.types ?? [];
81405
81504
  const explicitEntrypoint = currentTypes.some(
81406
81505
  (t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
81407
81506
  );
@@ -81431,7 +81530,7 @@ async function addWorkersTypesToTsConfig(ctx) {
81431
81530
  }
81432
81531
 
81433
81532
  // src/cli.ts
81434
- var { npm: npm23 } = detectPackageManager();
81533
+ var { npm: npm24 } = detectPackageManager();
81435
81534
  var main = async (argv) => {
81436
81535
  const result = await parseArgs(argv);
81437
81536
  if (result.type === "unknown") {
@@ -81467,10 +81566,10 @@ ${result.errorMessage}`);
81467
81566
  };
81468
81567
  var runLatest = async () => {
81469
81568
  const args = process.argv.slice(2);
81470
- if (npm23 === "npm") {
81569
+ if (npm24 === "npm") {
81471
81570
  args.unshift("--");
81472
81571
  }
81473
- await runCommand([npm23, "create", "cloudflare@latest", ...args]);
81572
+ await runCommand([npm24, "create", "cloudflare@latest", ...args]);
81474
81573
  };
81475
81574
  var runCli = async (args) => {
81476
81575
  printBanner(args);