vite-plus 0.1.24 → 0.2.1

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 (174) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +8 -6
  3. package/bin/oxfmt +5 -2
  4. package/bin/oxlint +12 -2
  5. package/binding/index.cjs +84 -67
  6. package/binding/index.d.cts +155 -4
  7. package/dist/{agent-Nuk-9l77.js → agent--cKmgD_n.js} +941 -70
  8. package/dist/bin.js +22 -30
  9. package/dist/{compat-DXZgnEyq.js → compat-Cql3K40m.js} +1 -1
  10. package/dist/config/bin.js +30 -14
  11. package/dist/constants-CrfJQIUX.js +66 -0
  12. package/dist/create/bin.d.ts +6 -0
  13. package/dist/create/bin.js +508 -232
  14. package/dist/define-config-2tfJoXr1.d.ts +305 -0
  15. package/dist/define-config-BGSjF6Xp.cjs +488 -0
  16. package/dist/define-config-DJUehepE.js +445 -0
  17. package/dist/define-config.cjs +8 -1
  18. package/dist/define-config.d.ts +2 -2
  19. package/dist/define-config.js +2 -2
  20. package/dist/dist-DRJUd9bL.js +3 -0
  21. package/dist/{dist-BgQuvbtq.js → dist-Oxo16Y0q.js} +4 -4
  22. package/dist/index.cjs +9 -4
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +3 -3
  25. package/dist/{main-DpJl3LoU.js → json-Dn87fvjk.js} +137 -1
  26. package/dist/migration/bin.js +292 -76
  27. package/dist/{oxlint-plugin-config-B89iKTKN.js → oxlint-plugin-config-q8a5PFch.js} +1 -1
  28. package/dist/oxlint-plugin.js +11 -3
  29. package/dist/pack-bin.js +44 -15
  30. package/dist/{package-PmBUZ-ve.js → package-BHirM1_v.js} +3 -138
  31. package/dist/{report-DgSBQUdz.js → report-BHSkWqRR.js} +2 -0
  32. package/dist/{resolve-vite-config-TTvhycU1.js → resolve-vite-config-CmdsfQzS.js} +13 -4
  33. package/dist/staged/bin.js +5 -5
  34. package/dist/test/_at-vitest-browser/context.d.ts +2 -0
  35. package/dist/test/_at-vitest-browser.d.ts +2 -0
  36. package/dist/test/browser/context.d.ts +2 -2
  37. package/dist/test/browser/context.js +1 -1
  38. package/dist/test/browser/providers/playwright/context.d.ts +1 -0
  39. package/dist/test/browser/providers/playwright/context.js +1 -0
  40. package/dist/test/browser/providers/playwright.d.ts +124 -2
  41. package/dist/test/browser/providers/playwright.js +1 -1
  42. package/dist/test/browser/providers/preview/context.d.ts +1 -0
  43. package/dist/test/browser/providers/preview/context.js +1 -0
  44. package/dist/test/browser/providers/preview.d.ts +32 -2
  45. package/dist/test/browser/providers/preview.js +1 -1
  46. package/dist/test/browser/providers/webdriverio/context.d.ts +1 -0
  47. package/dist/test/browser/providers/webdriverio/context.js +1 -0
  48. package/dist/test/browser/providers/webdriverio.d.ts +77 -2
  49. package/dist/test/browser/providers/webdriverio.js +1 -1
  50. package/dist/test/browser-compat.d.ts +2 -0
  51. package/dist/test/browser-compat.js +1 -1
  52. package/dist/test/browser-playwright/context.d.ts +1 -0
  53. package/dist/test/browser-playwright/context.js +1 -0
  54. package/dist/test/browser-playwright.d.ts +124 -2
  55. package/dist/test/browser-playwright.js +1 -1
  56. package/dist/test/browser-preview/context.d.ts +1 -0
  57. package/dist/test/browser-preview/context.js +1 -0
  58. package/dist/test/browser-preview.d.ts +32 -2
  59. package/dist/test/browser-preview.js +1 -1
  60. package/dist/test/browser-webdriverio/context.d.ts +1 -0
  61. package/dist/test/browser-webdriverio/context.js +1 -0
  62. package/dist/test/browser-webdriverio.d.ts +77 -2
  63. package/dist/test/browser-webdriverio.js +1 -1
  64. package/dist/test/browser.d.ts +2 -2
  65. package/dist/test/browser.js +1 -1
  66. package/dist/test/client.js +1 -1
  67. package/dist/test/config.cjs +1 -1
  68. package/dist/test/config.d.ts +2 -2
  69. package/dist/test/config.js +1 -1
  70. package/dist/test/context.d.ts +942 -2
  71. package/dist/test/context.js +1 -1
  72. package/dist/test/coverage.d.ts +2 -2
  73. package/dist/test/coverage.js +1 -1
  74. package/dist/test/environments.d.ts +2 -2
  75. package/dist/test/environments.js +1 -1
  76. package/dist/test/globals.d.ts +2 -2
  77. package/dist/test/import-meta.d.ts +2 -2
  78. package/dist/test/importMeta.d.ts +2 -2
  79. package/dist/test/index.cjs +1 -1
  80. package/dist/test/index.d.cts +2 -2
  81. package/dist/test/index.d.ts +2 -2
  82. package/dist/test/index.js +1 -1
  83. package/dist/test/internal/browser.d.ts +2 -2
  84. package/dist/test/internal/browser.js +1 -1
  85. package/dist/test/jsdom.d.ts +2 -2
  86. package/dist/test/locators.d.ts +294 -0
  87. package/dist/test/locators.js +1 -1
  88. package/dist/test/matchers.d.ts +29 -0
  89. package/dist/test/matchers.js +1 -1
  90. package/dist/test/node.d.ts +2 -2
  91. package/dist/test/node.js +1 -1
  92. package/dist/test/optional-runtime-types.js.d.ts +2 -2
  93. package/dist/test/optional-types.js.d.ts +2 -2
  94. package/dist/test/plugins/browser-client.js +1 -1
  95. package/dist/test/plugins/browser-context.js +1 -1
  96. package/dist/test/plugins/browser-locators.js +1 -1
  97. package/dist/test/plugins/browser-playwright.js +1 -1
  98. package/dist/test/plugins/browser-preview.js +1 -1
  99. package/dist/test/plugins/browser-webdriverio.js +1 -1
  100. package/dist/test/plugins/browser.js +1 -1
  101. package/dist/test/plugins/expect.js +1 -1
  102. package/dist/test/plugins/mocker-automock.js +1 -1
  103. package/dist/test/plugins/mocker-browser.js +1 -1
  104. package/dist/test/plugins/mocker-node.js +1 -1
  105. package/dist/test/plugins/mocker-redirect.js +1 -1
  106. package/dist/test/plugins/mocker-register.js +1 -1
  107. package/dist/test/plugins/mocker-transforms.js +1 -1
  108. package/dist/test/plugins/mocker.js +1 -1
  109. package/dist/test/plugins/pretty-format.js +1 -1
  110. package/dist/test/plugins/runner-types.js +1 -1
  111. package/dist/test/plugins/runner-utils.js +1 -1
  112. package/dist/test/plugins/runner.js +1 -1
  113. package/dist/test/plugins/snapshot-environment.js +1 -1
  114. package/dist/test/plugins/snapshot-manager.js +1 -1
  115. package/dist/test/plugins/snapshot.js +1 -1
  116. package/dist/test/plugins/spy.js +1 -1
  117. package/dist/test/plugins/utils-constants.js +1 -1
  118. package/dist/test/plugins/utils-diff.js +1 -1
  119. package/dist/test/plugins/utils-display.js +1 -1
  120. package/dist/test/plugins/utils-error.js +1 -1
  121. package/dist/test/plugins/utils-helpers.js +1 -1
  122. package/dist/test/plugins/utils-offset.js +1 -1
  123. package/dist/test/plugins/utils-resolver.js +1 -1
  124. package/dist/test/plugins/utils-serialize.js +1 -1
  125. package/dist/test/plugins/utils-source-map-node.js +1 -1
  126. package/dist/test/plugins/utils-source-map.js +1 -1
  127. package/dist/test/plugins/utils-timers.js +1 -1
  128. package/dist/test/plugins/utils.js +1 -1
  129. package/dist/test/reporters.d.ts +2 -2
  130. package/dist/test/reporters.js +1 -1
  131. package/dist/test/runners.d.ts +2 -2
  132. package/dist/test/runners.js +1 -1
  133. package/dist/test/runtime.d.ts +2 -2
  134. package/dist/test/runtime.js +1 -1
  135. package/dist/test/snapshot.d.ts +2 -2
  136. package/dist/test/snapshot.js +1 -1
  137. package/dist/test/suite.d.ts +2 -2
  138. package/dist/test/suite.js +1 -1
  139. package/dist/test/utils.js +1 -1
  140. package/dist/test/worker.d.ts +2 -2
  141. package/dist/test/worker.js +1 -1
  142. package/dist/{tsconfig-DFb5BKyT.js → tsconfig-BWQPmGKz.js} +565 -231
  143. package/dist/tsgolint-path-B-yOos8p.js +32 -0
  144. package/dist/tsgolint-path.d.ts +8 -0
  145. package/dist/tsgolint-path.js +2 -0
  146. package/dist/version.js +3 -3
  147. package/dist/versions.d.ts +1 -1
  148. package/dist/versions.js +6 -6
  149. package/dist/{workspace-NL-m9wgM.js → workspace-D0AVy4fu.js} +11 -9
  150. package/docs/_data/team.ts +2 -1
  151. package/docs/config/create.md +36 -1
  152. package/docs/config/index.md +7 -5
  153. package/docs/guide/commit-hooks.md +9 -0
  154. package/docs/guide/create.md +106 -2
  155. package/docs/guide/env.md +33 -5
  156. package/docs/guide/index.md +5 -3
  157. package/docs/guide/install.md +31 -12
  158. package/docs/guide/migrate.md +13 -3
  159. package/docs/guide/troubleshooting.md +2 -2
  160. package/docs/guide/upgrade.md +26 -7
  161. package/docs/package.json +3 -3
  162. package/docs/pnpm-lock.yaml +298 -395
  163. package/package.json +103 -55
  164. package/templates/generator/bin/index.ts +6 -3
  165. package/templates/generator/package.json +2 -3
  166. package/templates/generator/src/template.ts +0 -2
  167. package/templates/monorepo/package.json +1 -1
  168. package/dist/constants-DCBWlNrn.js +0 -33
  169. package/dist/define-config-BR1Y88zz.cjs +0 -84
  170. package/dist/define-config-BRC7qPNE.js +0 -21
  171. package/dist/define-config-COdn-tsn.d.ts +0 -177
  172. package/dist/dist-Bapm49IR.js +0 -3
  173. package/dist/test/plugins/utils-highlight.js +0 -1
  174. /package/dist/{chunk-DnnnRqeS.js → rolldown-runtime-DnnnRqeS.js} +0 -0
