create-cloudflare 0.0.0-99f802591 → 0.0.0-9a3d43c20

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 (155) hide show
  1. package/dist/cli.js +1088 -1019
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +7 -7
  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-experimental/astro → templates/astro/workers}/templates/ts/wrangler.jsonc +1 -1
  10. package/templates/common/c3.ts +5 -1
  11. package/templates/hello-world/c3.ts +3 -2
  12. package/templates/hello-world/ts/test/env.d.ts +3 -0
  13. package/templates/hello-world/ts/worker-configuration.d.ts +6 -2
  14. package/{templates-experimental → templates}/hello-world-assets-only/c3.ts +4 -3
  15. package/templates/hello-world-durable-object/c3.ts +6 -3
  16. package/templates/hello-world-durable-object/js/src/index.js +10 -9
  17. package/templates/hello-world-durable-object/js/wrangler.jsonc +1 -1
  18. package/templates/hello-world-durable-object/ts/src/index.ts +10 -9
  19. package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +6 -4
  20. package/templates/hello-world-durable-object/ts/wrangler.jsonc +1 -1
  21. package/{templates-experimental → templates}/hello-world-durable-object-with-assets/c3.ts +3 -3
  22. package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/src/index.js +11 -10
  23. package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/wrangler.jsonc +2 -2
  24. package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/src/index.ts +10 -9
  25. package/templates/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +8 -0
  26. package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/wrangler.jsonc +1 -1
  27. package/templates/hello-world-with-assets/c3.ts +24 -0
  28. package/{templates-experimental → templates}/hello-world-with-assets/js/public/index.html +2 -2
  29. package/{templates-experimental/hello-world-with-assets/ts → templates/hello-world-with-assets/py}/public/index.html +2 -2
  30. package/{templates-experimental/hello-world-with-assets/py → templates/hello-world-with-assets/ts}/public/index.html +2 -2
  31. package/templates/hello-world-with-assets/ts/test/env.d.ts +3 -0
  32. package/{templates-experimental → templates}/hello-world-with-assets/ts/test/tsconfig.json +1 -1
  33. package/templates/hello-world-with-assets/ts/worker-configuration.d.ts +7 -0
  34. package/templates/hono/c3.ts +5 -66
  35. package/templates/hono/pages/c3.ts +43 -0
  36. package/templates/hono/pages/templates/src/index.tsx +12 -0
  37. package/templates/hono/{templates → pages/templates}/wrangler.jsonc +1 -1
  38. package/{templates-experimental/hono → templates/hono/workers}/c3.ts +2 -4
  39. package/templates/next/c3.ts +7 -221
  40. package/templates/next/pages/c3.ts +224 -0
  41. package/{templates-experimental/next → templates/next/workers}/c3.ts +13 -14
  42. package/templates/next/workers/templates/open-next.config.ts +6 -0
  43. package/{templates-experimental/next → templates/next/workers}/templates/wrangler.jsonc +1 -2
  44. package/templates/nuxt/pages/c3.ts +1 -0
  45. package/templates/nuxt/workers/c3.ts +1 -0
  46. package/templates/openapi/c3.ts +5 -1
  47. package/templates/pre-existing/c3.ts +5 -1
  48. package/templates/queues/c3.ts +5 -1
  49. package/templates/qwik/c3.ts +5 -144
  50. package/templates/qwik/pages/c3.ts +149 -0
  51. package/{templates-experimental/qwik → templates/qwik/workers}/c3.ts +2 -2
  52. package/templates/react/workers/js/src/App.jsx +1 -1
  53. package/templates/react/workers/js/src/assets/Cloudflare_Logo.svg +7 -5
  54. package/templates/react/workers/js/{api → worker}/index.js +1 -1
  55. package/templates/react/workers/js/wrangler.jsonc +2 -2
  56. package/templates/react/workers/ts/src/App.tsx +1 -1
  57. package/templates/react/workers/ts/tsconfig.worker.json +1 -1
  58. package/templates/react/workers/ts/{api → worker}/index.ts +2 -3
  59. package/templates/react/workers/ts/wrangler.jsonc +2 -2
  60. package/templates/react-router/c3.ts +53 -0
  61. package/templates/react-router/templates/worker-configuration.d.ts +8 -0
  62. package/templates/remix/c3.ts +6 -63
  63. package/templates/remix/pages/c3.ts +68 -0
  64. package/{templates-experimental/remix → templates/remix/workers}/c3.ts +2 -2
  65. package/templates/scheduled/c3.ts +5 -1
  66. package/templates/scheduled/ts/src/index.ts +7 -0
  67. package/templates/svelte/c3.ts +5 -154
  68. package/templates/svelte/pages/c3.ts +159 -0
  69. package/{templates-experimental/svelte → templates/svelte/workers}/c3.ts +3 -3
  70. package/templates/svelte/workers/templates/static/.assetsignore +2 -0
  71. package/templates/vue/workers/js/server/index.js +2 -2
  72. package/templates/vue/workers/js/wrangler.jsonc +0 -1
  73. package/templates/vue/workers/ts/server/index.ts +2 -3
  74. package/templates/vue/workers/ts/wrangler.jsonc +0 -1
  75. package/templates/hono/snippets/appDeclaration.ts +0 -1
  76. package/templates/remix/templates/worker-configuration.d.ts +0 -4
  77. package/templates-experimental/astro/templates/ts/public/.assetsignore +0 -4
  78. package/templates-experimental/hello-world-durable-object-with-assets/ts/worker-configuration.d.ts +0 -5
  79. package/templates-experimental/hello-world-with-assets/c3.ts +0 -22
  80. package/templates-experimental/next/templates/open-next.config.ts +0 -28
  81. package/templates-experimental/qwik/templates/public/.assetsignore +0 -4
  82. package/templates-experimental/svelte/templates/static/.assetsignore +0 -4
  83. /package/templates/astro/{templates → pages/templates}/js/wrangler.jsonc +0 -0
  84. /package/{templates-experimental/astro → templates/astro/pages}/templates/ts/src/env.d.ts +0 -0
  85. /package/{templates-experimental/astro → templates/astro/pages}/templates/ts/worker-configuration.d.ts +0 -0
  86. /package/templates/astro/{templates → pages/templates}/ts/wrangler.jsonc +0 -0
  87. /package/{templates-experimental/astro → templates/astro/workers}/templates/js/wrangler.jsonc +0 -0
  88. /package/templates/astro/{templates → workers/templates}/ts/src/env.d.ts +0 -0
  89. /package/{templates-experimental/hello-world-with-assets → templates/astro/workers/templates}/ts/worker-configuration.d.ts +0 -0
  90. /package/{templates-experimental → templates}/hello-world-assets-only/templates/package.json +0 -0
  91. /package/{templates-experimental → templates}/hello-world-assets-only/templates/public/index.html +0 -0
  92. /package/{templates-experimental → templates}/hello-world-assets-only/templates/wrangler.jsonc +0 -0
  93. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/.editorconfig +0 -0
  94. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/.prettierrc +0 -0
  95. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/__dot__gitignore +0 -0
  96. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/package.json +0 -0
  97. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/js/public/index.html +0 -0
  98. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/.editorconfig +0 -0
  99. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/.prettierrc +0 -0
  100. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/__dot__gitignore +0 -0
  101. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/package.json +0 -0
  102. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/public/index.html +0 -0
  103. /package/{templates-experimental → templates}/hello-world-durable-object-with-assets/ts/tsconfig.json +0 -0
  104. /package/{templates-experimental → templates}/hello-world-with-assets/js/.editorconfig +0 -0
  105. /package/{templates-experimental → templates}/hello-world-with-assets/js/.prettierrc +0 -0
  106. /package/{templates-experimental → templates}/hello-world-with-assets/js/__dot__gitignore +0 -0
  107. /package/{templates-experimental → templates}/hello-world-with-assets/js/package.json +0 -0
  108. /package/{templates-experimental → templates}/hello-world-with-assets/js/src/index.js +0 -0
  109. /package/{templates-experimental → templates}/hello-world-with-assets/js/test/index.spec.js +0 -0
  110. /package/{templates-experimental → templates}/hello-world-with-assets/js/vitest.config.js +0 -0
  111. /package/{templates-experimental → templates}/hello-world-with-assets/js/wrangler.jsonc +0 -0
  112. /package/{templates-experimental → templates}/hello-world-with-assets/py/__dot__gitignore +0 -0
  113. /package/{templates-experimental → templates}/hello-world-with-assets/py/package.json +0 -0
  114. /package/{templates-experimental → templates}/hello-world-with-assets/py/src/entry.py +0 -0
  115. /package/{templates-experimental → templates}/hello-world-with-assets/py/wrangler.jsonc +0 -0
  116. /package/{templates-experimental → templates}/hello-world-with-assets/ts/.editorconfig +0 -0
  117. /package/{templates-experimental → templates}/hello-world-with-assets/ts/.prettierrc +0 -0
  118. /package/{templates-experimental → templates}/hello-world-with-assets/ts/__dot__gitignore +0 -0
  119. /package/{templates-experimental → templates}/hello-world-with-assets/ts/package.json +0 -0
  120. /package/{templates-experimental → templates}/hello-world-with-assets/ts/src/index.ts +0 -0
  121. /package/{templates-experimental → templates}/hello-world-with-assets/ts/test/index.spec.ts +0 -0
  122. /package/{templates-experimental → templates}/hello-world-with-assets/ts/tsconfig.json +0 -0
  123. /package/{templates-experimental → templates}/hello-world-with-assets/ts/vitest.config.mts +0 -0
  124. /package/{templates-experimental → templates}/hello-world-with-assets/ts/wrangler.jsonc +0 -0
  125. /package/{templates-experimental/hono → templates/hono/pages}/templates/worker-configuration.d.ts +0 -0
  126. /package/{templates-experimental/hono → templates/hono/workers}/templates/public/index.html +0 -0
  127. /package/{templates-experimental/hono → templates/hono/workers}/templates/src/index.ts +0 -0
  128. /package/templates/hono/{templates → workers/templates}/worker-configuration.d.ts +0 -0
  129. /package/{templates-experimental/hono → templates/hono/workers}/templates/wrangler.jsonc +0 -0
  130. /package/templates/next/{README.md → pages/README.md} +0 -0
  131. /package/templates/next/{app → pages/app}/js/app/api/hello/route.js +0 -0
  132. /package/templates/next/{app → pages/app}/js/app/not-found.js +0 -0
  133. /package/templates/next/{app → pages/app}/ts/app/api/hello/route.ts +0 -0
  134. /package/templates/next/{app → pages/app}/ts/app/not-found.tsx +0 -0
  135. /package/templates/next/{env.d.ts → pages/env.d.ts} +0 -0
  136. /package/templates/next/pages/{js → pages/js}/pages/api/hello.js +0 -0
  137. /package/templates/next/pages/{ts → pages/ts}/pages/api/hello.ts +0 -0
  138. /package/templates/next/{wrangler.jsonc → pages/wrangler.jsonc} +0 -0
  139. /package/{templates-experimental/next → templates/next/workers}/templates/.dev.vars +0 -0
  140. /package/{templates-experimental/next → templates/next/workers}/templates/__dot__gitignore +0 -0
  141. /package/{templates-experimental/next → templates/next/workers}/templates/cloudflare-env.d.ts +0 -0
  142. /package/{templates-experimental/qwik → templates/qwik/pages}/snippets/getPlatformProxy.ts +0 -0
  143. /package/{templates-experimental/qwik → templates/qwik/pages}/templates/worker-configuration.d.ts +0 -0
  144. /package/templates/qwik/{templates → pages/templates}/wrangler.jsonc +0 -0
  145. /package/templates/qwik/{snippets → workers/snippets}/getPlatformProxy.ts +0 -0
  146. /package/{templates-experimental/astro/templates/js → templates/qwik/workers/templates}/public/.assetsignore +0 -0
  147. /package/templates/{astro/templates/ts → qwik/workers/templates}/worker-configuration.d.ts +0 -0
  148. /package/{templates-experimental/qwik → templates/qwik/workers}/templates/wrangler.jsonc +0 -0
  149. /package/templates/{qwik → remix/pages}/templates/worker-configuration.d.ts +0 -0
  150. /package/templates/remix/{templates → pages/templates}/wrangler.jsonc +0 -0
  151. /package/{templates-experimental/remix → templates/remix/workers}/templates/public/.assetsignore +0 -0
  152. /package/{templates-experimental/remix → templates/remix/workers}/templates/worker-configuration.d.ts +0 -0
  153. /package/{templates-experimental/remix → templates/remix/workers}/templates/wrangler.toml +0 -0
  154. /package/templates/svelte/{templates → pages/templates}/wrangler.jsonc +0 -0
  155. /package/{templates-experimental/svelte → templates/svelte/workers}/templates/wrangler.jsonc +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 config48(dirOptions) {
572
572
  return path6.join(xdg.config(), finalPathSegment(dirOptions));
573
573
  };
