vite-plus 0.1.23 → 0.2.0
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.
- package/LICENSE +30 -0
- package/README.md +8 -6
- package/bin/oxfmt +5 -2
- package/bin/oxlint +12 -2
- package/binding/index.cjs +84 -67
- package/binding/index.d.cts +155 -4
- package/dist/{agent-aSGY0osq.js → agent-BD31CsvU.js} +969 -89
- package/dist/bin.js +29 -33
- package/dist/{compat-DXZgnEyq.js → compat-Cql3K40m.js} +1 -1
- package/dist/config/bin.js +30 -14
- package/dist/constants-CrfJQIUX.js +66 -0
- package/dist/create/bin.d.ts +7 -1
- package/dist/create/bin.js +578 -266
- package/dist/define-config-2tfJoXr1.d.ts +305 -0
- package/dist/define-config-BGSjF6Xp.cjs +488 -0
- package/dist/define-config-DJUehepE.js +445 -0
- package/dist/define-config.cjs +8 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +2 -2
- package/dist/dist-DRJUd9bL.js +3 -0
- package/dist/{dist-BgQuvbtq.js → dist-Oxo16Y0q.js} +4 -4
- package/dist/index.cjs +9 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{main-DpJl3LoU.js → json-Dn87fvjk.js} +137 -1
- package/dist/migration/bin.js +301 -84
- package/dist/{oxlint-plugin-config-B89iKTKN.js → oxlint-plugin-config-q8a5PFch.js} +1 -1
- package/dist/oxlint-plugin.js +11 -3
- package/dist/pack-bin.js +44 -15
- package/dist/{package-PmBUZ-ve.js → package-BHirM1_v.js} +3 -138
- package/dist/{report-DgSBQUdz.js → report-BHSkWqRR.js} +2 -0
- package/dist/{resolve-vite-config-TTvhycU1.js → resolve-vite-config-CmdsfQzS.js} +13 -4
- package/dist/staged/bin.js +150 -417
- package/dist/test/_at-vitest-browser/context.d.ts +2 -0
- package/dist/test/_at-vitest-browser.d.ts +2 -0
- package/dist/test/browser/context.d.ts +2 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.d.ts +1 -0
- package/dist/test/browser/providers/playwright/context.js +1 -0
- package/dist/test/browser/providers/playwright.d.ts +124 -2
- package/dist/test/browser/providers/playwright.js +1 -1
- package/dist/test/browser/providers/preview/context.d.ts +1 -0
- package/dist/test/browser/providers/preview/context.js +1 -0
- package/dist/test/browser/providers/preview.d.ts +32 -2
- package/dist/test/browser/providers/preview.js +1 -1
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -0
- package/dist/test/browser/providers/webdriverio/context.js +1 -0
- package/dist/test/browser/providers/webdriverio.d.ts +77 -2
- package/dist/test/browser/providers/webdriverio.js +1 -1
- package/dist/test/browser-compat.d.ts +2 -0
- package/dist/test/browser-compat.js +1 -1
- package/dist/test/browser-playwright/context.d.ts +1 -0
- package/dist/test/browser-playwright/context.js +1 -0
- package/dist/test/browser-playwright.d.ts +124 -2
- package/dist/test/browser-playwright.js +1 -1
- package/dist/test/browser-preview/context.d.ts +1 -0
- package/dist/test/browser-preview/context.js +1 -0
- package/dist/test/browser-preview.d.ts +32 -2
- package/dist/test/browser-preview.js +1 -1
- package/dist/test/browser-webdriverio/context.d.ts +1 -0
- package/dist/test/browser-webdriverio/context.js +1 -0
- package/dist/test/browser-webdriverio.d.ts +77 -2
- package/dist/test/browser-webdriverio.js +1 -1
- package/dist/test/browser.d.ts +2 -2
- package/dist/test/browser.js +1 -1
- package/dist/test/client.js +1 -1
- package/dist/test/config.cjs +1 -1
- package/dist/test/config.d.ts +2 -2
- package/dist/test/config.js +1 -1
- package/dist/test/context.d.ts +942 -2
- package/dist/test/context.js +1 -1
- package/dist/test/coverage.d.ts +2 -2
- package/dist/test/coverage.js +1 -1
- package/dist/test/environments.d.ts +2 -2
- package/dist/test/environments.js +1 -1
- package/dist/test/globals.d.ts +2 -2
- package/dist/test/import-meta.d.ts +2 -2
- package/dist/test/importMeta.d.ts +2 -2
- package/dist/test/index.cjs +1 -1
- package/dist/test/index.d.cts +2 -2
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +1 -1
- package/dist/test/internal/browser.d.ts +2 -2
- package/dist/test/internal/browser.js +1 -1
- package/dist/test/jsdom.d.ts +2 -2
- package/dist/test/locators.d.ts +294 -0
- package/dist/test/locators.js +1 -1
- package/dist/test/matchers.d.ts +29 -0
- package/dist/test/matchers.js +1 -1
- package/dist/test/node.d.ts +2 -2
- package/dist/test/node.js +1 -1
- package/dist/test/optional-runtime-types.js.d.ts +2 -2
- package/dist/test/optional-types.js.d.ts +2 -2
- package/dist/test/plugins/browser-client.js +1 -1
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.js +1 -1
- package/dist/test/plugins/browser-playwright.js +1 -1
- package/dist/test/plugins/browser-preview.js +1 -1
- package/dist/test/plugins/browser-webdriverio.js +1 -1
- package/dist/test/plugins/browser.js +1 -1
- package/dist/test/plugins/expect.js +1 -1
- package/dist/test/plugins/mocker-automock.js +1 -1
- package/dist/test/plugins/mocker-browser.js +1 -1
- package/dist/test/plugins/mocker-node.js +1 -1
- package/dist/test/plugins/mocker-redirect.js +1 -1
- package/dist/test/plugins/mocker-register.js +1 -1
- package/dist/test/plugins/mocker-transforms.js +1 -1
- package/dist/test/plugins/mocker.js +1 -1
- package/dist/test/plugins/pretty-format.js +1 -1
- package/dist/test/plugins/runner-types.js +1 -1
- package/dist/test/plugins/runner-utils.js +1 -1
- package/dist/test/plugins/runner.js +1 -1
- package/dist/test/plugins/snapshot-environment.js +1 -1
- package/dist/test/plugins/snapshot-manager.js +1 -1
- package/dist/test/plugins/snapshot.js +1 -1
- package/dist/test/plugins/spy.js +1 -1
- package/dist/test/plugins/utils-constants.js +1 -1
- package/dist/test/plugins/utils-diff.js +1 -1
- package/dist/test/plugins/utils-display.js +1 -1
- package/dist/test/plugins/utils-error.js +1 -1
- package/dist/test/plugins/utils-helpers.js +1 -1
- package/dist/test/plugins/utils-offset.js +1 -1
- package/dist/test/plugins/utils-resolver.js +1 -1
- package/dist/test/plugins/utils-serialize.js +1 -1
- package/dist/test/plugins/utils-source-map-node.js +1 -1
- package/dist/test/plugins/utils-source-map.js +1 -1
- package/dist/test/plugins/utils-timers.js +1 -1
- package/dist/test/plugins/utils.js +1 -1
- package/dist/test/reporters.d.ts +2 -2
- package/dist/test/reporters.js +1 -1
- package/dist/test/runners.d.ts +2 -2
- package/dist/test/runners.js +1 -1
- package/dist/test/runtime.d.ts +2 -2
- package/dist/test/runtime.js +1 -1
- package/dist/test/snapshot.d.ts +2 -2
- package/dist/test/snapshot.js +1 -1
- package/dist/test/suite.d.ts +2 -2
- package/dist/test/suite.js +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/worker.d.ts +2 -2
- package/dist/test/worker.js +1 -1
- package/dist/{tsconfig-DlUVXT3J.js → tsconfig-CJ_StdFc.js} +605 -263
- package/dist/tsgolint-path-B-yOos8p.js +32 -0
- package/dist/tsgolint-path.d.ts +8 -0
- package/dist/tsgolint-path.js +2 -0
- package/dist/version.js +3 -3
- package/dist/versions.d.ts +1 -1
- package/dist/versions.js +7 -7
- package/dist/{workspace-DElv730L.js → workspace-Cjoc1c_A.js} +20 -18
- package/docs/_data/team.ts +5 -4
- package/docs/config/create.md +36 -1
- package/docs/config/index.md +7 -5
- package/docs/guide/commit-hooks.md +9 -0
- package/docs/guide/create.md +106 -2
- package/docs/guide/env.md +33 -5
- package/docs/guide/index.md +9 -3
- package/docs/guide/install.md +46 -10
- package/docs/guide/migrate.md +13 -3
- package/docs/guide/troubleshooting.md +3 -29
- package/docs/guide/upgrade.md +36 -6
- package/docs/package.json +3 -3
- package/docs/pnpm-lock.yaml +298 -395
- package/package.json +104 -56
- package/templates/generator/bin/index.ts +6 -3
- package/templates/generator/package.json +2 -3
- package/templates/generator/src/template.ts +0 -2
- package/templates/monorepo/package.json +1 -1
- package/dist/constants-DCBWlNrn.js +0 -33
- package/dist/define-config-BR1Y88zz.cjs +0 -84
- package/dist/define-config-BRC7qPNE.js +0 -21
- package/dist/define-config-COdn-tsn.d.ts +0 -177
- package/dist/dist-Bapm49IR.js +0 -3
- package/dist/test/plugins/utils-highlight.js +0 -1
- /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 "./
|
|
2
|
-
import {
|
|
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 {
|
|
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
|
|
11
|
+
import G 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
|
|
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
|
|
477
|
-
const CONTROL_RE
|
|
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
|
|
480
|
-
const EMOJI_RE
|
|
481
|
-
const LATIN_RE
|
|
482
|
-
const MODIFIER_RE
|
|
483
|
-
const NO_TRUNCATION$
|
|
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
|
|
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
|
|
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
|
|
500
|
-
[ANSI_RE
|
|
501
|
-
[CONTROL_RE
|
|
502
|
-
[TAB_RE
|
|
503
|
-
[EMOJI_RE
|
|
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
|
|
521
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
522
522
|
const codePoint = char.codePointAt(0) || 0;
|
|
523
|
-
if (isFullWidth
|
|
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
|
|
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
|
|
566
|
+
const NO_TRUNCATION = {
|
|
567
567
|
limit: Infinity,
|
|
568
568
|
ellipsis: "",
|
|
569
569
|
ellipsisWidth: 0
|
|
570
570
|
};
|
|
571
|
-
const fastStringWidth
|
|
572
|
-
return getStringTruncatedWidth
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
700
|
+
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
701
701
|
continue;
|
|
702
702
|
}
|
|
703
703
|
rows[rows.length - 1] += word;
|
|
@@ -737,7 +737,7 @@ function wrapAnsi$1(string, columns, options) {
|
|
|
737
737
|
return String(string).normalize().split(CRLF_OR_LF$1).map((line) => exec$1(line, columns, options)).join("\n");
|
|
738
738
|
}
|
|
739
739
|
//#endregion
|
|
740
|
-
//#region ../../node_modules/.pnpm/@clack+core@1.
|
|
740
|
+
//#region ../../node_modules/.pnpm/@clack+core@1.4.0/node_modules/@clack/core/dist/index.mjs
|
|
741
741
|
var import_src = (/* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
742
742
|
const ESC = "\x1B";
|
|
743
743
|
const CSI = `${ESC}[`;
|
|
@@ -847,7 +847,7 @@ function C(r, t) {
|
|
|
847
847
|
for (const s of r) if (s !== void 0 && C(s, t)) return !0;
|
|
848
848
|
return !1;
|
|
849
849
|
}
|
|
850
|
-
function
|
|
850
|
+
function Y(r, t) {
|
|
851
851
|
if (r === t) return;
|
|
852
852
|
const s = r.split(`
|
|
853
853
|
`), e = t.split(`
|
|
@@ -860,15 +860,15 @@ function z(r, t) {
|
|
|
860
860
|
numLines: i
|
|
861
861
|
};
|
|
862
862
|
}
|
|
863
|
-
const
|
|
864
|
-
function
|
|
863
|
+
const q = globalThis.process.platform.startsWith("win"), k = Symbol("clack:cancel");
|
|
864
|
+
function R(r) {
|
|
865
865
|
return r === k;
|
|
866
866
|
}
|
|
867
867
|
function w(r, t) {
|
|
868
868
|
const s = r;
|
|
869
869
|
s.isTTY && s.setRawMode(t);
|
|
870
870
|
}
|
|
871
|
-
function
|
|
871
|
+
function W({ input: r = stdin, output: t = stdout, overwrite: s = !0, hideCursor: e = !0 } = {}) {
|
|
872
872
|
const i = b.createInterface({
|
|
873
873
|
input: r,
|
|
874
874
|
output: t,
|
|
@@ -894,11 +894,11 @@ function R({ input: r = stdin, output: t = stdout, overwrite: s = !0, hideCursor
|
|
|
894
894
|
});
|
|
895
895
|
};
|
|
896
896
|
return e && t.write(import_src.cursor.hide), r.once("keypress", n), () => {
|
|
897
|
-
r.off("keypress", n), e && t.write(import_src.cursor.show), r instanceof ReadStream && r.isTTY && !
|
|
897
|
+
r.off("keypress", n), e && t.write(import_src.cursor.show), r instanceof ReadStream && r.isTTY && !q && r.setRawMode(!1), i.terminal = !1, i.close();
|
|
898
898
|
};
|
|
899
899
|
}
|
|
900
900
|
const A = (r) => "columns" in r && typeof r.columns == "number" ? r.columns : 80, L = (r) => "rows" in r && typeof r.rows == "number" ? r.rows : 20;
|
|
901
|
-
function
|
|
901
|
+
function B(r, t, s, e = s, i = s, n) {
|
|
902
902
|
return wrapAnsi$1(t, A(r ?? stdout) - s.length, {
|
|
903
903
|
hard: !0,
|
|
904
904
|
trim: !1
|
|
@@ -909,7 +909,15 @@ function W(r, t, s, e = s, i = s, n) {
|
|
|
909
909
|
}).join(`
|
|
910
910
|
`);
|
|
911
911
|
}
|
|
912
|
-
|
|
912
|
+
function P(r, t) {
|
|
913
|
+
if ("~standard" in r) {
|
|
914
|
+
const s = r["~standard"].validate(t);
|
|
915
|
+
if (s instanceof Promise) throw new TypeError("Schema validation must be synchronous. Update `validate()` and remove any asynchronous logic.");
|
|
916
|
+
return s.issues?.at(0)?.message;
|
|
917
|
+
}
|
|
918
|
+
return r(t);
|
|
919
|
+
}
|
|
920
|
+
var m = class {
|
|
913
921
|
input;
|
|
914
922
|
output;
|
|
915
923
|
_abortSignal;
|
|
@@ -957,7 +965,7 @@ let m = class {
|
|
|
957
965
|
this.state = "cancel", this.close();
|
|
958
966
|
}, { once: !0 });
|
|
959
967
|
}
|
|
960
|
-
this.rl =
|
|
968
|
+
this.rl = G.createInterface({
|
|
961
969
|
input: this.input,
|
|
962
970
|
tabSize: 2,
|
|
963
971
|
prompt: "",
|
|
@@ -992,9 +1000,9 @@ let m = class {
|
|
|
992
1000
|
if (this._track && s.name !== "return" && (s.name && this._isActionKey(t, s) && this.rl?.write(null, {
|
|
993
1001
|
ctrl: !0,
|
|
994
1002
|
name: "h"
|
|
995
|
-
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t
|
|
1003
|
+
}), this._cursor = this.rl?.cursor ?? 0, this._setUserInput(this.rl?.line)), this.state === "error" && (this.state = "active"), s?.name && (!this._track && h.aliases.has(s.name) && this.emit("cursor", h.aliases.get(s.name)), h.actions.has(s.name) && this.emit("cursor", s.name)), t && (t.toLowerCase() === "y" || t.toLowerCase() === "n") && this.emit("confirm", t.toLowerCase() === "y"), this.emit("key", t, s), s?.name === "return" && this._shouldSubmit(t, s)) {
|
|
996
1004
|
if (this.opts.validate) {
|
|
997
|
-
const e = this.opts.validate
|
|
1005
|
+
const e = P(this.opts.validate, this.value);
|
|
998
1006
|
e && (this.error = e instanceof Error ? e.message : e, this.state = "error", this.rl?.write(this.userInput));
|
|
999
1007
|
}
|
|
1000
1008
|
this.state !== "error" && (this.state = "submit");
|
|
@@ -1025,7 +1033,7 @@ let m = class {
|
|
|
1025
1033
|
if (t !== this._prevFrame) {
|
|
1026
1034
|
if (this.state === "initial") this.output.write(import_src.cursor.hide);
|
|
1027
1035
|
else {
|
|
1028
|
-
const s =
|
|
1036
|
+
const s = Y(this._prevFrame, t), e = L(this.output);
|
|
1029
1037
|
if (this.restoreCursor(), s) {
|
|
1030
1038
|
const i = Math.max(0, s.numLinesAfter - e), n = Math.max(0, s.numLinesBefore - e);
|
|
1031
1039
|
let o = s.lines.find((u) => u >= i);
|
|
@@ -1059,7 +1067,7 @@ let m = class {
|
|
|
1059
1067
|
}
|
|
1060
1068
|
}
|
|
1061
1069
|
};
|
|
1062
|
-
var
|
|
1070
|
+
var Z = class extends m {
|
|
1063
1071
|
get cursor() {
|
|
1064
1072
|
return this.value ? 0 : 1;
|
|
1065
1073
|
}
|
|
@@ -1076,7 +1084,7 @@ var X = class extends m {
|
|
|
1076
1084
|
});
|
|
1077
1085
|
}
|
|
1078
1086
|
};
|
|
1079
|
-
let
|
|
1087
|
+
let ut = class extends m {
|
|
1080
1088
|
options;
|
|
1081
1089
|
cursor = 0;
|
|
1082
1090
|
get _value() {
|
|
@@ -1103,8 +1111,8 @@ let nt = class extends m {
|
|
|
1103
1111
|
constructor(t) {
|
|
1104
1112
|
super(t, !1), this.options = t.options, this.value = [...t.initialValues ?? []];
|
|
1105
1113
|
const s = Math.max(this.options.findIndex(({ value: e }) => e === t.cursorAt), 0);
|
|
1106
|
-
this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e) => {
|
|
1107
|
-
|
|
1114
|
+
this.cursor = this.options[s].disabled ? f(s, 1, this.options) : s, this.on("key", (e, i) => {
|
|
1115
|
+
i.name === "a" && this.toggleAll(), i.name === "i" && this.toggleInvert();
|
|
1108
1116
|
}), this.on("cursor", (e) => {
|
|
1109
1117
|
switch (e) {
|
|
1110
1118
|
case "left":
|
|
@@ -1122,7 +1130,7 @@ let nt = class extends m {
|
|
|
1122
1130
|
});
|
|
1123
1131
|
}
|
|
1124
1132
|
};
|
|
1125
|
-
var
|
|
1133
|
+
var ht = class extends m {
|
|
1126
1134
|
options;
|
|
1127
1135
|
cursor = 0;
|
|
1128
1136
|
get _selectedValue() {
|
|
@@ -1149,7 +1157,7 @@ var ut = class extends m {
|
|
|
1149
1157
|
});
|
|
1150
1158
|
}
|
|
1151
1159
|
};
|
|
1152
|
-
var
|
|
1160
|
+
var ct = class extends m {
|
|
1153
1161
|
get userInputWithCursor() {
|
|
1154
1162
|
if (this.state === "submit") return this.userInput;
|
|
1155
1163
|
const t = this.userInput;
|
|
@@ -1284,37 +1292,51 @@ const symbolBar = (state) => {
|
|
|
1284
1292
|
default: return import_picocolors.default.blue(S_BAR);
|
|
1285
1293
|
}
|
|
1286
1294
|
};
|
|
1287
|
-
const
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
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) => {
|
|
1291
1305
|
return x === 12288 || x >= 65281 && x <= 65376 || x >= 65504 && x <= 65510;
|
|
1292
1306
|
};
|
|
1293
|
-
const
|
|
1294
|
-
return x
|
|
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;
|
|
1295
1309
|
};
|
|
1296
|
-
const ANSI_RE = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/y;
|
|
1297
|
-
const CONTROL_RE = /[\x00-\x08\x0A-\x1F\x7F-\x9F]{1,1000}/y;
|
|
1298
|
-
const
|
|
1299
|
-
const
|
|
1300
|
-
const
|
|
1301
|
-
const
|
|
1302
|
-
const
|
|
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 = {
|
|
1303
1318
|
limit: Infinity,
|
|
1304
1319
|
ellipsis: ""
|
|
1305
1320
|
};
|
|
1306
|
-
const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
1321
|
+
const getStringTruncatedWidth$1 = (input, truncationOptions = {}, widthOptions = {}) => {
|
|
1307
1322
|
const LIMIT = truncationOptions.limit ?? Infinity;
|
|
1308
1323
|
const ELLIPSIS = truncationOptions.ellipsis ?? "";
|
|
1309
|
-
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth(ELLIPSIS, NO_TRUNCATION$
|
|
1310
|
-
const ANSI_WIDTH =
|
|
1324
|
+
const ELLIPSIS_WIDTH = truncationOptions?.ellipsisWidth ?? (ELLIPSIS ? getStringTruncatedWidth$1(ELLIPSIS, NO_TRUNCATION$3, widthOptions).width : 0);
|
|
1325
|
+
const ANSI_WIDTH = 0;
|
|
1311
1326
|
const CONTROL_WIDTH = widthOptions.controlWidth ?? 0;
|
|
1312
1327
|
const TAB_WIDTH = widthOptions.tabWidth ?? 8;
|
|
1313
|
-
const AMBIGUOUS_WIDTH = widthOptions.ambiguousWidth ?? 1;
|
|
1314
1328
|
const EMOJI_WIDTH = widthOptions.emojiWidth ?? 2;
|
|
1315
|
-
const FULL_WIDTH_WIDTH =
|
|
1329
|
+
const FULL_WIDTH_WIDTH = 2;
|
|
1316
1330
|
const REGULAR_WIDTH = widthOptions.regularWidth ?? 1;
|
|
1317
|
-
const WIDE_WIDTH = widthOptions.wideWidth ??
|
|
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
|
+
];
|
|
1318
1340
|
let indexPrev = 0;
|
|
1319
1341
|
let index = 0;
|
|
1320
1342
|
let length = input.length;
|
|
@@ -1330,11 +1352,10 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
1330
1352
|
if (unmatchedEnd > unmatchedStart || index >= length && index > indexPrev) {
|
|
1331
1353
|
const unmatched = input.slice(unmatchedStart, unmatchedEnd) || input.slice(indexPrev, index);
|
|
1332
1354
|
lengthExtra = 0;
|
|
1333
|
-
for (const char of unmatched.replaceAll(MODIFIER_RE, "")) {
|
|
1355
|
+
for (const char of unmatched.replaceAll(MODIFIER_RE$1, "")) {
|
|
1334
1356
|
const codePoint = char.codePointAt(0) || 0;
|
|
1335
|
-
if (isFullWidth(codePoint)) widthExtra = FULL_WIDTH_WIDTH;
|
|
1336
|
-
else if (
|
|
1337
|
-
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;
|
|
1338
1359
|
else widthExtra = REGULAR_WIDTH;
|
|
1339
1360
|
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, Math.max(unmatchedStart, indexPrev) + lengthExtra);
|
|
1340
1361
|
if (width + widthExtra > LIMIT) {
|
|
@@ -1346,77 +1367,24 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
1346
1367
|
}
|
|
1347
1368
|
unmatchedStart = unmatchedEnd = 0;
|
|
1348
1369
|
}
|
|
1349
|
-
if (index >= length) break;
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
if (ANSI_RE.test(input)) {
|
|
1367
|
-
if (width + ANSI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
|
|
1368
|
-
if (width + ANSI_WIDTH > LIMIT) {
|
|
1369
|
-
truncationEnabled = true;
|
|
1370
|
-
break;
|
|
1371
|
-
}
|
|
1372
|
-
width += ANSI_WIDTH;
|
|
1373
|
-
unmatchedStart = indexPrev;
|
|
1374
|
-
unmatchedEnd = index;
|
|
1375
|
-
index = indexPrev = ANSI_RE.lastIndex;
|
|
1376
|
-
continue;
|
|
1377
|
-
}
|
|
1378
|
-
CONTROL_RE.lastIndex = index;
|
|
1379
|
-
if (CONTROL_RE.test(input)) {
|
|
1380
|
-
lengthExtra = CONTROL_RE.lastIndex - index;
|
|
1381
|
-
widthExtra = lengthExtra * CONTROL_WIDTH;
|
|
1382
|
-
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / CONTROL_WIDTH));
|
|
1383
|
-
if (width + widthExtra > LIMIT) {
|
|
1384
|
-
truncationEnabled = true;
|
|
1385
|
-
break;
|
|
1386
|
-
}
|
|
1387
|
-
width += widthExtra;
|
|
1388
|
-
unmatchedStart = indexPrev;
|
|
1389
|
-
unmatchedEnd = index;
|
|
1390
|
-
index = indexPrev = CONTROL_RE.lastIndex;
|
|
1391
|
-
continue;
|
|
1392
|
-
}
|
|
1393
|
-
TAB_RE.lastIndex = index;
|
|
1394
|
-
if (TAB_RE.test(input)) {
|
|
1395
|
-
lengthExtra = TAB_RE.lastIndex - index;
|
|
1396
|
-
widthExtra = lengthExtra * TAB_WIDTH;
|
|
1397
|
-
if (width + widthExtra > truncationLimit) truncationIndex = Math.min(truncationIndex, index + Math.floor((truncationLimit - width) / TAB_WIDTH));
|
|
1398
|
-
if (width + widthExtra > LIMIT) {
|
|
1399
|
-
truncationEnabled = true;
|
|
1400
|
-
break;
|
|
1401
|
-
}
|
|
1402
|
-
width += widthExtra;
|
|
1403
|
-
unmatchedStart = indexPrev;
|
|
1404
|
-
unmatchedEnd = index;
|
|
1405
|
-
index = indexPrev = TAB_RE.lastIndex;
|
|
1406
|
-
continue;
|
|
1407
|
-
}
|
|
1408
|
-
EMOJI_RE.lastIndex = index;
|
|
1409
|
-
if (EMOJI_RE.test(input)) {
|
|
1410
|
-
if (width + EMOJI_WIDTH > truncationLimit) truncationIndex = Math.min(truncationIndex, index);
|
|
1411
|
-
if (width + EMOJI_WIDTH > LIMIT) {
|
|
1412
|
-
truncationEnabled = true;
|
|
1413
|
-
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;
|
|
1414
1387
|
}
|
|
1415
|
-
width += EMOJI_WIDTH;
|
|
1416
|
-
unmatchedStart = indexPrev;
|
|
1417
|
-
unmatchedEnd = index;
|
|
1418
|
-
index = indexPrev = EMOJI_RE.lastIndex;
|
|
1419
|
-
continue;
|
|
1420
1388
|
}
|
|
1421
1389
|
index += 1;
|
|
1422
1390
|
}
|
|
@@ -1427,13 +1395,13 @@ const getStringTruncatedWidth = (input, truncationOptions = {}, widthOptions = {
|
|
|
1427
1395
|
ellipsed: truncationEnabled && LIMIT >= ELLIPSIS_WIDTH
|
|
1428
1396
|
};
|
|
1429
1397
|
};
|
|
1430
|
-
const NO_TRUNCATION = {
|
|
1398
|
+
const NO_TRUNCATION$2 = {
|
|
1431
1399
|
limit: Infinity,
|
|
1432
1400
|
ellipsis: "",
|
|
1433
1401
|
ellipsisWidth: 0
|
|
1434
1402
|
};
|
|
1435
|
-
const fastStringWidth = (input, options = {}) => {
|
|
1436
|
-
return getStringTruncatedWidth(input, NO_TRUNCATION, options).width;
|
|
1403
|
+
const fastStringWidth$1 = (input, options = {}) => {
|
|
1404
|
+
return getStringTruncatedWidth$1(input, NO_TRUNCATION$2, options).width;
|
|
1437
1405
|
};
|
|
1438
1406
|
const ESC = "\x1B";
|
|
1439
1407
|
const CSI = "";
|
|
@@ -1464,13 +1432,13 @@ const wrapWord = (rows, word, columns) => {
|
|
|
1464
1432
|
let isInsideEscape = false;
|
|
1465
1433
|
let isInsideLinkEscape = false;
|
|
1466
1434
|
let lastRow = rows.at(-1);
|
|
1467
|
-
let visible = lastRow === void 0 ? 0 : fastStringWidth(lastRow);
|
|
1435
|
+
let visible = lastRow === void 0 ? 0 : fastStringWidth$1(lastRow);
|
|
1468
1436
|
let currentCharacter = characters.next();
|
|
1469
1437
|
let nextCharacter = characters.next();
|
|
1470
1438
|
let rawCharacterIndex = 0;
|
|
1471
1439
|
while (!currentCharacter.done) {
|
|
1472
1440
|
const character = currentCharacter.value;
|
|
1473
|
-
const characterLength = fastStringWidth(character);
|
|
1441
|
+
const characterLength = fastStringWidth$1(character);
|
|
1474
1442
|
if (visible + characterLength <= columns) rows[rows.length - 1] += character;
|
|
1475
1443
|
else {
|
|
1476
1444
|
rows.push(character);
|
|
@@ -1505,7 +1473,7 @@ const stringVisibleTrimSpacesRight = (string) => {
|
|
|
1505
1473
|
const words = string.split(" ");
|
|
1506
1474
|
let last = words.length;
|
|
1507
1475
|
while (last) {
|
|
1508
|
-
if (fastStringWidth(words[last - 1])) break;
|
|
1476
|
+
if (fastStringWidth$1(words[last - 1])) break;
|
|
1509
1477
|
last--;
|
|
1510
1478
|
}
|
|
1511
1479
|
if (last === words.length) return string;
|
|
@@ -1526,7 +1494,7 @@ const exec = (string, columns, options = {}) => {
|
|
|
1526
1494
|
const trimmed = row.trimStart();
|
|
1527
1495
|
if (row.length !== trimmed.length) {
|
|
1528
1496
|
rows[rows.length - 1] = trimmed;
|
|
1529
|
-
rowLength = fastStringWidth(trimmed);
|
|
1497
|
+
rowLength = fastStringWidth$1(trimmed);
|
|
1530
1498
|
}
|
|
1531
1499
|
}
|
|
1532
1500
|
if (index !== 0) {
|
|
@@ -1539,19 +1507,19 @@ const exec = (string, columns, options = {}) => {
|
|
|
1539
1507
|
rowLength++;
|
|
1540
1508
|
}
|
|
1541
1509
|
}
|
|
1542
|
-
const wordLength = fastStringWidth(word);
|
|
1510
|
+
const wordLength = fastStringWidth$1(word);
|
|
1543
1511
|
if (options.hard && wordLength > columns) {
|
|
1544
1512
|
const remainingColumns = columns - rowLength;
|
|
1545
1513
|
const breaksStartingThisLine = 1 + Math.floor((wordLength - remainingColumns - 1) / columns);
|
|
1546
1514
|
if (Math.floor((wordLength - 1) / columns) < breaksStartingThisLine) rows.push("");
|
|
1547
1515
|
wrapWord(rows, word, columns);
|
|
1548
|
-
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
1516
|
+
rowLength = fastStringWidth$1(rows.at(-1) ?? "");
|
|
1549
1517
|
continue;
|
|
1550
1518
|
}
|
|
1551
1519
|
if (rowLength + wordLength > columns && rowLength && wordLength) {
|
|
1552
1520
|
if (options.wordWrap === false && rowLength < columns) {
|
|
1553
1521
|
wrapWord(rows, word, columns);
|
|
1554
|
-
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
1522
|
+
rowLength = fastStringWidth$1(rows.at(-1) ?? "");
|
|
1555
1523
|
continue;
|
|
1556
1524
|
}
|
|
1557
1525
|
rows.push("");
|
|
@@ -1559,7 +1527,7 @@ const exec = (string, columns, options = {}) => {
|
|
|
1559
1527
|
}
|
|
1560
1528
|
if (rowLength + wordLength > columns && options.wordWrap === false) {
|
|
1561
1529
|
wrapWord(rows, word, columns);
|
|
1562
|
-
rowLength = fastStringWidth(rows.at(-1) ?? "");
|
|
1530
|
+
rowLength = fastStringWidth$1(rows.at(-1) ?? "");
|
|
1563
1531
|
continue;
|
|
1564
1532
|
}
|
|
1565
1533
|
rows[rows.length - 1] += word;
|
|
@@ -1571,8 +1539,10 @@ const exec = (string, columns, options = {}) => {
|
|
|
1571
1539
|
for (let i = 0; i < preString.length; i++) {
|
|
1572
1540
|
const character = preString[i];
|
|
1573
1541
|
returnValue += character;
|
|
1574
|
-
if (!inSurrogate)
|
|
1575
|
-
|
|
1542
|
+
if (!inSurrogate) {
|
|
1543
|
+
inSurrogate = character >= "\ud800" && character <= "\udbff";
|
|
1544
|
+
if (inSurrogate) continue;
|
|
1545
|
+
} else inSurrogate = false;
|
|
1576
1546
|
if (character === ESC || character === CSI) {
|
|
1577
1547
|
GROUP_REGEX.lastIndex = i + 1;
|
|
1578
1548
|
const groups = GROUP_REGEX.exec(preString)?.groups;
|
|
@@ -1672,7 +1642,7 @@ const limitOptions = (params) => {
|
|
|
1672
1642
|
const confirm = (opts) => {
|
|
1673
1643
|
const active = opts.active ?? "Yes";
|
|
1674
1644
|
const inactive = opts.inactive ?? "No";
|
|
1675
|
-
return new
|
|
1645
|
+
return new Z({
|
|
1676
1646
|
active,
|
|
1677
1647
|
inactive,
|
|
1678
1648
|
signal: opts.signal,
|
|
@@ -1782,7 +1752,7 @@ const multiselect = (opts) => {
|
|
|
1782
1752
|
};
|
|
1783
1753
|
const required = opts.required ?? true;
|
|
1784
1754
|
const hint = " " + import_picocolors.default.reset(import_picocolors.default.dim(`Press ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" space ")))} to select, ${import_picocolors.default.gray(import_picocolors.default.bgWhite(import_picocolors.default.inverse(" enter ")))} to submit`));
|
|
1785
|
-
return new
|
|
1755
|
+
return new ut({
|
|
1786
1756
|
options: opts.options,
|
|
1787
1757
|
signal: opts.signal,
|
|
1788
1758
|
input: opts.input,
|
|
@@ -1799,7 +1769,7 @@ const multiselect = (opts) => {
|
|
|
1799
1769
|
const formatMessageLines = (message) => {
|
|
1800
1770
|
return message.split("\n").map((line, index) => `${index === 0 ? `${symbol(this.state)} ` : nestedPrefix}${line}`).join("\n");
|
|
1801
1771
|
};
|
|
1802
|
-
const wrappedMessage = hasGuide ?
|
|
1772
|
+
const wrappedMessage = hasGuide ? B(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
|
|
1803
1773
|
const title = `${hasGuide ? `${import_picocolors.default.gray(S_BAR)}\n` : ""}${wrappedMessage}\n`;
|
|
1804
1774
|
const value = this.value ?? [];
|
|
1805
1775
|
const styleOption = (option, active) => {
|
|
@@ -1813,13 +1783,13 @@ const multiselect = (opts) => {
|
|
|
1813
1783
|
case "submit": {
|
|
1814
1784
|
const submitText = this.options.filter(({ value: optionValue }) => value.includes(optionValue)).map((option) => opt(option, "submitted")).join(import_picocolors.default.dim(", ")) || import_picocolors.default.dim("none");
|
|
1815
1785
|
const submitPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
|
|
1816
|
-
return `${title}${
|
|
1786
|
+
return `${title}${B(opts.output, submitText, submitPrefix)}\n`;
|
|
1817
1787
|
}
|
|
1818
1788
|
case "cancel": {
|
|
1819
1789
|
const label = this.options.filter(({ value: optionValue }) => value.includes(optionValue)).map((option) => opt(option, "cancelled")).join(import_picocolors.default.dim(", "));
|
|
1820
1790
|
if (label.trim() === "") return hasGuide ? `${title}${import_picocolors.default.gray(S_BAR)}\n` : `${title.trimEnd()}\n`;
|
|
1821
1791
|
const cancelPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
|
|
1822
|
-
const wrappedLabel =
|
|
1792
|
+
const wrappedLabel = B(opts.output, label, cancelPrefix);
|
|
1823
1793
|
return hasGuide ? `${title}${wrappedLabel}\n${import_picocolors.default.gray(S_BAR)}\n` : `${title}${wrappedLabel}\n`;
|
|
1824
1794
|
}
|
|
1825
1795
|
case "error": {
|
|
@@ -1931,7 +1901,7 @@ const spinner = ({ indicator = "dots", onCancel, output = process.stdout, cancel
|
|
|
1931
1901
|
const hasGuide = opts.withGuide ?? false;
|
|
1932
1902
|
const startLoop = () => {
|
|
1933
1903
|
isSpinnerActive = true;
|
|
1934
|
-
unblock =
|
|
1904
|
+
unblock = W({ output });
|
|
1935
1905
|
_origin = performance.now();
|
|
1936
1906
|
_prevMessage = void 0;
|
|
1937
1907
|
if (hasGuide) output.write(`${import_picocolors.default.gray(S_BAR)}\n`);
|
|
@@ -2032,7 +2002,7 @@ const select = (opts) => {
|
|
|
2032
2002
|
default: return withMarker(import_picocolors.default.dim(" "), label, (text) => text, hint);
|
|
2033
2003
|
}
|
|
2034
2004
|
};
|
|
2035
|
-
return new
|
|
2005
|
+
return new ht({
|
|
2036
2006
|
options: opts.options,
|
|
2037
2007
|
signal: opts.signal,
|
|
2038
2008
|
input: opts.input,
|
|
@@ -2045,16 +2015,16 @@ const select = (opts) => {
|
|
|
2045
2015
|
return message.split("\n").map((line, index) => `${index === 0 ? `${symbol(this.state)} ` : nestedPrefix}${line}`).join("\n");
|
|
2046
2016
|
};
|
|
2047
2017
|
const hasMessage = opts.message.trim().length > 0;
|
|
2048
|
-
const messageLines = !hasMessage ? "" : hasGuide ?
|
|
2018
|
+
const messageLines = !hasMessage ? "" : hasGuide ? B(opts.output, opts.message, `${symbolBar(this.state)} `, `${symbol(this.state)} `) : formatMessageLines(opts.message);
|
|
2049
2019
|
const title = hasMessage ? `${hasGuide ? `${import_picocolors.default.gray(S_BAR)}\n` : ""}${messageLines}\n` : "";
|
|
2050
2020
|
switch (this.state) {
|
|
2051
2021
|
case "submit": {
|
|
2052
2022
|
const submitPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
|
|
2053
|
-
return `${title}${
|
|
2023
|
+
return `${title}${B(opts.output, opt(this.options[this.cursor], "selected"), submitPrefix)}\n`;
|
|
2054
2024
|
}
|
|
2055
2025
|
case "cancel": {
|
|
2056
2026
|
const cancelPrefix = hasGuide ? `${import_picocolors.default.gray(S_BAR)} ` : nestedPrefix;
|
|
2057
|
-
return `${title}${
|
|
2027
|
+
return `${title}${B(opts.output, opt(this.options[this.cursor], "cancelled"), cancelPrefix)}${hasGuide ? `\n${import_picocolors.default.gray(S_BAR)}` : ""}\n`;
|
|
2058
2028
|
}
|
|
2059
2029
|
default: {
|
|
2060
2030
|
const prefix = hasGuide ? `${import_picocolors.default.blue(S_BAR)} ` : nestedPrefix;
|
|
@@ -2076,7 +2046,7 @@ const select = (opts) => {
|
|
|
2076
2046
|
}).prompt();
|
|
2077
2047
|
};
|
|
2078
2048
|
const text = (opts) => {
|
|
2079
|
-
return new
|
|
2049
|
+
return new ct({
|
|
2080
2050
|
validate: opts.validate,
|
|
2081
2051
|
placeholder: opts.placeholder,
|
|
2082
2052
|
defaultValue: opts.defaultValue,
|
|
@@ -2113,7 +2083,7 @@ const text = (opts) => {
|
|
|
2113
2083
|
}).prompt();
|
|
2114
2084
|
};
|
|
2115
2085
|
//#endregion
|
|
2116
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2086
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/constants.js
|
|
2117
2087
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2118
2088
|
const SEMVER_SPEC_VERSION = "2.0.0";
|
|
2119
2089
|
const MAX_LENGTH = 256;
|
|
@@ -2138,12 +2108,12 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2138
2108
|
};
|
|
2139
2109
|
}));
|
|
2140
2110
|
//#endregion
|
|
2141
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2111
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/debug.js
|
|
2142
2112
|
var require_debug = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2143
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) : () => {};
|
|
2144
2114
|
}));
|
|
2145
2115
|
//#endregion
|
|
2146
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2116
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/re.js
|
|
2147
2117
|
var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2148
2118
|
const { MAX_SAFE_COMPONENT_LENGTH, MAX_SAFE_BUILD_LENGTH, MAX_LENGTH } = require_constants();
|
|
2149
2119
|
const debug = require_debug();
|
|
@@ -2222,7 +2192,7 @@ var require_re = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2222
2192
|
createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
|
|
2223
2193
|
}));
|
|
2224
2194
|
//#endregion
|
|
2225
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2195
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/parse-options.js
|
|
2226
2196
|
var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2227
2197
|
const looseOption = Object.freeze({ loose: true });
|
|
2228
2198
|
const emptyOpts = Object.freeze({});
|
|
@@ -2234,7 +2204,7 @@ var require_parse_options = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
2234
2204
|
module.exports = parseOptions;
|
|
2235
2205
|
}));
|
|
2236
2206
|
//#endregion
|
|
2237
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2207
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/identifiers.js
|
|
2238
2208
|
var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2239
2209
|
const numeric = /^[0-9]+$/;
|
|
2240
2210
|
const compareIdentifiers = (a, b) => {
|
|
@@ -2254,13 +2224,19 @@ var require_identifiers = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2254
2224
|
};
|
|
2255
2225
|
}));
|
|
2256
2226
|
//#endregion
|
|
2257
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2227
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/semver.js
|
|
2258
2228
|
var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2259
2229
|
const debug = require_debug();
|
|
2260
2230
|
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
|
|
2261
2231
|
const { safeRe: re, t } = require_re();
|
|
2262
2232
|
const parseOptions = require_parse_options();
|
|
2263
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
|
+
};
|
|
2264
2240
|
module.exports = class SemVer {
|
|
2265
2241
|
constructor(version, options) {
|
|
2266
2242
|
options = parseOptions(options);
|
|
@@ -2417,8 +2393,9 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2417
2393
|
if (identifier) {
|
|
2418
2394
|
let prerelease = [identifier, base];
|
|
2419
2395
|
if (identifierBase === false) prerelease = [identifier];
|
|
2420
|
-
if (
|
|
2421
|
-
|
|
2396
|
+
if (isPrereleaseIdentifier(this.prerelease, identifier)) {
|
|
2397
|
+
const prereleaseBase = this.prerelease[identifier.split(".").length];
|
|
2398
|
+
if (isNaN(prereleaseBase)) this.prerelease = prerelease;
|
|
2422
2399
|
} else this.prerelease = prerelease;
|
|
2423
2400
|
}
|
|
2424
2401
|
break;
|
|
@@ -2432,7 +2409,7 @@ var require_semver$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2432
2409
|
};
|
|
2433
2410
|
}));
|
|
2434
2411
|
//#endregion
|
|
2435
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2412
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/parse.js
|
|
2436
2413
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2437
2414
|
const SemVer = require_semver$1();
|
|
2438
2415
|
const parse = (version, options, throwErrors = false) => {
|
|
@@ -2447,7 +2424,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2447
2424
|
module.exports = parse;
|
|
2448
2425
|
}));
|
|
2449
2426
|
//#endregion
|
|
2450
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2427
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/valid.js
|
|
2451
2428
|
var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2452
2429
|
const parse = require_parse();
|
|
2453
2430
|
const valid = (version, options) => {
|
|
@@ -2457,7 +2434,7 @@ var require_valid$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2457
2434
|
module.exports = valid;
|
|
2458
2435
|
}));
|
|
2459
2436
|
//#endregion
|
|
2460
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2437
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/clean.js
|
|
2461
2438
|
var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2462
2439
|
const parse = require_parse();
|
|
2463
2440
|
const clean = (version, options) => {
|
|
@@ -2467,7 +2444,7 @@ var require_clean = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2467
2444
|
module.exports = clean;
|
|
2468
2445
|
}));
|
|
2469
2446
|
//#endregion
|
|
2470
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2447
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/inc.js
|
|
2471
2448
|
var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2472
2449
|
const SemVer = require_semver$1();
|
|
2473
2450
|
const inc = (version, release, options, identifier, identifierBase) => {
|
|
@@ -2485,7 +2462,7 @@ var require_inc = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2485
2462
|
module.exports = inc;
|
|
2486
2463
|
}));
|
|
2487
2464
|
//#endregion
|
|
2488
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2465
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/diff.js
|
|
2489
2466
|
var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2490
2467
|
const parse = require_parse();
|
|
2491
2468
|
const diff = (version1, version2) => {
|
|
@@ -2513,28 +2490,28 @@ var require_diff = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2513
2490
|
module.exports = diff;
|
|
2514
2491
|
}));
|
|
2515
2492
|
//#endregion
|
|
2516
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2493
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/major.js
|
|
2517
2494
|
var require_major = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2518
2495
|
const SemVer = require_semver$1();
|
|
2519
2496
|
const major = (a, loose) => new SemVer(a, loose).major;
|
|
2520
2497
|
module.exports = major;
|
|
2521
2498
|
}));
|
|
2522
2499
|
//#endregion
|
|
2523
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2500
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/minor.js
|
|
2524
2501
|
var require_minor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2525
2502
|
const SemVer = require_semver$1();
|
|
2526
2503
|
const minor = (a, loose) => new SemVer(a, loose).minor;
|
|
2527
2504
|
module.exports = minor;
|
|
2528
2505
|
}));
|
|
2529
2506
|
//#endregion
|
|
2530
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2507
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/patch.js
|
|
2531
2508
|
var require_patch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2532
2509
|
const SemVer = require_semver$1();
|
|
2533
2510
|
const patch = (a, loose) => new SemVer(a, loose).patch;
|
|
2534
2511
|
module.exports = patch;
|
|
2535
2512
|
}));
|
|
2536
2513
|
//#endregion
|
|
2537
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2514
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/prerelease.js
|
|
2538
2515
|
var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2539
2516
|
const parse = require_parse();
|
|
2540
2517
|
const prerelease = (version, options) => {
|
|
@@ -2544,28 +2521,28 @@ var require_prerelease = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2544
2521
|
module.exports = prerelease;
|
|
2545
2522
|
}));
|
|
2546
2523
|
//#endregion
|
|
2547
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2524
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare.js
|
|
2548
2525
|
var require_compare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2549
2526
|
const SemVer = require_semver$1();
|
|
2550
2527
|
const compare = (a, b, loose) => new SemVer(a, loose).compare(new SemVer(b, loose));
|
|
2551
2528
|
module.exports = compare;
|
|
2552
2529
|
}));
|
|
2553
2530
|
//#endregion
|
|
2554
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2531
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rcompare.js
|
|
2555
2532
|
var require_rcompare = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2556
2533
|
const compare = require_compare();
|
|
2557
2534
|
const rcompare = (a, b, loose) => compare(b, a, loose);
|
|
2558
2535
|
module.exports = rcompare;
|
|
2559
2536
|
}));
|
|
2560
2537
|
//#endregion
|
|
2561
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2538
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-loose.js
|
|
2562
2539
|
var require_compare_loose = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2563
2540
|
const compare = require_compare();
|
|
2564
2541
|
const compareLoose = (a, b) => compare(a, b, true);
|
|
2565
2542
|
module.exports = compareLoose;
|
|
2566
2543
|
}));
|
|
2567
2544
|
//#endregion
|
|
2568
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2545
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/compare-build.js
|
|
2569
2546
|
var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2570
2547
|
const SemVer = require_semver$1();
|
|
2571
2548
|
const compareBuild = (a, b, loose) => {
|
|
@@ -2576,63 +2553,63 @@ var require_compare_build = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
2576
2553
|
module.exports = compareBuild;
|
|
2577
2554
|
}));
|
|
2578
2555
|
//#endregion
|
|
2579
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2556
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/sort.js
|
|
2580
2557
|
var require_sort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2581
2558
|
const compareBuild = require_compare_build();
|
|
2582
2559
|
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose));
|
|
2583
2560
|
module.exports = sort;
|
|
2584
2561
|
}));
|
|
2585
2562
|
//#endregion
|
|
2586
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2563
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/rsort.js
|
|
2587
2564
|
var require_rsort = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2588
2565
|
const compareBuild = require_compare_build();
|
|
2589
2566
|
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose));
|
|
2590
2567
|
module.exports = rsort;
|
|
2591
2568
|
}));
|
|
2592
2569
|
//#endregion
|
|
2593
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2570
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gt.js
|
|
2594
2571
|
var require_gt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2595
2572
|
const compare = require_compare();
|
|
2596
2573
|
const gt = (a, b, loose) => compare(a, b, loose) > 0;
|
|
2597
2574
|
module.exports = gt;
|
|
2598
2575
|
}));
|
|
2599
2576
|
//#endregion
|
|
2600
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2577
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lt.js
|
|
2601
2578
|
var require_lt = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2602
2579
|
const compare = require_compare();
|
|
2603
2580
|
const lt = (a, b, loose) => compare(a, b, loose) < 0;
|
|
2604
2581
|
module.exports = lt;
|
|
2605
2582
|
}));
|
|
2606
2583
|
//#endregion
|
|
2607
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2584
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/eq.js
|
|
2608
2585
|
var require_eq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2609
2586
|
const compare = require_compare();
|
|
2610
2587
|
const eq = (a, b, loose) => compare(a, b, loose) === 0;
|
|
2611
2588
|
module.exports = eq;
|
|
2612
2589
|
}));
|
|
2613
2590
|
//#endregion
|
|
2614
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2591
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/neq.js
|
|
2615
2592
|
var require_neq = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2616
2593
|
const compare = require_compare();
|
|
2617
2594
|
const neq = (a, b, loose) => compare(a, b, loose) !== 0;
|
|
2618
2595
|
module.exports = neq;
|
|
2619
2596
|
}));
|
|
2620
2597
|
//#endregion
|
|
2621
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2598
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/gte.js
|
|
2622
2599
|
var require_gte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2623
2600
|
const compare = require_compare();
|
|
2624
2601
|
const gte = (a, b, loose) => compare(a, b, loose) >= 0;
|
|
2625
2602
|
module.exports = gte;
|
|
2626
2603
|
}));
|
|
2627
2604
|
//#endregion
|
|
2628
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2605
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/lte.js
|
|
2629
2606
|
var require_lte = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2630
2607
|
const compare = require_compare();
|
|
2631
2608
|
const lte = (a, b, loose) => compare(a, b, loose) <= 0;
|
|
2632
2609
|
module.exports = lte;
|
|
2633
2610
|
}));
|
|
2634
2611
|
//#endregion
|
|
2635
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2612
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/cmp.js
|
|
2636
2613
|
var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2637
2614
|
const eq = require_eq();
|
|
2638
2615
|
const neq = require_neq();
|
|
@@ -2664,7 +2641,7 @@ var require_cmp = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2664
2641
|
module.exports = cmp;
|
|
2665
2642
|
}));
|
|
2666
2643
|
//#endregion
|
|
2667
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2644
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/coerce.js
|
|
2668
2645
|
var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2669
2646
|
const SemVer = require_semver$1();
|
|
2670
2647
|
const parse = require_parse();
|
|
@@ -2692,7 +2669,7 @@ var require_coerce = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2692
2669
|
module.exports = coerce;
|
|
2693
2670
|
}));
|
|
2694
2671
|
//#endregion
|
|
2695
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2672
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/truncate.js
|
|
2696
2673
|
var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2697
2674
|
const parse = require_parse();
|
|
2698
2675
|
const constants = require_constants();
|
|
@@ -2725,7 +2702,7 @@ var require_truncate = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2725
2702
|
module.exports = truncate;
|
|
2726
2703
|
}));
|
|
2727
2704
|
//#endregion
|
|
2728
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2705
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/internal/lrucache.js
|
|
2729
2706
|
var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2730
2707
|
var LRUCache = class {
|
|
2731
2708
|
constructor() {
|
|
@@ -2758,7 +2735,7 @@ var require_lrucache = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2758
2735
|
module.exports = LRUCache;
|
|
2759
2736
|
}));
|
|
2760
2737
|
//#endregion
|
|
2761
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
2738
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/range.js
|
|
2762
2739
|
var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
2763
2740
|
const SPACE_CHARACTERS = /\s+/g;
|
|
2764
2741
|
module.exports = class Range {
|
|
@@ -2812,6 +2789,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2812
2789
|
return this.range;
|
|
2813
2790
|
}
|
|
2814
2791
|
parseRange(range) {
|
|
2792
|
+
range = range.replace(BUILDSTRIPRE, "");
|
|
2815
2793
|
const memoKey = ((this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE)) + ":" + range;
|
|
2816
2794
|
const cached = cache.get(memoKey);
|
|
2817
2795
|
if (cached) return cached;
|
|
@@ -2870,8 +2848,9 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2870
2848
|
const Comparator = require_comparator();
|
|
2871
2849
|
const debug = require_debug();
|
|
2872
2850
|
const SemVer = require_semver$1();
|
|
2873
|
-
const { safeRe: re, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
2851
|
+
const { safeRe: re, src, t, comparatorTrimReplace, tildeTrimReplace, caretTrimReplace } = require_re();
|
|
2874
2852
|
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
|
|
2853
|
+
const BUILDSTRIPRE = new RegExp(src[t.BUILD], "g");
|
|
2875
2854
|
const isNullSet = (c) => c.value === "<0.0.0-0";
|
|
2876
2855
|
const isAny = (c) => c.value === "";
|
|
2877
2856
|
const isSatisfiable = (comparators, options) => {
|
|
@@ -2900,6 +2879,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2900
2879
|
return comp;
|
|
2901
2880
|
};
|
|
2902
2881
|
const isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
|
|
2882
|
+
const invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
|
|
2903
2883
|
const replaceTildes = (comp, options) => {
|
|
2904
2884
|
return comp.trim().split(/\s+/).map((c) => replaceTilde(c, options)).join(" ");
|
|
2905
2885
|
};
|
|
@@ -2940,8 +2920,8 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2940
2920
|
else ret = `>=${M}.${m}.${p}-${pr} <${+M + 1}.0.0-0`;
|
|
2941
2921
|
} else {
|
|
2942
2922
|
debug("no pr");
|
|
2943
|
-
if (M === "0") if (m === "0") ret = `>=${M}.${m}.${p}
|
|
2944
|
-
else ret = `>=${M}.${m}.${p}
|
|
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`;
|
|
2945
2925
|
else ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
|
|
2946
2926
|
}
|
|
2947
2927
|
debug("caret return", ret);
|
|
@@ -2957,6 +2937,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
2957
2937
|
const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
|
|
2958
2938
|
return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
|
|
2959
2939
|
debug("xRange", comp, ret, gtlt, M, m, p, pr);
|
|
2940
|
+
if (invalidXRangeOrder(M, m, p)) return comp;
|
|
2960
2941
|
const xM = isX(M);
|
|
2961
2942
|
const xm = xM || isX(m);
|
|
2962
2943
|
const xp = xm || isX(p);
|
|
@@ -3030,7 +3011,7 @@ var require_range = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3030
3011
|
};
|
|
3031
3012
|
}));
|
|
3032
3013
|
//#endregion
|
|
3033
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3014
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/classes/comparator.js
|
|
3034
3015
|
var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3035
3016
|
const ANY = Symbol("SemVer ANY");
|
|
3036
3017
|
module.exports = class Comparator {
|
|
@@ -3100,7 +3081,7 @@ var require_comparator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3100
3081
|
const Range = require_range();
|
|
3101
3082
|
}));
|
|
3102
3083
|
//#endregion
|
|
3103
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3084
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/functions/satisfies.js
|
|
3104
3085
|
var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3105
3086
|
const Range = require_range();
|
|
3106
3087
|
const satisfies = (version, range, options) => {
|
|
@@ -3114,14 +3095,14 @@ var require_satisfies = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3114
3095
|
module.exports = satisfies;
|
|
3115
3096
|
}));
|
|
3116
3097
|
//#endregion
|
|
3117
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3098
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/to-comparators.js
|
|
3118
3099
|
var require_to_comparators = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3119
3100
|
const Range = require_range();
|
|
3120
3101
|
const toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c) => c.value).join(" ").trim().split(" "));
|
|
3121
3102
|
module.exports = toComparators;
|
|
3122
3103
|
}));
|
|
3123
3104
|
//#endregion
|
|
3124
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3105
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/max-satisfying.js
|
|
3125
3106
|
var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3126
3107
|
const SemVer = require_semver$1();
|
|
3127
3108
|
const Range = require_range();
|
|
@@ -3147,7 +3128,7 @@ var require_max_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3147
3128
|
module.exports = maxSatisfying;
|
|
3148
3129
|
}));
|
|
3149
3130
|
//#endregion
|
|
3150
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3131
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-satisfying.js
|
|
3151
3132
|
var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3152
3133
|
const SemVer = require_semver$1();
|
|
3153
3134
|
const Range = require_range();
|
|
@@ -3173,7 +3154,7 @@ var require_min_satisfying = /* @__PURE__ */ __commonJSMin(((exports, module) =>
|
|
|
3173
3154
|
module.exports = minSatisfying;
|
|
3174
3155
|
}));
|
|
3175
3156
|
//#endregion
|
|
3176
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3157
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/min-version.js
|
|
3177
3158
|
var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3178
3159
|
const SemVer = require_semver$1();
|
|
3179
3160
|
const Range = require_range();
|
|
@@ -3213,7 +3194,7 @@ var require_min_version = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3213
3194
|
module.exports = minVersion;
|
|
3214
3195
|
}));
|
|
3215
3196
|
//#endregion
|
|
3216
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3197
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/valid.js
|
|
3217
3198
|
var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3218
3199
|
const Range = require_range();
|
|
3219
3200
|
const validRange = (range, options) => {
|
|
@@ -3226,7 +3207,7 @@ var require_valid = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3226
3207
|
module.exports = validRange;
|
|
3227
3208
|
}));
|
|
3228
3209
|
//#endregion
|
|
3229
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3210
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/outside.js
|
|
3230
3211
|
var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3231
3212
|
const SemVer = require_semver$1();
|
|
3232
3213
|
const Comparator = require_comparator();
|
|
@@ -3279,21 +3260,21 @@ var require_outside = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3279
3260
|
module.exports = outside;
|
|
3280
3261
|
}));
|
|
3281
3262
|
//#endregion
|
|
3282
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3263
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/gtr.js
|
|
3283
3264
|
var require_gtr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3284
3265
|
const outside = require_outside();
|
|
3285
3266
|
const gtr = (version, range, options) => outside(version, range, ">", options);
|
|
3286
3267
|
module.exports = gtr;
|
|
3287
3268
|
}));
|
|
3288
3269
|
//#endregion
|
|
3289
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3270
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/ltr.js
|
|
3290
3271
|
var require_ltr = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3291
3272
|
const outside = require_outside();
|
|
3292
3273
|
const ltr = (version, range, options) => outside(version, range, "<", options);
|
|
3293
3274
|
module.exports = ltr;
|
|
3294
3275
|
}));
|
|
3295
3276
|
//#endregion
|
|
3296
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3277
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/intersects.js
|
|
3297
3278
|
var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3298
3279
|
const Range = require_range();
|
|
3299
3280
|
const intersects = (r1, r2, options) => {
|
|
@@ -3304,7 +3285,7 @@ var require_intersects = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3304
3285
|
module.exports = intersects;
|
|
3305
3286
|
}));
|
|
3306
3287
|
//#endregion
|
|
3307
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3288
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/simplify.js
|
|
3308
3289
|
var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3309
3290
|
const satisfies = require_satisfies();
|
|
3310
3291
|
const compare = require_compare();
|
|
@@ -3334,7 +3315,7 @@ var require_simplify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3334
3315
|
};
|
|
3335
3316
|
}));
|
|
3336
3317
|
//#endregion
|
|
3337
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3318
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/ranges/subset.js
|
|
3338
3319
|
var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3339
3320
|
const Range = require_range();
|
|
3340
3321
|
const Comparator = require_comparator();
|
|
@@ -3398,7 +3379,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3398
3379
|
if (c.operator === ">" || c.operator === ">=") {
|
|
3399
3380
|
higher = higherGT(gt, c, options);
|
|
3400
3381
|
if (higher === c && higher !== gt) return false;
|
|
3401
|
-
} else if (gt.operator === ">=" && !
|
|
3382
|
+
} else if (gt.operator === ">=" && !c.test(gt.semver)) return false;
|
|
3402
3383
|
}
|
|
3403
3384
|
if (lt) {
|
|
3404
3385
|
if (needDomLTPre) {
|
|
@@ -3407,7 +3388,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3407
3388
|
if (c.operator === "<" || c.operator === "<=") {
|
|
3408
3389
|
lower = lowerLT(lt, c, options);
|
|
3409
3390
|
if (lower === c && lower !== lt) return false;
|
|
3410
|
-
} else if (lt.operator === "<=" && !
|
|
3391
|
+
} else if (lt.operator === "<=" && !c.test(lt.semver)) return false;
|
|
3411
3392
|
}
|
|
3412
3393
|
if (!c.operator && (lt || gt) && gtltComp !== 0) return false;
|
|
3413
3394
|
}
|
|
@@ -3429,7 +3410,7 @@ var require_subset = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3429
3410
|
module.exports = subset;
|
|
3430
3411
|
}));
|
|
3431
3412
|
//#endregion
|
|
3432
|
-
//#region ../../node_modules/.pnpm/semver@7.8.
|
|
3413
|
+
//#region ../../node_modules/.pnpm/semver@7.8.4/node_modules/semver/index.js
|
|
3433
3414
|
var require_semver = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3434
3415
|
const internalRe = require_re();
|
|
3435
3416
|
const constants = require_constants();
|
|
@@ -3499,8 +3480,371 @@ const DependencyType = {
|
|
|
3499
3480
|
optionalDependencies: "optionalDependencies"
|
|
3500
3481
|
};
|
|
3501
3482
|
//#endregion
|
|
3502
|
-
//#region src/utils/
|
|
3483
|
+
//#region src/utils/spinner.ts
|
|
3503
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
|
|
3504
3848
|
/**
|
|
3505
3849
|
* pnpm v11 promoted `ERR_PNPM_IGNORED_BUILDS` from a warning to a hard
|
|
3506
3850
|
* exit-1. Auto-installs run by `vp migrate` / `vp create` happen before the
|
|
@@ -3534,7 +3878,7 @@ async function selectPackageManager(interactive, silent = false) {
|
|
|
3534
3878
|
],
|
|
3535
3879
|
initialValue: PackageManager.pnpm
|
|
3536
3880
|
});
|
|
3537
|
-
if (
|
|
3881
|
+
if (R(selected)) cancelAndExit();
|
|
3538
3882
|
return selected;
|
|
3539
3883
|
} else {
|
|
3540
3884
|
if (!silent) log.info(`Using default package manager: ${accent(PackageManager.pnpm)}`);
|
|
@@ -3556,8 +3900,9 @@ async function runViteInstall(cwd, interactive, extraArgs, options) {
|
|
|
3556
3900
|
durationMs: 0,
|
|
3557
3901
|
status: "skipped"
|
|
3558
3902
|
};
|
|
3903
|
+
const detectIgnoredBuilds = options?.detectIgnoredBuilds === true;
|
|
3559
3904
|
const installArgs = [...extraArgs ?? []];
|
|
3560
|
-
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");
|
|
3561
3906
|
const spinner = options?.silent ? getSilentSpinner() : getSpinner(interactive);
|
|
3562
3907
|
const startTime = Date.now();
|
|
3563
3908
|
spinner.start(`Installing dependencies...`);
|
|
@@ -3567,12 +3912,16 @@ async function runViteInstall(cwd, interactive, extraArgs, options) {
|
|
|
3567
3912
|
cwd,
|
|
3568
3913
|
envs: process.env
|
|
3569
3914
|
});
|
|
3570
|
-
|
|
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) {
|
|
3571
3919
|
spinner.stop(`Dependencies installed`);
|
|
3572
3920
|
return {
|
|
3573
3921
|
durationMs: Date.now() - startTime,
|
|
3574
3922
|
exitCode,
|
|
3575
|
-
status: "installed"
|
|
3923
|
+
status: "installed",
|
|
3924
|
+
pendingBuilds
|
|
3576
3925
|
};
|
|
3577
3926
|
} else {
|
|
3578
3927
|
spinner.stop(`Install failed`);
|
|
@@ -3648,7 +3997,7 @@ async function promptGitHooks(options) {
|
|
|
3648
3997
|
message: "Set up pre-commit hooks to run formatting, linting, and type checking with auto-fixes?",
|
|
3649
3998
|
initialValue: true
|
|
3650
3999
|
});
|
|
3651
|
-
if (
|
|
4000
|
+
if (R(selected)) {
|
|
3652
4001
|
cancelAndExit();
|
|
3653
4002
|
return false;
|
|
3654
4003
|
}
|
|
@@ -3664,7 +4013,7 @@ async function promptGitInit(options) {
|
|
|
3664
4013
|
message: "Initialize a git repository with an initial commit?",
|
|
3665
4014
|
initialValue: true
|
|
3666
4015
|
});
|
|
3667
|
-
if (
|
|
4016
|
+
if (R(selected)) {
|
|
3668
4017
|
cancelAndExit();
|
|
3669
4018
|
return false;
|
|
3670
4019
|
}
|
|
@@ -3672,30 +4021,13 @@ async function promptGitInit(options) {
|
|
|
3672
4021
|
}
|
|
3673
4022
|
return false;
|
|
3674
4023
|
}
|
|
4024
|
+
async function resolveGitInit(options, isMonorepo) {
|
|
4025
|
+
if (isMonorepo) return false;
|
|
4026
|
+
return promptGitInit(options);
|
|
4027
|
+
}
|
|
3675
4028
|
function defaultInteractive() {
|
|
3676
4029
|
return !process.env.CI && process.stdin.isTTY;
|
|
3677
4030
|
}
|
|
3678
|
-
function getSpinner(interactive) {
|
|
3679
|
-
if (interactive) return spinner();
|
|
3680
|
-
return {
|
|
3681
|
-
start: (msg) => {
|
|
3682
|
-
if (msg) log.info(msg);
|
|
3683
|
-
},
|
|
3684
|
-
stop: (msg) => {
|
|
3685
|
-
if (msg) log.info(msg);
|
|
3686
|
-
},
|
|
3687
|
-
message: (msg) => {
|
|
3688
|
-
if (msg) log.info(msg);
|
|
3689
|
-
}
|
|
3690
|
-
};
|
|
3691
|
-
}
|
|
3692
|
-
function getSilentSpinner() {
|
|
3693
|
-
return {
|
|
3694
|
-
start: () => {},
|
|
3695
|
-
stop: () => {},
|
|
3696
|
-
message: () => {}
|
|
3697
|
-
};
|
|
3698
|
-
}
|
|
3699
4031
|
//#endregion
|
|
3700
4032
|
//#region src/utils/tsconfig.ts
|
|
3701
4033
|
/**
|
|
@@ -3731,7 +4063,7 @@ async function confirmBaseUrlFix(interactive) {
|
|
|
3731
4063
|
message: "Your tsconfig contains `baseUrl`, which prevents enabling type-aware linting.\n " + styleText("gray", "`baseUrl` is deprecated in TypeScript 6.0 and removed in TypeScript 7.0.") + `\n Download and run the external \`${BASEURL_TSCONFIG_FIX_PACKAGE}\` fixer now?\n ` + styleText("gray", `Equivalent command: \`vp dlx ${command}\``),
|
|
3732
4064
|
initialValue: true
|
|
3733
4065
|
});
|
|
3734
|
-
if (
|
|
4066
|
+
if (R(confirmed)) cancelAndExit();
|
|
3735
4067
|
return confirmed;
|
|
3736
4068
|
}
|
|
3737
4069
|
async function fixBaseUrlInTsconfig(projectPath, options) {
|
|
@@ -3791,6 +4123,20 @@ function removeDeprecatedTsconfigFalseOption(filePath, optionName) {
|
|
|
3791
4123
|
fs.writeFileSync(filePath, newText);
|
|
3792
4124
|
return true;
|
|
3793
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
|
+
}
|
|
3794
4140
|
function rewriteTypesInTsconfig(filePath) {
|
|
3795
4141
|
let text;
|
|
3796
4142
|
try {
|
|
@@ -3800,13 +4146,9 @@ function rewriteTypesInTsconfig(filePath) {
|
|
|
3800
4146
|
}
|
|
3801
4147
|
const types = parse(text)?.compilerOptions?.types;
|
|
3802
4148
|
if (!Array.isArray(types)) return false;
|
|
3803
|
-
const
|
|
3804
|
-
"tsdown/client": "vite-plus/pack/client",
|
|
3805
|
-
"vite/client": "vite-plus/client"
|
|
3806
|
-
};
|
|
3807
|
-
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 ? {
|
|
3808
4150
|
i,
|
|
3809
|
-
newVal:
|
|
4151
|
+
newVal: TSCONFIG_TYPE_REPLACEMENTS[t]
|
|
3810
4152
|
} : null).filter((x) => x !== null);
|
|
3811
4153
|
if (toReplace.length === 0) return false;
|
|
3812
4154
|
let currentText = text;
|
|
@@ -3823,4 +4165,4 @@ function rewriteTypesInTsconfig(filePath) {
|
|
|
3823
4165
|
return true;
|
|
3824
4166
|
}
|
|
3825
4167
|
//#endregion
|
|
3826
|
-
export {
|
|
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 };
|