create-cloudflare 0.0.0-a7aa28ad → 0.0.0-a7e36d50

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 (66) hide show
  1. package/dist/cli.js +877 -700
  2. package/package.json +4 -4
  3. package/templates/analog/c3.ts +134 -0
  4. package/templates/analog/snippets/devBindingsModule.ts +7 -0
  5. package/templates/analog/templates/env.d.ts +13 -0
  6. package/templates/analog/templates/src/dev-bindings.ts +18 -0
  7. package/templates/analog/templates/worker-configuration.d.ts +4 -0
  8. package/templates/analog/templates/wrangler.toml +78 -0
  9. package/templates/astro/c3.ts +3 -3
  10. package/templates/astro/templates/wrangler.toml +28 -2
  11. package/templates/common/js/wrangler.toml +4 -1
  12. package/templates/common/ts/package.json +2 -1
  13. package/templates/common/ts/src/index.ts +3 -0
  14. package/templates/common/ts/worker-configuration.d.ts +2 -14
  15. package/templates/common/ts/wrangler.toml +4 -1
  16. package/templates/hello-world/js/package.json +2 -1
  17. package/templates/hello-world/js/test/index.spec.js +17 -17
  18. package/templates/hello-world/js/wrangler.toml +4 -1
  19. package/templates/hello-world/ts/package.json +2 -1
  20. package/templates/hello-world/ts/src/index.ts +3 -17
  21. package/templates/hello-world/ts/test/index.spec.ts +17 -17
  22. package/templates/hello-world/ts/worker-configuration.d.ts +4 -0
  23. package/templates/hello-world/ts/wrangler.toml +4 -1
  24. package/templates/hello-world-durable-object/js/src/index.js +18 -14
  25. package/templates/hello-world-durable-object/js/wrangler.toml +4 -1
  26. package/templates/hello-world-durable-object/ts/package.json +2 -2
  27. package/templates/hello-world-durable-object/ts/src/index.ts +24 -16
  28. package/templates/hello-world-durable-object/ts/worker-configuration.d.ts +6 -0
  29. package/templates/hello-world-durable-object/ts/wrangler.toml +4 -2
  30. package/templates/hello-world-python/py/wrangler.toml +97 -0
  31. package/templates/hono/c3.ts +53 -0
  32. package/templates/hono/snippets/appDeclaration.ts +1 -0
  33. package/templates/hono/snippets/bindingsType.ts +1 -0
  34. package/templates/hono/templates/worker-configuration.d.ts +4 -0
  35. package/templates/hono/templates/wrangler.toml +100 -0
  36. package/templates/next/README.md +5 -5
  37. package/templates/next/c3.ts +3 -3
  38. package/templates/next/wrangler.toml +26 -1
  39. package/templates/nuxt/c3.ts +4 -4
  40. package/templates/nuxt/templates/worker-configuration.d.ts +1 -1
  41. package/templates/nuxt/templates/wrangler.toml +28 -2
  42. package/templates/openapi/ts/package.json +2 -1
  43. package/templates/openapi/ts/worker-configuration.d.ts +4 -0
  44. package/templates/openapi/ts/wrangler.toml +97 -0
  45. package/templates/pre-existing/js/wrangler.toml +1 -0
  46. package/templates/queues/js/wrangler.toml +4 -1
  47. package/templates/queues/ts/package.json +2 -1
  48. package/templates/queues/ts/src/index.ts +3 -5
  49. package/templates/queues/ts/worker-configuration.d.ts +5 -0
  50. package/templates/queues/ts/wrangler.toml +4 -1
  51. package/templates/qwik/c3.ts +3 -3
  52. package/templates/qwik/templates/worker-configuration.d.ts +1 -1
  53. package/templates/qwik/templates/wrangler.toml +28 -2
  54. package/templates/remix/c3.ts +3 -3
  55. package/templates/remix/templates/worker-configuration.d.ts +1 -1
  56. package/templates/remix/templates/wrangler.toml +28 -2
  57. package/templates/scheduled/js/wrangler.toml +5 -2
  58. package/templates/scheduled/ts/package.json +2 -1
  59. package/templates/scheduled/ts/src/index.ts +3 -20
  60. package/templates/scheduled/ts/worker-configuration.d.ts +4 -0
  61. package/templates/scheduled/ts/wrangler.toml +5 -2
  62. package/templates/solid/c3.ts +5 -3
  63. package/templates/solid/templates/wrangler.toml +77 -0
  64. package/templates/svelte/c3.ts +3 -3
  65. package/templates/svelte/js/wrangler.toml +28 -2
  66. package/templates/svelte/ts/wrangler.toml +28 -2
package/dist/cli.js CHANGED
@@ -3569,37 +3569,37 @@ var init_interactive = __esm({
3569
3569
  }
3570
3570
  return input;
3571
3571
  };