574
574
  XDGAppPaths.data = function data(dirOptions) {
@@ -625,7 +625,7 @@ var require_XDG = __commonJS({
625
625
  var cache = function() {
626
626
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
627
627
  };
628
- var config34 = function() {
628
+ var config48 = function() {
629
629
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
630
630
  };
631
631
  var data = function() {
@@ -637,13 +637,13 @@ var require_XDG = __commonJS({
637
637
  var state = function() {
638
638
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
639
639
  };
640
- return { cache, config: config34, data, runtime, state };
640
+ return { cache, config: config48, data, runtime, state };
641
641
  };
642
642
  var macos = function() {
643
643
  var cache = function() {
644
644
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
645
645
  };
646
- var config34 = function() {
646
+ var config48 = function() {
647
647
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
648
648
  };
649
649
  var data = function() {
@@ -655,7 +655,7 @@ var require_XDG = __commonJS({
655
655
  var state = function() {
656
656
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
657
657
  };
658
- return { cache, config: config34, data, runtime, state };
658
+ return { cache, config: config48, data, runtime, state };
659
659
  };
660
660
  var windows = function() {
661
661
  function appData() {
@@ -667,7 +667,7 @@ var require_XDG = __commonJS({
667
667
  var cache = function() {
668
668
  return valOrPath(env3.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
669
669
  };
670
- var config34 = function() {
670
+ var config48 = function() {
671
671
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
672
672
  };
673
673
  var data = function() {
@@ -679,7 +679,7 @@ var require_XDG = __commonJS({
679
679
  var state = function() {
680
680
  return valOrPath(env3.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
681
681
  };
682
- return { cache, config: config34, data, runtime, state };
682
+ return { cache, config: config48, data, runtime, state };
683
683
  };
684
684
  var XDG_ = /* @__PURE__ */ function() {
685
685
  function XDG_2() {
@@ -31509,21 +31509,21 @@ var require_dist_web = __commonJS({
31509
31509
  _createClass(Haikunator3, [{
31510
31510
  key: "haikunate",
31511
31511
  value: function haikunate(options) {
31512
- var config34 = (0, _lodash["default"])(options, this.config);
31513
- if (config34.tokenHex === true) {
31514
- config34.tokenChars = "0123456789abcdef";
31512
+ var config48 = (0, _lodash["default"])(options, this.config);
31513
+ if (config48.tokenHex === true) {
31514
+ config48.tokenChars = "0123456789abcdef";
31515
31515
  }
31516
31516
  var adjective = this._randomElement(this.adjectives);
31517
31517
  var noun = this._randomElement(this.nouns);
31518
- if (!config34.tokenLength) config34.tokenLength = 0;
31518
+ if (!config48.tokenLength) config48.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 < config48.tokenLength; i++) {
31521
+ token += this._randomElement(config48.tokenChars);
31522
31522
  }
31523
31523
  var sections = [adjective, noun, token];
31524
31524
  return sections.filter(function(e) {
31525
31525
  return !!e;
31526
- }).join(config34.delimiter);
31526
+ }).join(config48.delimiter);
31527
31527
  }
31528
31528
  /**
31529
31529
  * Get a random element from an array/string
@@ -40036,13 +40036,13 @@ var require_esprima = __commonJS({
40036
40036
  return Reader2;
40037
40037
  }();
40038
40038
  var Tokenizer = function() {
40039
- function Tokenizer2(code, config34) {
40039
+ function Tokenizer2(code, config48) {
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 = config48 ? typeof config48.tolerant === "boolean" && config48.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 = config48 ? typeof config48.comment === "boolean" && config48.comment : false;
40044
+ this.trackRange = config48 ? typeof config48.range === "boolean" && config48.range : false;
40045
+ this.trackLoc = config48 ? typeof config48.loc === "boolean" && config48.loc : false;
40046
40046
  this.buffer = [];
40047
40047
  this.reader = new Reader();
40048
40048
  }
@@ -49803,11 +49803,11 @@ var require_printer = __commonJS({
49803
49803
  return this.code;
49804
49804
  };
49805
49805
  var emptyPrintResult = new PrintResult("");
49806
- var Printer = function Printer2(config34) {
49806
+ var Printer = function Printer2(config48) {
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 = config48 && config48.tabWidth;
49809
+ config48 = options_1.normalize(config48);
49810
+ config48.sourceFileName = null;
49811
49811
  function makePrintFunctionWith(options, overrides) {
49812
49812
  options = Object.assign({}, options, overrides);
49813
49813
  return function(path6) {
@@ -49822,11 +49822,11 @@ var require_printer = __commonJS({
49822
49822
  includeComments: false
49823
49823
  }));
49824
49824
  }
49825
- var oldTabWidth = config34.tabWidth;
49825
+ var oldTabWidth = config48.tabWidth;
49826
49826
  if (!explicitTabWidth) {
49827
49827
  var loc = path6.getNode().loc;
49828
49828
  if (loc && loc.lines && loc.lines.guessTabWidth) {
49829
- config34.tabWidth = loc.lines.guessTabWidth();
49829
+ config48.tabWidth = loc.lines.guessTabWidth();
49830
49830
  }
49831
49831
  }
49832
49832
  var reprinter = patcher_1.getReprinter(path6);
@@ -49840,11 +49840,11 @@ var require_printer = __commonJS({
49840
49840
  // right choice because it gives us the opportunity to reprint
49841
49841
  // such nodes using their original source.
49842
49842
  reprinter(print2)
49843
- ) : genericPrint(path6, config34, options, makePrintFunctionWith(options, {
49843
+ ) : genericPrint(path6, config48, options, makePrintFunctionWith(options, {
49844
49844
  includeComments: true,
49845
49845
  avoidRootParens: false
49846
49846
  }));
49847
- config34.tabWidth = oldTabWidth;
49847
+ config48.tabWidth = oldTabWidth;
49848
49848
  return lines;
49849
49849
  }
49850
49850
  this.print = function(ast) {
@@ -49855,7 +49855,7 @@ var require_printer = __commonJS({
49855
49855
  includeComments: true,
49856
49856
  avoidRootParens: false
49857
49857
  });
49858
- return new PrintResult(lines.toString(config34), util.composeSourceMaps(config34.inputSourceMap, lines.getSourceMap(config34.sourceMapName, config34.sourceRoot)));
49858
+ return new PrintResult(lines.toString(config48), util.composeSourceMaps(config48.inputSourceMap, lines.getSourceMap(config48.sourceMapName, config48.sourceRoot)));
49859
49859
  };
49860
49860
  this.printGenerically = function(ast) {
49861
49861
  if (!ast) {
@@ -49863,26 +49863,26 @@ var require_printer = __commonJS({
49863
49863
  }
49864
49864
  function printGenerically(path7) {
49865
49865
  return comments_1.printComments(path7, function(path8) {
49866
- return genericPrint(path8, config34, {
49866
+ return genericPrint(path8, config48, {
49867
49867
  includeComments: true,
49868
49868
  avoidRootParens: false
49869
49869
  }, printGenerically);
49870
49870
  });
49871
49871
  }
49872
49872
  var path6 = fast_path_1.default.from(ast);
49873
- var oldReuseWhitespace = config34.reuseWhitespace;
49874
- config34.reuseWhitespace = false;
49875
- var pr = new PrintResult(printGenerically(path6).toString(config34));
49876
- config34.reuseWhitespace = oldReuseWhitespace;
49873
+ var oldReuseWhitespace = config48.reuseWhitespace;
49874
+ config48.reuseWhitespace = false;
49875
+ var pr = new PrintResult(printGenerically(path6).toString(config48));
49876
+ config48.reuseWhitespace = oldReuseWhitespace;
49877
49877
  return pr;
49878
49878
  };
49879
49879
  };
49880
49880
  exports2.Printer = Printer;
49881
- function genericPrint(path6, config34, options, printPath) {
49881
+ function genericPrint(path6, config48, options, printPath) {
49882
49882
  assert_1.default.ok(path6 instanceof fast_path_1.default);
49883
49883
  var node = path6.getValue();
49884
49884
  var parts = [];
49885
- var linesWithoutParens = genericPrintNoParens(path6, config34, printPath);
49885
+ var linesWithoutParens = genericPrintNoParens(path6, config48, printPath);
49886
49886
  if (!node || linesWithoutParens.isEmpty()) {
49887
49887
  return linesWithoutParens;
49888
49888
  }
@@ -69380,33 +69380,33 @@ var inputPrompt = async (promptConfig) => {
69380
69380
  }
69381
69381
  return input;
69382
69382
  };
69383
- var renderSubmit = (config34, value) => {
69384
- const { question, label } = config34;
69385
- if (config34.type !== "confirm" && !value) {
69383
+ var renderSubmit = (config48, value) => {
69384
+ const { question, label } = config48;
69385
+ if (config48.type !== "confirm" && !value) {
69386
69386
  return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
69387
69387
  }
69388
- const content = config34.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69388
+ const content = config48.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
69389
69389
  return [`${leftT} ${question}`, content, `${grayBar}`];
69390
69390
  };
69391
- var getRenderers = (config34) => {
69392
- switch (config34.type) {
69391
+ var getRenderers = (config48) => {
69392
+ switch (config48.type) {
69393
69393
  case "select":
69394
- return getSelectRenderers(config34);
69394
+ return getSelectRenderers(config48);
69395
69395
  case "confirm":
69396
- return getConfirmRenderers(config34);
69396
+ return getConfirmRenderers(config48);
69397
69397
  case "text":
69398
- return getTextRenderers(config34);
69398
+ return getTextRenderers(config48);
69399
69399
  case "multiselect":
69400
- return getSelectRenderers(config34);
69400
+ return getSelectRenderers(config48);
69401
69401
  case "list":
69402
- return getSelectListRenderers(config34);
69402
+ return getSelectListRenderers(config48);
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 = (config48) => {
69406
+ const { question } = config48;
69407
+ const helpText = config48.helpText ?? "";
69408
+ const format5 = config48.format ?? ((val) => String(val));
69409
+ const defaultValue = config48.defaultValue?.toString() ?? "";
69410
69410
  const activeRenderer = ({ value }) => [
69411
69411
  `${blCorner} ${bold(question)} ${dim(helpText)}`,
69412
69412
  `${space(2)}${format5(value || dim(defaultValue))}`,
@@ -69429,14 +69429,14 @@ var getTextRenderers = (config34) => {
69429
69429
  ``
69430
69430
  // extra line for readability
69431
69431
  ],
69432
- submit: ({ value }) => renderSubmit(config34, format5(value ?? "")),
69432
+ submit: ({ value }) => renderSubmit(config48, format5(value ?? "")),
69433
69433
  cancel: activeRenderer
69434
69434
  };
69435
69435
  };
69436
- var getSelectRenderers = (config34) => {
69437
- const { options, question, helpText: _helpText } = config34;
69436
+ var getSelectRenderers = (config48) => {
69437
+ const { options, question, helpText: _helpText } = config48;
69438
69438
  const helpText = _helpText ?? "";
69439
- const maxItemsPerPage = config34.maxItemsPerPage ?? 32;
69439
+ const maxItemsPerPage = config48.maxItemsPerPage ?? 32;
69440
69440
  const defaultRenderer = ({ cursor = 0, value }) => {
69441
69441
  const renderOption = (opt, i) => {
69442
69442
  const { label: optionLabel, value: optionValue } = opt;
@@ -69511,21 +69511,21 @@ ${space(2)}${dim("...")}` : ""}`,
69511
69511
  submit: ({ value }) => {
69512
69512
  if (Array.isArray(value)) {
69513
69513
  return renderSubmit(
69514
- config34,
69514
+ config48,
69515
69515
  options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
69516
69516
  );
69517
69517
  }
69518
69518
  return renderSubmit(
69519
- config34,
69519
+ config48,
69520
69520
  options.find((o) => o.value === value)?.label
69521
69521
  );
69522
69522
  },
69523
69523
  cancel: defaultRenderer
69524
69524
  };
69525
69525
  };
69526
- var getSelectListRenderers = (config34) => {
69527
- const { question, helpText: _helpText } = config34;
69528
- let options = config34.options;
69526
+ var getSelectListRenderers = (config48) => {
69527
+ const { question, helpText: _helpText } = config48;
69528
+ let options = config48.options;
69529
69529
  const helpText = _helpText ?? "";
69530
69530
  const { rows } = stdout;
69531
69531
  const defaultRenderer = ({ cursor, value }, prompt) => {
@@ -69606,20 +69606,20 @@ var getSelectListRenderers = (config34) => {
69606
69606
  submit: ({ value }) => {
69607
69607
  if (Array.isArray(value)) {
69608
69608
  return renderSubmit(
69609
- config34,
69609
+ config48,
69610
69610
  options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
69611
69611
  );
69612
69612
  }
69613
69613
  return renderSubmit(
69614
- config34,
69614
+ config48,
69615
69615
  options.find((o) => o.value === value)?.value
69616
69616
  );
69617
69617
  },
69618
69618
  cancel: defaultRenderer
69619
69619
  };
69620
69620
  };
69621
- var getConfirmRenderers = (config34) => {
69622
- const { activeText, inactiveText, question, helpText: _helpText } = config34;
69621
+ var getConfirmRenderers = (config48) => {
69622
+ const { activeText, inactiveText, question, helpText: _helpText } = config48;
69623
69623
  const helpText = _helpText ?? "";
69624
69624
  const active = activeText || "Yes";
69625
69625
  const inactive = inactiveText || "No";
@@ -69636,7 +69636,7 @@ var getConfirmRenderers = (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(config48, value ? "yes" : "no"),
69640
69640
  cancel: defaultRenderer
69641
69641
  };
69642
69642
  };
@@ -70604,23 +70604,23 @@ var YargsParser = class {
70604
70604
  const configPath = argv2[configKey] || configLookup[configKey];
70605
70605
  if (configPath) {
70606
70606
  try {
70607
- let config34 = null;
70607
+ let config48 = null;
70608
70608
  const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
70609
70609
  const resolveConfig = flags.configs[configKey];
70610
70610
  if (typeof resolveConfig === "function") {
70611
70611
  try {
70612
- config34 = resolveConfig(resolvedConfigPath);
70612
+ config48 = resolveConfig(resolvedConfigPath);
70613
70613
  } catch (e) {
70614
- config34 = e;
70614
+ config48 = e;
70615
70615
  }
70616
- if (config34 instanceof Error) {
70617
- error2 = config34;
70616
+ if (config48 instanceof Error) {
70617
+ error2 = config48;
70618
70618
  return;
70619
70619
  }
70620
70620
  } else {
70621
- config34 = mixin2.require(resolvedConfigPath);
70621
+ config48 = mixin2.require(resolvedConfigPath);
70622
70622
  }
70623
- setConfigObject(config34);
70623
+ setConfigObject(config48);
70624
70624
  } catch (ex) {
70625
70625
  if (ex.name === "PermissionDenied")
70626
70626
  error2 = ex;
@@ -70630,9 +70630,9 @@ var YargsParser = class {
70630
70630
  }
70631
70631
  });
70632
70632
  }
70633
- function setConfigObject(config34, prev) {
70634
- Object.keys(config34).forEach(function(key) {
70635
- const value = config34[key];
70633
+ function setConfigObject(config48, prev) {
70634
+ Object.keys(config48).forEach(function(key) {
70635
+ const value = config48[key];
70636
70636
  const fullKey = prev ? prev + "." + key : key;
70637
70637
  if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
70638
70638
  setConfigObject(value, fullKey);
@@ -71784,11 +71784,11 @@ var CommandInstance = class {
71784
71784
  });
71785
71785
  if (!unparsed.length)
71786
71786
  return;
71787
- const config34 = Object.assign({}, options.configuration, {
71787
+ const config48 = Object.assign({}, options.configuration, {
71788
71788
  "populate--": false
71789
71789
  });
71790
71790
  const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
71791
- configuration: config34
71791
+ configuration: config48
71792
71792
  }));
71793
71793
  if (parsed.error) {
71794
71794
  yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
@@ -73011,31 +73011,31 @@ ${customMsgs.join("\n")}` : "";
73011
73011
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
73012
73012
  var previouslyVisitedConfigs = [];
73013
73013
  var shim2;
73014
- function applyExtends(config34, cwd, mergeExtends, _shim) {
73014
+ function applyExtends(config48, 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(config48, "extends")) {
73018
+ if (typeof config48.extends !== "string")
73019
73019
  return defaultConfig;
73020
- const isPath = /\.json|\..*rc$/.test(config34.extends);
73020
+ const isPath = /\.json|\..*rc$/.test(config48.extends);
73021
73021
  let pathToDefault = null;
73022
73022
  if (!isPath) {
73023
73023
  try {
73024
- pathToDefault = require.resolve(config34.extends);
73024
+ pathToDefault = require.resolve(config48.extends);
73025
73025
  } catch (_err) {
73026
- return config34;
73026
+ return config48;
73027
73027
  }
73028
73028
  } else {
73029
- pathToDefault = getPathToDefaultConfig(cwd, config34.extends);
73029
+ pathToDefault = getPathToDefaultConfig(cwd, config48.extends);
73030
73030
  }
73031
73031
  checkForCircularExtends(pathToDefault);
73032
73032
  previouslyVisitedConfigs.push(pathToDefault);
73033
- defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config34.extends);
73034
- delete config34.extends;
73033
+ defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config48.extends);
73034
+ delete config48.extends;
73035
73035
  defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
73036
73036
  }
73037
73037
  previouslyVisitedConfigs = [];
73038
- return mergeExtends ? mergeDeep(defaultConfig, config34) : Object.assign({}, defaultConfig, config34);
73038
+ return mergeExtends ? mergeDeep(defaultConfig, config48) : Object.assign({}, defaultConfig, config48);
73039
73039
  }
73040
73040
  function checkForCircularExtends(cfgPath) {
73041
73041
  if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
@@ -73811,9 +73811,9 @@ var YargsInstance = class {
73811
73811
  }
73812
73812
  return maybePromise;
73813
73813
  }
73814
- parserConfiguration(config34) {
73815
- argsert("<object>", [config34], arguments.length);
73816
- __classPrivateFieldSet(this, _YargsInstance_parserConfig, config34, "f");
73814
+ parserConfiguration(config48) {
73815
+ argsert("<object>", [config48], arguments.length);
73816
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config48, "f");
73817
73817
  return this;
73818
73818
  }
73819
73819
  pkgConf(key, rootPath) {
@@ -73985,9 +73985,9 @@ var YargsInstance = class {
73985
73985
  return this;
73986
73986
  }
73987
73987
  }
73988
- usageConfiguration(config34) {
73989
- argsert("<object>", [config34], arguments.length);
73990
- __classPrivateFieldSet(this, _YargsInstance_usageConfig, config34, "f");
73988
+ usageConfiguration(config48) {
73989
+ argsert("<object>", [config48], arguments.length);
73990
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config48, "f");
73991
73991
  return this;
73992
73992
  }
73993
73993
  version(opt, msg, ver) {
@@ -74393,11 +74393,11 @@ var YargsInstance = class {
74393
74393
  __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
74394
74394
  __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
74395
74395
  const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
74396
- const config34 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
74396
+ const config48 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
74397
74397
  "populate--": true
74398
74398
  });
74399
74399
  const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
74400
- configuration: { "parse-positional-numbers": false, ...config34 }
74400
+ configuration: { "parse-positional-numbers": false, ...config48 }
74401
74401
  }));
74402
74402
  const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
74403
74403
  let argvPromise = void 0;
@@ -74560,7 +74560,7 @@ var Yargs = YargsFactory(esm_default);
74560
74560
  var yargs_default = Yargs;
74561
74561
 
74562
74562
  // package.json
74563
- var version = "0.0.0-99f802591";
74563
+ var version = "0.0.0-9a3d43c20";
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(config48) {
74608
74608
  (0, import_node_fs2.mkdirSync)(import_node_path2.default.dirname(getMetricsConfigPath()), { recursive: true });
74609
74609
  (0, import_node_fs2.writeFileSync)(
74610
74610
  getMetricsConfigPath(),
74611
74611
  JSON.stringify(
74612
- config34,
74612
+ config48,
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 config48 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
74621
74621
  return JSON.parse(
74622
- config34,
74622
+ config48,
74623
74623
  (key, value) => key === "date" ? new Date(value) : value
74624
74624
  );
74625
74625
  } catch {
@@ -74629,10 +74629,10 @@ function readMetricsConfig() {
74629
74629
  function getMetricsConfigPath() {
74630
74630
  return import_node_path2.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
74631
74631
  }
74632
- function getDeviceId(config34) {
74633
- const deviceId = config34.deviceId ?? (0, import_node_crypto.randomUUID)();
74634
- if (config34.deviceId === void 0) {
74635
- writeMetricsConfig({ ...config34, deviceId });
74632
+ function getDeviceId(config48) {
74633
+ const deviceId = config48.deviceId ?? (0, import_node_crypto.randomUUID)();
74634
+ if (config48.deviceId === void 0) {
74635
+ writeMetricsConfig({ ...config48, deviceId });
74636
74636
  }
74637
74637
  return deviceId;
74638
74638
  }
@@ -74817,7 +74817,7 @@ var detectPackageManager = () => {
74817
74817
  }
74818
74818
  };
74819
74819
  var rectifyPmMismatch = async (ctx) => {
74820
- const { npm: npm24 } = detectPackageManager();
74820
+ const { npm: npm25 } = detectPackageManager();
74821
74821
  if (!detectPmMismatch(ctx)) {
74822
74822
  return;
74823
74823
  }
@@ -74829,17 +74829,17 @@ var rectifyPmMismatch = async (ctx) => {
74829
74829
  if ((0, import_fs5.existsSync)(lockfilePath)) {
74830
74830
  (0, import_fs5.rmSync)(lockfilePath);
74831
74831
  }
74832
- await runCommand([npm24, "install"], {
74832
+ await runCommand([npm25, "install"], {
74833
74833
  silent: true,
74834
74834
  cwd: ctx.project.path,
74835
74835
  startText: "Installing dependencies",
74836
- doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
74836
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
74837
74837
  });
74838
74838
  };
74839
74839
  var detectPmMismatch = (ctx) => {
74840
- const { npm: npm24 } = detectPackageManager();
74840
+ const { npm: npm25 } = detectPackageManager();
74841
74841
  const projectPath = ctx.project.path;
74842
- switch (npm24) {
74842
+ switch (npm25) {
74843
74843
  case "npm":
74844
74844
  return false;
74845
74845
  case "yarn":
@@ -74853,7 +74853,7 @@ var detectPmMismatch = (ctx) => {
74853
74853
 
74854
74854
  // src/helpers/sparrow.ts
74855
74855
  var import_undici = __toESM(require_undici());
74856
- var SPARROW_SOURCE_KEY = "5adf183f94b3436ba78d67f506965998";
74856
+ var SPARROW_SOURCE_KEY = "";
74857
74857
  var SPARROW_URL = "https://sparrow.cloudflare.com";
74858
74858
  function hasSparrowSourceKey() {
74859
74859
  return SPARROW_SOURCE_KEY !== "";
@@ -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 config48 = readMetricsConfig() ?? {};
74911
+ const isFirstUsage = config48.c3permission === void 0;
74912
74912
  const isEnabled = isTelemetryEnabled();
74913
- const deviceId = getDeviceId(config34);
74913
+ const deviceId = getDeviceId(config48);
74914
74914
  const packageManager = detectPackageManager();
74915
74915
  const platform3 = getPlatform();
74916
74916
  const amplitude_session_id = Date.now();
@@ -74943,7 +74943,7 @@ function createReporter() {
74943
74943
  if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
74944
74944
  return false;
74945
74945
  }
74946
- return hasSparrowSourceKey() && getC3Permission(config34).enabled;
74946
+ return hasSparrowSourceKey() && getC3Permission(config48).enabled;
74947
74947
  }
74948
74948
  async function waitForAllEventsSettled() {
74949
74949
  await Promise.allSettled(events);
@@ -75049,20 +75049,20 @@ function initializeC3Permission(enabled = true) {
75049
75049
  date: /* @__PURE__ */ new Date()
75050
75050
  };
75051
75051
  }
75052
- function getC3Permission(config34 = readMetricsConfig() ?? {}) {
75053
- if (!config34.c3permission) {
75054
- config34.c3permission = initializeC3Permission();
75055
- writeMetricsConfig(config34);
75052
+ function getC3Permission(config48 = readMetricsConfig() ?? {}) {
75053
+ if (!config48.c3permission) {
75054
+ config48.c3permission = initializeC3Permission();
75055
+ writeMetricsConfig(config48);
75056
75056
  }
75057
- return config34.c3permission;
75057
+ return config48.c3permission;
75058
75058
  }
75059
75059
  function updateC3Pemission(enabled) {
75060
- const config34 = readMetricsConfig();
75061
- if (config34.c3permission?.enabled === enabled) {
75060
+ const config48 = readMetricsConfig();
75061
+ if (config48.c3permission?.enabled === enabled) {
75062
75062
  return;
75063
75063
  }
75064
- config34.c3permission = initializeC3Permission(enabled);
75065
- writeMetricsConfig(config34);
75064
+ config48.c3permission = initializeC3Permission(enabled);
75065
+ writeMetricsConfig(config48);
75066
75066
  }
75067
75067
  var runTelemetryCommand = (action) => {
75068
75068
  const logTelemetryStatus = (enabled) => {
@@ -75107,39 +75107,39 @@ var import_haikunator = __toESM(require_dist_web());
75107
75107
  var import_fs6 = require("fs");
75108
75108
  var import_path6 = __toESM(require("path"));
75109
75109
  var import_undici2 = __toESM(require_undici());
75110
- var installPackages = async (packages, config34 = {}) => {
75111
- const { npm: npm24 } = detectPackageManager();
75110
+ var installPackages = async (packages, config48 = {}) => {
75111
+ const { npm: npm25 } = detectPackageManager();
75112
75112
  let saveFlag;
75113
75113
  let cmd;
75114
- switch (npm24) {
75114
+ switch (npm25) {
75115
75115
  case "yarn":
75116
75116
  cmd = "add";
75117
- saveFlag = config34.dev ? "-D" : "";
75117
+ saveFlag = config48.dev ? "-D" : "";
75118
75118
  break;
75119
75119
  case "bun":
75120
75120
  cmd = "add";
75121
- saveFlag = config34.dev ? "-d" : "";
75121
+ saveFlag = config48.dev ? "-d" : "";
75122
75122
  break;
75123
75123
  case "npm":
75124
75124
  case "pnpm":
75125
75125
  default:
75126
75126
  cmd = "install";
75127
- saveFlag = config34.dev ? "--save-dev" : "";
75127
+ saveFlag = config48.dev ? "--save-dev" : "";
75128
75128
  break;
75129
75129
  }
75130
75130
  await runCommand(
75131
75131
  [
75132
- npm24,
75132
+ npm25,
75133
75133
  cmd,
75134
75134
  ...saveFlag ? [saveFlag] : [],
75135
75135
  ...packages,
75136
75136
  // Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
75137
75137
  // frameworks that haven't updated their peer dependency for Wrangler v4
75138
75138
  // TODO: Remove this once Wrangler v4 has been released and framework templates are updated
75139
- ...npm24 === "npm" ? ["--legacy-peer-deps"] : []
75139
+ ...npm25 === "npm" ? ["--legacy-peer-deps"] : []
75140
75140
  ],
75141
75141
  {
75142
- ...config34,
75142
+ ...config48,
75143
75143
  silent: true
75144
75144
  }
75145
75145
  );
@@ -75149,16 +75149,16 @@ var npmInstall = async (ctx) => {
75149
75149
  if ((0, import_fs6.existsSync)(nodeModulesPath)) {
75150
75150
  return;
75151
75151
  }
75152
- const { npm: npm24 } = detectPackageManager();
75152
+ const { npm: npm25 } = detectPackageManager();
75153
75153
  await runCommand(
75154
75154
  // Add --legacy-peer-deps so that installing Wrangler v4 doesn't case issues with
75155
75155
  // frameworks that haven't updated their peer dependency for Wrangler v4
75156
75156
  // TODO: Remove this once Wrangler v4 has been released and framework templates are updated
75157
- [npm24, "install", ...npm24 === "npm" ? ["--legacy-peer-deps"] : []],
75157
+ [npm25, "install", ...npm25 === "npm" ? ["--legacy-peer-deps"] : []],
75158
75158
  {
75159
75159
  silent: true,
75160
75160
  startText: "Installing dependencies",
75161
- doneText: `${brandColor("installed")} ${dim(`via \`${npm24} install\``)}`
75161
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm25} install\``)}`
75162
75162
  }
75163
75163
  );
75164
75164
  };
@@ -75168,14 +75168,14 @@ async function getLatestPackageVersion(packageSpecifier) {
75168
75168
  return npmInfo["dist-tags"].latest;
75169
75169
  }
75170
75170
  var installWrangler = async () => {
75171
- const { npm: npm24 } = detectPackageManager();
75171
+ const { npm: npm25 } = detectPackageManager();
75172
75172
  await installPackages([`wrangler@latest`], {
75173
75173
  dev: true,
75174
75174
  startText: `Installing wrangler ${dim(
75175
75175
  "A command line tool for building Cloudflare Workers"
75176
75176
  )}`,
75177
75177
  doneText: `${brandColor("installed")} ${dim(
75178
- `via \`${npm24} install wrangler --save-dev\``
75178
+ `via \`${npm25} install wrangler --save-dev\``
75179
75179
  )}`
75180
75180
  });
75181
75181
  };
@@ -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
 
@@ -75335,20 +75335,21 @@ var package_default = {
75335
75335
  "so that we can use dependabot to update these dependencies automatically."
75336
75336
  ],
75337
75337
  dependencies: {
75338
- "create-astro": "4.11.0",
75338
+ "create-astro": "4.11.1",
75339
75339
  "create-analog": "1.8.1",
75340
- "@angular/create": "19.1.6",
75340
+ "@angular/create": "19.2.5",
75341
75341
  "create-docusaurus": "3.7.0",
75342
75342
  "create-hono": "0.15.3",
75343
75343
  "create-next-app": "15.2.1",
75344
75344
  "create-qwik": "1.12.0",
75345
- "create-vite": "6.1.1",
75345
+ "create-vite": "6.3.1",
75346
75346
  "create-remix": "2.15.3",
75347
- "create-solid": "0.6.1",
75348
- "create-vue": "3.14.2",
75347
+ "create-react-router": "7.4.1",
75348
+ "create-solid": "0.6.2",
75349
+ "create-vue": "3.15.1",
75349
75350
  gatsby: "5.14.1",
75350
75351
  sv: "0.6.23",
75351
- nuxi: "3.21.1"
75352
+ nuxi: "3.23.1"
75352
75353
  }
75353
75354
  };
75354
75355
 
@@ -75363,9 +75364,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
75363
75364
  };
75364
75365
  var runFrameworkGenerator = async (ctx, args) => {
75365
75366
  const cli = getFrameworkCli(ctx, true);
75366
- const { npm: npm24, dlx } = detectPackageManager();
75367
- const cmd = [...npm24 === "yarn" ? ["npx"] : dlx, cli, ...args];
75368
- const env3 = npm24 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
75367
+ const { npm: npm25, dlx } = detectPackageManager();
75368
+ const cmd = [...npm25 === "yarn" ? ["npx"] : dlx, cli, ...args];
75369
+ const env3 = npm25 === "yarn" && !process.env.npm_config_user_agent?.startsWith("yarn") ? { npm_config_user_agent: "yarn/1.22.22" } : {};
75369
75370
  if (ctx.args.additionalArgs?.length) {
75370
75371
  cmd.push(...ctx.args.additionalArgs);
75371
75372
  }
@@ -75453,388 +75454,6 @@ var getPropertyName = (newProp) => {
75453
75454
  return newProp.key.type === "Identifier" ? newProp.key.name : newProp.key.type === "StringLiteral" ? newProp.key.value : null;
75454
75455
  };
75455
75456
 
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
- // templates-experimental/hono/c3.ts
75591
- var generate2 = async (ctx) => {
75592
- const { name: pm4 } = detectPackageManager();
75593
- await runFrameworkGenerator(ctx, [
75594
- ctx.project.name,
75595
- "--template",
75596
- "cloudflare-workers",
75597
- "--install",
75598
- "--pm",
75599
- pm4
75600
- ]);
75601
- logRaw("");
75602
- };
75603
- var config4 = {
75604
- configVersion: 1,
75605
- id: "hono",
75606
- frameworkCli: "create-hono",
75607
- displayName: "Hono",
75608
- copyFiles: {
75609
- path: "./templates"
75610
- },
75611
- platform: "workers",
75612
- path: "templates-experimental/hono",
75613
- generate: generate2,
75614
- transformPackageJson: async () => ({
75615
- scripts: {
75616
- dev: "wrangler dev",
75617
- deploy: "wrangler deploy --minify",
75618
- "cf-typegen": "wrangler types --env-interface CloudflareBindings"
75619
- }
75620
- }),
75621
- devScript: "dev",
75622
- deployScript: "deploy",
75623
- previewScript: "dev"
75624
- };
75625
- var c3_default5 = config4;
75626
-
75627
- // templates-experimental/next/c3.ts
75628
- var generate3 = async (ctx) => {
75629
- await runFrameworkGenerator(ctx, [ctx.project.name]);
75630
- };
75631
- var configure2 = async () => {
75632
- const packages = [
75633
- "@opennextjs/cloudflare@0.5.x",
75634
- "@cloudflare/workers-types"
75635
- ];
75636
- await installPackages(packages, {
75637
- dev: true,
75638
- startText: "Adding the Cloudflare adapter",
75639
- doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
75640
- });
75641
- updateNextConfig();
75642
- };
75643
- var updateNextConfig = () => {
75644
- const s = spinner();
75645
- const configFile = "next.config.mjs";
75646
- s.start(`Updating \`${configFile}\``);
75647
- const configContent = readFile(configFile);
75648
- const updatedConfigFile = configContent + `
75649
- // added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
75650
- import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
75651
- initOpenNextCloudflareForDev();
75652
- `.replace(/\n\t*/g, "\n");
75653
- writeFile2(configFile, updatedConfigFile);
75654
- s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
75655
- };
75656
- var c3_default6 = {
75657
- configVersion: 1,
75658
- id: "next",
75659
- 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",
75664
- platform: "workers",
75665
- displayName: "Next.js (using Node.js compat + Workers Assets)",
75666
- path: "templates-experimental/next",
75667
- copyFiles: {
75668
- path: "./templates"
75669
- },
75670
- generate: generate3,
75671
- configure: configure2,
75672
- transformPackageJson: async () => ({
75673
- scripts: {
75674
- deploy: `opennextjs-cloudflare && wrangler deploy`,
75675
- preview: `opennextjs-cloudflare && wrangler dev`,
75676
- "cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
75677
- }
75678
- }),
75679
- devScript: "dev",
75680
- previewScript: "preview",
75681
- deployScript: "deploy",
75682
- compatibilityFlags: ["nodejs_compat"]
75683
- };
75684
-
75685
- // templates-experimental/qwik/c3.ts
75686
- var recast3 = __toESM(require_main3());
75687
- var { npm, npx: npx2, name } = detectPackageManager();
75688
- var generate4 = async (ctx) => {
75689
- await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
75690
- };
75691
- var configure3 = async (ctx) => {
75692
- const cmd = [name === "pnpm" ? npm : npx2, "qwik", "add", "cloudflare-pages"];
75693
- endSection(`Running ${quoteShellArgs(cmd)}`);
75694
- await runCommand(cmd);
75695
- removeFile("./public/_headers");
75696
- removeFile("./public/_redirects");
75697
- removeFile("./public/_routes.json");
75698
- addBindingsProxy(ctx);
75699
- populateCloudflareEnv();
75700
- };
75701
- var addBindingsProxy = (ctx) => {
75702
- if (!usesTypescript(ctx)) {
75703
- return;
75704
- }
75705
- const s = spinner();
75706
- s.start("Updating `vite.config.ts`");
75707
- const snippets = loadTemplateSnippets(ctx);
75708
- const b3 = recast3.types.builders;
75709
- transformFile("vite.config.ts", {
75710
- // Insert the env declaration after the last import (but before the rest of the body)
75711
- visitProgram: function(n) {
75712
- const lastImportIndex = n.node.body.findLastIndex(
75713
- (t2) => t2.type === "ImportDeclaration"
75714
- );
75715
- const lastImport = n.get("body", lastImportIndex);
75716
- lastImport.insertAfter(...snippets.getPlatformProxyTs);
75717
- return this.traverse(n);
75718
- },
75719
- // Pass the `platform` object from the declaration to the `qwikCity` plugin
75720
- visitCallExpression: function(n) {
75721
- const callee = n.node.callee;
75722
- if (callee.name !== "qwikCity") {
75723
- return this.traverse(n);
75724
- }
75725
- const configArgument = n.node.arguments[0];
75726
- const platformPropery = b3.objectProperty.from({
75727
- key: b3.identifier("platform"),
75728
- value: b3.identifier("platform"),
75729
- shorthand: true
75730
- });
75731
- if (!configArgument) {
75732
- n.node.arguments = [b3.objectExpression([platformPropery])];
75733
- return false;
75734
- }
75735
- if (configArgument.type !== "ObjectExpression") {
75736
- crash("Failed to update `vite.config.ts`");
75737
- }
75738
- configArgument.properties.push(platformPropery);
75739
- return false;
75740
- }
75741
- });
75742
- s.stop(`${brandColor("updated")} \`vite.config.ts\``);
75743
- };
75744
- var populateCloudflareEnv = () => {
75745
- const entrypointPath = "src/entry.cloudflare-pages.tsx";
75746
- const s = spinner();
75747
- s.start(`Updating \`${entrypointPath}\``);
75748
- transformFile(entrypointPath, {
75749
- visitTSInterfaceDeclaration: function(n) {
75750
- const b3 = recast3.types.builders;
75751
- const id = n.node.id;
75752
- if (id.name !== "QwikCityPlatform") {
75753
- this.traverse(n);
75754
- }
75755
- const newBody = [
75756
- ["env", "Env"]
75757
- // Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
75758
- // ["cf", "CfProperties"],
75759
- ].map(
75760
- ([varName, type]) => b3.tsPropertySignature(
75761
- b3.identifier(varName),
75762
- b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
75763
- )
75764
- );
75765
- n.node.body.body = newBody;
75766
- return false;
75767
- }
75768
- });
75769
- s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
75770
- };
75771
- var config5 = {
75772
- configVersion: 1,
75773
- id: "qwik",
75774
- frameworkCli: "create-qwik",
75775
- displayName: "Qwik",
75776
- platform: "workers",
75777
- copyFiles: {
75778
- path: "./templates"
75779
- },
75780
- path: "templates-experimental/qwik",
75781
- generate: generate4,
75782
- configure: configure3,
75783
- transformPackageJson: async () => ({
75784
- scripts: {
75785
- deploy: `${npm} run build && wrangler deploy`,
75786
- preview: `${npm} run build && wrangler dev`,
75787
- "cf-typegen": `wrangler types`
75788
- }
75789
- }),
75790
- devScript: "dev",
75791
- deployScript: "deploy",
75792
- previewScript: "preview"
75793
- };
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;
75837
-
75838
75457
  // src/helpers/compatDate.ts
75839
75458
  var import_fs9 = require("fs");
75840
75459
  var import_path9 = require("path");
@@ -75888,18 +75507,18 @@ function getLatestTypesEntrypoint(ctx) {
75888
75507
  }
75889
75508
 
75890
75509
  // templates-experimental/solid/c3.ts
75891
- var recast4 = __toESM(require_main3());
75892
- var { npm: npm3 } = detectPackageManager();
75893
- var generate6 = async (ctx) => {
75510
+ var recast2 = __toESM(require_main3());
75511
+ var { npm } = detectPackageManager();
75512
+ var generate = async (ctx) => {
75894
75513
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
75895
75514
  logRaw("");
75896
75515
  };
75897
- var configure5 = async (ctx) => {
75516
+ var configure = async (ctx) => {
75898
75517
  const packages = ["nitropack"];
75899
75518
  await installPackages(packages, {
75900
75519
  dev: true,
75901
75520
  startText: "Installing nitro module `nitropack`",
75902
- doneText: `${brandColor("installed")} ${dim(`via \`${npm3} install\``)}`
75521
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
75903
75522
  });
75904
75523
  usesTypescript(ctx);
75905
75524
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
@@ -75911,7 +75530,7 @@ var configure5 = async (ctx) => {
75911
75530
  if (callee.name !== "defineConfig") {
75912
75531
  return this.traverse(n);
75913
75532
  }
75914
- const b3 = recast4.types.builders;
75533
+ const b3 = recast2.types.builders;
75915
75534
  mergeObjectProperties(
75916
75535
  n.node.arguments[0],
75917
75536
  [
@@ -75935,7 +75554,7 @@ var configure5 = async (ctx) => {
75935
75554
  }
75936
75555
  });
75937
75556
  };
75938
- var config7 = {
75557
+ var config = {
75939
75558
  configVersion: 1,
75940
75559
  id: "solid",
75941
75560
  frameworkCli: "create-solid",
@@ -75945,12 +75564,12 @@ var config7 = {
75945
75564
  path: "./templates"
75946
75565
  },
75947
75566
  path: "templates-experimental/solid",
75948
- generate: generate6,
75949
- configure: configure5,
75567
+ generate,
75568
+ configure,
75950
75569
  transformPackageJson: async () => ({
75951
75570
  scripts: {
75952
- preview: `${npm3} run build && npx wrangler dev`,
75953
- deploy: `${npm3} run build && wrangler deploy`
75571
+ preview: `${npm} run build && npx wrangler dev`,
75572
+ deploy: `${npm} run build && wrangler deploy`
75954
75573
  }
75955
75574
  }),
75956
75575
  compatibilityFlags: ["nodejs_compat"],
@@ -75958,111 +75577,12 @@ var config7 = {
75958
75577
  deployScript: "deploy",
75959
75578
  previewScript: "preview"
75960
75579
  };
75961
- var c3_default9 = config7;
75962
-
75963
- // templates-experimental/svelte/c3.ts
75964
- var import_node_os3 = require("node:os");
75965
- var recast5 = __toESM(require_main3());
75966
- var { npm: npm4 } = detectPackageManager();
75967
- var generate7 = async (ctx) => {
75968
- await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
75969
- logRaw("");
75970
- };
75971
- var configure6 = async (ctx) => {
75972
- const pkg = `@sveltejs/adapter-cloudflare`;
75973
- await installPackages([pkg], {
75974
- dev: true,
75975
- startText: "Adding the Cloudflare Pages adapter",
75976
- doneText: `${brandColor(`installed`)} ${dim(pkg)}`
75977
- });
75978
- updateSvelteConfig();
75979
- updateTypeDefinitions(ctx);
75980
- };
75981
- var updateSvelteConfig = () => {
75982
- updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
75983
- transformFile("svelte.config.js", {
75984
- visitImportDeclaration: function(n) {
75985
- const importSource = n.value.source;
75986
- if (importSource.value === "@sveltejs/adapter-auto") {
75987
- importSource.value = "@sveltejs/adapter-cloudflare";
75988
- }
75989
- return false;
75990
- }
75991
- });
75992
- };
75993
- var updateTypeDefinitions = (ctx) => {
75994
- if (!usesTypescript(ctx)) {
75995
- return;
75996
- }
75997
- updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
75998
- const b3 = recast5.types.builders;
75999
- transformFile("src/app.d.ts", {
76000
- visitTSModuleDeclaration(n) {
76001
- if (n.value.id.name === "App" && n.node.body) {
76002
- const moduleBlock = n.node.body;
76003
- const platformInterface = b3.tsInterfaceDeclaration(
76004
- b3.identifier("Platform"),
76005
- b3.tsInterfaceBody([
76006
- b3.tsPropertySignature(
76007
- b3.identifier("env"),
76008
- b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier("Env")))
76009
- ),
76010
- b3.tsPropertySignature(
76011
- b3.identifier("cf"),
76012
- b3.tsTypeAnnotation(
76013
- b3.tsTypeReference(b3.identifier("CfProperties"))
76014
- )
76015
- ),
76016
- b3.tsPropertySignature(
76017
- b3.identifier("ctx"),
76018
- b3.tsTypeAnnotation(
76019
- b3.tsTypeReference(b3.identifier("ExecutionContext"))
76020
- )
76021
- )
76022
- ])
76023
- );
76024
- moduleBlock.body.unshift(platformInterface);
76025
- }
76026
- this.traverse(n);
76027
- }
76028
- });
76029
- };
76030
- var config8 = {
76031
- configVersion: 1,
76032
- id: "svelte",
76033
- frameworkCli: "sv",
76034
- displayName: "SvelteKit",
76035
- platform: "workers",
76036
- copyFiles: {
76037
- path: "./templates"
76038
- },
76039
- path: "templates-experimental/svelte",
76040
- generate: generate7,
76041
- configure: configure6,
76042
- transformPackageJson: async (original, ctx) => {
76043
- let scripts = {
76044
- preview: `${npm4} run build && wrangler dev`,
76045
- deploy: `${npm4} run build && wrangler deploy`
76046
- };
76047
- if (usesTypescript(ctx)) {
76048
- const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
76049
- scripts = {
76050
- ...scripts,
76051
- "cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
76052
- };
76053
- }
76054
- return { scripts };
76055
- },
76056
- devScript: "dev",
76057
- deployScript: "deploy",
76058
- previewScript: "preview"
76059
- };
76060
- var c3_default10 = config8;
75580
+ var c3_default = config;
76061
75581
 
76062
75582
  // templates/analog/c3.ts
76063
- var recast6 = __toESM(require_main3());
76064
- var { npm: npm5, name: pm } = detectPackageManager();
76065
- var generate8 = async (ctx) => {
75583
+ var recast3 = __toESM(require_main3());
75584
+ var { npm: npm2, name: pm } = detectPackageManager();
75585
+ var generate2 = async (ctx) => {
76066
75586
  await runFrameworkGenerator(ctx, [
76067
75587
  ctx.project.name,
76068
75588
  "--template",
@@ -76070,7 +75590,7 @@ var generate8 = async (ctx) => {
76070
75590
  ]);
76071
75591
  logRaw("");
76072
75592
  };
76073
- var configure7 = async (ctx) => {
75593
+ var configure2 = async (ctx) => {
76074
75594
  if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
76075
75595
  const packages = [];
76076
75596
  packages.push("nitropack");
@@ -76080,7 +75600,7 @@ var configure7 = async (ctx) => {
76080
75600
  await installPackages(packages, {
76081
75601
  dev: true,
76082
75602
  startText: `Installing ${packages.join(", ")}`,
76083
- doneText: `${brandColor("installed")} ${dim(`via \`${npm5} install\``)}`
75603
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm2} install\``)}`
76084
75604
  });
76085
75605
  }
76086
75606
  updateViteConfig(ctx);
@@ -76101,7 +75621,7 @@ var updateEnvTypes = (ctx) => {
76101
75621
  s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
76102
75622
  };
76103
75623
  var updateViteConfig = (ctx) => {
76104
- const b3 = recast6.types.builders;
75624
+ const b3 = recast3.types.builders;
76105
75625
  const s = spinner();
76106
75626
  const configFile = "vite.config.ts";
76107
75627
  s.start(`Updating \`${configFile}\``);
@@ -76138,7 +75658,7 @@ var updateViteConfig = (ctx) => {
76138
75658
  });
76139
75659
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76140
75660
  };
76141
- var config9 = {
75661
+ var config2 = {
76142
75662
  configVersion: 1,
76143
75663
  id: "analog",
76144
75664
  frameworkCli: "create-analog",
@@ -76147,12 +75667,12 @@ var config9 = {
76147
75667
  copyFiles: {
76148
75668
  path: "./templates"
76149
75669
  },
76150
- generate: generate8,
76151
- configure: configure7,
75670
+ generate: generate2,
75671
+ configure: configure2,
76152
75672
  transformPackageJson: async () => ({
76153
75673
  scripts: {
76154
- preview: `${npm5} run build && wrangler pages dev`,
76155
- deploy: `${npm5} run build && wrangler pages deploy`,
75674
+ preview: `${npm2} run build && wrangler pages dev`,
75675
+ deploy: `${npm2} run build && wrangler pages deploy`,
76156
75676
  "cf-typegen": `wrangler types`
76157
75677
  }
76158
75678
  }),
@@ -76160,12 +75680,12 @@ var config9 = {
76160
75680
  deployScript: "deploy",
76161
75681
  previewScript: "preview"
76162
75682
  };
76163
- var c3_default11 = config9;
75683
+ var c3_default2 = config2;
76164
75684
 
76165
75685
  // templates/angular/pages/c3.ts
76166
75686
  var import_node_path3 = require("node:path");
76167
- var { npm: npm6 } = detectPackageManager();
76168
- var generate9 = async (ctx) => {
75687
+ var { npm: npm3 } = detectPackageManager();
75688
+ var generate3 = async (ctx) => {
76169
75689
  await runFrameworkGenerator(ctx, [
76170
75690
  ctx.project.name,
76171
75691
  "--ssr",
@@ -76173,7 +75693,7 @@ var generate9 = async (ctx) => {
76173
75693
  ]);
76174
75694
  logRaw("");
76175
75695
  };
76176
- var configure8 = async (ctx) => {
75696
+ var configure3 = async (ctx) => {
76177
75697
  updateAngularJson(ctx);
76178
75698
  await updateAppCode();
76179
75699
  await installCFWorker();
@@ -76182,7 +75702,7 @@ async function installCFWorker() {
76182
75702
  await installPackages(["xhr2"], {
76183
75703
  dev: true,
76184
75704
  startText: "Installing additional dependencies",
76185
- doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
75705
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm3} install\``)}`
76186
75706
  });
76187
75707
  }
76188
75708
  async function updateAppCode() {
@@ -76224,7 +75744,7 @@ function updateAngularJson(ctx) {
76224
75744
  writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
76225
75745
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
76226
75746
  }
76227
- var config10 = {
75747
+ var config3 = {
76228
75748
  configVersion: 1,
76229
75749
  id: "angular",
76230
75750
  frameworkCli: "@angular/create",
@@ -76237,23 +75757,23 @@ var config10 = {
76237
75757
  devScript: "start",
76238
75758
  deployScript: "deploy",
76239
75759
  previewScript: "start",
76240
- generate: generate9,
76241
- configure: configure8,
75760
+ generate: generate3,
75761
+ configure: configure3,
76242
75762
  transformPackageJson: async () => ({
76243
75763
  scripts: {
76244
- start: `${npm6} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
76245
- build: `ng build && ${npm6} run process`,
75764
+ start: `${npm3} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
75765
+ build: `ng build && ${npm3} run process`,
76246
75766
  process: "node ./tools/copy-files.mjs",
76247
- deploy: `${npm6} run build && wrangler pages deploy dist/cloudflare`
75767
+ deploy: `${npm3} run build && wrangler pages deploy dist/cloudflare`
76248
75768
  }
76249
75769
  })
76250
75770
  };
76251
- var c3_default12 = config10;
75771
+ var c3_default3 = config3;
76252
75772
 
76253
75773
  // templates/angular/workers/c3.ts
76254
75774
  var import_node_path4 = require("node:path");
76255
- var { npm: npm7 } = detectPackageManager();
76256
- var generate10 = async (ctx) => {
75775
+ var { npm: npm4 } = detectPackageManager();
75776
+ var generate4 = async (ctx) => {
76257
75777
  await runFrameworkGenerator(ctx, [
76258
75778
  ctx.project.name,
76259
75779
  "--ssr",
@@ -76261,7 +75781,7 @@ var generate10 = async (ctx) => {
76261
75781
  ]);
76262
75782
  logRaw("");
76263
75783
  };
76264
- var configure9 = async (ctx) => {
75784
+ var configure4 = async (ctx) => {
76265
75785
  updateAngularJson2(ctx);
76266
75786
  await updateAppCode2();
76267
75787
  await installCFWorker2();
@@ -76270,7 +75790,7 @@ async function installCFWorker2() {
76270
75790
  await installPackages(["xhr2"], {
76271
75791
  dev: true,
76272
75792
  startText: "Installing additional dependencies",
76273
- doneText: `${brandColor("installed")} ${dim(`via \`${npm7} install\``)}`
75793
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm4} install\``)}`
76274
75794
  });
76275
75795
  }
76276
75796
  async function updateAppCode2() {
@@ -76311,7 +75831,7 @@ function updateAngularJson2(ctx) {
76311
75831
  writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
76312
75832
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
76313
75833
  }
76314
- var config11 = {
75834
+ var config4 = {
76315
75835
  configVersion: 1,
76316
75836
  id: "angular",
76317
75837
  frameworkCli: "@angular/create",
@@ -76324,43 +75844,43 @@ var config11 = {
76324
75844
  devScript: "start",
76325
75845
  deployScript: "deploy",
76326
75846
  previewScript: "start",
76327
- generate: generate10,
76328
- configure: configure9,
75847
+ generate: generate4,
75848
+ configure: configure4,
76329
75849
  transformPackageJson: async () => ({
76330
75850
  scripts: {
76331
- start: `${npm7} run build && wrangler dev`,
75851
+ start: `${npm4} run build && wrangler dev`,
76332
75852
  build: `ng build`,
76333
- deploy: `${npm7} run build && wrangler deploy`
75853
+ deploy: `${npm4} run build && wrangler deploy`
76334
75854
  }
76335
75855
  })
76336
75856
  };
76337
- var c3_default13 = config11;
75857
+ var c3_default4 = config4;
76338
75858
 
76339
75859
  // templates/angular/c3.ts
76340
- var config12 = {
75860
+ var config5 = {
76341
75861
  displayName: "Angular",
76342
- platformVariants: { pages: c3_default12, workers: c3_default13 }
75862
+ platformVariants: { pages: c3_default3, workers: c3_default4 }
76343
75863
  };
76344
- var c3_default14 = config12;
75864
+ var c3_default5 = config5;
76345
75865
 
76346
- // templates/astro/c3.ts
76347
- var recast7 = __toESM(require_main3());
76348
- var { npx: npx3 } = detectPackageManager();
76349
- var generate11 = async (ctx) => {
75866
+ // templates/astro/pages/c3.ts
75867
+ var recast4 = __toESM(require_main3());
75868
+ var { npx } = detectPackageManager();
75869
+ var generate5 = async (ctx) => {
76350
75870
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
76351
75871
  logRaw("");
76352
75872
  };
76353
- var configure10 = async () => {
76354
- await runCommand([npx3, "astro", "add", "cloudflare", "-y"], {
75873
+ var configure5 = async () => {
75874
+ await runCommand([npx, "astro", "add", "cloudflare", "-y"], {
76355
75875
  silent: true,
76356
75876
  startText: "Installing adapter",
76357
75877
  doneText: `${brandColor("installed")} ${dim(
76358
- `via \`${npx3} astro add cloudflare\``
75878
+ `via \`${npx} astro add cloudflare\``
76359
75879
  )}`
76360
75880
  });
76361
- updateAstroConfig2();
75881
+ updateAstroConfig();
76362
75882
  };
76363
- var updateAstroConfig2 = () => {
75883
+ var updateAstroConfig = () => {
76364
75884
  const filePath = "astro.config.mjs";
76365
75885
  updateStatus(`Updating configuration in ${blue(filePath)}`);
76366
75886
  transformFile(filePath, {
@@ -76369,7 +75889,7 @@ var updateAstroConfig2 = () => {
76369
75889
  if (callee.name !== "cloudflare") {
76370
75890
  return this.traverse(n);
76371
75891
  }
76372
- const b3 = recast7.types.builders;
75892
+ const b3 = recast4.types.builders;
76373
75893
  n.node.arguments = [
76374
75894
  b3.objectExpression([
76375
75895
  b3.objectProperty(
@@ -76384,12 +75904,13 @@ var updateAstroConfig2 = () => {
76384
75904
  }
76385
75905
  });
76386
75906
  };
76387
- var config13 = {
75907
+ var config6 = {
76388
75908
  configVersion: 1,
76389
75909
  id: "astro",
76390
75910
  frameworkCli: "create-astro",
76391
75911
  platform: "pages",
76392
75912
  displayName: "Astro",
75913
+ path: "templates/astro/pages",
76393
75914
  copyFiles: {
76394
75915
  async selectVariant(ctx) {
76395
75916
  return usesTypescript(ctx) ? "ts" : "js";
@@ -76406,8 +75927,8 @@ var config13 = {
76406
75927
  devScript: "dev",
76407
75928
  deployScript: "deploy",
76408
75929
  previewScript: "preview",
76409
- generate: generate11,
76410
- configure: configure10,
75930
+ generate: generate5,
75931
+ configure: configure5,
76411
75932
  transformPackageJson: async (pkgJson, ctx) => ({
76412
75933
  scripts: {
76413
75934
  deploy: `astro build && wrangler pages deploy`,
@@ -76416,10 +75937,93 @@ var config13 = {
76416
75937
  }
76417
75938
  })
76418
75939
  };
76419
- var c3_default15 = config13;
75940
+ var c3_default6 = config6;
75941
+
75942
+ // templates/astro/workers/c3.ts
75943
+ var recast5 = __toESM(require_main3());
75944
+ var { npx: npx2 } = detectPackageManager();
75945
+ var generate6 = async (ctx) => {
75946
+ await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
75947
+ logRaw("");
75948
+ };
75949
+ var configure6 = async () => {
75950
+ await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
75951
+ silent: true,
75952
+ startText: "Installing adapter",
75953
+ doneText: `${brandColor("installed")} ${dim(
75954
+ `via \`${npx2} astro add cloudflare\``
75955
+ )}`
75956
+ });
75957
+ updateAstroConfig2();
75958
+ };
75959
+ var updateAstroConfig2 = () => {
75960
+ const filePath = "astro.config.mjs";
75961
+ updateStatus(`Updating configuration in ${blue(filePath)}`);
75962
+ transformFile(filePath, {
75963
+ visitCallExpression: function(n) {
75964
+ const callee = n.node.callee;
75965
+ if (callee.name !== "cloudflare") {
75966
+ return this.traverse(n);
75967
+ }
75968
+ const b3 = recast5.types.builders;
75969
+ n.node.arguments = [
75970
+ b3.objectExpression([
75971
+ b3.objectProperty(
75972
+ b3.identifier("platformProxy"),
75973
+ b3.objectExpression([
75974
+ b3.objectProperty(b3.identifier("enabled"), b3.booleanLiteral(true))
75975
+ ])
75976
+ )
75977
+ ])
75978
+ ];
75979
+ return false;
75980
+ }
75981
+ });
75982
+ };
75983
+ var config7 = {
75984
+ configVersion: 1,
75985
+ id: "astro",
75986
+ frameworkCli: "create-astro",
75987
+ platform: "workers",
75988
+ displayName: "Astro",
75989
+ copyFiles: {
75990
+ async selectVariant(ctx) {
75991
+ return usesTypescript(ctx) ? "ts" : "js";
75992
+ },
75993
+ variants: {
75994
+ js: {
75995
+ path: "./templates/js"
75996
+ },
75997
+ ts: {
75998
+ path: "./templates/ts"
75999
+ }
76000
+ }
76001
+ },
76002
+ devScript: "dev",
76003
+ deployScript: "deploy",
76004
+ previewScript: "preview",
76005
+ path: "templates/astro/workers",
76006
+ generate: generate6,
76007
+ configure: configure6,
76008
+ transformPackageJson: async (pkgJson, ctx) => ({
76009
+ scripts: {
76010
+ deploy: `astro build && wrangler deploy`,
76011
+ preview: `astro build && wrangler dev`,
76012
+ ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
76013
+ }
76014
+ })
76015
+ };
76016
+ var c3_default7 = config7;
76017
+
76018
+ // templates/astro/c3.ts
76019
+ var config8 = {
76020
+ displayName: "Astro",
76021
+ platformVariants: { pages: c3_default6, workers: c3_default7 }
76022
+ };
76023
+ var c3_default8 = config8;
76420
76024
 
76421
76025
  // templates/common/c3.ts
76422
- var c3_default16 = {
76026
+ var config9 = {
76423
76027
  configVersion: 1,
76424
76028
  id: "common",
76425
76029
  displayName: "Example router & proxy Worker",
@@ -76437,38 +76041,39 @@ var c3_default16 = {
76437
76041
  }
76438
76042
  }
76439
76043
  };
76044
+ var c3_default9 = config9;
76440
76045
 
76441
76046
  // templates/docusaurus/pages/c3.ts
76442
- var { npm: npm8 } = detectPackageManager();
76443
- var generate12 = async (ctx) => {
76047
+ var { npm: npm5 } = detectPackageManager();
76048
+ var generate7 = async (ctx) => {
76444
76049
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
76445
76050
  };
76446
- var config14 = {
76051
+ var config10 = {
76447
76052
  configVersion: 1,
76448
76053
  id: "docusaurus",
76449
76054
  frameworkCli: "create-docusaurus",
76450
76055
  platform: "pages",
76451
76056
  displayName: "Docusaurus",
76452
76057
  path: "templates/docusaurus/pages",
76453
- generate: generate12,
76058
+ generate: generate7,
76454
76059
  transformPackageJson: async () => ({
76455
76060
  scripts: {
76456
- preview: `${npm8} run build && wrangler pages dev ./build`,
76457
- deploy: `${npm8} run build && wrangler pages deploy ./build`
76061
+ preview: `${npm5} run build && wrangler pages dev ./build`,
76062
+ deploy: `${npm5} run build && wrangler pages deploy ./build`
76458
76063
  }
76459
76064
  }),
76460
76065
  devScript: "preview",
76461
76066
  deployScript: "deploy",
76462
76067
  previewScript: "preview"
76463
76068
  };
76464
- var c3_default17 = config14;
76069
+ var c3_default10 = config10;
76465
76070
 
76466
76071
  // templates/docusaurus/workers/c3.ts
76467
- var { npm: npm9 } = detectPackageManager();
76468
- var generate13 = async (ctx) => {
76072
+ var { npm: npm6 } = detectPackageManager();
76073
+ var generate8 = async (ctx) => {
76469
76074
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
76470
76075
  };
76471
- var config15 = {
76076
+ var config11 = {
76472
76077
  configVersion: 1,
76473
76078
  id: "docusaurus",
76474
76079
  frameworkCli: "create-docusaurus",
@@ -76478,29 +76083,29 @@ var config15 = {
76478
76083
  path: "./templates"
76479
76084
  },
76480
76085
  path: "templates/docusaurus/workers",
76481
- generate: generate13,
76086
+ generate: generate8,
76482
76087
  transformPackageJson: async () => ({
76483
76088
  scripts: {
76484
- deploy: `${npm9} run build && wrangler deploy`,
76485
- preview: `${npm9} run build && wrangler dev`
76089
+ deploy: `${npm6} run build && wrangler deploy`,
76090
+ preview: `${npm6} run build && wrangler dev`
76486
76091
  }
76487
76092
  }),
76488
76093
  devScript: "start",
76489
76094
  deployScript: "deploy",
76490
76095
  previewScript: "preview"
76491
76096
  };
76492
- var c3_default18 = config15;
76097
+ var c3_default11 = config11;
76493
76098
 
76494
76099
  // templates/docusaurus/c3.ts
76495
- var config16 = {
76100
+ var config12 = {
76496
76101
  displayName: "Docusaurus",
76497
- platformVariants: { pages: c3_default17, workers: c3_default18 }
76102
+ platformVariants: { pages: c3_default10, workers: c3_default11 }
76498
76103
  };
76499
- var c3_default19 = config16;
76104
+ var c3_default12 = config12;
76500
76105
 
76501
76106
  // templates/gatsby/pages/c3.ts
76502
- var { npm: npm10 } = detectPackageManager();
76503
- var generate14 = async (ctx) => {
76107
+ var { npm: npm7 } = detectPackageManager();
76108
+ var generate9 = async (ctx) => {
76504
76109
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
76505
76110
  const useTemplate = await inputPrompt({
76506
76111
  type: "confirm",
@@ -76519,29 +76124,29 @@ var generate14 = async (ctx) => {
76519
76124
  }
76520
76125
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
76521
76126
  };
76522
- var config17 = {
76127
+ var config13 = {
76523
76128
  configVersion: 1,
76524
76129
  id: "gatsby",
76525
76130
  frameworkCli: "gatsby",
76526
76131
  platform: "pages",
76527
76132
  displayName: "Gatsby",
76528
76133
  path: "templates/gatsby/pages",
76529
- generate: generate14,
76134
+ generate: generate9,
76530
76135
  transformPackageJson: async () => ({
76531
76136
  scripts: {
76532
- deploy: `${npm10} run build && wrangler pages deploy ./public`,
76533
- preview: `${npm10} run build && wrangler pages dev ./public`
76137
+ deploy: `${npm7} run build && wrangler pages deploy ./public`,
76138
+ preview: `${npm7} run build && wrangler pages dev ./public`
76534
76139
  }
76535
76140
  }),
76536
76141
  devScript: "develop",
76537
76142
  deployScript: "deploy",
76538
76143
  previewScript: "preview"
76539
76144
  };
76540
- var c3_default20 = config17;
76145
+ var c3_default13 = config13;
76541
76146
 
76542
76147
  // templates/gatsby/workers/c3.ts
76543
- var { npm: npm11 } = detectPackageManager();
76544
- var generate15 = async (ctx) => {
76148
+ var { npm: npm8 } = detectPackageManager();
76149
+ var generate10 = async (ctx) => {
76545
76150
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
76546
76151
  const useTemplate = await inputPrompt({
76547
76152
  type: "confirm",
@@ -76560,7 +76165,7 @@ var generate15 = async (ctx) => {
76560
76165
  }
76561
76166
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
76562
76167
  };
76563
- var config18 = {
76168
+ var config14 = {
76564
76169
  configVersion: 1,
76565
76170
  id: "gatsby",
76566
76171
  frameworkCli: "gatsby",
@@ -76570,32 +76175,67 @@ var config18 = {
76570
76175
  path: "./templates"
76571
76176
  },
76572
76177
  path: "templates/gatsby/workers",
76573
- generate: generate15,
76178
+ generate: generate10,
76574
76179
  transformPackageJson: async () => ({
76575
76180
  scripts: {
76576
- deploy: `${npm11} run build && wrangler deploy`,
76577
- preview: `${npm11} run build && wrangler dev`
76181
+ deploy: `${npm8} run build && wrangler deploy`,
76182
+ preview: `${npm8} run build && wrangler dev`
76578
76183
  }
76579
76184
  }),
76580
76185
  devScript: "develop",
76581
76186
  deployScript: "deploy",
76582
76187
  previewScript: "preview"
76583
76188
  };
76584
- var c3_default21 = config18;
76189
+ var c3_default14 = config14;
76585
76190
 
76586
76191
  // templates/gatsby/c3.ts
76587
- var config19 = {
76192
+ var config15 = {
76588
76193
  displayName: "Gatsby",
76589
- platformVariants: { pages: c3_default20, workers: c3_default21 }
76194
+ platformVariants: { pages: c3_default13, workers: c3_default14 }
76195
+ };
76196
+ var c3_default15 = config15;
76197
+
76198
+ // templates/hello-world-assets-only/c3.ts
76199
+ var config16 = {
76200
+ configVersion: 1,
76201
+ id: "hello-world-assets-only",
76202
+ path: "templates/hello-world-assets-only",
76203
+ displayName: "Assets only",
76204
+ description: "For static sites (including SPAs) or when using your own backend",
76205
+ platform: "workers",
76206
+ copyFiles: {
76207
+ path: "./templates"
76208
+ }
76209
+ };
76210
+ var c3_default16 = config16;
76211
+
76212
+ // templates/hello-world-durable-object-with-assets/c3.ts
76213
+ var config17 = {
76214
+ configVersion: 1,
76215
+ id: "hello-world-durable-object-with-assets",
76216
+ path: "templates/hello-world-durable-object-with-assets",
76217
+ displayName: "Worker + Durable Objects + Assets",
76218
+ description: "For full-stack applications requiring static assets, an API, and real-time coordination",
76219
+ platform: "workers",
76220
+ copyFiles: {
76221
+ variants: {
76222
+ js: {
76223
+ path: "./js"
76224
+ },
76225
+ ts: {
76226
+ path: "./ts"
76227
+ }
76228
+ }
76229
+ }
76590
76230
  };
76591
- var c3_default22 = config19;
76231
+ var c3_default17 = config17;
76592
76232
 
76593
76233
  // templates/hello-world-durable-object/c3.ts
76594
- var c3_default23 = {
76234
+ var config18 = {
76595
76235
  configVersion: 1,
76596
76236
  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",
76237
+ displayName: "Worker + Durable Objects",
76238
+ description: "For multiplayer apps using WebSockets, or when you need synchronization",
76599
76239
  platform: "workers",
76600
76240
  copyFiles: {
76601
76241
  variants: {
@@ -76608,15 +76248,40 @@ var c3_default23 = {
76608
76248
  }
76609
76249
  }
76610
76250
  };
76251
+ var c3_default18 = config18;
76252
+
76253
+ // templates/hello-world-with-assets/c3.ts
76254
+ var config19 = {
76255
+ configVersion: 1,
76256
+ id: "hello-world-with-assets",
76257
+ path: "templates/hello-world-with-assets",
76258
+ displayName: "Worker + Assets",
76259
+ description: "For static sites with an API or server-side rendering (SSR)",
76260
+ platform: "workers",
76261
+ copyFiles: {
76262
+ variants: {
76263
+ js: {
76264
+ path: "./js"
76265
+ },
76266
+ ts: {
76267
+ path: "./ts"
76268
+ },
76269
+ python: {
76270
+ path: "./py"
76271
+ }
76272
+ }
76273
+ }
76274
+ };
76275
+ var c3_default19 = config19;
76611
76276
 
76612
76277
  // templates/hello-world/c3.ts
76613
76278
  var import_promises2 = require("node:fs/promises");
76614
76279
  var import_node_path5 = require("node:path");
76615
- var c3_default24 = {
76280
+ var c3_default20 = {
76616
76281
  configVersion: 1,
76617
76282
  id: "hello-world",
76618
- displayName: "Hello World Worker",
76619
- description: "Get started with a basic Worker in the language of your choice",
76283
+ displayName: "Worker only",
76284
+ description: "For processing requests, transforming responses, or API endpoints",
76620
76285
  platform: "workers",
76621
76286
  async configure(ctx) {
76622
76287
  if (ctx.args.lang === "python") {
@@ -76645,35 +76310,56 @@ var c3_default24 = {
76645
76310
  }
76646
76311
  };
76647
76312
 
76648
- // templates/hono/c3.ts
76649
- var generate16 = async (ctx) => {
76313
+ // templates/hono/pages/c3.ts
76314
+ var generate11 = async (ctx) => {
76650
76315
  const { name: pm4 } = detectPackageManager();
76651
76316
  await runFrameworkGenerator(ctx, [
76652
76317
  ctx.project.name,
76653
76318
  "--template",
76654
- "cloudflare-workers",
76319
+ "cloudflare-pages",
76655
76320
  "--install",
76656
76321
  "--pm",
76657
76322
  pm4
76658
76323
  ]);
76659
76324
  logRaw("");
76660
76325
  };
76661
- var configure11 = async (ctx) => {
76662
- const indexFile = "src/index.ts";
76663
- const s = spinner();
76664
- s.start(`Updating \`${indexFile}\``);
76665
- const snippets = loadTemplateSnippets(ctx);
76666
- transformFile(indexFile, {
76667
- visitVariableDeclarator(n) {
76668
- if (n.node.id.type === "Identifier" && n.node.id.name === "app") {
76669
- n.node.init = snippets.appDeclarationTs[0];
76670
- return false;
76671
- }
76326
+ var config20 = {
76327
+ configVersion: 1,
76328
+ id: "hono",
76329
+ frameworkCli: "create-hono",
76330
+ displayName: "Hono",
76331
+ copyFiles: {
76332
+ path: "./templates"
76333
+ },
76334
+ path: "templates/hono/pages",
76335
+ platform: "pages",
76336
+ generate: generate11,
76337
+ transformPackageJson: async () => ({
76338
+ scripts: {
76339
+ "cf-typegen": "wrangler types --env-interface CloudflareBindings",
76340
+ preview: "vite build && wrangler pages dev"
76672
76341
  }
76673
- });
76674
- s.stop(`${brandColor("updated")} \`${dim(indexFile)}\``);
76342
+ }),
76343
+ devScript: "dev",
76344
+ deployScript: "deploy",
76345
+ previewScript: "preview"
76675
76346
  };
76676
- var config20 = {
76347
+ var c3_default21 = config20;
76348
+
76349
+ // templates/hono/workers/c3.ts
76350
+ var generate12 = async (ctx) => {
76351
+ const { name: pm4 } = detectPackageManager();
76352
+ await runFrameworkGenerator(ctx, [
76353
+ ctx.project.name,
76354
+ "--template",
76355
+ "cloudflare-workers",
76356
+ "--install",
76357
+ "--pm",
76358
+ pm4
76359
+ ]);
76360
+ logRaw("");
76361
+ };
76362
+ var config21 = {
76677
76363
  configVersion: 1,
76678
76364
  id: "hono",
76679
76365
  frameworkCli: "create-hono",
@@ -76682,12 +76368,10 @@ var config20 = {
76682
76368
  path: "./templates"
76683
76369
  },
76684
76370
  platform: "workers",
76685
- generate: generate16,
76686
- configure: configure11,
76371
+ path: "templates/hono/workers",
76372
+ generate: generate12,
76687
76373
  transformPackageJson: async () => ({
76688
76374
  scripts: {
76689
- dev: "wrangler dev",
76690
- deploy: "wrangler deploy --minify",
76691
76375
  "cf-typegen": "wrangler types --env-interface CloudflareBindings"
76692
76376
  }
76693
76377
  }),
@@ -76695,19 +76379,26 @@ var config20 = {
76695
76379
  deployScript: "deploy",
76696
76380
  previewScript: "dev"
76697
76381
  };
76698
- var c3_default25 = config20;
76382
+ var c3_default22 = config21;
76699
76383
 
76700
- // templates/next/c3.ts
76384
+ // templates/hono/c3.ts
76385
+ var config22 = {
76386
+ displayName: "Hono",
76387
+ platformVariants: { pages: c3_default21, workers: c3_default22 }
76388
+ };
76389
+ var c3_default23 = config22;
76390
+
76391
+ // templates/next/pages/c3.ts
76701
76392
  var import_path10 = require("path");
76702
- var { npm: npm12, npx: npx4 } = detectPackageManager();
76703
- var generate17 = async (ctx) => {
76393
+ var { npm: npm9, npx: npx3 } = detectPackageManager();
76394
+ var generate13 = async (ctx) => {
76704
76395
  const projectName = ctx.project.name;
76705
76396
  await runFrameworkGenerator(ctx, [projectName]);
76706
76397
  const wranglerConfig = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.jsonc"));
76707
76398
  writeFile2((0, import_path10.join)(ctx.project.path, "wrangler.jsonc"), wranglerConfig);
76708
76399
  updateStatus("Created wrangler.jsonc file");
76709
76400
  };
76710
- var updateNextConfig2 = (usesTs) => {
76401
+ var updateNextConfig = (usesTs) => {
76711
76402
  const s = spinner();
76712
76403
  const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
76713
76404
  s.start(`Updating \`${configFile}\``);
@@ -76725,7 +76416,7 @@ var updateNextConfig2 = (usesTs) => {
76725
76416
  writeFile2(configFile, updatedConfigFile);
76726
76417
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76727
76418
  };
76728
- var configure12 = async (ctx) => {
76419
+ var configure7 = async (ctx) => {
76729
76420
  const projectPath = ctx.project.path;
76730
76421
  const path6 = probePaths([
76731
76422
  `${projectPath}/pages/api`,
@@ -76750,7 +76441,7 @@ var configure12 = async (ctx) => {
76750
76441
  if (installEslintPlugin) {
76751
76442
  await writeEslintrc(ctx);
76752
76443
  }
76753
- updateNextConfig2(usesTs);
76444
+ updateNextConfig(usesTs);
76754
76445
  copyFile(
76755
76446
  (0, import_path10.join)(getTemplatePath(ctx), "README.md"),
76756
76447
  (0, import_path10.join)(projectPath, "README.md")
@@ -76800,14 +76491,15 @@ var addDevDependencies = async (installEslintPlugin) => {
76800
76491
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
76801
76492
  });
76802
76493
  };
76803
- var c3_default26 = {
76494
+ var c3_default24 = {
76804
76495
  configVersion: 1,
76805
76496
  id: "next",
76806
76497
  frameworkCli: "create-next-app",
76807
76498
  platform: "pages",
76808
76499
  displayName: "Next.js",
76809
- generate: generate17,
76810
- configure: configure12,
76500
+ path: "templates/next/pages",
76501
+ generate: generate13,
76502
+ configure: configure7,
76811
76503
  copyFiles: {
76812
76504
  async selectVariant(ctx) {
76813
76505
  const isApp = probePaths([
@@ -76838,12 +76530,12 @@ var c3_default26 = {
76838
76530
  }
76839
76531
  },
76840
76532
  transformPackageJson: async (_3, ctx) => {
76841
- const isNpm = npm12 === "npm";
76842
- const isBun = npm12 === "bun";
76533
+ const isNpm = npm9 === "npm";
76534
+ const isBun = npm9 === "bun";
76843
76535
  const isNpmOrBun = isNpm || isBun;
76844
76536
  const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
76845
76537
  const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
76846
- const pmCommand = isNpmOrBun ? npx4 : npm12;
76538
+ const pmCommand = isNpmOrBun ? npx3 : npm9;
76847
76539
  const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
76848
76540
  return {
76849
76541
  scripts: {
@@ -76862,22 +76554,86 @@ var c3_default26 = {
76862
76554
  compatibilityFlags: ["nodejs_compat"]
76863
76555
  };
76864
76556
 
76557
+ // templates/next/workers/c3.ts
76558
+ var generate14 = async (ctx) => {
76559
+ await runFrameworkGenerator(ctx, [ctx.project.name]);
76560
+ };
76561
+ var configure8 = async (ctx) => {
76562
+ const packages = [
76563
+ "@opennextjs/cloudflare@~1.0.0-beta.0 || ^1.0.0",
76564
+ "@cloudflare/workers-types"
76565
+ ];
76566
+ await installPackages(packages, {
76567
+ dev: true,
76568
+ startText: "Adding the Cloudflare adapter",
76569
+ doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
76570
+ });
76571
+ const usesTs = usesTypescript(ctx);
76572
+ updateNextConfig2(usesTs);
76573
+ };
76574
+ var updateNextConfig2 = (usesTs) => {
76575
+ const s = spinner();
76576
+ const configFile = `next.config.${usesTs ? "ts" : "mjs"}`;
76577
+ s.start(`Updating \`${configFile}\``);
76578
+ const configContent = readFile(configFile);
76579
+ const updatedConfigFile = configContent + `
76580
+ // added by create cloudflare to enable calling \`getCloudflareContext()\` in \`next dev\`
76581
+ import { initOpenNextCloudflareForDev } from '@opennextjs/cloudflare';
76582
+ initOpenNextCloudflareForDev();
76583
+ `.replace(/\n\t*/g, "\n");
76584
+ writeFile2(configFile, updatedConfigFile);
76585
+ s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76586
+ };
76587
+ var c3_default25 = {
76588
+ configVersion: 1,
76589
+ id: "next",
76590
+ frameworkCli: "create-next-app",
76591
+ frameworkCliPinnedVersion: "~15.2.4",
76592
+ platform: "workers",
76593
+ displayName: "Next.js (using Node.js compat + Workers Assets)",
76594
+ path: "templates/next/workers",
76595
+ copyFiles: {
76596
+ path: "./templates"
76597
+ },
76598
+ generate: generate14,
76599
+ configure: configure8,
76600
+ transformPackageJson: async () => ({
76601
+ scripts: {
76602
+ deploy: `opennextjs-cloudflare build && opennextjs-cloudflare deploy`,
76603
+ preview: `opennextjs-cloudflare build && opennextjs-cloudflare preview`,
76604
+ "cf-typegen": `wrangler types --env-interface CloudflareEnv cloudflare-env.d.ts`
76605
+ }
76606
+ }),
76607
+ devScript: "dev",
76608
+ previewScript: "preview",
76609
+ deployScript: "deploy",
76610
+ compatibilityFlags: ["nodejs_compat"]
76611
+ };
76612
+
76613
+ // templates/next/c3.ts
76614
+ var config23 = {
76615
+ displayName: "Next.js",
76616
+ platformVariants: { pages: c3_default24, workers: c3_default25 }
76617
+ };
76618
+ var c3_default26 = config23;
76619
+
76865
76620
  // templates/nuxt/pages/c3.ts
76866
- var recast8 = __toESM(require_main3());
76867
- var { npm: npm13, name: pm2 } = detectPackageManager();
76868
- var generate18 = async (ctx) => {
76621
+ var recast6 = __toESM(require_main3());
76622
+ var { npm: npm10, name: pm2 } = detectPackageManager();
76623
+ var generate15 = async (ctx) => {
76869
76624
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
76870
76625
  await runFrameworkGenerator(ctx, [
76871
76626
  "init",
76872
76627
  ctx.project.name,
76873
76628
  "--packageManager",
76874
- npm13,
76629
+ npm10,
76630
+ "--no-install",
76875
76631
  gitFlag
76876
76632
  ]);
76877
76633
  writeFile2("./.node-version", "18");
76878
76634
  logRaw("");
76879
76635
  };
76880
- var configure13 = async (ctx) => {
76636
+ var configure9 = async (ctx) => {
76881
76637
  const packages = ["nitro-cloudflare-dev"];
76882
76638
  if (pm2 === "pnpm") {
76883
76639
  packages.push("h3");
@@ -76885,7 +76641,7 @@ var configure13 = async (ctx) => {
76885
76641
  await installPackages(packages, {
76886
76642
  dev: true,
76887
76643
  startText: "Installing nitro module `nitro-cloudflare-dev`",
76888
- doneText: `${brandColor("installed")} ${dim(`via \`${npm13} install\``)}`
76644
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
76889
76645
  });
76890
76646
  updateNuxtConfig();
76891
76647
  updateEnvTypes2(ctx);
@@ -76908,7 +76664,7 @@ var updateNuxtConfig = () => {
76908
76664
  const s = spinner();
76909
76665
  const configFile = "nuxt.config.ts";
76910
76666
  s.start(`Updating \`${configFile}\``);
76911
- const b3 = recast8.types.builders;
76667
+ const b3 = recast6.types.builders;
76912
76668
  const presetDef = b3.objectProperty(
76913
76669
  b3.identifier("nitro"),
76914
76670
  b3.objectExpression([
@@ -76946,7 +76702,7 @@ var updateNuxtConfig = () => {
76946
76702
  });
76947
76703
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76948
76704
  };
76949
- var config21 = {
76705
+ var config24 = {
76950
76706
  configVersion: 1,
76951
76707
  id: "nuxt",
76952
76708
  frameworkCli: "nuxi",
@@ -76956,12 +76712,12 @@ var config21 = {
76956
76712
  path: "./templates"
76957
76713
  },
76958
76714
  path: "templates/nuxt/pages",
76959
- generate: generate18,
76960
- configure: configure13,
76715
+ generate: generate15,
76716
+ configure: configure9,
76961
76717
  transformPackageJson: async () => ({
76962
76718
  scripts: {
76963
- deploy: `${npm13} run build && wrangler pages deploy`,
76964
- preview: `${npm13} run build && wrangler pages dev`,
76719
+ deploy: `${npm10} run build && wrangler pages deploy`,
76720
+ preview: `${npm10} run build && wrangler pages dev`,
76965
76721
  "cf-typegen": `wrangler types`
76966
76722
  }
76967
76723
  }),
@@ -76969,24 +76725,25 @@ var config21 = {
76969
76725
  deployScript: "deploy",
76970
76726
  previewScript: "preview"
76971
76727
  };
76972
- var c3_default27 = config21;
76728
+ var c3_default27 = config24;
76973
76729
 
76974
76730
  // templates/nuxt/workers/c3.ts
76975
- var recast9 = __toESM(require_main3());
76976
- var { npm: npm14, name: pm3 } = detectPackageManager();
76977
- var generate19 = async (ctx) => {
76731
+ var recast7 = __toESM(require_main3());
76732
+ var { npm: npm11, name: pm3 } = detectPackageManager();
76733
+ var generate16 = async (ctx) => {
76978
76734
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
76979
76735
  await runFrameworkGenerator(ctx, [
76980
76736
  "init",
76981
76737
  ctx.project.name,
76982
76738
  "--packageManager",
76983
- npm14,
76739
+ npm11,
76740
+ "--no-install",
76984
76741
  gitFlag
76985
76742
  ]);
76986
76743
  writeFile2("./.node-version", "18");
76987
76744
  logRaw("");
76988
76745
  };
76989
- var configure14 = async (ctx) => {
76746
+ var configure10 = async (ctx) => {
76990
76747
  const packages = ["nitro-cloudflare-dev", "nitropack"];
76991
76748
  if (pm3 === "pnpm") {
76992
76749
  packages.push("h3");
@@ -76994,7 +76751,7 @@ var configure14 = async (ctx) => {
76994
76751
  await installPackages(packages, {
76995
76752
  dev: true,
76996
76753
  startText: "Installing nitro module `nitro-cloudflare-dev`",
76997
- doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
76754
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
76998
76755
  });
76999
76756
  updateNuxtConfig2();
77000
76757
  updateEnvTypes3(ctx);
@@ -77017,7 +76774,7 @@ var updateNuxtConfig2 = () => {
77017
76774
  const s = spinner();
77018
76775
  const configFile = "nuxt.config.ts";
77019
76776
  s.start(`Updating \`${configFile}\``);
77020
- const b3 = recast9.types.builders;
76777
+ const b3 = recast7.types.builders;
77021
76778
  const presetDef = b3.objectProperty(
77022
76779
  b3.identifier("nitro"),
77023
76780
  b3.objectExpression([
@@ -77055,7 +76812,7 @@ var updateNuxtConfig2 = () => {
77055
76812
  });
77056
76813
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
77057
76814
  };
77058
- var config22 = {
76815
+ var config25 = {
77059
76816
  configVersion: 1,
77060
76817
  id: "nuxt",
77061
76818
  frameworkCli: "nuxi",
@@ -77065,12 +76822,12 @@ var config22 = {
77065
76822
  path: "./templates"
77066
76823
  },
77067
76824
  path: "templates/nuxt/workers",
77068
- generate: generate19,
77069
- configure: configure14,
76825
+ generate: generate16,
76826
+ configure: configure10,
77070
76827
  transformPackageJson: async () => ({
77071
76828
  scripts: {
77072
- deploy: `${npm14} run build && wrangler deploy`,
77073
- preview: `${npm14} run build && wrangler dev`,
76829
+ deploy: `${npm11} run build && wrangler deploy`,
76830
+ preview: `${npm11} run build && wrangler dev`,
77074
76831
  "cf-typegen": `wrangler types`
77075
76832
  }
77076
76833
  }),
@@ -77078,17 +76835,17 @@ var config22 = {
77078
76835
  deployScript: "deploy",
77079
76836
  previewScript: "preview"
77080
76837
  };
77081
- var c3_default28 = config22;
76838
+ var c3_default28 = config25;
77082
76839
 
77083
76840
  // templates/nuxt/c3.ts
77084
- var config23 = {
76841
+ var config26 = {
77085
76842
  displayName: "Nuxt",
77086
76843
  platformVariants: { pages: c3_default27, workers: c3_default28 }
77087
76844
  };
77088
- var c3_default29 = config23;
76845
+ var c3_default29 = config26;
77089
76846
 
77090
76847
  // templates/openapi/c3.ts
77091
- var c3_default30 = {
76848
+ var config27 = {
77092
76849
  configVersion: 1,
77093
76850
  id: "openapi",
77094
76851
  displayName: "API starter (OpenAPI compliant)",
@@ -77098,6 +76855,7 @@ var c3_default30 = {
77098
76855
  path: "./ts"
77099
76856
  }
77100
76857
  };
76858
+ var c3_default30 = config27;
77101
76859
 
77102
76860
  // templates/pre-existing/c3.ts
77103
76861
  var import_promises3 = require("fs/promises");
@@ -77247,10 +77005,11 @@ async function copyExistingWorkerFiles(ctx) {
77247
77005
  (0, import_path11.join)(ctx.project.path, "wrangler.toml")
77248
77006
  );
77249
77007
  }
77250
- var c3_default31 = {
77008
+ var config28 = {
77251
77009
  configVersion: 1,
77252
77010
  id: "pre-existing",
77253
77011
  displayName: "Pre-existing Worker (from Dashboard)",
77012
+ description: "Fetch a Worker initialized from the Cloudflare dashboard.",
77254
77013
  platform: "workers",
77255
77014
  hidden: true,
77256
77015
  copyFiles: {
@@ -77262,8 +77021,9 @@ var c3_default31 = {
77262
77021
  copyFiles: copyExistingWorkerFiles
77263
77022
  })
77264
77023
  };
77024
+ var c3_default31 = config28;
77265
77025
  function buildConfigure(params) {
77266
- return async function configure22(ctx) {
77026
+ return async function configure21(ctx) {
77267
77027
  const loginSuccess = await params.login(ctx);
77268
77028
  if (!loginSuccess) {
77269
77029
  throw new Error("Failed to login to Cloudflare");
@@ -77275,7 +77035,7 @@ function buildConfigure(params) {
77275
77035
  }
77276
77036
 
77277
77037
  // templates/queues/c3.ts
77278
- var c3_default32 = {
77038
+ var config29 = {
77279
77039
  configVersion: 1,
77280
77040
  id: "queues",
77281
77041
  displayName: "Queue consumer & producer Worker",
@@ -77302,17 +77062,129 @@ var c3_default32 = {
77302
77062
  ]
77303
77063
  }
77304
77064
  };
77065
+ var c3_default32 = config29;
77305
77066
 
77306
- // templates/qwik/c3.ts
77307
- var recast10 = __toESM(require_main3());
77308
- var { npm: npm15, npx: npx5, name: name2 } = detectPackageManager();
77309
- var generate20 = async (ctx) => {
77067
+ // templates/qwik/pages/c3.ts
77068
+ var recast8 = __toESM(require_main3());
77069
+ var { npm: npm12, npx: npx4, name } = detectPackageManager();
77070
+ var generate17 = async (ctx) => {
77071
+ await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
77072
+ };
77073
+ var configure11 = async (ctx) => {
77074
+ const cmd = [name === "pnpm" ? npm12 : npx4, "qwik", "add", "cloudflare-pages"];
77075
+ endSection(`Running ${quoteShellArgs(cmd)}`);
77076
+ await runCommand(cmd);
77077
+ addBindingsProxy(ctx);
77078
+ populateCloudflareEnv();
77079
+ };
77080
+ var addBindingsProxy = (ctx) => {
77081
+ if (!usesTypescript(ctx)) {
77082
+ return;
77083
+ }
77084
+ const s = spinner();
77085
+ s.start("Updating `vite.config.ts`");
77086
+ const snippets = loadTemplateSnippets(ctx);
77087
+ const b3 = recast8.types.builders;
77088
+ transformFile("vite.config.ts", {
77089
+ // Insert the env declaration after the last import (but before the rest of the body)
77090
+ visitProgram: function(n) {
77091
+ const lastImportIndex = n.node.body.findLastIndex(
77092
+ (t2) => t2.type === "ImportDeclaration"
77093
+ );
77094
+ const lastImport = n.get("body", lastImportIndex);
77095
+ lastImport.insertAfter(...snippets.getPlatformProxyTs);
77096
+ return this.traverse(n);
77097
+ },
77098
+ // Pass the `platform` object from the declaration to the `qwikCity` plugin
77099
+ visitCallExpression: function(n) {
77100
+ const callee = n.node.callee;
77101
+ if (callee.name !== "qwikCity") {
77102
+ return this.traverse(n);
77103
+ }
77104
+ const configArgument = n.node.arguments[0];
77105
+ const platformPropery = b3.objectProperty.from({
77106
+ key: b3.identifier("platform"),
77107
+ value: b3.identifier("platform"),
77108
+ shorthand: true
77109
+ });
77110
+ if (!configArgument) {
77111
+ n.node.arguments = [b3.objectExpression([platformPropery])];
77112
+ return false;
77113
+ }
77114
+ if (configArgument.type !== "ObjectExpression") {
77115
+ throw new Error("Failed to update `vite.config.ts`");
77116
+ }
77117
+ configArgument.properties.push(platformPropery);
77118
+ return false;
77119
+ }
77120
+ });
77121
+ s.stop(`${brandColor("updated")} \`vite.config.ts\``);
77122
+ };
77123
+ var populateCloudflareEnv = () => {
77124
+ const entrypointPath = "src/entry.cloudflare-pages.tsx";
77125
+ const s = spinner();
77126
+ s.start(`Updating \`${entrypointPath}\``);
77127
+ transformFile(entrypointPath, {
77128
+ visitTSInterfaceDeclaration: function(n) {
77129
+ const b3 = recast8.types.builders;
77130
+ const id = n.node.id;
77131
+ if (id.name !== "QwikCityPlatform") {
77132
+ this.traverse(n);
77133
+ }
77134
+ const newBody = [
77135
+ ["env", "Env"]
77136
+ // Qwik doesn't supply `cf` to the platform object. Should they do so, uncomment this
77137
+ // ["cf", "CfProperties"],
77138
+ ].map(
77139
+ ([varName, type]) => b3.tsPropertySignature(
77140
+ b3.identifier(varName),
77141
+ b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier(type)))
77142
+ )
77143
+ );
77144
+ n.node.body.body = newBody;
77145
+ return false;
77146
+ }
77147
+ });
77148
+ s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
77149
+ };
77150
+ var config30 = {
77151
+ configVersion: 1,
77152
+ id: "qwik",
77153
+ frameworkCli: "create-qwik",
77154
+ displayName: "Qwik",
77155
+ platform: "pages",
77156
+ copyFiles: {
77157
+ path: "./templates"
77158
+ },
77159
+ path: "templates/qwik/pages",
77160
+ generate: generate17,
77161
+ configure: configure11,
77162
+ transformPackageJson: async () => ({
77163
+ scripts: {
77164
+ deploy: `${npm12} run build && wrangler pages deploy`,
77165
+ preview: `${npm12} run build && wrangler pages dev`,
77166
+ "cf-typegen": `wrangler types`
77167
+ }
77168
+ }),
77169
+ devScript: "dev",
77170
+ deployScript: "deploy",
77171
+ previewScript: "preview"
77172
+ };
77173
+ var c3_default33 = config30;
77174
+
77175
+ // templates/qwik/workers/c3.ts
77176
+ var recast9 = __toESM(require_main3());
77177
+ var { npm: npm13, npx: npx5, name: name2 } = detectPackageManager();
77178
+ var generate18 = async (ctx) => {
77310
77179
  await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
77311
77180
  };
77312
- var configure15 = async (ctx) => {
77313
- const cmd = [name2 === "pnpm" ? npm15 : npx5, "qwik", "add", "cloudflare-pages"];
77181
+ var configure12 = async (ctx) => {
77182
+ const cmd = [name2 === "pnpm" ? npm13 : npx5, "qwik", "add", "cloudflare-pages"];
77314
77183
  endSection(`Running ${quoteShellArgs(cmd)}`);
77315
77184
  await runCommand(cmd);
77185
+ removeFile("./public/_headers");
77186
+ removeFile("./public/_redirects");
77187
+ removeFile("./public/_routes.json");
77316
77188
  addBindingsProxy2(ctx);
77317
77189
  populateCloudflareEnv2();
77318
77190
  };
@@ -77323,7 +77195,7 @@ var addBindingsProxy2 = (ctx) => {
77323
77195
  const s = spinner();
77324
77196
  s.start("Updating `vite.config.ts`");
77325
77197
  const snippets = loadTemplateSnippets(ctx);
77326
- const b3 = recast10.types.builders;
77198
+ const b3 = recast9.types.builders;
77327
77199
  transformFile("vite.config.ts", {
77328
77200
  // Insert the env declaration after the last import (but before the rest of the body)
77329
77201
  visitProgram: function(n) {
@@ -77351,7 +77223,7 @@ var addBindingsProxy2 = (ctx) => {
77351
77223
  return false;
77352
77224
  }
77353
77225
  if (configArgument.type !== "ObjectExpression") {
77354
- throw new Error("Failed to update `vite.config.ts`");
77226
+ crash("Failed to update `vite.config.ts`");
77355
77227
  }
77356
77228
  configArgument.properties.push(platformPropery);
77357
77229
  return false;
@@ -77365,7 +77237,7 @@ var populateCloudflareEnv2 = () => {
77365
77237
  s.start(`Updating \`${entrypointPath}\``);
77366
77238
  transformFile(entrypointPath, {
77367
77239
  visitTSInterfaceDeclaration: function(n) {
77368
- const b3 = recast10.types.builders;
77240
+ const b3 = recast9.types.builders;
77369
77241
  const id = n.node.id;
77370
77242
  if (id.name !== "QwikCityPlatform") {
77371
77243
  this.traverse(n);
@@ -77386,21 +77258,22 @@ var populateCloudflareEnv2 = () => {
77386
77258
  });
77387
77259
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
77388
77260
  };
77389
- var config24 = {
77261
+ var config31 = {
77390
77262
  configVersion: 1,
77391
77263
  id: "qwik",
77392
77264
  frameworkCli: "create-qwik",
77393
77265
  displayName: "Qwik",
77394
- platform: "pages",
77266
+ platform: "workers",
77395
77267
  copyFiles: {
77396
77268
  path: "./templates"
77397
77269
  },
77398
- generate: generate20,
77399
- configure: configure15,
77270
+ path: "templates/qwik/workers",
77271
+ generate: generate18,
77272
+ configure: configure12,
77400
77273
  transformPackageJson: async () => ({
77401
77274
  scripts: {
77402
- deploy: `${npm15} run build && wrangler pages deploy`,
77403
- preview: `${npm15} run build && wrangler pages dev`,
77275
+ deploy: `${npm13} run build && wrangler deploy`,
77276
+ preview: `${npm13} run build && wrangler dev`,
77404
77277
  "cf-typegen": `wrangler types`
77405
77278
  }
77406
77279
  }),
@@ -77408,11 +77281,55 @@ var config24 = {
77408
77281
  deployScript: "deploy",
77409
77282
  previewScript: "preview"
77410
77283
  };
77411
- var c3_default33 = config24;
77284
+ var c3_default34 = config31;
77285
+
77286
+ // templates/qwik/c3.ts
77287
+ var config32 = {
77288
+ displayName: "Qwik",
77289
+ platformVariants: { pages: c3_default33, workers: c3_default34 }
77290
+ };
77291
+ var c3_default35 = config32;
77292
+
77293
+ // templates/react-router/c3.ts
77294
+ var { npm: npm14 } = detectPackageManager();
77295
+ var generate19 = async (ctx) => {
77296
+ await runFrameworkGenerator(ctx, [
77297
+ ctx.project.name,
77298
+ "--template",
77299
+ "https://github.com/remix-run/react-router-templates/tree/main/cloudflare",
77300
+ // to prevent asking about git twice, just let c3 do it
77301
+ "--no-git-init",
77302
+ "--no-install"
77303
+ ]);
77304
+ logRaw("");
77305
+ };
77306
+ var config33 = {
77307
+ configVersion: 1,
77308
+ id: "react-router",
77309
+ platform: "workers",
77310
+ frameworkCli: "create-react-router",
77311
+ displayName: "React Router (formerly Remix)",
77312
+ copyFiles: {
77313
+ path: "./templates"
77314
+ },
77315
+ generate: generate19,
77316
+ // configure,
77317
+ transformPackageJson: async () => ({
77318
+ scripts: {
77319
+ deploy: `${npm14} run build && wrangler deploy`,
77320
+ preview: `${npm14} run build && vite preview`,
77321
+ "cf-typegen": `wrangler types`
77322
+ }
77323
+ }),
77324
+ devScript: "dev",
77325
+ deployScript: "deploy",
77326
+ previewScript: "preview"
77327
+ };
77328
+ var c3_default36 = config33;
77412
77329
 
77413
77330
  // templates/react/pages/c3.ts
77414
- var { npm: npm16 } = detectPackageManager();
77415
- var generate21 = async (ctx) => {
77331
+ var { npm: npm15 } = detectPackageManager();
77332
+ var generate20 = async (ctx) => {
77416
77333
  const variant = await inputPrompt({
77417
77334
  type: "select",
77418
77335
  question: "Select a variant:",
@@ -77441,7 +77358,7 @@ var variantsOptions = [
77441
77358
  label: "JavaScript + SWC"
77442
77359
  }
77443
77360
  ];
77444
- var config25 = {
77361
+ var config34 = {
77445
77362
  configVersion: 1,
77446
77363
  id: "react",
77447
77364
  // React's documentation now recommends using create-vite.
@@ -77449,26 +77366,26 @@ var config25 = {
77449
77366
  displayName: "React",
77450
77367
  platform: "pages",
77451
77368
  path: "templates/react/pages",
77452
- generate: generate21,
77369
+ generate: generate20,
77453
77370
  transformPackageJson: async () => ({
77454
77371
  scripts: {
77455
- deploy: `${npm16} run build && wrangler pages deploy ./dist`,
77456
- preview: `${npm16} run build && wrangler pages dev ./dist`
77372
+ deploy: `${npm15} run build && wrangler pages deploy ./dist`,
77373
+ preview: `${npm15} run build && wrangler pages dev ./dist`
77457
77374
  }
77458
77375
  }),
77459
77376
  devScript: "dev",
77460
77377
  deployScript: "deploy",
77461
77378
  previewScript: "preview"
77462
77379
  };
77463
- var c3_default34 = config25;
77380
+ var c3_default37 = config34;
77464
77381
 
77465
77382
  // templates/react/workers/c3.ts
77466
77383
  var import_assert2 = __toESM(require("assert"));
77467
- var recast11 = __toESM(require_main3());
77468
- var b2 = recast11.types.builders;
77469
- var t = recast11.types.namedTypes;
77470
- var { npm: npm17 } = detectPackageManager();
77471
- var generate22 = async (ctx) => {
77384
+ var recast10 = __toESM(require_main3());
77385
+ var b2 = recast10.types.builders;
77386
+ var t = recast10.types.namedTypes;
77387
+ var { npm: npm16 } = detectPackageManager();
77388
+ var generate21 = async (ctx) => {
77472
77389
  const variant = await getVariant();
77473
77390
  ctx.args.lang = variant.lang;
77474
77391
  await runFrameworkGenerator(ctx, [
@@ -77478,7 +77395,7 @@ var generate22 = async (ctx) => {
77478
77395
  ]);
77479
77396
  logRaw("");
77480
77397
  };
77481
- var configure16 = async (ctx) => {
77398
+ var configure13 = async (ctx) => {
77482
77399
  await installPackages(["@cloudflare/vite-plugin"], {
77483
77400
  dev: true,
77484
77401
  startText: "Installing the Cloudflare Vite plugin",
@@ -77509,9 +77426,9 @@ function transformViteConfig(ctx) {
77509
77426
  if (callee.name !== "defineConfig") {
77510
77427
  return this.traverse(n);
77511
77428
  }
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));
77429
+ const config48 = n.node.arguments[0];
77430
+ (0, import_assert2.default)(t.ObjectExpression.check(config48));
77431
+ const pluginsProp = config48.properties.find((prop) => isPluginsProp(prop));
77515
77432
  (0, import_assert2.default)(pluginsProp && t.ArrayExpression.check(pluginsProp.value));
77516
77433
  pluginsProp.value.elements.push(
77517
77434
  b2.callExpression(b2.identifier("cloudflare"), [])
@@ -77568,7 +77485,7 @@ async function getVariant() {
77568
77485
  (0, import_assert2.default)(selected, "Expected a variant to be selected");
77569
77486
  return selected;
77570
77487
  }
77571
- var config26 = {
77488
+ var config35 = {
77572
77489
  configVersion: 1,
77573
77490
  id: "react",
77574
77491
  frameworkCli: "create-vite",
@@ -77585,12 +77502,12 @@ var config26 = {
77585
77502
  }
77586
77503
  }
77587
77504
  },
77588
- generate: generate22,
77589
- configure: configure16,
77505
+ generate: generate21,
77506
+ configure: configure13,
77590
77507
  transformPackageJson: async (_3, ctx) => ({
77591
77508
  scripts: {
77592
- deploy: `${npm17} run build && wrangler deploy`,
77593
- preview: `${npm17} run build && vite preview`,
77509
+ deploy: `${npm16} run build && wrangler deploy`,
77510
+ preview: `${npm16} run build && vite preview`,
77594
77511
  ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
77595
77512
  }
77596
77513
  }),
@@ -77598,18 +77515,18 @@ var config26 = {
77598
77515
  deployScript: "deploy",
77599
77516
  previewScript: "preview"
77600
77517
  };
77601
- var c3_default35 = config26;
77518
+ var c3_default38 = config35;
77602
77519
 
77603
77520
  // templates/react/c3.ts
77604
- var config27 = {
77521
+ var config36 = {
77605
77522
  displayName: "React",
77606
- platformVariants: { pages: c3_default34, workers: c3_default35 }
77523
+ platformVariants: { pages: c3_default37, workers: c3_default38 }
77607
77524
  };
77608
- var c3_default36 = config27;
77525
+ var c3_default39 = config36;
77609
77526
 
77610
- // templates/remix/c3.ts
77611
- var { npm: npm18 } = detectPackageManager();
77612
- var generate23 = async (ctx) => {
77527
+ // templates/remix/pages/c3.ts
77528
+ var { npm: npm17 } = detectPackageManager();
77529
+ var generate22 = async (ctx) => {
77613
77530
  await runFrameworkGenerator(ctx, [
77614
77531
  ctx.project.name,
77615
77532
  "--template",
@@ -77617,7 +77534,7 @@ var generate23 = async (ctx) => {
77617
77534
  ]);
77618
77535
  logRaw("");
77619
77536
  };
77620
- var configure17 = async () => {
77537
+ var configure14 = async () => {
77621
77538
  const typeDefsPath = "load-context.ts";
77622
77539
  const s = spinner();
77623
77540
  s.start(`Updating \`${typeDefsPath}\``);
@@ -77632,7 +77549,7 @@ var configure17 = async () => {
77632
77549
  });
77633
77550
  s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
77634
77551
  };
77635
- var config28 = {
77552
+ var config37 = {
77636
77553
  configVersion: 1,
77637
77554
  id: "remix",
77638
77555
  frameworkCli: "create-remix",
@@ -77641,12 +77558,55 @@ var config28 = {
77641
77558
  copyFiles: {
77642
77559
  path: "./templates"
77643
77560
  },
77561
+ path: "templates/remix/pages",
77562
+ generate: generate22,
77563
+ configure: configure14,
77564
+ transformPackageJson: async () => ({
77565
+ scripts: {
77566
+ deploy: `${npm17} run build && wrangler pages deploy`,
77567
+ preview: `${npm17} run build && wrangler pages dev`,
77568
+ "cf-typegen": `wrangler types`
77569
+ }
77570
+ }),
77571
+ devScript: "dev",
77572
+ deployScript: "deploy",
77573
+ previewScript: "preview"
77574
+ };
77575
+ var c3_default40 = config37;
77576
+
77577
+ // templates/remix/workers/c3.ts
77578
+ var { npm: npm18 } = detectPackageManager();
77579
+ var generate23 = async (ctx) => {
77580
+ await runFrameworkGenerator(ctx, [
77581
+ ctx.project.name,
77582
+ "--template",
77583
+ "https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
77584
+ ]);
77585
+ logRaw("");
77586
+ };
77587
+ var configure15 = async () => {
77588
+ await installPackages(["wrangler@latest"], {
77589
+ dev: true,
77590
+ startText: "Updating the Wrangler version",
77591
+ doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
77592
+ });
77593
+ };
77594
+ var config38 = {
77595
+ configVersion: 1,
77596
+ id: "remix",
77597
+ frameworkCli: "create-remix",
77598
+ platform: "workers",
77599
+ displayName: "Remix",
77600
+ copyFiles: {
77601
+ path: "./templates"
77602
+ },
77603
+ path: "templates/remix/workers",
77644
77604
  generate: generate23,
77645
- configure: configure17,
77605
+ configure: configure15,
77646
77606
  transformPackageJson: async () => ({
77647
77607
  scripts: {
77648
- deploy: `${npm18} run build && wrangler pages deploy`,
77649
- preview: `${npm18} run build && wrangler pages dev`,
77608
+ deploy: `${npm18} run build && wrangler deploy`,
77609
+ preview: `${npm18} run build && wrangler dev`,
77650
77610
  "cf-typegen": `wrangler types`
77651
77611
  }
77652
77612
  }),
@@ -77654,10 +77614,18 @@ var config28 = {
77654
77614
  deployScript: "deploy",
77655
77615
  previewScript: "preview"
77656
77616
  };
77657
- var c3_default37 = config28;
77617
+ var c3_default41 = config38;
77618
+
77619
+ // templates/remix/c3.ts
77620
+ var config39 = {
77621
+ displayName: "Remix",
77622
+ platformVariants: { pages: c3_default40, workers: c3_default41 },
77623
+ hidden: true
77624
+ };
77625
+ var c3_default42 = config39;
77658
77626
 
77659
77627
  // templates/scheduled/c3.ts
77660
- var c3_default38 = {
77628
+ var config40 = {
77661
77629
  configVersion: 1,
77662
77630
  id: "scheduled",
77663
77631
  displayName: "Scheduled Worker (Cron Trigger)",
@@ -77674,15 +77642,16 @@ var c3_default38 = {
77674
77642
  }
77675
77643
  }
77676
77644
  };
77645
+ var c3_default43 = config40;
77677
77646
 
77678
77647
  // templates/solid/c3.ts
77679
- var recast12 = __toESM(require_main3());
77648
+ var recast11 = __toESM(require_main3());
77680
77649
  var { npm: npm19 } = detectPackageManager();
77681
77650
  var generate24 = async (ctx) => {
77682
77651
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
77683
77652
  logRaw("");
77684
77653
  };
77685
- var configure18 = async (ctx) => {
77654
+ var configure16 = async (ctx) => {
77686
77655
  usesTypescript(ctx);
77687
77656
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
77688
77657
  updateStatus(`Updating configuration in ${blue(filePath)}`);
@@ -77692,7 +77661,7 @@ var configure18 = async (ctx) => {
77692
77661
  if (callee.name !== "defineConfig") {
77693
77662
  return this.traverse(n);
77694
77663
  }
77695
- const b3 = recast12.types.builders;
77664
+ const b3 = recast11.types.builders;
77696
77665
  mergeObjectProperties(
77697
77666
  n.node.arguments[0],
77698
77667
  [
@@ -77720,7 +77689,7 @@ var configure18 = async (ctx) => {
77720
77689
  }
77721
77690
  });
77722
77691
  };
77723
- var config29 = {
77692
+ var config41 = {
77724
77693
  configVersion: 1,
77725
77694
  id: "solid",
77726
77695
  frameworkCli: "create-solid",
@@ -77730,7 +77699,7 @@ var config29 = {
77730
77699
  path: "./templates"
77731
77700
  },
77732
77701
  generate: generate24,
77733
- configure: configure18,
77702
+ configure: configure16,
77734
77703
  transformPackageJson: async () => ({
77735
77704
  scripts: {
77736
77705
  preview: `${npm19} run build && npx wrangler pages dev`,
@@ -77742,29 +77711,29 @@ var config29 = {
77742
77711
  deployScript: "deploy",
77743
77712
  previewScript: "preview"
77744
77713
  };
77745
- var c3_default39 = config29;
77714
+ var c3_default44 = config41;
77746
77715
 
77747
- // templates/svelte/c3.ts
77716
+ // templates/svelte/pages/c3.ts
77748
77717
  var import_node_fs3 = require("node:fs");
77749
- var import_node_os4 = require("node:os");
77750
- var recast13 = __toESM(require_main3());
77718
+ var import_node_os3 = require("node:os");
77719
+ var recast12 = __toESM(require_main3());
77751
77720
  var { npm: npm20 } = detectPackageManager();
77752
77721
  var generate25 = async (ctx) => {
77753
77722
  await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
77754
77723
  logRaw("");
77755
77724
  };
77756
- var configure19 = async (ctx) => {
77725
+ var configure17 = async (ctx) => {
77757
77726
  const pkg = `@sveltejs/adapter-cloudflare`;
77758
77727
  await installPackages([pkg], {
77759
77728
  dev: true,
77760
77729
  startText: "Adding the Cloudflare Pages adapter",
77761
77730
  doneText: `${brandColor(`installed`)} ${dim(pkg)}`
77762
77731
  });
77763
- updateSvelteConfig2();
77732
+ updateSvelteConfig();
77764
77733
  updatePlaywrightConfig(usesTypescript(ctx));
77765
- updateTypeDefinitions2(ctx);
77734
+ updateTypeDefinitions(ctx);
77766
77735
  };
77767
- var updateSvelteConfig2 = () => {
77736
+ var updateSvelteConfig = () => {
77768
77737
  updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
77769
77738
  transformFile("svelte.config.js", {
77770
77739
  visitImportDeclaration: function(n) {
@@ -77798,12 +77767,12 @@ var updatePlaywrightConfig = (shouldUseTypescript) => {
77798
77767
  }
77799
77768
  });
77800
77769
  };
77801
- var updateTypeDefinitions2 = (ctx) => {
77770
+ var updateTypeDefinitions = (ctx) => {
77802
77771
  if (!usesTypescript(ctx)) {
77803
77772
  return;
77804
77773
  }
77805
77774
  updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
77806
- const b3 = recast13.types.builders;
77775
+ const b3 = recast12.types.builders;
77807
77776
  transformFile("src/app.d.ts", {
77808
77777
  visitTSModuleDeclaration(n) {
77809
77778
  if (n.value.id.name === "App" && n.node.body) {
@@ -77835,7 +77804,7 @@ var updateTypeDefinitions2 = (ctx) => {
77835
77804
  }
77836
77805
  });
77837
77806
  };
77838
- var config30 = {
77807
+ var config42 = {
77839
77808
  configVersion: 1,
77840
77809
  id: "svelte",
77841
77810
  frameworkCli: "sv",
@@ -77844,15 +77813,16 @@ var config30 = {
77844
77813
  copyFiles: {
77845
77814
  path: "./templates"
77846
77815
  },
77816
+ path: "templates/svelte/pages",
77847
77817
  generate: generate25,
77848
- configure: configure19,
77818
+ configure: configure17,
77849
77819
  transformPackageJson: async (original, ctx) => {
77850
77820
  let scripts = {
77851
77821
  preview: `${npm20} run build && wrangler pages dev`,
77852
77822
  deploy: `${npm20} run build && wrangler pages deploy`
77853
77823
  };
77854
77824
  if (usesTypescript(ctx)) {
77855
- const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
77825
+ const mv = (0, import_node_os3.platform)() === "win32" ? "move" : "mv";
77856
77826
  scripts = {
77857
77827
  ...scripts,
77858
77828
  "cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
@@ -77864,36 +77834,142 @@ var config30 = {
77864
77834
  deployScript: "deploy",
77865
77835
  previewScript: "preview"
77866
77836
  };
77867
- var c3_default40 = config30;
77837
+ var c3_default45 = config42;
77868
77838
 
77869
- // templates/vue/pages/c3.ts
77839
+ // templates/svelte/workers/c3.ts
77840
+ var import_node_os4 = require("node:os");
77841
+ var recast13 = __toESM(require_main3());
77870
77842
  var { npm: npm21 } = detectPackageManager();
77871
77843
  var generate26 = async (ctx) => {
77844
+ await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
77845
+ logRaw("");
77846
+ };
77847
+ var configure18 = async (ctx) => {
77848
+ const pkg = `@sveltejs/adapter-cloudflare`;
77849
+ await installPackages([pkg], {
77850
+ dev: true,
77851
+ startText: "Adding the Cloudflare adapter",
77852
+ doneText: `${brandColor(`installed`)} ${dim(pkg)}`
77853
+ });
77854
+ updateSvelteConfig2();
77855
+ updateTypeDefinitions2(ctx);
77856
+ };
77857
+ var updateSvelteConfig2 = () => {
77858
+ updateStatus(`Changing adapter in ${blue("svelte.config.js")}`);
77859
+ transformFile("svelte.config.js", {
77860
+ visitImportDeclaration: function(n) {
77861
+ const importSource = n.value.source;
77862
+ if (importSource.value === "@sveltejs/adapter-auto") {
77863
+ importSource.value = "@sveltejs/adapter-cloudflare";
77864
+ }
77865
+ return false;
77866
+ }
77867
+ });
77868
+ };
77869
+ var updateTypeDefinitions2 = (ctx) => {
77870
+ if (!usesTypescript(ctx)) {
77871
+ return;
77872
+ }
77873
+ updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
77874
+ const b3 = recast13.types.builders;
77875
+ transformFile("src/app.d.ts", {
77876
+ visitTSModuleDeclaration(n) {
77877
+ if (n.value.id.name === "App" && n.node.body) {
77878
+ const moduleBlock = n.node.body;
77879
+ const platformInterface = b3.tsInterfaceDeclaration(
77880
+ b3.identifier("Platform"),
77881
+ b3.tsInterfaceBody([
77882
+ b3.tsPropertySignature(
77883
+ b3.identifier("env"),
77884
+ b3.tsTypeAnnotation(b3.tsTypeReference(b3.identifier("Env")))
77885
+ ),
77886
+ b3.tsPropertySignature(
77887
+ b3.identifier("cf"),
77888
+ b3.tsTypeAnnotation(
77889
+ b3.tsTypeReference(b3.identifier("CfProperties"))
77890
+ )
77891
+ ),
77892
+ b3.tsPropertySignature(
77893
+ b3.identifier("ctx"),
77894
+ b3.tsTypeAnnotation(
77895
+ b3.tsTypeReference(b3.identifier("ExecutionContext"))
77896
+ )
77897
+ )
77898
+ ])
77899
+ );
77900
+ moduleBlock.body.unshift(platformInterface);
77901
+ }
77902
+ this.traverse(n);
77903
+ }
77904
+ });
77905
+ };
77906
+ var config43 = {
77907
+ configVersion: 1,
77908
+ id: "svelte",
77909
+ frameworkCli: "sv",
77910
+ displayName: "SvelteKit",
77911
+ platform: "workers",
77912
+ copyFiles: {
77913
+ path: "./templates"
77914
+ },
77915
+ path: "templates/svelte/workers",
77916
+ generate: generate26,
77917
+ configure: configure18,
77918
+ transformPackageJson: async (original, ctx) => {
77919
+ let scripts = {
77920
+ preview: `${npm21} run build && wrangler dev`,
77921
+ deploy: `${npm21} run build && wrangler deploy`
77922
+ };
77923
+ if (usesTypescript(ctx)) {
77924
+ const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
77925
+ scripts = {
77926
+ ...scripts,
77927
+ "cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
77928
+ };
77929
+ }
77930
+ return { scripts };
77931
+ },
77932
+ devScript: "dev",
77933
+ deployScript: "deploy",
77934
+ previewScript: "preview"
77935
+ };
77936
+ var c3_default46 = config43;
77937
+
77938
+ // templates/svelte/c3.ts
77939
+ var config44 = {
77940
+ displayName: "SvelteKit",
77941
+ platformVariants: { pages: c3_default45, workers: c3_default46 }
77942
+ };
77943
+ var c3_default47 = config44;
77944
+
77945
+ // templates/vue/pages/c3.ts
77946
+ var { npm: npm22 } = detectPackageManager();
77947
+ var generate27 = async (ctx) => {
77872
77948
  await runFrameworkGenerator(ctx, [ctx.project.name]);
77873
77949
  };
77874
- var config31 = {
77950
+ var config45 = {
77875
77951
  configVersion: 1,
77876
77952
  id: "vue",
77877
77953
  frameworkCli: "create-vue",
77878
77954
  displayName: "Vue",
77879
77955
  platform: "pages",
77880
77956
  path: "templates/pages/vue",
77881
- generate: generate26,
77957
+ generate: generate27,
77882
77958
  transformPackageJson: async () => ({
77883
77959
  scripts: {
77884
- deploy: `${npm21} run build && wrangler pages deploy ./dist`,
77885
- preview: `${npm21} run build && wrangler pages dev ./dist`
77960
+ deploy: `${npm22} run build && wrangler pages deploy ./dist`,
77961
+ preview: `${npm22} run build && wrangler pages dev ./dist`
77886
77962
  }
77887
77963
  }),
77888
77964
  devScript: "dev",
77889
77965
  deployScript: "deploy",
77890
77966
  previewScript: "preview"
77891
77967
  };
77892
- var c3_default41 = config31;
77968
+ var c3_default48 = config45;
77893
77969
 
77894
77970
  // templates/vue/workers/c3.ts
77895
- var { npm: npm22 } = detectPackageManager();
77896
- var generate27 = async (ctx) => {
77971
+ var { npm: npm23 } = detectPackageManager();
77972
+ var generate28 = async (ctx) => {
77897
77973
  const lang = ctx.args.lang ?? await inputPrompt({
77898
77974
  type: "select",
77899
77975
  question: "Would you like to use TypeScript?",
@@ -77910,7 +77986,7 @@ var generate27 = async (ctx) => {
77910
77986
  ]);
77911
77987
  logRaw("");
77912
77988
  };
77913
- var configure20 = async (ctx) => {
77989
+ var configure19 = async (ctx) => {
77914
77990
  await installPackages(["@cloudflare/vite-plugin"], {
77915
77991
  dev: true,
77916
77992
  startText: "Installing the Cloudflare Vite plugin",
@@ -77931,7 +78007,7 @@ function updateTsconfigJson2() {
77931
78007
  writeJSON("tsconfig.json", tsconfig);
77932
78008
  s.stop(`${brandColor(`updated`)} ${dim(`\`tsconfig.json\``)}`);
77933
78009
  }
77934
- var config32 = {
78010
+ var config46 = {
77935
78011
  configVersion: 1,
77936
78012
  id: "vue",
77937
78013
  frameworkCli: "create-vue",
@@ -77951,12 +78027,12 @@ var config32 = {
77951
78027
  }
77952
78028
  }
77953
78029
  },
77954
- configure: configure20,
77955
- generate: generate27,
78030
+ configure: configure19,
78031
+ generate: generate28,
77956
78032
  transformPackageJson: async (_3, ctx) => ({
77957
78033
  scripts: {
77958
- deploy: `${npm22} run build && wrangler deploy`,
77959
- preview: `${npm22} run build && wrangler dev`,
78034
+ deploy: `${npm23} run build && wrangler deploy`,
78035
+ preview: `${npm23} run build && wrangler dev`,
77960
78036
  ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
77961
78037
  }
77962
78038
  }),
@@ -77964,20 +78040,20 @@ var config32 = {
77964
78040
  deployScript: "deploy",
77965
78041
  previewScript: "preview"
77966
78042
  };
77967
- var c3_default42 = config32;
78043
+ var c3_default49 = config46;
77968
78044
 
77969
78045
  // templates/vue/c3.ts
77970
- var config33 = {
78046
+ var config47 = {
77971
78047
  displayName: "Vue",
77972
- platformVariants: { pages: c3_default41, workers: c3_default42 }
78048
+ platformVariants: { pages: c3_default48, workers: c3_default49 }
77973
78049
  };
77974
- var c3_default43 = config33;
78050
+ var c3_default50 = config47;
77975
78051
 
77976
78052
  // src/git.ts
77977
78053
  var import_node_assert = __toESM(require("node:assert"));
77978
78054
 
77979
78055
  // ../wrangler/package.json
77980
- var version2 = "0.0.0-99f802591";
78056
+ var version2 = "0.0.0-9a3d43c20";
77981
78057
 
77982
78058
  // src/git.ts
77983
78059
  var offerGit = async (ctx) => {
@@ -78238,47 +78314,58 @@ var defaultSelectVariant = async (ctx) => {
78238
78314
  function getFrameworkMap({ experimental = false }) {
78239
78315
  if (experimental) {
78240
78316
  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
78317
+ solid: c3_default
78248
78318
  };
78249
78319
  } else {
78250
78320
  return {
78251
- analog: c3_default11,
78252
- angular: c3_default14,
78253
- astro: c3_default15,
78254
- docusaurus: c3_default19,
78255
- gatsby: c3_default22,
78256
- hono: c3_default25,
78321
+ analog: c3_default2,
78322
+ angular: c3_default5,
78323
+ astro: c3_default8,
78324
+ docusaurus: c3_default12,
78325
+ gatsby: c3_default15,
78326
+ hono: c3_default23,
78257
78327
  next: c3_default26,
78258
78328
  nuxt: c3_default29,
78259
- qwik: c3_default33,
78260
- react: c3_default36,
78261
- remix: c3_default37,
78262
- solid: c3_default39,
78263
- svelte: c3_default40,
78264
- vue: c3_default43
78329
+ qwik: c3_default35,
78330
+ react: c3_default39,
78331
+ "react-router": c3_default36,
78332
+ remix: c3_default42,
78333
+ solid: c3_default44,
78334
+ svelte: c3_default47,
78335
+ vue: c3_default50
78265
78336
  };
78266
78337
  }
78267
78338
  }
78268
- function getTemplateMap({ experimental = false }) {
78339
+ function getOtherTemplateMap({
78340
+ experimental = false
78341
+ }) {
78269
78342
  if (experimental) {
78343
+ return {};
78344
+ } else {
78270
78345
  return {
78271
- "hello-world-assets-only": c3_default2,
78272
- "hello-world-with-assets": c3_default4,
78273
- "hello-world-durable-object-with-assets": c3_default3
78346
+ common: c3_default9,
78347
+ scheduled: c3_default43,
78348
+ queues: c3_default32,
78349
+ openapi: c3_default30,
78350
+ "pre-existing": c3_default31
78274
78351
  };
78352
+ }
78353
+ }
78354
+ function getHelloWorldTemplateMap({
78355
+ experimental = false
78356
+ }) {
78357
+ if (experimental) {
78358
+ return {};
78275
78359
  } else {
78276
78360
  return {
78277
- "hello-world": c3_default24,
78278
- common: c3_default16,
78279
- scheduled: c3_default38,
78361
+ "hello-world": c3_default20,
78362
+ "hello-world-assets-only": c3_default16,
78363
+ "hello-world-with-assets": c3_default19,
78364
+ "hello-world-durable-object": c3_default18,
78365
+ "hello-world-durable-object-with-assets": c3_default17,
78366
+ common: c3_default9,
78367
+ scheduled: c3_default43,
78280
78368
  queues: c3_default32,
78281
- "hello-world-durable-object": c3_default23,
78282
78369
  openapi: c3_default30,
78283
78370
  "pre-existing": c3_default31
78284
78371
  };
@@ -78340,6 +78427,12 @@ var deriveCorrelatedArgs = (args) => {
78340
78427
  };
78341
78428
  var createContext = async (args, prevArgs) => {
78342
78429
  deriveCorrelatedArgs(args);
78430
+ const experimental = args.experimental;
78431
+ const frameworkMap = getFrameworkMap({ experimental });
78432
+ const helloWorldTemplateMap = await getHelloWorldTemplateMap({
78433
+ experimental
78434
+ });
78435
+ const otherTemplateMap = await getOtherTemplateMap({ experimental });
78343
78436
  let linesPrinted = 0;
78344
78437
  const goBack = async (from) => {
78345
78438
  const currentArgs = { ...args };
@@ -78386,22 +78479,29 @@ var createContext = async (args, prevArgs) => {
78386
78479
  validate: (value) => validateProjectDirectory(String(value) || C3_DEFAULTS.projectName, args),
78387
78480
  format: (val) => `./${val}`
78388
78481
  });
78389
- const categoryOptions = [
78390
- {
78482
+ const categoryOptions = [];
78483
+ if (Object.keys(helloWorldTemplateMap).length) {
78484
+ categoryOptions.push({
78391
78485
  label: "Hello World example",
78392
78486
  value: "hello-world",
78393
78487
  description: "Select from barebones examples to get started with Workers"
78394
- },
78395
- {
78488
+ });
78489
+ }
78490
+ if (Object.keys(frameworkMap).length) {
78491
+ categoryOptions.push({
78396
78492
  label: "Framework Starter",
78397
78493
  value: "web-framework",
78398
78494
  description: "Select from the most popular full-stack web frameworks"
78399
- },
78400
- {
78495
+ });
78496
+ }
78497
+ if (Object.keys(otherTemplateMap).length) {
78498
+ categoryOptions.push({
78401
78499
  label: "Application Starter",
78402
78500
  value: "demo",
78403
78501
  description: "Select from a range of starter applications using various Cloudflare products"
78404
- },
78502
+ });
78503
+ }
78504
+ categoryOptions.push(
78405
78505
  {
78406
78506
  label: "Template from a GitHub repo",
78407
78507
  value: "remote-template",
@@ -78410,7 +78510,7 @@ var createContext = async (args, prevArgs) => {
78410
78510
  // This is used only if the type is `pre-existing`
78411
78511
  { label: "Others", value: "others", hidden: true },
78412
78512
  backOption
78413
- ];
78513
+ );
78414
78514
  const category = await processArgument(args, "category", {
78415
78515
  type: "select",
78416
78516
  question: "What would you like to start with?",
@@ -78424,14 +78524,17 @@ var createContext = async (args, prevArgs) => {
78424
78524
  }
78425
78525
  let template;
78426
78526
  if (category === "web-framework") {
78427
- const frameworkMap = getFrameworkMap({
78428
- experimental: args.experimental
78429
- });
78430
- const frameworkOptions = Object.entries(frameworkMap).map(
78431
- ([key, config34]) => ({
78432
- label: config34.displayName,
78433
- value: key
78434
- })
78527
+ const frameworkOptions = Object.entries(frameworkMap).reduce(
78528
+ (acc, [key, config48]) => {
78529
+ if (!config48.hidden || args.framework) {
78530
+ acc.push({
78531
+ label: config48.displayName,
78532
+ value: key
78533
+ });
78534
+ }
78535
+ return acc;
78536
+ },
78537
+ []
78435
78538
  );
78436
78539
  const framework = await processArgument(args, "framework", {
78437
78540
  type: "select",
@@ -78482,18 +78585,14 @@ var createContext = async (args, prevArgs) => {
78482
78585
  } else if (category === "remote-template") {
78483
78586
  template = await processRemoteTemplate(args);
78484
78587
  } else {
78485
- const templateMap = await getTemplateMap({
78486
- experimental: args.experimental
78487
- });
78588
+ const templateMap = category === "hello-world" ? helloWorldTemplateMap : otherTemplateMap;
78488
78589
  const templateOptions = Object.entries(templateMap).map(
78489
78590
  ([value, { displayName, description, hidden: hidden2 }]) => {
78490
- const isHelloWorldExample = value.startsWith("hello-world");
78491
- const isCategoryMatched = category === "hello-world" ? isHelloWorldExample : !isHelloWorldExample;
78492
78591
  return {
78493
78592
  value,
78494
78593
  label: displayName,
78495
78594
  description,
78496
- hidden: hidden2 || !isCategoryMatched
78595
+ hidden: hidden2
78497
78596
  };
78498
78597
  }
78499
78598
  );
@@ -78596,28 +78695,28 @@ var processRemoteTemplate = async (args) => {
78596
78695
  src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
78597
78696
  }
78598
78697
  const path6 = await downloadRemoteTemplate(src);
78599
- const config34 = inferTemplateConfig(path6);
78600
- validateTemplate(path6, config34);
78698
+ const config48 = inferTemplateConfig(path6);
78699
+ validateTemplate(path6, config48);
78601
78700
  updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
78602
78701
  return {
78603
78702
  path: path6,
78604
- ...config34
78703
+ ...config48
78605
78704
  };
78606
78705
  };
78607
- var validateTemplate = (path6, config34) => {
78608
- if (!config34.copyFiles) {
78706
+ var validateTemplate = (path6, config48) => {
78707
+ if (!config48.copyFiles) {
78609
78708
  return;
78610
78709
  }
78611
- if (isVariantInfo(config34.copyFiles)) {
78612
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config34.copyFiles.path), config34);
78710
+ if (isVariantInfo(config48.copyFiles)) {
78711
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config48.copyFiles.path), config48);
78613
78712
  } else {
78614
- for (const variant of Object.values(config34.copyFiles.variants)) {
78615
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config34);
78713
+ for (const variant of Object.values(config48.copyFiles.variants)) {
78714
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config48);
78616
78715
  }
78617
78716
  }
78618
78717
  };
78619
- var validateTemplateSrcDirectory = (path6, config34) => {
78620
- if (config34.platform === "workers") {
78718
+ var validateTemplateSrcDirectory = (path6, config48) => {
78719
+ if (config48.platform === "workers") {
78621
78720
  const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
78622
78721
  const wranglerJsonPath = (0, import_path13.resolve)(path6, "wrangler.json");
78623
78722
  const wranglerJsoncPath = (0, import_path13.resolve)(path6, "wrangler.jsonc");
@@ -78790,13 +78889,10 @@ var cliDefinition = {
78790
78889
  values(args) {
78791
78890
  const experimental = Boolean(args?.["experimental"]);
78792
78891
  if (experimental) {
78793
- return [
78794
- { name: "hello-world", description: "Hello World example" },
78795
- { name: "web-framework", description: "Framework Starter" }
78796
- ];
78892
+ return [{ name: "web-framework", description: "Framework Starter" }];
78797
78893
  } else {
78798
78894
  return [
78799
- { name: "hello-world", description: "Hello World example" },
78895
+ { name: "hello-world", description: "Hello World Starter" },
78800
78896
  { name: "web-framework", description: "Framework Starter" },
78801
78897
  { name: "demo", description: "Application Starter" },
78802
78898
  {
@@ -78819,40 +78915,10 @@ var cliDefinition = {
78819
78915
  `,
78820
78916
  values(args) {
78821
78917
  const experimental = Boolean(args?.["experimental"]);
78822
- if (experimental) {
78823
- return getNamesAndDescriptions(getTemplateMap({ experimental }));
78824
- } else {
78825
- return [
78826
- {
78827
- name: "hello-world",
78828
- description: "A basic \u201CHello World\u201D Cloudflare Worker."
78829
- },
78830
- {
78831
- name: "hello-world-durable-object",
78832
- description: "A basic \u201CHello World\u201D Cloudflare Worker with a Durable Worker."
78833
- },
78834
- {
78835
- name: "common",
78836
- description: "A Cloudflare Worker which implements a common example of routing/proxying functionalities."
78837
- },
78838
- {
78839
- name: "scheduled",
78840
- description: "A scheduled Cloudflare Worker (triggered via Cron Triggers)."
78841
- },
78842
- {
78843
- name: "queues",
78844
- description: "A Cloudflare Worker which is both a consumer and produced of Queues."
78845
- },
78846
- {
78847
- name: "openapi",
78848
- description: "A Worker implementing an OpenAPI REST endpoint."
78849
- },
78850
- {
78851
- name: "pre-existing",
78852
- description: "Fetch a Worker initialized from the Cloudflare dashboard."
78853
- }
78854
- ];
78855
- }
78918
+ return getNamesAndDescriptions({
78919
+ ...getHelloWorldTemplateMap({ experimental }),
78920
+ ...getOtherTemplateMap({ experimental })
78921
+ });
78856
78922
  }
78857
78923
  },
78858
78924
  {
@@ -78867,7 +78933,7 @@ var cliDefinition = {
78867
78933
  You may specify additional arguments to be passed directly to these underlying tools by adding them after a "--" argument, like so:
78868
78934
 
78869
78935
  npm create cloudflare -- --framework next -- --ts
78870
- pnpm create clouldfare --framework next -- --ts
78936
+ pnpm create cloudflare --framework next -- --ts
78871
78937
  `,
78872
78938
  values: (args) => getNamesAndDescriptions(
78873
78939
  getFrameworkMap({
@@ -80528,20 +80594,20 @@ function applyEdits(text, edits) {
80528
80594
  var import_fs12 = require("fs");
80529
80595
  var import_path14 = require("path");
80530
80596
  var import_toml2 = __toESM(require_toml());
80531
- function ensureNameExists(config34, projectName) {
80532
- config34["name"] = projectName;
80533
- return config34;
80597
+ function ensureNameExists(config48, projectName) {
80598
+ config48["name"] = projectName;
80599
+ return config48;
80534
80600
  }
80535
- async function ensureCompatDateExists(config34) {
80536
- if (typeof config34["compatibility_date"] === "string") {
80601
+ async function ensureCompatDateExists(config48) {
80602
+ if (typeof config48["compatibility_date"] === "string") {
80537
80603
  const validCompatDateRe = /^\d{4}-\d{2}-\d{2}/m;
80538
- if (!config34["compatibility_date"].match(validCompatDateRe)) {
80539
- config34["compatibility_date"] = await getWorkerdCompatibilityDate();
80604
+ if (!config48["compatibility_date"].match(validCompatDateRe)) {
80605
+ config48["compatibility_date"] = await getWorkerdCompatibilityDate();
80540
80606
  }
80541
80607
  } else {
80542
- config34["compatibility_date"] = await getWorkerdCompatibilityDate();
80608
+ config48["compatibility_date"] = await getWorkerdCompatibilityDate();
80543
80609
  }
80544
- return config34;
80610
+ return config48;
80545
80611
  }
80546
80612
  var updateWranglerConfig = async (ctx) => {
80547
80613
  if (wranglerJsonExists(ctx)) {
@@ -80552,12 +80618,15 @@ var updateWranglerConfig = async (ctx) => {
80552
80618
  const modified = await ensureCompatDateExists(
80553
80619
  ensureNameExists(parsed, ctx.project.name)
80554
80620
  );
80555
- const comment = `/**
80621
+ let comment = `/**
80556
80622
  * For more details on how to configure Wrangler, refer to:
80557
80623
  * https://developers.cloudflare.com/workers/wrangler/configuration/
80558
80624
  */
80559
- {
80625
+ {`;
80626
+ if (!modified["$schema"]) {
80627
+ comment += `
80560
80628
  "$schema": "node_modules/wrangler/config-schema.json",`;
80629
+ }
80561
80630
  if (!modified["observability"]) {
80562
80631
  modified["observability"] = { enabled: true };
80563
80632
  }
@@ -80712,7 +80781,7 @@ var addVscodeConfig = (ctx) => {
80712
80781
 
80713
80782
  // src/deploy.ts
80714
80783
  var offerToDeploy = async (ctx) => {
80715
- const { npm: npm24 } = detectPackageManager();
80784
+ const { npm: npm25 } = detectPackageManager();
80716
80785
  startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
80717
80786
  if (!await isDeployable(ctx)) {
80718
80787
  ctx.args.deploy = false;
@@ -80723,7 +80792,7 @@ var offerToDeploy = async (ctx) => {
80723
80792
  );
80724
80793
  }
80725
80794
  const label = `deploy via \`${quoteShellArgs([
80726
- npm24,
80795
+ npm25,
80727
80796
  "run",
80728
80797
  ctx.template.deployScript ?? "deploy"
80729
80798
  ])}\``;
@@ -80760,11 +80829,11 @@ var readWranglerConfig = (ctx) => {
80760
80829
  return import_toml3.default.parse(wranglerTomlStr.replace(/\r\n/g, "\n"));
80761
80830
  };
80762
80831
  var runDeploy = async (ctx) => {
80763
- const { npm: npm24, name: pm4 } = detectPackageManager();
80832
+ const { npm: npm25, name: pm4 } = detectPackageManager();
80764
80833
  if (!ctx.account?.id) {
80765
80834
  throw new Error("Failed to read Cloudflare account.");
80766
80835
  }
80767
- const baseDeployCmd = [npm24, "run", ctx.template.deployScript ?? "deploy"];
80836
+ const baseDeployCmd = [npm25, "run", ctx.template.deployScript ?? "deploy"];
80768
80837
  const insideGitRepo = await isInsideGitRepo(ctx.project.path);
80769
80838
  const deployCmd = [
80770
80839
  ...baseDeployCmd,
@@ -80880,14 +80949,14 @@ var printSummary = (ctx) => {
80880
80949
  const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
80881
80950
  const relativePath = (0, import_path15.relative)(ctx.originalCWD, ctx.project.path);
80882
80951
  const cdCommand = relativePath ? `cd ${relativePath}` : null;
80883
- const { npm: npm24 } = detectPackageManager();
80952
+ const { npm: npm25 } = detectPackageManager();
80884
80953
  const devServerCommand = quoteShellArgs([
80885
- npm24,
80954
+ npm25,
80886
80955
  "run",
80887
80956
  ctx.template.devScript ?? "start"
80888
80957
  ]);
80889
80958
  const deployCommand = quoteShellArgs([
80890
- npm24,
80959
+ npm25,
80891
80960
  "run",
80892
80961
  ctx.template.deployScript ?? "deploy"
80893
80962
  ]);
@@ -81255,8 +81324,8 @@ var renderValues = (values) => {
81255
81324
  };
81256
81325
 
81257
81326
  // src/helpers/retry.ts
81258
- var retry = async (config34, fn) => {
81259
- let { times } = config34;
81327
+ var retry = async (config48, fn) => {
81328
+ let { times } = config48;
81260
81329
  let error2 = null;
81261
81330
  while (times > 0) {
81262
81331
  try {
@@ -81264,10 +81333,10 @@ var retry = async (config34, fn) => {
81264
81333
  } catch (e) {
81265
81334
  error2 = e;
81266
81335
  times--;
81267
- if (config34.exitCondition?.(e)) {
81336
+ if (config48.exitCondition?.(e)) {
81268
81337
  break;
81269
81338
  }
81270
- await sleep(config34.sleepMs ?? 1e3);
81339
+ await sleep(config48.sleepMs ?? 1e3);
81271
81340
  }
81272
81341
  }
81273
81342
  throw error2;
@@ -81357,14 +81426,14 @@ var createProject = async (ctx) => {
81357
81426
  var import_fs13 = require("fs");
81358
81427
  var import_path16 = require("path");
81359
81428
  async function installWorkersTypes(ctx) {
81360
- const { npm: npm24 } = detectPackageManager();
81429
+ const { npm: npm25 } = detectPackageManager();
81361
81430
  if (!usesTypescript(ctx)) {
81362
81431
  return;
81363
81432
  }
81364
81433
  await installPackages(["@cloudflare/workers-types"], {
81365
81434
  dev: true,
81366
81435
  startText: "Installing @cloudflare/workers-types",
81367
- doneText: `${brandColor("installed")} ${dim(`via ${npm24}`)}`
81436
+ doneText: `${brandColor("installed")} ${dim(`via ${npm25}`)}`
81368
81437
  });
81369
81438
  await addWorkersTypesToTsConfig(ctx);
81370
81439
  }
@@ -81387,8 +81456,8 @@ async function addWorkersTypesToTsConfig(ctx) {
81387
81456
  }
81388
81457
  const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
81389
81458
  try {
81390
- const config34 = parse4(tsconfig);
81391
- const currentTypes = config34.compilerOptions?.types ?? [];
81459
+ const config48 = parse4(tsconfig);
81460
+ const currentTypes = config48.compilerOptions?.types ?? [];
81392
81461
  const explicitEntrypoint = currentTypes.some(
81393
81462
  (t2) => t2.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
81394
81463
  );
@@ -81418,7 +81487,7 @@ async function addWorkersTypesToTsConfig(ctx) {
81418
81487
  }
81419
81488
 
81420
81489
  // src/cli.ts
81421
- var { npm: npm23 } = detectPackageManager();
81490
+ var { npm: npm24 } = detectPackageManager();
81422
81491
  var main = async (argv) => {
81423
81492
  const result = await parseArgs(argv);
81424
81493
  if (result.type === "unknown") {
@@ -81454,16 +81523,16 @@ ${result.errorMessage}`);
81454
81523
  };
81455
81524
  var runLatest = async () => {
81456
81525
  const args = process.argv.slice(2);
81457
- if (npm23 === "npm") {
81526
+ if (npm24 === "npm") {
81458
81527
  args.unshift("--");
81459
81528
  }
81460
- await runCommand([npm23, "create", "cloudflare@latest", ...args]);
81529
+ await runCommand([npm24, "create", "cloudflare@latest", ...args]);
81461
81530
  };
81462
81531
  var runCli = async (args) => {
81463
81532
  printBanner(args);
81464
81533
  const ctx = await createContext(args);
81465
81534
  await create(ctx);
81466
- await configure21(ctx);
81535
+ await configure20(ctx);
81467
81536
  await deploy(ctx);
81468
81537
  printSummary(ctx);
81469
81538
  logRaw("");
@@ -81491,7 +81560,7 @@ var create = async (ctx) => {
81491
81560
  await rectifyPmMismatch(ctx);
81492
81561
  endSection(`Application created`);
81493
81562
  };
81494
- var configure21 = async (ctx) => {
81563
+ var configure20 = async (ctx) => {
81495
81564
  startSection("Configuring your application for Cloudflare", "Step 2 of 3");
81496
81565
  await installWrangler();
81497
81566
  await installWorkersTypes(ctx);