@@ -1,14 +1,14 @@
1
- import { n as __require, r as __toESM, t as __commonJSMin } from "./chunk-DnnnRqeS.js";
2
- import { s as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-DCBWlNrn.js";
1
+ import { n as __require, r as __toESM, t as __commonJSMin } from "./rolldown-runtime-DnnnRqeS.js";
2
+ import { l as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-CrfJQIUX.js";
3
3
  import { t as accent } from "./terminal-uTv0ZaMr.js";
4
- import { n as modify, r as parse, t as applyEdits } from "./main-DpJl3LoU.js";
4
+ import { a as applyEdits, i as writeJsonFile, o as modify, r as readJsonFile, s as parse } from "./json-Dn87fvjk.js";
5
5
  import path from "node:path";
6
6
  import { downloadPackageManager } from "../binding/index.js";
7
7
  import fs from "node:fs";
8
- import { styleText } from "node:util";
8
+ import { stripVTControlCharacters, styleText } from "node:util";
9
9
  import process$1, { stdin, stdout } from "node:process";
10
10
  import * as b from "node:readline";
11
- import G from "node:readline";
11
+ import u from "node:readline";
12
12
  import { ReadStream } from "node:tty";
13
13
  //#region ../../node_modules/.pnpm/isexe@2.0.0/node_modules/isexe/windows.js
14
14
  var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
@@ -456,7 +456,7 @@ async function runCommand$1(options) {
456
456
  }
457
457
  //#endregion
458
458
  //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js
459
- const getCodePointsLength = (() => {
459
+ const getCodePointsLength$1 = (() => {
460
460
  const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
461
461
  return (input) => {
462
462
  let surrogatePairsNr = 0;
@@ -465,29 +465,29 @@ const getCodePointsLength = (() => {
465
465
  return input.length - surrogatePairsNr;
466
466
  };
467
467
  })();
468
- const isFullWidth$1 = (x) => {
468
+ const isFullWidth = (x) => {
469
469
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
470
470
  };
471
- const isWideNotCJKTNotEmoji = (x) => {
471
+ const isWideNotCJKTNotEmoji$1 = (x) => {
472
472
  return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
473
473
  };
474
474
  //#endregion
475
475
  //#region ../../node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js
476
- const ANSI_RE$1 = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
477
- const CONTROL_RE$1 = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
478
- const CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
479
- const TAB_RE$1 = /\t{1,1000}/y;
480
- const EMOJI_RE$1 = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy;
481
- const LATIN_RE$1 = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
482
- const MODIFIER_RE$1 = /\p{M}+/gu;
483
- const NO_TRUNCATION$3 = {
476
+ const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
477
+ const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
478
+ const CJKT_WIDE_RE$1 = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
479
+ const TAB_RE = /\t{1,1000}/y;
480
+ const EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy;
481
+ const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
482
+ const MODIFIER_RE = /\p{M}+/gu;
483
+ const NO_TRUNCATION$1 = {
484
484
  limit: Infinity,
485
485
  ellipsis: ""
486
486
  };
487
- const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions = {}) => {
487
+ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
488
488
  const LIMIT = truncationOptions.limit ?? Infinity;
489
489
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
490
- const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth$1(ELLIPSIS, NO_TRUNCATION$3, widthOptions).width : 0);
490
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
491
491
  const ANSI_WIDTH = 0;
492
492
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
493
493
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
@@ -496,12 +496,12 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
496
496
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
497
497
  const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
498
498
  const PARSE_BLOCKS = [
499
- [LATIN_RE$1, REGULAR_WIDTH],
500
- [ANSI_RE$1, ANSI_WIDTH],
501
- [CONTROL_RE$1, CONTROL_WIDTH],
502
- [TAB_RE$1, TAB_WIDTH],
503
- [EMOJI_RE$1, EMOJI_WIDTH],
504
- [CJKT_WIDE_RE, WIDE_WIDTH]
499
+ [LATIN_RE, REGULAR_WIDTH],
500
+ [ANSI_RE, ANSI_WIDTH],
501
+ [CONTROL_RE, CONTROL_WIDTH],
502
+ [TAB_RE, TAB_WIDTH],
503
+ [EMOJI_RE, EMOJI_WIDTH],
504
+ [CJKT_WIDE_RE$1, WIDE_WIDTH]
505
505
  ];
506
506
  let indexPrev = 0;
507
507
  let index = 0;
@@ -518,10 +518,10 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
518
518
  if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
519
519
  const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
520
520
  lengthExtra = 0;
521
- for (const char of unmatched.replaceAll(MODIFIER_RE$1, "")) {
521
+ for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
522
522
  const codePoint = char.codePointAt(0) || 0;
523
- if (isFullWidth$1(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
524
- else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
523
+ if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
524
+ else if (isWideNotCJKTNotEmoji$1(codePoint)) widthExtra = WIDE_WIDTH;
525
525
  else widthExtra = REGULAR_WIDTH;
526
526
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
527
527
  if (width + widthExtra > LIMIT) {
@@ -538,7 +538,7 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
538
538
  const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
539
539
  BLOCK_RE.lastIndex = index;
540
540
  if (BLOCK_RE.test(input)) {
541
- lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE$1 ? 1 : BLOCK_RE.lastIndex - index;
541
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE$1 ? getCodePointsLength$1(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE ? 1 : BLOCK_RE.lastIndex - index;
542
542
  widthExtra = lengthExtra * BLOCK_WIDTH;
543
543
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
544
544
  if (width + widthExtra > LIMIT) {
@@ -563,13 +563,13 @@ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions =
563
563
  };
564
564
  //#endregion
565
565
  //#region ../../node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js
566
- const NO_TRUNCATION$2 = {
566
+ const NO_TRUNCATION = {
567
567
  limit: Infinity,
568
568
  ellipsis: "",
569
569
  ellipsisWidth: 0
570
570
  };
571
- const fastStringWidth$1 = (input, options = {}) => {
572
- return getStringTruncatedWidth$1(input, NO_TRUNCATION$2, options).width;
571
+ const fastStringWidth = (input, options = {}) => {
572
+ return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
573
573
  };
574
574
  //#endregion
575
575
  //#region ../../node_modules/.pnpm/fast-wrap-ansi@0.2.0/node_modules/fast-wrap-ansi/lib/main.js
@@ -602,13 +602,13 @@ const wrapWord$1 = (rows, word, columns) => {
602
602
  let isInsideEscape = false;
603
603
  let isInsideLinkEscape = false;
604
604
  let lastRow = rows.at(-1);
605
- let visible = lastRow === void 0 ? 0 : fastStringWidth$1(lastRow);
605
+ let visible = lastRow === void 0 ? 0 : fastStringWidth(lastRow);
606
606
  let currentCharacter = characters.next();
607
607
  let nextCharacter = characters.next();
608
608
  let rawCharacterIndex = 0;
609
609
  while (!currentCharacter.done) {
610
610
  const character = currentCharacter.value;
611
- const characterLength = fastStringWidth$1(character);
611
+ const characterLength = fastStringWidth(character);
612
612
  if (visible + characterLength <= columns) rows[rows.length - 1] += character;
613
613
  else {
614
614
  rows.push(character);
@@ -643,7 +643,7 @@ const stringVisibleTrimSpacesRight$1 = (string) => {
643
643
  const words = string.split(" ");
644
644
  let last = words.length;
645
645
  while (last) {
646
- if (fastStringWidth$1(words[last - 1])) break;
646
+ if (fastStringWidth(words[last - 1])) break;
647
647
  last--;
648
648
  }
649
649
  if (last === words.length) return string;
@@ -664,7 +664,7 @@ const exec$1 = (string, columns, options = {}) => {
664
664
  const trimmed = row.trimStart();
665
665
  if (row.length !== trimmed.length) {
666
666
  rows[rows.length - 1] = trimmed;
667
- rowLength = fastStringWidth$1(trimmed);
667
+ rowLength = fastStringWidth(trimmed);
668
668
  }
669
669
  }
670
670
  if (index !== 0) {
@@ -677,19 +677,19 @@ const exec$1 = (string, columns, options = {}) => {
677
677
  rowLength++;
678
678
  }
679
679
  }
680
- const wordLength = fastStringWidth$1(word);
680
+ const wordLength = fastStringWidth(word);
681
681
  if (options.hard && wordLength > columns) {
682
682
  const remainingColumns = columns - rowLength;
683
683
  const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
684
684
  if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
685
685
  wrapWord$1(rows, word, columns);
686
- rowLength = fastStringWidth$1(rows.at(-1) ?? "");
686
+ rowLength = fastStringWidth(rows.at(-1) ?? "");
687
687
  continue;
688
688
  }
689
689
  if (rowLength + wordLength > columns && rowLength && wordLength) {
690
690
  if (options.wordWrap === false && rowLength < columns) {
691
691
  wrapWord$1(rows, word, columns);
692
- rowLength = fastStringWidth$1(rows.at(-1) ?? "");
692
+ rowLength = fastStringWidth(rows.at(-1) ?? "");
693
693
  continue;
694
694
  }
695
695
  rows.push("");
@@ -697,7 +697,7 @@ const exec$1 = (string, columns, options = {}) => {
697
697
  }
698
698
  if (rowLength + wordLength > columns && options.wordWrap === false) {
699
699
  wrapWord$1(rows, word, columns);
700
- rowLength = fastStringWidth$1(rows.at(-1) ?? "");
700
+ rowLength = fastStringWidth(rows.at(-1) ?? "");
701
701
  continue;
702
702
  }
703
703
  rows[rows.length - 1] += word;
@@ -965,7 +965,7 @@ var m = class {
965
965
  this.state = "cancel", this.close();
966
966
  }, { once: !0 });
967
967
  }
968
- this.rl = G.createInterface({
968
+ this.rl = u.createInterface({
969
969
  input: this.input,
970
970
  tabSize: 2,
971
971
  prompt: "",
@@ -1292,37 +1292,51 @@ const symbolBar = (state) => {
1292
1292
  default: return import_picocolors.default.blue(S_BAR);
1293
1293
  }
1294
1294
  };
1295
- const isAmbiguous = (x) => {
1296
- return x === 161 || x === 164 || x === 167 || x === 168 || x === 170 || x === 173 || x === 174 || x >= 176 && x <= 180 || x >= 182 && x <= 186 || x >= 188 && x <= 191 || x === 198 || x === 208 || x === 215 || x === 216 || x >= 222 && x <= 225 || x === 230 || x >= 232 && x <= 234 || x === 236 || x === 237 || x === 240 || x === 242 || x === 243 || x >= 247 && x <= 250 || x === 252 || x === 254 || x === 257 || x === 273 || x === 275 || x === 283 || x === 294 || x === 295 || x === 299 || x >= 305 && x <= 307 || x === 312 || x >= 319 && x <= 322 || x === 324 || x >= 328 && x <= 331 || x === 333 || x === 338 || x === 339 || x === 358 || x === 359 || x === 363 || x === 462 || x === 464 || x === 466 || x === 468 || x === 470 || x === 472 || x === 474 || x === 476 || x === 593 || x === 609 || x === 708 || x === 711 || x >= 713 && x <= 715 || x === 717 || x === 720 || x >= 728 && x <= 731 || x === 733 || x === 735 || x >= 768 && x <= 879 || x >= 913 && x <= 929 || x >= 931 && x <= 937 || x >= 945 && x <= 961 || x >= 963 && x <= 969 || x === 1025 || x >= 1040 && x <= 1103 || x === 1105 || x === 8208 || x >= 8211 && x <= 8214 || x === 8216 || x === 8217 || x === 8220 || x === 8221 || x >= 8224 && x <= 8226 || x >= 8228 && x <= 8231 || x === 8240 || x === 8242 || x === 8243 || x === 8245 || x === 8251 || x === 8254 || x === 8308 || x === 8319 || x >= 8321 && x <= 8324 || x === 8364 || x === 8451 || x === 8453 || x === 8457 || x === 8467 || x === 8470 || x === 8481 || x === 8482 || x === 8486 || x === 8491 || x === 8531 || x === 8532 || x >= 8539 && x <= 8542 || x >= 8544 && x <= 8555 || x >= 8560 && x <= 8569 || x === 8585 || x >= 8592 && x <= 8601 || x === 8632 || x === 8633 || x === 8658 || x === 8660 || x === 8679 || x === 8704 || x === 8706 || x === 8707 || x === 8711 || x === 8712 || x === 8715 || x === 8719 || x === 8721 || x === 8725 || x === 8730 || x >= 8733 && x <= 8736 || x === 8739 || x === 8741 || x >= 8743 && x <= 8748 || x === 8750 || x >= 8756 && x <= 8759 || x === 8764 || x === 8765 || x === 8776 || x === 8780 || x === 8786 || x === 8800 || x === 8801 || x >= 8804 && x <= 8807 || x === 8810 || x === 8811 || x === 8814 || x === 8815 || x === 8834 || x === 8835 || x === 8838 || x === 8839 || x === 8853 || x === 8857 || x === 8869 || x === 8895 || x === 8978 || x >= 9312 && x <= 9449 || x >= 9451 && x <= 9547 || x >= 9552 && x <= 9587 || x >= 9600 && x <= 9615 || x >= 9618 && x <= 9621 || x === 9632 || x === 9633 || x >= 9635 && x <= 9641 || x === 9650 || x === 9651 || x === 9654 || x === 9655 || x === 9660 || x === 9661 || x === 9664 || x === 9665 || x >= 9670 && x <= 9672 || x === 9675 || x >= 9678 && x <= 9681 || x >= 9698 && x <= 9701 || x === 9711 || x === 9733 || x === 9734 || x === 9737 || x === 9742 || x === 9743 || x === 9756 || x === 9758 || x === 9792 || x === 9794 || x === 9824 || x === 9825 || x >= 9827 && x <= 9829 || x >= 9831 && x <= 9834 || x === 9836 || x === 9837 || x === 9839 || x === 9886 || x === 9887 || x === 9919 || x >= 9926 && x <= 9933 || x >= 9935 && x <= 9939 || x >= 9941 && x <= 9953 || x === 9955 || x === 9960 || x === 9961 || x >= 9963 && x <= 9969 || x === 9972 || x >= 9974 && x <= 9977 || x === 9979 || x === 9980 || x === 9982 || x === 9983 || x === 10045 || x >= 10102 && x <= 10111 || x >= 11094 && x <= 11097 || x >= 12872 && x <= 12879 || x >= 57344 && x <= 63743 || x >= 65024 && x <= 65039 || x === 65533 || x >= 127232 && x <= 127242 || x >= 127248 && x <= 127277 || x >= 127280 && x <= 127337 || x >= 127344 && x <= 127373 || x === 127375 || x === 127376 || x >= 127387 && x <= 127404 || x >= 917760 && x <= 917999 || x >= 983040 && x <= 1048573 || x >= 1048576 && x <= 1114109;
1297
- };
1298
- const isFullWidth = (x) => {
1295
+ const getCodePointsLength = (() => {
1296
+ const SURROGATE_PAIR_RE = /[\uD800-\uDBFF][\uDC00-\uDFFF]/g;
1297
+ return (input) => {
1298
+ let surrogatePairsNr = 0;
1299
+ SURROGATE_PAIR_RE.lastIndex = 0;
1300
+ while (SURROGATE_PAIR_RE.test(input)) surrogatePairsNr += 1;
1301
+ return input.length - surrogatePairsNr;
1302
+ };
1303
+ })();
1304
+ const isFullWidth$1 = (x) => {
1299
1305
  return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
1300
1306
  };
1301
- const isWide = (x) => {
1302
- return x >= 4352 && x <= 4447 || x === 8986 || x === 8987 || x === 9001 || x === 9002 || x >= 9193 && x <= 9196 || x === 9200 || x === 9203 || x === 9725 || x === 9726 || x === 9748 || x === 9749 || x >= 9800 && x <= 9811 || x === 9855 || x === 9875 || x === 9889 || x === 9898 || x === 9899 || x === 9917 || x === 9918 || x === 9924 || x === 9925 || x === 9934 || x === 9940 || x === 9962 || x === 9970 || x === 9971 || x === 9973 || x === 9978 || x === 9981 || x === 9989 || x === 9994 || x === 9995 || x === 10024 || x === 10060 || x === 10062 || x >= 10067 && x <= 10069 || x === 10071 || x >= 10133 && x <= 10135 || x === 10160 || x === 10175 || x === 11035 || x === 11036 || x === 11088 || x === 11093 || x >= 11904 && x <= 11929 || x >= 11931 && x <= 12019 || x >= 12032 && x <= 12245 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12353 && x <= 12438 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 19968 && x <= 42124 || x >= 42128 && x <= 42182 || x >= 43360 && x <= 43388 || x >= 44032 && x <= 55203 || x >= 63744 && x <= 64255 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 94176 && x <= 94180 || x === 94192 || x === 94193 || x >= 94208 && x <= 100343 || x >= 100352 && x <= 101589 || x >= 101632 && x <= 101640 || x >= 110576 && x <= 110579 || x >= 110581 && x <= 110587 || x === 110589 || x === 110590 || x >= 110592 && x <= 110882 || x === 110898 || x >= 110928 && x <= 110930 || x === 110933 || x >= 110948 && x <= 110951 || x >= 110960 && x <= 111355 || x === 126980 || x === 127183 || x === 127374 || x >= 127377 && x <= 127386 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x === 127568 || x === 127569 || x >= 127584 && x <= 127589 || x >= 127744 && x <= 127776 || x >= 127789 && x <= 127797 || x >= 127799 && x <= 127868 || x >= 127870 && x <= 127891 || x >= 127904 && x <= 127946 || x >= 127951 && x <= 127955 || x >= 127968 && x <= 127984 || x === 127988 || x >= 127992 && x <= 128062 || x === 128064 || x >= 128066 && x <= 128252 || x >= 128255 && x <= 128317 || x >= 128331 && x <= 128334 || x >= 128336 && x <= 128359 || x === 128378 || x === 128405 || x === 128406 || x === 128420 || x >= 128507 && x <= 128591 || x >= 128640 && x <= 128709 || x === 128716 || x >= 128720 && x <= 128722 || x >= 128725 && x <= 128727 || x >= 128732 && x <= 128735 || x === 128747 || x === 128748 || x >= 128756 && x <= 128764 || x >= 128992 && x <= 129003 || x === 129008 || x >= 129292 && x <= 129338 || x >= 129340 && x <= 129349 || x >= 129351 && x <= 129535 || x >= 129648 && x <= 129660 || x >= 129664 && x <= 129672 || x >= 129680 && x <= 129725 || x >= 129727 && x <= 129733 || x >= 129742 && x <= 129755 || x >= 129760 && x <= 129768 || x >= 129776 && x <= 129784 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
1307
+ const isWideNotCJKTNotEmoji = (x) => {
1308
+ return x === 8987 || x === 9001 || x >= 12272 && x <= 12287 || x >= 12289 && x <= 12350 || x >= 12441 && x <= 12543 || x >= 12549 && x <= 12591 || x >= 12593 && x <= 12686 || x >= 12688 && x <= 12771 || x >= 12783 && x <= 12830 || x >= 12832 && x <= 12871 || x >= 12880 && x <= 19903 || x >= 65040 && x <= 65049 || x >= 65072 && x <= 65106 || x >= 65108 && x <= 65126 || x >= 65128 && x <= 65131 || x >= 127488 && x <= 127490 || x >= 127504 && x <= 127547 || x >= 127552 && x <= 127560 || x >= 131072 && x <= 196605 || x >= 196608 && x <= 262141;
1303
1309
  };
1304
- const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
1305
- const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
1306
- const TAB_RE = /\t{1,1000}/y;
1307
- const EMOJI_RE = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy;
1308
- const LATIN_RE = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
1309
- const MODIFIER_RE = /\p{M}+/gu;
1310
- const NO_TRUNCATION$1 = {
1310
+ const ANSI_RE$1 = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]|\u001b\]8;[^;]*;.*?(?:\u0007|\u001b\u005c)/y;
1311
+ const CONTROL_RE$1 = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
1312
+ const CJKT_WIDE_RE = /(?:(?![\uFF61-\uFF9F\uFF00-\uFFEF])[\p{Script=Han}\p{Script=Hiragana}\p{Script=Katakana}\p{Script=Hangul}\p{Script=Tangut}]){1,1000}/uy;
1313
+ const TAB_RE$1 = /\t{1,1000}/y;
1314
+ const EMOJI_RE$1 = /[\u{1F1E6}-\u{1F1FF}]{2}|\u{1F3F4}[\u{E0061}-\u{E007A}]{2}[\u{E0030}-\u{E0039}\u{E0061}-\u{E007A}]{1,3}\u{E007F}|(?:\p{Emoji}\uFE0F\u20E3?|\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation})(?:\u200D(?:\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?|\p{Emoji_Presentation}|\p{Emoji}\uFE0F\u20E3?))*/uy;
1315
+ const LATIN_RE$1 = /(?:[\x20-\x7E\xA0-\xFF](?!\uFE0F)){1,1000}/y;
1316
+ const MODIFIER_RE$1 = /\p{M}+/gu;
1317
+ const NO_TRUNCATION$3 = {
1311
1318
  limit: Infinity,
1312
1319
  ellipsis: ""
1313
1320
  };
1314
- const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
1321
+ const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions = {}) => {
1315
1322
  const LIMIT = truncationOptions.limit ?? Infinity;
1316
1323
  const ELLIPSIS = truncationOptions.ellipsis ?? "";
1317
- const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$1, widthOptions).width : 0);
1318
- const ANSI_WIDTH = widthOptions.ansiWidth ?? 0;
1324
+ const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth$1(ELLIPSIS, NO_TRUNCATION$3, widthOptions).width : 0);
1325
+ const ANSI_WIDTH = 0;
1319
1326
  const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
1320
1327
  const TAB_WIDTH = widthOptions.tabWidth ?? 8;
1321
- const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
1322
1328
  const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
1323
- const FULL_WIDTH_WIDTH = widthOptions.fullWidthWidth ?? 2;
1329
+ const FULL_WIDTH_WIDTH = 2;
1324
1330
  const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
1325
- const WIDE_WIDTH = widthOptions.wideWidth ?? 2;
1331
+ const WIDE_WIDTH = widthOptions.wideWidth ?? FULL_WIDTH_WIDTH;
1332
+ const PARSE_BLOCKS = [
1333
+ [LATIN_RE$1, REGULAR_WIDTH],
1334
+ [ANSI_RE$1, ANSI_WIDTH],
1335
+ [CONTROL_RE$1, CONTROL_WIDTH],
1336
+ [TAB_RE$1, TAB_WIDTH],
1337
+ [EMOJI_RE$1, EMOJI_WIDTH],
1338
+ [CJKT_WIDE_RE, WIDE_WIDTH]
1339
+ ];
1326
1340
  let indexPrev = 0;
1327
1341
  let index = 0;
1328
1342
  let length = input.length;
@@ -1338,11 +1352,10 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
1338
1352
  if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
1339
1353
  const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
1340
1354
  lengthExtra = 0;
1341
- for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
1355
+ for (const char of unmatched.replaceAll(MODIFIER_RE$1, "")) {
1342
1356
  const codePoint = char.codePointAt(0) || 0;
1343
- if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
1344
- else if (isWide(codePoint)) widthExtra = WIDE_WIDTH;
1345
- else if (AMBIGUOUS_WIDTH !== REGULAR_WIDTH && isAmbiguous(codePoint)) widthExtra = AMBIGUOUS_WIDTH;
1357
+ if (isFullWidth$1(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
1358
+ else if (isWideNotCJKTNotEmoji(codePoint)) widthExtra = WIDE_WIDTH;
1346
1359
  else widthExtra = REGULAR_WIDTH;
1347
1360
  if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
1348
1361
  if (width + widthExtra > LIMIT) {
@@ -1354,77 +1367,24 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
1354
1367
  }
1355
1368
  unmatchedStart = unmatchedEnd = 0;
1356
1369
  }
1357
- if (index >= length) break;
1358
- LATIN_RE.lastIndex = index;
1359
- if (LATIN_RE.test(input)) {
1360
- lengthExtra = LATIN_RE.lastIndex - index;
1361
- widthExtra = lengthExtra * REGULAR_WIDTH;
1362
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / REGULAR_WIDTH));
1363
- if (width + widthExtra > LIMIT) {
1364
- truncationEnabled = true;
1365
- break;
1366
- }
1367
- width += widthExtra;
1368
- unmatchedStart = indexPrev;
1369
- unmatchedEnd = index;
1370
- index = indexPrev = LATIN_RE.lastIndex;
1371
- continue;
1372
- }
1373
- ANSI_RE.lastIndex = index;
1374
- if (ANSI_RE.test(input)) {
1375
- if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
1376
- if (width + ANSI_WIDTH > LIMIT) {
1377
- truncationEnabled = true;
1378
- break;
1379
- }
1380
- width += ANSI_WIDTH;
1381
- unmatchedStart = indexPrev;
1382
- unmatchedEnd = index;
1383
- index = indexPrev = ANSI_RE.lastIndex;
1384
- continue;
1385
- }
1386
- CONTROL_RE.lastIndex = index;
1387
- if (CONTROL_RE.test(input)) {
1388
- lengthExtra = CONTROL_RE.lastIndex - index;
1389
- widthExtra = lengthExtra * CONTROL_WIDTH;
1390
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
1391
- if (width + widthExtra > LIMIT) {
1392
- truncationEnabled = true;
1393
- break;
1394
- }
1395
- width += widthExtra;
1396
- unmatchedStart = indexPrev;
1397
- unmatchedEnd = index;
1398
- index = indexPrev = CONTROL_RE.lastIndex;
1399
- continue;
1400
- }
1401
- TAB_RE.lastIndex = index;
1402
- if (TAB_RE.test(input)) {
1403
- lengthExtra = TAB_RE.lastIndex - index;
1404
- widthExtra = lengthExtra * TAB_WIDTH;
1405
- if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
1406
- if (width + widthExtra > LIMIT) {
1407
- truncationEnabled = true;
1408
- break;
1409
- }
1410
- width += widthExtra;
1411
- unmatchedStart = indexPrev;
1412
- unmatchedEnd = index;
1413
- index = indexPrev = TAB_RE.lastIndex;
1414
- continue;
1415
- }
1416
- EMOJI_RE.lastIndex = index;
1417
- if (EMOJI_RE.test(input)) {
1418
- if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
1419
- if (width + EMOJI_WIDTH > LIMIT) {
1420
- truncationEnabled = true;
1421
- break;
1370
+ if (index >= length) break outer;
1371
+ for (let i = 0, l = PARSE_BLOCKS.length; i < l; i++) {
1372
+ const [BLOCK_RE, BLOCK_WIDTH] = PARSE_BLOCKS[i];
1373
+ BLOCK_RE.lastIndex = index;
1374
+ if (BLOCK_RE.test(input)) {
1375
+ lengthExtra = BLOCK_RE === CJKT_WIDE_RE ? getCodePointsLength(input.slice(index, BLOCK_RE.lastIndex)) : BLOCK_RE === EMOJI_RE$1 ? 1 : BLOCK_RE.lastIndex - index;
1376
+ widthExtra = lengthExtra * BLOCK_WIDTH;
1377
+ if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / BLOCK_WIDTH));
1378
+ if (width + widthExtra > LIMIT) {
1379
+ truncationEnabled = true;
1380
+ break outer;
1381
+ }
1382
+ width += widthExtra;
1383
+ unmatchedStart = indexPrev;
1384
+ unmatchedEnd = index;
1385
+ index = indexPrev = BLOCK_RE.lastIndex;
1386
+ continue outer;
1422
1387
  }
1423
- width += EMOJI_WIDTH;
1424
- unmatchedStart = indexPrev;
1425
- unmatchedEnd = index;
1426
- index = indexPrev = EMOJI_RE.lastIndex;
1427
- continue;
1428
1388
  }
1429
1389
  index += 1;
1430
1390
  }
@@ -1435,13 +1395,13 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
1435
1395
  ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
1436
1396
  };
1437
1397
  };
1438
- const NO_TRUNCATION = {
1398
+ const NO_TRUNCATION$2 = {
1439
1399
  limit: Infinity,
1440
1400
  ellipsis: "",
1441
1401
  ellipsisWidth: 0
1442
1402
  };
1443
- const fastStringWidth = (input, options = {}) => {
1444
- return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
1403
+ const fastStringWidth$1 = (input, options = {}) => {
1404
+ return getStringTruncatedWidth$1(input, NO_TRUNCATION$2, options).width;
1445
1405
  };
1446
1406
  const ESC = "\x1B";
1447
1407
  const CSI = "›";
@@ -1472,13 +1432,13 @@ const wrapWord = (rows, word, columns) => {
1472
1432
  let isInsideEscape = false;
1473
1433
  let isInsideLinkEscape = false;
1474
1434
  let lastRow = rows.at(-1);
1475
- let visible = lastRow === void 0 ? 0 : fastStringWidth(lastRow);
1435
+ let visible = lastRow === void 0 ? 0 : fastStringWidth$1(lastRow);
1476
1436
  let currentCharacter = characters.next();
1477
1437
  let nextCharacter = characters.next();
1478
1438
  let rawCharacterIndex = 0;
1479
1439
  while (!currentCharacter.done) {
1480
1440
  const character = currentCharacter.value;
1481
- const characterLength = fastStringWidth(character);
1441
+ const characterLength = fastStringWidth$1(character);
1482
1442
  if (visible + characterLength <= columns) rows[rows.length - 1] += character;
1483
1443
  else {
1484
1444
  rows.push(character);
@@ -1513,7 +1473,7 @@ const stringVisibleTrimSpacesRight = (string) => {
1513
1473
  const words = string.split(" ");
1514
1474
  let last = words.length;
1515
1475
  while (last) {
1516
- if (fastStringWidth(words[last - 1])) break;
1476
+ if (fastStringWidth$1(words[last - 1])) break;
1517
1477
  last--;
1518
1478
  }
1519
1479
  if (last === words.length) return string;
@@ -1534,7 +1494,7 @@ const exec = (string, columns, options = {}) => {
1534
1494
  const trimmed = row.trimStart();
1535
1495
  if (row.length !== trimmed.length) {
1536
1496
  rows[rows.length - 1] = trimmed;
1537
- rowLength = fastStringWidth(trimmed);
1497
+ rowLength = fastStringWidth$1(trimmed);
1538
1498
  }
1539
1499
  }
1540
1500
  if (index !== 0) {
@@ -1547,19 +1507,19 @@ const exec = (string, columns, options = {}) => {
1547
1507
  rowLength++;
1548
1508
  }
1549
1509
  }
1550
- const wordLength = fastStringWidth(word);
1510
+ const wordLength = fastStringWidth$1(word);
1551
1511
  if (options.hard && wordLength > columns) {
1552
1512
  const remainingColumns = columns - rowLength;
1553
1513
  const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
1554
1514
  if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
1555
1515
  wrapWord(rows, word, columns);
1556
- rowLength = fastStringWidth(rows.at(-1) ?? "");
1516
+ rowLength = fastStringWidth$1(rows.at(-1) ?? "");
1557
1517
  continue;
1558
1518
  }
1559
1519
  if (rowLength + wordLength > columns && rowLength && wordLength) {
1560
1520
  if (options.wordWrap === false && rowLength < columns) {
1561
1521
  wrapWord(rows, word, columns);
1562
- rowLength = fastStringWidth(rows.at(-1) ?? "");
1522
+ rowLength = fastStringWidth$1(rows.at(-1) ?? "");
1563
1523
  continue;
1564
1524
  }
1565
1525
  rows.push("");
@@ -1567,7 +1527,7 @@ const exec = (string, columns, options = {}) => {
1567
1527
  }
1568
1528
  if (rowLength + wordLength > columns && options.wordWrap === false) {
1569
1529
  wrapWord(rows, word, columns);
1570
- rowLength = fastStringWidth(rows.at(-1) ?? "");
1530
+ rowLength = fastStringWidth$1(rows.at(-1) ?? "");
1571
1531
  continue;
1572
1532
  }
1573
1533
  rows[rows.length - 1] += word;
@@ -1579,8 +1539,10 @@ const exec = (string, columns, options = {}) => {
1579
1539
  for (let i = 0; i < preString.length; i++) {
1580
1540
  const character = preString[i];
1581
1541
  returnValue += character;
1582
- if (!inSurrogate) inSurrogate = character >= "\ud800" && character <= "\udbff";
1583
- else continue;
1542
+ if (!inSurrogate) {
1543
+ inSurrogate = character >= "\ud800" && character <= "\udbff";
1544
+ if (inSurrogate) continue;
1545
+ } else inSurrogate = false;
1584
1546
  if (character === ESC || character === CSI) {
1585
1547
  GROUP_REGEX.lastIndex = i + 1;
1586
1548
  const groups = GROUP_REGEX.exec(preString)?.groups;
@@ -2121,7 +2083,7 @@ const text = (opts) => {
2121
2083
  }).prompt();
2122
2084
  };
2123
2085
  //#endregion
2124
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/constants.js
2086
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js
2125
2087
  var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2126
2088
  const SEMVER_SPEC_VERSION = "2.0.0";
2127
2089
  const MAX_LENGTH = 256;
@@ -2146,12 +2108,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2146
2108
  };
2147
2109
  }));
2148
2110
  //#endregion
2149
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/debug.js
2111
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js
2150
2112
  var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2151
2113
  module.exports = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {};
2152
2114
  }));
2153
2115
  //#endregion
2154
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/re.js
2116
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
2155
2117
  var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2156
2118
  const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
2157
2119
  const debug = require_debug();
@@ -2230,7 +2192,7 @@ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2230
2192
  createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
2231
2193
  }));
2232
2194
  //#endregion
2233
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/parse-options.js
2195
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
2234
2196
  var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2235
2197
  const looseOption = Object.freeze({ loose: true });
2236
2198
  const emptyOpts = Object.freeze({});
@@ -2242,7 +2204,7 @@ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) =>
2242
2204
  module.exports = parseOptions;
2243
2205
  }));
2244
2206
  //#endregion
2245
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/identifiers.js
2207
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
2246
2208
  var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2247
2209
  const numeric = /^[0-9]+$/;
2248
2210
  const compareIdentifiers = (a, b) => {
@@ -2262,13 +2224,19 @@ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2262
2224
  };
2263
2225
  }));
2264
2226
  //#endregion
2265
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/semver.js
2227
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
2266
2228
  var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2267
2229
  const debug = require_debug();
2268
2230
  const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
2269
2231
  const { safeRe: re, t } = require_re();
2270
2232
  const parseOptions = require_parse_options();
2271
2233
  const { compareIdentifiers } = require_identifiers();
2234
+ const isPrereleaseIdentifier = (prerelease, identifier) => {
2235
+ const identifiers = identifier.split(".");
2236
+ if (identifiers.length > prerelease.length) return false;
2237
+ for (let i = 0; i < identifiers.length; i++) if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) return false;
2238
+ return true;
2239
+ };
2272
2240
  module.exports = class SemVer {
2273
2241
  constructor(version, options) {
2274
2242
  options = parseOptions(options);
@@ -2425,8 +2393,9 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2425
2393
  if (identifier) {
2426
2394
  let prerelease = [identifier, base];
2427
2395
  if (identifierBase === false) prerelease = [identifier];
2428
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
2429
- if (isNaN(this.prerelease[1])) this.prerelease = prerelease;
2396
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
2397
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
2398
+ if (isNaN(prereleaseBase)) this.prerelease = prerelease;
2430
2399
  } else this.prerelease = prerelease;
2431
2400
  }
2432
2401
  break;
@@ -2440,7 +2409,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2440
2409
  };
2441
2410
  }));
2442
2411
  //#endregion
2443
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/parse.js
2412
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
2444
2413
  var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2445
2414
  const SemVer = require_semver$1();
2446
2415
  const parse = (version, options, throwErrors = false) => {
@@ -2455,7 +2424,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2455
2424
  module.exports = parse;
2456
2425
  }));
2457
2426
  //#endregion
2458
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/valid.js
2427
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
2459
2428
  var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2460
2429
  const parse = require_parse();
2461
2430
  const valid = (version, options) => {
@@ -2465,7 +2434,7 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2465
2434
  module.exports = valid;
2466
2435
  }));