3572
- renderSubmit = (config13, value) => {
3573
- const { question, label } = config13;
3574
- if (config13.type !== "confirm" && value.length === 0) {
3572
+ renderSubmit = (config14, value) => {
3573
+ const { question, label } = config14;
3574
+ if (config14.type !== "confirm" && value.length === 0) {
3575
3575
  return [`${leftT} ${question} ${dim("(skipped)")}`, `${grayBar}`];
3576
3576
  }
3577
- const content = config13.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
3577
+ const content = config14.type === "confirm" ? `${grayBar} ${brandColor(value)} ${dim(label)}` : `${grayBar} ${brandColor(label)} ${dim(value)}`;
3578
3578
  return [`${leftT} ${question}`, content, `${grayBar}`];
3579
3579
  };
3580
3580
  handleCancel = () => {
3581
3581
  cancel("Operation cancelled.");
3582
3582
  process.exit(0);
3583
3583
  };
3584
- getRenderers = (config13) => {
3585
- switch (config13.type) {
3584
+ getRenderers = (config14) => {
3585
+ switch (config14.type) {
3586
3586
  case "select":
3587
- return getSelectRenderers(config13);
3587
+ return getSelectRenderers(config14);
3588
3588
  case "confirm":
3589
- return getConfirmRenderers(config13);
3589
+ return getConfirmRenderers(config14);
3590
3590
  case "text":
3591
- return getTextRenderers(config13);
3591
+ return getTextRenderers(config14);
3592
3592
  case "multiselect":
3593
- return getSelectRenderers(config13);
3593
+ return getSelectRenderers(config14);
3594
3594
  case "list":
3595
- return getSelectListRenderers(config13);
3595
+ return getSelectListRenderers(config14);
3596
3596
  }
3597
3597
  };
3598
- getTextRenderers = (config13) => {
3599
- const { question } = config13;
3600
- const helpText = config13.helpText ?? "";
3601
- const format5 = config13.format ?? ((val) => String(val));
3602
- const defaultValue = config13.defaultValue?.toString() ?? "";
3598
+ getTextRenderers = (config14) => {
3599
+ const { question } = config14;
3600
+ const helpText = config14.helpText ?? "";
3601
+ const format5 = config14.format ?? ((val) => String(val));
3602
+ const defaultValue = config14.defaultValue?.toString() ?? "";
3603
3603
  return {
3604
3604
  initial: () => [
3605
3605
  `${blCorner} ${bold(question)} ${dim(helpText)}`,
@@ -3621,14 +3621,14 @@ var init_interactive = __esm({
3621
3621
  ``
3622
3622
  // extra line for readability
3623
3623
  ],
3624
- submit: ({ value }) => renderSubmit(config13, format5(value ?? "")),
3624
+ submit: ({ value }) => renderSubmit(config14, format5(value ?? "")),
3625
3625
  cancel: handleCancel
3626
3626
  };
3627
3627
  };
3628
- getSelectRenderers = (config13) => {
3629
- const { options, question, helpText: _helpText } = config13;
3628
+ getSelectRenderers = (config14) => {
3629
+ const { options, question, helpText: _helpText } = config14;
3630
3630
  const helpText = _helpText ?? "";
3631
- const maxItemsPerPage = config13.maxItemsPerPage ?? 32;
3631
+ const maxItemsPerPage = config14.maxItemsPerPage ?? 32;
3632
3632
  const defaultRenderer = ({ cursor, value }) => {
3633
3633
  cursor = cursor ?? 0;
3634
3634
  const renderOption = (opt, i) => {
@@ -3675,21 +3675,21 @@ ${space(2)}${dim("...")}` : ""}`,
3675
3675
  submit: ({ value }) => {
3676
3676
  if (Array.isArray(value)) {
3677
3677
  return renderSubmit(
3678
- config13,
3678
+ config14,
3679
3679
  options.filter((o) => value.includes(o.value)).map((o) => o.label).join(", ")
3680
3680
  );
3681
3681
  }
3682
3682
  return renderSubmit(
3683
- config13,
3683
+ config14,
3684
3684
  options.find((o) => o.value === value)?.label
3685
3685
  );
3686
3686
  },
3687
3687
  cancel: handleCancel
3688
3688
  };
3689
3689
  };
3690
- getSelectListRenderers = (config13) => {
3691
- const { question, helpText: _helpText } = config13;
3692
- let options = config13.options;
3690
+ getSelectListRenderers = (config14) => {
3691
+ const { question, helpText: _helpText } = config14;
3692
+ let options = config14.options;
3693
3693
  const helpText = _helpText ?? "";
3694
3694
  const { rows } = stdout;
3695
3695
  const defaultRenderer = ({ cursor, value }, prompt) => {
@@ -3770,20 +3770,20 @@ ${space(2)}${dim("...")}` : ""}`,
3770
3770
  submit: ({ value }) => {
3771
3771
  if (Array.isArray(value)) {
3772
3772
  return renderSubmit(
3773
- config13,
3773
+ config14,
3774
3774
  options.filter((o) => value.includes(o.value)).map((o) => o.value).join(", ")
3775
3775
  );
3776
3776
  }
3777
3777
  return renderSubmit(
3778
- config13,
3778
+ config14,
3779
3779
  options.find((o) => o.value === value)?.value
3780
3780
  );
3781
3781
  },
3782
3782
  cancel: handleCancel
3783
3783
  };
3784
3784
  };
3785
- getConfirmRenderers = (config13) => {
3786
- const { activeText, inactiveText, question, helpText: _helpText } = config13;
3785
+ getConfirmRenderers = (config14) => {
3786
+ const { activeText, inactiveText, question, helpText: _helpText } = config14;
3787
3787
  const helpText = _helpText ?? "";
3788
3788
  const active = activeText || "Yes";
3789
3789
  const inactive = inactiveText || "No";
@@ -3800,7 +3800,7 @@ ${space(2)}${dim("...")}` : ""}`,
3800
3800
  active: defaultRenderer,
3801
3801
  confirm: defaultRenderer,
3802
3802
  error: defaultRenderer,
3803
- submit: ({ value }) => renderSubmit(config13, value ? "yes" : "no"),
3803
+ submit: ({ value }) => renderSubmit(config14, value ? "yes" : "no"),
3804
3804
  cancel: handleCancel
3805
3805
  };
3806
3806
  };
@@ -3897,7 +3897,7 @@ var init_args = __esm({
3897
3897
  var version, devDependencies;
3898
3898
  var init_package = __esm({
3899
3899
  "package.json"() {
3900
- version = "0.0.0-a7aa28ad";
3900
+ version = "0.0.0-a7e36d50";
3901
3901
  devDependencies = {
3902
3902
  "@babel/parser": "^7.21.3",
3903
3903
  "@babel/types": "^7.21.4",
@@ -3905,7 +3905,7 @@ var init_package = __esm({
3905
3905
  "@cloudflare/cli": "workspace:*",
3906
3906
  "@cloudflare/eslint-config-worker": "*",
3907
3907
  "@cloudflare/workers-tsconfig": "workspace:*",
3908
- "@cloudflare/workers-types": "^4.20240404.0",
3908
+ "@cloudflare/workers-types": "^4.20240419.0",
3909
3909
  "@iarna/toml": "^3.0.0",
3910
3910
  "@types/command-exists": "^1.2.0",
3911
3911
  "@types/cross-spawn": "^6.0.2",
@@ -7065,7 +7065,7 @@ var init_packageManagers = __esm({
7065
7065
  }
7066
7066
  };
7067
7067
  rectifyPmMismatch = async (ctx) => {
7068
- const { npm: npm13 } = detectPackageManager();
7068
+ const { npm: npm14 } = detectPackageManager();
7069
7069
  if (!detectPmMismatch(ctx)) {
7070
7070
  return;
7071
7071
  }
@@ -7075,17 +7075,17 @@ var init_packageManagers = __esm({
7075
7075
  const lockfilePath = import_path5.default.join(ctx.project.path, "package-lock.json");
7076
7076
  if ((0, import_fs5.existsSync)(lockfilePath))
7077
7077
  (0, import_fs5.rmSync)(lockfilePath);
7078
- await runCommand([npm13, "install"], {
7078
+ await runCommand([npm14, "install"], {
7079
7079
  silent: true,
7080
7080
  cwd: ctx.project.path,
7081
7081
  startText: "Installing dependencies",
7082
- doneText: `${brandColor("installed")} ${dim(`via \`${npm13} install\``)}`
7082
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
7083
7083
  });
7084
7084
  };
7085
7085
  detectPmMismatch = (ctx) => {
7086
- const { npm: npm13 } = detectPackageManager();
7086
+ const { npm: npm14 } = detectPackageManager();
7087
7087
  const projectPath = ctx.project.path;
7088
- switch (npm13) {
7088
+ switch (npm14) {
7089
7089
  case "npm":
7090
7090
  return false;
7091
7091
  case "yarn":
@@ -7509,22 +7509,22 @@ var require_dist_web = __commonJS({
7509
7509
  _createClass(Haikunator3, [{
7510
7510
  key: "haikunate",
7511
7511
  value: function haikunate(options) {
7512
- var config13 = (0, _lodash["default"])(options, this.config);
7513
- if (config13.tokenHex === true) {
7514
- config13.tokenChars = "0123456789abcdef";
7512
+ var config14 = (0, _lodash["default"])(options, this.config);
7513
+ if (config14.tokenHex === true) {
7514
+ config14.tokenChars = "0123456789abcdef";
7515
7515
  }
7516
7516
  var adjective = this._randomElement(this.adjectives);
7517
7517
  var noun = this._randomElement(this.nouns);
7518
- if (!config13.tokenLength)
7519
- config13.tokenLength = 0;
7518
+ if (!config14.tokenLength)
7519
+ config14.tokenLength = 0;
7520
7520
  var token = "";
7521
- for (var i = 0; i < config13.tokenLength; i++) {
7522
- token += this._randomElement(config13.tokenChars);
7521
+ for (var i = 0; i < config14.tokenLength; i++) {
7522
+ token += this._randomElement(config14.tokenChars);
7523
7523
  }
7524
7524
  var sections = [adjective, noun, token];
7525
7525
  return sections.filter(function(e) {
7526
7526
  return !!e;
7527
- }).join(config13.delimiter);
7527
+ }).join(config14.delimiter);
7528
7528
  }
7529
7529
  /**
7530
7530
  * Get a random element from an array/string
@@ -11101,7 +11101,7 @@ var require_symbols2 = __commonJS({
11101
11101
  var require_webidl = __commonJS({
11102
11102
  "../../node_modules/.pnpm/undici@5.28.3/node_modules/undici/lib/fetch/webidl.js"(exports2, module2) {
11103
11103
  "use strict";
11104
- var { types: types6 } = require("util");
11104
+ var { types: types7 } = require("util");
11105
11105
  var { hasOwn, toUSVString } = require_util2();
11106
11106
  var webidl = {};
11107
11107
  webidl.converters = {};
@@ -11266,7 +11266,7 @@ var require_webidl = __commonJS({
11266
11266
  });
11267
11267
  }
11268
11268
  const result = {};
11269
- if (!types6.isProxy(O2)) {
11269
+ if (!types7.isProxy(O2)) {
11270
11270
  const keys2 = Object.keys(O2);
11271
11271
  for (const key of keys2) {
11272
11272
  const typedKey = keyConverter(key);
@@ -11392,14 +11392,14 @@ var require_webidl = __commonJS({
11392
11392
  return x2;
11393
11393
  };
11394
11394
  webidl.converters.ArrayBuffer = function(V2, opts = {}) {
11395
- if (webidl.util.Type(V2) !== "Object" || !types6.isAnyArrayBuffer(V2)) {
11395
+ if (webidl.util.Type(V2) !== "Object" || !types7.isAnyArrayBuffer(V2)) {
11396
11396
  throw webidl.errors.conversionFailed({
11397
11397
  prefix: `${V2}`,
11398
11398
  argument: `${V2}`,
11399
11399
  types: ["ArrayBuffer"]
11400
11400
  });
11401
11401
  }
11402
- if (opts.allowShared === false && types6.isSharedArrayBuffer(V2)) {
11402
+ if (opts.allowShared === false && types7.isSharedArrayBuffer(V2)) {
11403
11403
  throw webidl.errors.exception({
11404
11404
  header: "ArrayBuffer",
11405
11405
  message: "SharedArrayBuffer is not allowed."
@@ -11408,14 +11408,14 @@ var require_webidl = __commonJS({
11408
11408
  return V2;
11409
11409
  };
11410
11410
  webidl.converters.TypedArray = function(V2, T2, opts = {}) {
11411
- if (webidl.util.Type(V2) !== "Object" || !types6.isTypedArray(V2) || V2.constructor.name !== T2.name) {
11411
+ if (webidl.util.Type(V2) !== "Object" || !types7.isTypedArray(V2) || V2.constructor.name !== T2.name) {
11412
11412
  throw webidl.errors.conversionFailed({
11413
11413
  prefix: `${T2.name}`,
11414
11414
  argument: `${V2}`,
11415
11415
  types: [T2.name]
11416
11416
  });
11417
11417
  }
11418
- if (opts.allowShared === false && types6.isSharedArrayBuffer(V2.buffer)) {
11418
+ if (opts.allowShared === false && types7.isSharedArrayBuffer(V2.buffer)) {
11419
11419
  throw webidl.errors.exception({
11420
11420
  header: "ArrayBuffer",
11421
11421
  message: "SharedArrayBuffer is not allowed."
@@ -11424,13 +11424,13 @@ var require_webidl = __commonJS({
11424
11424
  return V2;
11425
11425
  };
11426
11426
  webidl.converters.DataView = function(V2, opts = {}) {
11427
- if (webidl.util.Type(V2) !== "Object" || !types6.isDataView(V2)) {
11427
+ if (webidl.util.Type(V2) !== "Object" || !types7.isDataView(V2)) {
11428
11428
  throw webidl.errors.exception({
11429
11429
  header: "DataView",
11430
11430
  message: "Object is not a DataView."
11431
11431
  });
11432
11432
  }
11433
- if (opts.allowShared === false && types6.isSharedArrayBuffer(V2.buffer)) {
11433
+ if (opts.allowShared === false && types7.isSharedArrayBuffer(V2.buffer)) {
11434
11434
  throw webidl.errors.exception({
11435
11435
  header: "ArrayBuffer",
11436
11436
  message: "SharedArrayBuffer is not allowed."
@@ -11439,13 +11439,13 @@ var require_webidl = __commonJS({
11439
11439
  return V2;
11440
11440
  };
11441
11441
  webidl.converters.BufferSource = function(V2, opts = {}) {
11442
- if (types6.isAnyArrayBuffer(V2)) {
11442
+ if (types7.isAnyArrayBuffer(V2)) {
11443
11443
  return webidl.converters.ArrayBuffer(V2, opts);
11444
11444
  }
11445
- if (types6.isTypedArray(V2)) {
11445
+ if (types7.isTypedArray(V2)) {
11446
11446
  return webidl.converters.TypedArray(V2, V2.constructor);
11447
11447
  }
11448
- if (types6.isDataView(V2)) {
11448
+ if (types7.isDataView(V2)) {
11449
11449
  return webidl.converters.DataView(V2, opts);
11450
11450
  }
11451
11451
  throw new TypeError(`Could not convert ${V2} to a BufferSource.`);
@@ -11760,7 +11760,7 @@ var require_file = __commonJS({
11760
11760
  "../../node_modules/.pnpm/undici@5.28.3/node_modules/undici/lib/fetch/file.js"(exports2, module2) {
11761
11761
  "use strict";
11762
11762
  var { Blob: Blob2, File: NativeFile } = require("buffer");
11763
- var { types: types6 } = require("util");
11763
+ var { types: types7 } = require("util");
11764
11764
  var { kState } = require_symbols2();
11765
11765
  var { isBlobLike } = require_util2();
11766
11766
  var { webidl } = require_webidl();
@@ -11869,7 +11869,7 @@ var require_file = __commonJS({
11869
11869
  if (isBlobLike(V2)) {
11870
11870
  return webidl.converters.Blob(V2, { strict: false });
11871
11871
  }
11872
- if (ArrayBuffer.isView(V2) || types6.isAnyArrayBuffer(V2)) {
11872
+ if (ArrayBuffer.isView(V2) || types7.isAnyArrayBuffer(V2)) {
11873
11873
  return webidl.converters.BufferSource(V2, opts);
11874
11874
  }
11875
11875
  }
@@ -11913,7 +11913,7 @@ var require_file = __commonJS({
11913
11913
  s = convertLineEndingsNative(s);
11914
11914
  }
11915
11915
  bytes.push(encoder.encode(s));
11916
- } else if (types6.isAnyArrayBuffer(element) || types6.isTypedArray(element)) {
11916
+ } else if (types7.isAnyArrayBuffer(element) || types7.isTypedArray(element)) {
11917
11917
  if (!element.buffer) {
11918
11918
  bytes.push(new Uint8Array(element));
11919
11919
  } else {
@@ -18802,7 +18802,7 @@ var require_response = __commonJS({
18802
18802
  var { URLSerializer } = require_dataURL();
18803
18803
  var { kHeadersList, kConstruct } = require_symbols();
18804
18804
  var assert = require("assert");
18805
- var { types: types6 } = require("util");
18805
+ var { types: types7 } = require("util");
18806
18806
  var ReadableStream = globalThis.ReadableStream || require("stream/web").ReadableStream;
18807
18807
  var textEncoder = new TextEncoder("utf-8");
18808
18808
  var Response = class {
@@ -19105,7 +19105,7 @@ var require_response = __commonJS({
19105
19105
  if (isBlobLike(V2)) {
19106
19106
  return webidl.converters.Blob(V2, { strict: false });
19107
19107
  }
19108
- if (types6.isArrayBuffer(V2) || types6.isTypedArray(V2) || types6.isDataView(V2)) {
19108
+ if (types7.isArrayBuffer(V2) || types7.isTypedArray(V2) || types7.isDataView(V2)) {
19109
19109
  return webidl.converters.BufferSource(V2);
19110
19110
  }
19111
19111
  if (util.isFormDataLike(V2)) {
@@ -21211,7 +21211,7 @@ var require_util4 = __commonJS({
21211
21211
  var { getEncoding } = require_encoding();
21212
21212
  var { DOMException: DOMException2 } = require_constants2();
21213
21213
  var { serializeAMimeType, parseMIMEType } = require_dataURL();
21214
- var { types: types6 } = require("util");
21214
+ var { types: types7 } = require("util");
21215
21215
  var { StringDecoder } = require("string_decoder");
21216
21216
  var { btoa: btoa2 } = require("buffer");
21217
21217
  var staticPropertyDescriptors = {
@@ -21241,7 +21241,7 @@ var require_util4 = __commonJS({
21241
21241
  });
21242
21242
  }
21243
21243
  isFirstChunk = false;
21244
- if (!done && types6.isUint8Array(value)) {
21244
+ if (!done && types7.isUint8Array(value)) {
21245
21245
  bytes.push(value);
21246
21246
  if ((fr[kLastProgressEventFired] === void 0 || Date.now() - fr[kLastProgressEventFired] >= 50) && !fr[kAborted]) {
21247
21247
  fr[kLastProgressEventFired] = Date.now();
@@ -23623,7 +23623,7 @@ var require_websocket = __commonJS({
23623
23623
  var { ByteParser } = require_receiver();
23624
23624
  var { kEnumerableProperty, isBlobLike } = require_util();
23625
23625
  var { getGlobalDispatcher } = require_global2();
23626
- var { types: types6 } = require("util");
23626
+ var { types: types7 } = require("util");
23627
23627
  var experimentalWarned = false;
23628
23628
  var WebSocket = class extends EventTarget {
23629
23629
  #events = {
@@ -23770,7 +23770,7 @@ var require_websocket = __commonJS({
23770
23770
  socket.write(buffer, () => {
23771
23771
  this.#bufferedAmount -= value.byteLength;
23772
23772
  });
23773
- } else if (types6.isArrayBuffer(data)) {
23773
+ } else if (types7.isArrayBuffer(data)) {
23774
23774
  const value = Buffer.from(data);
23775
23775
  const frame = new WebsocketFrameSend(value);
23776
23776
  const buffer = frame.createFrame(opcodes.BINARY);
@@ -23992,7 +23992,7 @@ var require_websocket = __commonJS({
23992
23992
  if (isBlobLike(V2)) {
23993
23993
  return webidl.converters.Blob(V2, { strict: false });
23994
23994
  }
23995
- if (ArrayBuffer.isView(V2) || types6.isAnyArrayBuffer(V2)) {
23995
+ if (ArrayBuffer.isView(V2) || types7.isAnyArrayBuffer(V2)) {
23996
23996
  return webidl.converters.BufferSource(V2);
23997
23997
  }
23998
23998
  }
@@ -24158,28 +24158,28 @@ var init_packages = __esm({
24158
24158
  import_undici = __toESM(require_undici());
24159
24159
  init_command();
24160
24160
  init_packageManagers();
24161
- installPackages = async (packages, config13 = {}) => {
24162
- const { npm: npm13 } = detectPackageManager();
24161
+ installPackages = async (packages, config14 = {}) => {
24162
+ const { npm: npm14 } = detectPackageManager();
24163
24163
  let saveFlag;
24164
24164
  let cmd;
24165
- switch (npm13) {
24165
+ switch (npm14) {
24166
24166
  case "yarn":
24167
24167
  cmd = "add";
24168
- saveFlag = config13.dev ? "-D" : "";
24168
+ saveFlag = config14.dev ? "-D" : "";
24169
24169
  break;
24170
24170
  case "bun":
24171
24171
  cmd = "add";
24172
- saveFlag = config13.dev ? "-d" : "";
24172
+ saveFlag = config14.dev ? "-d" : "";
24173
24173
  break;
24174
24174
  case "npm":
24175
24175
  case "pnpm":
24176
24176
  default:
24177
24177
  cmd = "install";
24178
- saveFlag = config13.dev ? "--save-dev" : "";
24178
+ saveFlag = config14.dev ? "--save-dev" : "";
24179
24179
  break;
24180
24180
  }
24181
- await runCommand([npm13, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
24182
- ...config13,
24181
+ await runCommand([npm14, cmd, ...saveFlag ? [saveFlag] : [], ...packages], {
24182
+ ...config14,
24183
24183
  silent: true
24184
24184
  });
24185
24185
  };
@@ -24188,15 +24188,15 @@ var init_packages = __esm({
24188
24188
  if ((0, import_fs6.existsSync)(nodeModulesPath)) {
24189
24189
  return;
24190
24190
  }
24191
- const { npm: npm13 } = detectPackageManager();
24192
- await runCommand([npm13, "install"], {
24191
+ const { npm: npm14 } = detectPackageManager();
24192
+ await runCommand([npm14, "install"], {
24193
24193
  silent: true,
24194
24194
  startText: "Installing dependencies",
24195
- doneText: `${brandColor("installed")} ${dim(`via \`${npm13} install\``)}`
24195
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm14} install\``)}`
24196
24196
  });
24197
24197
  };
24198
24198
  installWrangler = async () => {
24199
- const { npm: npm13 } = detectPackageManager();
24199
+ const { npm: npm14 } = detectPackageManager();
24200
24200
  if ((0, import_fs6.existsSync)(import_path6.default.resolve("node_modules", "wrangler"))) {
24201
24201
  return;
24202
24202
  }
@@ -24206,7 +24206,7 @@ var init_packages = __esm({
24206
24206
  "A command line tool for building Cloudflare Workers"
24207
24207
  )}`,
24208
24208
  doneText: `${brandColor("installed")} ${dim(
24209
- `via \`${npm13} install wrangler --save-dev\``
24209
+ `via \`${npm14} install wrangler --save-dev\``
24210
24210
  )}`
24211
24211
  });
24212
24212
  };
@@ -24575,7 +24575,7 @@ var init_cli2 = __esm({
24575
24575
  C3_DEFAULTS = {
24576
24576
  projectName: new import_haikunator.default().haikunate({ tokenHex: true }),
24577
24577
  type: "hello-world",
24578
- framework: "angular",
24578
+ framework: "analog",
24579
24579
  autoUpdate: true,
24580
24580
  deploy: true,
24581
24581
  git: true,
@@ -24603,21 +24603,23 @@ var init_package2 = __esm({
24603
24603
  "additionally it also contains a map that maps frameworks to their respective clis"
24604
24604
  ],
24605
24605
  dependencies: {
24606
- "create-astro": "4.7.4",
24606
+ "create-astro": "4.7.5",
24607
+ "create-analog": "1.2.0",
24607
24608
  "@angular/create": "17.2.3",
24608
24609
  "create-docusaurus": "3.1.1",
24609
- "create-hono": "0.5.0",
24610
+ "create-hono": "0.7.0",
24610
24611
  "create-next-app": "14.1.0",
24611
24612
  "create-qwik": "1.4.5",
24612
24613
  "create-react-app": "5.0.1",
24613
24614
  "create-remix": "2.8.1",
24614
24615
  "create-solid": "0.5.5",
24615
24616
  "create-svelte": "6.0.10",
24616
- "create-vue": "3.9.2",
24617
+ "create-vue": "3.10.2",
24617
24618
  gatsby: "5.13.3",
24618
24619
  nuxi: "3.11.1"
24619
24620
  },
24620
24621
  frameworkCliMap: {
24622
+ analog: "create-analog",
24621
24623
  angular: "@angular/create",
24622
24624
  astro: "create-astro",
24623
24625
  docusaurus: "create-docusaurus",
@@ -24656,9 +24658,9 @@ var init_frameworks = __esm({
24656
24658
  };
24657
24659
  runFrameworkGenerator = async (ctx, args) => {
24658
24660
  const cli = getFrameworkCli(ctx, true);
24659
- const { npm: npm13, dlx } = detectPackageManager();
24660
- const cmd = [...npm13 === "yarn" ? ["npx"] : dlx, cli, ...args];
24661
- const env2 = npm13 === "yarn" ? { npm_config_user_agent: "yarn" } : {};
24661
+ const { npm: npm14, dlx } = detectPackageManager();
24662
+ const cmd = [...npm14 === "yarn" ? ["npx"] : dlx, cli, ...args];
24663
+ const env2 = npm14 === "yarn" ? { npm_config_user_agent: "yarn" } : {};
24662
24664
  if (ctx.args.additionalArgs?.length) {
24663
24665
  cmd.push(...ctx.args.additionalArgs);
24664
24666
  }
@@ -24686,7 +24688,12 @@ var init_accounts = __esm({
24686
24688
  s.start(`Selecting Cloudflare account ${dim("retrieving accounts")}`);
24687
24689
  const accounts = await listAccounts();
24688
24690
  let accountId;
24689
- if (Object.keys(accounts).length == 1) {
24691
+ const numAccounts = Object.keys(accounts).length;
24692
+ if (numAccounts === 0) {
24693
+ throw new Error(
24694
+ "Unable to find any accounts to deploy to! Please ensure you're logged in as a user that can deploy Workers."
24695
+ );
24696
+ } else if (numAccounts === 1) {
24690
24697
  const accountName2 = Object.keys(accounts)[0];
24691
24698
  accountId = accounts[accountName2];
24692
24699
  s.stop(`${brandColor("account")} ${dim(accountName2)}`);
@@ -29700,7 +29707,7 @@ var require_index_688c5d50 = __commonJS({
29700
29707
  }
29701
29708
  }
29702
29709
  };
29703
- var types6 = createCommonjsModule(function(module3, exports3) {
29710
+ var types7 = createCommonjsModule(function(module3, exports3) {
29704
29711
  exports3.name = /* @__PURE__ */ new Map([
29705
29712
  ["0", "File"],
29706
29713
  // same as File
@@ -29954,14 +29961,14 @@ var require_index_688c5d50 = __commonJS({
29954
29961
  }
29955
29962
  }
29956
29963
  get type() {
29957
- return types6.name.get(this[TYPE]) || this[TYPE];
29964
+ return types7.name.get(this[TYPE]) || this[TYPE];
29958
29965
  }
29959
29966
  get typeKey() {
29960
29967
  return this[TYPE];
29961
29968
  }
29962
29969
  set type(type) {
29963
- if (types6.code.has(type))
29964
- this[TYPE] = types6.code.get(type);
29970
+ if (types7.code.has(type))
29971
+ this[TYPE] = types7.code.get(type);
29965
29972
  else
29966
29973
  this[TYPE] = type;
29967
29974
  }
@@ -33073,7 +33080,7 @@ var require_index_688c5d50 = __commonJS({
33073
33080
  exports3.WriteEntry = writeEntry;
33074
33081
  exports3.Header = header;
33075
33082
  exports3.Pax = pax;
33076
- exports3.types = types6;
33083
+ exports3.types = types7;
33077
33084
  });
33078
33085
  var colorName = {
33079
33086
  "aliceblue": [240, 248, 255],
@@ -39416,97 +39423,6 @@ var init_validators = __esm({
39416
39423
  }
39417
39424
  });
39418
39425
 
39419
- // templates/angular/c3.ts
39420
- var c3_exports = {};
39421
- __export(c3_exports, {
39422
- default: () => c3_default
39423
- });
39424
- async function installCFWorker() {
39425
- await installPackages(
39426
- ["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
39427
- {
39428
- dev: true,
39429
- startText: "Installing adapter dependencies",
39430
- doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
39431
- }
39432
- );
39433
- }
39434
- async function updateAppCode() {
39435
- const s = spinner();
39436
- s.start(`Updating application code`);
39437
- const appConfigPath = "src/app/app.config.ts";
39438
- const appConfig = readFile((0, import_node_path.resolve)(appConfigPath));
39439
- const newAppConfig = "import { provideHttpClient, withFetch } from '@angular/common/http';\n" + appConfig.replace(
39440
- "providers: [",
39441
- "providers: [provideHttpClient(withFetch()), "
39442
- );
39443
- writeFile2((0, import_node_path.resolve)(appConfigPath), newAppConfig);
39444
- s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
39445
- s.start(`Updating package.json`);
39446
- const packageJsonPath = (0, import_node_path.resolve)("package.json");
39447
- const packageManifest = readJSON(packageJsonPath);
39448
- delete packageManifest["dependencies"]["@angular/ssr"];
39449
- delete packageManifest["dependencies"]["express"];
39450
- writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
39451
- s.stop(`${brandColor(`updated`)} ${dim(`\`package.json\``)}`);
39452
- }
39453
- function updateAngularJson(ctx) {
39454
- const s = spinner();
39455
- s.start(`Updating angular.json config`);
39456
- const angularJson = readJSON((0, import_node_path.resolve)("angular.json"));
39457
- const architectSection = angularJson.projects[ctx.project.name].architect;
39458
- architectSection.build.options.outputPath = "dist";
39459
- architectSection.build.options.assets.push("src/_routes.json");
39460
- writeFile2((0, import_node_path.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
39461
- s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
39462
- }
39463
- var import_node_path, npm, generate, configure, config, c3_default;
39464
- var init_c3 = __esm({
39465
- "templates/angular/c3.ts"() {
39466
- import_node_path = require("node:path");
39467
- init_cli();
39468
- init_colors();
39469
- init_interactive();
39470
- init_frameworks();
39471
- init_compatDate();
39472
- init_files();
39473
- init_packageManagers();
39474
- init_packages();
39475
- ({ npm } = detectPackageManager());
39476
- generate = async (ctx) => {
39477
- await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
39478
- logRaw("");
39479
- };
39480
- configure = async (ctx) => {
39481
- updateAngularJson(ctx);
39482
- await updateAppCode();
39483
- await installCFWorker();
39484
- };
39485
- config = {
39486
- configVersion: 1,
39487
- id: "angular",
39488
- displayName: "Angular",
39489
- platform: "pages",
39490
- copyFiles: {
39491
- path: "./templates"
39492
- },
39493
- devScript: "start",
39494
- deployScript: "deploy",
39495
- generate,
39496
- configure,
39497
- transformPackageJson: async () => ({
39498
- scripts: {
39499
- start: `${npm} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
39500
- build: `ng build && ${npm} run process`,
39501
- process: "node ./tools/copy-files.mjs && node ./tools/alter-polyfills.mjs",
39502
- deploy: `${npm} run build && wrangler pages deploy dist/cloudflare`
39503
- }
39504
- })
39505
- };
39506
- c3_default = config;
39507
- }
39508
- });
39509
-
39510
39426
  // ../../node_modules/.pnpm/tslib@2.5.3/node_modules/tslib/tslib.es6.mjs
39511
39427
  var tslib_es6_exports = {};
39512
39428
  __export(tslib_es6_exports, {
@@ -40097,9 +40013,9 @@ var require_types = __commonJS({
40097
40013
  /** @class */
40098
40014
  function(_super) {
40099
40015
  (0, tslib_1.__extends)(OrType2, _super);
40100
- function OrType2(types6) {
40016
+ function OrType2(types7) {
40101
40017
  var _this = _super.call(this) || this;
40102
- _this.types = types6;
40018
+ _this.types = types7;
40103
40019
  _this.kind = "OrType";
40104
40020
  return _this;
40105
40021
  }
@@ -40244,11 +40160,11 @@ var require_types = __commonJS({
40244
40160
  function typesPlugin(_fork) {
40245
40161
  var Type = {
40246
40162
  or: function() {
40247
- var types6 = [];
40163
+ var types7 = [];
40248
40164
  for (var _i = 0; _i < arguments.length; _i++) {
40249
- types6[_i] = arguments[_i];
40165
+ types7[_i] = arguments[_i];
40250
40166
  }
40251
- return new OrType(types6.map(function(type) {
40167
+ return new OrType(types7.map(function(type) {
40252
40168
  return Type.from(type);
40253
40169
  }));
40254
40170
  },
@@ -40697,9 +40613,9 @@ var require_path = __commonJS({
40697
40613
  var Op = Object.prototype;
40698
40614
  var hasOwn = Op.hasOwnProperty;
40699
40615
  function pathPlugin(fork) {
40700
- var types6 = fork.use(types_1.default);
40701
- var isArray = types6.builtInTypes.array;
40702
- var isNumber = types6.builtInTypes.number;
40616
+ var types7 = fork.use(types_1.default);
40617
+ var isArray = types7.builtInTypes.array;
40618
+ var isNumber = types7.builtInTypes.number;
40703
40619
  var Path = function Path2(value, parentPath, name) {
40704
40620
  if (!(this instanceof Path2)) {
40705
40621
  throw new Error("Path constructor cannot be invoked without 'new'");
@@ -40999,13 +40915,13 @@ var require_scope = __commonJS({
40999
40915
  var types_1 = (0, tslib_1.__importDefault)(require_types());
41000
40916
  var hasOwn = Object.prototype.hasOwnProperty;
41001
40917
  function scopePlugin(fork) {
41002
- var types6 = fork.use(types_1.default);
41003
- var Type = types6.Type;
41004
- var namedTypes = types6.namedTypes;
40918
+ var types7 = fork.use(types_1.default);
40919
+ var Type = types7.Type;
40920
+ var namedTypes = types7.namedTypes;
41005
40921
  var Node = namedTypes.Node;
41006
40922
  var Expression = namedTypes.Expression;
41007
- var isArray = types6.builtInTypes.array;
41008
- var b2 = types6.builders;
40923
+ var isArray = types7.builtInTypes.array;
40924
+ var b2 = types7.builders;
41009
40925
  var Scope = function Scope2(path4, parentScope) {
41010
40926
  if (!(this instanceof Scope2)) {
41011
40927
  throw new Error("Scope constructor cannot be invoked without 'new'");
@@ -41073,7 +40989,7 @@ var require_scope = __commonJS({
41073
40989
  ++index;
41074
40990
  }
41075
40991
  var name = prefix + index;
41076
- return this.bindings[name] = types6.builders.identifier(name);
40992
+ return this.bindings[name] = types7.builders.identifier(name);
41077
40993
  };
41078
40994
  Sp.injectTemporary = function(identifier, init) {
41079
40995
  identifier || (identifier = this.declareTemporary());
@@ -41153,7 +41069,7 @@ var require_scope = __commonJS({
41153
41069
  bindings
41154
41070
  );
41155
41071
  } else if (Node.check(node) && !Expression.check(node)) {
41156
- types6.eachField(node, function(name, child) {
41072
+ types7.eachField(node, function(name, child) {
41157
41073
  var childPath = path4.get(name);
41158
41074
  if (!pathHasValue(childPath, child)) {
41159
41075
  throw new Error("");
@@ -41232,24 +41148,24 @@ var require_scope = __commonJS({
41232
41148
  addPattern(patternPath.get("argument"), bindings);
41233
41149
  }
41234
41150
  }
41235
- function addTypePattern(patternPath, types7) {
41151
+ function addTypePattern(patternPath, types8) {
41236
41152
  var pattern = patternPath.value;
41237
41153
  namedTypes.Pattern.assert(pattern);
41238
41154
  if (namedTypes.Identifier.check(pattern)) {
41239
- if (hasOwn.call(types7, pattern.name)) {
41240
- types7[pattern.name].push(patternPath);
41155
+ if (hasOwn.call(types8, pattern.name)) {
41156
+ types8[pattern.name].push(patternPath);
41241
41157
  } else {
41242
- types7[pattern.name] = [patternPath];
41158
+ types8[pattern.name] = [patternPath];
41243
41159
  }
41244
41160
  }
41245
41161
  }
41246
- function addTypeParameter(parameterPath, types7) {
41162
+ function addTypeParameter(parameterPath, types8) {
41247
41163
  var parameter = parameterPath.value;
41248
41164
  FlowOrTSTypeParameterType.assert(parameter);
41249
- if (hasOwn.call(types7, parameter.name)) {
41250
- types7[parameter.name].push(parameterPath);
41165
+ if (hasOwn.call(types8, parameter.name)) {
41166
+ types8[parameter.name].push(parameterPath);
41251
41167
  } else {
41252
- types7[parameter.name] = [parameterPath];
41168
+ types8[parameter.name] = [parameterPath];
41253
41169
  }
41254
41170
  }
41255
41171
  Sp.lookup = function(name) {
@@ -41287,11 +41203,11 @@ var require_node_path = __commonJS({
41287
41203
  var path_1 = (0, tslib_1.__importDefault)(require_path());
41288
41204
  var scope_1 = (0, tslib_1.__importDefault)(require_scope());
41289
41205
  function nodePathPlugin(fork) {
41290
- var types6 = fork.use(types_1.default);
41291
- var n2 = types6.namedTypes;
41292
- var b2 = types6.builders;
41293
- var isNumber = types6.builtInTypes.number;
41294
- var isArray = types6.builtInTypes.array;
41206
+ var types7 = fork.use(types_1.default);
41207
+ var n2 = types7.namedTypes;
41208
+ var b2 = types7.builders;
41209
+ var isNumber = types7.builtInTypes.number;
41210
+ var isArray = types7.builtInTypes.array;
41295
41211
  var Path = fork.use(path_1.default);
41296
41212
  var Scope = fork.use(scope_1.default);
41297
41213
  var NodePath = function NodePath2(value, parentPath, name) {
@@ -41382,7 +41298,7 @@ var require_node_path = __commonJS({
41382
41298
  return scope || null;
41383
41299
  };
41384
41300
  NPp.getValueProperty = function(name) {
41385
- return types6.getFieldValue(this.value, name);
41301
+ return types7.getFieldValue(this.value, name);
41386
41302
  };
41387
41303
  NPp.needsParens = function(assumeExpressionContext) {
41388
41304
  var pp = this.parentPath;
@@ -41524,7 +41440,7 @@ var require_node_path = __commonJS({
41524
41440
  return node.some(containsCallExpression);
41525
41441
  }
41526
41442
  if (n2.Node.check(node)) {
41527
- return types6.someField(node, function(_name, child) {
41443
+ return types7.someField(node, function(_name, child) {
41528
41444
  return containsCallExpression(child);
41529
41445
  });
41530
41446
  }
@@ -41642,11 +41558,11 @@ var require_path_visitor = __commonJS({
41642
41558
  var node_path_1 = (0, tslib_1.__importDefault)(require_node_path());
41643
41559
  var hasOwn = Object.prototype.hasOwnProperty;
41644
41560
  function pathVisitorPlugin(fork) {
41645
- var types6 = fork.use(types_1.default);
41561
+ var types7 = fork.use(types_1.default);
41646
41562
  var NodePath = fork.use(node_path_1.default);
41647
- var isArray = types6.builtInTypes.array;
41648
- var isObject2 = types6.builtInTypes.object;
41649
- var isFunction2 = types6.builtInTypes.function;
41563
+ var isArray = types7.builtInTypes.array;
41564
+ var isObject2 = types7.builtInTypes.object;
41565
+ var isFunction2 = types7.builtInTypes.function;
41650
41566
  var undefined2;
41651
41567
  var PathVisitor = function PathVisitor2() {
41652
41568
  if (!(this instanceof PathVisitor2)) {
@@ -41666,7 +41582,7 @@ var require_path_visitor = __commonJS({
41666
41582
  typeNames[methodName.slice("visit".length)] = true;
41667
41583
  }
41668
41584
  }
41669
- var supertypeTable = types6.computeSupertypeLookupTable(typeNames);
41585
+ var supertypeTable = types7.computeSupertypeLookupTable(typeNames);
41670
41586
  var methodNameTable = /* @__PURE__ */ Object.create(null);
41671
41587
  var typeNameKeys = Object.keys(supertypeTable);
41672
41588
  var typeNameCount = typeNameKeys.length;
@@ -41785,7 +41701,7 @@ var require_path_visitor = __commonJS({
41785
41701
  path4.each(visitor.visitWithoutReset, visitor);
41786
41702
  } else if (!isObject2.check(value)) {
41787
41703
  } else {
41788
- var childNames = types6.getFieldNames(value);
41704
+ var childNames = types7.getFieldNames(value);
41789
41705
  if (visitor._shouldVisitComments && value.comments && childNames.indexOf("comments") < 0) {
41790
41706
  childNames.push("comments");
41791
41707
  }
@@ -41794,7 +41710,7 @@ var require_path_visitor = __commonJS({
41794
41710
  for (var i = 0; i < childCount; ++i) {
41795
41711
  var childName = childNames[i];
41796
41712
  if (!hasOwn.call(value, childName)) {
41797
- value[childName] = types6.getFieldValue(value, childName);
41713
+ value[childName] = types7.getFieldValue(value, childName);
41798
41714
  }
41799
41715
  childPaths.push(path4.get(childName));
41800
41716
  }
@@ -41934,13 +41850,13 @@ var require_equiv = __commonJS({
41934
41850
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
41935
41851
  var types_1 = (0, tslib_1.__importDefault)(require_types());
41936
41852
  function default_1(fork) {
41937
- var types6 = fork.use(types_1.default);
41938
- var getFieldNames = types6.getFieldNames;
41939
- var getFieldValue = types6.getFieldValue;
41940
- var isArray = types6.builtInTypes.array;
41941
- var isObject2 = types6.builtInTypes.object;
41942
- var isDate = types6.builtInTypes.Date;
41943
- var isRegExp = types6.builtInTypes.RegExp;
41853
+ var types7 = fork.use(types_1.default);
41854
+ var getFieldNames = types7.getFieldNames;
41855
+ var getFieldValue = types7.getFieldValue;
41856
+ var isArray = types7.builtInTypes.array;
41857
+ var isObject2 = types7.builtInTypes.object;
41858
+ var isDate = types7.builtInTypes.Date;
41859
+ var isRegExp = types7.builtInTypes.RegExp;
41944
41860
  var hasOwn = Object.prototype.hasOwnProperty;
41945
41861
  function astNodesAreEquivalent(a, b2, problemPath) {
41946
41862
  if (isArray.check(problemPath)) {
@@ -42090,24 +42006,24 @@ var require_fork = __commonJS({
42090
42006
  var node_path_1 = (0, tslib_1.__importDefault)(require_node_path());
42091
42007
  function default_1(plugins) {
42092
42008
  var fork = createFork();
42093
- var types6 = fork.use(types_1.default);
42009
+ var types7 = fork.use(types_1.default);
42094
42010
  plugins.forEach(fork.use);
42095
- types6.finalize();
42011
+ types7.finalize();
42096
42012
  var PathVisitor = fork.use(path_visitor_1.default);
42097
42013
  return {
42098
- Type: types6.Type,
42099
- builtInTypes: types6.builtInTypes,
42100
- namedTypes: types6.namedTypes,
42101
- builders: types6.builders,
42102
- defineMethod: types6.defineMethod,
42103
- getFieldNames: types6.getFieldNames,
42104
- getFieldValue: types6.getFieldValue,
42105
- eachField: types6.eachField,
42106
- someField: types6.someField,
42107
- getSupertypeNames: types6.getSupertypeNames,
42108
- getBuilderName: types6.getBuilderName,
42014
+ Type: types7.Type,
42015
+ builtInTypes: types7.builtInTypes,
42016
+ namedTypes: types7.namedTypes,
42017
+ builders: types7.builders,
42018
+ defineMethod: types7.defineMethod,
42019
+ getFieldNames: types7.getFieldNames,
42020
+ getFieldValue: types7.getFieldValue,
42021
+ eachField: types7.eachField,
42022
+ someField: types7.someField,
42023
+ getSupertypeNames: types7.getSupertypeNames,
42024
+ getBuilderName: types7.getBuilderName,
42109
42025
  astNodesAreEquivalent: fork.use(equiv_1.default),
42110
- finalize: types6.finalize,
42026
+ finalize: types7.finalize,
42111
42027
  Path: fork.use(path_1.default),
42112
42028
  NodePath: fork.use(node_path_1.default),
42113
42029
  PathVisitor,
@@ -42143,9 +42059,9 @@ var require_shared = __commonJS({
42143
42059
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
42144
42060
  var types_1 = (0, tslib_1.__importDefault)(require_types());
42145
42061
  function default_1(fork) {
42146
- var types6 = fork.use(types_1.default);
42147
- var Type = types6.Type;
42148
- var builtin = types6.builtInTypes;
42062
+ var types7 = fork.use(types_1.default);
42063
+ var Type = types7.Type;
42064
+ var builtin = types7.builtInTypes;
42149
42065
  var isNumber = builtin.number;
42150
42066
  function geq(than) {
42151
42067
  return Type.from(function(value) {
@@ -42324,8 +42240,8 @@ var require_core2 = __commonJS({
42324
42240
  var types_1 = (0, tslib_1.__importDefault)(require_types());
42325
42241
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42326
42242
  function default_1(fork) {
42327
- var types6 = fork.use(types_1.default);
42328
- var Type = types6.Type;
42243
+ var types7 = fork.use(types_1.default);
42244
+ var Type = types7.Type;
42329
42245
  var def = Type.def;
42330
42246
  var or = Type.or;
42331
42247
  var shared = fork.use(shared_1.default);
@@ -42415,9 +42331,9 @@ var require_es6 = __commonJS({
42415
42331
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42416
42332
  function default_1(fork) {
42417
42333
  fork.use(core_1.default);
42418
- var types6 = fork.use(types_1.default);
42419
- var def = types6.Type.def;
42420
- var or = types6.Type.or;
42334
+ var types7 = fork.use(types_1.default);
42335
+ var def = types7.Type.def;
42336
+ var or = types7.Type.or;
42421
42337
  var defaults = fork.use(shared_1.default).defaults;
42422
42338
  def("Function").field("generator", Boolean, defaults["false"]).field("expression", Boolean, defaults["false"]).field("defaults", [or(def("Expression"), null)], defaults.emptyArray).field("rest", or(def("Identifier"), null), defaults["null"]);
42423
42339
  def("RestElement").bases("Pattern").build("argument").field("argument", def("Pattern")).field(
@@ -42503,8 +42419,8 @@ var require_es2017 = __commonJS({
42503
42419
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42504
42420
  function default_1(fork) {
42505
42421
  fork.use(es2016_1.default);
42506
- var types6 = fork.use(types_1.default);
42507
- var def = types6.Type.def;
42422
+ var types7 = fork.use(types_1.default);
42423
+ var def = types7.Type.def;
42508
42424
  var defaults = fork.use(shared_1.default).defaults;
42509
42425
  def("Function").field("async", Boolean, defaults["false"]);
42510
42426
  def("AwaitExpression").bases("Expression").build("argument").field("argument", def("Expression"));
@@ -42525,9 +42441,9 @@ var require_es2018 = __commonJS({
42525
42441
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42526
42442
  function default_1(fork) {
42527
42443
  fork.use(es2017_1.default);
42528
- var types6 = fork.use(types_1.default);
42529
- var def = types6.Type.def;
42530
- var or = types6.Type.or;
42444
+ var types7 = fork.use(types_1.default);
42445
+ var def = types7.Type.def;
42446
+ var or = types7.Type.or;
42531
42447
  var defaults = fork.use(shared_1.default).defaults;
42532
42448
  def("ForOfStatement").field("await", Boolean, defaults["false"]);
42533
42449
  def("SpreadProperty").bases("Node").build("argument").field("argument", def("Expression"));
@@ -42557,9 +42473,9 @@ var require_es2019 = __commonJS({
42557
42473
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42558
42474
  function default_1(fork) {
42559
42475
  fork.use(es2018_1.default);
42560
- var types6 = fork.use(types_1.default);
42561
- var def = types6.Type.def;
42562
- var or = types6.Type.or;
42476
+ var types7 = fork.use(types_1.default);
42477
+ var def = types7.Type.def;
42478
+ var or = types7.Type.or;
42563
42479
  var defaults = fork.use(shared_1.default).defaults;
42564
42480
  def("CatchClause").field("param", or(def("Pattern"), null), defaults["null"]);
42565
42481
  }
@@ -42581,9 +42497,9 @@ var require_es20202 = __commonJS({
42581
42497
  function default_1(fork) {
42582
42498
  fork.use(es2020_1.default);
42583
42499
  fork.use(es2019_1.default);
42584
- var types6 = fork.use(types_1.default);
42585
- var def = types6.Type.def;
42586
- var or = types6.Type.or;
42500
+ var types7 = fork.use(types_1.default);
42501
+ var def = types7.Type.def;
42502
+ var or = types7.Type.or;
42587
42503
  var shared = fork.use(shared_1.default);
42588
42504
  var defaults = shared.defaults;
42589
42505
  def("ImportExpression").bases("Expression").build("source").field("source", def("Expression"));
@@ -42627,8 +42543,8 @@ var require_es2022 = __commonJS({
42627
42543
  var types_1 = (0, tslib_1.__importDefault)(require_types());
42628
42544
  function default_1(fork) {
42629
42545
  fork.use(es2021_1.default);
42630
- var types6 = fork.use(types_1.default);
42631
- var def = types6.Type.def;
42546
+ var types7 = fork.use(types_1.default);
42547
+ var def = types7.Type.def;
42632
42548
  def("StaticBlock").bases("Declaration").build("body").field("body", [def("Statement")]);
42633
42549
  }
42634
42550
  exports2.default = default_1;
@@ -42647,9 +42563,9 @@ var require_es_proposals = __commonJS({
42647
42563
  var es2022_1 = (0, tslib_1.__importDefault)(require_es2022());
42648
42564
  function default_1(fork) {
42649
42565
  fork.use(es2022_1.default);
42650
- var types6 = fork.use(types_1.default);
42651
- var Type = types6.Type;
42652
- var def = types6.Type.def;
42566
+ var types7 = fork.use(types_1.default);
42567
+ var Type = types7.Type;
42568
+ var def = types7.Type.def;
42653
42569
  var or = Type.or;
42654
42570
  var shared = fork.use(shared_1.default);
42655
42571
  var defaults = shared.defaults;
@@ -42687,9 +42603,9 @@ var require_jsx = __commonJS({
42687
42603
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42688
42604
  function default_1(fork) {
42689
42605
  fork.use(es_proposals_1.default);
42690
- var types6 = fork.use(types_1.default);
42691
- var def = types6.Type.def;
42692
- var or = types6.Type.or;
42606
+ var types7 = fork.use(types_1.default);
42607
+ var def = types7.Type.def;
42608
+ var or = types7.Type.or;
42693
42609
  var defaults = fork.use(shared_1.default).defaults;
42694
42610
  def("JSXAttribute").bases("Node").build("name", "value").field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))).field("value", or(
42695
42611
  def("Literal"),
@@ -42751,9 +42667,9 @@ var require_type_annotations = __commonJS({
42751
42667
  var types_1 = (0, tslib_1.__importDefault)(require_types());
42752
42668
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42753
42669
  function default_1(fork) {
42754
- var types6 = fork.use(types_1.default);
42755
- var def = types6.Type.def;
42756
- var or = types6.Type.or;
42670
+ var types7 = fork.use(types_1.default);
42671
+ var def = types7.Type.def;
42672
+ var or = types7.Type.or;
42757
42673
  var defaults = fork.use(shared_1.default).defaults;
42758
42674
  var TypeAnnotation = or(def("TypeAnnotation"), def("TSTypeAnnotation"), null);
42759
42675
  var TypeParamDecl = or(def("TypeParameterDeclaration"), def("TSTypeParameterDeclaration"), null);
@@ -42786,9 +42702,9 @@ var require_flow = __commonJS({
42786
42702
  function default_1(fork) {
42787
42703
  fork.use(es_proposals_1.default);
42788
42704
  fork.use(type_annotations_1.default);
42789
- var types6 = fork.use(types_1.default);
42790
- var def = types6.Type.def;
42791
- var or = types6.Type.or;
42705
+ var types7 = fork.use(types_1.default);
42706
+ var def = types7.Type.def;
42707
+ var or = types7.Type.or;
42792
42708
  var defaults = fork.use(shared_1.default).defaults;
42793
42709
  def("Flow").bases("Node");
42794
42710
  def("FlowType").bases("Flow");
@@ -42903,10 +42819,10 @@ var require_esprima = __commonJS({
42903
42819
  var shared_1 = (0, tslib_1.__importDefault)(require_shared());
42904
42820
  function default_1(fork) {
42905
42821
  fork.use(es_proposals_1.default);
42906
- var types6 = fork.use(types_1.default);
42822
+ var types7 = fork.use(types_1.default);
42907
42823
  var defaults = fork.use(shared_1.default).defaults;
42908
- var def = types6.Type.def;
42909
- var or = types6.Type.or;
42824
+ var def = types7.Type.def;
42825
+ var or = types7.Type.or;
42910
42826
  def("VariableDeclaration").field("declarations", [or(
42911
42827
  def("VariableDeclarator"),
42912
42828
  def("Identifier")
@@ -42963,11 +42879,11 @@ var require_babel_core = __commonJS({
42963
42879
  function default_1(fork) {
42964
42880
  var _a2, _b2, _c2, _d, _e;
42965
42881
  fork.use(es_proposals_1.default);
42966
- var types6 = fork.use(types_1.default);
42882
+ var types7 = fork.use(types_1.default);
42967
42883
  var defaults = fork.use(shared_1.default).defaults;
42968
- var def = types6.Type.def;
42969
- var or = types6.Type.or;
42970
- var isUndefined = types6.builtInTypes.undefined;
42884
+ var def = types7.Type.def;
42885
+ var or = types7.Type.or;
42886
+ var isUndefined = types7.builtInTypes.undefined;
42971
42887
  def("Noop").bases("Statement").build();
42972
42888
  def("DoExpression").bases("Expression").build("body").field("body", [def("Statement")]);
42973
42889
  def("BindExpression").bases("Expression").build("object", "callee").field("object", or(def("Expression"), null)).field("callee", def("Expression"));
@@ -43002,7 +42918,7 @@ var require_babel_core = __commonJS({
43002
42918
  raw: String
43003
42919
  },
43004
42920
  function getDefault() {
43005
- var value = types6.getFieldValue(this, "value");
42921
+ var value = types7.getFieldValue(this, "value");
43006
42922
  return {
43007
42923
  rawValue: value,
43008
42924
  raw: toRaw ? toRaw(value) : String(value)
@@ -43093,8 +43009,8 @@ var require_babel = __commonJS({
43093
43009
  var babel_core_1 = (0, tslib_1.__importDefault)(require_babel_core());
43094
43010
  var flow_1 = (0, tslib_1.__importDefault)(require_flow());
43095
43011
  function default_1(fork) {
43096
- var types6 = fork.use(types_1.default);
43097
- var def = types6.Type.def;
43012
+ var types7 = fork.use(types_1.default);
43013
+ var def = types7.Type.def;
43098
43014
  fork.use(babel_core_1.default);
43099
43015
  fork.use(flow_1.default);
43100
43016
  def("V8IntrinsicIdentifier").bases("Expression").build("name").field("name", String);
@@ -43118,12 +43034,12 @@ var require_typescript = __commonJS({
43118
43034
  function default_1(fork) {
43119
43035
  fork.use(babel_core_1.default);
43120
43036
  fork.use(type_annotations_1.default);
43121
- var types6 = fork.use(types_1.default);
43122
- var n2 = types6.namedTypes;
43123
- var def = types6.Type.def;
43124
- var or = types6.Type.or;
43037
+ var types7 = fork.use(types_1.default);
43038
+ var n2 = types7.namedTypes;
43039
+ var def = types7.Type.def;
43040
+ var or = types7.Type.or;
43125
43041
  var defaults = fork.use(shared_1.default).defaults;
43126
- var StringLiteral = types6.Type.from(function(value, deep) {
43042
+ var StringLiteral = types7.Type.from(function(value, deep) {
43127
43043
  if (n2.StringLiteral && n2.StringLiteral.check(value, deep)) {
43128
43044
  return true;
43129
43045
  }
@@ -45101,8 +45017,8 @@ var require_util9 = __commonJS({
45101
45017
  exports2.isTrailingCommaEnabled = exports2.getParentExportDeclaration = exports2.isExportDeclaration = exports2.fixFaultyLocations = exports2.getTrueLoc = exports2.composeSourceMaps = exports2.copyPos = exports2.comparePos = exports2.getUnionOfKeys = exports2.getOption = exports2.isBrowser = exports2.getLineTerminator = void 0;
45102
45018
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
45103
45019
  var assert_1 = tslib_1.__importDefault(require("assert"));
45104
- var types6 = tslib_1.__importStar(require_main2());
45105
- var n2 = types6.namedTypes;
45020
+ var types7 = tslib_1.__importStar(require_main2());
45021
+ var n2 = types7.namedTypes;
45106
45022
  var source_map_1 = tslib_1.__importDefault(require_source_map());
45107
45023
  var SourceMapConsumer = source_map_1.default.SourceMapConsumer;
45108
45024
  var SourceMapGenerator = source_map_1.default.SourceMapGenerator;
@@ -51527,13 +51443,13 @@ var require_esprima2 = __commonJS({
51527
51443
  return Reader2;
51528
51444
  }();
51529
51445
  var Tokenizer = function() {
51530
- function Tokenizer2(code, config13) {
51446
+ function Tokenizer2(code, config14) {
51531
51447
  this.errorHandler = new error_handler_1.ErrorHandler();
51532
- this.errorHandler.tolerant = config13 ? typeof config13.tolerant === "boolean" && config13.tolerant : false;
51448
+ this.errorHandler.tolerant = config14 ? typeof config14.tolerant === "boolean" && config14.tolerant : false;
51533
51449
  this.scanner = new scanner_1.Scanner(code, this.errorHandler);
51534
- this.scanner.trackComment = config13 ? typeof config13.comment === "boolean" && config13.comment : false;
51535
- this.trackRange = config13 ? typeof config13.range === "boolean" && config13.range : false;
51536
- this.trackLoc = config13 ? typeof config13.loc === "boolean" && config13.loc : false;
51450
+ this.scanner.trackComment = config14 ? typeof config14.comment === "boolean" && config14.comment : false;
51451
+ this.trackRange = config14 ? typeof config14.range === "boolean" && config14.range : false;
51452
+ this.trackLoc = config14 ? typeof config14.loc === "boolean" && config14.loc : false;
51537
51453
  this.buffer = [];
51538
51454
  this.reader = new Reader();
51539
51455
  }
@@ -52515,10 +52431,10 @@ var require_comments = __commonJS({
52515
52431
  exports2.printComments = exports2.attach = void 0;
52516
52432
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
52517
52433
  var assert_1 = tslib_1.__importDefault(require("assert"));
52518
- var types6 = tslib_1.__importStar(require_main2());
52519
- var n2 = types6.namedTypes;
52520
- var isArray = types6.builtInTypes.array;
52521
- var isObject2 = types6.builtInTypes.object;
52434
+ var types7 = tslib_1.__importStar(require_main2());
52435
+ var n2 = types7.namedTypes;
52436
+ var isArray = types7.builtInTypes.array;
52437
+ var isObject2 = types7.builtInTypes.object;
52522
52438
  var lines_1 = require_lines();
52523
52439
  var util_1 = require_util9();
52524
52440
  var childNodesCache = /* @__PURE__ */ new WeakMap();
@@ -52549,7 +52465,7 @@ var require_comments = __commonJS({
52549
52465
  if (isArray.check(node)) {
52550
52466
  names = Object.keys(node);
52551
52467
  } else if (isObject2.check(node)) {
52552
- names = types6.getFieldNames(node);
52468
+ names = types7.getFieldNames(node);
52553
52469
  } else {
52554
52470
  return resultArray;
52555
52471
  }
@@ -52729,7 +52645,7 @@ var require_comments = __commonJS({
52729
52645
  function printComments(path4, print2) {
52730
52646
  var value = path4.getValue();
52731
52647
  var innerLines = print2(path4);
52732
- var comments = n2.Node.check(value) && types6.getFieldValue(value, "comments");
52648
+ var comments = n2.Node.check(value) && types7.getFieldValue(value, "comments");
52733
52649
  if (!comments || comments.length === 0) {
52734
52650
  return innerLines;
52735
52651
  }
@@ -52737,8 +52653,8 @@ var require_comments = __commonJS({
52737
52653
  var trailingParts = [innerLines];
52738
52654
  path4.each(function(commentPath) {
52739
52655
  var comment = commentPath.getValue();
52740
- var leading = types6.getFieldValue(comment, "leading");
52741
- var trailing = types6.getFieldValue(comment, "trailing");
52656
+ var leading = types7.getFieldValue(comment, "leading");
52657
+ var trailing = types7.getFieldValue(comment, "trailing");
52742
52658
  if (leading || trailing && !(n2.Statement.check(value) || comment.type === "Block" || comment.type === "CommentBlock")) {
52743
52659
  leadingParts.push(printLeadingComment(commentPath, print2));
52744
52660
  } else if (trailing) {
@@ -52760,10 +52676,10 @@ var require_parser2 = __commonJS({
52760
52676
  exports2.parse = void 0;
52761
52677
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
52762
52678
  var assert_1 = tslib_1.__importDefault(require("assert"));
52763
- var types6 = tslib_1.__importStar(require_main2());
52764
- var b2 = types6.builders;
52765
- var isObject2 = types6.builtInTypes.object;
52766
- var isArray = types6.builtInTypes.array;
52679
+ var types7 = tslib_1.__importStar(require_main2());
52680
+ var b2 = types7.builders;
52681
+ var isObject2 = types7.builtInTypes.object;
52682
+ var isArray = types7.builtInTypes.array;
52767
52683
  var options_1 = require_options();
52768
52684
  var lines_1 = require_lines();
52769
52685
  var comments_1 = require_comments();
@@ -52950,11 +52866,11 @@ var require_fast_path = __commonJS({
52950
52866
  Object.defineProperty(exports2, "__esModule", { value: true });
52951
52867
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
52952
52868
  var assert_1 = tslib_1.__importDefault(require("assert"));
52953
- var types6 = tslib_1.__importStar(require_main2());
52869
+ var types7 = tslib_1.__importStar(require_main2());
52954
52870
  var util = tslib_1.__importStar(require_util9());
52955
- var n2 = types6.namedTypes;
52956
- var isArray = types6.builtInTypes.array;
52957
- var isNumber = types6.builtInTypes.number;
52871
+ var n2 = types7.namedTypes;
52872
+ var isArray = types7.builtInTypes.array;
52873
+ var isNumber = types7.builtInTypes.number;
52958
52874
  var PRECEDENCE = {};
52959
52875
  [
52960
52876
  ["??"],
@@ -52983,7 +52899,7 @@ var require_fast_path = __commonJS({
52983
52899
  if (obj instanceof FastPath) {
52984
52900
  return obj.copy();
52985
52901
  }
52986
- if (obj instanceof types6.NodePath) {
52902
+ if (obj instanceof types7.NodePath) {
52987
52903
  var copy = Object.create(FastPath.prototype);
52988
52904
  var stack = [obj.value];
52989
52905
  for (var pp = void 0; pp = obj.parentPath; obj = pp)
@@ -53294,7 +53210,7 @@ var require_fast_path = __commonJS({
53294
53210
  return node.some(containsCallExpression);
53295
53211
  }
53296
53212
  if (n2.Node.check(node)) {
53297
- return types6.someField(node, function(_name, child) {
53213
+ return types7.someField(node, function(_name, child) {
53298
53214
  return containsCallExpression(child);
53299
53215
  });
53300
53216
  }
@@ -53384,16 +53300,16 @@ var require_patcher = __commonJS({
53384
53300
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
53385
53301
  var assert_1 = tslib_1.__importDefault(require("assert"));
53386
53302
  var linesModule = tslib_1.__importStar(require_lines());
53387
- var types6 = tslib_1.__importStar(require_main2());
53388
- var Printable = types6.namedTypes.Printable;
53389
- var Expression = types6.namedTypes.Expression;
53390
- var ReturnStatement = types6.namedTypes.ReturnStatement;
53391
- var SourceLocation = types6.namedTypes.SourceLocation;
53303
+ var types7 = tslib_1.__importStar(require_main2());
53304
+ var Printable = types7.namedTypes.Printable;
53305
+ var Expression = types7.namedTypes.Expression;
53306
+ var ReturnStatement = types7.namedTypes.ReturnStatement;
53307
+ var SourceLocation = types7.namedTypes.SourceLocation;
53392
53308
  var util_1 = require_util9();
53393
53309
  var fast_path_1 = tslib_1.__importDefault(require_fast_path());
53394
- var isObject2 = types6.builtInTypes.object;
53395
- var isArray = types6.builtInTypes.array;
53396
- var isString = types6.builtInTypes.string;
53310
+ var isObject2 = types7.builtInTypes.object;
53311
+ var isArray = types7.builtInTypes.array;
53312
+ var isString = types7.builtInTypes.string;
53397
53313
  var riskyAdjoiningCharExp = /[0-9a-z_$]/i;
53398
53314
  var Patcher = function Patcher2(lines) {
53399
53315
  assert_1.default.ok(this instanceof Patcher2);
@@ -53672,8 +53588,8 @@ var require_patcher = __commonJS({
53672
53588
  if (k2.charAt(0) === "_") {
53673
53589
  continue;
53674
53590
  }
53675
- newPath.stack.push(k2, types6.getFieldValue(newNode, k2));
53676
- oldPath.stack.push(k2, types6.getFieldValue(oldNode, k2));
53591
+ newPath.stack.push(k2, types7.getFieldValue(newNode, k2));
53592
+ oldPath.stack.push(k2, types7.getFieldValue(oldNode, k2));
53677
53593
  var canReprint = findAnyReprints(newPath, oldPath, reprints);
53678
53594
  newPath.stack.length -= 2;
53679
53595
  oldPath.stack.length -= 2;
@@ -53701,10 +53617,10 @@ var require_printer = __commonJS({
53701
53617
  var lines_1 = require_lines();
53702
53618
  var options_1 = require_options();
53703
53619
  var patcher_1 = require_patcher();
53704
- var types6 = tslib_1.__importStar(require_main2());
53705
- var namedTypes = types6.namedTypes;
53706
- var isString = types6.builtInTypes.string;
53707
- var isObject2 = types6.builtInTypes.object;
53620
+ var types7 = tslib_1.__importStar(require_main2());
53621
+ var namedTypes = types7.namedTypes;
53622
+ var isString = types7.builtInTypes.string;
53623
+ var isObject2 = types7.builtInTypes.object;
53708
53624
  var fast_path_1 = tslib_1.__importDefault(require_fast_path());
53709
53625
  var util = tslib_1.__importStar(require_util9());
53710
53626
  var PrintResult = function PrintResult2(code, sourceMap) {
@@ -53726,11 +53642,11 @@ var require_printer = __commonJS({
53726
53642
  return this.code;
53727
53643
  };
53728
53644
  var emptyPrintResult = new PrintResult("");
53729
- var Printer = function Printer2(config13) {
53645
+ var Printer = function Printer2(config14) {
53730
53646
  assert_1.default.ok(this instanceof Printer2);
53731
- var explicitTabWidth = config13 && config13.tabWidth;
53732
- config13 = options_1.normalize(config13);
53733
- config13.sourceFileName = null;
53647
+ var explicitTabWidth = config14 && config14.tabWidth;
53648
+ config14 = options_1.normalize(config14);
53649
+ config14.sourceFileName = null;
53734
53650
  function makePrintFunctionWith(options, overrides) {
53735
53651
  options = Object.assign({}, options, overrides);
53736
53652
  return function(path4) {
@@ -53745,11 +53661,11 @@ var require_printer = __commonJS({
53745
53661
  includeComments: false
53746
53662
  }));
53747
53663
  }
53748
- var oldTabWidth = config13.tabWidth;
53664
+ var oldTabWidth = config14.tabWidth;
53749
53665
  if (!explicitTabWidth) {
53750
53666
  var loc = path4.getNode().loc;
53751
53667
  if (loc && loc.lines && loc.lines.guessTabWidth) {
53752
- config13.tabWidth = loc.lines.guessTabWidth();
53668
+ config14.tabWidth = loc.lines.guessTabWidth();
53753
53669
  }
53754
53670
  }
53755
53671
  var reprinter = patcher_1.getReprinter(path4);
@@ -53763,11 +53679,11 @@ var require_printer = __commonJS({
53763
53679
  // right choice because it gives us the opportunity to reprint
53764
53680
  // such nodes using their original source.
53765
53681
  reprinter(print2)
53766
- ) : genericPrint(path4, config13, options, makePrintFunctionWith(options, {
53682
+ ) : genericPrint(path4, config14, options, makePrintFunctionWith(options, {
53767
53683
  includeComments: true,
53768
53684
  avoidRootParens: false
53769
53685
  }));
53770
- config13.tabWidth = oldTabWidth;
53686
+ config14.tabWidth = oldTabWidth;
53771
53687
  return lines;
53772
53688
  }
53773
53689
  this.print = function(ast) {
@@ -53778,7 +53694,7 @@ var require_printer = __commonJS({
53778
53694
  includeComments: true,
53779
53695
  avoidRootParens: false
53780
53696
  });
53781
- return new PrintResult(lines.toString(config13), util.composeSourceMaps(config13.inputSourceMap, lines.getSourceMap(config13.sourceMapName, config13.sourceRoot)));
53697
+ return new PrintResult(lines.toString(config14), util.composeSourceMaps(config14.inputSourceMap, lines.getSourceMap(config14.sourceMapName, config14.sourceRoot)));
53782
53698
  };
53783
53699
  this.printGenerically = function(ast) {
53784
53700
  if (!ast) {
@@ -53786,26 +53702,26 @@ var require_printer = __commonJS({
53786
53702
  }
53787
53703
  function printGenerically(path5) {
53788
53704
  return comments_1.printComments(path5, function(path6) {
53789
- return genericPrint(path6, config13, {
53705
+ return genericPrint(path6, config14, {
53790
53706
  includeComments: true,
53791
53707
  avoidRootParens: false
53792
53708
  }, printGenerically);
53793
53709
  });
53794
53710
  }
53795
53711
  var path4 = fast_path_1.default.from(ast);
53796
- var oldReuseWhitespace = config13.reuseWhitespace;
53797
- config13.reuseWhitespace = false;
53798
- var pr = new PrintResult(printGenerically(path4).toString(config13));
53799
- config13.reuseWhitespace = oldReuseWhitespace;
53712
+ var oldReuseWhitespace = config14.reuseWhitespace;
53713
+ config14.reuseWhitespace = false;
53714
+ var pr = new PrintResult(printGenerically(path4).toString(config14));
53715
+ config14.reuseWhitespace = oldReuseWhitespace;
53800
53716
  return pr;
53801
53717
  };
53802
53718
  };
53803
53719
  exports2.Printer = Printer;
53804
- function genericPrint(path4, config13, options, printPath) {
53720
+ function genericPrint(path4, config14, options, printPath) {
53805
53721
  assert_1.default.ok(path4 instanceof fast_path_1.default);
53806
53722
  var node = path4.getValue();
53807
53723
  var parts = [];
53808
- var linesWithoutParens = genericPrintNoParens(path4, config13, printPath);
53724
+ var linesWithoutParens = genericPrintNoParens(path4, config14, printPath);
53809
53725
  if (!node || linesWithoutParens.isEmpty()) {
53810
53726
  return linesWithoutParens;
53811
53727
  }
@@ -53878,7 +53794,7 @@ var require_printer = __commonJS({
53878
53794
  case "OptionalMemberExpression": {
53879
53795
  parts.push(path4.call(print2, "object"));
53880
53796
  var property = path4.call(print2, "property");
53881
- var optional = types6.getFieldValue(n2, "optional");
53797
+ var optional = types7.getFieldValue(n2, "optional");
53882
53798
  if (n2.computed) {
53883
53799
  parts.push(optional ? "?.[" : "[", property, "]");
53884
53800
  } else {
@@ -54149,7 +54065,7 @@ var require_printer = __commonJS({
54149
54065
  if (n2.typeArguments) {
54150
54066
  parts.push(path4.call(print2, "typeArguments"));
54151
54067
  }
54152
- if (types6.getFieldValue(n2, "optional")) {
54068
+ if (types7.getFieldValue(n2, "optional")) {
54153
54069
  parts.push("?.");
54154
54070
  }
54155
54071
  parts.push(printArgumentsList(path4, options, print2));
@@ -55781,8 +55697,8 @@ var require_printer = __commonJS({
55781
55697
  });
55782
55698
  }
55783
55699
  function getPossibleRaw(node) {
55784
- var value = types6.getFieldValue(node, "value");
55785
- var extra = types6.getFieldValue(node, "extra");
55700
+ var value = types7.getFieldValue(node, "value");
55701
+ var extra = types7.getFieldValue(node, "extra");
55786
55702
  if (extra && typeof extra.raw === "string" && value == extra.rawValue) {
55787
55703
  return extra.raw;
55788
55704
  }
@@ -55830,8 +55746,8 @@ var require_main3 = __commonJS({
55830
55746
  exports2.run = exports2.prettyPrint = exports2.print = exports2.visit = exports2.types = exports2.parse = void 0;
55831
55747
  var tslib_1 = (init_tslib_es6(), __toCommonJS(tslib_es6_exports));
55832
55748
  var fs_1 = tslib_1.__importDefault(require("fs"));
55833
- var types6 = tslib_1.__importStar(require_main2());
55834
- exports2.types = types6;
55749
+ var types7 = tslib_1.__importStar(require_main2());
55750
+ exports2.types = types7;
55835
55751
  var parser_1 = require_parser2();
55836
55752
  Object.defineProperty(exports2, "parse", { enumerable: true, get: function() {
55837
55753
  return parser_1.parse;
@@ -56695,14 +56611,14 @@ var require_lib = __commonJS({
56695
56611
  this.preserveSpace = !!preserveSpace;
56696
56612
  }
56697
56613
  };
56698
- var types6 = {
56614
+ var types7 = {
56699
56615
  brace: new TokContext("{"),
56700
56616
  j_oTag: new TokContext("<tag"),
56701
56617
  j_cTag: new TokContext("</tag"),
56702
56618
  j_expr: new TokContext("<tag>...</tag>", true)
56703
56619
  };
56704
56620
  {
56705
- types6.template = new TokContext("`", true);
56621
+ types7.template = new TokContext("`", true);
56706
56622
  }
56707
56623
  var beforeExpr = true;
56708
56624
  var startsExpr = true;
@@ -57234,17 +57150,17 @@ var require_lib = __commonJS({
57234
57150
  context.pop();
57235
57151
  };
57236
57152
  tokenTypes[5].updateContext = tokenTypes[7].updateContext = tokenTypes[23].updateContext = (context) => {
57237
- context.push(types6.brace);
57153
+ context.push(types7.brace);
57238
57154
  };
57239
57155
  tokenTypes[22].updateContext = (context) => {
57240
- if (context[context.length - 1] === types6.template) {
57156
+ if (context[context.length - 1] === types7.template) {
57241
57157
  context.pop();
57242
57158
  } else {
57243
- context.push(types6.template);
57159
+ context.push(types7.template);
57244
57160
  }
57245
57161
  };
57246
57162
  tokenTypes[140].updateContext = (context) => {
57247
- context.push(types6.j_expr, types6.j_oTag);
57163
+ context.push(types7.j_expr, types7.j_oTag);
57248
57164
  };
57249
57165
  }
57250
57166
  var nonASCIIidentifierStartChars = "\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC";
@@ -57850,7 +57766,7 @@ var require_lib = __commonJS({
57850
57766
  this.lastTokEndLoc = null;
57851
57767
  this.lastTokStartLoc = null;
57852
57768
  this.lastTokStart = 0;
57853
- this.context = [types6.brace];
57769
+ this.context = [types7.brace];
57854
57770
  this.canStartJSXElement = true;
57855
57771
  this.containsEsc = false;
57856
57772
  this.firstInvalidTemplateEscapePos = null;
@@ -61741,7 +61657,7 @@ var require_lib = __commonJS({
61741
61657
  context
61742
61658
  } = this.state;
61743
61659
  const currentContext = context[context.length - 1];
61744
- if (currentContext === types6.j_oTag || currentContext === types6.j_expr) {
61660
+ if (currentContext === types7.j_oTag || currentContext === types7.j_expr) {
61745
61661
  context.pop();
61746
61662
  }
61747
61663
  }
@@ -62799,9 +62715,9 @@ var require_lib = __commonJS({
62799
62715
  switch (this.state.type) {
62800
62716
  case 5:
62801
62717
  node = this.startNode();
62802
- this.setContext(types6.brace);
62718
+ this.setContext(types7.brace);
62803
62719
  this.next();
62804
- node = this.jsxParseExpressionContainer(node, types6.j_oTag);
62720
+ node = this.jsxParseExpressionContainer(node, types7.j_oTag);
62805
62721
  if (node.expression.type === "JSXEmptyExpression") {
62806
62722
  this.raise(JsxErrors.AttributeIsEmpty, {
62807
62723
  at: node
@@ -62824,7 +62740,7 @@ var require_lib = __commonJS({
62824
62740
  jsxParseSpreadChild(node) {
62825
62741
  this.next();
62826
62742
  node.expression = this.parseExpression();
62827
- this.setContext(types6.j_expr);
62743
+ this.setContext(types7.j_expr);
62828
62744
  this.state.canStartJSXElement = true;
62829
62745
  this.expect(8);
62830
62746
  return this.finishNode(node, "JSXSpreadChild");
@@ -62844,11 +62760,11 @@ var require_lib = __commonJS({
62844
62760
  jsxParseAttribute() {
62845
62761
  const node = this.startNode();
62846
62762
  if (this.match(5)) {
62847
- this.setContext(types6.brace);
62763
+ this.setContext(types7.brace);
62848
62764
  this.next();
62849
62765
  this.expect(21);
62850
62766
  node.argument = this.parseMaybeAssignAllowIn();
62851
- this.setContext(types6.j_oTag);
62767
+ this.setContext(types7.j_oTag);
62852
62768
  this.state.canStartJSXElement = true;
62853
62769
  this.expect(8);
62854
62770
  return this.finishNode(node, "JSXSpreadAttribute");
@@ -62907,12 +62823,12 @@ var require_lib = __commonJS({
62907
62823
  break;
62908
62824
  case 5: {
62909
62825
  const node2 = this.startNode();
62910
- this.setContext(types6.brace);
62826
+ this.setContext(types7.brace);
62911
62827
  this.next();
62912
62828
  if (this.match(21)) {
62913
62829
  children.push(this.jsxParseSpreadChild(node2));
62914
62830
  } else {
62915
- children.push(this.jsxParseExpressionContainer(node2, types6.j_expr));
62831
+ children.push(this.jsxParseExpressionContainer(node2, types7.j_expr));
62916
62832
  }
62917
62833
  break;
62918
62834
  }
@@ -62983,11 +62899,11 @@ var require_lib = __commonJS({
62983
62899
  }
62984
62900
  getTokenFromCode(code) {
62985
62901
  const context = this.curContext();
62986
- if (context === types6.j_expr) {
62902
+ if (context === types7.j_expr) {
62987
62903
  this.jsxReadToken();
62988
62904
  return;
62989
62905
  }
62990
- if (context === types6.j_oTag || context === types6.j_cTag) {
62906
+ if (context === types7.j_oTag || context === types7.j_cTag) {
62991
62907
  if (isIdentifierStart(code)) {
62992
62908
  this.jsxReadWord();
62993
62909
  return;
@@ -62997,7 +62913,7 @@ var require_lib = __commonJS({
62997
62913
  this.finishToken(141);
62998
62914
  return;
62999
62915
  }
63000
- if ((code === 34 || code === 39) && context === types6.j_oTag) {
62916
+ if ((code === 34 || code === 39) && context === types7.j_oTag) {
63001
62917
  this.jsxReadString(code);
63002
62918
  return;
63003
62919
  }
@@ -63015,17 +62931,17 @@ var require_lib = __commonJS({
63015
62931
  type
63016
62932
  } = this.state;
63017
62933
  if (type === 56 && prevType === 140) {
63018
- context.splice(-2, 2, types6.j_cTag);
62934
+ context.splice(-2, 2, types7.j_cTag);
63019
62935
  this.state.canStartJSXElement = false;
63020
62936
  } else if (type === 140) {
63021
- context.push(types6.j_oTag);
62937
+ context.push(types7.j_oTag);
63022
62938
  } else if (type === 141) {
63023
62939
  const out = context[context.length - 1];
63024
- if (out === types6.j_oTag && prevType === 56 || out === types6.j_cTag) {
62940
+ if (out === types7.j_oTag && prevType === 56 || out === types7.j_cTag) {
63025
62941
  context.pop();
63026
- this.state.canStartJSXElement = context[context.length - 1] === types6.j_expr;
62942
+ this.state.canStartJSXElement = context[context.length - 1] === types7.j_expr;
63027
62943
  } else {
63028
- this.setContext(types6.j_expr);
62944
+ this.setContext(types7.j_expr);
63029
62945
  this.state.canStartJSXElement = true;
63030
62946
  }
63031
62947
  } else {
@@ -64469,14 +64385,14 @@ var require_lib = __commonJS({
64469
64385
  tsParseUnionOrIntersectionType(kind, parseConstituentType, operator) {
64470
64386
  const node = this.startNode();
64471
64387
  const hasLeadingOperator = this.eat(operator);
64472
- const types7 = [];
64388
+ const types8 = [];
64473
64389
  do {
64474
- types7.push(parseConstituentType());
64390
+ types8.push(parseConstituentType());
64475
64391
  } while (this.eat(operator));
64476
- if (types7.length === 1 && !hasLeadingOperator) {
64477
- return types7[0];
64392
+ if (types8.length === 1 && !hasLeadingOperator) {
64393
+ return types8[0];
64478
64394
  }
64479
- node.types = types7;
64395
+ node.types = types8;
64480
64396
  return this.finishNode(node, kind);
64481
64397
  }
64482
64398
  tsParseIntersectionTypeOrHigher() {
@@ -65050,7 +64966,7 @@ var require_lib = __commonJS({
65050
64966
  this.raise(TSErrors.EmptyTypeArguments, {
65051
64967
  at: node
65052
64968
  });
65053
- } else if (!this.state.inType && this.curContext() === types6.brace) {
64969
+ } else if (!this.state.inType && this.curContext() === types7.brace) {
65054
64970
  this.reScan_lt_gt();
65055
64971
  }
65056
64972
  this.expect(48);
@@ -65727,7 +65643,7 @@ var require_lib = __commonJS({
65727
65643
  context
65728
65644
  } = this.state;
65729
65645
  const currentContext = context[context.length - 1];
65730
- if (currentContext === types6.j_oTag || currentContext === types6.j_expr) {
65646
+ if (currentContext === types7.j_oTag || currentContext === types7.j_expr) {
65731
65647
  context.pop();
65732
65648
  }
65733
65649
  }
@@ -70615,13 +70531,224 @@ var init_codemod = __esm({
70615
70531
  }
70616
70532
  });
70617
70533
 
70618
- // templates/astro/c3.ts
70534
+ // templates/analog/c3.ts
70535
+ var c3_exports = {};
70536
+ __export(c3_exports, {
70537
+ default: () => c3_default
70538
+ });
70539
+ var recast2, npm, pm, generate, configure, updateEnvTypes, updateViteConfig, config, c3_default;
70540
+ var init_c3 = __esm({
70541
+ "templates/analog/c3.ts"() {
70542
+ init_cli();
70543
+ init_colors();
70544
+ init_interactive();
70545
+ init_frameworks();
70546
+ init_codemod();
70547
+ init_compatDate();
70548
+ init_files();
70549
+ init_packageManagers();
70550
+ init_packages();
70551
+ recast2 = __toESM(require_main3());
70552
+ ({ npm, name: pm } = detectPackageManager());
70553
+ generate = async (ctx) => {
70554
+ await runFrameworkGenerator(ctx, [
70555
+ ctx.project.name,
70556
+ "--template",
70557
+ "angular-v17"
70558
+ ]);
70559
+ logRaw("");
70560
+ };
70561
+ configure = async (ctx) => {
70562
+ if (pm === "pnpm" || pm === "yarn" || pm === "bun") {
70563
+ const packages = [];
70564
+ packages.push("nitropack");
70565
+ packages.push("h3");
70566
+ packages.push("@ngtools/webpack");
70567
+ packages.push("@angular-devkit/build-angular");
70568
+ await installPackages(packages, {
70569
+ dev: true,
70570
+ startText: `Installing ${packages.join(", ")}`,
70571
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm} install\``)}`
70572
+ });
70573
+ }
70574
+ updateViteConfig(ctx);
70575
+ updateEnvTypes(ctx);
70576
+ };
70577
+ updateEnvTypes = (ctx) => {
70578
+ const filepath = "env.d.ts";
70579
+ const s = spinner();
70580
+ s.start(`Updating ${filepath}`);
70581
+ let file = readFile(filepath);
70582
+ let typesEntrypoint = `@cloudflare/workers-types`;
70583
+ const latestEntrypoint = getLatestTypesEntrypoint(ctx);
70584
+ if (latestEntrypoint) {
70585
+ typesEntrypoint += `/${latestEntrypoint}`;
70586
+ }
70587
+ file = file.replace("WORKERS_TYPES_ENTRYPOINT", typesEntrypoint);
70588
+ writeFile2("env.d.ts", file);
70589
+ s.stop(`${brandColor(`updated`)} ${dim(`\`${filepath}\``)}`);
70590
+ };
70591
+ updateViteConfig = (ctx) => {
70592
+ const b2 = recast2.types.builders;
70593
+ const s = spinner();
70594
+ const configFile = "vite.config.ts";
70595
+ s.start(`Updating \`${configFile}\``);
70596
+ const snippets = loadTemplateSnippets(ctx);
70597
+ transformFile(configFile, {
70598
+ visitProgram(n2) {
70599
+ const lastImportIndex = n2.node.body.findLastIndex(
70600
+ (t) => t.type === "ImportDeclaration"
70601
+ );
70602
+ const lastImport = n2.get("body", lastImportIndex);
70603
+ lastImport.insertAfter(...snippets.devBindingsModuleTs);
70604
+ return this.traverse(n2);
70605
+ },
70606
+ visitCallExpression(n2) {
70607
+ const callee = n2.node.callee;
70608
+ if (callee.name === "analog") {
70609
+ const pluginArguments = b2.objectProperty(
70610
+ b2.identifier("nitro"),
70611
+ b2.objectExpression([
70612
+ b2.objectProperty(
70613
+ b2.identifier("preset"),
70614
+ b2.stringLiteral("cloudflare-pages")
70615
+ ),
70616
+ b2.objectProperty(
70617
+ b2.identifier("modules"),
70618
+ b2.arrayExpression([b2.identifier("devBindingsModule")])
70619
+ )
70620
+ ])
70621
+ );
70622
+ n2.node.arguments = [b2.objectExpression([pluginArguments])];
70623
+ }
70624
+ return this.traverse(n2);
70625
+ }
70626
+ });
70627
+ s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
70628
+ };
70629
+ config = {
70630
+ configVersion: 1,
70631
+ id: "analog",
70632
+ platform: "pages",
70633
+ displayName: "Analog",
70634
+ copyFiles: {
70635
+ path: "./templates"
70636
+ },
70637
+ generate,
70638
+ configure,
70639
+ transformPackageJson: async () => ({
70640
+ scripts: {
70641
+ preview: `${npm} run build && wrangler pages dev`,
70642
+ deploy: `${npm} run build && wrangler pages deploy`,
70643
+ "cf-typegen": `wrangler types`
70644
+ }
70645
+ }),
70646
+ devScript: "dev",
70647
+ deployScript: "deploy",
70648
+ previewScript: "preview"
70649
+ };
70650
+ c3_default = config;
70651
+ }
70652
+ });
70653
+
70654
+ // templates/angular/c3.ts
70619
70655
  var c3_exports2 = {};
70620
70656
  __export(c3_exports2, {
70621
70657
  default: () => c3_default2
70622
70658
  });
70623
- var recast2, npx2, generate2, configure2, updateAstroConfig, updateEnvDeclaration, config2, c3_default2;
70659
+ async function installCFWorker() {
70660
+ await installPackages(
70661
+ ["@cloudflare/workers-types", "@miniflare/tre@next", "wrangler@beta"],
70662
+ {
70663
+ dev: true,
70664
+ startText: "Installing adapter dependencies",
70665
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm2} install\``)}`
70666
+ }
70667
+ );
70668
+ }
70669
+ async function updateAppCode() {
70670
+ const s = spinner();
70671
+ s.start(`Updating application code`);
70672
+ const appConfigPath = "src/app/app.config.ts";
70673
+ const appConfig = readFile((0, import_node_path.resolve)(appConfigPath));
70674
+ const newAppConfig = "import { provideHttpClient, withFetch } from '@angular/common/http';\n" + appConfig.replace(
70675
+ "providers: [",
70676
+ "providers: [provideHttpClient(withFetch()), "
70677
+ );
70678
+ writeFile2((0, import_node_path.resolve)(appConfigPath), newAppConfig);
70679
+ s.stop(`${brandColor(`updated`)} ${dim(appConfigPath)}`);
70680
+ s.start(`Updating package.json`);
70681
+ const packageJsonPath = (0, import_node_path.resolve)("package.json");
70682
+ const packageManifest = readJSON(packageJsonPath);
70683
+ delete packageManifest["dependencies"]["@angular/ssr"];
70684
+ delete packageManifest["dependencies"]["express"];
70685
+ writeFile2(packageJsonPath, JSON.stringify(packageManifest, null, 2));
70686
+ s.stop(`${brandColor(`updated`)} ${dim(`\`package.json\``)}`);
70687
+ }
70688
+ function updateAngularJson(ctx) {
70689
+ const s = spinner();
70690
+ s.start(`Updating angular.json config`);
70691
+ const angularJson = readJSON((0, import_node_path.resolve)("angular.json"));
70692
+ const architectSection = angularJson.projects[ctx.project.name].architect;
70693
+ architectSection.build.options.outputPath = "dist";
70694
+ architectSection.build.options.assets.push("src/_routes.json");
70695
+ writeFile2((0, import_node_path.resolve)("angular.json"), JSON.stringify(angularJson, null, 2));
70696
+ s.stop(`${brandColor(`updated`)} ${dim(`\`angular.json\``)}`);
70697
+ }
70698
+ var import_node_path, npm2, generate2, configure2, config2, c3_default2;
70624
70699
  var init_c32 = __esm({
70700
+ "templates/angular/c3.ts"() {
70701
+ import_node_path = require("node:path");
70702
+ init_cli();
70703
+ init_colors();
70704
+ init_interactive();
70705
+ init_frameworks();
70706
+ init_compatDate();
70707
+ init_files();
70708
+ init_packageManagers();
70709
+ init_packages();
70710
+ ({ npm: npm2 } = detectPackageManager());
70711
+ generate2 = async (ctx) => {
70712
+ await runFrameworkGenerator(ctx, [ctx.project.name, "--ssr"]);
70713
+ logRaw("");
70714
+ };
70715
+ configure2 = async (ctx) => {
70716
+ updateAngularJson(ctx);
70717
+ await updateAppCode();
70718
+ await installCFWorker();
70719
+ };
70720
+ config2 = {
70721
+ configVersion: 1,
70722
+ id: "angular",
70723
+ displayName: "Angular",
70724
+ platform: "pages",
70725
+ copyFiles: {
70726
+ path: "./templates"
70727
+ },
70728
+ devScript: "start",
70729
+ deployScript: "deploy",
70730
+ generate: generate2,
70731
+ configure: configure2,
70732
+ transformPackageJson: async () => ({
70733
+ scripts: {
70734
+ start: `${npm2} run build && wrangler pages dev dist/cloudflare ${await compatDateFlag()} --experimental-local`,
70735
+ build: `ng build && ${npm2} run process`,
70736
+ process: "node ./tools/copy-files.mjs && node ./tools/alter-polyfills.mjs",
70737
+ deploy: `${npm2} run build && wrangler pages deploy dist/cloudflare`
70738
+ }
70739
+ })
70740
+ };
70741
+ c3_default2 = config2;
70742
+ }
70743
+ });
70744
+
70745
+ // templates/astro/c3.ts
70746
+ var c3_exports3 = {};
70747
+ __export(c3_exports3, {
70748
+ default: () => c3_default3
70749
+ });
70750
+ var recast3, npx2, generate3, configure3, updateAstroConfig, updateEnvDeclaration, config3, c3_default3;
70751
+ var init_c33 = __esm({
70625
70752
  "templates/astro/c3.ts"() {
70626
70753
  init_cli();
70627
70754
  init_colors();
@@ -70630,13 +70757,13 @@ var init_c32 = __esm({
70630
70757
  init_command();
70631
70758
  init_files();
70632
70759
  init_packageManagers();
70633
- recast2 = __toESM(require_main3());
70760
+ recast3 = __toESM(require_main3());
70634
70761
  ({ npx: npx2 } = detectPackageManager());
70635
- generate2 = async (ctx) => {
70762
+ generate3 = async (ctx) => {
70636
70763
  await runFrameworkGenerator(ctx, [ctx.project.name, "--no-install"]);
70637
70764
  logRaw("");
70638
70765
  };
70639
- configure2 = async (ctx) => {
70766
+ configure3 = async (ctx) => {
70640
70767
  await runCommand([npx2, "astro", "add", "cloudflare", "-y"], {
70641
70768
  silent: true,
70642
70769
  startText: "Installing adapter",
@@ -70656,7 +70783,7 @@ var init_c32 = __esm({
70656
70783
  if (callee.name !== "cloudflare") {
70657
70784
  return this.traverse(n2);
70658
70785
  }
70659
- const b2 = recast2.types.builders;
70786
+ const b2 = recast3.types.builders;
70660
70787
  n2.node.arguments = [
70661
70788
  b2.objectExpression([
70662
70789
  b2.objectProperty(
@@ -70681,7 +70808,7 @@ var init_c32 = __esm({
70681
70808
  visitProgram: function(n2) {
70682
70809
  const snippets = loadTemplateSnippets(ctx);
70683
70810
  const patch = snippets.runtimeDeclarationTs;
70684
- const b2 = recast2.types.builders;
70811
+ const b2 = recast3.types.builders;
70685
70812
  const comments = n2.get("comments").value;
70686
70813
  n2.node.comments = comments.map(
70687
70814
  (c2) => b2.commentLine(c2.value)
@@ -70691,7 +70818,7 @@ var init_c32 = __esm({
70691
70818
  }
70692
70819
  });
70693
70820
  };
70694
- config2 = {
70821
+ config3 = {
70695
70822
  configVersion: 1,
70696
70823
  id: "astro",
70697
70824
  platform: "pages",
@@ -70702,65 +70829,65 @@ var init_c32 = __esm({
70702
70829
  devScript: "dev",
70703
70830
  deployScript: "deploy",
70704
70831
  previewScript: "preview",
70705
- generate: generate2,
70706
- configure: configure2,
70832
+ generate: generate3,
70833
+ configure: configure3,
70707
70834
  transformPackageJson: async (pkgJson, ctx) => ({
70708
70835
  scripts: {
70709
- deploy: `astro build && wrangler pages deploy ./dist`,
70710
- preview: `astro build && wrangler pages dev ./dist`,
70711
- ...usesTypescript(ctx) && { "build-cf-types": `wrangler types` }
70836
+ deploy: `astro build && wrangler pages deploy`,
70837
+ preview: `astro build && wrangler pages dev`,
70838
+ ...usesTypescript(ctx) && { "cf-typegen": `wrangler types` }
70712
70839
  }
70713
70840
  })
70714
70841
  };
70715
- c3_default2 = config2;
70842
+ c3_default3 = config3;
70716
70843
  }
70717
70844
  });
70718
70845
 
70719
70846
  // templates/docusaurus/c3.ts
70720
- var c3_exports3 = {};
70721
- __export(c3_exports3, {
70722
- default: () => c3_default3
70847
+ var c3_exports4 = {};
70848
+ __export(c3_exports4, {
70849
+ default: () => c3_default4
70723
70850
  });
70724
- var npm2, generate3, config3, c3_default3;
70725
- var init_c33 = __esm({
70851
+ var npm3, generate4, config4, c3_default4;
70852
+ var init_c34 = __esm({
70726
70853
  "templates/docusaurus/c3.ts"() {
70727
70854
  init_frameworks();
70728
70855
  init_packageManagers();
70729
- ({ npm: npm2 } = detectPackageManager());
70730
- generate3 = async (ctx) => {
70856
+ ({ npm: npm3 } = detectPackageManager());
70857
+ generate4 = async (ctx) => {
70731
70858
  await runFrameworkGenerator(ctx, [ctx.project.name, "classic"]);
70732
70859
  };
70733
- config3 = {
70860
+ config4 = {
70734
70861
  configVersion: 1,
70735
70862
  id: "docusaurus",
70736
70863
  platform: "pages",
70737
70864
  displayName: "Docusaurus",
70738
- generate: generate3,
70865
+ generate: generate4,
70739
70866
  transformPackageJson: async () => ({
70740
70867
  scripts: {
70741
- deploy: `${npm2} run build && wrangler pages deploy ./build`
70868
+ deploy: `${npm3} run build && wrangler pages deploy ./build`
70742
70869
  }
70743
70870
  }),
70744
70871
  devScript: "start",
70745
70872
  deployScript: "deploy"
70746
70873
  };
70747
- c3_default3 = config3;
70874
+ c3_default4 = config4;
70748
70875
  }
70749
70876
  });
70750
70877
 
70751
70878
  // templates/gatsby/c3.ts
70752
- var c3_exports4 = {};
70753
- __export(c3_exports4, {
70754
- default: () => c3_default4
70879
+ var c3_exports5 = {};
70880
+ __export(c3_exports5, {
70881
+ default: () => c3_default5
70755
70882
  });
70756
- var npm3, generate4, config4, c3_default4;
70757
- var init_c34 = __esm({
70883
+ var npm4, generate5, config5, c3_default5;
70884
+ var init_c35 = __esm({
70758
70885
  "templates/gatsby/c3.ts"() {
70759
70886
  init_interactive();
70760
70887
  init_frameworks();
70761
70888
  init_packageManagers();
70762
- ({ npm: npm3 } = detectPackageManager());
70763
- generate4 = async (ctx) => {
70889
+ ({ npm: npm4 } = detectPackageManager());
70890
+ generate5 = async (ctx) => {
70764
70891
  const defaultTemplate = "https://github.com/gatsbyjs/gatsby-starter-blog";
70765
70892
  const useTemplate = await inputPrompt({
70766
70893
  type: "confirm",
@@ -70779,66 +70906,109 @@ var init_c34 = __esm({
70779
70906
  }
70780
70907
  await runFrameworkGenerator(ctx, ["new", ctx.project.name, templateUrl]);
70781
70908
  };
70782
- config4 = {
70909
+ config5 = {
70783
70910
  configVersion: 1,
70784
70911
  id: "gatsby",
70785
70912
  platform: "pages",
70786
70913
  displayName: "Gatsby",
70787
- generate: generate4,
70914
+ generate: generate5,
70788
70915
  transformPackageJson: async () => ({
70789
70916
  scripts: {
70790
- deploy: `${npm3} run build && wrangler pages deploy ./public`,
70791
- preview: `${npm3} run build && wrangler pages dev ./public`
70917
+ deploy: `${npm4} run build && wrangler pages deploy ./public`,
70918
+ preview: `${npm4} run build && wrangler pages dev ./public`
70792
70919
  }
70793
70920
  }),
70794
70921
  devScript: "develop",
70795
70922
  deployScript: "deploy",
70796
70923
  previewScript: "preview"
70797
70924
  };
70798
- c3_default4 = config4;
70925
+ c3_default5 = config5;
70799
70926
  }
70800
70927
  });
70801
70928
 
70802
70929
  // templates/hono/c3.ts
70803
- var c3_exports5 = {};
70804
- __export(c3_exports5, {
70805
- default: () => c3_default5
70930
+ var c3_exports6 = {};
70931
+ __export(c3_exports6, {
70932
+ default: () => c3_default6
70806
70933
  });
70807
- var generate5, config5, c3_default5;
70808
- var init_c35 = __esm({
70934
+ var generate6, configure4, config6, c3_default6;
70935
+ var init_c36 = __esm({
70809
70936
  "templates/hono/c3.ts"() {
70810
70937
  init_cli();
70938
+ init_colors();
70939
+ init_interactive();
70811
70940
  init_frameworks();
70812
- generate5 = async (ctx) => {
70941
+ init_codemod();
70942
+ init_packageManagers();
70943
+ generate6 = async (ctx) => {
70944
+ const { name: pm3 } = detectPackageManager();
70813
70945
  await runFrameworkGenerator(ctx, [
70814
70946
  ctx.project.name,
70815
70947
  "--template",
70816
- "cloudflare-workers"
70948
+ "cloudflare-workers",
70949
+ "--install",
70950
+ "--pm",
70951
+ pm3
70817
70952
  ]);
70818
70953
  logRaw("");
70819
70954
  };
70820
- config5 = {
70955
+ configure4 = async (ctx) => {
70956
+ const indexFile = "src/index.ts";
70957
+ const s = spinner();
70958
+ s.start(`Updating \`${indexFile}\``);
70959
+ const snippets = loadTemplateSnippets(ctx);
70960
+ transformFile(indexFile, {
70961
+ // Insert the env declaration after the last import (but before the rest of the body)
70962
+ visitProgram: function(n2) {
70963
+ const lastImportIndex = n2.node.body.findLastIndex(
70964
+ (t) => t.type === "ImportDeclaration"
70965
+ );
70966
+ const lastImport = n2.get("body", lastImportIndex);
70967
+ lastImport.insertAfter(...snippets.bindingsTypeTs);
70968
+ return this.traverse(n2);
70969
+ },
70970
+ visitVariableDeclarator(n2) {
70971
+ if (n2.node.id.type === "Identifier" && n2.node.id.name === "app") {
70972
+ n2.node.init = snippets.appDeclarationTs[0];
70973
+ return false;
70974
+ }
70975
+ }
70976
+ });
70977
+ s.stop(`${brandColor("updated")} \`${dim(indexFile)}\``);
70978
+ };
70979
+ config6 = {
70821
70980
  configVersion: 1,
70822
70981
  id: "hono",
70823
70982
  displayName: "Hono",
70983
+ copyFiles: {
70984
+ path: "./templates"
70985
+ },
70824
70986
  platform: "workers",
70825
- generate: generate5,
70987
+ generate: generate6,
70988
+ configure: configure4,
70989
+ transformPackageJson: async () => ({
70990
+ scripts: {
70991
+ dev: "wrangler dev",
70992
+ deploy: "wrangler deploy --minify",
70993
+ "cf-typegen": "wrangler types --env-interface CloudflareBindings"
70994
+ }
70995
+ }),
70826
70996
  devScript: "dev",
70827
70997
  deployScript: "deploy"
70828
70998
  };
70829
- c3_default5 = config5;
70999
+ c3_default6 = config6;
70830
71000
  }
70831
71001
  });
70832
71002
 
70833
71003
  // templates/next/c3.ts
70834
- var c3_exports6 = {};
70835
- __export(c3_exports6, {
70836
- default: () => c3_default6,
71004
+ var c3_exports7 = {};
71005
+ __export(c3_exports7, {
71006
+ default: () => c3_default7,
70837
71007
  shouldInstallNextOnPagesEslintPlugin: () => shouldInstallNextOnPagesEslintPlugin,
70838
71008
  writeEslintrc: () => writeEslintrc
70839
71009
  });
70840
- var import_path13, npm4, npx3, generate6, updateNextConfig, configure3, shouldInstallNextOnPagesEslintPlugin, writeEslintrc, addDevDependencies, c3_default6;
70841
- var init_c36 = __esm({
71010
+ var import_path13, npm5, npx3, generate7, updateNextConfig, configure5, shouldInstallNextOnPagesEslintPlugin, writeEslintrc, addDevDependencies, c3_default7;
71011
+ var init_c37 = __esm({
70842
71012
  "templates/next/c3.ts"() {
70843
71013
  import_path13 = require("path");
70844
71014
  init_cli();
@@ -70850,8 +71020,8 @@ var init_c36 = __esm({
70850
71020
  init_packageManagers();
70851
71021
  init_packages();
70852
71022
  init_templates();
70853
- ({ npm: npm4, npx: npx3 } = detectPackageManager());
70854
- generate6 = async (ctx) => {
71023
+ ({ npm: npm5, npx: npx3 } = detectPackageManager());
71024
+ generate7 = async (ctx) => {
70855
71025
  const projectName = ctx.project.name;
70856
71026
  await runFrameworkGenerator(ctx, [projectName]);
70857
71027
  const wranglerToml = readFile((0, import_path13.join)(getTemplatePath(ctx), "wrangler.toml"));
@@ -70884,7 +71054,7 @@ ${$1}`
70884
71054
  writeFile2(configFile, updatedConfigFile);
70885
71055
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
70886
71056
  };
70887
- configure3 = async (ctx) => {
71057
+ configure5 = async (ctx) => {
70888
71058
  const projectPath = ctx.project.path;
70889
71059
  const path4 = probePaths([
70890
71060
  `${projectPath}/pages/api`,
@@ -70958,13 +71128,13 @@ ${$1}`
70958
71128
  doneText: `${brandColor(`installed`)} ${dim(packages.join(", "))}`
70959
71129
  });
70960
71130
  };
70961
- c3_default6 = {
71131
+ c3_default7 = {
70962
71132
  configVersion: 1,
70963
71133
  id: "next",
70964
71134
  platform: "pages",
70965
71135
  displayName: "Next",
70966
- generate: generate6,
70967
- configure: configure3,
71136
+ generate: generate7,
71137
+ configure: configure5,
70968
71138
  copyFiles: {
70969
71139
  async selectVariant(ctx) {
70970
71140
  const isApp = probePaths([
@@ -70995,20 +71165,20 @@ ${$1}`
70995
71165
  }
70996
71166
  },
70997
71167
  transformPackageJson: async (_2, ctx) => {
70998
- const isNpm = npm4 === "npm";
70999
- const isBun = npm4 === "bun";
71168
+ const isNpm = npm5 === "npm";
71169
+ const isBun = npm5 === "bun";
71000
71170
  const isNpmOrBun = isNpm || isBun;
71001
71171
  const nextOnPagesScope = isNpmOrBun ? "@cloudflare/" : "";
71002
71172
  const nextOnPagesCommand = `${nextOnPagesScope}next-on-pages`;
71003
- const pmCommand = isNpmOrBun ? npx3 : npm4;
71173
+ const pmCommand = isNpmOrBun ? npx3 : npm5;
71004
71174
  const pagesBuildRunCommand = `${isNpm ? "npm run" : isBun ? "bun" : pmCommand} pages:build`;
71005
71175
  return {
71006
71176
  scripts: {
71007
71177
  "pages:build": `${pmCommand} ${nextOnPagesCommand}`,
71008
- preview: `${pagesBuildRunCommand} && wrangler pages dev .vercel/output/static`,
71009
- deploy: `${pagesBuildRunCommand} && wrangler pages deploy .vercel/output/static`,
71178
+ preview: `${pagesBuildRunCommand} && wrangler pages dev`,
71179
+ deploy: `${pagesBuildRunCommand} && wrangler pages deploy`,
71010
71180
  ...usesTypescript(ctx) && {
71011
- "build-cf-types": `wrangler types --env-interface CloudflareEnv env.d.ts`
71181
+ "cf-typegen": `wrangler types --env-interface CloudflareEnv env.d.ts`
71012
71182
  }
71013
71183
  }
71014
71184
  };
@@ -71022,12 +71192,12 @@ ${$1}`
71022
71192
  });
71023
71193
 
71024
71194
  // templates/nuxt/c3.ts
71025
- var c3_exports7 = {};
71026
- __export(c3_exports7, {
71027
- default: () => c3_default7
71195
+ var c3_exports8 = {};
71196
+ __export(c3_exports8, {
71197
+ default: () => c3_default8
71028
71198
  });
71029
- var recast3, npm5, pm, generate7, configure4, updateEnvTypes, updateNuxtConfig, config6, c3_default7;
71030
- var init_c37 = __esm({
71199
+ var recast4, npm6, pm2, generate8, configure6, updateEnvTypes2, updateNuxtConfig, config7, c3_default8;
71200
+ var init_c38 = __esm({
71031
71201
  "templates/nuxt/c3.ts"() {
71032
71202
  init_cli();
71033
71203
  init_colors();
@@ -71038,39 +71208,39 @@ var init_c37 = __esm({
71038
71208
  init_files();
71039
71209
  init_packageManagers();
71040
71210
  init_packages();
71041
- recast3 = __toESM(require_main3());
71042
- ({ npm: npm5, name: pm } = detectPackageManager());
71043
- generate7 = async (ctx) => {
71211
+ recast4 = __toESM(require_main3());
71212
+ ({ npm: npm6, name: pm2 } = detectPackageManager());
71213
+ generate8 = async (ctx) => {
71044
71214
  const gitFlag = ctx.args.git ? `--gitInit` : `--no-gitInit`;
71045
71215
  await runFrameworkGenerator(ctx, [
71046
71216
  "init",
71047
71217
  ctx.project.name,
71048
71218
  "--packageManager",
71049
- npm5,
71219
+ npm6,
71050
71220
  gitFlag
71051
71221
  ]);
71052
71222
  writeFile2("./.node-version", "17");
71053
71223
  logRaw("");
71054
71224
  };
71055
- configure4 = async (ctx) => {
71225
+ configure6 = async (ctx) => {
71056
71226
  const packages = ["nitro-cloudflare-dev"];
71057
- if (pm === "pnpm") {
71227
+ if (pm2 === "pnpm") {
71058
71228
  packages.push("h3");
71059
71229
  }
71060
71230
  await installPackages(packages, {
71061
71231
  dev: true,
71062
71232
  startText: "Installing nitro module `nitro-cloudflare-dev`",
71063
- doneText: `${brandColor("installed")} ${dim(`via \`${npm5} install\``)}`
71233
+ doneText: `${brandColor("installed")} ${dim(`via \`${npm6} install\``)}`
71064
71234
  });
71065
71235
  updateNuxtConfig();
71066
- updateEnvTypes(ctx);
71236
+ updateEnvTypes2(ctx);
71067
71237
  };
71068
- updateEnvTypes = (ctx) => {
71238
+ updateEnvTypes2 = (ctx) => {
71069
71239
  const filepath = "env.d.ts";
71070
71240
  const s = spinner();
71071
71241
  s.start(`Updating ${filepath}`);
71072
71242
  let file = readFile(filepath);
71073
- let typesEntrypoint = `@cloudflare/workers-types/`;
71243
+ let typesEntrypoint = `@cloudflare/workers-types`;
71074
71244
  const latestEntrypoint = getLatestTypesEntrypoint(ctx);
71075
71245
  if (latestEntrypoint) {
71076
71246
  typesEntrypoint += `/${latestEntrypoint}`;
@@ -71083,7 +71253,7 @@ var init_c37 = __esm({
71083
71253
  const s = spinner();
71084
71254
  const configFile = "nuxt.config.ts";
71085
71255
  s.start(`Updating \`${configFile}\``);
71086
- const b2 = recast3.types.builders;
71256
+ const b2 = recast4.types.builders;
71087
71257
  const presetDef = b2.objectProperty(
71088
71258
  b2.identifier("nitro"),
71089
71259
  b2.objectExpression([
@@ -71110,7 +71280,7 @@ var init_c37 = __esm({
71110
71280
  });
71111
71281
  s.stop(`${brandColor(`updated`)} ${dim(`\`${configFile}\``)}`);
71112
71282
  };
71113
- config6 = {
71283
+ config7 = {
71114
71284
  configVersion: 1,
71115
71285
  id: "nuxt",
71116
71286
  platform: "pages",
@@ -71118,30 +71288,30 @@ var init_c37 = __esm({
71118
71288
  copyFiles: {
71119
71289
  path: "./templates"
71120
71290
  },
71121
- generate: generate7,
71122
- configure: configure4,
71291
+ generate: generate8,
71292
+ configure: configure6,
71123
71293
  transformPackageJson: async () => ({
71124
71294
  scripts: {
71125
- deploy: `${npm5} run build && wrangler pages deploy ./dist`,
71126
- preview: `${npm5} run build && wrangler pages dev ./dist`,
71127
- "build-cf-types": `wrangler types`
71295
+ deploy: `${npm6} run build && wrangler pages deploy`,
71296
+ preview: `${npm6} run build && wrangler pages dev`,
71297
+ "cf-typegen": `wrangler types`
71128
71298
  }
71129
71299
  }),
71130
71300
  devScript: "dev",
71131
71301
  deployScript: "deploy",
71132
71302
  previewScript: "preview"
71133
71303
  };
71134
- c3_default7 = config6;
71304
+ c3_default8 = config7;
71135
71305
  }
71136
71306
  });
71137
71307
 
71138
71308
  // templates/qwik/c3.ts
71139
- var c3_exports8 = {};
71140
- __export(c3_exports8, {
71141
- default: () => c3_default8
71309
+ var c3_exports9 = {};
71310
+ __export(c3_exports9, {
71311
+ default: () => c3_default9
71142
71312
  });
71143
- var recast4, npm6, npx4, generate8, configure5, addBindingsProxy, populateCloudflareEnv, config7, c3_default8;
71144
- var init_c38 = __esm({
71313
+ var recast5, npm7, npx4, generate9, configure7, addBindingsProxy, populateCloudflareEnv, config8, c3_default9;
71314
+ var init_c39 = __esm({
71145
71315
  "templates/qwik/c3.ts"() {
71146
71316
  init_cli();
71147
71317
  init_colors();
@@ -71151,12 +71321,12 @@ var init_c38 = __esm({
71151
71321
  init_command();
71152
71322
  init_files();
71153
71323
  init_packageManagers();
71154
- recast4 = __toESM(require_main3());
71155
- ({ npm: npm6, npx: npx4 } = detectPackageManager());
71156
- generate8 = async (ctx) => {
71324
+ recast5 = __toESM(require_main3());
71325
+ ({ npm: npm7, npx: npx4 } = detectPackageManager());
71326
+ generate9 = async (ctx) => {
71157
71327
  await runFrameworkGenerator(ctx, ["basic", ctx.project.name]);
71158
71328
  };
71159
- configure5 = async (ctx) => {
71329
+ configure7 = async (ctx) => {
71160
71330
  const cmd = [npx4, "qwik", "add", "cloudflare-pages"];
71161
71331
  endSection(`Running ${quoteShellArgs(cmd)}`);
71162
71332
  await runCommand(cmd);
@@ -71170,7 +71340,7 @@ var init_c38 = __esm({
71170
71340
  const s = spinner();
71171
71341
  s.start("Updating `vite.config.ts`");
71172
71342
  const snippets = loadTemplateSnippets(ctx);
71173
- const b2 = recast4.types.builders;
71343
+ const b2 = recast5.types.builders;
71174
71344
  transformFile("vite.config.ts", {
71175
71345
  // Insert the env declaration after the last import (but before the rest of the body)
71176
71346
  visitProgram: function(n2) {
@@ -71212,7 +71382,7 @@ var init_c38 = __esm({
71212
71382
  s.start(`Updating \`${entrypointPath}\``);
71213
71383
  transformFile(entrypointPath, {
71214
71384
  visitTSInterfaceDeclaration: function(n2) {
71215
- const b2 = recast4.types.builders;
71385
+ const b2 = recast5.types.builders;
71216
71386
  const id = n2.node.id;
71217
71387
  if (id.name !== "QwikCityPlatform") {
71218
71388
  this.traverse(n2);
@@ -71233,7 +71403,7 @@ var init_c38 = __esm({
71233
71403
  });
71234
71404
  s.stop(`${brandColor("updated")} \`${entrypointPath}\``);
71235
71405
  };
71236
- config7 = {
71406
+ config8 = {
71237
71407
  configVersion: 1,
71238
71408
  id: "qwik",
71239
71409
  displayName: "Qwik",
@@ -71241,66 +71411,66 @@ var init_c38 = __esm({
71241
71411
  copyFiles: {
71242
71412
  path: "./templates"
71243
71413
  },
71244
- generate: generate8,
71245
- configure: configure5,
71414
+ generate: generate9,
71415
+ configure: configure7,
71246
71416
  transformPackageJson: async () => ({
71247
71417
  scripts: {
71248
- deploy: `${npm6} run build && wrangler pages deploy ./dist`,
71249
- preview: `${npm6} run build && wrangler pages dev ./dist`,
71250
- "build-cf-types": `wrangler types`
71418
+ deploy: `${npm7} run build && wrangler pages deploy`,
71419
+ preview: `${npm7} run build && wrangler pages dev`,
71420
+ "cf-typegen": `wrangler types`
71251
71421
  }
71252
71422
  }),
71253
71423
  devScript: "dev",
71254
71424
  deployScript: "deploy",
71255
71425
  previewScript: "preview"
71256
71426
  };
71257
- c3_default8 = config7;
71427
+ c3_default9 = config8;
71258
71428
  }
71259
71429
  });
71260
71430
 
71261
71431
  // templates/react/c3.ts
71262
- var c3_exports9 = {};
71263
- __export(c3_exports9, {
71264
- default: () => c3_default9
71432
+ var c3_exports10 = {};
71433
+ __export(c3_exports10, {
71434
+ default: () => c3_default10
71265
71435
  });
71266
- var npm7, generate9, config8, c3_default9;
71267
- var init_c39 = __esm({
71436
+ var npm8, generate10, config9, c3_default10;
71437
+ var init_c310 = __esm({
71268
71438
  "templates/react/c3.ts"() {
71269
71439
  init_cli();
71270
71440
  init_frameworks();
71271
71441
  init_packageManagers();
71272
- ({ npm: npm7 } = detectPackageManager());
71273
- generate9 = async (ctx) => {
71442
+ ({ npm: npm8 } = detectPackageManager());
71443
+ generate10 = async (ctx) => {
71274
71444
  await runFrameworkGenerator(ctx, [ctx.project.name]);
71275
71445
  logRaw("");
71276
71446
  };
71277
- config8 = {
71447
+ config9 = {
71278
71448
  configVersion: 1,
71279
71449
  id: "react",
71280
71450
  displayName: "React",
71281
71451
  platform: "pages",
71282
- generate: generate9,
71452
+ generate: generate10,
71283
71453
  transformPackageJson: async () => ({
71284
71454
  scripts: {
71285
- deploy: `${npm7} run build && wrangler pages deploy ./build`,
71286
- preview: `${npm7} run build && wrangler pages dev ./build`
71455
+ deploy: `${npm8} run build && wrangler pages deploy ./build`,
71456
+ preview: `${npm8} run build && wrangler pages dev ./build`
71287
71457
  }
71288
71458
  }),
71289
71459
  devScript: "dev",
71290
71460
  deployScript: "deploy",
71291
71461
  previewScript: "preview"
71292
71462
  };
71293
- c3_default9 = config8;
71463
+ c3_default10 = config9;
71294
71464
  }
71295
71465
  });
71296
71466
 
71297
71467
  // templates/remix/c3.ts
71298
- var c3_exports10 = {};
71299
- __export(c3_exports10, {
71300
- default: () => c3_default10
71468
+ var c3_exports11 = {};
71469
+ __export(c3_exports11, {
71470
+ default: () => c3_default11
71301
71471
  });
71302
- var npm8, generate10, configure6, config9, c3_default10;
71303
- var init_c310 = __esm({
71472
+ var npm9, generate11, configure8, config10, c3_default11;
71473
+ var init_c311 = __esm({
71304
71474
  "templates/remix/c3.ts"() {
71305
71475
  init_cli();
71306
71476
  init_colors();
@@ -71308,8 +71478,8 @@ var init_c310 = __esm({
71308
71478
  init_frameworks();
71309
71479
  init_codemod();
71310
71480
  init_packageManagers();
71311
- ({ npm: npm8 } = detectPackageManager());
71312
- generate10 = async (ctx) => {
71481
+ ({ npm: npm9 } = detectPackageManager());
71482
+ generate11 = async (ctx) => {
71313
71483
  await runFrameworkGenerator(ctx, [
71314
71484
  ctx.project.name,
71315
71485
  "--template",
@@ -71317,7 +71487,7 @@ var init_c310 = __esm({
71317
71487
  ]);
71318
71488
  logRaw("");
71319
71489
  };
71320
- configure6 = async () => {
71490
+ configure8 = async () => {
71321
71491
  const typeDefsPath = "load-context.ts";
71322
71492
  const s = spinner();
71323
71493
  s.start(`Updating \`${typeDefsPath}\``);
@@ -71332,7 +71502,7 @@ var init_c310 = __esm({
71332
71502
  });
71333
71503
  s.stop(`${brandColor("updated")} \`${dim(typeDefsPath)}\``);
71334
71504
  };
71335
- config9 = {
71505
+ config10 = {
71336
71506
  configVersion: 1,
71337
71507
  id: "remix",
71338
71508
  platform: "pages",
@@ -71340,45 +71510,44 @@ var init_c310 = __esm({
71340
71510
  copyFiles: {
71341
71511
  path: "./templates"
71342
71512
  },
71343
- generate: generate10,
71344
- configure: configure6,
71513
+ generate: generate11,
71514
+ configure: configure8,
71345
71515
  transformPackageJson: async () => ({
71346
71516
  scripts: {
71347
- deploy: `${npm8} run build && wrangler pages deploy ./build/client`,
71348
- preview: `${npm8} run build && wrangler pages dev ./build/client`,
71349
- "build-cf-types": `wrangler types`
71517
+ deploy: `${npm9} run build && wrangler pages deploy`,
71518
+ preview: `${npm9} run build && wrangler pages dev`,
71519
+ "cf-typegen": `wrangler types`
71350
71520
  }
71351
71521
  }),
71352
71522
  devScript: "dev",
71353
71523
  deployScript: "deploy",
71354
71524
  previewScript: "preview"
71355
71525
  };
71356
- c3_default10 = config9;
71526
+ c3_default11 = config10;
71357
71527
  }
71358
71528
  });
71359
71529
 
71360
71530
  // templates/solid/c3.ts
71361
- var c3_exports11 = {};
71362
- __export(c3_exports11, {
71363
- default: () => c3_default11
71531
+ var c3_exports12 = {};
71532
+ __export(c3_exports12, {
71533
+ default: () => c3_default12
71364
71534
  });
71365
- var recast5, npm9, generate11, configure7, config10, c3_default11;
71366
- var init_c311 = __esm({
71535
+ var recast6, npm10, generate12, configure9, config11, c3_default12;
71536
+ var init_c312 = __esm({
71367
71537
  "templates/solid/c3.ts"() {
71368
71538
  init_cli();
71369
71539
  init_colors();
71370
71540
  init_frameworks();
71371
71541
  init_codemod();
71372
- init_compatDate();
71373
71542
  init_files();
71374
71543
  init_packageManagers();
71375
- recast5 = __toESM(require_main3());
71376
- ({ npm: npm9 } = detectPackageManager());
71377
- generate11 = async (ctx) => {
71544
+ recast6 = __toESM(require_main3());
71545
+ ({ npm: npm10 } = detectPackageManager());
71546
+ generate12 = async (ctx) => {
71378
71547
  await runFrameworkGenerator(ctx, ["-p", ctx.project.name, "-s"]);
71379
71548
  logRaw("");
71380
71549
  };
71381
- configure7 = async (ctx) => {
71550
+ configure9 = async (ctx) => {
71382
71551
  usesTypescript(ctx);
71383
71552
  const filePath = `app.config.${usesTypescript(ctx) ? "ts" : "js"}`;
71384
71553
  updateStatus(`Updating configuration in ${blue(filePath)}`);
@@ -71388,7 +71557,7 @@ var init_c311 = __esm({
71388
71557
  if (callee.name !== "defineConfig") {
71389
71558
  return this.traverse(n2);
71390
71559
  }
71391
- const b2 = recast5.types.builders;
71560
+ const b2 = recast6.types.builders;
71392
71561
  n2.node.arguments = [
71393
71562
  b2.objectExpression([
71394
71563
  b2.objectProperty(
@@ -71415,17 +71584,20 @@ var init_c311 = __esm({
71415
71584
  }
71416
71585
  });
71417
71586
  };
71418
- config10 = {
71587
+ config11 = {
71419
71588
  configVersion: 1,
71420
71589
  id: "solid",
71421
71590
  displayName: "Solid",
71422
71591
  platform: "pages",
71423
- generate: generate11,
71424
- configure: configure7,
71592
+ copyFiles: {
71593
+ path: "./templates"
71594
+ },
71595
+ generate: generate12,
71596
+ configure: configure9,
71425
71597
  transformPackageJson: async () => ({
71426
71598
  scripts: {
71427
- preview: `${npm9} run build && npx wrangler pages dev dist ${await compatDateFlag()} --compatibility-flag nodejs_compat`,
71428
- deploy: `${npm9} run build && wrangler pages deploy ./dist`
71599
+ preview: `${npm10} run build && npx wrangler pages dev`,
71600
+ deploy: `${npm10} run build && wrangler pages deploy`
71429
71601
  }
71430
71602
  }),
71431
71603
  compatibilityFlags: ["nodejs_compat"],
@@ -71433,17 +71605,17 @@ var init_c311 = __esm({
71433
71605
  deployScript: "deploy",
71434
71606
  previewScript: "preview"
71435
71607
  };
71436
- c3_default11 = config10;
71608
+ c3_default12 = config11;
71437
71609
  }
71438
71610
  });
71439
71611
 
71440
71612
  // templates/svelte/c3.ts
71441
- var c3_exports12 = {};
71442
- __export(c3_exports12, {
71443
- default: () => c3_default12
71613
+ var c3_exports13 = {};
71614
+ __export(c3_exports13, {
71615
+ default: () => c3_default13
71444
71616
  });
71445
- var import_node_os, recast6, npm10, generate12, configure8, updateSvelteConfig, updateTypeDefinitions, config11, c3_default12;
71446
- var init_c312 = __esm({
71617
+ var import_node_os, recast7, npm11, generate13, configure10, updateSvelteConfig, updateTypeDefinitions, config12, c3_default13;
71618
+ var init_c313 = __esm({
71447
71619
  "templates/svelte/c3.ts"() {
71448
71620
  import_node_os = require("node:os");
71449
71621
  init_cli();
@@ -71453,13 +71625,13 @@ var init_c312 = __esm({
71453
71625
  init_files();
71454
71626
  init_packageManagers();
71455
71627
  init_packages();
71456
- recast6 = __toESM(require_main3());
71457
- ({ npm: npm10 } = detectPackageManager());
71458
- generate12 = async (ctx) => {
71628
+ recast7 = __toESM(require_main3());
71629
+ ({ npm: npm11 } = detectPackageManager());
71630
+ generate13 = async (ctx) => {
71459
71631
  await runFrameworkGenerator(ctx, [ctx.project.name]);
71460
71632
  logRaw("");
71461
71633
  };
71462
- configure8 = async (ctx) => {
71634
+ configure10 = async (ctx) => {
71463
71635
  const pkg = `@sveltejs/adapter-cloudflare`;
71464
71636
  await installPackages([pkg], {
71465
71637
  dev: true,
@@ -71486,7 +71658,7 @@ var init_c312 = __esm({
71486
71658
  return;
71487
71659
  }
71488
71660
  updateStatus(`Updating global type definitions in ${blue("app.d.ts")}`);
71489
- const b2 = recast6.types.builders;
71661
+ const b2 = recast7.types.builders;
71490
71662
  transformFile("src/app.d.ts", {
71491
71663
  visitTSModuleDeclaration(n2) {
71492
71664
  if (n2.value.id.name === "App" && n2.node.body) {
@@ -71518,7 +71690,7 @@ var init_c312 = __esm({
71518
71690
  }
71519
71691
  });
71520
71692
  };
71521
- config11 = {
71693
+ config12 = {
71522
71694
  configVersion: 1,
71523
71695
  id: "svelte",
71524
71696
  displayName: "Svelte",
@@ -71529,18 +71701,18 @@ var init_c312 = __esm({
71529
71701
  ts: { path: "./ts" }
71530
71702
  }
71531
71703
  },
71532
- generate: generate12,
71533
- configure: configure8,
71704
+ generate: generate13,
71705
+ configure: configure10,
71534
71706
  transformPackageJson: async (original, ctx) => {
71535
71707
  let scripts = {
71536
- preview: `${npm10} run build && wrangler pages dev .svelte-kit/cloudflare`,
71537
- deploy: `${npm10} run build && wrangler pages deploy .svelte-kit/cloudflare`
71708
+ preview: `${npm11} run build && wrangler pages dev`,
71709
+ deploy: `${npm11} run build && wrangler pages deploy`
71538
71710
  };
71539
71711
  if (usesTypescript(ctx)) {
71540
71712
  const mv = (0, import_node_os.platform)() === "win32" ? "move" : "mv";
71541
71713
  scripts = {
71542
71714
  ...scripts,
71543
- "build-cf-types": `wrangler types && ${mv} worker-configuration.d.ts src/`
71715
+ "cf-typegen": `wrangler types && ${mv} worker-configuration.d.ts src/`
71544
71716
  };
71545
71717
  }
71546
71718
  return { scripts };
@@ -71549,53 +71721,53 @@ var init_c312 = __esm({
71549
71721
  deployScript: "deploy",
71550
71722
  previewScript: "preview"
71551
71723
  };
71552
- c3_default12 = config11;
71724
+ c3_default13 = config12;
71553
71725
  }
71554
71726
  });
71555
71727
 
71556
71728
  // templates/vue/c3.ts
71557
- var c3_exports13 = {};
71558
- __export(c3_exports13, {
71559
- default: () => c3_default13
71729
+ var c3_exports14 = {};
71730
+ __export(c3_exports14, {
71731
+ default: () => c3_default14
71560
71732
  });
71561
- var npm11, generate13, config12, c3_default13;
71562
- var init_c313 = __esm({
71733
+ var npm12, generate14, config13, c3_default14;
71734
+ var init_c314 = __esm({
71563
71735
  "templates/vue/c3.ts"() {
71564
71736
  init_frameworks();
71565
71737
  init_packageManagers();
71566
- ({ npm: npm11 } = detectPackageManager());
71567
- generate13 = async (ctx) => {
71738
+ ({ npm: npm12 } = detectPackageManager());
71739
+ generate14 = async (ctx) => {
71568
71740
  await runFrameworkGenerator(ctx, [ctx.project.name]);
71569
71741
  };
71570
- config12 = {
71742
+ config13 = {
71571
71743
  configVersion: 1,
71572
71744
  id: "vue",
71573
71745
  displayName: "Vue",
71574
71746
  platform: "pages",
71575
- generate: generate13,
71747
+ generate: generate14,
71576
71748
  transformPackageJson: async () => ({
71577
71749
  scripts: {
71578
- deploy: `${npm11} run build && wrangler pages deploy ./dist`,
71579
- preview: `${npm11} run build && wrangler pages dev ./dist`
71750
+ deploy: `${npm12} run build && wrangler pages deploy ./dist`,
71751
+ preview: `${npm12} run build && wrangler pages dev ./dist`
71580
71752
  }
71581
71753
  }),
71582
71754
  devScript: "dev",
71583
71755
  deployScript: "deploy",
71584
71756
  previewScript: "preview"
71585
71757
  };
71586
- c3_default13 = config12;
71758
+ c3_default14 = config13;
71587
71759
  }
71588
71760
  });
71589
71761
 
71590
71762
  // templates/hello-world/c3.ts
71591
- var c3_exports14 = {};
71592
- __export(c3_exports14, {
71593
- default: () => c3_default14
71763
+ var c3_exports15 = {};
71764
+ __export(c3_exports15, {
71765
+ default: () => c3_default15
71594
71766
  });
71595
- var c3_default14;
71596
- var init_c314 = __esm({
71767
+ var c3_default15;
71768
+ var init_c315 = __esm({
71597
71769
  "templates/hello-world/c3.ts"() {
71598
- c3_default14 = {
71770
+ c3_default15 = {
71599
71771
  configVersion: 1,
71600
71772
  id: "hello-world",
71601
71773
  displayName: '"Hello World" Worker',
@@ -71615,14 +71787,14 @@ var init_c314 = __esm({
71615
71787
  });
71616
71788
 
71617
71789
  // templates/hello-world-python/c3.ts
71618
- var c3_exports15 = {};
71619
- __export(c3_exports15, {
71620
- default: () => c3_default15
71790
+ var c3_exports16 = {};
71791
+ __export(c3_exports16, {
71792
+ default: () => c3_default16
71621
71793
  });
71622
- var c3_default15;
71623
- var init_c315 = __esm({
71794
+ var c3_default16;
71795
+ var init_c316 = __esm({
71624
71796
  "templates/hello-world-python/c3.ts"() {
71625
- c3_default15 = {
71797
+ c3_default16 = {
71626
71798
  configVersion: 1,
71627
71799
  id: "hello-world-python",
71628
71800
  displayName: '"Hello World" Worker (Python)',
@@ -71635,14 +71807,14 @@ var init_c315 = __esm({
71635
71807
  });
71636
71808
 
71637
71809
  // templates/hello-world-durable-object/c3.ts
71638
- var c3_exports16 = {};
71639
- __export(c3_exports16, {
71640
- default: () => c3_default16
71810
+ var c3_exports17 = {};
71811
+ __export(c3_exports17, {
71812
+ default: () => c3_default17
71641
71813
  });
71642
- var c3_default16;
71643
- var init_c316 = __esm({
71814
+ var c3_default17;
71815
+ var init_c317 = __esm({
71644
71816
  "templates/hello-world-durable-object/c3.ts"() {
71645
- c3_default16 = {
71817
+ c3_default17 = {
71646
71818
  configVersion: 1,
71647
71819
  id: "hello-world-durable-object",
71648
71820
  displayName: '"Hello World" Durable Object',
@@ -71662,14 +71834,14 @@ var init_c316 = __esm({
71662
71834
  });
71663
71835
 
71664
71836
  // templates/common/c3.ts
71665
- var c3_exports17 = {};
71666
- __export(c3_exports17, {
71667
- default: () => c3_default17
71837
+ var c3_exports18 = {};
71838
+ __export(c3_exports18, {
71839
+ default: () => c3_default18
71668
71840
  });
71669
- var c3_default17;
71670
- var init_c317 = __esm({
71841
+ var c3_default18;
71842
+ var init_c318 = __esm({
71671
71843
  "templates/common/c3.ts"() {
71672
- c3_default17 = {
71844
+ c3_default18 = {
71673
71845
  configVersion: 1,
71674
71846
  id: "common",
71675
71847
  displayName: "Example router & proxy Worker",
@@ -71689,14 +71861,14 @@ var init_c317 = __esm({
71689
71861
  });
71690
71862
 
71691
71863
  // templates/scheduled/c3.ts
71692
- var c3_exports18 = {};
71693
- __export(c3_exports18, {
71694
- default: () => c3_default18
71864
+ var c3_exports19 = {};
71865
+ __export(c3_exports19, {
71866
+ default: () => c3_default19
71695
71867
  });
71696
- var c3_default18;
71697
- var init_c318 = __esm({
71868
+ var c3_default19;
71869
+ var init_c319 = __esm({
71698
71870
  "templates/scheduled/c3.ts"() {
71699
- c3_default18 = {
71871
+ c3_default19 = {
71700
71872
  configVersion: 1,
71701
71873
  id: "scheduled",
71702
71874
  displayName: "Scheduled Worker (Cron Trigger)",
@@ -71716,14 +71888,14 @@ var init_c318 = __esm({
71716
71888
  });
71717
71889
 
71718
71890
  // templates/queues/c3.ts
71719
- var c3_exports19 = {};
71720
- __export(c3_exports19, {
71721
- default: () => c3_default19
71891
+ var c3_exports20 = {};
71892
+ __export(c3_exports20, {
71893
+ default: () => c3_default20
71722
71894
  });
71723
- var c3_default19;
71724
- var init_c319 = __esm({
71895
+ var c3_default20;
71896
+ var init_c320 = __esm({
71725
71897
  "templates/queues/c3.ts"() {
71726
- c3_default19 = {
71898
+ c3_default20 = {
71727
71899
  configVersion: 1,
71728
71900
  id: "queues",
71729
71901
  displayName: "Queue consumer & producer Worker",
@@ -71753,14 +71925,14 @@ var init_c319 = __esm({
71753
71925
  });
71754
71926
 
71755
71927
  // templates/openapi/c3.ts
71756
- var c3_exports20 = {};
71757
- __export(c3_exports20, {
71758
- default: () => c3_default20
71928
+ var c3_exports21 = {};
71929
+ __export(c3_exports21, {
71930
+ default: () => c3_default21
71759
71931
  });
71760
- var c3_default20;
71761
- var init_c320 = __esm({
71932
+ var c3_default21;
71933
+ var init_c321 = __esm({
71762
71934
  "templates/openapi/c3.ts"() {
71763
- c3_default20 = {
71935
+ c3_default21 = {
71764
71936
  configVersion: 1,
71765
71937
  id: "openapi",
71766
71938
  displayName: "API starter (OpenAPI compliant)",
@@ -71773,10 +71945,10 @@ var init_c320 = __esm({
71773
71945
  });
71774
71946
 
71775
71947
  // templates/pre-existing/c3.ts
71776
- var c3_exports21 = {};
71777
- __export(c3_exports21, {
71948
+ var c3_exports22 = {};
71949
+ __export(c3_exports22, {
71778
71950
  copyExistingWorkerFiles: () => copyExistingWorkerFiles,
71779
- default: () => c3_default21
71951
+ default: () => c3_default22
71780
71952
  });
71781
71953
  async function copyExistingWorkerFiles(ctx) {
71782
71954
  const { dlx } = detectPackageManager();
@@ -71825,8 +71997,8 @@ async function copyExistingWorkerFiles(ctx) {
71825
71997
  (0, import_path14.join)(ctx.project.path, "wrangler.toml")
71826
71998
  );
71827
71999
  }
71828
- var import_promises, import_os, import_path14, c3_default21;
71829
- var init_c321 = __esm({
72000
+ var import_promises, import_os, import_path14, c3_default22;
72001
+ var init_c322 = __esm({
71830
72002
  "templates/pre-existing/c3.ts"() {
71831
72003
  import_promises = require("fs/promises");
71832
72004
  import_os = require("os");
@@ -71836,7 +72008,7 @@ var init_c321 = __esm({
71836
72008
  init_command();
71837
72009
  init_packageManagers();
71838
72010
  init_accounts();
71839
- c3_default21 = {
72011
+ c3_default22 = {
71840
72012
  configVersion: 1,
71841
72013
  id: "pre-existing",
71842
72014
  displayName: "Pre-existing Worker (from Dashboard)",
@@ -71900,36 +72072,37 @@ var init_templates = __esm({
71900
72072
  return typescript ? "ts" : "js";
71901
72073
  };
71902
72074
  getFrameworkMap = async () => ({
71903
- angular: (await Promise.resolve().then(() => (init_c3(), c3_exports))).default,
71904
- astro: (await Promise.resolve().then(() => (init_c32(), c3_exports2))).default,
71905
- docusaurus: (await Promise.resolve().then(() => (init_c33(), c3_exports3))).default,
71906
- gatsby: (await Promise.resolve().then(() => (init_c34(), c3_exports4))).default,
71907
- hono: (await Promise.resolve().then(() => (init_c35(), c3_exports5))).default,
71908
- next: (await Promise.resolve().then(() => (init_c36(), c3_exports6))).default,
71909
- nuxt: (await Promise.resolve().then(() => (init_c37(), c3_exports7))).default,
71910
- qwik: (await Promise.resolve().then(() => (init_c38(), c3_exports8))).default,
71911
- react: (await Promise.resolve().then(() => (init_c39(), c3_exports9))).default,
71912
- remix: (await Promise.resolve().then(() => (init_c310(), c3_exports10))).default,
71913
- solid: (await Promise.resolve().then(() => (init_c311(), c3_exports11))).default,
71914
- svelte: (await Promise.resolve().then(() => (init_c312(), c3_exports12))).default,
71915
- vue: (await Promise.resolve().then(() => (init_c313(), c3_exports13))).default
72075
+ analog: (await Promise.resolve().then(() => (init_c3(), c3_exports))).default,
72076
+ angular: (await Promise.resolve().then(() => (init_c32(), c3_exports2))).default,
72077
+ astro: (await Promise.resolve().then(() => (init_c33(), c3_exports3))).default,
72078
+ docusaurus: (await Promise.resolve().then(() => (init_c34(), c3_exports4))).default,
72079
+ gatsby: (await Promise.resolve().then(() => (init_c35(), c3_exports5))).default,
72080
+ hono: (await Promise.resolve().then(() => (init_c36(), c3_exports6))).default,
72081
+ next: (await Promise.resolve().then(() => (init_c37(), c3_exports7))).default,
72082
+ nuxt: (await Promise.resolve().then(() => (init_c38(), c3_exports8))).default,
72083
+ qwik: (await Promise.resolve().then(() => (init_c39(), c3_exports9))).default,
72084
+ react: (await Promise.resolve().then(() => (init_c310(), c3_exports10))).default,
72085
+ remix: (await Promise.resolve().then(() => (init_c311(), c3_exports11))).default,
72086
+ solid: (await Promise.resolve().then(() => (init_c312(), c3_exports12))).default,
72087
+ svelte: (await Promise.resolve().then(() => (init_c313(), c3_exports13))).default,
72088
+ vue: (await Promise.resolve().then(() => (init_c314(), c3_exports14))).default
71916
72089
  });
71917
72090
  getTemplateMap = async () => {
71918
72091
  return {
71919
- "hello-world": (await Promise.resolve().then(() => (init_c314(), c3_exports14))).default,
71920
- "hello-world-python": (await Promise.resolve().then(() => (init_c315(), c3_exports15))).default,
71921
- "hello-world-durable-object": (await Promise.resolve().then(() => (init_c316(), c3_exports16))).default,
72092
+ "hello-world": (await Promise.resolve().then(() => (init_c315(), c3_exports15))).default,
72093
+ "hello-world-python": (await Promise.resolve().then(() => (init_c316(), c3_exports16))).default,
72094
+ "hello-world-durable-object": (await Promise.resolve().then(() => (init_c317(), c3_exports17))).default,
71922
72095
  // Dummy record -- actual template config resolved in `selectFramework`
71923
72096
  "web-framework": { displayName: "Website or web app" },
71924
- common: (await Promise.resolve().then(() => (init_c317(), c3_exports17))).default,
71925
- scheduled: (await Promise.resolve().then(() => (init_c318(), c3_exports18))).default,
71926
- queues: (await Promise.resolve().then(() => (init_c319(), c3_exports19))).default,
71927
- openapi: (await Promise.resolve().then(() => (init_c320(), c3_exports20))).default,
72097
+ common: (await Promise.resolve().then(() => (init_c318(), c3_exports18))).default,
72098
+ scheduled: (await Promise.resolve().then(() => (init_c319(), c3_exports19))).default,
72099
+ queues: (await Promise.resolve().then(() => (init_c320(), c3_exports20))).default,
72100
+ openapi: (await Promise.resolve().then(() => (init_c321(), c3_exports21))).default,
71928
72101
  // Dummy record -- actual template config resolved in `processRemoteTemplate`
71929
72102
  "remote-template": {
71930
72103
  displayName: "Worker built from a template hosted in a git repository"
71931
72104
  },
71932
- "pre-existing": (await Promise.resolve().then(() => (init_c321(), c3_exports21))).default
72105
+ "pre-existing": (await Promise.resolve().then(() => (init_c322(), c3_exports22))).default
71933
72106
  };
71934
72107
  };
71935
72108
  selectTemplate = async (args) => {
@@ -71980,8 +72153,8 @@ var init_templates = __esm({
71980
72153
  selectFramework = async (args) => {
71981
72154
  const frameworkMap = await getFrameworkMap();
71982
72155
  const frameworkOptions = Object.entries(frameworkMap).map(
71983
- ([key, config13]) => ({
71984
- label: config13.displayName,
72156
+ ([key, config14]) => ({
72157
+ label: config14.displayName,
71985
72158
  value: key
71986
72159
  })
71987
72160
  );
@@ -72030,27 +72203,27 @@ var init_templates = __esm({
72030
72203
  defaultValue: C3_DEFAULTS.template
72031
72204
  });
72032
72205
  const path4 = await downloadRemoteTemplate(templateUrl);
72033
- const config13 = inferTemplateConfig(path4);
72034
- validateTemplate(path4, config13);
72206
+ const config14 = inferTemplateConfig(path4);
72207
+ validateTemplate(path4, config14);
72035
72208
  return {
72036
72209
  path: path4,
72037
- ...config13
72210
+ ...config14
72038
72211
  };
72039
72212
  };
72040
- validateTemplate = (path4, config13) => {
72041
- if (!config13.copyFiles) {
72213
+ validateTemplate = (path4, config14) => {
72214
+ if (!config14.copyFiles) {
72042
72215
  return;
72043
72216
  }
72044
- if (isVariantInfo(config13.copyFiles)) {
72045
- validateTemplateSrcDirectory((0, import_path15.resolve)(path4, config13.copyFiles.path), config13);
72217
+ if (isVariantInfo(config14.copyFiles)) {
72218
+ validateTemplateSrcDirectory((0, import_path15.resolve)(path4, config14.copyFiles.path), config14);
72046
72219
  } else {
72047
- for (const variant of Object.values(config13.copyFiles.variants)) {
72048
- validateTemplateSrcDirectory((0, import_path15.resolve)(path4, variant.path), config13);
72220
+ for (const variant of Object.values(config14.copyFiles.variants)) {
72221
+ validateTemplateSrcDirectory((0, import_path15.resolve)(path4, variant.path), config14);
72049
72222
  }
72050
72223
  }
72051
72224
  };
72052
- validateTemplateSrcDirectory = (path4, config13) => {
72053
- if (config13.platform === "workers") {
72225
+ validateTemplateSrcDirectory = (path4, config14) => {
72226
+ if (config14.platform === "workers") {
72054
72227
  const wranglerTomlPath = (0, import_path15.resolve)(path4, "wrangler.toml");
72055
72228
  if (!(0, import_fs12.existsSync)(wranglerTomlPath)) {
72056
72229
  crash(`create-cloudflare templates must contain a "wrangler.toml" file.`);
@@ -73100,23 +73273,23 @@ var YargsParser = class {
73100
73273
  const configPath = argv2[configKey] || configLookup[configKey];
73101
73274
  if (configPath) {
73102
73275
  try {
73103
- let config13 = null;
73276
+ let config14 = null;
73104
73277
  const resolvedConfigPath = mixin2.resolve(mixin2.cwd(), configPath);
73105
73278
  const resolveConfig = flags.configs[configKey];
73106
73279
  if (typeof resolveConfig === "function") {
73107
73280
  try {
73108
- config13 = resolveConfig(resolvedConfigPath);
73281
+ config14 = resolveConfig(resolvedConfigPath);
73109
73282
  } catch (e) {
73110
- config13 = e;
73283
+ config14 = e;
73111
73284
  }
73112
- if (config13 instanceof Error) {
73113
- error2 = config13;
73285
+ if (config14 instanceof Error) {
73286
+ error2 = config14;
73114
73287
  return;
73115
73288
  }
73116
73289
  } else {
73117
- config13 = mixin2.require(resolvedConfigPath);
73290
+ config14 = mixin2.require(resolvedConfigPath);
73118
73291
  }
73119
- setConfigObject(config13);
73292
+ setConfigObject(config14);
73120
73293
  } catch (ex) {
73121
73294
  if (ex.name === "PermissionDenied")
73122
73295
  error2 = ex;
@@ -73126,9 +73299,9 @@ var YargsParser = class {
73126
73299
  }
73127
73300
  });
73128
73301
  }
73129
- function setConfigObject(config13, prev) {
73130
- Object.keys(config13).forEach(function(key) {
73131
- const value = config13[key];
73302
+ function setConfigObject(config14, prev) {
73303
+ Object.keys(config14).forEach(function(key) {
73304
+ const value = config14[key];
73132
73305
  const fullKey = prev ? prev + "." + key : key;
73133
73306
  if (typeof value === "object" && value !== null && !Array.isArray(value) && configuration["dot-notation"]) {
73134
73307
  setConfigObject(value, fullKey);
@@ -74280,11 +74453,11 @@ var CommandInstance = class {
74280
74453
  });
74281
74454
  if (!unparsed.length)
74282
74455
  return;
74283
- const config13 = Object.assign({}, options.configuration, {
74456
+ const config14 = Object.assign({}, options.configuration, {
74284
74457
  "populate--": false
74285
74458
  });
74286
74459
  const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
74287
- configuration: config13
74460
+ configuration: config14
74288
74461
  }));
74289
74462
  if (parsed.error) {
74290
74463
  yargs.getInternalMethods().getUsageInstance().fail(parsed.error.message, parsed.error);
@@ -75506,31 +75679,31 @@ ${customMsgs.join("\n")}` : "";
75506
75679
  // ../../node_modules/.pnpm/yargs@17.7.1/node_modules/yargs/build/lib/utils/apply-extends.js
75507
75680
  var previouslyVisitedConfigs = [];
75508
75681
  var shim2;
75509
- function applyExtends(config13, cwd, mergeExtends, _shim) {
75682
+ function applyExtends(config14, cwd, mergeExtends, _shim) {
75510
75683
  shim2 = _shim;
75511
75684
  let defaultConfig = {};
75512
- if (Object.prototype.hasOwnProperty.call(config13, "extends")) {
75513
- if (typeof config13.extends !== "string")
75685
+ if (Object.prototype.hasOwnProperty.call(config14, "extends")) {
75686
+ if (typeof config14.extends !== "string")
75514
75687
  return defaultConfig;
75515
- const isPath = /\.json|\..*rc$/.test(config13.extends);
75688
+ const isPath = /\.json|\..*rc$/.test(config14.extends);
75516
75689
  let pathToDefault = null;
75517
75690
  if (!isPath) {
75518
75691
  try {
75519
- pathToDefault = require.resolve(config13.extends);
75692
+ pathToDefault = require.resolve(config14.extends);
75520
75693
  } catch (_err) {
75521
- return config13;
75694
+ return config14;
75522
75695
  }
75523
75696
  } else {
75524
- pathToDefault = getPathToDefaultConfig(cwd, config13.extends);
75697
+ pathToDefault = getPathToDefaultConfig(cwd, config14.extends);
75525
75698
  }
75526
75699
  checkForCircularExtends(pathToDefault);
75527
75700
  previouslyVisitedConfigs.push(pathToDefault);
75528
- defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config13.extends);
75529
- delete config13.extends;
75701
+ defaultConfig = isPath ? JSON.parse(shim2.readFileSync(pathToDefault, "utf8")) : require(config14.extends);
75702
+ delete config14.extends;
75530
75703
  defaultConfig = applyExtends(defaultConfig, shim2.path.dirname(pathToDefault), mergeExtends, shim2);
75531
75704
  }
75532
75705
  previouslyVisitedConfigs = [];
75533
- return mergeExtends ? mergeDeep(defaultConfig, config13) : Object.assign({}, defaultConfig, config13);
75706
+ return mergeExtends ? mergeDeep(defaultConfig, config14) : Object.assign({}, defaultConfig, config14);
75534
75707
  }
75535
75708
  function checkForCircularExtends(cfgPath) {
75536
75709
  if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
@@ -76311,9 +76484,9 @@ var YargsInstance = class {
76311
76484
  }
76312
76485
  return maybePromise;
76313
76486
  }
76314
- parserConfiguration(config13) {
76315
- argsert("<object>", [config13], arguments.length);
76316
- __classPrivateFieldSet(this, _YargsInstance_parserConfig, config13, "f");
76487
+ parserConfiguration(config14) {
76488
+ argsert("<object>", [config14], arguments.length);
76489
+ __classPrivateFieldSet(this, _YargsInstance_parserConfig, config14, "f");
76317
76490
  return this;
76318
76491
  }
76319
76492
  pkgConf(key, rootPath) {
@@ -76485,9 +76658,9 @@ var YargsInstance = class {
76485
76658
  return this;
76486
76659
  }
76487
76660
  }
76488
- usageConfiguration(config13) {
76489
- argsert("<object>", [config13], arguments.length);
76490
- __classPrivateFieldSet(this, _YargsInstance_usageConfig, config13, "f");
76661
+ usageConfiguration(config14) {
76662
+ argsert("<object>", [config14], arguments.length);
76663
+ __classPrivateFieldSet(this, _YargsInstance_usageConfig, config14, "f");
76491
76664
  return this;
76492
76665
  }
76493
76666
  version(opt, msg, ver) {
@@ -76893,11 +77066,11 @@ var YargsInstance = class {
76893
77066
  __classPrivateFieldGet(this, _YargsInstance_options, "f").__ = __classPrivateFieldGet(this, _YargsInstance_shim, "f").y18n.__;
76894
77067
  __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration = this[kGetParserConfiguration]();
76895
77068
  const populateDoubleDash = !!__classPrivateFieldGet(this, _YargsInstance_options, "f").configuration["populate--"];
76896
- const config13 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
77069
+ const config14 = Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f").configuration, {
76897
77070
  "populate--": true
76898
77071
  });
76899
77072
  const parsed = __classPrivateFieldGet(this, _YargsInstance_shim, "f").Parser.detailed(args, Object.assign({}, __classPrivateFieldGet(this, _YargsInstance_options, "f"), {
76900
- configuration: { "parse-positional-numbers": false, ...config13 }
77073
+ configuration: { "parse-positional-numbers": false, ...config14 }
76901
77074
  }));
76902
77075
  const argv = Object.assign(parsed.argv, __classPrivateFieldGet(this, _YargsInstance_parseContext, "f"));
76903
77076
  let argvPromise = void 0;
@@ -77334,15 +77507,15 @@ var showHelp = ({
77334
77507
  options,
77335
77508
  intro
77336
77509
  }) => {
77337
- const { name: pm2 } = detectPackageManager();
77510
+ const { name: pm3 } = detectPackageManager();
77338
77511
  logRaw(`${brandColor("create-cloudflare")} ${dim("v" + version)}
77339
77512
  `);
77340
77513
  indent(`${intro.trim()}
77341
77514
  `, 1);
77342
77515
  logRaw(bold("USAGE\n"));
77343
- const latest = pm2 === "yarn" ? "" : "@latest";
77344
- const opts = pm2 === "npm" ? "-- options" : "options";
77345
- indent(`${pm2} create cloudflare${latest} [directory] [${opts}]
77516
+ const latest = pm3 === "yarn" ? "" : "@latest";
77517
+ const opts = pm3 === "npm" ? "-- options" : "options";
77518
+ indent(`${pm3} create cloudflare${latest} [directory] [${opts}]
77346
77519
  `, 1);
77347
77520
  logRaw(bold("OPTIONS\n"));
77348
77521
  renderPositionals(positionals);
@@ -77471,6 +77644,7 @@ var cliDefinition = {
77471
77644
  pnpm create clouldfare --framework next -- --ts
77472
77645
  `,
77473
77646
  values: [
77647
+ { name: "analog" },
77474
77648
  { name: "angular" },
77475
77649
  { name: "astro" },
77476
77650
  { name: "docusaurus" },
@@ -77671,7 +77845,7 @@ init_command();
77671
77845
  init_packageManagers();
77672
77846
 
77673
77847
  // ../wrangler/package.json
77674
- var version2 = "3.48.0";
77848
+ var version2 = "3.51.2";
77675
77849
 
77676
77850
  // src/git.ts
77677
77851
  init_package();
@@ -78966,7 +79140,7 @@ var writeWranglerToml = (ctx, contents) => {
78966
79140
 
78967
79141
  // src/deploy.ts
78968
79142
  var offerToDeploy = async (ctx) => {
78969
- const { npm: npm13 } = detectPackageManager();
79143
+ const { npm: npm14 } = detectPackageManager();
78970
79144
  startSection(`Deploy with Cloudflare`, `Step 3 of 3`);
78971
79145
  if (!await isDeployable(ctx)) {
78972
79146
  ctx.args.deploy = false;
@@ -78977,7 +79151,7 @@ var offerToDeploy = async (ctx) => {
78977
79151
  );
78978
79152
  }
78979
79153
  const label = `deploy via \`${quoteShellArgs([
78980
- npm13,
79154
+ npm14,
78981
79155
  "run",
78982
79156
  ctx.template.deployScript ?? "deploy"
78983
79157
  ])}\``;
@@ -79008,18 +79182,18 @@ var isDeployable = async (ctx) => {
79008
79182
  return true;
79009
79183
  };
79010
79184
  var runDeploy = async (ctx) => {
79011
- const { npm: npm13, name: pm2 } = detectPackageManager();
79185
+ const { npm: npm14, name: pm3 } = detectPackageManager();
79012
79186
  if (!ctx.account?.id) {
79013
79187
  crash("Failed to read Cloudflare account.");
79014
79188
  return;
79015
79189
  }
79016
- const baseDeployCmd = [npm13, "run", ctx.template.deployScript ?? "deploy"];
79190
+ const baseDeployCmd = [npm14, "run", ctx.template.deployScript ?? "deploy"];
79017
79191
  const insideGitRepo = await isInsideGitRepo(ctx.project.path);
79018
79192
  const deployCmd = [
79019
79193
  ...baseDeployCmd,
79020
79194
  // Important: the following assumes that all framework deploy commands terminate with `wrangler pages deploy`
79021
79195
  ...ctx.template.platform === "pages" && ctx.commitMessage && !insideGitRepo ? [
79022
- ...pm2 === "npm" ? ["--"] : [],
79196
+ ...pm3 === "npm" ? ["--"] : [],
79023
79197
  "--commit-message",
79024
79198
  JSON.stringify(ctx.commitMessage)
79025
79199
  ] : []
@@ -79027,7 +79201,10 @@ var runDeploy = async (ctx) => {
79027
79201
  const result = await runCommand(deployCmd, {
79028
79202
  silent: true,
79029
79203
  cwd: ctx.project.path,
79030
- env: { CLOUDFLARE_ACCOUNT_ID: ctx.account.id, NODE_ENV: "production" },
79204
+ env: {
79205
+ CLOUDFLARE_ACCOUNT_ID: ctx.account.id,
79206
+ NODE_ENV: "production"
79207
+ },
79031
79208
  startText: "Deploying your application",
79032
79209
  doneText: `${brandColor("deployed")} ${dim(
79033
79210
  `via \`${quoteShellArgs(baseDeployCmd)}\``
@@ -79054,8 +79231,8 @@ init_command();
79054
79231
  init_packageManagers();
79055
79232
 
79056
79233
  // src/helpers/retry.ts
79057
- var retry = async (config13, fn) => {
79058
- let { times } = config13;
79234
+ var retry = async (config14, fn) => {
79235
+ let { times } = config14;
79059
79236
  let error2 = null;
79060
79237
  while (times > 0) {
79061
79238
  try {
@@ -79063,7 +79240,7 @@ var retry = async (config13, fn) => {
79063
79240
  } catch (e) {
79064
79241
  error2 = e;
79065
79242
  times--;
79066
- if (config13.exitCondition?.(e)) {
79243
+ if (config14.exitCondition?.(e)) {
79067
79244
  break;
79068
79245
  }
79069
79246
  }
@@ -79252,29 +79429,29 @@ function secondsSince(start) {
79252
79429
 
79253
79430
  // src/summary.ts
79254
79431
  var printSummary = async (ctx) => {
79255
- const { npm: npm13 } = detectPackageManager();
79432
+ const { npm: npm14 } = detectPackageManager();
79256
79433
  const dirRelativePath = (0, import_path10.relative)(ctx.originalCWD, ctx.project.path);
79257
79434
  const nextSteps = [
79258
- dirRelativePath ? ["Navigate to the new directory", `cd ${dirRelativePath}`] : [],
79435
+ ...dirRelativePath ? [["Navigate to the new directory", `cd ${dirRelativePath}`]] : [],
79259
79436
  [
79260
79437
  "Run the development server",
79261
- quoteShellArgs([npm13, "run", ctx.template.devScript ?? "start"])
79438
+ quoteShellArgs([npm14, "run", ctx.template.devScript ?? "start"])
79262
79439
  ],
79263
79440
  ...ctx.template.previewScript ? [
79264
79441
  [
79265
79442
  "Preview your application",
79266
- quoteShellArgs([npm13, "run", ctx.template.previewScript])
79443
+ quoteShellArgs([npm14, "run", ctx.template.previewScript])
79267
79444
  ]
79268
79445
  ] : [],
79269
79446
  [
79270
79447
  "Deploy your application",
79271
- quoteShellArgs([npm13, "run", ctx.template.deployScript ?? "deploy"])
79448
+ quoteShellArgs([npm14, "run", ctx.template.deployScript ?? "deploy"])
79272
79449
  ],
79273
79450
  [
79274
79451
  "Read the documentation",
79275
79452
  `https://developers.cloudflare.com/${ctx.template.platform}`
79276
79453
  ],
79277
- ["Stuck? Join us at", "https://discord.gg/cloudflaredev"]
79454
+ ["Stuck? Join us at", "https://discord.cloudflare.com"]
79278
79455
  ];
79279
79456
  if (ctx.deployment.url) {
79280
79457
  const msg = [
@@ -79290,7 +79467,7 @@ var printSummary = async (ctx) => {
79290
79467
  `${bgGreen(" APPLICATION CREATED ")}`,
79291
79468
  `${dim("Deploy your application with")}`,
79292
79469
  `${blue(
79293
- quoteShellArgs([npm13, "run", ctx.template.deployScript ?? "deploy"])
79470
+ quoteShellArgs([npm14, "run", ctx.template.deployScript ?? "deploy"])
79294
79471
  )}`
79295
79472
  ].join(" ");
79296
79473
  logRaw(msg);
@@ -80634,14 +80811,14 @@ function applyEdits(text, edits) {
80634
80811
 
80635
80812
  // src/workers.ts
80636
80813
  async function installWorkersTypes(ctx) {
80637
- const { npm: npm13 } = detectPackageManager();
80814
+ const { npm: npm14 } = detectPackageManager();
80638
80815
  if (!usesTypescript(ctx)) {
80639
80816
  return;
80640
80817
  }
80641
80818
  await installPackages(["@cloudflare/workers-types"], {
80642
80819
  dev: true,
80643
80820
  startText: "Installing @cloudflare/workers-types",
80644
- doneText: `${brandColor("installed")} ${dim(`via ${npm13}`)}`
80821
+ doneText: `${brandColor("installed")} ${dim(`via ${npm14}`)}`
80645
80822
  });
80646
80823
  await addWorkersTypesToTsConfig(ctx);
80647
80824
  }
@@ -80664,8 +80841,8 @@ async function addWorkersTypesToTsConfig(ctx) {
80664
80841
  }
80665
80842
  const typesEntrypoint = `@cloudflare/workers-types/${entrypointVersion}`;
80666
80843
  try {
80667
- const config13 = parse3(tsconfig);
80668
- const currentTypes = config13.compilerOptions?.types ?? [];
80844
+ const config14 = parse3(tsconfig);
80845
+ const currentTypes = config14.compilerOptions?.types ?? [];
80669
80846
  const explicitEntrypoint = currentTypes.some(
80670
80847
  (t) => t.match(/@cloudflare\/workers-types\/\d{4}-\d{2}-\d{2}/)
80671
80848
  );
@@ -80695,7 +80872,7 @@ async function addWorkersTypesToTsConfig(ctx) {
80695
80872
  }
80696
80873
 
80697
80874
  // src/cli.ts
80698
- var { npm: npm12 } = detectPackageManager();
80875
+ var { npm: npm13 } = detectPackageManager();
80699
80876
  var main = async (argv) => {
80700
80877
  const args = await parseArgs(argv);
80701
80878
  logRaw("");
@@ -80707,10 +80884,10 @@ var main = async (argv) => {
80707
80884
  };
80708
80885
  var runLatest = async () => {
80709
80886
  const args = process.argv.slice(2);
80710
- if (npm12 === "npm") {
80887
+ if (npm13 === "npm") {
80711
80888
  args.unshift("--");
80712
80889
  }
80713
- await runCommand([npm12, "create", "cloudflare@latest", ...args]);
80890
+ await runCommand([npm13, "create", "cloudflare@latest", ...args]);
80714
80891
  };
80715
80892
  var runCli = async (args) => {
80716
80893
  printBanner();
@@ -80755,7 +80932,7 @@ var setupProjectDirectory = (args) => {
80755
80932
  };
80756
80933
  var runTemplate = async (ctx) => {
80757
80934
  await create(ctx);
80758
- await configure9(ctx);
80935
+ await configure11(ctx);
80759
80936
  await deploy(ctx);
80760
80937
  await printSummary(ctx);
80761
80938
  };
@@ -80771,7 +80948,7 @@ var create = async (ctx) => {
80771
80948
  await rectifyPmMismatch(ctx);
80772
80949
  endSection(`Application created`);
80773
80950
  };
80774
- var configure9 = async (ctx) => {
80951
+ var configure11 = async (ctx) => {
80775
80952
  startSection("Configuring your application for Cloudflare", "Step 2 of 3");
80776
80953
  await installWrangler();
80777
80954
  await installWorkersTypes(ctx);