create-cloudflare 0.0.0-80e5bc688 → 0.0.0-80f21799a

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 (36) hide show
  1. package/dist/cli.js +498 -441
  2. package/dist/tsconfig.tsbuildinfo +1 -1
  3. package/package.json +5 -5
  4. package/templates/angular/c3.ts +25 -13
  5. package/templates/angular/templates/src/server.ts +15 -0
  6. package/templates/angular/templates/tools/copy-files.mjs +8 -2
  7. package/templates/astro/templates/wrangler.toml +1 -0
  8. package/templates/hello-world/js/package.json +1 -1
  9. package/templates/hello-world/ts/package.json +1 -1
  10. package/templates/hello-world/ts/test/tsconfig.json +1 -1
  11. package/templates/svelte/c3.ts +34 -7
  12. package/templates-experimental/angular/c3.ts +21 -7
  13. package/templates-experimental/angular/templates/src/server.ts +15 -0
  14. package/templates-experimental/hello-world-with-assets/js/package.json +1 -1
  15. package/templates-experimental/hello-world-with-assets/ts/package.json +1 -1
  16. package/templates-experimental/nuxt/c3.ts +1 -1
  17. package/templates-experimental/nuxt/templates/wrangler.toml +2 -2
  18. package/templates-experimental/remix/c3.ts +1 -26
  19. package/templates-experimental/remix/templates/public/.assetsignore +0 -4
  20. package/templates-experimental/remix/templates/wrangler.toml +1 -1
  21. package/templates-experimental/solid/c3.ts +7 -50
  22. package/templates-experimental/solid/templates/wrangler.toml +2 -2
  23. package/templates-experimental/svelte/c3.ts +4 -7
  24. package/templates-experimental/vue/c3.ts +33 -0
  25. package/templates-experimental/{svelte/ts → vue/templates}/wrangler.toml +1 -2
  26. package/templates/angular/templates/server.ts +0 -34
  27. package/templates/angular/templates/tools/alter-polyfills.mjs +0 -27
  28. package/templates/angular/templates/tools/paths.mjs +0 -9
  29. package/templates/svelte/ts/wrangler.toml +0 -85
  30. package/templates-experimental/angular/templates/server.ts +0 -34
  31. package/templates-experimental/angular/templates/tools/alter-polyfills.mjs +0 -32
  32. package/templates-experimental/nuxt/templates/cloudflare-preset/nitro.config.ts +0 -27
  33. package/templates-experimental/svelte/ts/static/.assetsignore +0 -4
  34. /package/templates/svelte/{js → templates}/wrangler.toml +0 -0
  35. /package/templates-experimental/svelte/{js → templates}/static/.assetsignore +0 -0
  36. /package/templates-experimental/svelte/{js → templates}/wrangler.toml +0 -0
package/dist/cli.js CHANGED
@@ -558,7 +558,7 @@ var require_XDGAppPaths = __commonJS({
558
558
  XDGAppPaths.cache = function cache(dirOptions) {
559
559
  return path6.join(xdg.cache(), finalPathSegment(dirOptions));
560
560
  };
561
- XDGAppPaths.config = function config26(dirOptions) {
561
+ XDGAppPaths.config = function config27(dirOptions) {
562
562
  return path6.join(xdg.config(), finalPathSegment(dirOptions));
563
563
  };
564
564
  XDGAppPaths.data = function data(dirOptions) {
@@ -615,7 +615,7 @@ var require_XDG = __commonJS({
615
615
  var cache = function() {
616
616
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), ".cache"]);
617
617
  };
618
- var config26 = function() {
618
+ var config27 = function() {
619
619
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), ".config"]);
620
620
  };
621
621
  var data = function() {
@@ -627,13 +627,13 @@ var require_XDG = __commonJS({
627
627
  var state = function() {
628
628
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), ".local", "state"]);
629
629
  };
630
- return { cache, config: config26, data, runtime, state };
630
+ return { cache, config: config27, data, runtime, state };
631
631
  };