2467
2436
  //#endregion
2468
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/clean.js
2437
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
2469
2438
  var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2470
2439
  const parse = require_parse();
2471
2440
  const clean = (version, options) => {
@@ -2475,7 +2444,7 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2475
2444
  module.exports = clean;
2476
2445
  }));
2477
2446
  //#endregion
2478
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/inc.js
2447
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
2479
2448
  var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2480
2449
  const SemVer = require_semver$1();
2481
2450
  const inc = (version, release, options, identifier, identifierBase) => {
@@ -2493,7 +2462,7 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2493
2462
  module.exports = inc;
2494
2463
  }));
2495
2464
  //#endregion
2496
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/diff.js
2465
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
2497
2466
  var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2498
2467
  const parse = require_parse();
2499
2468
  const diff = (version1, version2) => {
@@ -2521,28 +2490,28 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2521
2490
  module.exports = diff;
2522
2491
  }));
2523
2492
  //#endregion
2524
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/major.js
2493
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
2525
2494
  var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2526
2495
  const SemVer = require_semver$1();
2527
2496
  const major = (a, loose) => new SemVer(a, loose).major;
2528
2497
  module.exports = major;
2529
2498
  }));
2530
2499
  //#endregion
2531
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/minor.js
2500
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
2532
2501
  var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2533
