create-cloudflare 0.0.0-62a4ae6c5 → 0.0.0-62d5471ea

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 (87) hide show
  1. package/dist/cli.js +659 -647
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +6 -6
  4. package/templates/astro/c3.ts +5 -93
  5. package/templates/astro/pages/c3.ts +98 -0
  6. package/{templates-experimental/astro → templates/astro/workers}/c3.ts +2 -2
  7. package/templates/astro/workers/templates/js/public/.assetsignore +2 -0
  8. package/templates/astro/workers/templates/ts/public/.assetsignore +2 -0
  9. package/templates/hello-world/c3.ts +3 -2
  10. package/{templates-experimental → templates}/hello-world-assets-only/c3.ts +4 -3
  11. package/templates/hello-world-durable-object/c3.ts +2 -2
  12. package/templates/hello-world-durable-object/js/src/index.js +10 -9
  13. package/templates/hello-world-durable-object/js/wrangler.jsonc +1 -1
  14. package/templates/hello-world-durable-object/ts/src/index.ts +10 -9
  15. package/templates/hello-world-durable-object/ts/wrangler.jsonc +1 -1
  16. package/{templates-experimental → templates}/hello-world-durable-object-with-assets/c3.ts +3 -3
  17. package/{templates-experimental → templates}/hello-world-with-assets/c3.ts +3 -4
  18. package/templates/react/workers/js/src/App.css +45 -0
  19. package/templates/react/workers/js/src/assets/Cloudflare_Logo.svg +53 -26
  20. package/templates/react/workers/ts/src/App.css +45 -0
  21. package/templates/react/workers/ts/src/assets/Cloudflare_Logo.svg +51 -26
  22. package/templates/remix/c3.ts +5 -63
  23. package/templates/remix/pages/c3.ts +68 -0
  24. package/{templates-experimental/remix → templates/remix/workers}/c3.ts +2 -2
  25. package/templates-experimental/next/c3.ts +9 -9
  26. package/templates-experimental/next/templates/open-next.config.ts +5 -27
  27. package/templates-experimental/next/templates/wrangler.jsonc +0 -1
  28. package/templates-experimental/astro/templates/js/public/.assetsignore +0 -4
  29. package/templates-experimental/astro/templates/ts/public/.assetsignore +0 -4
  30. /package/templates/astro/{templates → pages/templates}/js/wrangler.jsonc +0 -0
  31. /package/{templates-experimental/astro → templates/astro/pages}/templates/ts/src/env.d.ts +0 -0
  32. /package/{templates-experimental/astro → templates/astro/pages}/templates/ts/worker-configuration.d.ts +0 -0
  33. /package/templates/astro/{templates → pages/templates}/ts/wrangler.jsonc +0 -0
  34. /package/{templates-experimental/astro → templates/astro/workers}/templates/js/wrangler.jsonc +0 -0
  35. /package/templates/astro/{templates → workers/templates}/ts/src/env.d.ts +0 -0
  36. /package/{templates-experimental/hello-world-with-assets → templates/astro/workers/templates}/ts/worker-configuration.d.ts +0 -0
  37. /package/{templates-experimental/astro → templates/astro/workers}/templates/ts/wrangler.jsonc +0 -0
  38. /package/{templates-experimental → templates}/hello-world-assets-only/templates/package.json +0 -0
  39. /package/{templates-experimental → templates}/hello-world-assets-only/templates/public/index.html +0 -0
  40. /package/{templates-experimental → templates}/hello-world-assets-only/templates/wrangler.jsonc +0 -0
  41. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/.editorconfig +0 -0
  42. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/.prettierrc +0 -0
  43. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/__dot__gitignore +0 -0
  44. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/package.json +0 -0
  45. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/public/index.html +0 -0
  46. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/src/index.js +0 -0
  47. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/wrangler.jsonc +0 -0
  48. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/.editorconfig +0 -0
  49. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/.prettierrc +0 -0
  50. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/__dot__gitignore +0 -0
  51. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/package.json +0 -0
  52. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/public/index.html +0 -0
  53. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/src/index.ts +0 -0
  54. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/tsconfig.json +0 -0
  55. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +0 -0
  56. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/wrangler.jsonc +0 -0
  57. /package/{templates-experimental → templates}/hello-world-with-assets/js/.editorconfig +0 -0
  58. /package/{templates-experimental → templates}/hello-world-with-assets/js/.prettierrc +0 -0
  59. /package/{templates-experimental → templates}/hello-world-with-assets/js/__dot__gitignore +0 -0
  60. /package/{templates-experimental → templates}/hello-world-with-assets/js/package.json +0 -0
  61. /package/{templates-experimental → templates}/hello-world-with-assets/js/public/index.html +0 -0
  62. /package/{templates-experimental → templates}/hello-world-with-assets/js/src/index.js +0 -0
  63. /package/{templates-experimental → templates}/hello-world-with-assets/js/test/index.spec.js +0 -0
  64. /package/{templates-experimental → templates}/hello-world-with-assets/js/vitest.config.js +0 -0
  65. /package/{templates-experimental → templates}/hello-world-with-assets/js/wrangler.jsonc +0 -0
  66. /package/{templates-experimental → templates}/hello-world-with-assets/py/__dot__gitignore +0 -0
  67. /package/{templates-experimental → templates}/hello-world-with-assets/py/package.json +0 -0
  68. /package/{templates-experimental → templates}/hello-world-with-assets/py/public/index.html +0 -0
  69. /package/{templates-experimental → templates}/hello-world-with-assets/py/src/entry.py +0 -0
  70. /package/{templates-experimental → templates}/hello-world-with-assets/py/wrangler.jsonc +0 -0
  71. /package/{templates-experimental → templates}/hello-world-with-assets/ts/.editorconfig +0 -0
  72. /package/{templates-experimental → templates}/hello-world-with-assets/ts/.prettierrc +0 -0
  73. /package/{templates-experimental → templates}/hello-world-with-assets/ts/__dot__gitignore +0 -0
  74. /package/{templates-experimental → templates}/hello-world-with-assets/ts/package.json +0 -0
  75. /package/{templates-experimental → templates}/hello-world-with-assets/ts/public/index.html +0 -0
  76. /package/{templates-experimental → templates}/hello-world-with-assets/ts/src/index.ts +0 -0
  77. /package/{templates-experimental → templates}/hello-world-with-assets/ts/test/index.spec.ts +0 -0
  78. /package/{templates-experimental → templates}/hello-world-with-assets/ts/test/tsconfig.json +0 -0
  79. /package/{templates-experimental → templates}/hello-world-with-assets/ts/tsconfig.json +0 -0
  80. /package/{templates-experimental → templates}/hello-world-with-assets/ts/vitest.config.mts +0 -0
  81. /package/templates/{astro/templates → hello-world-with-assets}/ts/worker-configuration.d.ts +0 -0
  82. /package/{templates-experimental → templates}/hello-world-with-assets/ts/wrangler.jsonc +0 -0
  83. /package/templates/remix/{templates → pages/templates}/worker-configuration.d.ts +0 -0
  84. /package/templates/remix/{templates → pages/templates}/wrangler.jsonc +0 -0
  85. /package/{templates-experimental/remix → templates/remix/workers}/templates/public/.assetsignore +0 -0
  86. /package/{templates-experimental/remix → templates/remix/workers}/templates/worker-configuration.d.ts +0 -0
  87. /package/{templates-experimental/remix → templates/remix/workers}/templates/wrangler.toml +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 config34(dirOptions) {
571
+ XDGAppPaths.config = function config36(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 config34 = function() {
628
+ var config36 = 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: config34, data, runtime, state };
640
+ return { cache, config: config36, 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 config34 = function() {
646
+ var config36 = 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: config34, data, runtime, state };
658
+ return { cache, config: config36, 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 config34 = function() {
670
+ var config36 = 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: config34, data, runtime, state };
682
+ return { cache, config: config36, 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 config34 = (0, _lodash["default"])(options, this.config);
31513
- if (config34.tokenHex === true) {
31514
- config34.tokenChars = "0123456789abcdef";
31512
+ var config36 = (0, _lodash["default"])(options, this.config);
31513
+ if (config36.tokenHex === true) {
31514
+ config36.tokenChars = "0123456789abcdef";
31515
31515
  }
31516
31516
  var adjective = this._randomElement(this.adjectives);
31517
31517
  var noun = this._randomElement(this.nouns);
31518
- if (!config34.tokenLength) config34.tokenLength = 0;
31518
+ if (!config36.tokenLength) config36.tokenLength = 0;
31519
31519
  var token = "";
31520
- for (var i = 0; i < config34.tokenLength; i++) {
31521
- token += this._randomElement(config34.tokenChars);
31520
+ for (var i = 0; i < config36.tokenLength; i++) {
31521
+ token += this._randomElement(config36.tokenChars);
31522
31522
  }
31523
31523
  var sections = [adjective, noun, token];
31524
31524
  return sections.filter(function(e) {
31525
31525
  return !!e;
31526
- }).join(config34.delimiter);
31526
+ }).join(config36.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, config34) {
40039
+ function Tokenizer2(code, config36) {
40040
40040
  this.errorHandler = new error_handler_1.ErrorHandler();
40041
- this.errorHandler.tolerant = config34 ? typeof config34.tolerant === "boolean" && config34.tolerant : false;
40041
+ this.errorHandler.tolerant = config36 ? typeof config36.tolerant === "boolean" && config36.tolerant : false;
40042
40042
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
40043
- this.scanner.trackComment = config34 ? typeof config34.comment === "boolean" && config34.comment : false;
40044
- this.trackRange = config34 ? typeof config34.range === "boolean" && config34.range : false;
40045
- this.trackLoc = config34 ? typeof config34.loc === "boolean" && config34.loc : false;
40043
+ this.scanner.trackComment = config36 ? typeof config36.comment === "boolean" && config36.comment : false;
40044
+ this.trackRange = config36 ? typeof config36.range === "boolean" && config36.range : false;
40045
+ this.trackLoc = config36 ? typeof config36.loc === "boolean" && config36.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(config34) {
49806
+ var Printer = function Printer2(config36) {
49807
49807
  assert_1.default.ok(this instanceof Printer2);
49808
- var explicitTabWidth = config34 && config34.tabWidth;
49809
- config34 = options_1.normalize(config34);
49810
- config34.sourceFileName = null;
49808
+ var explicitTabWidth = config36 && config36.tabWidth;
49809
+ config36 = options_1.normalize(config36);
49810
+ config36.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 = config34.tabWidth;
49825
+ var oldTabWidth = config36.tabWidth;
49826
49826
  if (!explicitTabWidth) {
49827
49827
  var loc = path6.getNode().loc;
49828
49828
  if (loc && loc.lines && loc.lines.guessTabWidth) {
49829
- config34.tabWidth = loc.lines.guessTabWidth();
49829
+ config36.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, config34, options, makePrintFunctionWith(options, {
49843
+ ) : genericPrint(path6, config36, options, makePrintFunctionWith(options, {
49844
49844
  includeComments: true,
49845
49845
  avoidRootParens: false
49846
49846
  }));
49847
- config34.tabWidth = oldTabWidth;
49847
+ config36.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(config34), util.composeSourceMaps(config34.inputSourceMap, lines.getSourceMap(config34.sourceMapName, config34.sourceRoot)));
49858
+ return new PrintResult(lines.toString(config36), util.composeSourceMaps(config36.inputSourceMap, lines.getSourceMap(config36.sourceMapName, config36.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, config34, {
49866
+ return genericPrint(path8, config36, {
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 = config34.reuseWhitespace;
49874
- config34.reuseWhitespace = false;
49875
- var pr = new PrintResult(printGenerically(path6).toString(config34));
49876
- config34.reuseWhitespace = oldReuseWhitespace;
49873
+ var oldReuseWhitespace = config36.reuseWhitespace;
49874
+ config36.reuseWhitespace = false;
49875
+ var pr = new PrintResult(printGenerically(path6).toString(config36));
49876
+ config36.reuseWhitespace = oldReuseWhitespace;
49877
49877
  return pr;
49878
49878
  };
49879
49879
  };
49880
49880
  exports2.Printer = Printer;
49881
- function genericPrint(path6, config34, options, printPath) {
49881
+ function genericPrint(path6, config36, 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, config34, printPath);
49885
+ var linesWithoutParens = genericPrintNoParens(path6, config36, 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 = (config34, value) => {
69384
- const { question, label } = config34;
69385
- if (config34.type !== "confirm" && !value) {
69383
+ var renderSubmit = (config36, value) => {
69384
+ const { question, label } = config36;
69385
+ if (config36.type !== "confirm" && !value) {
69386
69386
  return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
69387
69387
  }
69388
- const content = config34.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69388
+ const content = config36.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69389
69389
  return [`${leftT} ${question}`, content, `${grayBar}`];
69390
69390
  };
69391
- var getRenderers = (config34) => {
69392
- switch (config34.type) {
69391
+ var getRenderers = (config36) => {
69392
+ switch (config36.type) {
69393
69393
  case "select":
69394
- return getSelectRenderers(config34);
69394
+ return getSelectRenderers(config36);
69395
69395
  case "confirm":
69396
- return getConfirmRenderers(config34);
69396
+ return getConfirmRenderers(config36);
69397
69397
  case "text":
69398
- return getTextRenderers(config34);
69398
+ return getTextRenderers(config36);
69399
69399
  case "multiselect":
69400
- return getSelectRenderers(config34);
69400
+ return getSelectRenderers(config36);
69401
69401
  case "list":
69402
- return getSelectListRenderers(config34);
69402
+ return getSelectListRenderers(config36);
69403
69403
  }
69404
69404
  };
69405
- var getTextRenderers = (config34) => {
69406
- const { question } = config34;
69407
- const helpText = config34.helpText ?? "";
69408
- const format5 = config34.format ?? ((val) => String(val));
69409
- const defaultValue = config34.defaultValue?.toString() ?? "";
69405
+ var getTextRenderers = (config36) => {
69406
+ const { question } = config36;
69407
+ const helpText = config36.helpText ?? "";
69408
+ const format5 = config36.format ?? ((val) => String(val));
69409
+ const defaultValue = config36.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 = (config34) => {
69429
69429
  ``
69430
69430
  // extra line for readability
69431
69431
  ],
69432
- submit: ({ value }) => renderSubmit(config34, format5(value ?? "")),
69432
+ submit: ({ value }) => renderSubmit(config36, format5(value ?? "")),
69433
69433
  cancel: activeRenderer
69434
69434
  };
69435
69435
  };
69436
- var getSelectRenderers = (config34) => {
69437
- const { options, question, helpText: _helpText } = config34;
69436
+ var getSelectRenderers = (config36) => {
69437
+ const { options, question, helpText: _helpText } = config36;
69438
69438
  const helpText = _helpText ?? "";
69439
- const maxItemsPerPage = config34.maxItemsPerPage ?? 32;
69439
+ const maxItemsPerPage = config36.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
- config34,
69514
+ config36,
69515
69515
  options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
69516
69516
  );
69517
69517
  }
69518
69518
  return renderSubmit(
69519
- config34,
69519
+ config36,
69520
69520
  options.find((o) => o.value === value)?.label
69521
69521
  );
69522
69522
  },
69523
69523
  cancel: defaultRenderer
69524
69524
  };
69525
69525
  };
69526
- var getSelectListRenderers = (config34) => {
69527
- const { question, helpText: _helpText } = config34;
69528
- let options = config34.options;
69526
+ var getSelectListRenderers = (config36) => {
69527
+ const { question, helpText: _helpText } = config36;
69528
+ let options = config36.options;
69529
69529
  const helpText = _helpText ?? "";
69530
69530
  const { rows } = stdout;
69531
69531
  const defaultRenderer = ({ cursor, value }, prompt) => {
@@ -69606,20 +69606,20 @@ var getSelectListRenderers = (config34) => {
69606
69606
  submit: ({ value }) => {
69607
69607
  if (Array.isArray(value)) {
69608
69608
  return renderSubmit(
69609
- config34,
69609
+ config36,
69610
69610
  options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
69611
69611
  );
69612
69612
  }
69613
69613
  return renderSubmit(
69614
- config34,
69614
+ config36,
69615
69615
  options.find((o) => o.value === value)?.value
69616
69616
  );
69617
69617
  },
69618
69618
  cancel: defaultRenderer
69619
69619
  };
69620
69620
  };
69621
- var getConfirmRenderers = (config34) => {
69622
- const { activeText, inactiveText, question, helpText: _helpText } = config34;
69621
+ var getConfirmRenderers = (config36) => {
69622
+ const { activeText, inactiveText, question, helpText: _helpText } = config36;
69623
69623
  const helpText = _helpText ?? "";
69624
69624
  const active = activeText || "Yes";
69625
69625
  const inactive = inactiveText || "No";
@@ -69636,7 +69636,7 @@ var getConfirmRenderers = (config34) => {
69636
69636
  active: defaultRenderer,
69637
69637
  confirm: defaultRenderer,
69638
69638
  error: defaultRenderer,
69639
- submit: ({ value }) => renderSubmit(config34, value ? "yes" : "no"),
69639
+ submit: ({ value }) => renderSubmit(config36, 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 config34 = null;
70607
+ let config36 = 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
- config34 = resolveConfig(resolvedConfigPath);
70612
+ config36 = resolveConfig(resolvedConfigPath);
70613
70613
  } catch (e) {
70614
- config34 = e;
70614
+ config36 = e;
70615
70615
  }
70616
- if (config34 instanceof Error) {
70617
- error2 = config34;
70616
+ if (config36 instanceof Error) {
70617
+ error2 = config36;
70618
70618
  return;
70619
70619
  }
70620
70620
  } else {
70621
- config34 = mixin2.require(resolvedConfigPath);
70621
+ config36 = mixin2.require(resolvedConfigPath);
70622
70622
  }
70623
- setConfigObject(config34);
70623
+ setConfigObject(config36);
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(config34, prev) {
70634
- Object.keys(config34).forEach(function(key) {
70635
- const value = config34[key];
70633
+ function setConfigObject(config36, prev) {
70634
+ Object.keys(config36).forEach(function(key) {
70635
+ const value = config36[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 config34 = Object.assign({}, options.configuration, {
71787
+ const config36 = Object.assign({}, options.configuration, {
71788
71788
  "populate--": false
71789
71789
  });
71790
71790
  const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
71791
- configuration: config34
71791
+ configuration: config36
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(config34, cwd, mergeExtends, _shim) {
73014
+ function applyExtends(config36, cwd, mergeExtends, _shim) {
73015
73015
  shim2 = _shim;
73016
73016
  let defaultConfig = {};
73017
- if (Object.prototype.hasOwnProperty.call(config34, "extends")) {
73018
- if (typeof config34.extends !== "string")
73017
+ if (Object.prototype.hasOwnProperty.call(config36, "extends")) {
73018
+ if (typeof config36.extends !== "string")
73019
73019
  return defaultConfig;
73020
- const isPath = /\.json|\..*rc$/.test(config34.extends);
73020
+ const isPath = /\.json|\..*rc$/.test(config36.extends);
73021
73021
  let pathToDefault = null;
73022
73022
  if (!isPath) {
73023
73023
  try {
73024
- pathToDefault = require.resolve(config34.extends);
73024
+ pathToDefault = require.resolve(config36.extends);
73025
73025
  } catch (_err) {
73026
- return config34;
73026
+ return config36;
73027
73027
  }
73028
73028
  } else {
73029
- pathToDefault = getPathToDefaultConfig(cwd, config34.extends);
73029
+ pathToDefault = getPathToDefaultConfig(cwd, config36.extends);
73030
73030
  }
73031
73031
  checkForCircularExtends(pathToDefault);
73032
73032
  previouslyVisitedConfigs.push(pathToDefault);
73033
- defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config34.extends);
73034
- delete config34.extends;
73033
+ defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config36.extends);
73034
+ delete config36.extends;
73035
73035
  defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
73036
73036
  }
73037
73037
  previouslyVisitedConfigs = [];
73038
- return mergeExtends ? mergeDeep(defaultConfig, config34) : Object.assign({}, defaultConfig, config34);
73038
+ return mergeExtends ? mergeDeep(defaultConfig, config36) : Object.assign({}, defaultConfig, config36);
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(config34) {
73815
- argsert("<object>", [config34], arguments.length);
73816
- __classPrivateFieldSet(this, _YargsInstance_parserConfig, config34, "f");
73814
+ parserConfiguration(config36) {
73815
+ argsert("<object>", [config36], arguments.length);
73816
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config36, "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(config34) {
73989
- argsert("<object>", [config34], arguments.length);
73990
- __classPrivateFieldSet(this, _YargsInstance_usageConfig, config34, "f");
73988
+ usageConfiguration(config36) {
73989
+ argsert("<object>", [config36], arguments.length);
73990
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config36, "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 config34 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
74396
+ const config36 = 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, ...config34 }
74400
+ configuration: { "parse-positional-numbers": false, ...config36 }
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-62a4ae6c5";
74563
+ var version = "0.0.0-62d5471ea";
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(config34) {
74607
+ function writeMetricsConfig(config36) {
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
- config34,
74612
+ config36,
74613
74613
  (_key, value) => value instanceof Date ? value.toISOString() : value,
74614
74614
  " "
74615
74615
  )
@@ -74617,9 +74617,9 @@ function writeMetricsConfig(config34) {
74617
74617
  }
74618
74618
  function readMetricsConfig() {
74619
74619
  try {
74620
- const config34 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
74620
+ const config36 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
74621
74621
  return JSON.parse(
74622
- config34,
74622
+ config36,
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(config34) {
74633
- const deviceId = config34.deviceId ?? (0, import_node_crypto.randomUUID)();
74634
- if (config34.deviceId === void 0) {
74635
- writeMetricsConfig({ ...config34, deviceId });
74632
+ function getDeviceId(config36) {
74633
+ const deviceId = config36.deviceId ?? (0, import_node_crypto.randomUUID)();
74634
+ if (config36.deviceId === void 0) {
74635
+ writeMetricsConfig({ ...config36, deviceId });
74636
74636
  }
74637
74637
  return deviceId;
74638
74638
  }
@@ -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 config34 = readMetricsConfig() ?? {};
74911
- const isFirstUsage = config34.c3permission === void 0;
74910
+ const config36 = readMetricsConfig() ?? {};
74911
+ const isFirstUsage = config36.c3permission === void 0;
74912
74912
  const isEnabled = isTelemetryEnabled();
74913
- const deviceId = getDeviceId(config34);
74913
+ const deviceId = getDeviceId(config36);
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(config34).enabled;
74946
+ return hasSparrowSourceKey() && getC3Permission(config36).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(config34 = readMetricsConfig() ?? {}) {
75053
- if (!config34.c3permission) {
75054
- config34.c3permission = initializeC3Permission();
75055
- writeMetricsConfig(config34);
75052
+ function getC3Permission(config36 = readMetricsConfig() ?? {}) {
75053
+ if (!config36.c3permission) {
75054
+ config36.c3permission = initializeC3Permission();
75055
+ writeMetricsConfig(config36);
75056
75056
  }
75057
- return config34.c3permission;
75057
+ return config36.c3permission;
75058
75058
  }
75059
75059
  function updateC3Pemission(enabled) {
75060
- const config34 = readMetricsConfig();
75061
- if (config34.c3permission?.enabled === enabled) {
75060
+ const config36 = readMetricsConfig();
75061
+ if (config36.c3permission?.enabled === enabled) {
75062
75062
  return;
75063
75063
  }
75064
- config34.c3permission = initializeC3Permission(enabled);
75065
- writeMetricsConfig(config34);
75064
+ config36.c3permission = initializeC3Permission(enabled);
75065
+ writeMetricsConfig(config36);
75066
75066
  }
75067
75067
  var runTelemetryCommand = (action) => {
75068
75068
  const logTelemetryStatus = (enabled) => {
@@ -75107,24 +75107,24 @@ 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, config34 = {}) => {
75110
+ var installPackages = async (packages, config36 = {}) => {
75111
75111
  const { npm: npm24 } = detectPackageManager();
75112
75112
  let saveFlag;
75113
75113
  let cmd;
75114
75114
  switch (npm24) {
75115
75115
  case "yarn":
75116
75116
  cmd = "add";
75117
- saveFlag = config34.dev ? "-D" : "";
75117
+ saveFlag = config36.dev ? "-D" : "";
75118
75118
  break;
75119
75119
  case "bun":
75120
75120
  cmd = "add";
75121
- saveFlag = config34.dev ? "-d" : "";
75121
+ saveFlag = config36.dev ? "-d" : "";
75122
75122
  break;
75123
75123
  case "npm":
75124
75124
  case "pnpm":
75125
75125
  default:
75126
75126
  cmd = "install";
75127
- saveFlag = config34.dev ? "--save-dev" : "";
75127
+ saveFlag = config36.dev ? "--save-dev" : "";
75128
75128
  break;
75129
75129
  }
75130
75130
  await runCommand(
@@ -75139,7 +75139,7 @@ var installPackages = async (packages, config34 = {}) => {
75139
75139
  ...npm24 === "npm" ? ["--legacy-peer-deps"] : []
75140
75140
  ],
75141
75141
  {
75142
- ...config34,
75142
+ ...config36,
75143
75143
  silent: true
75144
75144
  }
75145
75145
  );
@@ -75209,7 +75209,7 @@ var isUpdateAvailable = async () => {
75209
75209
  var C3_DEFAULTS = {
75210
75210
  projectName: new import_haikunator.default().haikunate({ tokenHex: true }),
75211
75211
  category: "hello-world",
75212
- type: "hello-world",
75212
+ type: "hello-world-with-assets",
75213
75213
  framework: "analog",
75214
75214
  experimental: false,
75215
75215
  autoUpdate: true,
@@ -75217,11 +75217,11 @@ var C3_DEFAULTS = {
75217
75217
  git: true,
75218
75218
  open: true,
75219
75219
  lang: "ts",
75220
- template: "cloudflare/workers-sdk/packages/create-cloudflare/templates/hello-world"
75220
+ template: "cloudflare/workers-sdk/packages/create-cloudflare/templates/hello-world-with-assets"
75221
75221
  };
75222
75222
  var WRANGLER_DEFAULTS = {
75223
75223
  ...C3_DEFAULTS,
75224
- type: "hello-world",
75224
+ type: "hello-world-with-assets",
75225
75225
  deploy: false
75226
75226
  };
75227
75227
 
@@ -75340,11 +75340,11 @@ var package_default = {
75340
75340
  "@angular/create": "19.1.6",
75341
75341
  "create-docusaurus": "3.7.0",
75342
75342
  "create-hono": "0.15.3",
75343
- "create-next-app": "15.1.6",
75343
+ "create-next-app": "15.2.1",
75344
75344
  "create-qwik": "1.12.0",
75345
75345
  "create-vite": "6.1.1",
75346
75346
  "create-remix": "2.15.3",
75347
- "create-solid": "0.5.14",
75347
+ "create-solid": "0.6.1",
75348
75348
  "create-vue": "3.14.2",
75349
75349
  gatsby: "5.14.1",
75350
75350
  sv: "0.6.23",
@@ -75378,217 +75378,8 @@ var runFrameworkGenerator = async (ctx, args) => {
75378
75378
  await runCommand(cmd, { env: env3 });
75379
75379
  };
75380
75380
 
75381
- // src/helpers/codemod.ts
75382
- var import_fs8 = require("fs");
75383
- var import_path8 = __toESM(require("path"));
75384
- var recast = __toESM(require_main3());
75385
- var esprimaParser = __toESM(require_esprima3());
75386
- var typescriptParser = __toESM(require_typescript2());
75387
- var parseFile = (filePath) => {
75388
- const lang = import_path8.default.extname(filePath).slice(1);
75389
- const parser2 = lang === "js" ? esprimaParser : typescriptParser;
75390
- try {
75391
- const fileContents = readFile(import_path8.default.resolve(filePath));
75392
- if (fileContents) {
75393
- return recast.parse(fileContents, { parser: parser2 }).program;
75394
- }
75395
- } catch (error2) {
75396
- throw new Error(`Error parsing file: ${filePath}`);
75397
- }
75398
- return null;
75399
- };
75400
- var transformFile = (filePath, methods) => {
75401
- const ast = parseFile(filePath);
75402
- if (ast) {
75403
- recast.visit(ast, methods);
75404
- writeFile2(filePath, recast.print(ast).code);
75405
- }
75406
- };
75407
- var loadSnippets = (parentFolder) => {
75408
- const snippetsPath = (0, import_path8.join)(parentFolder, "snippets");
75409
- if (!(0, import_fs8.existsSync)(snippetsPath)) {
75410
- return {};
75411
- }
75412
- if (!(0, import_fs8.lstatSync)(snippetsPath).isDirectory) {
75413
- return {};
75414
- }
75415
- const files = (0, import_fs8.readdirSync)(snippetsPath);
75416
- return files.filter((fileName) => (0, import_fs8.lstatSync)((0, import_path8.join)(snippetsPath, fileName)).isFile).filter((fileName) => [".js", ".ts"].includes((0, import_path8.extname)(fileName))).reduce((acc, snippetPath) => {
75417
- const [file, ext] = snippetPath.split(".");
75418
- const key = `${file}${ext === "js" ? "Js" : "Ts"}`;
75419
- return {
75420
- ...acc,
75421
- [key]: parseFile((0, import_path8.join)(snippetsPath, snippetPath))?.body
75422
- };
75423
- }, {});
75424
- };
75425
- var loadTemplateSnippets = (ctx) => {
75426
- return loadSnippets(getTemplatePath(ctx));
75427
- };
75428
- var mergeObjectProperties = (sourceObject, newProperties) => {
75429
- newProperties.forEach((newProp) => {
75430
- const newPropName = getPropertyName(newProp);
75431
- if (!newPropName) {
75432
- return false;
75433
- }
75434
- const indexOfExisting = sourceObject.properties.findIndex(
75435
- (p2) => p2.type === "ObjectProperty" && getPropertyName(p2) === newPropName
75436
- );
75437
- const existing = sourceObject.properties[indexOfExisting];
75438
- if (!existing) {
75439
- sourceObject.properties.push(newProp);
75440
- return;
75441
- }
75442
- if (existing.type === "ObjectProperty" && existing.value.type === "ObjectExpression" && newProp.value.type === "ObjectExpression") {
75443
- mergeObjectProperties(
75444
- existing.value,
75445
- newProp.value.properties
75446
- );
75447
- return;
75448
- }
75449
- sourceObject.properties[indexOfExisting] = newProp;
75450
- });
75451
- };
75452
- var getPropertyName = (newProp) => {
75453
- return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
75454
- };
75455
-
75456
- // templates-experimental/astro/c3.ts
75457
- var recast2 = __toESM(require_main3());
75458
- var { npx } = detectPackageManager();
75459
- var generate = async (ctx) => {
75460
- await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
75461
- logRaw("");
75462
- };
75463
- var configure = async () => {
75464
- await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
75465
- silent: true,
75466
- startText: "Installing adapter",
75467
- doneText: `${brandColor("installed")} ${dim(
75468
- `via \`${npx} astro add cloudflare\``
75469
- )}`
75470
- });
75471
- updateAstroConfig();
75472
- };
75473
- var updateAstroConfig = () => {
75474
- const filePath = "astro.config.mjs";
75475
- updateStatus(`Updating configuration in ${blue(filePath)}`);
75476
- transformFile(filePath, {
75477
- visitCallExpression: function(n) {
75478
- const callee = n.node.callee;
75479
- if (callee.name !== "cloudflare") {
75480
- return this.traverse(n);
75481
- }
75482
- const b3 = recast2.types.builders;
75483
- n.node.arguments = [
75484
- b3.objectExpression([
75485
- b3.objectProperty(
75486
- b3.identifier("platformProxy"),
75487
- b3.objectExpression([
75488
- b3.objectProperty(b3.identifier("enabled"), b3.booleanLiteral(true))
75489
- ])
75490
- )
75491
- ])
75492
- ];
75493
- return false;
75494
- }
75495
- });
75496
- };
75497
- var config = {
75498
- configVersion: 1,
75499
- id: "astro",
75500
- frameworkCli: "create-astro",
75501
- platform: "workers",
75502
- displayName: "Astro",
75503
- copyFiles: {
75504
- async selectVariant(ctx) {
75505
- return usesTypescript(ctx) ? "ts" : "js";
75506
- },
75507
- variants: {
75508
- js: {
75509
- path: "./templates/js"
75510
- },
75511
- ts: {
75512
- path: "./templates/ts"
75513
- }
75514
- }
75515
- },
75516
- devScript: "dev",
75517
- deployScript: "deploy",
75518
- previewScript: "preview",
75519
- path: "templates-experimental/astro",
75520
- generate,
75521
- configure,
75522
- transformPackageJson: async (pkgJson, ctx) => ({
75523
- scripts: {
75524
- deploy: `astro build && wrangler deploy`,
75525
- preview: `astro build && wrangler dev`,
75526
- ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
75527
- }
75528
- })
75529
- };
75530
- var c3_default = config;
75531
-
75532
- // templates-experimental/hello-world-assets-only/c3.ts
75533
- var config2 = {
75534
- configVersion: 1,
75535
- id: "hello-world-assets-only",
75536
- path: "templates-experimental/hello-world-assets-only",
75537
- displayName: "Hello World - Assets-only",
75538
- description: "Get started with a basic Worker that only serves static assets",
75539
- platform: "workers",
75540
- copyFiles: {
75541
- path: "./templates"
75542
- }
75543
- };
75544
- var c3_default2 = config2;
75545
-
75546
- // templates-experimental/hello-world-durable-object-with-assets/c3.ts
75547
- var config3 = {
75548
- configVersion: 1,
75549
- id: "hello-world-durable-object-with-assets",
75550
- path: "templates-experimental/hello-world-durable-object-with-assets",
75551
- displayName: "Hello World - Worker Using Durable Objects with Assets",
75552
- description: "Get started with a basic stateful app to build projects like real-time chats, collaborative apps, and multiplayer games, which hosts assets",
75553
- platform: "workers",
75554
- copyFiles: {
75555
- variants: {
75556
- js: {
75557
- path: "./js"
75558
- },
75559
- ts: {
75560
- path: "./ts"
75561
- }
75562
- }
75563
- }
75564
- };
75565
- var c3_default3 = config3;
75566
-
75567
- // templates-experimental/hello-world-with-assets/c3.ts
75568
- var c3_default4 = {
75569
- configVersion: 1,
75570
- id: "hello-world-with-assets",
75571
- path: "templates-experimental/hello-world-with-assets",
75572
- displayName: "Hello World - Worker with Assets",
75573
- description: "Get started with a basic Worker that also serves static assets, in the language of your choice",
75574
- platform: "workers",
75575
- copyFiles: {
75576
- variants: {
75577
- js: {
75578
- path: "./js"
75579
- },
75580
- ts: {
75581
- path: "./ts"
75582
- },
75583
- python: {
75584
- path: "./py"
75585
- }
75586
- }
75587
- }
75588
- };
75589
-
75590
75381
  // templates-experimental/hono/c3.ts
75591
- var generate2 = async (ctx) => {
75382
+ var generate = async (ctx) => {
75592
75383
  const { name: pm4 } = detectPackageManager();
75593
75384
  await runFrameworkGenerator(ctx, [
75594
75385
  ctx.project.name,
@@ -75600,7 +75391,7 @@ var generate2 = async (ctx) => {
75600
75391
  ]);
75601
75392
  logRaw("");
75602
75393
  };
75603
- var config4 = {
75394
+ var config = {
75604
75395
  configVersion: 1,
75605
75396
  id: "hono",
75606
75397
  frameworkCli: "create-hono",
@@ -75610,7 +75401,7 @@ var config4 = {
75610
75401
  },
75611
75402
  platform: "workers",
75612
75403
  path: "templates-experimental/hono",
75613
- generate: generate2,
75404
+ generate,
75614
75405
  transformPackageJson: async () => ({
75615
75406
  scripts: {
75616
75407
  dev: "wrangler dev",
@@ -75622,13 +75413,13 @@ var config4 = {
75622
75413
  deployScript: "deploy",
75623
75414
  previewScript: "dev"
75624
75415
  };
75625
- var c3_default5 = config4;
75416
+ var c3_default = config;
75626
75417
 
75627
75418
  // templates-experimental/next/c3.ts
75628
- var generate3 = async (ctx) => {
75419
+ var generate2 = async (ctx) => {
75629
75420
  await runFrameworkGenerator(ctx, [ctx.project.name]);
75630
75421
  };
75631
- var configure2 = async () => {
75422
+ var configure = async (ctx) => {
75632
75423
  const packages = [
75633
75424
  "@opennextjs/cloudflare@0.5.x",
75634
75425
  "@cloudflare/workers-types"
@@ -75638,11 +75429,12 @@ var configure2 = async () => {
75638
75429
  startText: "Adding the Cloudflare adapter",
75639
75430
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
75640
75431
  });
75641
- updateNextConfig();
75432
+ const usesTs = usesTypescript(ctx);
75433
+ updateNextConfig(usesTs);
75642
75434
  };
75643
- var updateNextConfig = () => {
75435
+ var updateNextConfig = (usesTs) => {
75644
75436
  const s = spinner();
75645
- const configFile = "next.config.mjs";
75437
+ const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
75646
75438
  s.start(`Updating \`${configFile}\``);
75647
75439
  const configContent = readFile(configFile);
75648
75440
  const updatedConfigFile = configContent + `
@@ -75653,22 +75445,20 @@ var updateNextConfig = () => {
75653
75445
  writeFile2(configFile, updatedConfigFile);
75654
75446
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
75655
75447
  };
75656
- var c3_default6 = {
75448
+ var c3_default2 = {
75657
75449
  configVersion: 1,
75658
75450
  id: "next",
75659
75451
  frameworkCli: "create-next-app",
75660
- // TODO: here we need to specify a version of create-next-app which is different from the
75661
- // standard one used in the stable Next.js template, that's because our open-next adapter
75662
- // is not yet fully ready for Next.js 15, once it is we should remove the following
75663
- frameworkCliPinnedVersion: "^14.2.23",
75452
+ // TODO: Stop using a pinned version when the template graduates.
75453
+ frameworkCliPinnedVersion: "~15.2.2",
75664
75454
  platform: "workers",
75665
75455
  displayName: "Next.js (using Node.js compat + Workers Assets)",
75666
75456
  path: "templates-experimental/next",
75667
75457
  copyFiles: {
75668
75458
  path: "./templates"
75669
75459
  },
75670
- generate: generate3,
75671
- configure: configure2,
75460
+ generate: generate2,
75461
+ configure,
75672
75462
  transformPackageJson: async () => ({
75673
75463
  scripts: {
75674
75464
  deploy: `opennextjs-cloudflare && wrangler deploy`,
@@ -75682,14 +75472,89 @@ var c3_default6 = {
75682
75472
  compatibilityFlags: ["nodejs_compat"]
75683
75473
  };
75684
75474
 
75475
+ // src/helpers/codemod.ts
75476
+ var import_fs8 = require("fs");
75477
+ var import_path8 = __toESM(require("path"));
75478
+ var recast = __toESM(require_main3());
75479
+ var esprimaParser = __toESM(require_esprima3());
75480
+ var typescriptParser = __toESM(require_typescript2());
75481
+ var parseFile = (filePath) => {
75482
+ const lang = import_path8.default.extname(filePath).slice(1);
75483
+ const parser2 = lang === "js" ? esprimaParser : typescriptParser;
75484
+ try {
75485
+ const fileContents = readFile(import_path8.default.resolve(filePath));
75486
+ if (fileContents) {
75487
+ return recast.parse(fileContents, { parser: parser2 }).program;
75488
+ }
75489
+ } catch (error2) {
75490
+ throw new Error(`Error parsing file: ${filePath}`);
75491
+ }
75492
+ return null;
75493
+ };
75494
+ var transformFile = (filePath, methods) => {
75495
+ const ast = parseFile(filePath);
75496
+ if (ast) {
75497
+ recast.visit(ast, methods);
75498
+ writeFile2(filePath, recast.print(ast).code);
75499
+ }
75500
+ };
75501
+ var loadSnippets = (parentFolder) => {
75502
+ const snippetsPath = (0, import_path8.join)(parentFolder, "snippets");
75503
+ if (!(0, import_fs8.existsSync)(snippetsPath)) {
75504
+ return {};
75505
+ }
75506
+ if (!(0, import_fs8.lstatSync)(snippetsPath).isDirectory) {
75507
+ return {};
75508
+ }
75509
+ const files = (0, import_fs8.readdirSync)(snippetsPath);
75510
+ return files.filter((fileName) => (0, import_fs8.lstatSync)((0, import_path8.join)(snippetsPath, fileName)).isFile).filter((fileName) => [".js", ".ts"].includes((0, import_path8.extname)(fileName))).reduce((acc, snippetPath) => {
75511
+ const [file, ext] = snippetPath.split(".");
75512
+ const key = `${file}${ext === "js" ? "Js" : "Ts"}`;
75513
+ return {
75514
+ ...acc,
75515
+ [key]: parseFile((0, import_path8.join)(snippetsPath, snippetPath))?.body
75516
+ };
75517
+ }, {});
75518
+ };
75519
+ var loadTemplateSnippets = (ctx) => {
75520
+ return loadSnippets(getTemplatePath(ctx));
75521
+ };
75522
+ var mergeObjectProperties = (sourceObject, newProperties) => {
75523
+ newProperties.forEach((newProp) => {
75524
+ const newPropName = getPropertyName(newProp);
75525
+ if (!newPropName) {
75526
+ return false;
75527
+ }
75528
+ const indexOfExisting = sourceObject.properties.findIndex(
75529
+ (p2) => p2.type === "ObjectProperty" && getPropertyName(p2) === newPropName
75530
+ );
75531
+ const existing = sourceObject.properties[indexOfExisting];
75532
+ if (!existing) {
75533
+ sourceObject.properties.push(newProp);
75534
+ return;
75535
+ }
75536
+ if (existing.type === "ObjectProperty" && existing.value.type === "ObjectExpression" && newProp.value.type === "ObjectExpression") {
75537
+ mergeObjectProperties(
75538
+ existing.value,
75539
+ newProp.value.properties
75540
+ );
75541
+ return;
75542
+ }
75543
+ sourceObject.properties[indexOfExisting] = newProp;
75544
+ });
75545
+ };
75546
+ var getPropertyName = (newProp) => {
75547
+ return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
75548
+ };
75549
+
75685
75550
  // templates-experimental/qwik/c3.ts
75686
- var recast3 = __toESM(require_main3());
75687
- var { npm, npx: npx2, name } = detectPackageManager();
75688
- var generate4 = async (ctx) => {
75551
+ var recast2 = __toESM(require_main3());
75552
+ var { npm, npx, name } = detectPackageManager();
75553
+ var generate3 = async (ctx) => {
75689
75554
  await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
75690
75555
  };
75691
- var configure3 = async (ctx) => {
75692
- const cmd = [name === "pnpm" ? npm : npx2, "qwik", "add", "cloudflare-pages"];
75556
+ var configure2 = async (ctx) => {
75557
+ const cmd = [name === "pnpm" ? npm : npx, "qwik", "add", "cloudflare-pages"];
75693
75558
  endSection(`Running ${quoteShellArgs(cmd)}`);
75694
75559
  await runCommand(cmd);
75695
75560
  removeFile("./public/_headers");
@@ -75705,7 +75570,7 @@ var addBindingsProxy = (ctx) => {
75705
75570
  const s = spinner();
75706
75571
  s.start("Updating `vite.config.ts`");
75707
75572
  const snippets = loadTemplateSnippets(ctx);
75708
- const b3 = recast3.types.builders;
75573
+ const b3 = recast2.types.builders;
75709
75574
  transformFile("vite.config.ts", {
75710
75575
  // Insert the env declaration after the last import (but before the rest of the body)
75711
75576
  visitProgram: function(n) {
@@ -75747,7 +75612,7 @@ var populateCloudflareEnv = () => {
75747
75612
  s.start(`Updating \`${entrypointPath}\``);
75748
75613
  transformFile(entrypointPath, {
75749
75614
  visitTSInterfaceDeclaration: function(n) {
75750
- const b3 = recast3.types.builders;
75615
+ const b3 = recast2.types.builders;
75751
75616
  const id = n.node.id;
75752
75617
  if (id.name !== "QwikCityPlatform") {
75753
75618
  this.traverse(n);
@@ -75768,7 +75633,7 @@ var populateCloudflareEnv = () => {
75768
75633
  });
75769
75634
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
75770
75635
  };
75771
- var config5 = {
75636
+ var config2 = {
75772
75637
  configVersion: 1,
75773
75638
  id: "qwik",
75774
75639
  frameworkCli: "create-qwik",
@@ -75778,8 +75643,8 @@ var config5 = {
75778
75643
  path: "./templates"
75779
75644
  },
75780
75645
  path: "templates-experimental/qwik",
75781
- generate: generate4,
75782
- configure: configure3,
75646
+ generate: generate3,
75647
+ configure: configure2,
75783
75648
  transformPackageJson: async () => ({
75784
75649
  scripts: {
75785
75650
  deploy: `${npm} run build && wrangler deploy`,
@@ -75791,49 +75656,7 @@ var config5 = {
75791
75656
  deployScript: "deploy",
75792
75657
  previewScript: "preview"
75793
75658
  };
75794
- var c3_default7 = config5;
75795
-
75796
- // templates-experimental/remix/c3.ts
75797
- var { npm: npm2 } = detectPackageManager();
75798
- var generate5 = async (ctx) => {
75799
- await runFrameworkGenerator(ctx, [
75800
- ctx.project.name,
75801
- "--template",
75802
- "https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
75803
- ]);
75804
- logRaw("");
75805
- };
75806
- var configure4 = async () => {
75807
- await installPackages(["wrangler@latest"], {
75808
- dev: true,
75809
- startText: "Updating the Wrangler version",
75810
- doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
75811
- });
75812
- };
75813
- var config6 = {
75814
- configVersion: 1,
75815
- id: "remix",
75816
- frameworkCli: "create-remix",
75817
- platform: "workers",
75818
- displayName: "Remix",
75819
- copyFiles: {
75820
- path: "./templates"
75821
- },
75822
- path: "templates-experimental/remix",
75823
- generate: generate5,
75824
- configure: configure4,
75825
- transformPackageJson: async () => ({
75826
- scripts: {
75827
- deploy: `${npm2} run build && wrangler deploy`,
75828
- preview: `${npm2} run build && wrangler dev`,
75829
- "cf-typegen": `wrangler types`
75830
- }
75831
- }),
75832
- devScript: "dev",
75833
- deployScript: "deploy",
75834
- previewScript: "preview"
75835
- };
75836
- var c3_default8 = config6;
75659
+ var c3_default3 = config2;
75837
75660
 
75838
75661
  // src/helpers/compatDate.ts
75839
75662
  var import_fs9 = require("fs");
@@ -75888,18 +75711,18 @@ function getLatestTypesEntrypoint(ctx) {
75888
75711
  }
75889
75712
 
75890
75713
  // templates-experimental/solid/c3.ts
75891
- var recast4 = __toESM(require_main3());
75892
- var { npm: npm3 } = detectPackageManager();
75893
- var generate6 = async (ctx) => {
75714
+ var recast3 = __toESM(require_main3());
75715
+ var { npm: npm2 } = detectPackageManager();
75716
+ var generate4 = async (ctx) => {
75894
75717
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
75895
75718
  logRaw("");
75896
75719
  };
75897
- var configure5 = async (ctx) => {
75720
+ var configure3 = async (ctx) => {
75898
75721
  const packages = ["nitropack"];
75899
75722
  await installPackages(packages, {
75900
75723
  dev: true,
75901
75724
  startText: "Installing nitro module `nitropack`",
75902
- doneText: `${brandColor("installed")} ${dim(`via \`${npm3} install\``)}`
75725
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm2} install\``)}`
75903
75726
  });
75904
75727
  usesTypescript(ctx);
75905
75728
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
@@ -75911,7 +75734,7 @@ var configure5 = async (ctx) => {
75911
75734
  if (callee.name !== "defineConfig") {
75912
75735
  return this.traverse(n);
75913
75736
  }
75914
- const b3 = recast4.types.builders;
75737
+ const b3 = recast3.types.builders;
75915
75738
  mergeObjectProperties(
75916
75739
  n.node.arguments[0],
75917
75740
  [
@@ -75935,7 +75758,7 @@ var configure5 = async (ctx) => {
75935
75758
  }
75936
75759
  });
75937
75760
  };
75938
- var config7 = {
75761
+ var config3 = {
75939
75762
  configVersion: 1,
75940
75763
  id: "solid",
75941
75764
  frameworkCli: "create-solid",
@@ -75945,12 +75768,12 @@ var config7 = {
75945
75768
  path: "./templates"
75946
75769
  },
75947
75770
  path: "templates-experimental/solid",
75948
- generate: generate6,
75949
- configure: configure5,
75771
+ generate: generate4,
75772
+ configure: configure3,
75950
75773
  transformPackageJson: async () => ({
75951
75774
  scripts: {
75952
- preview: `${npm3} run build && npx wrangler dev`,
75953
- deploy: `${npm3} run build && wrangler deploy`
75775
+ preview: `${npm2} run build && npx wrangler dev`,
75776
+ deploy: `${npm2} run build && wrangler deploy`
75954
75777
  }
75955
75778
  }),
75956
75779
  compatibilityFlags: ["nodejs_compat"],
@@ -75958,17 +75781,17 @@ var config7 = {
75958
75781
  deployScript: "deploy",
75959
75782
  previewScript: "preview"
75960
75783
  };
75961
- var c3_default9 = config7;
75784
+ var c3_default4 = config3;
75962
75785
 
75963
75786
  // templates-experimental/svelte/c3.ts
75964
75787
  var import_node_os3 = require("node:os");
75965
- var recast5 = __toESM(require_main3());
75966
- var { npm: npm4 } = detectPackageManager();
75967
- var generate7 = async (ctx) => {
75788
+ var recast4 = __toESM(require_main3());
75789
+ var { npm: npm3 } = detectPackageManager();
75790
+ var generate5 = async (ctx) => {
75968
75791
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
75969
75792
  logRaw("");
75970
75793
  };
75971
- var configure6 = async (ctx) => {
75794
+ var configure4 = async (ctx) => {
75972
75795
  const pkg = `@sveltejs/adapter-cloudflare`;
75973
75796
  await installPackages([pkg], {
75974
75797
  dev: true,
@@ -75995,7 +75818,7 @@ var updateTypeDefinitions = (ctx) => {
75995
75818
  return;
75996
75819
  }
75997
75820
  updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
75998
- const b3 = recast5.types.builders;
75821
+ const b3 = recast4.types.builders;
75999
75822
  transformFile("src/app.d.ts", {
76000
75823
  visitTSModuleDeclaration(n) {
76001
75824
  if (n.value.id.name === "App" && n.node.body) {
@@ -76027,7 +75850,7 @@ var updateTypeDefinitions = (ctx) => {
76027
75850
  }
76028
75851
  });
76029
75852
  };
76030
- var config8 = {
75853
+ var config4 = {
76031
75854
  configVersion: 1,
76032
75855
  id: "svelte",
76033
75856
  frameworkCli: "sv",
@@ -76037,12 +75860,12 @@ var config8 = {
76037
75860
  path: "./templates"
76038
75861
  },
76039
75862
  path: "templates-experimental/svelte",
76040
- generate: generate7,
76041
- configure: configure6,
75863
+ generate: generate5,
75864
+ configure: configure4,
76042
75865
  transformPackageJson: async (original, ctx) => {
76043
75866
  let scripts = {
76044
- preview: `${npm4} run build && wrangler dev`,
76045
- deploy: `${npm4} run build && wrangler deploy`
75867
+ preview: `${npm3} run build && wrangler dev`,
75868
+ deploy: `${npm3} run build && wrangler deploy`
76046
75869
  };
76047
75870
  if (usesTypescript(ctx)) {
76048
75871
  const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
@@ -76057,12 +75880,12 @@ var config8 = {
76057
75880
  deployScript: "deploy",
76058
75881
  previewScript: "preview"
76059
75882
  };
76060
- var c3_default10 = config8;
75883
+ var c3_default5 = config4;
76061
75884
 
76062
75885
  // templates/analog/c3.ts
76063
- var recast6 = __toESM(require_main3());
76064
- var { npm: npm5, name: pm } = detectPackageManager();
76065
- var generate8 = async (ctx) => {
75886
+ var recast5 = __toESM(require_main3());
75887
+ var { npm: npm4, name: pm } = detectPackageManager();
75888
+ var generate6 = async (ctx) => {
76066
75889
  await runFrameworkGenerator(ctx, [
76067
75890
  ctx.project.name,
76068
75891
  "--template",
@@ -76070,7 +75893,7 @@ var generate8 = async (ctx) => {
76070
75893
  ]);
76071
75894
  logRaw("");
76072
75895
  };
76073
- var configure7 = async (ctx) => {
75896
+ var configure5 = async (ctx) => {
76074
75897
  if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
76075
75898
  const packages = [];
76076
75899
  packages.push("nitropack");
@@ -76080,7 +75903,7 @@ var configure7 = async (ctx) => {
76080
75903
  await installPackages(packages, {
76081
75904
  dev: true,
76082
75905
  startText: `Installing ${packages.join(", ")}`,
76083
- doneText: `${brandColor("installed")} ${dim(`via \`${npm5} install\``)}`
75906
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm4} install\``)}`
76084
75907
  });
76085
75908
  }
76086
75909
  updateViteConfig(ctx);
@@ -76101,7 +75924,7 @@ var updateEnvTypes = (ctx) => {
76101
75924
  s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
76102
75925
  };
76103
75926
  var updateViteConfig = (ctx) => {
76104
- const b3 = recast6.types.builders;
75927
+ const b3 = recast5.types.builders;
76105
75928
  const s = spinner();
76106
75929
  const configFile = "vite.config.ts";
76107
75930
  s.start(`Updating \`${configFile}\``);
@@ -76138,7 +75961,7 @@ var updateViteConfig = (ctx) => {
76138
75961
  });
76139
75962
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76140
75963
  };
76141
- var config9 = {
75964
+ var config5 = {
76142
75965
  configVersion: 1,
76143
75966
  id: "analog",
76144
75967
  frameworkCli: "create-analog",
@@ -76147,12 +75970,12 @@ var config9 = {
76147
75970
  copyFiles: {
76148
75971
  path: "./templates"
76149
75972
  },
76150
- generate: generate8,
76151
- configure: configure7,
75973
+ generate: generate6,
75974
+ configure: configure5,
76152
75975
  transformPackageJson: async () => ({
76153
75976
  scripts: {
76154
- preview: `${npm5} run build && wrangler pages dev`,
76155
- deploy: `${npm5} run build && wrangler pages deploy`,
75977
+ preview: `${npm4} run build && wrangler pages dev`,
75978
+ deploy: `${npm4} run build && wrangler pages deploy`,
76156
75979
  "cf-typegen": `wrangler types`
76157
75980
  }
76158
75981
  }),
@@ -76160,12 +75983,12 @@ var config9 = {
76160
75983
  deployScript: "deploy",
76161
75984
  previewScript: "preview"
76162
75985
  };
76163
- var c3_default11 = config9;
75986
+ var c3_default6 = config5;
76164
75987
 
76165
75988
  // templates/angular/pages/c3.ts
76166
75989
  var import_node_path3 = require("node:path");
76167
- var { npm: npm6 } = detectPackageManager();
76168
- var generate9 = async (ctx) => {
75990
+ var { npm: npm5 } = detectPackageManager();
75991
+ var generate7 = async (ctx) => {
76169
75992
  await runFrameworkGenerator(ctx, [
76170
75993
  ctx.project.name,
76171
75994
  "--ssr",
@@ -76173,7 +75996,7 @@ var generate9 = async (ctx) => {
76173
75996
  ]);
76174
75997
  logRaw("");
76175
75998
  };
76176
- var configure8 = async (ctx) => {
75999
+ var configure6 = async (ctx) => {
76177
76000
  updateAngularJson(ctx);
76178
76001
  await updateAppCode();
76179
76002
  await installCFWorker();
@@ -76182,7 +76005,7 @@ async function installCFWorker() {
76182
76005
  await installPackages(["xhr2"], {
76183
76006
  dev: true,
76184
76007
  startText: "Installing additional dependencies",
76185
- doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
76008
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm5} install\``)}`
76186
76009
  });
76187
76010
  }
76188
76011
  async function updateAppCode() {
@@ -76224,7 +76047,7 @@ function updateAngularJson(ctx) {
76224
76047
  writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
76225
76048
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
76226
76049
  }
76227
- var config10 = {
76050
+ var config6 = {
76228
76051
  configVersion: 1,
76229
76052
  id: "angular",
76230
76053
  frameworkCli: "@angular/create",
@@ -76237,23 +76060,23 @@ var config10 = {
76237
76060
  devScript: "start",
76238
76061
  deployScript: "deploy",
76239
76062
  previewScript: "start",
76240
- generate: generate9,
76241
- configure: configure8,
76063
+ generate: generate7,
76064
+ configure: configure6,
76242
76065
  transformPackageJson: async () => ({
76243
76066
  scripts: {
76244
- start: `${npm6} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
76245
- build: `ng build && ${npm6} run process`,
76067
+ start: `${npm5} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
76068
+ build: `ng build && ${npm5} run process`,
76246
76069
  process: "node ./tools/copy-files.mjs",
76247
- deploy: `${npm6} run build && wrangler pages deploy dist/cloudflare`
76070
+ deploy: `${npm5} run build && wrangler pages deploy dist/cloudflare`
76248
76071
  }
76249
76072
  })
76250
76073
  };
76251
- var c3_default12 = config10;
76074
+ var c3_default7 = config6;
76252
76075
 
76253
76076
  // templates/angular/workers/c3.ts
76254
76077
  var import_node_path4 = require("node:path");
76255
- var { npm: npm7 } = detectPackageManager();
76256
- var generate10 = async (ctx) => {
76078
+ var { npm: npm6 } = detectPackageManager();
76079
+ var generate8 = async (ctx) => {
76257
76080
  await runFrameworkGenerator(ctx, [
76258
76081
  ctx.project.name,
76259
76082
  "--ssr",
@@ -76261,7 +76084,7 @@ var generate10 = async (ctx) => {
76261
76084
  ]);
76262
76085
  logRaw("");
76263
76086
  };
76264
- var configure9 = async (ctx) => {
76087
+ var configure7 = async (ctx) => {
76265
76088
  updateAngularJson2(ctx);
76266
76089
  await updateAppCode2();
76267
76090
  await installCFWorker2();
@@ -76270,7 +76093,7 @@ async function installCFWorker2() {
76270
76093
  await installPackages(["xhr2"], {
76271
76094
  dev: true,
76272
76095
  startText: "Installing additional dependencies",
76273
- doneText: `${brandColor("installed")} ${dim(`via \`${npm7} install\``)}`
76096
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
76274
76097
  });
76275
76098
  }
76276
76099
  async function updateAppCode2() {
@@ -76311,7 +76134,7 @@ function updateAngularJson2(ctx) {
76311
76134
  writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
76312
76135
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
76313
76136
  }
76314
- var config11 = {
76137
+ var config7 = {
76315
76138
  configVersion: 1,
76316
76139
  id: "angular",
76317
76140
  frameworkCli: "@angular/create",
@@ -76324,43 +76147,43 @@ var config11 = {
76324
76147
  devScript: "start",
76325
76148
  deployScript: "deploy",
76326
76149
  previewScript: "start",
76327
- generate: generate10,
76328
- configure: configure9,
76150
+ generate: generate8,
76151
+ configure: configure7,
76329
76152
  transformPackageJson: async () => ({
76330
76153
  scripts: {
76331
- start: `${npm7} run build && wrangler dev`,
76154
+ start: `${npm6} run build && wrangler dev`,
76332
76155
  build: `ng build`,
76333
- deploy: `${npm7} run build && wrangler deploy`
76156
+ deploy: `${npm6} run build && wrangler deploy`
76334
76157
  }
76335
76158
  })
76336
76159
  };
76337
- var c3_default13 = config11;
76160
+ var c3_default8 = config7;
76338
76161
 
76339
76162
  // templates/angular/c3.ts
76340
- var config12 = {
76163
+ var config8 = {
76341
76164
  displayName: "Angular",
76342
- platformVariants: { pages: c3_default12, workers: c3_default13 }
76165
+ platformVariants: { pages: c3_default7, workers: c3_default8 }
76343
76166
  };
76344
- var c3_default14 = config12;
76167
+ var c3_default9 = config8;
76345
76168
 
76346
- // templates/astro/c3.ts
76347
- var recast7 = __toESM(require_main3());
76348
- var { npx: npx3 } = detectPackageManager();
76349
- var generate11 = async (ctx) => {
76169
+ // templates/astro/pages/c3.ts
76170
+ var recast6 = __toESM(require_main3());
76171
+ var { npx: npx2 } = detectPackageManager();
76172
+ var generate9 = async (ctx) => {
76350
76173
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
76351
76174
  logRaw("");
76352
76175
  };
76353
- var configure10 = async () => {
76354
- await runCommand([npx3, "astro", "add", "cloudflare", "-y"], {
76176
+ var configure8 = async () => {
76177
+ await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
76355
76178
  silent: true,
76356
76179
  startText: "Installing adapter",
76357
76180
  doneText: `${brandColor("installed")} ${dim(
76358
- `via \`${npx3} astro add cloudflare\``
76181
+ `via \`${npx2} astro add cloudflare\``
76359
76182
  )}`
76360
76183
  });
76361
- updateAstroConfig2();
76184
+ updateAstroConfig();
76362
76185
  };
76363
- var updateAstroConfig2 = () => {
76186
+ var updateAstroConfig = () => {
76364
76187
  const filePath = "astro.config.mjs";
76365
76188
  updateStatus(`Updating configuration in ${blue(filePath)}`);
76366
76189
  transformFile(filePath, {
@@ -76369,7 +76192,7 @@ var updateAstroConfig2 = () => {
76369
76192
  if (callee.name !== "cloudflare") {
76370
76193
  return this.traverse(n);
76371
76194
  }
76372
- const b3 = recast7.types.builders;
76195
+ const b3 = recast6.types.builders;
76373
76196
  n.node.arguments = [
76374
76197
  b3.objectExpression([
76375
76198
  b3.objectProperty(
@@ -76384,12 +76207,13 @@ var updateAstroConfig2 = () => {
76384
76207
  }
76385
76208
  });
76386
76209
  };
76387
- var config13 = {
76210
+ var config9 = {
76388
76211
  configVersion: 1,
76389
76212
  id: "astro",
76390
76213
  frameworkCli: "create-astro",
76391
76214
  platform: "pages",
76392
76215
  displayName: "Astro",
76216
+ path: "templates/astro/pages",
76393
76217
  copyFiles: {
76394
76218
  async selectVariant(ctx) {
76395
76219
  return usesTypescript(ctx) ? "ts" : "js";
@@ -76406,8 +76230,8 @@ var config13 = {
76406
76230
  devScript: "dev",
76407
76231
  deployScript: "deploy",
76408
76232
  previewScript: "preview",
76409
- generate: generate11,
76410
- configure: configure10,
76233
+ generate: generate9,
76234
+ configure: configure8,
76411
76235
  transformPackageJson: async (pkgJson, ctx) => ({
76412
76236
  scripts: {
76413
76237
  deploy: `astro build && wrangler pages deploy`,
@@ -76416,10 +76240,93 @@ var config13 = {
76416
76240
  }
76417
76241
  })
76418
76242
  };
76419
- var c3_default15 = config13;
76243
+ var c3_default10 = config9;
76244
+
76245
+ // templates/astro/workers/c3.ts
76246
+ var recast7 = __toESM(require_main3());
76247
+ var { npx: npx3 } = detectPackageManager();
76248
+ var generate10 = async (ctx) => {
76249
+ await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
76250
+ logRaw("");
76251
+ };
76252
+ var configure9 = async () => {
76253
+ await runCommand([npx3, "astro", "add", "cloudflare", "-y"], {
76254
+ silent: true,
76255
+ startText: "Installing adapter",
76256
+ doneText: `${brandColor("installed")} ${dim(
76257
+ `via \`${npx3} astro add cloudflare\``
76258
+ )}`
76259
+ });
76260
+ updateAstroConfig2();
76261
+ };
76262
+ var updateAstroConfig2 = () => {
76263
+ const filePath = "astro.config.mjs";
76264
+ updateStatus(`Updating configuration in ${blue(filePath)}`);
76265
+ transformFile(filePath, {
76266
+ visitCallExpression: function(n) {
76267
+ const callee = n.node.callee;
76268
+ if (callee.name !== "cloudflare") {
76269
+ return this.traverse(n);
76270
+ }
76271
+ const b3 = recast7.types.builders;
76272
+ n.node.arguments = [
76273
+ b3.objectExpression([
76274
+ b3.objectProperty(
76275
+ b3.identifier("platformProxy"),
76276
+ b3.objectExpression([
76277
+ b3.objectProperty(b3.identifier("enabled"), b3.booleanLiteral(true))
76278
+ ])
76279
+ )
76280
+ ])
76281
+ ];
76282
+ return false;
76283
+ }
76284
+ });
76285
+ };
76286
+ var config10 = {
76287
+ configVersion: 1,
76288
+ id: "astro",
76289
+ frameworkCli: "create-astro",
76290
+ platform: "workers",
76291
+ displayName: "Astro",
76292
+ copyFiles: {
76293
+ async selectVariant(ctx) {
76294
+ return usesTypescript(ctx) ? "ts" : "js";
76295
+ },
76296
+ variants: {
76297
+ js: {
76298
+ path: "./templates/js"
76299
+ },
76300
+ ts: {
76301
+ path: "./templates/ts"
76302
+ }
76303
+ }
76304
+ },
76305
+ devScript: "dev",
76306
+ deployScript: "deploy",
76307
+ previewScript: "preview",
76308
+ path: "templates/astro/workers",
76309
+ generate: generate10,
76310
+ configure: configure9,
76311
+ transformPackageJson: async (pkgJson, ctx) => ({
76312
+ scripts: {
76313
+ deploy: `astro build && wrangler deploy`,
76314
+ preview: `astro build && wrangler dev`,
76315
+ ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
76316
+ }
76317
+ })
76318
+ };
76319
+ var c3_default11 = config10;
76320
+
76321
+ // templates/astro/c3.ts
76322
+ var config11 = {
76323
+ displayName: "Astro",
76324
+ platformVariants: { pages: c3_default10, workers: c3_default11 }
76325
+ };
76326
+ var c3_default12 = config11;
76420
76327
 
76421
76328
  // templates/common/c3.ts
76422
- var c3_default16 = {
76329
+ var c3_default13 = {
76423
76330
  configVersion: 1,
76424
76331
  id: "common",
76425
76332
  displayName: "Example router & proxy Worker",
@@ -76439,36 +76346,36 @@ var c3_default16 = {
76439
76346
  };
76440
76347
 
76441
76348
  // templates/docusaurus/pages/c3.ts
76442
- var { npm: npm8 } = detectPackageManager();
76443
- var generate12 = async (ctx) => {
76349
+ var { npm: npm7 } = detectPackageManager();
76350
+ var generate11 = async (ctx) => {
76444
76351
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
76445
76352
  };
76446
- var config14 = {
76353
+ var config12 = {
76447
76354
  configVersion: 1,
76448
76355
  id: "docusaurus",
76449
76356
  frameworkCli: "create-docusaurus",
76450
76357
  platform: "pages",
76451
76358
  displayName: "Docusaurus",
76452
76359
  path: "templates/docusaurus/pages",
76453
- generate: generate12,
76360
+ generate: generate11,
76454
76361
  transformPackageJson: async () => ({
76455
76362
  scripts: {
76456
- preview: `${npm8} run build && wrangler pages dev ./build`,
76457
- deploy: `${npm8} run build && wrangler pages deploy ./build`
76363
+ preview: `${npm7} run build && wrangler pages dev ./build`,
76364
+ deploy: `${npm7} run build && wrangler pages deploy ./build`
76458
76365
  }
76459
76366
  }),
76460
76367
  devScript: "preview",
76461
76368
  deployScript: "deploy",
76462
76369
  previewScript: "preview"
76463
76370
  };
76464
- var c3_default17 = config14;
76371
+ var c3_default14 = config12;
76465
76372
 
76466
76373
  // templates/docusaurus/workers/c3.ts
76467
- var { npm: npm9 } = detectPackageManager();
76468
- var generate13 = async (ctx) => {
76374
+ var { npm: npm8 } = detectPackageManager();
76375
+ var generate12 = async (ctx) => {
76469
76376
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
76470
76377
  };
76471
- var config15 = {
76378
+ var config13 = {
76472
76379
  configVersion: 1,
76473
76380
  id: "docusaurus",
76474
76381
  frameworkCli: "create-docusaurus",
@@ -76478,29 +76385,29 @@ var config15 = {
76478
76385
  path: "./templates"
76479
76386
  },
76480
76387
  path: "templates/docusaurus/workers",
76481
- generate: generate13,
76388
+ generate: generate12,
76482
76389
  transformPackageJson: async () => ({
76483
76390
  scripts: {
76484
- deploy: `${npm9} run build && wrangler deploy`,
76485
- preview: `${npm9} run build && wrangler dev`
76391
+ deploy: `${npm8} run build && wrangler deploy`,
76392
+ preview: `${npm8} run build && wrangler dev`
76486
76393
  }
76487
76394
  }),
76488
76395
  devScript: "start",
76489
76396
  deployScript: "deploy",
76490
76397
  previewScript: "preview"
76491
76398
  };
76492
- var c3_default18 = config15;
76399
+ var c3_default15 = config13;
76493
76400
 
76494
76401
  // templates/docusaurus/c3.ts
76495
- var config16 = {
76402
+ var config14 = {
76496
76403
  displayName: "Docusaurus",
76497
- platformVariants: { pages: c3_default17, workers: c3_default18 }
76404
+ platformVariants: { pages: c3_default14, workers: c3_default15 }
76498
76405
  };
76499
- var c3_default19 = config16;
76406
+ var c3_default16 = config14;
76500
76407
 
76501
76408
  // templates/gatsby/pages/c3.ts
76502
- var { npm: npm10 } = detectPackageManager();
76503
- var generate14 = async (ctx) => {
76409
+ var { npm: npm9 } = detectPackageManager();
76410
+ var generate13 = async (ctx) => {
76504
76411
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
76505
76412
  const useTemplate = await inputPrompt({
76506
76413
  type: "confirm",
@@ -76519,29 +76426,29 @@ var generate14 = async (ctx) => {
76519
76426
  }
76520
76427
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
76521
76428
  };
76522
- var config17 = {
76429
+ var config15 = {
76523
76430
  configVersion: 1,
76524
76431
  id: "gatsby",
76525
76432
  frameworkCli: "gatsby",
76526
76433
  platform: "pages",
76527
76434
  displayName: "Gatsby",
76528
76435
  path: "templates/gatsby/pages",
76529
- generate: generate14,
76436
+ generate: generate13,
76530
76437
  transformPackageJson: async () => ({
76531
76438
  scripts: {
76532
- deploy: `${npm10} run build && wrangler pages deploy ./public`,
76533
- preview: `${npm10} run build && wrangler pages dev ./public`
76439
+ deploy: `${npm9} run build && wrangler pages deploy ./public`,
76440
+ preview: `${npm9} run build && wrangler pages dev ./public`
76534
76441
  }
76535
76442
  }),
76536
76443
  devScript: "develop",
76537
76444
  deployScript: "deploy",
76538
76445
  previewScript: "preview"
76539
76446
  };
76540
- var c3_default20 = config17;
76447
+ var c3_default17 = config15;
76541
76448
 
76542
76449
  // templates/gatsby/workers/c3.ts
76543
- var { npm: npm11 } = detectPackageManager();
76544
- var generate15 = async (ctx) => {
76450
+ var { npm: npm10 } = detectPackageManager();
76451
+ var generate14 = async (ctx) => {
76545
76452
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
76546
76453
  const useTemplate = await inputPrompt({
76547
76454
  type: "confirm",
@@ -76560,7 +76467,7 @@ var generate15 = async (ctx) => {
76560
76467
  }
76561
76468
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
76562
76469
  };
76563
- var config18 = {
76470
+ var config16 = {
76564
76471
  configVersion: 1,
76565
76472
  id: "gatsby",
76566
76473
  frameworkCli: "gatsby",
@@ -76570,32 +76477,67 @@ var config18 = {
76570
76477
  path: "./templates"
76571
76478
  },
76572
76479
  path: "templates/gatsby/workers",
76573
- generate: generate15,
76480
+ generate: generate14,
76574
76481
  transformPackageJson: async () => ({
76575
76482
  scripts: {
76576
- deploy: `${npm11} run build && wrangler deploy`,
76577
- preview: `${npm11} run build && wrangler dev`
76483
+ deploy: `${npm10} run build && wrangler deploy`,
76484
+ preview: `${npm10} run build && wrangler dev`
76578
76485
  }
76579
76486
  }),
76580
76487
  devScript: "develop",
76581
76488
  deployScript: "deploy",
76582
76489
  previewScript: "preview"
76583
76490
  };
76584
- var c3_default21 = config18;
76491
+ var c3_default18 = config16;
76585
76492
 
76586
76493
  // templates/gatsby/c3.ts
76587
- var config19 = {
76494
+ var config17 = {
76588
76495
  displayName: "Gatsby",
76589
- platformVariants: { pages: c3_default20, workers: c3_default21 }
76496
+ platformVariants: { pages: c3_default17, workers: c3_default18 }
76497
+ };
76498
+ var c3_default19 = config17;
76499
+
76500
+ // templates/hello-world-assets-only/c3.ts
76501
+ var config18 = {
76502
+ configVersion: 1,
76503
+ id: "hello-world-assets-only",
76504
+ path: "templates/hello-world-assets-only",
76505
+ displayName: "Assets only",
76506
+ description: "For static sites (including SPAs) or when using your own backend",
76507
+ platform: "workers",
76508
+ copyFiles: {
76509
+ path: "./templates"
76510
+ }
76511
+ };
76512
+ var c3_default20 = config18;
76513
+
76514
+ // templates/hello-world-durable-object-with-assets/c3.ts
76515
+ var config19 = {
76516
+ configVersion: 1,
76517
+ id: "hello-world-durable-object-with-assets",
76518
+ path: "templates/hello-world-durable-object-with-assets",
76519
+ displayName: "Worker + Durable Objects + Assets",
76520
+ description: "For full-stack applications requiring static assets, an API, and real-time coordination",
76521
+ platform: "workers",
76522
+ copyFiles: {
76523
+ variants: {
76524
+ js: {
76525
+ path: "./js"
76526
+ },
76527
+ ts: {
76528
+ path: "./ts"
76529
+ }
76530
+ }
76531
+ }
76590
76532
  };
76591
- var c3_default22 = config19;
76533
+ var c3_default21 = config19;
76592
76534
 
76593
76535
  // templates/hello-world-durable-object/c3.ts
76594
- var c3_default23 = {
76536
+ var c3_default22 = {
76595
76537
  configVersion: 1,
76596
76538
  id: "hello-world-durable-object",
76597
- displayName: "Hello World Worker Using Durable Objects",
76598
- description: "Get started with a basic stateful app to build projects like real-time chats, collaborative apps, and multiplayer games",
76539
+ displayName: "Worker + Durable Objects",
76540
+ description: "For multiplayer apps using WebSockets, or when you need synchronization",
76599
76541
  platform: "workers",
76600
76542
  copyFiles: {
76601
76543
  variants: {
@@ -76609,14 +76551,37 @@ var c3_default23 = {
76609
76551
  }
76610
76552
  };
76611
76553
 
76554
+ // templates/hello-world-with-assets/c3.ts
76555
+ var c3_default23 = {
76556
+ configVersion: 1,
76557
+ id: "hello-world-with-assets",
76558
+ path: "templates/hello-world-with-assets",
76559
+ displayName: "Worker + Assets",
76560
+ description: "For static sites with an API or server-side rendering (SSR)",
76561
+ platform: "workers",
76562
+ copyFiles: {
76563
+ variants: {
76564
+ js: {
76565
+ path: "./js"
76566
+ },
76567
+ ts: {
76568
+ path: "./ts"
76569
+ },
76570
+ python: {
76571
+ path: "./py"
76572
+ }
76573
+ }
76574
+ }
76575
+ };
76576
+
76612
76577
  // templates/hello-world/c3.ts
76613
76578
  var import_promises2 = require("node:fs/promises");
76614
76579
  var import_node_path5 = require("node:path");
76615
76580
  var c3_default24 = {
76616
76581
  configVersion: 1,
76617
76582
  id: "hello-world",
76618
- displayName: "Hello World Worker",
76619
- description: "Get started with a basic Worker in the language of your choice",
76583
+ displayName: "Worker only",
76584
+ description: "For processing requests, transforming responses, or API endpoints",
76620
76585
  platform: "workers",
76621
76586
  async configure(ctx) {
76622
76587
  if (ctx.args.lang === "python") {
@@ -76646,7 +76611,7 @@ var c3_default24 = {
76646
76611
  };
76647
76612
 
76648
76613
  // templates/hono/c3.ts
76649
- var generate16 = async (ctx) => {
76614
+ var generate15 = async (ctx) => {
76650
76615
  const { name: pm4 } = detectPackageManager();
76651
76616
  await runFrameworkGenerator(ctx, [
76652
76617
  ctx.project.name,
@@ -76658,7 +76623,7 @@ var generate16 = async (ctx) => {
76658
76623
  ]);
76659
76624
  logRaw("");
76660
76625
  };
76661
- var configure11 = async (ctx) => {
76626
+ var configure10 = async (ctx) => {
76662
76627
  const indexFile = "src/index.ts";
76663
76628
  const s = spinner();
76664
76629
  s.start(`Updating \`${indexFile}\``);
@@ -76682,8 +76647,8 @@ var config20 = {
76682
76647
  path: "./templates"
76683
76648
  },
76684
76649
  platform: "workers",
76685
- generate: generate16,
76686
- configure: configure11,
76650
+ generate: generate15,
76651
+ configure: configure10,
76687
76652
  transformPackageJson: async () => ({
76688
76653
  scripts: {
76689
76654
  dev: "wrangler dev",
@@ -76699,8 +76664,8 @@ var c3_default25 = config20;
76699
76664
 
76700
76665
  // templates/next/c3.ts
76701
76666
  var import_path10 = require("path");
76702
- var { npm: npm12, npx: npx4 } = detectPackageManager();
76703
- var generate17 = async (ctx) => {
76667
+ var { npm: npm11, npx: npx4 } = detectPackageManager();
76668
+ var generate16 = async (ctx) => {
76704
76669
  const projectName = ctx.project.name;
76705
76670
  await runFrameworkGenerator(ctx, [projectName]);
76706
76671
  const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
@@ -76725,7 +76690,7 @@ var updateNextConfig2 = (usesTs) => {
76725
76690
  writeFile2(configFile, updatedConfigFile);
76726
76691
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76727
76692
  };
76728
- var configure12 = async (ctx) => {
76693
+ var configure11 = async (ctx) => {
76729
76694
  const projectPath = ctx.project.path;
76730
76695
  const path6 = probePaths([
76731
76696
  `${projectPath}/pages/api`,
@@ -76806,8 +76771,8 @@ var c3_default26 = {
76806
76771
  frameworkCli: "create-next-app",
76807
76772
  platform: "pages",
76808
76773
  displayName: "Next.js",
76809
- generate: generate17,
76810
- configure: configure12,
76774
+ generate: generate16,
76775
+ configure: configure11,
76811
76776
  copyFiles: {
76812
76777
  async selectVariant(ctx) {
76813
76778
  const isApp = probePaths([
@@ -76838,12 +76803,12 @@ var c3_default26 = {
76838
76803
  }
76839
76804
  },
76840
76805
  transformPackageJson: async (_3, ctx) => {
76841
- const isNpm = npm12 === "npm";
76842
- const isBun = npm12 === "bun";
76806
+ const isNpm = npm11 === "npm";
76807
+ const isBun = npm11 === "bun";
76843
76808
  const isNpmOrBun = isNpm || isBun;
76844
76809
  const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
76845
76810
  const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
76846
- const pmCommand = isNpmOrBun ? npx4 : npm12;
76811
+ const pmCommand = isNpmOrBun ? npx4 : npm11;
76847
76812
  const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
76848
76813
  return {
76849
76814
  scripts: {
@@ -76864,20 +76829,20 @@ var c3_default26 = {
76864
76829
 
76865
76830
  // templates/nuxt/pages/c3.ts
76866
76831
  var recast8 = __toESM(require_main3());
76867
- var { npm: npm13, name: pm2 } = detectPackageManager();
76868
- var generate18 = async (ctx) => {
76832
+ var { npm: npm12, name: pm2 } = detectPackageManager();
76833
+ var generate17 = async (ctx) => {
76869
76834
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
76870
76835
  await runFrameworkGenerator(ctx, [
76871
76836
  "init",
76872
76837
  ctx.project.name,
76873
76838
  "--packageManager",
76874
- npm13,
76839
+ npm12,
76875
76840
  gitFlag
76876
76841
  ]);
76877
76842
  writeFile2("./.node-version", "18");
76878
76843
  logRaw("");
76879
76844
  };
76880
- var configure13 = async (ctx) => {
76845
+ var configure12 = async (ctx) => {
76881
76846
  const packages = ["nitro-cloudflare-dev"];
76882
76847
  if (pm2 === "pnpm") {
76883
76848
  packages.push("h3");
@@ -76885,7 +76850,7 @@ var configure13 = async (ctx) => {
76885
76850
  await installPackages(packages, {
76886
76851
  dev: true,
76887
76852
  startText: "Installing nitro module `nitro-cloudflare-dev`",
76888
- doneText: `${brandColor("installed")} ${dim(`via \`${npm13} install\``)}`
76853
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm12} install\``)}`
76889
76854
  });
76890
76855
  updateNuxtConfig();
76891
76856
  updateEnvTypes2(ctx);
@@ -76956,12 +76921,12 @@ var config21 = {
76956
76921
  path: "./templates"
76957
76922
  },
76958
76923
  path: "templates/nuxt/pages",
76959
- generate: generate18,
76960
- configure: configure13,
76924
+ generate: generate17,
76925
+ configure: configure12,
76961
76926
  transformPackageJson: async () => ({
76962
76927
  scripts: {
76963
- deploy: `${npm13} run build && wrangler pages deploy`,
76964
- preview: `${npm13} run build && wrangler pages dev`,
76928
+ deploy: `${npm12} run build && wrangler pages deploy`,
76929
+ preview: `${npm12} run build && wrangler pages dev`,
76965
76930
  "cf-typegen": `wrangler types`
76966
76931
  }
76967
76932
  }),
@@ -76973,20 +76938,20 @@ var c3_default27 = config21;
76973
76938
 
76974
76939
  // templates/nuxt/workers/c3.ts
76975
76940
  var recast9 = __toESM(require_main3());
76976
- var { npm: npm14, name: pm3 } = detectPackageManager();
76977
- var generate19 = async (ctx) => {
76941
+ var { npm: npm13, name: pm3 } = detectPackageManager();
76942
+ var generate18 = async (ctx) => {
76978
76943
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
76979
76944
  await runFrameworkGenerator(ctx, [
76980
76945
  "init",
76981
76946
  ctx.project.name,
76982
76947
  "--packageManager",
76983
- npm14,
76948
+ npm13,
76984
76949
  gitFlag
76985
76950
  ]);
76986
76951
  writeFile2("./.node-version", "18");
76987
76952
  logRaw("");
76988
76953
  };
76989
- var configure14 = async (ctx) => {
76954
+ var configure13 = async (ctx) => {
76990
76955
  const packages = ["nitro-cloudflare-dev", "nitropack"];
76991
76956
  if (pm3 === "pnpm") {
76992
76957
  packages.push("h3");
@@ -76994,7 +76959,7 @@ var configure14 = async (ctx) => {
76994
76959
  await installPackages(packages, {
76995
76960
  dev: true,
76996
76961
  startText: "Installing nitro module `nitro-cloudflare-dev`",
76997
- doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
76962
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm13} install\``)}`
76998
76963
  });
76999
76964
  updateNuxtConfig2();
77000
76965
  updateEnvTypes3(ctx);
@@ -77065,12 +77030,12 @@ var config22 = {
77065
77030
  path: "./templates"
77066
77031
  },
77067
77032
  path: "templates/nuxt/workers",
77068
- generate: generate19,
77069
- configure: configure14,
77033
+ generate: generate18,
77034
+ configure: configure13,
77070
77035
  transformPackageJson: async () => ({
77071
77036
  scripts: {
77072
- deploy: `${npm14} run build && wrangler deploy`,
77073
- preview: `${npm14} run build && wrangler dev`,
77037
+ deploy: `${npm13} run build && wrangler deploy`,
77038
+ preview: `${npm13} run build && wrangler dev`,
77074
77039
  "cf-typegen": `wrangler types`
77075
77040
  }
77076
77041
  }),
@@ -77305,12 +77270,12 @@ var c3_default32 = {
77305
77270
 
77306
77271
  // templates/qwik/c3.ts
77307
77272
  var recast10 = __toESM(require_main3());
77308
- var { npm: npm15, npx: npx5, name: name2 } = detectPackageManager();
77309
- var generate20 = async (ctx) => {
77273
+ var { npm: npm14, npx: npx5, name: name2 } = detectPackageManager();
77274
+ var generate19 = async (ctx) => {
77310
77275
  await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
77311
77276
  };
77312
- var configure15 = async (ctx) => {
77313
- const cmd = [name2 === "pnpm" ? npm15 : npx5, "qwik", "add", "cloudflare-pages"];
77277
+ var configure14 = async (ctx) => {
77278
+ const cmd = [name2 === "pnpm" ? npm14 : npx5, "qwik", "add", "cloudflare-pages"];
77314
77279
  endSection(`Running ${quoteShellArgs(cmd)}`);
77315
77280
  await runCommand(cmd);
77316
77281
  addBindingsProxy2(ctx);
@@ -77395,12 +77360,12 @@ var config24 = {
77395
77360
  copyFiles: {
77396
77361
  path: "./templates"
77397
77362
  },
77398
- generate: generate20,
77399
- configure: configure15,
77363
+ generate: generate19,
77364
+ configure: configure14,
77400
77365
  transformPackageJson: async () => ({
77401
77366
  scripts: {
77402
- deploy: `${npm15} run build && wrangler pages deploy`,
77403
- preview: `${npm15} run build && wrangler pages dev`,
77367
+ deploy: `${npm14} run build && wrangler pages deploy`,
77368
+ preview: `${npm14} run build && wrangler pages dev`,
77404
77369
  "cf-typegen": `wrangler types`
77405
77370
  }
77406
77371
  }),
@@ -77411,8 +77376,8 @@ var config24 = {
77411
77376
  var c3_default33 = config24;
77412
77377
 
77413
77378
  // templates/react/pages/c3.ts
77414
- var { npm: npm16 } = detectPackageManager();
77415
- var generate21 = async (ctx) => {
77379
+ var { npm: npm15 } = detectPackageManager();
77380
+ var generate20 = async (ctx) => {
77416
77381
  const variant = await inputPrompt({
77417
77382
  type: "select",
77418
77383
  question: "Select a variant:",
@@ -77449,11 +77414,11 @@ var config25 = {
77449
77414
  displayName: "React",
77450
77415
  platform: "pages",
77451
77416
  path: "templates/react/pages",
77452
- generate: generate21,
77417
+ generate: generate20,
77453
77418
  transformPackageJson: async () => ({
77454
77419
  scripts: {
77455
- deploy: `${npm16} run build && wrangler pages deploy ./dist`,
77456
- preview: `${npm16} run build && wrangler pages dev ./dist`
77420
+ deploy: `${npm15} run build && wrangler pages deploy ./dist`,
77421
+ preview: `${npm15} run build && wrangler pages dev ./dist`
77457
77422
  }
77458
77423
  }),
77459
77424
  devScript: "dev",
@@ -77467,8 +77432,8 @@ var import_assert2 = __toESM(require("assert"));
77467
77432
  var recast11 = __toESM(require_main3());
77468
77433
  var b2 = recast11.types.builders;
77469
77434
  var t = recast11.types.namedTypes;
77470
- var { npm: npm17 } = detectPackageManager();
77471
- var generate22 = async (ctx) => {
77435
+ var { npm: npm16 } = detectPackageManager();
77436
+ var generate21 = async (ctx) => {
77472
77437
  const variant = await getVariant();
77473
77438
  ctx.args.lang = variant.lang;
77474
77439
  await runFrameworkGenerator(ctx, [
@@ -77478,7 +77443,7 @@ var generate22 = async (ctx) => {
77478
77443
  ]);
77479
77444
  logRaw("");
77480
77445
  };
77481
- var configure16 = async (ctx) => {
77446
+ var configure15 = async (ctx) => {
77482
77447
  await installPackages(["@cloudflare/vite-plugin"], {
77483
77448
  dev: true,
77484
77449
  startText: "Installing the Cloudflare Vite plugin",
@@ -77509,9 +77474,9 @@ function transformViteConfig(ctx) {
77509
77474
  if (callee.name !== "defineConfig") {
77510
77475
  return this.traverse(n);
77511
77476
  }
77512
- const config34 = n.node.arguments[0];
77513
- (0, import_assert2.default)(t.ObjectExpression.check(config34));
77514
- const pluginsProp = config34.properties.find((prop) => isPluginsProp(prop));
77477
+ const config36 = n.node.arguments[0];
77478
+ (0, import_assert2.default)(t.ObjectExpression.check(config36));
77479
+ const pluginsProp = config36.properties.find((prop) => isPluginsProp(prop));
77515
77480
  (0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
77516
77481
  pluginsProp.value.elements.push(
77517
77482
  b2.callExpression(b2.identifier("cloudflare"), [])
@@ -77585,12 +77550,12 @@ var config26 = {
77585
77550
  }
77586
77551
  }
77587
77552
  },
77588
- generate: generate22,
77589
- configure: configure16,
77553
+ generate: generate21,
77554
+ configure: configure15,
77590
77555
  transformPackageJson: async (_3, ctx) => ({
77591
77556
  scripts: {
77592
- deploy: `${npm17} run build && wrangler deploy`,
77593
- preview: `${npm17} run build && vite preview`,
77557
+ deploy: `${npm16} run build && wrangler deploy`,
77558
+ preview: `${npm16} run build && vite preview`,
77594
77559
  ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
77595
77560
  }
77596
77561
  }),
@@ -77607,9 +77572,9 @@ var config27 = {
77607
77572
  };
77608
77573
  var c3_default36 = config27;
77609
77574
 
77610
- // templates/remix/c3.ts
77611
- var { npm: npm18 } = detectPackageManager();
77612
- var generate23 = async (ctx) => {
77575
+ // templates/remix/pages/c3.ts
77576
+ var { npm: npm17 } = detectPackageManager();
77577
+ var generate22 = async (ctx) => {
77613
77578
  await runFrameworkGenerator(ctx, [
77614
77579
  ctx.project.name,
77615
77580
  "--template",
@@ -77617,7 +77582,7 @@ var generate23 = async (ctx) => {
77617
77582
  ]);
77618
77583
  logRaw("");
77619
77584
  };
77620
- var configure17 = async () => {
77585
+ var configure16 = async () => {
77621
77586
  const typeDefsPath = "load-context.ts";
77622
77587
  const s = spinner();
77623
77588
  s.start(`Updating \`${typeDefsPath}\``);
@@ -77641,12 +77606,55 @@ var config28 = {
77641
77606
  copyFiles: {
77642
77607
  path: "./templates"
77643
77608
  },
77609
+ path: "templates/remix/pages",
77610
+ generate: generate22,
77611
+ configure: configure16,
77612
+ transformPackageJson: async () => ({
77613
+ scripts: {
77614
+ deploy: `${npm17} run build && wrangler pages deploy`,
77615
+ preview: `${npm17} run build && wrangler pages dev`,
77616
+ "cf-typegen": `wrangler types`
77617
+ }
77618
+ }),
77619
+ devScript: "dev",
77620
+ deployScript: "deploy",
77621
+ previewScript: "preview"
77622
+ };
77623
+ var c3_default37 = config28;
77624
+
77625
+ // templates/remix/workers/c3.ts
77626
+ var { npm: npm18 } = detectPackageManager();
77627
+ var generate23 = async (ctx) => {
77628
+ await runFrameworkGenerator(ctx, [
77629
+ ctx.project.name,
77630
+ "--template",
77631
+ "https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
77632
+ ]);
77633
+ logRaw("");
77634
+ };
77635
+ var configure17 = async () => {
77636
+ await installPackages(["wrangler@latest"], {
77637
+ dev: true,
77638
+ startText: "Updating the Wrangler version",
77639
+ doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
77640
+ });
77641
+ };
77642
+ var config29 = {
77643
+ configVersion: 1,
77644
+ id: "remix",
77645
+ frameworkCli: "create-remix",
77646
+ platform: "workers",
77647
+ displayName: "Remix",
77648
+ copyFiles: {
77649
+ path: "./templates"
77650
+ },
77651
+ path: "templates/remix/workers",
77644
77652
  generate: generate23,
77645
77653
  configure: configure17,
77646
77654
  transformPackageJson: async () => ({
77647
77655
  scripts: {
77648
- deploy: `${npm18} run build && wrangler pages deploy`,
77649
- preview: `${npm18} run build && wrangler pages dev`,
77656
+ deploy: `${npm18} run build && wrangler deploy`,
77657
+ preview: `${npm18} run build && wrangler dev`,
77650
77658
  "cf-typegen": `wrangler types`
77651
77659
  }
77652
77660
  }),
@@ -77654,10 +77662,17 @@ var config28 = {
77654
77662
  deployScript: "deploy",
77655
77663
  previewScript: "preview"
77656
77664
  };
77657
- var c3_default37 = config28;
77665
+ var c3_default38 = config29;
77666
+
77667
+ // templates/remix/c3.ts
77668
+ var config30 = {
77669
+ displayName: "Remix",
77670
+ platformVariants: { pages: c3_default37, workers: c3_default38 }
77671
+ };
77672
+ var c3_default39 = config30;
77658
77673
 
77659
77674
  // templates/scheduled/c3.ts
77660
- var c3_default38 = {
77675
+ var c3_default40 = {
77661
77676
  configVersion: 1,
77662
77677
  id: "scheduled",
77663
77678
  displayName: "Scheduled Worker (Cron Trigger)",
@@ -77720,7 +77735,7 @@ var configure18 = async (ctx) => {
77720
77735
  }
77721
77736
  });
77722
77737
  };
77723
- var config29 = {
77738
+ var config31 = {
77724
77739
  configVersion: 1,
77725
77740
  id: "solid",
77726
77741
  frameworkCli: "create-solid",
@@ -77742,7 +77757,7 @@ var config29 = {
77742
77757
  deployScript: "deploy",
77743
77758
  previewScript: "preview"
77744
77759
  };
77745
- var c3_default39 = config29;
77760
+ var c3_default41 = config31;
77746
77761
 
77747
77762
  // templates/svelte/c3.ts
77748
77763
  var import_node_fs3 = require("node:fs");
@@ -77835,7 +77850,7 @@ var updateTypeDefinitions2 = (ctx) => {
77835
77850
  }
77836
77851
  });
77837
77852
  };
77838
- var config30 = {
77853
+ var config32 = {
77839
77854
  configVersion: 1,
77840
77855
  id: "svelte",
77841
77856
  frameworkCli: "sv",
@@ -77864,14 +77879,14 @@ var config30 = {
77864
77879
  deployScript: "deploy",
77865
77880
  previewScript: "preview"
77866
77881
  };
77867
- var c3_default40 = config30;
77882
+ var c3_default42 = config32;
77868
77883
 
77869
77884
  // templates/vue/pages/c3.ts
77870
77885
  var { npm: npm21 } = detectPackageManager();
77871
77886
  var generate26 = async (ctx) => {
77872
77887
  await runFrameworkGenerator(ctx, [ctx.project.name]);
77873
77888
  };
77874
- var config31 = {
77889
+ var config33 = {
77875
77890
  configVersion: 1,
77876
77891
  id: "vue",
77877
77892
  frameworkCli: "create-vue",
@@ -77889,7 +77904,7 @@ var config31 = {
77889
77904
  deployScript: "deploy",
77890
77905
  previewScript: "preview"
77891
77906
  };
77892
- var c3_default41 = config31;
77907
+ var c3_default43 = config33;
77893
77908
 
77894
77909
  // templates/vue/workers/c3.ts
77895
77910
  var { npm: npm22 } = detectPackageManager();
@@ -77931,7 +77946,7 @@ function updateTsconfigJson2() {
77931
77946
  writeJSON("tsconfig.json", tsconfig);
77932
77947
  s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
77933
77948
  }
77934
- var config32 = {
77949
+ var config34 = {
77935
77950
  configVersion: 1,
77936
77951
  id: "vue",
77937
77952
  frameworkCli: "create-vue",
@@ -77964,20 +77979,20 @@ var config32 = {
77964
77979
  deployScript: "deploy",
77965
77980
  previewScript: "preview"
77966
77981
  };
77967
- var c3_default42 = config32;
77982
+ var c3_default44 = config34;
77968
77983
 
77969
77984
  // templates/vue/c3.ts
77970
- var config33 = {
77985
+ var config35 = {
77971
77986
  displayName: "Vue",
77972
- platformVariants: { pages: c3_default41, workers: c3_default42 }
77987
+ platformVariants: { pages: c3_default43, workers: c3_default44 }
77973
77988
  };
77974
- var c3_default43 = config33;
77989
+ var c3_default45 = config35;
77975
77990
 
77976
77991
  // src/git.ts
77977
77992
  var import_node_assert = __toESM(require("node:assert"));
77978
77993
 
77979
77994
  // ../wrangler/package.json
77980
- var version2 = "0.0.0-62a4ae6c5";
77995
+ var version2 = "0.0.0-62d5471ea";
77981
77996
 
77982
77997
  // src/git.ts
77983
77998
  var offerGit = async (ctx) => {
@@ -78238,47 +78253,44 @@ var defaultSelectVariant = async (ctx) => {
78238
78253
  function getFrameworkMap({ experimental = false }) {
78239
78254
  if (experimental) {
78240
78255
  return {
78241
- astro: c3_default,
78242
- hono: c3_default5,
78243
- next: c3_default6,
78244
- qwik: c3_default7,
78245
- remix: c3_default8,
78246
- solid: c3_default9,
78247
- svelte: c3_default10
78256
+ hono: c3_default,
78257
+ next: c3_default2,
78258
+ qwik: c3_default3,
78259
+ solid: c3_default4,
78260
+ svelte: c3_default5
78248
78261
  };
78249
78262
  } else {
78250
78263
  return {
78251
- analog: c3_default11,
78252
- angular: c3_default14,
78253
- astro: c3_default15,
78254
- docusaurus: c3_default19,
78255
- gatsby: c3_default22,
78264
+ analog: c3_default6,
78265
+ angular: c3_default9,
78266
+ astro: c3_default12,
78267
+ docusaurus: c3_default16,
78268
+ gatsby: c3_default19,
78256
78269
  hono: c3_default25,
78257
78270
  next: c3_default26,
78258
78271
  nuxt: c3_default29,
78259
78272
  qwik: c3_default33,
78260
78273
  react: c3_default36,
78261
- remix: c3_default37,
78262
- solid: c3_default39,
78263
- svelte: c3_default40,
78264
- vue: c3_default43
78274
+ remix: c3_default39,
78275
+ solid: c3_default41,
78276
+ svelte: c3_default42,
78277
+ vue: c3_default45
78265
78278
  };
78266
78279
  }
78267
78280
  }
78268
78281
  function getTemplateMap({ experimental = false }) {
78269
78282
  if (experimental) {
78270
- return {
78271
- "hello-world-assets-only": c3_default2,
78272
- "hello-world-with-assets": c3_default4,
78273
- "hello-world-durable-object-with-assets": c3_default3
78274
- };
78283
+ return {};
78275
78284
  } else {
78276
78285
  return {
78277
78286
  "hello-world": c3_default24,
78278
- common: c3_default16,
78279
- scheduled: c3_default38,
78287
+ "hello-world-assets-only": c3_default20,
78288
+ "hello-world-with-assets": c3_default23,
78289
+ "hello-world-durable-object": c3_default22,
78290
+ "hello-world-durable-object-with-assets": c3_default21,
78291
+ common: c3_default13,
78292
+ scheduled: c3_default40,
78280
78293
  queues: c3_default32,
78281
- "hello-world-durable-object": c3_default23,
78282
78294
  openapi: c3_default30,
78283
78295
  "pre-existing": c3_default31
78284
78296
  };
@@ -78388,9 +78400,9 @@ var createContext = async (args, prevArgs) => {
78388
78400
  });
78389
78401
  const categoryOptions = [
78390
78402
  {
78391
- label: "Hello World example",
78403
+ label: "Hello World Starter",
78392
78404
  value: "hello-world",
78393
- description: "Select from barebones examples to get started with Workers"
78405
+ description: "Select from basic scaffolds to get started with Workers, Assets and Durable Objects"
78394
78406
  },
78395
78407
  {
78396
78408
  label: "Framework Starter",
@@ -78428,8 +78440,8 @@ var createContext = async (args, prevArgs) => {
78428
78440
  experimental: args.experimental
78429
78441
  });
78430
78442
  const frameworkOptions = Object.entries(frameworkMap).map(
78431
- ([key, config34]) => ({
78432
- label: config34.displayName,
78443
+ ([key, config36]) => ({
78444
+ label: config36.displayName,
78433
78445
  value: key
78434
78446
  })
78435
78447
  );
@@ -78596,28 +78608,28 @@ var processRemoteTemplate = async (args) => {
78596
78608
  src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
78597
78609
  }
78598
78610
  const path6 = await downloadRemoteTemplate(src);
78599
- const config34 = inferTemplateConfig(path6);
78600
- validateTemplate(path6, config34);
78611
+ const config36 = inferTemplateConfig(path6);
78612
+ validateTemplate(path6, config36);
78601
78613
  updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
78602
78614
  return {
78603
78615
  path: path6,
78604
- ...config34
78616
+ ...config36
78605
78617
  };
78606
78618
  };
78607
- var validateTemplate = (path6, config34) => {
78608
- if (!config34.copyFiles) {
78619
+ var validateTemplate = (path6, config36) => {
78620
+ if (!config36.copyFiles) {
78609
78621
  return;
78610
78622
  }
78611
- if (isVariantInfo(config34.copyFiles)) {
78612
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config34.copyFiles.path), config34);
78623
+ if (isVariantInfo(config36.copyFiles)) {
78624
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config36.copyFiles.path), config36);
78613
78625
  } else {
78614
- for (const variant of Object.values(config34.copyFiles.variants)) {
78615
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config34);
78626
+ for (const variant of Object.values(config36.copyFiles.variants)) {
78627
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config36);
78616
78628
  }
78617
78629
  }
78618
78630
  };
78619
- var validateTemplateSrcDirectory = (path6, config34) => {
78620
- if (config34.platform === "workers") {
78631
+ var validateTemplateSrcDirectory = (path6, config36) => {
78632
+ if (config36.platform === "workers") {
78621
78633
  const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
78622
78634
  const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
78623
78635
  const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
@@ -78791,12 +78803,12 @@ var cliDefinition = {
78791
78803
  const experimental = Boolean(args?.["experimental"]);
78792
78804
  if (experimental) {
78793
78805
  return [
78794
- { name: "hello-world", description: "Hello World example" },
78806
+ { name: "hello-world", description: "Hello World Starter" },
78795
78807
  { name: "web-framework", description: "Framework Starter" }
78796
78808
  ];
78797
78809
  } else {
78798
78810
  return [
78799
- { name: "hello-world", description: "Hello World example" },
78811
+ { name: "hello-world", description: "Hello World Starter" },
78800
78812
  { name: "web-framework", description: "Framework Starter" },
78801
78813
  { name: "demo", description: "Application Starter" },
78802
78814
  {
@@ -80528,20 +80540,20 @@ function applyEdits(text, edits) {
80528
80540
  var import_fs12 = require("fs");
80529
80541
  var import_path14 = require("path");
80530
80542
  var import_toml2 = __toESM(require_toml());
80531
- function ensureNameExists(config34, projectName) {
80532
- config34["name"] = projectName;
80533
- return config34;
80543
+ function ensureNameExists(config36, projectName) {
80544
+ config36["name"] = projectName;
80545
+ return config36;
80534
80546
  }
80535
- async function ensureCompatDateExists(config34) {
80536
- if (typeof config34["compatibility_date"] === "string") {
80547
+ async function ensureCompatDateExists(config36) {
80548
+ if (typeof config36["compatibility_date"] === "string") {
80537
80549
  const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
80538
- if (!config34["compatibility_date"].match(validCompatDateRe)) {
80539
- config34["compatibility_date"] = await getWorkerdCompatibilityDate();
80550
+ if (!config36["compatibility_date"].match(validCompatDateRe)) {
80551
+ config36["compatibility_date"] = await getWorkerdCompatibilityDate();
80540
80552
  }
80541
80553
  } else {
80542
- config34["compatibility_date"] = await getWorkerdCompatibilityDate();
80554
+ config36["compatibility_date"] = await getWorkerdCompatibilityDate();
80543
80555
  }
80544
- return config34;
80556
+ return config36;
80545
80557
  }
80546
80558
  var updateWranglerConfig = async (ctx) => {
80547
80559
  if (wranglerJsonExists(ctx)) {
@@ -81255,8 +81267,8 @@ var renderValues = (values) => {
81255
81267
  };
81256
81268
 
81257
81269
  // src/helpers/retry.ts
81258
- var retry = async (config34, fn) => {
81259
- let { times } = config34;
81270
+ var retry = async (config36, fn) => {
81271
+ let { times } = config36;
81260
81272
  let error2 = null;
81261
81273
  while (times > 0) {
81262
81274
  try {
@@ -81264,10 +81276,10 @@ var retry = async (config34, fn) => {
81264
81276
  } catch (e) {
81265
81277
  error2 = e;
81266
81278
  times--;
81267
- if (config34.exitCondition?.(e)) {
81279
+ if (config36.exitCondition?.(e)) {
81268
81280
  break;
81269
81281
  }
81270
- await sleep(config34.sleepMs ?? 1e3);
81282
+ await sleep(config36.sleepMs ?? 1e3);
81271
81283
  }
81272
81284
  }
81273
81285
  throw error2;
@@ -81387,8 +81399,8 @@ async function addWorkersTypesToTsConfig(ctx) {
81387
81399
  }
81388
81400
  const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
81389
81401
  try {
81390
- const config34 = parse4(tsconfig);
81391
- const currentTypes = config34.compilerOptions?.types ?? [];
81402
+ const config36 = parse4(tsconfig);
81403
+ const currentTypes = config36.compilerOptions?.types ?? [];
81392
81404
  const explicitEntrypoint = currentTypes.some(
81393
81405
  (t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
81394
81406
  );