632
632
  var macos = function() {
633
633
  var cache = function() {
634
634
  return valOrPath(env3.get("XDG_CACHE_HOME"), [baseDir(), "Library", "Caches"]);
635
635
  };
636
- var config26 = function() {
636
+ var config27 = function() {
637
637
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [baseDir(), "Library", "Preferences"]);
638
638
  };
639
639
  var data = function() {
@@ -645,7 +645,7 @@ var require_XDG = __commonJS({
645
645
  var state = function() {
646
646
  return valOrPath(env3.get("XDG_STATE_HOME"), [baseDir(), "Library", "State"]);
647
647
  };
648
- return { cache, config: config26, data, runtime, state };
648
+ return { cache, config: config27, data, runtime, state };
649
649
  };
650
650
  var windows = function() {
651
651
  function appData() {
@@ -657,7 +657,7 @@ var require_XDG = __commonJS({
657
657
  var cache = function() {
658
658
  return valOrPath(env3.get("XDG_CACHE_HOME"), [localAppData(), "xdg.cache"]);
659
659
  };
660
- var config26 = function() {
660
+ var config27 = function() {
661
661
  return valOrPath(env3.get("XDG_CONFIG_HOME"), [appData(), "xdg.config"]);
662
662
  };
663
663
  var data = function() {
@@ -669,7 +669,7 @@ var require_XDG = __commonJS({
669
669
  var state = function() {
670
670
  return valOrPath(env3.get("XDG_STATE_HOME"), [localAppData(), "xdg.state"]);
671
671
  };
672
- return { cache, config: config26, data, runtime, state };
672
+ return { cache, config: config27, data, runtime, state };
673
673
  };
674
674
  var XDG_ = function() {
675
675
  function XDG_2() {
@@ -24815,8 +24815,8 @@ var require_index_688c5d50 = __commonJS({
24815
24815
  var pathReservations = () => {
24816
24816
  const queues = /* @__PURE__ */ new Map();
24817
24817
  const reservations = /* @__PURE__ */ new Map();
24818
- const { join: join7 } = path__default["default"];
24819
- const getDirs = (path7) => join7(path7).split(/[\\/]/).slice(0, -1).reduce((set, path8) => set.length ? set.concat(join7(set[set.length - 1], path8)) : [path8], []);
24818
+ const { join: join8 } = path__default["default"];
24819
+ const getDirs = (path7) => join8(path7).split(/[\\/]/).slice(0, -1).reduce((set, path8) => set.length ? set.concat(join8(set[set.length - 1], path8)) : [path8], []);
24820
24820
  const running = /* @__PURE__ */ new Set();
24821
24821
  const getQueues = (fn) => {
24822
24822
  const res = reservations.get(fn);
@@ -32170,22 +32170,22 @@ var require_dist_web = __commonJS({
32170
32170
  _createClass(Haikunator3, [{
32171
32171
  key: "haikunate",
32172
32172
  value: function haikunate(options) {
32173
- var config26 = (0, _lodash["default"])(options, this.config);
32174
- if (config26.tokenHex === true) {
32175
- config26.tokenChars = "0123456789abcdef";
32173
+ var config27 = (0, _lodash["default"])(options, this.config);
32174
+ if (config27.tokenHex === true) {
32175
+ config27.tokenChars = "0123456789abcdef";
32176
32176
  }
32177
32177
  var adjective = this._randomElement(this.adjectives);
32178
32178
  var noun = this._randomElement(this.nouns);
32179
- if (!config26.tokenLength)
32180
- config26.tokenLength = 0;
32179
+ if (!config27.tokenLength)
32180
+ config27.tokenLength = 0;
32181
32181
  var token = "";
32182
- for (var i = 0; i < config26.tokenLength; i++) {
32183
- token += this._randomElement(config26.tokenChars);
32182
+ for (var i = 0; i < config27.tokenLength; i++) {
32183
+ token += this._randomElement(config27.tokenChars);
32184
32184
  }
32185
32185
  var sections = [adjective, noun, token];
32186
32186
  return sections.filter(function(e) {
32187
32187
  return !!e;
32188
- }).join(config26.delimiter);
32188
+ }).join(config27.delimiter);
32189
32189
  }
32190
32190
  /**
32191
32191
  * Get a random element from an array/string
@@ -38609,7 +38609,7 @@ var require_util8 = __commonJS({
38609
38609
  return path6;
38610
38610
  }
38611
38611
  exports2.normalize = normalize2;
38612
- function join7(aRoot, aPath) {
38612
+ function join8(aRoot, aPath) {
38613
38613
  if (aRoot === "") {
38614
38614
  aRoot = ".";
38615
38615
  }
@@ -38641,7 +38641,7 @@ var require_util8 = __commonJS({
38641
38641
  }
38642
38642
  return joined;
38643
38643
  }
38644
- exports2.join = join7;
38644
+ exports2.join = join8;
38645
38645
  exports2.isAbsolute = function(aPath) {
38646
38646
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
38647
38647
  };
@@ -38814,7 +38814,7 @@ var require_util8 = __commonJS({
38814
38814
  parsed.path = parsed.path.substring(0, index + 1);
38815
38815
  }
38816
38816
  }
38817
- sourceURL = join7(urlGenerate(parsed), sourceURL);
38817
+ sourceURL = join8(urlGenerate(parsed), sourceURL);
38818
38818
  }
38819
38819
  return normalize2(sourceURL);
38820
38820
  }
@@ -46608,13 +46608,13 @@ var require_esprima2 = __commonJS({
46608
46608
  return Reader2;
46609
46609
  }();
46610
46610
  var Tokenizer = function() {
46611
- function Tokenizer2(code, config26) {
46611
+ function Tokenizer2(code, config27) {
46612
46612
  this.errorHandler = new error_handler_1.ErrorHandler();
46613
- this.errorHandler.tolerant = config26 ? typeof config26.tolerant === "boolean" && config26.tolerant : false;
46613
+ this.errorHandler.tolerant = config27 ? typeof config27.tolerant === "boolean" && config27.tolerant : false;
46614
46614
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
46615
- this.scanner.trackComment = config26 ? typeof config26.comment === "boolean" && config26.comment : false;
46616
- this.trackRange = config26 ? typeof config26.range === "boolean" && config26.range : false;
46617
- this.trackLoc = config26 ? typeof config26.loc === "boolean" && config26.loc : false;
46615
+ this.scanner.trackComment = config27 ? typeof config27.comment === "boolean" && config27.comment : false;
46616
+ this.trackRange = config27 ? typeof config27.range === "boolean" && config27.range : false;
46617
+ this.trackLoc = config27 ? typeof config27.loc === "boolean" && config27.loc : false;
46618
46618
  this.buffer = [];
46619
46619
  this.reader = new Reader();
46620
46620
  }
@@ -48807,11 +48807,11 @@ var require_printer = __commonJS({
48807
48807
  return this.code;
48808
48808
  };
48809
48809
  var emptyPrintResult = new PrintResult("");
48810
- var Printer = function Printer2(config26) {
48810
+ var Printer = function Printer2(config27) {
48811
48811
  assert_1.default.ok(this instanceof Printer2);
48812
- var explicitTabWidth = config26 && config26.tabWidth;
48813
- config26 = options_1.normalize(config26);
48814
- config26.sourceFileName = null;
48812
+ var explicitTabWidth = config27 && config27.tabWidth;
48813
+ config27 = options_1.normalize(config27);
48814
+ config27.sourceFileName = null;
48815
48815
  function makePrintFunctionWith(options, overrides) {
48816
48816
  options = Object.assign({}, options, overrides);
48817
48817
  return function(path6) {
@@ -48826,11 +48826,11 @@ var require_printer = __commonJS({
48826
48826
  includeComments: false
48827
48827
  }));
48828
48828
  }
48829
- var oldTabWidth = config26.tabWidth;
48829
+ var oldTabWidth = config27.tabWidth;
48830
48830
  if (!explicitTabWidth) {
48831
48831
  var loc = path6.getNode().loc;
48832
48832
  if (loc && loc.lines && loc.lines.guessTabWidth) {
48833
- config26.tabWidth = loc.lines.guessTabWidth();
48833
+ config27.tabWidth = loc.lines.guessTabWidth();
48834
48834
  }
48835
48835
  }
48836
48836
  var reprinter = patcher_1.getReprinter(path6);
@@ -48844,11 +48844,11 @@ var require_printer = __commonJS({
48844
48844
  // right choice because it gives us the opportunity to reprint
48845
48845
  // such nodes using their original source.
48846
48846
  reprinter(print2)
48847
- ) : genericPrint(path6, config26, options, makePrintFunctionWith(options, {
48847
+ ) : genericPrint(path6, config27, options, makePrintFunctionWith(options, {
48848
48848
  includeComments: true,
48849
48849
  avoidRootParens: false
48850
48850
  }));
48851
- config26.tabWidth = oldTabWidth;
48851
+ config27.tabWidth = oldTabWidth;
48852
48852
  return lines;
48853
48853
  }
48854
48854
  this.print = function(ast) {
@@ -48859,7 +48859,7 @@ var require_printer = __commonJS({
48859
48859
  includeComments: true,
48860
48860
  avoidRootParens: false
48861
48861
  });
48862
- return new PrintResult(lines.toString(config26), util.composeSourceMaps(config26.inputSourceMap, lines.getSourceMap(config26.sourceMapName, config26.sourceRoot)));
48862
+ return new PrintResult(lines.toString(config27), util.composeSourceMaps(config27.inputSourceMap, lines.getSourceMap(config27.sourceMapName, config27.sourceRoot)));
48863
48863
  };
48864
48864
  this.printGenerically = function(ast) {
48865
48865
  if (!ast) {
@@ -48867,26 +48867,26 @@ var require_printer = __commonJS({
48867
48867
  }
48868
48868
  function printGenerically(path7) {
48869
48869
  return comments_1.printComments(path7, function(path8) {
48870
- return genericPrint(path8, config26, {
48870
+ return genericPrint(path8, config27, {
48871
48871
  includeComments: true,
48872
48872
  avoidRootParens: false
48873
48873
  }, printGenerically);
48874
48874
  });
48875
48875
  }
48876
48876
  var path6 = fast_path_1.default.from(ast);
48877
- var oldReuseWhitespace = config26.reuseWhitespace;
48878
- config26.reuseWhitespace = false;
48879
- var pr = new PrintResult(printGenerically(path6).toString(config26));
48880
- config26.reuseWhitespace = oldReuseWhitespace;
48877
+ var oldReuseWhitespace = config27.reuseWhitespace;
48878
+ config27.reuseWhitespace = false;
48879
+ var pr = new PrintResult(printGenerically(path6).toString(config27));
48880
+ config27.reuseWhitespace = oldReuseWhitespace;
48881
48881
  return pr;
48882
48882
  };
48883
48883
  };
48884
48884
  exports2.Printer = Printer;
48885
- function genericPrint(path6, config26, options, printPath) {
48885
+ function genericPrint(path6, config27, options, printPath) {
48886
48886
  assert_1.default.ok(path6 instanceof fast_path_1.default);
48887
48887
  var node = path6.getValue();
48888
48888
  var parts = [];
48889
- var linesWithoutParens = genericPrintNoParens(path6, config26, printPath);
48889
+ var linesWithoutParens = genericPrintNoParens(path6, config27, printPath);
48890
48890
  if (!node || linesWithoutParens.isEmpty()) {
48891
48891
  return linesWithoutParens;
48892
48892
  }
@@ -67118,7 +67118,7 @@ var logRaw = (msg) => {
67118
67118
  `);
67119
67119
  };
67120
67120
  var log = (msg) => {
67121
- const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)} ${white(ln)}`);
67121
+ const lines = msg.split("\n").map((ln) => `${gray(shapes.bar)}${ln.length > 0 ? " " + white(ln) : ""}`);
67122
67122
  logRaw(lines.join("\n"));
67123
67123
  };
67124
67124
  var newline = () => {
@@ -68447,7 +68447,12 @@ var inputPrompt = async (promptConfig) => {
68447
68447
  };
68448
68448
  let prompt;
68449
68449
  const dispatchRender = (props, p2) => {
68450
- const renderedLines = renderers[props.state](props, p2);
68450
+ let state = props.state;
68451
+ if (state === "initial" && promptConfig.initialErrorMessage) {
68452
+ state = "error";
68453
+ props.error = promptConfig.initialErrorMessage;
68454
+ }
68455
+ const renderedLines = renderers[state](props, p2);
68451
68456
  return renderedLines.join("\n");
68452
68457
  };
68453
68458
  if (promptConfig.type === "select") {
@@ -68533,33 +68538,33 @@ var inputPrompt = async (promptConfig) => {
68533
68538
  }
68534
68539
  return input;
68535
68540
  };
68536
- var renderSubmit = (config26, value) => {
68537
- const { question, label } = config26;
68538
- if (config26.type !== "confirm" && !value) {
68541
+ var renderSubmit = (config27, value) => {
68542
+ const { question, label } = config27;
68543
+ if (config27.type !== "confirm" && !value) {
68539
68544
  return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
68540
68545
  }
68541
- const content = config26.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
68546
+ const content = config27.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
68542
68547
  return [`${leftT} ${question}`, content, `${grayBar}`];
68543
68548
  };
68544
- var getRenderers = (config26) => {
68545
- switch (config26.type) {
68549
+ var getRenderers = (config27) => {
68550
+ switch (config27.type) {
68546
68551
  case "select":
68547
- return getSelectRenderers(config26);
68552
+ return getSelectRenderers(config27);
68548
68553
  case "confirm":
68549
- return getConfirmRenderers(config26);
68554
+ return getConfirmRenderers(config27);
68550
68555
  case "text":
68551
- return getTextRenderers(config26);
68556
+ return getTextRenderers(config27);
68552
68557
  case "multiselect":
68553
- return getSelectRenderers(config26);
68558
+ return getSelectRenderers(config27);
68554
68559
  case "list":
68555
- return getSelectListRenderers(config26);
68560
+ return getSelectListRenderers(config27);
68556
68561
  }
68557
68562
  };
68558
- var getTextRenderers = (config26) => {
68559
- const { question } = config26;
68560
- const helpText = config26.helpText ?? "";
68561
- const format5 = config26.format ?? ((val) => String(val));
68562
- const defaultValue = config26.defaultValue?.toString() ?? "";
68563
+ var getTextRenderers = (config27) => {
68564
+ const { question } = config27;
68565
+ const helpText = config27.helpText ?? "";
68566
+ const format5 = config27.format ?? ((val) => String(val));
68567
+ const defaultValue = config27.defaultValue?.toString() ?? "";
68563
68568
  const activeRenderer = ({ value }) => [
68564
68569
  `${blCorner} ${bold(question)} ${dim(helpText)}`,
68565
68570
  `${space(2)}${format5(value || dim(defaultValue))}`,
@@ -68582,14 +68587,14 @@ var getTextRenderers = (config26) => {
68582
68587
  ``
68583
68588
  // extra line for readability
68584
68589
  ],
68585
- submit: ({ value }) => renderSubmit(config26, format5(value ?? "")),
68590
+ submit: ({ value }) => renderSubmit(config27, format5(value ?? "")),
68586
68591
  cancel: activeRenderer
68587
68592
  };
68588
68593
  };
68589
- var getSelectRenderers = (config26) => {
68590
- const { options, question, helpText: _helpText } = config26;
68594
+ var getSelectRenderers = (config27) => {
68595
+ const { options, question, helpText: _helpText } = config27;
68591
68596
  const helpText = _helpText ?? "";
68592
- const maxItemsPerPage = config26.maxItemsPerPage ?? 32;
68597
+ const maxItemsPerPage = config27.maxItemsPerPage ?? 32;
68593
68598
  const defaultRenderer = ({ cursor = 0, value }) => {
68594
68599
  const renderOption = (opt, i) => {
68595
68600
  const { label: optionLabel, value: optionValue } = opt;
@@ -68664,21 +68669,21 @@ ${space(2)}${dim("...")}` : ""}`,
68664
68669
  submit: ({ value }) => {
68665
68670
  if (Array.isArray(value)) {
68666
68671
  return renderSubmit(
68667
- config26,
68672
+ config27,
68668
68673
  options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
68669
68674
  );
68670
68675
  }
68671
68676
  return renderSubmit(
68672
- config26,
68677
+ config27,
68673
68678
  options.find((o) => o.value === value)?.label
68674
68679
  );
68675
68680
  },
68676
68681
  cancel: defaultRenderer
68677
68682
  };
68678
68683
  };
68679
- var getSelectListRenderers = (config26) => {
68680
- const { question, helpText: _helpText } = config26;
68681
- let options = config26.options;
68684
+ var getSelectListRenderers = (config27) => {
68685
+ const { question, helpText: _helpText } = config27;
68686
+ let options = config27.options;
68682
68687
  const helpText = _helpText ?? "";
68683
68688
  const { rows } = stdout;
68684
68689
  const defaultRenderer = ({ cursor, value }, prompt) => {
@@ -68759,20 +68764,20 @@ var getSelectListRenderers = (config26) => {
68759
68764
  submit: ({ value }) => {
68760
68765
  if (Array.isArray(value)) {
68761
68766
  return renderSubmit(
68762
- config26,
68767
+ config27,
68763
68768
  options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
68764
68769
  );
68765
68770
  }
68766
68771
  return renderSubmit(
68767
- config26,
68772
+ config27,
68768
68773
  options.find((o) => o.value === value)?.value
68769
68774
  );
68770
68775
  },
68771
68776
  cancel: defaultRenderer
68772
68777
  };
68773
68778
  };
68774
- var getConfirmRenderers = (config26) => {
68775
- const { activeText, inactiveText, question, helpText: _helpText } = config26;
68779
+ var getConfirmRenderers = (config27) => {
68780
+ const { activeText, inactiveText, question, helpText: _helpText } = config27;
68776
68781
  const helpText = _helpText ?? "";
68777
68782
  const active = activeText || "Yes";
68778
68783
  const inactive = inactiveText || "No";
@@ -68789,7 +68794,7 @@ var getConfirmRenderers = (config26) => {
68789
68794
  active: defaultRenderer,
68790
68795
  confirm: defaultRenderer,
68791
68796
  error: defaultRenderer,
68792
- submit: ({ value }) => renderSubmit(config26, value ? "yes" : "no"),
68797
+ submit: ({ value }) => renderSubmit(config27, value ? "yes" : "no"),
68793
68798
  cancel: defaultRenderer
68794
68799
  };
68795
68800
  };
@@ -68813,7 +68818,10 @@ var spinner = (frames = spinnerFrames.clockwise, color = brandColor) => {
68813
68818
  start(msg, helpText) {
68814
68819
  helpText ||= ``;
68815
68820
  currentMsg = msg;
68816
- startMsg = `${currentMsg} ${dim(helpText)}`;
68821
+ startMsg = currentMsg;
68822
+ if (helpText !== void 0 && helpText.length > 0) {
68823
+ startMsg += ` ${dim(helpText)}`;
68824
+ }
68817
68825
  if (isInteractive()) {
68818
68826
  let index = 0;
68819
68827
  clearLoop();
@@ -68826,7 +68834,7 @@ var spinner = (frames = spinnerFrames.clockwise, color = brandColor) => {
68826
68834
  }
68827
68835
  }, frameRate);
68828
68836
  } else {
68829
- logUpdate2(`${leftT} ${startMsg}`);
68837
+ logRaw(`${leftT} ${startMsg}`);
68830
68838
  }
68831
68839
  },
68832
68840
  update(msg) {
@@ -68844,17 +68852,20 @@ ${grayBar} ${msg}`);
68844
68852
  clearLoop();
68845
68853
  } else {
68846
68854
  if (msg !== void 0) {
68847
- logUpdate2(`
68848
- ${grayBar} ${msg}`);
68855
+ logRaw(`${grayBar} ${msg}`);
68849
68856
  }
68850
68857
  newline();
68851
68858
  }
68852
68859
  }
68853
68860
  };
68854
68861
  };
68855
- var isInteractive = () => {
68856
- return process.stdin.isTTY;
68857
- };
68862
+ function isInteractive() {
68863
+ try {
68864
+ return Boolean(process.stdin.isTTY && process.stdout.isTTY);
68865
+ } catch {
68866
+ return false;
68867
+ }
68868
+ }
68858
68869
 
68859
68870
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/lib/platform-shims/esm.mjs
68860
68871
  var import_assert = require("assert");
@@ -69753,23 +69764,23 @@ var YargsParser = class {
69753
69764
  const configPath = argv2[configKey] || configLookup[configKey];
69754
69765
  if (configPath) {
69755
69766
  try {
69756
- let config26 = null;
69767
+ let config27 = null;
69757
69768
  const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
69758
69769
  const resolveConfig = flags.configs[configKey];
69759
69770
  if (typeof resolveConfig === "function") {
69760
69771
  try {
69761
- config26 = resolveConfig(resolvedConfigPath);
69772
+ config27 = resolveConfig(resolvedConfigPath);
69762
69773
  } catch (e) {
69763
- config26 = e;
69774
+ config27 = e;
69764
69775
  }
69765
- if (config26 instanceof Error) {
69766
- error2 = config26;
69776
+ if (config27 instanceof Error) {
69777
+ error2 = config27;
69767
69778
  return;
69768
69779
  }
69769
69780
  } else {
69770
- config26 = mixin2.require(resolvedConfigPath);
69781
+ config27 = mixin2.require(resolvedConfigPath);
69771
69782
  }
69772
- setConfigObject(config26);
69783
+ setConfigObject(config27);
69773
69784
  } catch (ex) {
69774
69785
  if (ex.name === "PermissionDenied")
69775
69786
  error2 = ex;
@@ -69779,9 +69790,9 @@ var YargsParser = class {
69779
69790
  }
69780
69791
  });
69781
69792
  }
69782
- function setConfigObject(config26, prev) {
69783
- Object.keys(config26).forEach(function(key) {
69784
- const value = config26[key];
69793
+ function setConfigObject(config27, prev) {
69794
+ Object.keys(config27).forEach(function(key) {
69795
+ const value = config27[key];
69785
69796
  const fullKey = prev ? prev + "." + key : key;
69786
69797
  if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
69787
69798
  setConfigObject(value, fullKey);
@@ -70933,11 +70944,11 @@ var CommandInstance = class {
70933
70944
  });
70934
70945
  if (!unparsed.length)
70935
70946
  return;
70936
- const config26 = Object.assign({}, options.configuration, {
70947
+ const config27 = Object.assign({}, options.configuration, {
70937
70948
  "populate--": false
70938
70949
  });
70939
70950
  const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
70940
- configuration: config26
70951
+ configuration: config27
70941
70952
  }));
70942
70953
  if (parsed.error) {
70943
70954
  yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
@@ -72160,31 +72171,31 @@ ${customMsgs.join("\n")}` : "";
72160
72171
  // ../../node_modules/.pnpm/yargs@17.7.2/node_modules/yargs/build/lib/utils/apply-extends.js
72161
72172
  var previouslyVisitedConfigs = [];
72162
72173
  var shim2;
72163
- function applyExtends(config26, cwd, mergeExtends, _shim) {
72174
+ function applyExtends(config27, cwd, mergeExtends, _shim) {
72164
72175
  shim2 = _shim;
72165
72176
  let defaultConfig = {};
72166
- if (Object.prototype.hasOwnProperty.call(config26, "extends")) {
72167
- if (typeof config26.extends !== "string")
72177
+ if (Object.prototype.hasOwnProperty.call(config27, "extends")) {
72178
+ if (typeof config27.extends !== "string")
72168
72179
  return defaultConfig;
72169
- const isPath = /\.json|\..*rc$/.test(config26.extends);
72180
+ const isPath = /\.json|\..*rc$/.test(config27.extends);
72170
72181
  let pathToDefault = null;
72171
72182
  if (!isPath) {
72172
72183
  try {
72173
- pathToDefault = require.resolve(config26.extends);
72184
+ pathToDefault = require.resolve(config27.extends);
72174
72185
  } catch (_err) {
72175
- return config26;
72186
+ return config27;
72176
72187
  }
72177
72188
  } else {
72178
- pathToDefault = getPathToDefaultConfig(cwd, config26.extends);
72189
+ pathToDefault = getPathToDefaultConfig(cwd, config27.extends);
72179
72190
  }
72180
72191
  checkForCircularExtends(pathToDefault);
72181
72192
  previouslyVisitedConfigs.push(pathToDefault);
72182
- defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config26.extends);
72183
- delete config26.extends;
72193
+ defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config27.extends);
72194
+ delete config27.extends;
72184
72195
  defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
72185
72196
  }
72186
72197
  previouslyVisitedConfigs = [];
72187
- return mergeExtends ? mergeDeep(defaultConfig, config26) : Object.assign({}, defaultConfig, config26);
72198
+ return mergeExtends ? mergeDeep(defaultConfig, config27) : Object.assign({}, defaultConfig, config27);
72188
72199
  }
72189
72200
  function checkForCircularExtends(cfgPath) {
72190
72201
  if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
@@ -72194,17 +72205,17 @@ function checkForCircularExtends(cfgPath) {
72194
72205
  function getPathToDefaultConfig(cwd, pathToExtend) {
72195
72206
  return shim2.path.resolve(cwd, pathToExtend);
72196
72207
  }
72197
- function mergeDeep(config1, config26) {
72208
+ function mergeDeep(config1, config27) {
72198
72209
  const target = {};
72199
72210
  function isObject2(obj) {
72200
72211
  return obj && typeof obj === "object" && !Array.isArray(obj);
72201
72212
  }
72202
72213
  Object.assign(target, config1);
72203
- for (const key of Object.keys(config26)) {
72204
- if (isObject2(config26[key]) && isObject2(target[key])) {
72205
- target[key] = mergeDeep(config1[key], config26[key]);
72214
+ for (const key of Object.keys(config27)) {
72215
+ if (isObject2(config27[key]) && isObject2(target[key])) {
72216
+ target[key] = mergeDeep(config1[key], config27[key]);
72206
72217
  } else {
72207
- target[key] = config26[key];
72218
+ target[key] = config27[key];
72208
72219
  }
72209
72220
  }
72210
72221
  return target;
@@ -72965,9 +72976,9 @@ var YargsInstance = class {
72965
72976
  }
72966
72977
  return maybePromise;
72967
72978
  }
72968
- parserConfiguration(config26) {
72969
- argsert("<object>", [config26], arguments.length);
72970
- __classPrivateFieldSet(this, _YargsInstance_parserConfig, config26, "f");
72979
+ parserConfiguration(config27) {
72980
+ argsert("<object>", [config27], arguments.length);
72981
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config27, "f");
72971
72982
  return this;
72972
72983
  }
72973
72984
  pkgConf(key, rootPath) {
@@ -73139,9 +73150,9 @@ var YargsInstance = class {
73139
73150
  return this;
73140
73151
  }
73141
73152
  }
73142
- usageConfiguration(config26) {
73143
- argsert("<object>", [config26], arguments.length);
73144
- __classPrivateFieldSet(this, _YargsInstance_usageConfig, config26, "f");
73153
+ usageConfiguration(config27) {
73154
+ argsert("<object>", [config27], arguments.length);
73155
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config27, "f");
73145
73156
  return this;
73146
73157
  }
73147
73158
  version(opt, msg, ver) {
@@ -73547,11 +73558,11 @@ var YargsInstance = class {
73547
73558
  __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
73548
73559
  __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
73549
73560
  const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
73550
- const config26 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
73561
+ const config27 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
73551
73562
  "populate--": true
73552
73563
  });
73553
73564
  const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
73554
- configuration: { "parse-positional-numbers": false, ...config26 }
73565
+ configuration: { "parse-positional-numbers": false, ...config27 }
73555
73566
  }));
73556
73567
  const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
73557
73568
  let argvPromise = void 0;
@@ -73714,7 +73725,7 @@ var Yargs = YargsFactory(esm_default);
73714
73725
  var yargs_default = Yargs;
73715
73726
 
73716
73727
  // package.json
73717
- var version = "0.0.0-80e5bc688";
73728
+ var version = "0.0.0-80f21799a";
73718
73729
 
73719
73730
  // src/metrics.ts
73720
73731
  var import_node_async_hooks = require("node:async_hooks");
@@ -73758,12 +73769,12 @@ function getGlobalWranglerConfigPath() {
73758
73769
  }
73759
73770
 
73760
73771
  // src/helpers/metrics-config.ts
73761
- function writeMetricsConfig(config26) {
73772
+ function writeMetricsConfig(config27) {
73762
73773
  (0, import_node_fs2.mkdirSync)(import_node_path2.default.dirname(getMetricsConfigPath()), { recursive: true });
73763
73774
  (0, import_node_fs2.writeFileSync)(
73764
73775
  getMetricsConfigPath(),
73765
73776
  JSON.stringify(
73766
- config26,
73777
+ config27,
73767
73778
  (_key, value) => value instanceof Date ? value.toISOString() : value,
73768
73779
  " "
73769
73780
  )
@@ -73771,9 +73782,9 @@ function writeMetricsConfig(config26) {
73771
73782
  }
73772
73783
  function readMetricsConfig() {
73773
73784
  try {
73774
- const config26 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
73785
+ const config27 = (0, import_node_fs2.readFileSync)(getMetricsConfigPath(), "utf8");
73775
73786
  return JSON.parse(
73776
- config26,
73787
+ config27,
73777
73788
  (key, value) => key === "date" ? new Date(value) : value
73778
73789
  );
73779
73790
  } catch {
@@ -73783,10 +73794,10 @@ function readMetricsConfig() {
73783
73794
  function getMetricsConfigPath() {
73784
73795
  return import_node_path2.default.resolve(getGlobalWranglerConfigPath(), "metrics.json");
73785
73796
  }
73786
- function getDeviceId(config26) {
73787
- const deviceId = config26.deviceId ?? (0, import_node_crypto.randomUUID)();
73788
- if (config26.deviceId === void 0) {
73789
- writeMetricsConfig({ ...config26, deviceId });
73797
+ function getDeviceId(config27) {
73798
+ const deviceId = config27.deviceId ?? (0, import_node_crypto.randomUUID)();
73799
+ if (config27.deviceId === void 0) {
73800
+ writeMetricsConfig({ ...config27, deviceId });
73790
73801
  }
73791
73802
  return deviceId;
73792
73803
  }
@@ -73806,6 +73817,13 @@ var runCommand = async (command2, opts = {}) => {
73806
73817
  doneText: opts.doneText,
73807
73818
  promise() {
73808
73819
  const [executable, ...args] = command2;
73820
+ if (args[0] === "wrangler") {
73821
+ const metrics = readMetricsConfig();
73822
+ if (metrics.c3permission?.enabled === false) {
73823
+ opts.env ??= {};
73824
+ opts.env["WRANGLER_SEND_METRICS"] = "false";
73825
+ }
73826
+ }
73809
73827
  const abortController = new AbortController();
73810
73828
  const cmd = (0, import_cross_spawn.spawn)(executable, [...args], {
73811
73829
  // TODO: ideally inherit stderr, but npm install uses this for warnings
@@ -73964,7 +73982,7 @@ var detectPackageManager = () => {
73964
73982
  }
73965
73983
  };
73966
73984
  var rectifyPmMismatch = async (ctx) => {
73967
- const { npm: npm22 } = detectPackageManager();
73985
+ const { npm: npm23 } = detectPackageManager();
73968
73986
  if (!detectPmMismatch(ctx)) {
73969
73987
  return;
73970
73988
  }
@@ -73976,17 +73994,17 @@ var rectifyPmMismatch = async (ctx) => {
73976
73994
  if ((0, import_fs5.existsSync)(lockfilePath)) {
73977
73995
  (0, import_fs5.rmSync)(lockfilePath);
73978
73996
  }
73979
- await runCommand([npm22, "install"], {
73997
+ await runCommand([npm23, "install"], {
73980
73998
  silent: true,
73981
73999
  cwd: ctx.project.path,
73982
74000
  startText: "Installing dependencies",
73983
- doneText: `${brandColor("installed")} ${dim(`via \`${npm22} install\``)}`
74001
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm23} install\``)}`
73984
74002
  });
73985
74003
  };
73986
74004
  var detectPmMismatch = (ctx) => {
73987
- const { npm: npm22 } = detectPackageManager();
74005
+ const { npm: npm23 } = detectPackageManager();
73988
74006
  const projectPath = ctx.project.path;
73989
- switch (npm22) {
74007
+ switch (npm23) {
73990
74008
  case "npm":
73991
74009
  return false;
73992
74010
  case "yarn":
@@ -73994,7 +74012,7 @@ var detectPmMismatch = (ctx) => {
73994
74012
  case "pnpm":
73995
74013
  return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "pnpm-lock.yaml"));
73996
74014
  case "bun":
73997
- return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb"));
74015
+ return !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lockb")) && !(0, import_fs5.existsSync)(import_path5.default.join(projectPath, "bun.lock"));
73998
74016
  }
73999
74017
  };
74000
74018
 
@@ -74054,10 +74072,10 @@ function getPlatform() {
74054
74072
  function createReporter() {
74055
74073
  const events = [];
74056
74074
  const als = new import_node_async_hooks.AsyncLocalStorage();
74057
- const config26 = readMetricsConfig() ?? {};
74058
- const isFirstUsage = config26.c3permission === void 0;
74075
+ const config27 = readMetricsConfig() ?? {};
74076
+ const isFirstUsage = config27.c3permission === void 0;
74059
74077
  const isEnabled = isTelemetryEnabled();
74060
- const deviceId = getDeviceId(config26);
74078
+ const deviceId = getDeviceId(config27);
74061
74079
  const packageManager = detectPackageManager();
74062
74080
  const platform3 = getPlatform();
74063
74081
  const amplitude_session_id = Date.now();
@@ -74090,7 +74108,7 @@ function createReporter() {
74090
74108
  if (process.env.CREATE_CLOUDFLARE_TELEMETRY_DISABLED === "1") {
74091
74109
  return false;
74092
74110
  }
74093
- return hasSparrowSourceKey() && getC3Permission(config26).enabled;
74111
+ return hasSparrowSourceKey() && getC3Permission(config27).enabled;
74094
74112
  }
74095
74113
  async function waitForAllEventsSettled() {
74096
74114
  await Promise.allSettled(events);
@@ -74196,20 +74214,20 @@ function initializeC3Permission(enabled = true) {
74196
74214
  date: /* @__PURE__ */ new Date()
74197
74215
  };
74198
74216
  }
74199
- function getC3Permission(config26 = readMetricsConfig() ?? {}) {
74200
- if (!config26.c3permission) {
74201
- config26.c3permission = initializeC3Permission();
74202
- writeMetricsConfig(config26);
74217
+ function getC3Permission(config27 = readMetricsConfig() ?? {}) {
74218
+ if (!config27.c3permission) {
74219
+ config27.c3permission = initializeC3Permission();
74220
+ writeMetricsConfig(config27);
74203
74221
  }
74204
- return config26.c3permission;
74222
+ return config27.c3permission;
74205
74223
  }
74206
74224
  function updateC3Pemission(enabled) {
74207
- const config26 = readMetricsConfig();
74208
- if (config26.c3permission?.enabled === enabled) {
74225
+ const config27 = readMetricsConfig();
74226
+ if (config27.c3permission?.enabled === enabled) {
74209
74227
  return;
74210
74228
  }
74211
- config26.c3permission = initializeC3Permission(enabled);
74212
- writeMetricsConfig(config26);
74229
+ config27.c3permission = initializeC3Permission(enabled);
74230
+ writeMetricsConfig(config27);
74213
74231
  }
74214
74232
  var runTelemetryCommand = (action) => {
74215
74233
  const logTelemetryStatus = (enabled) => {
@@ -74254,28 +74272,28 @@ var import_haikunator = __toESM(require_dist_web());
74254
74272
  var import_fs6 = require("fs");
74255
74273
  var import_path6 = __toESM(require("path"));
74256
74274
  var import_undici2 = __toESM(require_undici());
74257
- var installPackages = async (packages, config26 = {}) => {
74258
- const { npm: npm22 } = detectPackageManager();
74275
+ var installPackages = async (packages, config27 = {}) => {
74276
+ const { npm: npm23 } = detectPackageManager();
74259
74277
  let saveFlag;
74260
74278
  let cmd;
74261
- switch (npm22) {
74279
+ switch (npm23) {
74262
74280
  case "yarn":
74263
74281
  cmd = "add";
74264
- saveFlag = config26.dev ? "-D" : "";
74282
+ saveFlag = config27.dev ? "-D" : "";
74265
74283
  break;
74266
74284
  case "bun":
74267
74285
  cmd = "add";
74268
- saveFlag = config26.dev ? "-d" : "";
74286
+ saveFlag = config27.dev ? "-d" : "";
74269
74287
  break;
74270
74288
  case "npm":
74271
74289
  case "pnpm":
74272
74290
  default:
74273
74291
  cmd = "install";
74274
- saveFlag = config26.dev ? "--save-dev" : "";
74292
+ saveFlag = config27.dev ? "--save-dev" : "";
74275
74293
  break;
74276
74294
  }
74277
- await runCommand([npm22, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
74278
- ...config26,
74295
+ await runCommand([npm23, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
74296
+ ...config27,
74279
74297
  silent: true
74280
74298
  });
74281
74299
  };
@@ -74284,11 +74302,11 @@ var npmInstall = async (ctx) => {
74284
74302
  if ((0, import_fs6.existsSync)(nodeModulesPath)) {
74285
74303
  return;
74286
74304
  }
74287
- const { npm: npm22 } = detectPackageManager();
74288
- await runCommand([npm22, "install"], {
74305
+ const { npm: npm23 } = detectPackageManager();
74306
+ await runCommand([npm23, "install"], {
74289
74307
  silent: true,
74290
74308
  startText: "Installing dependencies",
74291
- doneText: `${brandColor("installed")} ${dim(`via \`${npm22} install\``)}`
74309
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm23} install\``)}`
74292
74310
  });
74293
74311
  };
74294
74312
  async function getLatestPackageVersion(packageSpecifier) {
@@ -74297,7 +74315,7 @@ async function getLatestPackageVersion(packageSpecifier) {
74297
74315
  return npmInfo["dist-tags"].latest;
74298
74316
  }
74299
74317
  var installWrangler = async () => {
74300
- const { npm: npm22 } = detectPackageManager();
74318
+ const { npm: npm23 } = detectPackageManager();
74301
74319
  if ((0, import_fs6.existsSync)(import_path6.default.resolve("node_modules", "wrangler"))) {
74302
74320
  return;
74303
74321
  }
@@ -74307,7 +74325,7 @@ var installWrangler = async () => {
74307
74325
  "A command line tool for building Cloudflare Workers"
74308
74326
  )}`,
74309
74327
  doneText: `${brandColor("installed")} ${dim(
74310
- `via \`${npm22} install wrangler --save-dev\``
74328
+ `via \`${npm23} install wrangler --save-dev\``
74311
74329
  )}`
74312
74330
  });
74313
74331
  };
@@ -74469,20 +74487,20 @@ var package_default = {
74469
74487
  "so that we can use dependabot to update these dependencies automatically."
74470
74488
  ],
74471
74489
  dependencies: {
74472
- "create-astro": "4.8.0",
74490
+ "create-astro": "4.10.0",
74473
74491
  "create-analog": "1.8.1",
74474
- "@angular/create": "18.2.8",
74475
- "create-docusaurus": "3.5.2",
74492
+ "@angular/create": "19.0.0",
74493
+ "create-docusaurus": "3.6.3",
74476
74494
  "create-hono": "0.14.2",
74477
74495
  "create-next-app": "14.2.5",
74478
- "create-qwik": "1.9.1",
74479
- "create-vite": "5.5.3",
74480
- "create-remix": "2.13.1",
74481
- "create-solid": "0.5.13",
74482
- "create-svelte": "6.4.0",
74483
- "create-vue": "3.11.1",
74484
- gatsby: "5.13.7",
74485
- nuxi: "3.12.0"
74496
+ "create-qwik": "1.11.0",
74497
+ "create-vite": "6.0.1",
74498
+ "create-remix": "2.15.0",
74499
+ "create-solid": "0.5.14",
74500
+ "create-vue": "3.12.1",
74501
+ gatsby: "5.14.0",
74502
+ nuxi: "3.16.0",
74503
+ sv: "0.6.1"
74486
74504
  }
74487
74505
  };
74488
74506
 
@@ -74497,9 +74515,9 @@ var getFrameworkCli = (ctx, withVersion = true) => {
74497
74515
  };
74498
74516
  var runFrameworkGenerator = async (ctx, args) => {
74499
74517
  const cli = getFrameworkCli(ctx, true);
74500
- const { npm: npm22, dlx } = detectPackageManager();
74501
- const cmd = [...npm22 === "yarn" ? ["npx"] : dlx, cli, ...args];
74502
- const env3 = npm22 === "yarn" ? { npm_config_user_agent: "yarn" } : {};
74518
+ const { npm: npm23, dlx } = detectPackageManager();
74519
+ const cmd = [...npm23 === "yarn" ? ["npx"] : dlx, cli, ...args];
74520
+ const env3 = npm23 === "yarn" ? { npm_config_user_agent: "yarn" } : {};
74503
74521
  if (ctx.args.additionalArgs?.length) {
74504
74522
  cmd.push(...ctx.args.additionalArgs);
74505
74523
  }
@@ -74515,7 +74533,11 @@ var runFrameworkGenerator = async (ctx, args) => {
74515
74533
  // templates-experimental/angular/c3.ts
74516
74534
  var { npm } = detectPackageManager();
74517
74535
  var generate = async (ctx) => {
74518
- await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
74536
+ await runFrameworkGenerator(ctx, [
74537
+ ctx.project.name,
74538
+ "--ssr",
74539
+ "--server-routing"
74540
+ ]);
74519
74541
  logRaw("");
74520
74542
  };
74521
74543
  var configure = async (ctx) => {
@@ -74524,9 +74546,9 @@ var configure = async (ctx) => {
74524
74546
  await installCFWorker();
74525
74547
  };
74526
74548
  async function installCFWorker() {
74527
- await installPackages(["@cloudflare/workers-types", "wrangler"], {
74549
+ await installPackages(["xhr2"], {
74528
74550
  dev: true,
74529
- startText: "Installing adapter dependencies",
74551
+ startText: "Installing additional dependencies",
74530
74552
  doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
74531
74553
  });
74532
74554
  }
@@ -74541,10 +74563,17 @@ async function updateAppCode() {
74541
74563
  );
74542
74564
  writeFile2((0, import_node_path3.resolve)(appConfigPath), newAppConfig);
74543
74565
  s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
74566
+ const appServerRoutesPath = "src/app/app.routes.server.ts";
74567
+ const appRoutes = readFile((0, import_node_path3.resolve)(appServerRoutesPath));
74568
+ const newAppRoutes = appRoutes.replace(
74569
+ "RenderMode.Prerender",
74570
+ "RenderMode.Server"
74571
+ );
74572
+ writeFile2((0, import_node_path3.resolve)(appServerRoutesPath), newAppRoutes);
74573
+ s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
74544
74574
  s.start(`Updating package.json`);
74545
74575
  const packageJsonPath = (0, import_node_path3.resolve)("package.json");
74546
74576
  const packageManifest = readJSON(packageJsonPath);
74547
- delete packageManifest["dependencies"]["@angular/ssr"];
74548
74577
  delete packageManifest["dependencies"]["express"];
74549
74578
  delete packageManifest["devDependencies"]["@types/express"];
74550
74579
  writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
@@ -74556,7 +74585,8 @@ function updateAngularJson(ctx) {
74556
74585
  const angularJson = readJSON((0, import_node_path3.resolve)("angular.json"));
74557
74586
  const architectSection = angularJson.projects[ctx.project.name].architect;
74558
74587
  architectSection.build.options.outputPath = "dist";
74559
- architectSection.build.options.assets.push("src/_routes.json");
74588
+ architectSection.build.options.outputMode = "server";
74589
+ architectSection.build.options.ssr.experimentalPlatform = "neutral";
74560
74590
  writeFile2((0, import_node_path3.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
74561
74591
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
74562
74592
  }
@@ -74572,13 +74602,13 @@ var config = {
74572
74602
  path: "templates-experimental/angular",
74573
74603
  devScript: "start",
74574
74604
  deployScript: "deploy",
74605
+ previewScript: "start",
74575
74606
  generate,
74576
74607
  configure,
74577
74608
  transformPackageJson: async () => ({
74578
74609
  scripts: {
74579
74610
  start: `${npm} run build && wrangler dev`,
74580
- build: `ng build && ${npm} run process`,
74581
- process: "node ./tools/alter-polyfills.mjs",
74611
+ build: `ng build`,
74582
74612
  deploy: `${npm} run build && wrangler deploy`
74583
74613
  }
74584
74614
  })
@@ -75058,7 +75088,7 @@ var updateNuxtConfig = () => {
75058
75088
  b2.objectExpression([
75059
75089
  b2.objectProperty(
75060
75090
  b2.identifier("preset"),
75061
- b2.stringLiteral("./cloudflare-preset")
75091
+ b2.stringLiteral("cloudflare_module")
75062
75092
  )
75063
75093
  ])
75064
75094
  );
@@ -75222,7 +75252,7 @@ var generate9 = async (ctx) => {
75222
75252
  await runFrameworkGenerator(ctx, [
75223
75253
  ctx.project.name,
75224
75254
  "--template",
75225
- "https://github.com/remix-run/remix/tree/main/templates/cloudflare"
75255
+ "https://github.com/remix-run/remix/tree/main/templates/cloudflare-workers"
75226
75256
  ]);
75227
75257
  logRaw("");
75228
75258
  };
@@ -75232,19 +75262,6 @@ var configure6 = async () => {
75232
75262
  startText: "Updating the Wrangler version",
75233
75263
  doneText: `${brandColor(`updated`)} ${dim("wrangler@latest")}`
75234
75264
  });
75235
- const typeDefsPath = "load-context.ts";
75236
- const s = spinner();
75237
- s.start(`Updating \`${typeDefsPath}\``);
75238
- transformFile(typeDefsPath, {
75239
- visitTSInterfaceDeclaration(n2) {
75240
- if (n2.node.id.type === "Identifier" && n2.node.id.name !== "Env") {
75241
- return this.traverse(n2);
75242
- }
75243
- n2.replace();
75244
- return false;
75245
- }
75246
- });
75247
- s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
75248
75265
  };
75249
75266
  var config10 = {
75250
75267
  configVersion: 1,
@@ -75260,7 +75277,6 @@ var config10 = {
75260
75277
  configure: configure6,
75261
75278
  transformPackageJson: async () => ({
75262
75279
  scripts: {
75263
- build: "remix vite:build && wrangler pages functions build --outdir build/worker",
75264
75280
  deploy: `${npm6} run build && wrangler deploy`,
75265
75281
  preview: `${npm6} run build && wrangler dev`,
75266
75282
  "cf-typegen": `wrangler types`
@@ -75288,6 +75304,7 @@ var configure7 = async (ctx) => {
75288
75304
  });
75289
75305
  usesTypescript(ctx);
75290
75306
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
75307
+ const compatDate = await getWorkerdCompatibilityDate();
75291
75308
  updateStatus(`Updating configuration in ${blue(filePath)}`);
75292
75309
  transformFile(filePath, {
75293
75310
  visitCallExpression: function(n2) {
@@ -75302,60 +75319,14 @@ var configure7 = async (ctx) => {
75302
75319
  b2.objectProperty(
75303
75320
  b2.identifier("server"),
75304
75321
  b2.objectExpression([
75305
- // preset: "cloudflare-pages"
75322
+ // preset: "cloudflare_module"
75306
75323
  b2.objectProperty(
75307
75324
  b2.identifier("preset"),
75308
- b2.stringLiteral("./cloudflare-pages")
75325
+ b2.stringLiteral("cloudflare_module")
75309
75326
  ),
75310
- // output: {
75311
- // dir: "{{ rootDir }}/dist",
75312
- // publicDir: "{{ output.dir }}/public",
75313
- // serverDir: "{{ output.dir }}/worker",
75314
- // },
75315
75327
  b2.objectProperty(
75316
- b2.identifier("output"),
75317
- b2.objectExpression([
75318
- b2.objectProperty(
75319
- b2.identifier("dir"),
75320
- b2.stringLiteral("{{ rootDir }}/dist")
75321
- ),
75322
- b2.objectProperty(
75323
- b2.identifier("publicDir"),
75324
- b2.stringLiteral("{{ output.dir }}/public")
75325
- ),
75326
- b2.objectProperty(
75327
- b2.identifier("serverDir"),
75328
- b2.stringLiteral("{{ output.dir }}/worker")
75329
- )
75330
- ])
75331
- ),
75332
- // rollupConfig: {
75333
- // external: ["node:async_hooks"],
75334
- // },
75335
- b2.objectProperty(
75336
- b2.identifier("rollupConfig"),
75337
- b2.objectExpression([
75338
- b2.objectProperty(
75339
- b2.identifier("external"),
75340
- b2.arrayExpression([b2.stringLiteral("node:async_hooks")])
75341
- )
75342
- ])
75343
- ),
75344
- // hooks: {
75345
- // // Prevent the Pages preset from writing the _routes.json etc.
75346
- // compiled() {},
75347
- // },
75348
- b2.objectProperty(
75349
- b2.identifier("hooks"),
75350
- b2.objectExpression([
75351
- b2.objectMethod(
75352
- "method",
75353
- b2.identifier("compiled"),
75354
- [],
75355
- b2.blockStatement([]),
75356
- false
75357
- )
75358
- ])
75328
+ b2.identifier("compatibilityDate"),
75329
+ b2.stringLiteral(compatDate)
75359
75330
  )
75360
75331
  ])
75361
75332
  )
@@ -75395,7 +75366,7 @@ var import_node_os3 = require("node:os");
75395
75366
  var recast6 = __toESM(require_main3());
75396
75367
  var { npm: npm8 } = detectPackageManager();
75397
75368
  var generate11 = async (ctx) => {
75398
- await runFrameworkGenerator(ctx, [ctx.project.name]);
75369
+ await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
75399
75370
  logRaw("");
75400
75371
  };
75401
75372
  var configure8 = async (ctx) => {
@@ -75460,14 +75431,11 @@ var updateTypeDefinitions = (ctx) => {
75460
75431
  var config12 = {
75461
75432
  configVersion: 1,
75462
75433
  id: "svelte",
75463
- frameworkCli: "create-svelte",
75464
- displayName: "Svelte",
75434
+ frameworkCli: "sv",
75435
+ displayName: "SvelteKit",
75465
75436
  platform: "workers",
75466
75437
  copyFiles: {
75467
- variants: {
75468
- js: { path: "./js" },
75469
- ts: { path: "./ts" }
75470
- }
75438
+ path: "./templates"
75471
75439
  },
75472
75440
  path: "templates-experimental/svelte",
75473
75441
  generate: generate11,
@@ -75492,10 +75460,38 @@ var config12 = {
75492
75460
  };
75493
75461
  var c3_default14 = config12;
75494
75462
 
75463
+ // templates-experimental/vue/c3.ts
75464
+ var { npm: npm9 } = detectPackageManager();
75465
+ var generate12 = async (ctx) => {
75466
+ await runFrameworkGenerator(ctx, [ctx.project.name]);
75467
+ };
75468
+ var config13 = {
75469
+ configVersion: 1,
75470
+ id: "vue",
75471
+ frameworkCli: "create-vue",
75472
+ platform: "workers",
75473
+ displayName: "Vue",
75474
+ copyFiles: {
75475
+ path: "./templates"
75476
+ },
75477
+ path: "templates-experimental/vue",
75478
+ generate: generate12,
75479
+ transformPackageJson: async () => ({
75480
+ scripts: {
75481
+ deploy: `${npm9} run build && wrangler deploy`,
75482
+ preview: `${npm9} run build && wrangler dev`
75483
+ }
75484
+ }),
75485
+ devScript: "dev",
75486
+ deployScript: "deploy",
75487
+ previewScript: "preview"
75488
+ };
75489
+ var c3_default15 = config13;
75490
+
75495
75491
  // templates/analog/c3.ts
75496
75492
  var recast7 = __toESM(require_main3());
75497
- var { npm: npm9, name: pm2 } = detectPackageManager();
75498
- var generate12 = async (ctx) => {
75493
+ var { npm: npm10, name: pm2 } = detectPackageManager();
75494
+ var generate13 = async (ctx) => {
75499
75495
  await runFrameworkGenerator(ctx, [
75500
75496
  ctx.project.name,
75501
75497
  "--template",
@@ -75513,7 +75509,7 @@ var configure9 = async (ctx) => {
75513
75509
  await installPackages(packages, {
75514
75510
  dev: true,
75515
75511
  startText: `Installing ${packages.join(", ")}`,
75516
- doneText: `${brandColor("installed")} ${dim(`via \`${npm9} install\``)}`
75512
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
75517
75513
  });
75518
75514
  }
75519
75515
  updateViteConfig(ctx);
@@ -75571,7 +75567,7 @@ var updateViteConfig = (ctx) => {
75571
75567
  });
75572
75568
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
75573
75569
  };
75574
- var config13 = {
75570
+ var config14 = {
75575
75571
  configVersion: 1,
75576
75572
  id: "analog",
75577
75573
  frameworkCli: "create-analog",
@@ -75580,12 +75576,12 @@ var config13 = {
75580
75576
  copyFiles: {
75581
75577
  path: "./templates"
75582
75578
  },
75583
- generate: generate12,
75579
+ generate: generate13,
75584
75580
  configure: configure9,
75585
75581
  transformPackageJson: async () => ({
75586
75582
  scripts: {
75587
- preview: `${npm9} run build && wrangler pages dev`,
75588
- deploy: `${npm9} run build && wrangler pages deploy`,
75583
+ preview: `${npm10} run build && wrangler pages dev`,
75584
+ deploy: `${npm10} run build && wrangler pages deploy`,
75589
75585
  "cf-typegen": `wrangler types`
75590
75586
  }
75591
75587
  }),
@@ -75593,13 +75589,17 @@ var config13 = {
75593
75589
  deployScript: "deploy",
75594
75590
  previewScript: "preview"
75595
75591
  };
75596
- var c3_default15 = config13;
75592
+ var c3_default16 = config14;
75597
75593
 
75598
75594
  // templates/angular/c3.ts
75599
75595
  var import_node_path4 = require("node:path");
75600
- var { npm: npm10 } = detectPackageManager();
75601
- var generate13 = async (ctx) => {
75602
- await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
75596
+ var { npm: npm11 } = detectPackageManager();
75597
+ var generate14 = async (ctx) => {
75598
+ await runFrameworkGenerator(ctx, [
75599
+ ctx.project.name,
75600
+ "--ssr",
75601
+ "--server-routing"
75602
+ ]);
75603
75603
  logRaw("");
75604
75604
  };
75605
75605
  var configure10 = async (ctx) => {
@@ -75608,14 +75608,11 @@ var configure10 = async (ctx) => {
75608
75608
  await installCFWorker2();
75609
75609
  };
75610
75610
  async function installCFWorker2() {
75611
- await installPackages(
75612
- ["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
75613
- {
75614
- dev: true,
75615
- startText: "Installing adapter dependencies",
75616
- doneText: `${brandColor("installed")} ${dim(`via \`${npm10} install\``)}`
75617
- }
75618
- );
75611
+ await installPackages(["xhr2"], {
75612
+ dev: true,
75613
+ startText: "Installing additional dependencies",
75614
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm11} install\``)}`
75615
+ });
75619
75616
  }
75620
75617
  async function updateAppCode2() {
75621
75618
  const s = spinner();
@@ -75628,10 +75625,17 @@ async function updateAppCode2() {
75628
75625
  );
75629
75626
  writeFile2((0, import_node_path4.resolve)(appConfigPath), newAppConfig);
75630
75627
  s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
75628
+ const appServerRoutesPath = "src/app/app.routes.server.ts";
75629
+ const appRoutes = readFile((0, import_node_path4.resolve)(appServerRoutesPath));
75630
+ const newAppRoutes = appRoutes.replace(
75631
+ "RenderMode.Prerender",
75632
+ "RenderMode.Server"
75633
+ );
75634
+ writeFile2((0, import_node_path4.resolve)(appServerRoutesPath), newAppRoutes);
75635
+ s.stop(`${brandColor(`updated`)} ${dim(appServerRoutesPath)}`);
75631
75636
  s.start(`Updating package.json`);
75632
75637
  const packageJsonPath = (0, import_node_path4.resolve)("package.json");
75633
75638
  const packageManifest = readJSON(packageJsonPath);
75634
- delete packageManifest["dependencies"]["@angular/ssr"];
75635
75639
  delete packageManifest["dependencies"]["express"];
75636
75640
  delete packageManifest["devDependencies"]["@types/express"];
75637
75641
  writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
@@ -75643,11 +75647,13 @@ function updateAngularJson2(ctx) {
75643
75647
  const angularJson = readJSON((0, import_node_path4.resolve)("angular.json"));
75644
75648
  const architectSection = angularJson.projects[ctx.project.name].architect;
75645
75649
  architectSection.build.options.outputPath = "dist";
75650
+ architectSection.build.options.outputMode = "server";
75651
+ architectSection.build.options.ssr.experimentalPlatform = "neutral";
75646
75652
  architectSection.build.options.assets.push("src/_routes.json");
75647
75653
  writeFile2((0, import_node_path4.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
75648
75654
  s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
75649
75655
  }
75650
- var config14 = {
75656
+ var config15 = {
75651
75657
  configVersion: 1,
75652
75658
  id: "angular",
75653
75659
  frameworkCli: "@angular/create",
@@ -75658,23 +75664,24 @@ var config14 = {
75658
75664
  },
75659
75665
  devScript: "start",
75660
75666
  deployScript: "deploy",
75661
- generate: generate13,
75667
+ previewScript: "start",
75668
+ generate: generate14,
75662
75669
  configure: configure10,
75663
75670
  transformPackageJson: async () => ({
75664
75671
  scripts: {
75665
- start: `${npm10} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
75666
- build: `ng build && ${npm10} run process`,
75667
- process: "node ./tools/copy-files.mjs && node ./tools/alter-polyfills.mjs",
75668
- deploy: `${npm10} run build && wrangler pages deploy dist/cloudflare`
75672
+ start: `${npm11} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()}`,
75673
+ build: `ng build && ${npm11} run process`,
75674
+ process: "node ./tools/copy-files.mjs",
75675
+ deploy: `${npm11} run build && wrangler pages deploy dist/cloudflare`
75669
75676
  }
75670
75677
  })
75671
75678
  };
75672
- var c3_default16 = config14;
75679
+ var c3_default17 = config15;
75673
75680
 
75674
75681
  // templates/astro/c3.ts
75675
75682
  var recast8 = __toESM(require_main3());
75676
75683
  var { npx: npx3 } = detectPackageManager();
75677
- var generate14 = async (ctx) => {
75684
+ var generate15 = async (ctx) => {
75678
75685
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
75679
75686
  logRaw("");
75680
75687
  };
@@ -75733,7 +75740,7 @@ var updateEnvDeclaration2 = (ctx) => {
75733
75740
  }
75734
75741
  });
75735
75742
  };
75736
- var config15 = {
75743
+ var config16 = {
75737
75744
  configVersion: 1,
75738
75745
  id: "astro",
75739
75746
  frameworkCli: "create-astro",
@@ -75745,7 +75752,7 @@ var config15 = {
75745
75752
  devScript: "dev",
75746
75753
  deployScript: "deploy",
75747
75754
  previewScript: "preview",
75748
- generate: generate14,
75755
+ generate: generate15,
75749
75756
  configure: configure11,
75750
75757
  transformPackageJson: async (pkgJson, ctx) => ({
75751
75758
  scripts: {
@@ -75755,10 +75762,10 @@ var config15 = {
75755
75762
  }
75756
75763
  })
75757
75764
  };
75758
- var c3_default17 = config15;
75765
+ var c3_default18 = config16;
75759
75766
 
75760
75767
  // templates/common/c3.ts
75761
- var c3_default18 = {
75768
+ var c3_default19 = {
75762
75769
  configVersion: 1,
75763
75770
  id: "common",
75764
75771
  displayName: "Example router & proxy Worker",
@@ -75778,31 +75785,31 @@ var c3_default18 = {
75778
75785
  };
75779
75786
 
75780
75787
  // templates/docusaurus/c3.ts
75781
- var { npm: npm11 } = detectPackageManager();
75782
- var generate15 = async (ctx) => {
75788
+ var { npm: npm12 } = detectPackageManager();
75789
+ var generate16 = async (ctx) => {
75783
75790
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
75784
75791
  };
75785
- var config16 = {
75792
+ var config17 = {
75786
75793
  configVersion: 1,
75787
75794
  id: "docusaurus",
75788
75795
  frameworkCli: "create-docusaurus",
75789
75796
  platform: "pages",
75790
75797
  displayName: "Docusaurus",
75791
- generate: generate15,
75798
+ generate: generate16,
75792
75799
  transformPackageJson: async () => ({
75793
75800
  scripts: {
75794
- preview: `${npm11} run build && wrangler pages dev ./build`,
75795
- deploy: `${npm11} run build && wrangler pages deploy ./build`
75801
+ preview: `${npm12} run build && wrangler pages dev ./build`,
75802
+ deploy: `${npm12} run build && wrangler pages deploy ./build`
75796
75803
  }
75797
75804
  }),
75798
75805
  devScript: "preview",
75799
75806
  deployScript: "deploy"
75800
75807
  };
75801
- var c3_default19 = config16;
75808
+ var c3_default20 = config17;
75802
75809
 
75803
75810
  // templates/gatsby/c3.ts
75804
- var { npm: npm12 } = detectPackageManager();
75805
- var generate16 = async (ctx) => {
75811
+ var { npm: npm13 } = detectPackageManager();
75812
+ var generate17 = async (ctx) => {
75806
75813
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
75807
75814
  const useTemplate = await inputPrompt({
75808
75815
  type: "confirm",
@@ -75821,27 +75828,27 @@ var generate16 = async (ctx) => {
75821
75828
  }
75822
75829
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
75823
75830
  };
75824
- var config17 = {
75831
+ var config18 = {
75825
75832
  configVersion: 1,
75826
75833
  id: "gatsby",
75827
75834
  frameworkCli: "gatsby",
75828
75835
  platform: "pages",
75829
75836
  displayName: "Gatsby",
75830
- generate: generate16,
75837
+ generate: generate17,
75831
75838
  transformPackageJson: async () => ({
75832
75839
  scripts: {
75833
- deploy: `${npm12} run build && wrangler pages deploy ./public`,
75834
- preview: `${npm12} run build && wrangler pages dev ./public`
75840
+ deploy: `${npm13} run build && wrangler pages deploy ./public`,
75841
+ preview: `${npm13} run build && wrangler pages dev ./public`
75835
75842
  }
75836
75843
  }),
75837
75844
  devScript: "develop",
75838
75845
  deployScript: "deploy",
75839
75846
  previewScript: "preview"
75840
75847
  };
75841
- var c3_default20 = config17;
75848
+ var c3_default21 = config18;
75842
75849
 
75843
75850
  // templates/hello-world-durable-object/c3.ts
75844
- var c3_default21 = {
75851
+ var c3_default22 = {
75845
75852
  configVersion: 1,
75846
75853
  id: "hello-world-durable-object",
75847
75854
  displayName: "Hello World Worker Using Durable Objects",
@@ -75860,7 +75867,7 @@ var c3_default21 = {
75860
75867
  };
75861
75868
 
75862
75869
  // templates/hello-world/c3.ts
75863
- var c3_default22 = {
75870
+ var c3_default23 = {
75864
75871
  configVersion: 1,
75865
75872
  id: "hello-world",
75866
75873
  displayName: "Hello World Worker",
@@ -75882,7 +75889,7 @@ var c3_default22 = {
75882
75889
  };
75883
75890
 
75884
75891
  // templates/hono/c3.ts
75885
- var generate17 = async (ctx) => {
75892
+ var generate18 = async (ctx) => {
75886
75893
  const { name: pm4 } = detectPackageManager();
75887
75894
  await runFrameworkGenerator(ctx, [
75888
75895
  ctx.project.name,
@@ -75909,7 +75916,7 @@ var configure12 = async (ctx) => {
75909
75916
  });
75910
75917
  s.stop(`${brandColor("updated")} \`${dim(indexFile)}\``);
75911
75918
  };
75912
- var config18 = {
75919
+ var config19 = {
75913
75920
  configVersion: 1,
75914
75921
  id: "hono",
75915
75922
  frameworkCli: "create-hono",
@@ -75918,7 +75925,7 @@ var config18 = {
75918
75925
  path: "./templates"
75919
75926
  },
75920
75927
  platform: "workers",
75921
- generate: generate17,
75928
+ generate: generate18,
75922
75929
  configure: configure12,
75923
75930
  transformPackageJson: async () => ({
75924
75931
  scripts: {
@@ -75930,12 +75937,12 @@ var config18 = {
75930
75937
  devScript: "dev",
75931
75938
  deployScript: "deploy"
75932
75939
  };
75933
- var c3_default23 = config18;
75940
+ var c3_default24 = config19;
75934
75941
 
75935
75942
  // templates/next/c3.ts
75936
75943
  var import_path10 = require("path");
75937
- var { npm: npm13, npx: npx4 } = detectPackageManager();
75938
- var generate18 = async (ctx) => {
75944
+ var { npm: npm14, npx: npx4 } = detectPackageManager();
75945
+ var generate19 = async (ctx) => {
75939
75946
  const projectName = ctx.project.name;
75940
75947
  await runFrameworkGenerator(ctx, [projectName]);
75941
75948
  const wranglerToml = readFile((0, import_path10.join)(getTemplatePath(ctx), "wrangler.toml"));
@@ -76043,13 +76050,13 @@ var addDevDependencies = async (installEslintPlugin) => {
76043
76050
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
76044
76051
  });
76045
76052
  };
76046
- var c3_default24 = {
76053
+ var c3_default25 = {
76047
76054
  configVersion: 1,
76048
76055
  id: "next",
76049
76056
  frameworkCli: "create-next-app",
76050
76057
  platform: "pages",
76051
76058
  displayName: "Next",
76052
- generate: generate18,
76059
+ generate: generate19,
76053
76060
  configure: configure13,
76054
76061
  copyFiles: {
76055
76062
  async selectVariant(ctx) {
@@ -76081,12 +76088,12 @@ var c3_default24 = {
76081
76088
  }
76082
76089
  },
76083
76090
  transformPackageJson: async (_3, ctx) => {
76084
- const isNpm = npm13 === "npm";
76085
- const isBun = npm13 === "bun";
76091
+ const isNpm = npm14 === "npm";
76092
+ const isBun = npm14 === "bun";
76086
76093
  const isNpmOrBun = isNpm || isBun;
76087
76094
  const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
76088
76095
  const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
76089
- const pmCommand = isNpmOrBun ? npx4 : npm13;
76096
+ const pmCommand = isNpmOrBun ? npx4 : npm14;
76090
76097
  const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
76091
76098
  return {
76092
76099
  scripts: {
@@ -76107,14 +76114,14 @@ var c3_default24 = {
76107
76114
 
76108
76115
  // templates/nuxt/c3.ts
76109
76116
  var recast9 = __toESM(require_main3());
76110
- var { npm: npm14, name: pm3 } = detectPackageManager();
76111
- var generate19 = async (ctx) => {
76117
+ var { npm: npm15, name: pm3 } = detectPackageManager();
76118
+ var generate20 = async (ctx) => {
76112
76119
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
76113
76120
  await runFrameworkGenerator(ctx, [
76114
76121
  "init",
76115
76122
  ctx.project.name,
76116
76123
  "--packageManager",
76117
- npm14,
76124
+ npm15,
76118
76125
  gitFlag
76119
76126
  ]);
76120
76127
  writeFile2("./.node-version", "17");
@@ -76128,7 +76135,7 @@ var configure14 = async (ctx) => {
76128
76135
  await installPackages(packages, {
76129
76136
  dev: true,
76130
76137
  startText: "Installing nitro module `nitro-cloudflare-dev`",
76131
- doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
76138
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm15} install\``)}`
76132
76139
  });
76133
76140
  updateNuxtConfig2();
76134
76141
  updateEnvTypes3(ctx);
@@ -76179,7 +76186,7 @@ var updateNuxtConfig2 = () => {
76179
76186
  });
76180
76187
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
76181
76188
  };
76182
- var config19 = {
76189
+ var config20 = {
76183
76190
  configVersion: 1,
76184
76191
  id: "nuxt",
76185
76192
  frameworkCli: "nuxi",
@@ -76188,12 +76195,12 @@ var config19 = {
76188
76195
  copyFiles: {
76189
76196
  path: "./templates"
76190
76197
  },
76191
- generate: generate19,
76198
+ generate: generate20,
76192
76199
  configure: configure14,
76193
76200
  transformPackageJson: async () => ({
76194
76201
  scripts: {
76195
- deploy: `${npm14} run build && wrangler pages deploy`,
76196
- preview: `${npm14} run build && wrangler pages dev`,
76202
+ deploy: `${npm15} run build && wrangler pages deploy`,
76203
+ preview: `${npm15} run build && wrangler pages dev`,
76197
76204
  "cf-typegen": `wrangler types`
76198
76205
  }
76199
76206
  }),
@@ -76201,10 +76208,10 @@ var config19 = {
76201
76208
  deployScript: "deploy",
76202
76209
  previewScript: "preview"
76203
76210
  };
76204
- var c3_default25 = config19;
76211
+ var c3_default26 = config20;
76205
76212
 
76206
76213
  // templates/openapi/c3.ts
76207
- var c3_default26 = {
76214
+ var c3_default27 = {
76208
76215
  configVersion: 1,
76209
76216
  id: "openapi",
76210
76217
  displayName: "API starter (OpenAPI compliant)",
@@ -76363,7 +76370,7 @@ async function copyExistingWorkerFiles(ctx) {
76363
76370
  (0, import_path11.join)(ctx.project.path, "wrangler.toml")
76364
76371
  );
76365
76372
  }
76366
- var c3_default27 = {
76373
+ var c3_default28 = {
76367
76374
  configVersion: 1,
76368
76375
  id: "pre-existing",
76369
76376
  displayName: "Pre-existing Worker (from Dashboard)",
@@ -76391,7 +76398,7 @@ function buildConfigure(params) {
76391
76398
  }
76392
76399
 
76393
76400
  // templates/queues/c3.ts
76394
- var c3_default28 = {
76401
+ var c3_default29 = {
76395
76402
  configVersion: 1,
76396
76403
  id: "queues",
76397
76404
  displayName: "Queue consumer & producer Worker",
@@ -76421,8 +76428,8 @@ var c3_default28 = {
76421
76428
 
76422
76429
  // templates/qwik/c3.ts
76423
76430
  var recast10 = __toESM(require_main3());
76424
- var { npm: npm15, npx: npx5 } = detectPackageManager();
76425
- var generate20 = async (ctx) => {
76431
+ var { npm: npm16, npx: npx5 } = detectPackageManager();
76432
+ var generate21 = async (ctx) => {
76426
76433
  await runFrameworkGenerator(ctx, ["playground", ctx.project.name]);
76427
76434
  };
76428
76435
  var configure15 = async (ctx) => {
@@ -76502,7 +76509,7 @@ var populateCloudflareEnv2 = () => {
76502
76509
  });
76503
76510
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
76504
76511
  };
76505
- var config20 = {
76512
+ var config21 = {
76506
76513
  configVersion: 1,
76507
76514
  id: "qwik",
76508
76515
  frameworkCli: "create-qwik",
@@ -76511,12 +76518,12 @@ var config20 = {
76511
76518
  copyFiles: {
76512
76519
  path: "./templates"
76513
76520
  },
76514
- generate: generate20,
76521
+ generate: generate21,
76515
76522
  configure: configure15,
76516
76523
  transformPackageJson: async () => ({
76517
76524
  scripts: {
76518
- deploy: `${npm15} run build && wrangler pages deploy`,
76519
- preview: `${npm15} run build && wrangler pages dev`,
76525
+ deploy: `${npm16} run build && wrangler pages deploy`,
76526
+ preview: `${npm16} run build && wrangler pages dev`,
76520
76527
  "cf-typegen": `wrangler types`
76521
76528
  }
76522
76529
  }),
@@ -76524,11 +76531,11 @@ var config20 = {
76524
76531
  deployScript: "deploy",
76525
76532
  previewScript: "preview"
76526
76533
  };
76527
- var c3_default29 = config20;
76534
+ var c3_default30 = config21;
76528
76535
 
76529
76536
  // templates/react/c3.ts
76530
- var { npm: npm16 } = detectPackageManager();
76531
- var generate21 = async (ctx) => {
76537
+ var { npm: npm17 } = detectPackageManager();
76538
+ var generate22 = async (ctx) => {
76532
76539
  const variant = await inputPrompt({
76533
76540
  type: "select",
76534
76541
  question: "Select a variant:",
@@ -76557,29 +76564,29 @@ var variantsOptions = [
76557
76564
  label: "JavaScript + SWC"
76558
76565
  }
76559
76566
  ];
76560
- var config21 = {
76567
+ var config22 = {
76561
76568
  configVersion: 1,
76562
76569
  id: "react",
76563
76570
  // React's documentation now recommends using create-vite.
76564
76571
  frameworkCli: "create-vite",
76565
76572
  displayName: "React",
76566
76573
  platform: "pages",
76567
- generate: generate21,
76574
+ generate: generate22,
76568
76575
  transformPackageJson: async () => ({
76569
76576
  scripts: {
76570
- deploy: `${npm16} run build && wrangler pages deploy ./dist`,
76571
- preview: `${npm16} run build && wrangler pages dev ./dist`
76577
+ deploy: `${npm17} run build && wrangler pages deploy ./dist`,
76578
+ preview: `${npm17} run build && wrangler pages dev ./dist`
76572
76579
  }
76573
76580
  }),
76574
76581
  devScript: "dev",
76575
76582
  deployScript: "deploy",
76576
76583
  previewScript: "preview"
76577
76584
  };
76578
- var c3_default30 = config21;
76585
+ var c3_default31 = config22;
76579
76586
 
76580
76587
  // templates/remix/c3.ts
76581
- var { npm: npm17 } = detectPackageManager();
76582
- var generate22 = async (ctx) => {
76588
+ var { npm: npm18 } = detectPackageManager();
76589
+ var generate23 = async (ctx) => {
76583
76590
  await runFrameworkGenerator(ctx, [
76584
76591
  ctx.project.name,
76585
76592
  "--template",
@@ -76602,7 +76609,7 @@ var configure16 = async () => {
76602
76609
  });
76603
76610
  s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
76604
76611
  };
76605
- var config22 = {
76612
+ var config23 = {
76606
76613
  configVersion: 1,
76607
76614
  id: "remix",
76608
76615
  frameworkCli: "create-remix",
@@ -76611,12 +76618,12 @@ var config22 = {
76611
76618
  copyFiles: {
76612
76619
  path: "./templates"
76613
76620
  },
76614
- generate: generate22,
76621
+ generate: generate23,
76615
76622
  configure: configure16,
76616
76623
  transformPackageJson: async () => ({
76617
76624
  scripts: {
76618
- deploy: `${npm17} run build && wrangler pages deploy`,
76619
- preview: `${npm17} run build && wrangler pages dev`,
76625
+ deploy: `${npm18} run build && wrangler pages deploy`,
76626
+ preview: `${npm18} run build && wrangler pages dev`,
76620
76627
  "cf-typegen": `wrangler types`
76621
76628
  }
76622
76629
  }),
@@ -76624,10 +76631,10 @@ var config22 = {
76624
76631
  deployScript: "deploy",
76625
76632
  previewScript: "preview"
76626
76633
  };
76627
- var c3_default31 = config22;
76634
+ var c3_default32 = config23;
76628
76635
 
76629
76636
  // templates/scheduled/c3.ts
76630
- var c3_default32 = {
76637
+ var c3_default33 = {
76631
76638
  configVersion: 1,
76632
76639
  id: "scheduled",
76633
76640
  displayName: "Scheduled Worker (Cron Trigger)",
@@ -76647,8 +76654,8 @@ var c3_default32 = {
76647
76654
 
76648
76655
  // templates/solid/c3.ts
76649
76656
  var recast11 = __toESM(require_main3());
76650
- var { npm: npm18 } = detectPackageManager();
76651
- var generate23 = async (ctx) => {
76657
+ var { npm: npm19 } = detectPackageManager();
76658
+ var generate24 = async (ctx) => {
76652
76659
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
76653
76660
  logRaw("");
76654
76661
  };
@@ -76690,7 +76697,7 @@ var configure17 = async (ctx) => {
76690
76697
  }
76691
76698
  });
76692
76699
  };
76693
- var config23 = {
76700
+ var config24 = {
76694
76701
  configVersion: 1,
76695
76702
  id: "solid",
76696
76703
  frameworkCli: "create-solid",
@@ -76699,12 +76706,12 @@ var config23 = {
76699
76706
  copyFiles: {
76700
76707
  path: "./templates"
76701
76708
  },
76702
- generate: generate23,
76709
+ generate: generate24,
76703
76710
  configure: configure17,
76704
76711
  transformPackageJson: async () => ({
76705
76712
  scripts: {
76706
- preview: `${npm18} run build && npx wrangler pages dev`,
76707
- deploy: `${npm18} run build && wrangler pages deploy`
76713
+ preview: `${npm19} run build && npx wrangler pages dev`,
76714
+ deploy: `${npm19} run build && wrangler pages deploy`
76708
76715
  }
76709
76716
  }),
76710
76717
  compatibilityFlags: ["nodejs_compat"],
@@ -76712,14 +76719,15 @@ var config23 = {
76712
76719
  deployScript: "deploy",
76713
76720
  previewScript: "preview"
76714
76721
  };
76715
- var c3_default33 = config23;
76722
+ var c3_default34 = config24;
76716
76723
 
76717
76724
  // templates/svelte/c3.ts
76725
+ var import_node_fs3 = require("node:fs");
76718
76726
  var import_node_os4 = require("node:os");
76719
76727
  var recast12 = __toESM(require_main3());
76720
- var { npm: npm19 } = detectPackageManager();
76721
- var generate24 = async (ctx) => {
76722
- await runFrameworkGenerator(ctx, [ctx.project.name]);
76728
+ var { npm: npm20 } = detectPackageManager();
76729
+ var generate25 = async (ctx) => {
76730
+ await runFrameworkGenerator(ctx, ["create", ctx.project.name]);
76723
76731
  logRaw("");
76724
76732
  };
76725
76733
  var configure18 = async (ctx) => {
@@ -76730,6 +76738,7 @@ var configure18 = async (ctx) => {
76730
76738
  doneText: `${brandColor(`installed`)} ${dim(pkg)}`
76731
76739
  });
76732
76740
  updateSvelteConfig2();
76741
+ updatePlaywrightConfig(usesTypescript(ctx));
76733
76742
  updateTypeDefinitions2(ctx);
76734
76743
  };
76735
76744
  var updateSvelteConfig2 = () => {
@@ -76744,6 +76753,28 @@ var updateSvelteConfig2 = () => {
76744
76753
  }
76745
76754
  });
76746
76755
  };
76756
+ var updatePlaywrightConfig = (shouldUseTypescript) => {
76757
+ const filePath = `playwright.config.${shouldUseTypescript ? "ts" : "js"}`;
76758
+ if (!(0, import_node_fs3.existsSync)(filePath)) {
76759
+ return;
76760
+ }
76761
+ updateStatus(`Changing webServer port in ${blue(filePath)}`);
76762
+ transformFile(filePath, {
76763
+ visitObjectExpression: function(n2) {
76764
+ const portProp = n2.node.properties.find((prop) => {
76765
+ if (!("key" in prop) || !("name" in prop.key)) {
76766
+ return false;
76767
+ }
76768
+ return prop.key.name === "port";
76769
+ });
76770
+ if (!portProp || !("value" in portProp) || !("value" in portProp.value)) {
76771
+ return this.traverse(n2);
76772
+ }
76773
+ portProp.value.value = 8788;
76774
+ return false;
76775
+ }
76776
+ });
76777
+ };
76747
76778
  var updateTypeDefinitions2 = (ctx) => {
76748
76779
  if (!usesTypescript(ctx)) {
76749
76780
  return;
@@ -76781,24 +76812,21 @@ var updateTypeDefinitions2 = (ctx) => {
76781
76812
  }
76782
76813
  });
76783
76814
  };
76784
- var config24 = {
76815
+ var config25 = {
76785
76816
  configVersion: 1,
76786
76817
  id: "svelte",
76787
- frameworkCli: "create-svelte",
76788
- displayName: "Svelte",
76818
+ frameworkCli: "sv",
76819
+ displayName: "SvelteKit",
76789
76820
  platform: "pages",
76790
76821
  copyFiles: {
76791
- variants: {
76792
- js: { path: "./js" },
76793
- ts: { path: "./ts" }
76794
- }
76822
+ path: "./templates"
76795
76823
  },
76796
- generate: generate24,
76824
+ generate: generate25,
76797
76825
  configure: configure18,
76798
76826
  transformPackageJson: async (original, ctx) => {
76799
76827
  let scripts = {
76800
- preview: `${npm19} run build && wrangler pages dev`,
76801
- deploy: `${npm19} run build && wrangler pages deploy`
76828
+ preview: `${npm20} run build && wrangler pages dev`,
76829
+ deploy: `${npm20} run build && wrangler pages deploy`
76802
76830
  };
76803
76831
  if (usesTypescript(ctx)) {
76804
76832
  const mv = (0, import_node_os4.platform)() === "win32" ? "move" : "mv";
@@ -76813,34 +76841,34 @@ var config24 = {
76813
76841
  deployScript: "deploy",
76814
76842
  previewScript: "preview"
76815
76843
  };
76816
- var c3_default34 = config24;
76844
+ var c3_default35 = config25;
76817
76845
 
76818
76846
  // templates/vue/c3.ts
76819
- var { npm: npm20 } = detectPackageManager();
76820
- var generate25 = async (ctx) => {
76847
+ var { npm: npm21 } = detectPackageManager();
76848
+ var generate26 = async (ctx) => {
76821
76849
  await runFrameworkGenerator(ctx, [ctx.project.name]);
76822
76850
  };
76823
- var config25 = {
76851
+ var config26 = {
76824
76852
  configVersion: 1,
76825
76853
  id: "vue",
76826
76854
  frameworkCli: "create-vue",
76827
76855
  displayName: "Vue",
76828
76856
  platform: "pages",
76829
- generate: generate25,
76857
+ generate: generate26,
76830
76858
  transformPackageJson: async () => ({
76831
76859
  scripts: {
76832
- deploy: `${npm20} run build && wrangler pages deploy ./dist`,
76833
- preview: `${npm20} run build && wrangler pages dev ./dist`
76860
+ deploy: `${npm21} run build && wrangler pages deploy ./dist`,
76861
+ preview: `${npm21} run build && wrangler pages dev ./dist`
76834
76862
  }
76835
76863
  }),
76836
76864
  devScript: "dev",
76837
76865
  deployScript: "deploy",
76838
76866
  previewScript: "preview"
76839
76867
  };
76840
- var c3_default35 = config25;
76868
+ var c3_default36 = config26;
76841
76869
 
76842
76870
  // ../wrangler/package.json
76843
- var version2 = "0.0.0-80e5bc688";
76871
+ var version2 = "0.0.0-80f21799a";
76844
76872
 
76845
76873
  // src/git.ts
76846
76874
  var offerGit = async (ctx) => {
@@ -77116,24 +77144,25 @@ function getFrameworkMap({ experimental = false }) {
77116
77144
  qwik: c3_default11,
77117
77145
  remix: c3_default12,
77118
77146
  solid: c3_default13,
77119
- svelte: c3_default14
77147
+ svelte: c3_default14,
77148
+ vue: c3_default15
77120
77149
  };
77121
77150
  } else {
77122
77151
  return {
77123
- analog: c3_default15,
77124
- angular: c3_default16,
77125
- astro: c3_default17,
77126
- docusaurus: c3_default19,
77127
- gatsby: c3_default20,
77128
- hono: c3_default23,
77129
- next: c3_default24,
77130
- nuxt: c3_default25,
77131
- qwik: c3_default29,
77132
- react: c3_default30,
77133
- remix: c3_default31,
77134
- solid: c3_default33,
77135
- svelte: c3_default34,
77136
- vue: c3_default35
77152
+ analog: c3_default16,
77153
+ angular: c3_default17,
77154
+ astro: c3_default18,
77155
+ docusaurus: c3_default20,
77156
+ gatsby: c3_default21,
77157
+ hono: c3_default24,
77158
+ next: c3_default25,
77159
+ nuxt: c3_default26,
77160
+ qwik: c3_default30,
77161
+ react: c3_default31,
77162
+ remix: c3_default32,
77163
+ solid: c3_default34,
77164
+ svelte: c3_default35,
77165
+ vue: c3_default36
77137
77166
  };
77138
77167
  }
77139
77168
  }
@@ -77146,13 +77175,13 @@ function getTemplateMap({ experimental = false }) {
77146
77175
  };
77147
77176
  } else {
77148
77177
  return {
77149
- "hello-world": c3_default22,
77150
- common: c3_default18,
77151
- scheduled: c3_default32,
77152
- queues: c3_default28,
77153
- "hello-world-durable-object": c3_default21,
77154
- openapi: c3_default26,
77155
- "pre-existing": c3_default27
77178
+ "hello-world": c3_default23,
77179
+ common: c3_default19,
77180
+ scheduled: c3_default33,
77181
+ queues: c3_default29,
77182
+ "hello-world-durable-object": c3_default22,
77183
+ openapi: c3_default27,
77184
+ "pre-existing": c3_default28
77156
77185
  };
77157
77186
  }
77158
77187
  }
@@ -77299,8 +77328,8 @@ var createContext = async (args, prevArgs) => {
77299
77328
  experimental: args.experimental
77300
77329
  });
77301
77330
  const frameworkOptions = Object.entries(frameworkMap).map(
77302
- ([key, config26]) => ({
77303
- label: config26.displayName,
77331
+ ([key, config27]) => ({
77332
+ label: config27.displayName,
77304
77333
  value: key
77305
77334
  })
77306
77335
  );
@@ -77438,28 +77467,28 @@ var processRemoteTemplate = async (args) => {
77438
77467
  src = src.replace("https://github.com/", "github:").replace("/tree/main/", "/");
77439
77468
  }
77440
77469
  const path6 = await downloadRemoteTemplate(src);
77441
- const config26 = inferTemplateConfig(path6);
77442
- validateTemplate(path6, config26);
77470
+ const config27 = inferTemplateConfig(path6);
77471
+ validateTemplate(path6, config27);
77443
77472
  updateStatus(`${brandColor("template")} ${dim("cloned and validated")}`);
77444
77473
  return {
77445
77474
  path: path6,
77446
- ...config26
77475
+ ...config27
77447
77476
  };
77448
77477
  };
77449
- var validateTemplate = (path6, config26) => {
77450
- if (!config26.copyFiles) {
77478
+ var validateTemplate = (path6, config27) => {
77479
+ if (!config27.copyFiles) {
77451
77480
  return;
77452
77481
  }
77453
- if (isVariantInfo(config26.copyFiles)) {
77454
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config26.copyFiles.path), config26);
77482
+ if (isVariantInfo(config27.copyFiles)) {
77483
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, config27.copyFiles.path), config27);
77455
77484
  } else {
77456
- for (const variant of Object.values(config26.copyFiles.variants)) {
77457
- validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config26);
77485
+ for (const variant of Object.values(config27.copyFiles.variants)) {
77486
+ validateTemplateSrcDirectory((0, import_path13.resolve)(path6, variant.path), config27);
77458
77487
  }
77459
77488
  }
77460
77489
  };
77461
- var validateTemplateSrcDirectory = (path6, config26) => {
77462
- if (config26.platform === "workers") {
77490
+ var validateTemplateSrcDirectory = (path6, config27) => {
77491
+ if (config27.platform === "workers") {
77463
77492
  const wranglerTomlPath = (0, import_path13.resolve)(path6, "wrangler.toml");
77464
77493
  if (!(0, import_fs11.existsSync)(wranglerTomlPath)) {
77465
77494
  throw new Error(
@@ -77911,11 +77940,13 @@ var processArgument = async (args, key, promptConfig) => {
77911
77940
  disableTelemetry: args[key] !== void 0,
77912
77941
  async promise() {
77913
77942
  const value = args[key];
77943
+ const error2 = promptConfig.validate?.(value) ?? null;
77914
77944
  const result = await inputPrompt({
77915
77945
  ...promptConfig,
77916
77946
  // Accept the default value if the arg is already set
77917
- acceptDefault: promptConfig.acceptDefault ?? value !== void 0,
77947
+ acceptDefault: promptConfig.acceptDefault ?? (value !== void 0 && !error2),
77918
77948
  defaultValue: value ?? promptConfig.defaultValue,
77949
+ initialErrorMessage: error2,
77919
77950
  throwOnError: true
77920
77951
  });
77921
77952
  args[key] = result;
@@ -77927,6 +77958,9 @@ var processArgument = async (args, key, promptConfig) => {
77927
77958
  };
77928
77959
 
77929
77960
  // src/deploy.ts
77961
+ var import_promises4 = require("node:fs/promises");
77962
+ var import_node_os5 = require("node:os");
77963
+ var import_node_path5 = require("node:path");
77930
77964
  var import_toml2 = __toESM(require_toml());
77931
77965
 
77932
77966
  // src/helpers/poll.ts
@@ -79160,14 +79194,16 @@ var updateWranglerToml = async (ctx) => {
79160
79194
  }
79161
79195
  } else {
79162
79196
  newToml.prepend(
79163
- `compatibility_date = "${await getWorkerdCompatibilityDate()}"`
79197
+ `compatibility_date = "${await getWorkerdCompatibilityDate()}"
79198
+ `
79164
79199
  );
79165
79200
  }
79166
79201
  const nameRe = /^name\s*=.*/m;
79167
79202
  if (wranglerToml.match(nameRe)) {
79168
79203
  newToml.replace(nameRe, `name = "${ctx.project.name}"`);
79169
79204
  } else {
79170
- newToml.prepend(`name = "${ctx.project.name}"`);
79205
+ newToml.prepend(`name = "${ctx.project.name}"
79206
+ `);
79171
79207
  }
79172
79208
  writeWranglerToml(ctx, newToml.toString());
79173
79209
  };
@@ -79189,7 +79225,7 @@ var writeWranglerToml = (ctx, contents) => {
79189
79225
 
79190
79226
  // src/deploy.ts
79191
79227
  var offerToDeploy = async (ctx) => {
79192
- const { npm: npm22 } = detectPackageManager();
79228
+ const { npm: npm23 } = detectPackageManager();
79193
79229
  startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
79194
79230
  if (!await isDeployable(ctx)) {
79195
79231
  ctx.args.deploy = false;
@@ -79200,7 +79236,7 @@ var offerToDeploy = async (ctx) => {
79200
79236
  );
79201
79237
  }
79202
79238
  const label = `deploy via \`${quoteShellArgs([
79203
- npm22,
79239
+ npm23,
79204
79240
  "run",
79205
79241
  ctx.template.deployScript ?? "deploy"
79206
79242
  ])}\``;
@@ -79230,11 +79266,11 @@ var isDeployable = async (ctx) => {
79230
79266
  return !hasBinding(wranglerToml);
79231
79267
  };
79232
79268
  var runDeploy = async (ctx) => {
79233
- const { npm: npm22, name: pm4 } = detectPackageManager();
79269
+ const { npm: npm23, name: pm4 } = detectPackageManager();
79234
79270
  if (!ctx.account?.id) {
79235
79271
  throw new Error("Failed to read Cloudflare account.");
79236
79272
  }
79237
- const baseDeployCmd = [npm22, "run", ctx.template.deployScript ?? "deploy"];
79273
+ const baseDeployCmd = [npm23, "run", ctx.template.deployScript ?? "deploy"];
79238
79274
  const insideGitRepo = await isInsideGitRepo(ctx.project.path);
79239
79275
  const deployCmd = [
79240
79276
  ...baseDeployCmd,
@@ -79245,23 +79281,34 @@ var runDeploy = async (ctx) => {
79245
79281
  JSON.stringify(ctx.commitMessage)
79246
79282
  ] : []
79247
79283
  ];
79248
- const result = await runCommand(deployCmd, {
79249
- silent: true,
79284
+ const outputFile = (0, import_node_path5.join)(
79285
+ await (0, import_promises4.mkdtemp)((0, import_node_path5.join)((0, import_node_os5.tmpdir)(), "c3-wrangler-deploy-")),
79286
+ "output.json"
79287
+ );
79288
+ await runCommand(deployCmd, {
79250
79289
  cwd: ctx.project.path,
79251
79290
  env: {
79252
79291
  CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
79253
- NODE_ENV: "production"
79292
+ NODE_ENV: "production",
79293
+ WRANGLER_OUTPUT_FILE_PATH: outputFile
79254
79294
  },
79255
79295
  startText: "Deploying your application",
79256
79296
  doneText: `${brandColor("deployed")} ${dim(
79257
79297
  `via \`${quoteShellArgs(baseDeployCmd)}\``
79258
79298
  )}`
79259
79299
  });
79260
- const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
79261
- const deployedUrlMatch = result.match(deployedUrlRegex);
79262
- if (deployedUrlMatch) {
79263
- ctx.deployment.url = deployedUrlMatch[0];
79264
- } else {
79300
+ try {
79301
+ const contents = readFile(outputFile);
79302
+ const entries = contents.split("\n").filter(Boolean).map((entry) => JSON.parse(entry));
79303
+ const url = entries.find((entry) => entry.type === "deploy")?.targets?.[0] ?? entries.find((entry) => entry.type === "pages-deploy")?.url;
79304
+ const deployedUrlRegex = /https:\/\/.+\.(pages|workers)\.dev/;
79305
+ const deployedUrlMatch = url?.match(deployedUrlRegex);
79306
+ if (deployedUrlMatch) {
79307
+ ctx.deployment.url = deployedUrlMatch[0];
79308
+ } else {
79309
+ throw new Error("Failed to find deployment url.");
79310
+ }
79311
+ } catch {
79265
79312
  throw new Error("Failed to find deployment url.");
79266
79313
  }
79267
79314
  if (ctx.deployment.url?.endsWith(".pages.dev")) {
@@ -79313,16 +79360,22 @@ function createDialog(lines) {
79313
79360
  ""
79314
79361
  ].join("\n");
79315
79362
  }
79316
- function printWelcomeMessage(version3, telemetryEnabled) {
79363
+ function printWelcomeMessage(version3, telemetryEnabled, args) {
79317
79364
  const lines = [
79318
79365
  `\u{1F44B} Welcome to create-cloudflare v${version3}!`,
79319
79366
  `\u{1F9E1} Let's get started.`
79320
79367
  ];
79368
+ if (args.experimental) {
79369
+ lines.push("", blue`🧪 Running in experimental mode`);
79370
+ }
79321
79371
  if (telemetryEnabled) {
79372
+ if (args.experimental) {
79373
+ lines.push("");
79374
+ }
79322
79375
  const telemetryDocsUrl = `https://github.com/cloudflare/workers-sdk/blob/main/packages/create-cloudflare/telemetry.md`;
79323
79376
  lines.push(
79324
79377
  `\u{1F4CA} Cloudflare collects telemetry about your usage of Create-Cloudflare.`,
79325
- ``,
79378
+ "",
79326
79379
  `Learn more at: ${blue.underline(hyperlink(telemetryDocsUrl))}`
79327
79380
  );
79328
79381
  }
@@ -79333,19 +79386,20 @@ var printSummary = (ctx) => {
79333
79386
  const dashboardUrl = ctx.account ? `https://dash.cloudflare.com/?to=/:account/workers/services/view/${ctx.project.name}` : null;
79334
79387
  const relativePath = (0, import_path15.relative)(ctx.originalCWD, ctx.project.path);
79335
79388
  const cdCommand = relativePath ? `cd ${relativePath}` : null;
79336
- const { npm: npm22 } = detectPackageManager();
79389
+ const { npm: npm23 } = detectPackageManager();
79337
79390
  const devServerCommand = quoteShellArgs([
79338
- npm22,
79391
+ npm23,
79339
79392
  "run",
79340
79393
  ctx.template.devScript ?? "start"
79341
79394
  ]);
79342
79395
  const deployCommand = quoteShellArgs([
79343
- npm22,
79396
+ npm23,
79344
79397
  "run",
79345
79398
  ctx.template.deployScript ?? "deploy"
79346
79399
  ]);
79347
79400
  const documentationUrl = `https://developers.cloudflare.com/${ctx.template.platform}`;
79348
79401
  const discordUrl = `https://discord.cloudflare.com`;
79402
+ const reportIssueUrl = "https://github.com/cloudflare/workers-sdk/issues/new/choose";
79349
79403
  const lines = [
79350
79404
  `\u{1F389} ${bgGreen(" SUCCESS ")} Application ${ctx.deployment.url ? "deployed" : "created"} successfully!`,
79351
79405
  ``
@@ -79367,6 +79421,9 @@ var printSummary = (ctx) => {
79367
79421
  `\u{1F4D6} Explore Documentation`,
79368
79422
  `${blue.underline(hyperlink(documentationUrl))}`,
79369
79423
  ``,
79424
+ `\u{1F41B} Report an Issue`,
79425
+ `${blue.underline(hyperlink(reportIssueUrl))}`,
79426
+ ``,
79370
79427
  `\u{1F4AC} Join our Community`,
79371
79428
  `${blue.underline(hyperlink(discordUrl))}`
79372
79429
  );
@@ -79704,8 +79761,8 @@ var renderValues = (values) => {
79704
79761
  };
79705
79762
 
79706
79763
  // src/helpers/retry.ts
79707
- var retry = async (config26, fn) => {
79708
- let { times } = config26;
79764
+ var retry = async (config27, fn) => {
79765
+ let { times } = config27;
79709
79766
  let error2 = null;
79710
79767
  while (times > 0) {
79711
79768
  try {
@@ -79713,10 +79770,10 @@ var retry = async (config26, fn) => {
79713
79770
  } catch (e) {
79714
79771
  error2 = e;
79715
79772
  times--;
79716
- if (config26.exitCondition?.(e)) {
79773
+ if (config27.exitCondition?.(e)) {
79717
79774
  break;
79718
79775
  }
79719
- await sleep(config26.sleepMs ?? 1e3);
79776
+ await sleep(config27.sleepMs ?? 1e3);
79720
79777
  }
79721
79778
  }
79722
79779
  throw error2;
@@ -81113,14 +81170,14 @@ function applyEdits(text, edits) {
81113
81170
 
81114
81171
  // src/workers.ts
81115
81172
  async function installWorkersTypes(ctx) {
81116
- const { npm: npm22 } = detectPackageManager();
81173
+ const { npm: npm23 } = detectPackageManager();
81117
81174
  if (!usesTypescript(ctx)) {
81118
81175
  return;
81119
81176
  }
81120
81177
  await installPackages(["@cloudflare/workers-types"], {
81121
81178
  dev: true,
81122
81179
  startText: "Installing @cloudflare/workers-types",
81123
- doneText: `${brandColor("installed")} ${dim(`via ${npm22}`)}`
81180
+ doneText: `${brandColor("installed")} ${dim(`via ${npm23}`)}`
81124
81181
  });
81125
81182
  await addWorkersTypesToTsConfig(ctx);
81126
81183
  }
@@ -81143,8 +81200,8 @@ async function addWorkersTypesToTsConfig(ctx) {
81143
81200
  }
81144
81201
  const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
81145
81202
  try {
81146
- const config26 = parse3(tsconfig);
81147
- const currentTypes = config26.compilerOptions?.types ?? [];
81203
+ const config27 = parse3(tsconfig);
81204
+ const currentTypes = config27.compilerOptions?.types ?? [];
81148
81205
  const explicitEntrypoint = currentTypes.some(
81149
81206
  (t) => t.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
81150
81207
  );
@@ -81174,7 +81231,7 @@ async function addWorkersTypesToTsConfig(ctx) {
81174
81231
  }
81175
81232
 
81176
81233
  // src/cli.ts
81177
- var { npm: npm21 } = detectPackageManager();
81234
+ var { npm: npm22 } = detectPackageManager();
81178
81235
  var main = async (argv) => {
81179
81236
  const result = await parseArgs(argv);
81180
81237
  if (result.type === "unknown") {
@@ -81210,13 +81267,13 @@ ${result.errorMessage}`);
81210
81267
  };
81211
81268
  var runLatest = async () => {
81212
81269
  const args = process.argv.slice(2);
81213
- if (npm21 === "npm") {
81270
+ if (npm22 === "npm") {
81214
81271
  args.unshift("--");
81215
81272
  }
81216
- await runCommand([npm21, "create", "cloudflare@latest", ...args]);
81273
+ await runCommand([npm22, "create", "cloudflare@latest", ...args]);
81217
81274
  };
81218
81275
  var runCli = async (args) => {
81219
- printBanner();
81276
+ printBanner(args);
81220
81277
  const ctx = await createContext(args);
81221
81278
  await create(ctx);
81222
81279
  await configure19(ctx);
@@ -81270,8 +81327,8 @@ var deploy = async (ctx) => {
81270
81327
  await maybeOpenBrowser(ctx);
81271
81328
  endSection("Done");
81272
81329
  };
81273
- var printBanner = () => {
81274
- printWelcomeMessage(version, reporter.isEnabled);
81330
+ var printBanner = (args) => {
81331
+ printWelcomeMessage(version, reporter.isEnabled, args);
81275
81332
  startSection(`Create an application with Cloudflare`, "Step 1 of 3");
81276
81333
  };
81277
81334
  main(process.argv).catch((e) => {