2502
  const SemVer = require_semver$1();
2534
2503
  const minor = (a, loose) => new SemVer(a, loose).minor;
2535
2504
  module.exports = minor;
2536
2505
  }));
2537
2506
  //#endregion
2538
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/patch.js
2507
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
2539
2508
  var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2540
2509
  const SemVer = require_semver$1();
2541
2510
  const patch = (a, loose) => new SemVer(a, loose).patch;
2542
2511
  module.exports = patch;
2543
2512
  }));
2544
2513
  //#endregion
2545
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/prerelease.js
2514
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
2546
2515
  var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2547
2516
  const parse = require_parse();
2548
2517
  const prerelease = (version, options) => {
@@ -2552,28 +2521,28 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2552
2521
  module.exports = prerelease;
2553
2522
  }));
2554
2523
  //#endregion
2555
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare.js
2524
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
2556
2525
  var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2557
2526
  const SemVer = require_semver$1();
2558
2527
  const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
2559
2528
  module.exports = compare;
2560
2529
  }));
2561
2530
  //#endregion
2562
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rcompare.js
2531
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
2563
2532
  var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2564
2533
  const compare = require_compare();
2565
2534
  const rcompare = (a, b, loose) => compare(b, a, loose);
2566
2535
  module.exports = rcompare;
2567
2536
  }));
2568
2537
  //#endregion
2569
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-loose.js
2538
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
2570
2539
  var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2571
2540
  const compare = require_compare();
2572
2541
  const compareLoose = (a, b) => compare(a, b, true);
2573
2542
  module.exports = compareLoose;
2574
2543
  }));
2575
2544
  //#endregion
2576
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/compare-build.js
2545
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
2577
2546
  var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2578
2547
  const SemVer = require_semver$1();
2579
2548
  const compareBuild = (a, b, loose) => {
@@ -2584,63 +2553,63 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
2584
2553
  module.exports = compareBuild;
2585
2554
  }));
2586
2555
  //#endregion
2587
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/sort.js
2556
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
2588
2557
  var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2589
2558
  const compareBuild = require_compare_build();
2590
2559
  const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
2591
2560
  module.exports = sort;
2592
2561
  }));
2593
2562
  //#endregion
2594
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/rsort.js
2563
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
2595
2564
  var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2596
2565
  const compareBuild = require_compare_build();
2597
2566
  const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
2598
2567
  module.exports = rsort;
2599
2568
  }));
2600
2569
  //#endregion
2601
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gt.js
2570
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
2602
2571
  var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2603
2572
  const compare = require_compare();
2604
2573
  const gt = (a, b, loose) => compare(a, b, loose) > 0;
2605
2574
  module.exports = gt;
2606
2575
  }));
2607
2576
  //#endregion
2608
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lt.js
2577
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
2609
2578
  var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2610
2579
  const compare = require_compare();
2611
2580
  const lt = (a, b, loose) => compare(a, b, loose) < 0;
2612
2581
  module.exports = lt;
2613
2582
  }));
2614
2583
  //#endregion
2615
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/eq.js
2584
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
2616
2585
  var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2617
2586
  const compare = require_compare();
2618
2587
  const eq = (a, b, loose) => compare(a, b, loose) === 0;
2619
2588
  module.exports = eq;
2620
2589
  }));
2621
2590
  //#endregion
2622
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/neq.js
2591
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
2623
2592
  var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2624
2593
  const compare = require_compare();
2625
2594
  const neq = (a, b, loose) => compare(a, b, loose) !== 0;
2626
2595
  module.exports = neq;
2627
2596
  }));
2628
2597
  //#endregion
2629
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/gte.js
2598
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
2630
2599
  var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2631
2600
  const compare = require_compare();
2632
2601
  const gte = (a, b, loose) => compare(a, b, loose) >= 0;
2633
2602
  module.exports = gte;
2634
2603
  }));
2635
2604
  //#endregion
2636
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/lte.js
2605
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
2637
2606
  var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2638
2607
  const compare = require_compare();
2639
2608
  const lte = (a, b, loose) => compare(a, b, loose) <= 0;
2640
2609
  module.exports = lte;
2641
2610
  }));
2642
2611
  //#endregion
2643
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/cmp.js
2612
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
2644
2613
  var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2645
2614
  const eq = require_eq();
2646
2615
  const neq = require_neq();
@@ -2672,7 +2641,7 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2672
2641
  module.exports = cmp;
2673
2642
  }));
2674
2643
  //#endregion
2675
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/coerce.js
2644
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
2676
2645
  var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2677
2646
  const SemVer = require_semver$1();
2678
2647
  const parse = require_parse();
@@ -2700,7 +2669,7 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2700
2669
  module.exports = coerce;
2701
2670
  }));
2702
2671
  //#endregion
2703
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/truncate.js
2672
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
2704
2673
  var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2705
2674
  const parse = require_parse();
2706
2675
  const constants = require_constants();
@@ -2733,7 +2702,7 @@ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2733
2702
  module.exports = truncate;
2734
2703
  }));
2735
2704
  //#endregion
2736
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/internal/lrucache.js
2705
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/lrucache.js
2737
2706
  var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2738
2707
  var LRUCache = class {
2739
2708
  constructor() {
@@ -2766,7 +2735,7 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2766
2735
  module.exports = LRUCache;
2767
2736
  }));
2768
2737
  //#endregion
2769
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/range.js
2738
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js
2770
2739
  var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2771
2740
  const SPACE_CHARACTERS = /\s+/g;
2772
2741
  module.exports = class Range {
@@ -2820,6 +2789,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2820
2789
  return this.range;
2821
2790
  }
2822
2791
  parseRange(range) {
2792
+ range = range.replace(BUILDSTRIPRE, "");
2823
2793
  const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
2824
2794
  const cached = cache.get(memoKey);
2825
2795
  if (cached) return cached;
@@ -2878,8 +2848,9 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2878
2848
  const Comparator = require_comparator();
2879
2849
  const debug = require_debug();
2880
2850
  const SemVer = require_semver$1();
2881
- const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
2851
+ const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
2882
2852
  const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
2853
+ const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
2883
2854
  const isNullSet = (c) => c.value === "<0.0.0-0";
2884
2855
  const isAny = (c) => c.value === "";
2885
2856
  const isSatisfiable = (comparators, options) => {
@@ -2908,6 +2879,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2908
2879
  return comp;
2909
2880
  };
2910
2881
  const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
2882
+ const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
2911
2883
  const replaceTildes = (comp, options) => {
2912
2884
  return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
2913
2885
  };
@@ -2948,8 +2920,8 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2948
2920
  else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
2949
2921
  } else {
2950
2922
  debug("no pr");
2951
- if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
2952
- else ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
2923
+ if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
2924
+ else ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
2953
2925
  else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
2954
2926
  }
2955
2927
  debug("caret return", ret);
@@ -2965,6 +2937,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2965
2937
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
2966
2938
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
2967
2939
  debug("xRange", comp, ret, gtlt, M, m, p, pr);
2940
+ if (invalidXRangeOrder(M, m, p)) return comp;
2968
2941
  const xM = isX(M);
2969
2942
  const xm = xM || isX(m);
2970
2943
  const xp = xm || isX(p);
@@ -3038,7 +3011,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3038
3011
  };
3039
3012
  }));
3040
3013
  //#endregion
3041
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/classes/comparator.js
3014
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js
3042
3015
  var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3043
3016
  const ANY = Symbol("SemVer ANY");
3044
3017
  module.exports = class Comparator {
@@ -3108,7 +3081,7 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3108
3081
  const Range = require_range();
3109
3082
  }));
3110
3083
  //#endregion
3111
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/functions/satisfies.js
3084
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
3112
3085
  var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3113
3086
  const Range = require_range();
3114
3087
  const satisfies = (version, range, options) => {
@@ -3122,14 +3095,14 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3122
3095
  module.exports = satisfies;
3123
3096
  }));
3124
3097
  //#endregion
3125
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/to-comparators.js
3098
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
3126
3099
  var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3127
3100
  const Range = require_range();
3128
3101
  const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
3129
3102
  module.exports = toComparators;
3130
3103
  }));
3131
3104
  //#endregion
3132
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/max-satisfying.js
3105
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
3133
3106
  var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3134
3107
  const SemVer = require_semver$1();
3135
3108
  const Range = require_range();
@@ -3155,7 +3128,7 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
3155
3128
  module.exports = maxSatisfying;
3156
3129
  }));
3157
3130
  //#endregion
3158
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-satisfying.js
3131
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
3159
3132
  var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3160
3133
  const SemVer = require_semver$1();
3161
3134
  const Range = require_range();
@@ -3181,7 +3154,7 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
3181
3154
  module.exports = minSatisfying;
3182
3155
  }));
3183
3156
  //#endregion
3184
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/min-version.js
3157
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-version.js
3185
3158
  var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3186
3159
  const SemVer = require_semver$1();
3187
3160
  const Range = require_range();
@@ -3221,7 +3194,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3221
3194
  module.exports = minVersion;
3222
3195
  }));
3223
3196
  //#endregion
3224
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/valid.js
3197
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/valid.js
3225
3198
  var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3226
3199
  const Range = require_range();
3227
3200
  const validRange = (range, options) => {
@@ -3234,7 +3207,7 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3234
3207
  module.exports = validRange;
3235
3208
  }));
3236
3209
  //#endregion
3237
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/outside.js
3210
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/outside.js
3238
3211
  var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3239
3212
  const SemVer = require_semver$1();
3240
3213
  const Comparator = require_comparator();
@@ -3287,21 +3260,21 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3287
3260
  module.exports = outside;
3288
3261
  }));
3289
3262
  //#endregion
3290
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/gtr.js
3263
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
3291
3264
  var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3292
3265
  const outside = require_outside();
3293
3266
  const gtr = (version, range, options) => outside(version, range, ">", options);
3294
3267
  module.exports = gtr;
3295
3268
  }));
3296
3269
  //#endregion
3297
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/ltr.js
3270
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
3298
3271
  var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3299
3272
  const outside = require_outside();
3300
3273
  const ltr = (version, range, options) => outside(version, range, "<", options);
3301
3274
  module.exports = ltr;
3302
3275
  }));
3303
3276
  //#endregion
3304
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/intersects.js
3277
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
3305
3278
  var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3306
3279
  const Range = require_range();
3307
3280
  const intersects = (r1, r2, options) => {
@@ -3312,7 +3285,7 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3312
3285
  module.exports = intersects;
3313
3286
  }));
3314
3287
  //#endregion
3315
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/simplify.js
3288
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
3316
3289
  var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3317
3290
  const satisfies = require_satisfies();
3318
3291
  const compare = require_compare();
@@ -3342,7 +3315,7 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3342
3315
  };
3343
3316
  }));
3344
3317
  //#endregion
3345
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/ranges/subset.js
3318
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
3346
3319
  var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3347
3320
  const Range = require_range();
3348
3321
  const Comparator = require_comparator();
@@ -3406,7 +3379,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3406
3379
  if (c.operator === ">" || c.operator === ">=") {
3407
3380
  higher = higherGT(gt, c, options);
3408
3381
  if (higher === c && higher !== gt) return false;
3409
- } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c), options)) return false;
3382
+ } else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
3410
3383
  }
3411
3384
  if (lt) {
3412
3385
  if (needDomLTPre) {
@@ -3415,7 +3388,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3415
3388
  if (c.operator === "<" || c.operator === "<=") {
3416
3389
  lower = lowerLT(lt, c, options);
3417
3390
  if (lower === c && lower !== lt) return false;
3418
- } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c), options)) return false;
3391
+ } else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
3419
3392
  }
3420
3393
  if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
3421
3394
  }
@@ -3437,7 +3410,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3437
3410
  module.exports = subset;
3438
3411
  }));
3439
3412
  //#endregion
3440
- //#region ../../node_modules/.pnpm/semver@7.8.0/node_modules/semver/index.js
3413
+ //#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/index.js
3441
3414
  var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3442
3415
  const internalRe = require_re();
3443
3416
  const constants = require_constants();
@@ -3507,8 +3480,371 @@ const DependencyType = {
3507
3480
  optionalDependencies: "optionalDependencies"
3508
3481
  };
3509
3482
  //#endregion
3510
- //#region src/utils/prompts.ts
3483
+ //#region src/utils/spinner.ts
3511
3484
  var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
3485
+ function getSpinner(interactive) {
3486
+ if (interactive) return spinner();
3487
+ return {
3488
+ start: (msg) => {
3489
+ if (msg) log.info(msg);
3490
+ },
3491
+ stop: (msg) => {
3492
+ if (msg) log.info(msg);
3493
+ },
3494
+ message: (msg) => {
3495
+ if (msg) log.info(msg);
3496
+ }
3497
+ };
3498
+ }
3499
+ function getSilentSpinner() {
3500
+ return {
3501
+ start: () => {},
3502
+ stop: () => {},
3503
+ message: () => {}
3504
+ };
3505
+ }
3506
+ //#endregion
3507
+ //#region src/utils/approve-builds.ts
3508
+ /**
3509
+ * pnpm prints this prefix whenever it gates a dependency's build (install /
3510
+ * postinstall) script behind explicit approval. It appears both in the pnpm
3511
+ * >= 11 hard-error line (`[ERR_PNPM_IGNORED_BUILDS] Ignored build scripts:
3512
+ * better-sqlite3@11.0.0, esbuild@0.25.0`) and the pnpm 10 warning box
3513
+ * (`Ignored build scripts: esbuild.`).
3514
+ */
3515
+ const IGNORED_BUILDS_MARKER = "Ignored build scripts:";
3516
+ /** pnpm >= 11 turns the gated-builds warning into a hard exit-1 with this code. */
3517
+ const IGNORED_BUILDS_ERROR_CODE = "ERR_PNPM_IGNORED_BUILDS";
3518
+ /** Box-drawing / list characters pnpm wraps the pnpm-10 warning message in. */
3519
+ const BOX_CHARS = /[│|╮╯╰╭─]/gu;
3520
+ /** Non-global form, for testing whether a line is a box-bordered continuation. */
3521
+ const BOX_LINE = /[│|╮╯╰╭─]/u;
3522
+ function isPnpmIgnoredBuildsError(output) {
3523
+ return output.includes(IGNORED_BUILDS_ERROR_CODE);
3524
+ }
3525
+ /**
3526
+ * Strip a trailing `@version` from a (possibly scoped) package spec.
3527
+ * `better-sqlite3@11.0.0` -> `better-sqlite3`, `@scope/pkg@1.2.3` ->
3528
+ * `@scope/pkg`, `esbuild` -> `esbuild`.
3529
+ */
3530
+ function stripPackageVersion(spec) {
3531
+ const at = spec.lastIndexOf("@");
3532
+ return at > 0 ? spec.slice(0, at) : spec;
3533
+ }
3534
+ /**
3535
+ * Collect the name `extract` pulls from each item, dropping empties and
3536
+ * duplicates while preserving first-seen order. The three install-output
3537
+ * parsers (pnpm / bun / yarn) differ only in how a name is read from each token
3538
+ * or line; this captures their shared dedupe-in-order loop.
3539
+ */
3540
+ function dedupeNames(items, extract) {
3541
+ const names = [];
3542
+ const seen = /* @__PURE__ */ new Set();
3543
+ for (const item of items) {
3544
+ const name = extract(item);
3545
+ if (!name || seen.has(name)) continue;
3546
+ seen.add(name);
3547
+ names.push(name);
3548
+ }
3549
+ return names;
3550
+ }
3551
+ /**
3552
+ * Parse the package names pnpm reports under "Ignored build scripts:" from
3553
+ * captured install output. Handles both the pnpm >= 11 single-line error and
3554
+ * the pnpm 10 boxed warning, strips version suffixes, and dedupes while
3555
+ * preserving first-seen order. Returns `[]` when the marker is absent.
3556
+ */
3557
+ function parseIgnoredBuilds(output) {
3558
+ if (!output) return [];
3559
+ const clean = stripVTControlCharacters(output);
3560
+ const markerIndex = clean.indexOf(IGNORED_BUILDS_MARKER);
3561
+ if (markerIndex === -1) return [];
3562
+ const lines = clean.slice(markerIndex + 22).split("\n");
3563
+ const listLines = [];
3564
+ for (const line of lines) {
3565
+ if (listLines.length > 0 && (/approve-builds/u.test(line) || !BOX_LINE.test(line))) break;
3566
+ listLines.push(line);
3567
+ }
3568
+ const segment = listLines.join(" ").replace(BOX_CHARS, " ").replace(/[.\s]+$/u, "").trim();
3569
+ if (!segment) return [];
3570
+ return dedupeNames(segment.split(","), (rawToken) => {
3571
+ const token = rawToken.trim();
3572
+ return token ? stripPackageVersion(token) : null;
3573
+ });
3574
+ }
3575
+ /**
3576
+ * Parse the package names from `bun pm untrusted` output. bun does not hard-fail
3577
+ * on gated builds; after install it lists each blocked package on its own line
3578
+ * as `./node_modules/<name> @<version>` (scoped: `@scope/pkg`, nested:
3579
+ * `./node_modules/a/node_modules/b`). The name after the last `node_modules/`
3580
+ * is what `bun pm trust` expects. Returns deduped names in first-seen order;
3581
+ * `[]` when nothing is blocked.
3582
+ */
3583
+ function parseBunUntrusted(output) {
3584
+ if (!output) return [];
3585
+ return dedupeNames(output.split("\n"), (rawLine) => {
3586
+ const line = rawLine.trim();
3587
+ if (!line.startsWith("./node_modules/") && !line.startsWith("node_modules/")) return null;
3588
+ const match = line.slice(line.lastIndexOf("node_modules/") + 13).match(/^(@?[^\s]+) @[^\s]+$/u);
3589
+ return match ? match[1] : null;
3590
+ });
3591
+ }
3592
+ const YARN_DISABLED_BUILDS_MARKER = "lists build scripts, but all build scripts have been disabled";
3593
+ /**
3594
+ * Yarn (Berry) gates build scripts when `enableScripts` is false: each gated
3595
+ * package is reported on its own line as `<descriptor> lists build scripts, but
3596
+ * all build scripts have been disabled` (e.g. `core-js@npm:3.39.0 lists build
3597
+ * scripts...`). Yarn does not fail the install. Returns deduped package names.
3598
+ */
3599
+ function parseYarnDisabledBuilds(output) {
3600
+ if (!output) return [];
3601
+ return dedupeNames(output.split("\n"), (rawLine) => {
3602
+ const line = stripVTControlCharacters(rawLine);
3603
+ const markerIndex = line.indexOf(YARN_DISABLED_BUILDS_MARKER);
3604
+ if (markerIndex === -1) return null;
3605
+ return yarnDescriptorName(line.slice(0, markerIndex).trim().split(/\s+/u).filter((token) => token && !/^\[[0-9a-f]+\]$/u.test(token)).pop() ?? "");
3606
+ });
3607
+ }
3608
+ /**
3609
+ * Extract the package name from a yarn descriptor by dropping the trailing
3610
+ * `@<range>`: `core-js@npm:3.39.0` -> `core-js`, `@scope/pkg@npm:1.0.0` ->
3611
+ * `@scope/pkg`.
3612
+ */
3613
+ function yarnDescriptorName(descriptor) {
3614
+ const match = descriptor.match(/^(@[^@/]+\/[^@]+|[^@]+)@/u);
3615
+ return match ? match[1] : descriptor;
3616
+ }
3617
+ /**
3618
+ * Parse the gated build-script package names from an install log, dispatching on
3619
+ * the package manager: pnpm prints `Ignored build scripts:`, yarn prints
3620
+ * `... build scripts have been disabled`. bun is not parsed here (its blocked
3621
+ * packages are queried separately via `bun pm untrusted`).
3622
+ */
3623
+ function parseInstallGatedBuilds(output, packageManager) {
3624
+ if (packageManager === PackageManager.pnpm) return parseIgnoredBuilds(output);
3625
+ if (packageManager === PackageManager.yarn) return parseYarnDisabledBuilds(output);
3626
+ return [];
3627
+ }
3628
+ /**
3629
+ * Collect the names a project directly depends on (the dependencies it can
3630
+ * meaningfully approve). peerDependencies are intentionally excluded: they are
3631
+ * not installed into the project's own tree.
3632
+ */
3633
+ function collectDirectDependencyNames(pkg) {
3634
+ const names = /* @__PURE__ */ new Set();
3635
+ if (!pkg) return names;
3636
+ for (const field of [
3637
+ "dependencies",
3638
+ "devDependencies",
3639
+ "optionalDependencies"
3640
+ ]) {
3641
+ const deps = pkg[field];
3642
+ if (deps && typeof deps === "object") for (const [name, spec] of Object.entries(deps)) {
3643
+ names.add(name);
3644
+ if (typeof spec === "string" && spec.startsWith("npm:")) {
3645
+ const aliased = stripPackageVersion(spec.slice(4));
3646
+ if (aliased) names.add(aliased);
3647
+ }
3648
+ }
3649
+ }
3650
+ return names;
3651
+ }
3652
+ function filterToDirectDependencies(ignored, direct) {
3653
+ return ignored.filter((name) => direct.has(name));
3654
+ }
3655
+ /**
3656
+ * pnpm gained positional `approve-builds <pkg>` in pnpm 11; pnpm 10 only accepts
3657
+ * `--all` (and otherwise opens an interactive picker), so a non-interactive
3658
+ * positional approve there silently does nothing. When the version is unknown,
3659
+ * assume a modern pnpm (vp provisions 11+).
3660
+ */
3661
+ function pnpmSupportsPositionalApprove(version) {
3662
+ if (!version) return true;
3663
+ const major = Number.parseInt(version, 10);
3664
+ return Number.isNaN(major) || major >= 11;
3665
+ }
3666
+ /** Package managers that gate build scripts and expose an approval workflow. */
3667
+ const GATED_BUILD_PACKAGE_MANAGERS = new Set([
3668
+ PackageManager.pnpm,
3669
+ PackageManager.bun,
3670
+ PackageManager.yarn
3671
+ ]);
3672
+ /**
3673
+ * Narrow a package manager's gated builds down to the ones worth surfacing
3674
+ * during `vp create`: packages the generated project depends on directly.
3675
+ * Transitive gated builds (e.g. `esbuild` pulled in by Vite) are noise the user
3676
+ * did not choose, so they are dropped. Returns `[]` for package managers that
3677
+ * do not gate build scripts (npm, yarn classic), since there is nothing to
3678
+ * approve.
3679
+ */
3680
+ function resolveApproveBuildTargets(projectDir, pendingBuilds, packageManager) {
3681
+ if (!packageManager || !GATED_BUILD_PACKAGE_MANAGERS.has(packageManager) || !pendingBuilds || pendingBuilds.length === 0) return [];
3682
+ let pkg;
3683
+ try {
3684
+ pkg = readJsonFile(path.join(projectDir, "package.json"));
3685
+ } catch {
3686
+ return [];
3687
+ }
3688
+ const direct = collectDirectDependencyNames(pkg);
3689
+ return filterToDirectDependencies([...new Set(pendingBuilds)], direct);
3690
+ }
3691
+ /**
3692
+ * Enumerate the packages whose build scripts a package manager gated during the
3693
+ * install, as raw names (still unfiltered by direct dependency).
3694
+ *
3695
+ * - pnpm and yarn report them in their install output, so the names are parsed
3696
+ * there (see {@link parseInstallGatedBuilds}) and passed in via
3697
+ * `pendingBuildsFromInstall`.
3698
+ * - bun exits 0 and only prints a count, so `bun pm untrusted` is queried here.
3699
+ *
3700
+ * Other package managers run build scripts by default and return `[]`.
3701
+ */
3702
+ async function detectGatedBuilds(installCwd, packageManager, pendingBuildsFromInstall) {
3703
+ if (packageManager === PackageManager.pnpm || packageManager === PackageManager.yarn) return pendingBuildsFromInstall ?? [];
3704
+ if (packageManager === PackageManager.bun) {
3705
+ const { exitCode, stdout, stderr } = await runCommandSilently({
3706
+ command: process.env.VP_CLI_BIN ?? "vp",
3707
+ args: [
3708
+ "exec",
3709
+ "bun",
3710
+ "pm",
3711
+ "untrusted"
3712
+ ],
3713
+ cwd: installCwd,
3714
+ envs: process.env
3715
+ });
3716
+ if (exitCode !== 0) return [];
3717
+ return parseBunUntrusted(`${stdout.toString()}\n${stderr.toString()}`);
3718
+ }
3719
+ return [];
3720
+ }
3721
+ function lastLines(text, count) {
3722
+ return text.split("\n").slice(-count).join("\n");
3723
+ }
3724
+ function printApproveBuildsGuidance(targets, packageManager) {
3725
+ log.warn(`Build scripts were not run for: ${accent(targets.join(", "))}.`);
3726
+ if (packageManager === PackageManager.yarn) {
3727
+ log.info(`These dependencies may not work until built. Enable them in the workspace root package.json (${accent("dependenciesMeta.<pkg>.built: true")}) and reinstall, or re-create with ${accent("--approve-builds")}.`);
3728
+ return;
3729
+ }
3730
+ const command = packageManager === PackageManager.bun ? `vp pm approve-builds ${targets.join(" ")}` : "vp pm approve-builds";
3731
+ log.info(`These dependencies may not work until built. Run ${accent(command)} in the project to approve them, or re-create with ${accent("--approve-builds")}.`);
3732
+ }
3733
+ /**
3734
+ * Run a `vp` build/approval command and report the outcome through a spinner.
3735
+ * On failure the approval has still been recorded (pnpm/bun config or yarn's
3736
+ * `dependenciesMeta`), so the retry hint points back at `vp install`. Returns
3737
+ * `true` when the command succeeded, `false` when the build exited non-zero.
3738
+ */
3739
+ async function runBuildAndReport(args, cwd, packages, interactive, silent, extraEnv) {
3740
+ const spinner = silent ? getSilentSpinner() : getSpinner(interactive);
3741
+ spinner.start(`Building ${packages.join(", ")}...`);
3742
+ const { exitCode, stdout, stderr } = await runCommandSilently({
3743
+ command: process.env.VP_CLI_BIN ?? "vp",
3744
+ args,
3745
+ cwd,
3746
+ envs: extraEnv ? {
3747
+ ...process.env,
3748
+ ...extraEnv
3749
+ } : process.env
3750
+ });
3751
+ if (exitCode === 0) {
3752
+ spinner.stop(`Built ${packages.join(", ")}`);
3753
+ return true;
3754
+ }
3755
+ spinner.stop(`Build failed for ${packages.join(", ")}`);
3756
+ const output = `${stdout.toString()}\n${stderr.toString()}`.trim();
3757
+ if (output) log.info(lastLines(output, 20));
3758
+ log.warn(`Build scripts failed for ${accent(packages.join(", "))}. They were approved; fix the build toolchain and run ${accent("vp install")} to retry.`);
3759
+ return false;
3760
+ }
3761
+ /**
3762
+ * Mark each package as build-allowed in yarn's `dependenciesMeta[<pkg>].built`,
3763
+ * preserving existing metadata. Guards against a non-object container or
3764
+ * per-package value so a hand-authored scalar doesn't corrupt package.json.
3765
+ * Mutates and returns `pkg`.
3766
+ */
3767
+ function addYarnBuiltDependenciesMeta(pkg, packages) {
3768
+ const existing = pkg.dependenciesMeta;
3769
+ const meta = existing && typeof existing === "object" ? { ...existing } : {};
3770
+ for (const name of packages) {
3771
+ const current = meta[name];
3772
+ meta[name] = {
3773
+ ...current && typeof current === "object" ? current : {},
3774
+ built: true
3775
+ };
3776
+ }
3777
+ pkg.dependenciesMeta = meta;
3778
+ return pkg;
3779
+ }
3780
+ /**
3781
+ * Approve gated builds for yarn. Unlike pnpm/bun, yarn has no `approve-builds`
3782
+ * command: a package's build is enabled by setting `dependenciesMeta[name].built`
3783
+ * to true in package.json, after which a reinstall runs its build script.
3784
+ *
3785
+ * The metadata is written to the install root's manifest (`installCwd`), not the
3786
+ * created package: yarn only honors `dependenciesMeta.<pkg>.built` from the
3787
+ * workspace root, so a child-package entry is ignored and the build never runs.
3788
+ */
3789
+ async function approveYarnBuilds(installCwd, packages, interactive, silent) {
3790
+ const pkgPath = path.join(installCwd, "package.json");
3791
+ let pkg;
3792
+ try {
3793
+ pkg = readJsonFile(pkgPath);
3794
+ } catch {
3795
+ printApproveBuildsGuidance(packages, PackageManager.yarn);
3796
+ return true;
3797
+ }
3798
+ writeJsonFile(pkgPath, addYarnBuiltDependenciesMeta(pkg, packages));
3799
+ return runBuildAndReport(["install"], installCwd, packages, interactive, silent, { YARN_ENABLE_IMMUTABLE_INSTALLS: "false" });
3800
+ }
3801
+ /**
3802
+ * Surface pnpm's gated build scripts after a `vp create` install and let the
3803
+ * user act on them:
3804
+ * - `--approve-builds`: approve + build every target, no prompt.
3805
+ * - interactive: a default-off multiselect so each package is approved
3806
+ * individually (pnpm gates them for security, so nothing is opt-in by
3807
+ * default).
3808
+ * - non-interactive: print guidance pointing at `vp pm approve-builds`.
3809
+ *
3810
+ * Returns `false` only when an approved build actually ran and failed (so a
3811
+ * non-interactive `--approve-builds` caller can surface a non-zero exit);
3812
+ * approving nothing or printing guidance returns `true`.
3813
+ */
3814
+ async function approveBuilds(options) {
3815
+ const { cwd, packageManager, packageManagerVersion, targets, interactive, autoApprove, silent = false } = options;
3816
+ if (targets.length === 0) return true;
3817
+ let selected;
3818
+ if (autoApprove) selected = targets;
3819
+ else if (interactive) {
3820
+ const answer = await multiselect({
3821
+ message: "These dependencies have build scripts (e.g. native builds) that were not run. Select which to approve and build:",
3822
+ options: targets.map((name) => ({
3823
+ value: name,
3824
+ label: name
3825
+ })),
3826
+ initialValues: [],
3827
+ required: false
3828
+ });
3829
+ selected = R(answer) ? [] : answer;
3830
+ } else selected = [];
3831
+ if (selected.length === 0) {
3832
+ printApproveBuildsGuidance(targets, packageManager);
3833
+ return true;
3834
+ }
3835
+ if (packageManager === PackageManager.yarn) return approveYarnBuilds(cwd, selected, interactive, silent);
3836
+ if (packageManager === PackageManager.pnpm && !pnpmSupportsPositionalApprove(packageManagerVersion)) {
3837
+ printApproveBuildsGuidance(selected, packageManager);
3838
+ return !(autoApprove && !interactive);
3839
+ }
3840
+ return runBuildAndReport([
3841
+ "pm",
3842
+ "approve-builds",
3843
+ ...selected
3844
+ ], cwd, selected, interactive, silent);
3845
+ }
3846
+ //#endregion
3847
+ //#region src/utils/prompts.ts
3512
3848
  /**
3513
3849
  * pnpm v11 promoted `ERR_PNPM_IGNORED_BUILDS` from a warning to a hard
3514
3850
  * exit-1. Auto-installs run by `vp migrate` / `vp create` happen before the
@@ -3564,8 +3900,9 @@ async function runViteInstall(cwd, interactive, extraArgs, options) {
3564
3900
  durationMs: 0,
3565
3901
  status: "skipped"
3566
3902
  };
3903
+ const detectIgnoredBuilds = options?.detectIgnoredBuilds === true;
3567
3904
  const installArgs = [...extraArgs ?? []];
3568
- if (shouldIgnoreScriptsForAutoInstall(options?.packageManager, options?.packageManagerVersion) && !installArgs.includes("--ignore-scripts")) installArgs.push("--ignore-scripts");
3905
+ if (!detectIgnoredBuilds && shouldIgnoreScriptsForAutoInstall(options?.packageManager, options?.packageManagerVersion) && !installArgs.includes("--ignore-scripts")) installArgs.push("--ignore-scripts");
3569
3906
  const spinner = options?.silent ? getSilentSpinner() : getSpinner(interactive);
3570
3907
  const startTime = Date.now();
3571
3908
  spinner.start(`Installing dependencies...`);
@@ -3575,12 +3912,16 @@ async function runViteInstall(cwd, interactive, extraArgs, options) {
3575
3912
  cwd,
3576
3913
  envs: process.env
3577
3914
  });
3578
- if (exitCode === 0) {
3915
+ const combinedOutput = `${stdout.toString()}\n${stderr.toString()}`;
3916
+ const pendingBuilds = detectIgnoredBuilds ? parseInstallGatedBuilds(combinedOutput, options?.packageManager) : void 0;
3917
+ const ignoredBuildsOnly = exitCode !== 0 && detectIgnoredBuilds && isPnpmIgnoredBuildsError(combinedOutput);
3918
+ if (exitCode === 0 || ignoredBuildsOnly) {
3579
3919
  spinner.stop(`Dependencies installed`);
3580
3920
  return {
3581
3921
  durationMs: Date.now() - startTime,
3582
3922
  exitCode,
3583
- status: "installed"
3923
+ status: "installed",
3924
+ pendingBuilds
3584
3925
  };
3585
3926
  } else {
3586
3927
  spinner.stop(`Install failed`);
@@ -3680,30 +4021,13 @@ async function promptGitInit(options) {
3680
4021
  }
3681
4022
  return false;
3682
4023
  }
4024
+ async function resolveGitInit(options, isMonorepo) {
4025
+ if (isMonorepo) return false;
4026
+ return promptGitInit(options);
4027
+ }
3683
4028
  function defaultInteractive() {
3684
4029
  return !process.env.CI && process.stdin.isTTY;
3685
4030
  }
3686
- function getSpinner(interactive) {
3687
- if (interactive) return spinner();
3688
- return {
3689
- start: (msg) => {
3690
- if (msg) log.info(msg);
3691
- },
3692
- stop: (msg) => {
3693
- if (msg) log.info(msg);
3694
- },
3695
- message: (msg) => {
3696
- if (msg) log.info(msg);
3697
- }
3698
- };
3699
- }
3700
- function getSilentSpinner() {
3701
- return {
3702
- start: () => {},
3703
- stop: () => {},
3704
- message: () => {}
3705
- };
3706
- }
3707
4031
  //#endregion
3708
4032
  //#region src/utils/tsconfig.ts
3709
4033
  /**
@@ -3799,6 +4123,20 @@ function removeDeprecatedTsconfigFalseOption(filePath, optionName) {
3799
4123
  fs.writeFileSync(filePath, newText);
3800
4124
  return true;
3801
4125
  }
4126
+ const TSCONFIG_TYPE_REPLACEMENTS = {
4127
+ "tsdown/client": "vite-plus/pack/client",
4128
+ "vite/client": "vite-plus/client"
4129
+ };
4130
+ function hasTypesToRewriteInTsconfig(filePath) {
4131
+ let text;
4132
+ try {
4133
+ text = fs.readFileSync(filePath, "utf-8");
4134
+ } catch {
4135
+ return false;
4136
+ }
4137
+ const types = parse(text)?.compilerOptions?.types;
4138
+ return Array.isArray(types) && types.some((t) => typeof t === "string" && t in TSCONFIG_TYPE_REPLACEMENTS);
4139
+ }
3802
4140
  function rewriteTypesInTsconfig(filePath) {
3803
4141
  let text;
3804
4142
  try {
@@ -3808,13 +4146,9 @@ function rewriteTypesInTsconfig(filePath) {
3808
4146
  }
3809
4147
  const types = parse(text)?.compilerOptions?.types;
3810
4148
  if (!Array.isArray(types)) return false;
3811
- const REPLACEMENTS = {
3812
- "tsdown/client": "vite-plus/pack/client",
3813
- "vite/client": "vite-plus/client"
3814
- };
3815
- const toReplace = types.map((t, i) => typeof t === "string" && t in REPLACEMENTS ? {
4149
+ const toReplace = types.map((t, i) => typeof t === "string" && t in TSCONFIG_TYPE_REPLACEMENTS ? {
3816
4150
  i,
3817
- newVal: REPLACEMENTS[t]
4151
+ newVal: TSCONFIG_TYPE_REPLACEMENTS[t]
3818
4152
  } : null).filter((x) => x !== null);
3819
4153
  if (toReplace.length === 0) return false;
3820
4154
  let currentText = text;
@@ -3831,4 +4165,4 @@ function rewriteTypesInTsconfig(filePath) {
3831
4165
  return true;
3832
4166
  }
3833
4167
  //#endregion
3834
- export { R as A, log as C, spinner as D, select as E, runCommandSilently as M, require_cross_spawn as N, text as O, intro as S, outro as T, DependencyType as _, removeDeprecatedTsconfigFalseOption as a, cancel as b, defaultInteractive as c, promptGitHooks as d, promptGitInit as f, upgradeYarn as g, selectPackageManager as h, hasBaseUrlInTsconfig as i, runCommand$1 as j, require_picocolors as k, downloadPackageManager$1 as l, runViteInstall as m, findTsconfigFiles as n, rewriteTypesInTsconfig as o, runViteFmt as p, fixBaseUrlInTsconfig as r, cancelAndExit as s, confirmBaseUrlFix as t, getSpinner as u, PackageManager as v, multiselect as w, confirm as x, require_semver as y };
4168
+ export { select as A, require_semver as C, log as D, intro as E, runCommand$1 as F, runCommandSilently as I, require_cross_spawn as L, text as M, require_picocolors as N, multiselect as O, R as P, PackageManager as S, confirm as T, approveBuilds as _, hasTypesToRewriteInTsconfig as a, getSpinner as b, cancelAndExit as c, promptGitHooks as d, resolveGitInit as f, upgradeYarn as g, selectPackageManager as h, hasBaseUrlInTsconfig as i, spinner as j, outro as k, defaultInteractive as l, runViteInstall as m, findTsconfigFiles as n, removeDeprecatedTsconfigFalseOption as o, runViteFmt as p, fixBaseUrlInTsconfig as r, rewriteTypesInTsconfig as s, confirmBaseUrlFix as t, downloadPackageManager$1 as u, detectGatedBuilds as v, cancel as w, DependencyType as x, resolveApproveBuildTargets as y };