vite-plus 1.5.1 → 1.6.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/binding/index.cjs +57 -56
- package/binding/index.d.cts +9 -0
- package/dist/{agent-CowvWq3j.js → agent-CTG3B-ec.js} +2 -2
- package/dist/bin.js +21 -6
- package/dist/{comparison-CmVirWIW-UlEf2maz.js → comparison-CmVirWIW-Z8p6CfWL.js} +4 -1
- package/dist/config/bin.js +2 -2
- package/dist/constants-DXqV1vWL.js +77 -0
- package/dist/create/bin.js +29 -34
- package/dist/{define-config-XKYhw0xH.js → define-config-CeYkQCqG.js} +1 -1
- package/dist/{define-config-BGCfAiIo.cjs → define-config-jt2Hyhp2.cjs} +1 -1
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{editor-BVaNnIey.js → editor-C0U0Ymqk.js} +213 -83
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +9 -8
- package/dist/{oxlint-plugin-config-5hVqz4kj.js → oxlint-plugin-config-DvBRM_Se.js} +1 -1
- package/dist/oxlint-plugin.js +2 -2
- package/dist/pack-bin.js +1 -1
- package/dist/{package-DLUCo6L_.js → package-CK48ZXBV.js} +1 -1
- package/dist/{constants-D5f7inVN.js → package-Cc9gI1u1.js} +2 -77
- package/dist/{package-overrides-Ci8GXouY.js → package-overrides-nw4zcITi.js} +1 -1
- package/dist/{prompts-DLpJGhfK.js → prompts-JkuWOV60.js} +9 -5
- package/dist/{resolve-vite-config-D7IUZYKq.js → resolve-vite-config-CfUvxuCo.js} +1 -1
- package/dist/{resolve-vite-config-D-JtjGRa.js → resolve-vite-config-x5QVnaf4.js} +2 -2
- package/dist/staged/bin.js +1 -1
- package/dist/sync-versions/bin.js +1 -1
- package/dist/toolchain.js +7 -7
- package/dist/toolchain.json +7 -7
- package/dist/{tsconfig-DLERIAbF.js → tsconfig-CZlh956U.js} +1 -1
- package/dist/{tsconfig-D3DiCiW6.js → tsconfig-DUR3fhIX.js} +2 -2
- package/dist/user-agent-CpEaSTwI.js +6 -0
- package/dist/version.js +3 -2
- package/dist/versions.js +3 -3
- package/dist/vpx-bin.js +2 -0
- package/docs/config/run.md +8 -7
- package/docs/guide/automatic-data-tracking.md +138 -0
- package/docs/guide/check.md +13 -0
- package/docs/guide/global-cli.md +12 -2
- package/docs/guide/migrate-rules.md +3 -1
- package/docs/guide/migrate.md +4 -4
- package/docs/guide/run.md +22 -0
- package/package.json +17 -17
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { r as __toESM } from "./rolldown-runtime-DegdyBIC.js";
|
|
2
2
|
import { t as documentationUrl$1 } from "./documentation-cv_y0Auv.js";
|
|
3
|
-
import { a as SETUP_VP_VERSION, c as VITEST_VERSION, d as VITE_PLUS_OVERRIDE_PACKAGES, f as VITE_PLUS_VERSION, l as VITE_CONFIG_FILES, m as isForceOverrideMode, n as BASEURL_TSCONFIG_WARNING, o as TSDOWN_MIGRATION_SKILL_URL, s as VITEST_AGE_GATE_EXEMPT_PACKAGES, u as VITE_PLUS_NAME } from "./constants-
|
|
4
|
-
import { a as ensureVitePlusImportRuleDefaults, i as createDefaultVitePlusLintConfig, t as PREFER_VITE_PLUS_IMPORTS_RULE } from "./oxlint-plugin-config-
|
|
3
|
+
import { a as SETUP_VP_VERSION, c as VITEST_VERSION, d as VITE_PLUS_OVERRIDE_PACKAGES, f as VITE_PLUS_VERSION, l as VITE_CONFIG_FILES, m as isForceOverrideMode, n as BASEURL_TSCONFIG_WARNING, o as TSDOWN_MIGRATION_SKILL_URL, s as VITEST_AGE_GATE_EXEMPT_PACKAGES, u as VITE_PLUS_NAME } from "./constants-DXqV1vWL.js";
|
|
4
|
+
import { a as ensureVitePlusImportRuleDefaults, i as createDefaultVitePlusLintConfig, t as PREFER_VITE_PLUS_IMPORTS_RULE } from "./oxlint-plugin-config-DvBRM_Se.js";
|
|
5
5
|
import { a as writeJsonFile, c as modify, i as readJsonFile, l as parse, n as editJsonFile, o as applyEdits, r as isJsonFile, t as detectFormattingOptions } from "./json-kl84kDyH.js";
|
|
6
|
-
import { c as getNpmRegistry, n as detectPackageMetadata, r as getScopeFromPackageName, s as fetchNpmResource } from "./package-
|
|
6
|
+
import { c as getNpmRegistry, n as detectPackageMetadata, r as getScopeFromPackageName, s as fetchNpmResource } from "./package-CK48ZXBV.js";
|
|
7
7
|
import { n as isAlignableVitestEcosystemPackage } from "./vitest-ecosystem-BeEYz-qF.js";
|
|
8
|
-
import { C as confirm, E as multiselect, M as isCancel, O as select, S as normalize$3, T as log$1, _ as getSpinner, b as coerce, d as readYamlFile, f as scalarString, g as getSilentSpinner, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-
|
|
9
|
-
import { _ as isGreaterThanOrEqual, h as compareReversed, v as isLessThanOrEqual } from "./comparison-CmVirWIW-
|
|
10
|
-
import { s as satisfies, t as extractOverrideTargetName } from "./package-overrides-
|
|
11
|
-
import { l as displayRelative, u as rulesDir } from "./agent-
|
|
8
|
+
import { C as confirm, E as multiselect, M as isCancel, O as select, S as normalize$3, T as log$1, _ as getSpinner, b as coerce, d as readYamlFile, f as scalarString, g as getSilentSpinner, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-JkuWOV60.js";
|
|
9
|
+
import { _ as isGreaterThanOrEqual, h as compareReversed, v as isLessThan, y as isLessThanOrEqual } from "./comparison-CmVirWIW-Z8p6CfWL.js";
|
|
10
|
+
import { s as satisfies, t as extractOverrideTargetName } from "./package-overrides-nw4zcITi.js";
|
|
11
|
+
import { l as displayRelative, u as rulesDir } from "./agent-CTG3B-ec.js";
|
|
12
12
|
import { n as addMigrationWarning, t as addManualStep } from "./report-BEdpIQvC.js";
|
|
13
13
|
import { a as require_cross_spawn, i as runCommandSilently, n as getVpCommand } from "./command-rY79K5NI.js";
|
|
14
14
|
import { t as require_dist } from "./dist-Bs0SObNC.js";
|
|
15
|
-
import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-
|
|
15
|
+
import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-DUR3fhIX.js";
|
|
16
16
|
import { t as require_picomatch } from "./picomatch-DEUoj81q.js";
|
|
17
17
|
import { a as findUnsafeHookInstallPath, n as SUPPORTED_GIT_HOOK_NAMES, o as hookScript, t as HOOK_STUB_SCRIPT } from "./hooks-w_e2whkQ.js";
|
|
18
18
|
import path from "node:path";
|
|
@@ -2218,7 +2218,71 @@ function expand_(str, max, maxLength, maxDepth, depth, maxRewrites, isTop) {
|
|
|
2218
2218
|
}
|
|
2219
2219
|
return acc;
|
|
2220
2220
|
}
|
|
2221
|
-
// ../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.0
|
|
2221
|
+
// ../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/numeric-range.js
|
|
2222
|
+
const digit = (a, b) => a === b ? {
|
|
2223
|
+
t: "lit",
|
|
2224
|
+
ch: String(a)
|
|
2225
|
+
} : {
|
|
2226
|
+
t: "class",
|
|
2227
|
+
re: new RegExp(`^[${a}-${b}]$`)
|
|
2228
|
+
};
|
|
2229
|
+
const prefix = (d, alts) => alts.map((s) => [digit(d, d), ...s]);
|
|
2230
|
+
const fixed = (a, b) => {
|
|
2231
|
+
if (!a) return [[]];
|
|
2232
|
+
let lo = +a[0];
|
|
2233
|
+
let hi = +b[0];
|
|
2234
|
+
const ra = a.slice(1);
|
|
2235
|
+
const rb = b.slice(1);
|
|
2236
|
+
if (lo === hi) return prefix(lo, fixed(ra, rb));
|
|
2237
|
+
const zeros = "0".repeat(ra.length);
|
|
2238
|
+
const nines = "9".repeat(ra.length);
|
|
2239
|
+
const out = [];
|
|
2240
|
+
if (ra !== zeros) out.push(...prefix(lo++, fixed(ra, nines)));
|
|
2241
|
+
const last = rb === nines ? [] : prefix(hi--, fixed(zeros, rb));
|
|
2242
|
+
if (lo <= hi) out.push([digit(lo, hi), ...Array.from(ra, () => digit(0, 9))]);
|
|
2243
|
+
out.push(...last);
|
|
2244
|
+
return out;
|
|
2245
|
+
};
|
|
2246
|
+
const nonneg = (a, b, width) => {
|
|
2247
|
+
if (width) return fixed(String(a).padStart(width, "0"), String(b).padStart(width, "0"));
|
|
2248
|
+
const out = [];
|
|
2249
|
+
for (let len = String(a).length; len <= String(b).length; len++) {
|
|
2250
|
+
const lo = Math.max(a, len === 1 ? 0 : 10 ** (len - 1));
|
|
2251
|
+
const hi = Math.min(b, 10 ** len - 1);
|
|
2252
|
+
out.push(...fixed(String(lo), String(hi)));
|
|
2253
|
+
}
|
|
2254
|
+
return out;
|
|
2255
|
+
};
|
|
2256
|
+
/**
|
|
2257
|
+
* The strings that the bash brace expansion `{lo..hi}` makes, as
|
|
2258
|
+
* the alternatives of an `@(...)` extglob. Each one is a sequence of
|
|
2259
|
+
* digits and digit classes, so there are only a few of them, even for
|
|
2260
|
+
* a large range.
|
|
2261
|
+
*
|
|
2262
|
+
* If either end has a leading zero, such as `{01..10}`, each number
|
|
2263
|
+
* has leading zeros to make it as long as the longer end, counting a
|
|
2264
|
+
* `-` sign. So `{-05..3}` makes `-05` to `-01`, then `000` to `003`.
|
|
2265
|
+
*
|
|
2266
|
+
* Returns undefined if either end is not a safe integer.
|
|
2267
|
+
*/
|
|
2268
|
+
const numericRange = (loStr, hiStr) => {
|
|
2269
|
+
let lo = Number(loStr);
|
|
2270
|
+
let hi = Number(hiStr);
|
|
2271
|
+
if (!Number.isSafeInteger(lo) || !Number.isSafeInteger(hi)) return;
|
|
2272
|
+
if (lo > hi) [lo, hi] = [hi, lo];
|
|
2273
|
+
const width = /^-?0\d/.test(loStr) || /^-?0\d/.test(hiStr) ? Math.max(loStr.length, hiStr.length) : 0;
|
|
2274
|
+
const out = [];
|
|
2275
|
+
if (lo < 0) {
|
|
2276
|
+
const neg = nonneg(Math.max(-hi, 1), -lo, width && width - 1);
|
|
2277
|
+
out.push(...neg.map((s) => [{
|
|
2278
|
+
t: "lit",
|
|
2279
|
+
ch: "-"
|
|
2280
|
+
}, ...s]));
|
|
2281
|
+
}
|
|
2282
|
+
if (hi >= 0) out.push(...nonneg(Math.max(lo, 0), hi, width));
|
|
2283
|
+
return out;
|
|
2284
|
+
};
|
|
2285
|
+
// ../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/parse-class.js
|
|
2222
2286
|
const posixClasses = {
|
|
2223
2287
|
"[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}"],
|
|
2224
2288
|
"[:alpha:]": ["\\p{L}\\p{Nl}"],
|
|
@@ -2311,7 +2375,7 @@ const parseClass = (glob, position, nocase = false, form) => {
|
|
|
2311
2375
|
const comb = "^" + (ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs);
|
|
2312
2376
|
return [new RegExp(comb, nocase ? "iu" : "u"), endPos - pos];
|
|
2313
2377
|
};
|
|
2314
|
-
// ../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.0
|
|
2378
|
+
// ../../node_modules/.pnpm/@isaacs+nonrecursive-glob-match@1.1.0/node_modules/@isaacs/nonrecursive-glob-match/dist/esm/index.js
|
|
2315
2379
|
const MATCH = {
|
|
2316
2380
|
t: "match",
|
|
2317
2381
|
id: 0
|
|
@@ -2342,10 +2406,28 @@ const litMatch = (l, c) => {
|
|
|
2342
2406
|
ascii[code] ||= l.re.test(c) ? 1 : 2;
|
|
2343
2407
|
return ascii[code] === 1;
|
|
2344
2408
|
};
|
|
2345
|
-
const tokenize = (p, nocase, noext, form) => {
|
|
2409
|
+
const tokenize = (p, nocase, noext, form, mark) => {
|
|
2346
2410
|
const toks = [];
|
|
2347
2411
|
for (let i = 0; i < p.length;) {
|
|
2348
2412
|
const c = String.fromCodePoint(p.codePointAt(i));
|
|
2413
|
+
if (mark) {
|
|
2414
|
+
const m = c === "\\" && p.startsWith(mark, i + 1) ? 1 : 0;
|
|
2415
|
+
if (m || c === mark) {
|
|
2416
|
+
const start = i + m + mark.length;
|
|
2417
|
+
const end = p.indexOf(mark, start);
|
|
2418
|
+
const r = /^(-?\d+)\.\.(-?\d+)$/.exec(p.slice(start, end));
|
|
2419
|
+
const alts = end !== -1 && r && numericRange(r[1], r[2]);
|
|
2420
|
+
if (alts) {
|
|
2421
|
+
toks.push({
|
|
2422
|
+
t: "ext",
|
|
2423
|
+
type: "@",
|
|
2424
|
+
alts
|
|
2425
|
+
});
|
|
2426
|
+
i = end + mark.length;
|
|
2427
|
+
continue;
|
|
2428
|
+
}
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2349
2431
|
if (c === "\\") {
|
|
2350
2432
|
const e = p.codePointAt(i + 1);
|
|
2351
2433
|
const ch = e === void 0 ? c : String.fromCodePoint(e);
|
|
@@ -2788,7 +2870,7 @@ var Matcher = class {
|
|
|
2788
2870
|
const { nocase = false, noext = false, normalize: n } = options;
|
|
2789
2871
|
this.#form = n === true ? "NFC" : n || void 0;
|
|
2790
2872
|
const literal = /^[?*+@]\(\)$/.test(pattern);
|
|
2791
|
-
const toks = tokenize(pattern, nocase, noext || literal, this.#form);
|
|
2873
|
+
const toks = tokenize(pattern, nocase, noext || literal, this.#form, options.rangeMark);
|
|
2792
2874
|
let [items] = build$8(toks, pair(toks), 0, toks.length, true);
|
|
2793
2875
|
if (this.#form) items = normalize$2(items, this.#form);
|
|
2794
2876
|
const [start, size] = compile(items, nocase);
|
|
@@ -2902,13 +2984,13 @@ var Matcher = class {
|
|
|
2902
2984
|
return show(this.#start);
|
|
2903
2985
|
}
|
|
2904
2986
|
};
|
|
2905
|
-
// ../../node_modules/.pnpm/minimatch@11.0.
|
|
2987
|
+
// ../../node_modules/.pnpm/minimatch@11.0.5/node_modules/minimatch/dist/esm/assert-valid-pattern.js
|
|
2906
2988
|
const MAX_PATTERN_LENGTH = 65536;
|
|
2907
2989
|
const assertValidPattern = (pattern) => {
|
|
2908
2990
|
if (typeof pattern !== "string") throw new TypeError("invalid pattern");
|
|
2909
2991
|
if (pattern.length > MAX_PATTERN_LENGTH) throw new TypeError("pattern is too long");
|
|
2910
2992
|
};
|
|
2911
|
-
// ../../node_modules/.pnpm/minimatch@11.0.
|
|
2993
|
+
// ../../node_modules/.pnpm/minimatch@11.0.5/node_modules/minimatch/dist/esm/escape.js
|
|
2912
2994
|
/**
|
|
2913
2995
|
* Escape all magic characters in a glob pattern.
|
|
2914
2996
|
*
|
|
@@ -2925,7 +3007,7 @@ const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false } = {})
|
|
|
2925
3007
|
if (magicalBraces) return windowsPathsNoEscape ? s.replace(/[?*()[\]{}]/g, "[$&]") : s.replace(/[?*()[\]\\{}]/g, "\\$&");
|
|
2926
3008
|
return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
|
|
2927
3009
|
};
|
|
2928
|
-
// ../../node_modules/.pnpm/minimatch@11.0.
|
|
3010
|
+
// ../../node_modules/.pnpm/minimatch@11.0.5/node_modules/minimatch/dist/esm/unescape.js
|
|
2929
3011
|
/**
|
|
2930
3012
|
* Un-escape a string that has been escaped with {@link escape}.
|
|
2931
3013
|
*
|
|
@@ -2949,7 +3031,7 @@ const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true } = {}
|
|
|
2949
3031
|
if (magicalBraces) return windowsPathsNoEscape ? s.replace(/\[([^/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\])\]/g, "$1$2").replace(/\\([^/])/g, "$1");
|
|
2950
3032
|
return windowsPathsNoEscape ? s.replace(/\[([^/\\{}])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^/\\{}])\]/g, "$1$2").replace(/\\([^/{}])/g, "$1");
|
|
2951
3033
|
};
|
|
2952
|
-
// ../../node_modules/.pnpm/minimatch@11.0.
|
|
3034
|
+
// ../../node_modules/.pnpm/minimatch@11.0.5/node_modules/minimatch/dist/esm/index.js
|
|
2953
3035
|
const minimatch = (p, pattern, options = {}) => {
|
|
2954
3036
|
assertValidPattern(pattern);
|
|
2955
3037
|
if (!options.nocomment && pattern.charAt(0) === "#") return false;
|
|
@@ -3010,6 +3092,8 @@ const braceExpand = (pattern, options = {}) => {
|
|
|
3010
3092
|
return expand(pattern, { max: options.braceExpandMax });
|
|
3011
3093
|
};
|
|
3012
3094
|
minimatch.braceExpand = braceExpand;
|
|
3095
|
+
const RANGE_MIN = 100;
|
|
3096
|
+
const rangeRe = /(?<![\\$])\{(-?\d+)\.\.(-?\d+)\}/g;
|
|
3013
3097
|
const match = (list, pattern, options = {}) => {
|
|
3014
3098
|
const mm = new Minimatch(pattern, options);
|
|
3015
3099
|
list = list.filter((f) => mm.match(f));
|
|
@@ -3137,6 +3221,7 @@ var Minimatch = class {
|
|
|
3137
3221
|
#endRows = [];
|
|
3138
3222
|
#matchers = /* @__PURE__ */ new Map();
|
|
3139
3223
|
#pending = false;
|
|
3224
|
+
#rangeMark;
|
|
3140
3225
|
#globstarParts = /* @__PURE__ */ new WeakMap();
|
|
3141
3226
|
constructor(pattern, options = {}) {
|
|
3142
3227
|
assertValidPattern(pattern);
|
|
@@ -3211,7 +3296,7 @@ var Minimatch = class {
|
|
|
3211
3296
|
return;
|
|
3212
3297
|
}
|
|
3213
3298
|
this.parseNegate();
|
|
3214
|
-
this.globSet = [...new Set(this
|
|
3299
|
+
this.globSet = [...new Set(this.#expandBraces())];
|
|
3215
3300
|
const rawGlobParts = this.globSet.map((s) => this.#slashSplit(s));
|
|
3216
3301
|
this.globParts = this.preprocess(rawGlobParts);
|
|
3217
3302
|
this.#pending = true;
|
|
@@ -3460,6 +3545,8 @@ var Minimatch = class {
|
|
|
3460
3545
|
}
|
|
3461
3546
|
firstPhasePreProcess(globParts) {
|
|
3462
3547
|
const { braceExpandMax = 1e5 } = this.options;
|
|
3548
|
+
let splitCells = 0;
|
|
3549
|
+
const maxSplitCells = 1e6;
|
|
3463
3550
|
let didSomething = false;
|
|
3464
3551
|
do {
|
|
3465
3552
|
didSomething = false;
|
|
@@ -3473,11 +3560,14 @@ var Minimatch = class {
|
|
|
3473
3560
|
const p = parts[gs + 2];
|
|
3474
3561
|
const p2 = parts[gs + 3];
|
|
3475
3562
|
if (next !== "..") continue;
|
|
3476
|
-
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === ".."
|
|
3563
|
+
if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") continue;
|
|
3564
|
+
const addedCells = parts.length - 1;
|
|
3565
|
+
if (globParts.length >= braceExpandMax || splitCells + addedCells > maxSplitCells) throw new RangeError(`optimizationLevel 2: too many patterns from '**/..'`);
|
|
3477
3566
|
didSomething = true;
|
|
3478
3567
|
parts.splice(gs, 1);
|
|
3479
3568
|
const other = parts.slice(0);
|
|
3480
3569
|
other[gs] = "**";
|
|
3570
|
+
splitCells += addedCells;
|
|
3481
3571
|
globParts.push(other);
|
|
3482
3572
|
gs--;
|
|
3483
3573
|
}
|
|
@@ -3513,46 +3603,41 @@ var Minimatch = class {
|
|
|
3513
3603
|
return globParts;
|
|
3514
3604
|
}
|
|
3515
3605
|
secondPhasePreProcess(globParts) {
|
|
3516
|
-
|
|
3517
|
-
|
|
3518
|
-
const
|
|
3519
|
-
if (
|
|
3520
|
-
|
|
3521
|
-
|
|
3522
|
-
|
|
3606
|
+
const keys = /* @__PURE__ */ new Set();
|
|
3607
|
+
const rows = globParts.filter((parts) => {
|
|
3608
|
+
const key = parts.join("/");
|
|
3609
|
+
if (keys.has(key)) return false;
|
|
3610
|
+
keys.add(key);
|
|
3611
|
+
return true;
|
|
3612
|
+
});
|
|
3613
|
+
const stars = /* @__PURE__ */ new Map();
|
|
3614
|
+
for (const parts of rows) {
|
|
3615
|
+
const s = [];
|
|
3616
|
+
for (let i = 0; i < parts.length; i++) if (parts[i] === "*") s.push(i);
|
|
3617
|
+
if (s.length) stars.set(s.join(","), s);
|
|
3618
|
+
}
|
|
3619
|
+
if (!stars.size || rows.length * stars.size > 1e5) return rows;
|
|
3620
|
+
const { dot } = this.options;
|
|
3621
|
+
return rows.filter((parts) => {
|
|
3622
|
+
for (const s of stars.values()) {
|
|
3623
|
+
if (s[s.length - 1] >= parts.length) continue;
|
|
3624
|
+
const c = [...parts];
|
|
3625
|
+
let ok = true;
|
|
3626
|
+
let changed = false;
|
|
3627
|
+
for (const i of s) {
|
|
3628
|
+
const p = parts[i];
|
|
3629
|
+
if (p === "*") continue;
|
|
3630
|
+
if (!p || p === "**" || !dot && p.startsWith(".")) {
|
|
3631
|
+
ok = false;
|
|
3632
|
+
break;
|
|
3633
|
+
}
|
|
3634
|
+
c[i] = "*";
|
|
3635
|
+
changed = true;
|
|
3636
|
+
}
|
|
3637
|
+
if (ok && changed && keys.has(c.join("/"))) return false;
|
|
3523
3638
|
}
|
|
3524
|
-
|
|
3525
|
-
|
|
3526
|
-
}
|
|
3527
|
-
partsMatch(a, b, emptyGSMatch = false) {
|
|
3528
|
-
let ai = 0;
|
|
3529
|
-
let bi = 0;
|
|
3530
|
-
let result = [];
|
|
3531
|
-
let which = "";
|
|
3532
|
-
while (ai < a.length && bi < b.length) if (a[ai] === b[bi]) {
|
|
3533
|
-
result.push(which === "b" ? b[bi] : a[ai]);
|
|
3534
|
-
ai++;
|
|
3535
|
-
bi++;
|
|
3536
|
-
} else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
|
|
3537
|
-
result.push(a[ai]);
|
|
3538
|
-
ai++;
|
|
3539
|
-
} else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
|
|
3540
|
-
result.push(b[bi]);
|
|
3541
|
-
bi++;
|
|
3542
|
-
} else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
|
|
3543
|
-
if (which === "b") return false;
|
|
3544
|
-
which = "a";
|
|
3545
|
-
result.push(a[ai]);
|
|
3546
|
-
ai++;
|
|
3547
|
-
bi++;
|
|
3548
|
-
} else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
|
|
3549
|
-
if (which === "a") return false;
|
|
3550
|
-
which = "b";
|
|
3551
|
-
result.push(b[bi]);
|
|
3552
|
-
ai++;
|
|
3553
|
-
bi++;
|
|
3554
|
-
} else return false;
|
|
3555
|
-
return a.length === b.length && result;
|
|
3639
|
+
return true;
|
|
3640
|
+
});
|
|
3556
3641
|
}
|
|
3557
3642
|
parseNegate() {
|
|
3558
3643
|
if (this.nonegate) return;
|
|
@@ -3719,13 +3804,37 @@ var Minimatch = class {
|
|
|
3719
3804
|
braceExpand() {
|
|
3720
3805
|
return braceExpand(this.pattern, this.options);
|
|
3721
3806
|
}
|
|
3807
|
+
#expandBraces() {
|
|
3808
|
+
const { pattern } = this;
|
|
3809
|
+
if (this.options.nobrace) return this.braceExpand();
|
|
3810
|
+
let code = 57344;
|
|
3811
|
+
while (pattern.includes(String.fromCharCode(code))) if (++code > 63743) return this.braceExpand();
|
|
3812
|
+
const mark = String.fromCharCode(code);
|
|
3813
|
+
let found = false;
|
|
3814
|
+
const marked = pattern.replace(rangeRe, (m, lo, hi) => {
|
|
3815
|
+
const a = Number(lo);
|
|
3816
|
+
const b = Number(hi);
|
|
3817
|
+
if (!Number.isSafeInteger(a) || !Number.isSafeInteger(b) || Math.abs(a - b) + 1 < RANGE_MIN) return m;
|
|
3818
|
+
found = true;
|
|
3819
|
+
return `${mark}${lo}..${hi}${mark}`;
|
|
3820
|
+
});
|
|
3821
|
+
if (!found) return this.braceExpand();
|
|
3822
|
+
const set = braceExpand(marked, this.options);
|
|
3823
|
+
for (const p of set) for (const portion of p.split("/")) {
|
|
3824
|
+
const c = portion.indexOf("[");
|
|
3825
|
+
if (c !== -1 && c < portion.lastIndexOf(mark)) return this.braceExpand();
|
|
3826
|
+
}
|
|
3827
|
+
this.#rangeMark = mark;
|
|
3828
|
+
return set;
|
|
3829
|
+
}
|
|
3722
3830
|
parse(pattern) {
|
|
3723
3831
|
assertValidPattern(pattern);
|
|
3724
3832
|
const options = this.options;
|
|
3725
3833
|
if (pattern === "**") return GLOBSTAR;
|
|
3726
3834
|
if (pattern === "") return "";
|
|
3727
3835
|
const { nocase, nocaseMagicOnly, noext = false, dot, normalize } = options;
|
|
3728
|
-
const
|
|
3836
|
+
const rangeMark = this.#rangeMark;
|
|
3837
|
+
const lit = rangeMark && pattern.includes(rangeMark) ? void 0 : literal(pattern, noext);
|
|
3729
3838
|
if (lit !== void 0 && !(nocase && !nocaseMagicOnly && pattern.toUpperCase() !== pattern.toLowerCase())) return this.#norm(lit);
|
|
3730
3839
|
if (this.#pending) return PENDING;
|
|
3731
3840
|
let m = this.#matchers.get(pattern);
|
|
@@ -3734,7 +3843,8 @@ var Minimatch = class {
|
|
|
3734
3843
|
nocase,
|
|
3735
3844
|
noext,
|
|
3736
3845
|
dot,
|
|
3737
|
-
normalize
|
|
3846
|
+
normalize,
|
|
3847
|
+
...rangeMark && { rangeMark }
|
|
3738
3848
|
});
|
|
3739
3849
|
this.#matchers.set(pattern, m);
|
|
3740
3850
|
}
|
|
@@ -4680,6 +4790,10 @@ function versionAtLeast(version, minVersion, tags) {
|
|
|
4680
4790
|
if (coerced) return isGreaterThanOrEqual(coerced, minVersion);
|
|
4681
4791
|
return tags.includes(version);
|
|
4682
4792
|
}
|
|
4793
|
+
function pnpmRequiresWorkspacePackages(version) {
|
|
4794
|
+
const coerced = coerce(version);
|
|
4795
|
+
return coerced ? isLessThan(coerced, "10.5.0") : false;
|
|
4796
|
+
}
|
|
4683
4797
|
const PNPM_WORKSPACE_SETTINGS_MIN_VERSION = "10.6.2";
|
|
4684
4798
|
function pnpmSupportsWorkspaceSettings(version) {
|
|
4685
4799
|
return versionAtLeast(version, PNPM_WORKSPACE_SETTINGS_MIN_VERSION, ["latest", "next"]);
|
|
@@ -4696,6 +4810,12 @@ function yarnSupportsCatalog(version) {
|
|
|
4696
4810
|
"stable"
|
|
4697
4811
|
]);
|
|
4698
4812
|
}
|
|
4813
|
+
const BUN_TOP_LEVEL_CATALOG_MIN_VERSION = "1.2.21";
|
|
4814
|
+
function bunSupportsCatalog(pkg, version) {
|
|
4815
|
+
const { workspaces } = pkg;
|
|
4816
|
+
if (workspaces == null) return false;
|
|
4817
|
+
return !Array.isArray(workspaces) && (workspaces.catalog != null || pkg.catalog == null && workspaces.catalogs != null) || versionAtLeast(version, BUN_TOP_LEVEL_CATALOG_MIN_VERSION, ["latest", "canary"]);
|
|
4818
|
+
}
|
|
4699
4819
|
function supportsCatalog(packageManager, version, isBunWorkspace = false) {
|
|
4700
4820
|
switch (packageManager) {
|
|
4701
4821
|
case PackageManager.pnpm: return pnpmSupportsCatalog(version);
|
|
@@ -5073,7 +5193,7 @@ function rewriteYamlCatalogAtPath(doc, catalogPath, addMissing, usesVitest, vite
|
|
|
5073
5193
|
}
|
|
5074
5194
|
if (!VITE_PLUS_VERSION.startsWith("file:") && (addMissing || catalog.has("vite-plus"))) catalog.set(scalarString(VITE_PLUS_NAME), scalarString(VITE_PLUS_VERSION));
|
|
5075
5195
|
if (addMissing && VITEST_IS_MANAGED_OVERRIDE) {
|
|
5076
|
-
const additions =
|
|
5196
|
+
const additions = /* @__PURE__ */ new Set([...catalogAdditions, ...vitestEcosystemPackages]);
|
|
5077
5197
|
for (const name of additions) if (isAlignableVitestEcosystemPackage(name)) catalog.set(scalarString(name), scalarString(VITEST_VERSION));
|
|
5078
5198
|
}
|
|
5079
5199
|
for (const name of REMOVE_PACKAGES) catalog.delete(name);
|
|
@@ -5097,11 +5217,12 @@ function rewriteCatalogObject(catalog, addMissing, usesVitest, vitestEcosystemPa
|
|
|
5097
5217
|
if (!VITE_PLUS_VERSION.startsWith("file:") && (addMissing || "vite-plus" in catalog)) catalog[VITE_PLUS_NAME] = VITE_PLUS_VERSION;
|
|
5098
5218
|
for (const name of REMOVE_PACKAGES) delete catalog[name];
|
|
5099
5219
|
if (VITEST_IS_MANAGED_OVERRIDE) {
|
|
5100
|
-
|
|
5220
|
+
const names = addMissing ? /* @__PURE__ */ new Set([...Object.keys(catalog), ...vitestEcosystemPackages]) : Object.keys(catalog);
|
|
5221
|
+
for (const name of names) if (vitestEcosystemPackages.has(name) && isAlignableVitestEcosystemPackage(name)) catalog[name] = VITEST_VERSION;
|
|
5101
5222
|
}
|
|
5102
5223
|
}
|
|
5103
|
-
function rewriteCatalogsObject(catalogs, usesVitest, vitestEcosystemPackages) {
|
|
5104
|
-
for (const catalog of Object.values(catalogs)) rewriteCatalogObject(catalog,
|
|
5224
|
+
function rewriteCatalogsObject(catalogs, usesVitest, vitestEcosystemPackages, targetCatalog) {
|
|
5225
|
+
for (const catalog of Object.values(catalogs)) rewriteCatalogObject(catalog, catalog === targetCatalog, usesVitest, vitestEcosystemPackages);
|
|
5105
5226
|
}
|
|
5106
5227
|
/**
|
|
5107
5228
|
* Write catalog entries to root package.json for bun.
|
|
@@ -5116,10 +5237,14 @@ function rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages, use
|
|
|
5116
5237
|
editJsonFile(packageJsonPath, (pkg) => {
|
|
5117
5238
|
const workspacesObj = pkg.workspaces && !Array.isArray(pkg.workspaces) ? pkg.workspaces : void 0;
|
|
5118
5239
|
const useWorkspacesCatalog = workspacesObj?.catalog != null || pkg.catalog == null && workspacesObj?.catalogs != null;
|
|
5119
|
-
const
|
|
5120
|
-
|
|
5240
|
+
const { preferredCatalogSpec } = readBunCatalogDependencyResolver(pkg);
|
|
5241
|
+
const preferredName = preferredCatalogSpec.slice(8);
|
|
5242
|
+
const namedTarget = preferredName ? workspacesObj?.catalogs?.[preferredName] ?? pkg.catalogs?.[preferredName] : void 0;
|
|
5243
|
+
const defaultCatalog = useWorkspacesCatalog ? workspacesObj?.catalog : pkg.catalog;
|
|
5244
|
+
const catalog = { ...defaultCatalog };
|
|
5245
|
+
rewriteCatalogObject(catalog, !namedTarget, usesVitest, vitestEcosystemPackages);
|
|
5121
5246
|
pruneLegacyWrapperAliases(catalog);
|
|
5122
|
-
if (useWorkspacesCatalog) {
|
|
5247
|
+
if (namedTarget && !defaultCatalog) {} else if (useWorkspacesCatalog) {
|
|
5123
5248
|
workspacesObj.catalog = catalog;
|
|
5124
5249
|
if (pkg.catalog) {
|
|
5125
5250
|
rewriteCatalogObject(pkg.catalog, false, usesVitest, vitestEcosystemPackages);
|
|
@@ -5133,11 +5258,11 @@ function rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages, use
|
|
|
5133
5258
|
}
|
|
5134
5259
|
}
|
|
5135
5260
|
if (workspacesObj?.catalogs) {
|
|
5136
|
-
rewriteCatalogsObject(workspacesObj.catalogs, usesVitest, vitestEcosystemPackages);
|
|
5261
|
+
rewriteCatalogsObject(workspacesObj.catalogs, usesVitest, vitestEcosystemPackages, namedTarget);
|
|
5137
5262
|
for (const named of Object.values(workspacesObj.catalogs)) pruneLegacyWrapperAliases(named);
|
|
5138
5263
|
}
|
|
5139
5264
|
if (pkg.catalogs) {
|
|
5140
|
-
rewriteCatalogsObject(pkg.catalogs, usesVitest, vitestEcosystemPackages);
|
|
5265
|
+
rewriteCatalogsObject(pkg.catalogs, usesVitest, vitestEcosystemPackages, namedTarget);
|
|
5141
5266
|
for (const named of Object.values(pkg.catalogs)) pruneLegacyWrapperAliases(named);
|
|
5142
5267
|
}
|
|
5143
5268
|
const overrides = { ...pkg.overrides };
|
|
@@ -5146,7 +5271,7 @@ function rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages, use
|
|
|
5146
5271
|
for (const [key, value] of Object.entries(managed)) {
|
|
5147
5272
|
const current = overrides[key];
|
|
5148
5273
|
if (current !== void 0 && typeof current !== "string") continue;
|
|
5149
|
-
overrides[key] = key === "@vitest/browser" ? value : getCatalogDependencySpec(current, value, true);
|
|
5274
|
+
overrides[key] = key === "@vitest/browser" ? value : getCatalogDependencySpec(current, value, true, { preferredCatalogSpec });
|
|
5150
5275
|
}
|
|
5151
5276
|
pkg.overrides = overrides;
|
|
5152
5277
|
return pkg;
|
|
@@ -5180,11 +5305,15 @@ function rewriteRootWorkspacePackageJson(projectPath, packageManager, skipStaged
|
|
|
5180
5305
|
...managed
|
|
5181
5306
|
};
|
|
5182
5307
|
else if (packageManager === PackageManager.bun) {
|
|
5183
|
-
if (
|
|
5308
|
+
if (!supportCatalog) pkg.overrides = {
|
|
5309
|
+
...pkg.overrides,
|
|
5310
|
+
...managed
|
|
5311
|
+
};
|
|
5312
|
+
else if (managed["@vitest/browser"]) pkg.overrides = {
|
|
5184
5313
|
...pkg.overrides,
|
|
5185
5314
|
"@vitest/browser": managed["@vitest/browser"]
|
|
5186
5315
|
};
|
|
5187
|
-
setDirectViteEdge(pkg,
|
|
5316
|
+
setDirectViteEdge(pkg, supportCatalog, catalogDependencyResolver);
|
|
5188
5317
|
} else if (packageManager === PackageManager.pnpm) {
|
|
5189
5318
|
const overrideKeys = Object.keys(managedOverridePackages(workspaceUsesVitest));
|
|
5190
5319
|
if (!pnpmSupportsWorkspaceSettings(pnpmVersion ?? "")) {
|
|
@@ -5653,11 +5782,6 @@ function dropDeadOxlintPluginsDependency(rootDir, packages, originalDependencies
|
|
|
5653
5782
|
return changed;
|
|
5654
5783
|
}
|
|
5655
5784
|
// src/migration/migrator/vite-plus-bootstrap.ts
|
|
5656
|
-
function bunWorkspaceDeclaresPackages(workspaces) {
|
|
5657
|
-
if (Array.isArray(workspaces)) return workspaces.length > 0;
|
|
5658
|
-
if (workspaces && typeof workspaces === "object") return Array.isArray(workspaces.packages) && workspaces.packages.length > 0;
|
|
5659
|
-
return false;
|
|
5660
|
-
}
|
|
5661
5785
|
function isSemanticVitePlusOverrideSpec(dependencyName, spec) {
|
|
5662
5786
|
if (!spec) return false;
|
|
5663
5787
|
if (isLegacyWrapperSpec(spec)) return false;
|
|
@@ -5873,7 +5997,7 @@ function detectVitePlusBootstrapPending(projectPath, packageManager, packages, p
|
|
|
5873
5997
|
const resolvedPackageManagerVersion = (packageManagerVersion ?? pinnedPackageManagerVersion(pkg)) || "latest";
|
|
5874
5998
|
const usePnpmWorkspaceYaml = packageManager === PackageManager.pnpm && pnpmSupportsWorkspaceSettings(resolvedPackageManagerVersion);
|
|
5875
5999
|
if (usePnpmWorkspaceYaml && pnpmPackageJsonSettingsPending(pkg)) return true;
|
|
5876
|
-
const supportCatalog = !VITE_PLUS_VERSION.startsWith("file:") && supportsCatalog(packageManager, resolvedPackageManagerVersion, packageManager === PackageManager.bun &&
|
|
6000
|
+
const supportCatalog = !VITE_PLUS_VERSION.startsWith("file:") && supportsCatalog(packageManager, resolvedPackageManagerVersion, packageManager === PackageManager.bun && bunSupportsCatalog(pkg, resolvedPackageManagerVersion));
|
|
5877
6001
|
const catalogDependencyResolver = createCatalogDependencyResolver(projectPath, packageManager);
|
|
5878
6002
|
const canonicalVitePlusSpec = supportCatalog ? catalogDependencyResolver?.preferredCatalogSpec ?? "catalog:" : VITE_PLUS_VERSION;
|
|
5879
6003
|
if (workspaceVitestEcosystemCatalogReferencesPending(projectPath, packages, catalogDependencyResolver)) return true;
|
|
@@ -5888,7 +6012,10 @@ function detectVitePlusBootstrapPending(projectPath, packageManager, packages, p
|
|
|
5888
6012
|
const usesWebdriverio = workspaceUsesWebdriverioProvider(projectPath, packages);
|
|
5889
6013
|
if (packageManager === PackageManager.yarn) return !overridesSatisfyVitePlus(pkg.resolutions, usesVitest, void 0, "bare", usesWebdriverio) || !yarnrcSatisfiesVitePlus(projectPath, usesVitest, supportCatalog) || yarnWorkspaceHoistingOptOutPending(projectPath, packageManager, packages);
|
|
5890
6014
|
if (packageManager === PackageManager.npm) return vitePlusDependencyNeedsConcreteVersion(pkg) || !overridesSatisfyVitePlus(pkg.overrides, usesVitest, void 0, "bare", usesWebdriverio) || npmVitePlusManagedDependenciesPending(pkg, usesVitest);
|
|
5891
|
-
if (packageManager === PackageManager.bun)
|
|
6015
|
+
if (packageManager === PackageManager.bun) {
|
|
6016
|
+
const bunCatalogResolver = supportCatalog ? readBunCatalogDependencyResolver(pkg) : void 0;
|
|
6017
|
+
return supportCatalog && workspaceCatalogVitePlusDependencyPending(projectPath, packages, bunCatalogResolver) || !overridesSatisfyVitePlus(pkg.overrides, usesVitest, bunCatalogResolver, "bare", usesWebdriverio);
|
|
6018
|
+
}
|
|
5892
6019
|
if (packageManager === PackageManager.pnpm) {
|
|
5893
6020
|
if (!pnpmWorkspaceExoticSubdepsSettingSatisfied(projectPath)) return true;
|
|
5894
6021
|
if (!usePnpmWorkspaceYaml) {
|
|
@@ -5994,7 +6121,7 @@ function ensureVitePlusBootstrap(workspaceInfo, report) {
|
|
|
5994
6121
|
const pnpmMajorVersion = pnpmMajor(workspaceInfo.downloadPackageManager.version);
|
|
5995
6122
|
const shouldAllowBrowserBuilds = workspaceUsesWebdriverio(projectPath, workspaceInfo.packages);
|
|
5996
6123
|
const usePnpmWorkspaceYaml = workspaceInfo.packageManager === PackageManager.pnpm && pnpmSupportsWorkspaceSettings(workspaceInfo.downloadPackageManager.version);
|
|
5997
|
-
const isBunWorkspace = workspaceInfo.packageManager === PackageManager.bun &&
|
|
6124
|
+
const isBunWorkspace = workspaceInfo.packageManager === PackageManager.bun && bunSupportsCatalog(readJsonFile(packageJsonPath), workspaceInfo.downloadPackageManager.version);
|
|
5998
6125
|
const supportCatalog = !VITE_PLUS_VERSION.startsWith("file:") && supportsCatalog(workspaceInfo.packageManager, workspaceInfo.downloadPackageManager.version, isBunWorkspace);
|
|
5999
6126
|
const catalogDependencyResolver = createCatalogDependencyResolver(projectPath, workspaceInfo.packageManager);
|
|
6000
6127
|
const canonicalVitePlusSpec = supportCatalog ? catalogDependencyResolver?.preferredCatalogSpec ?? "catalog:" : VITE_PLUS_VERSION;
|
|
@@ -6303,7 +6430,7 @@ function rewritePackageJson(pkg, packageManager, isMonorepo, skipStagedMigration
|
|
|
6303
6430
|
const canonicalVitePlusSpec = supportCatalog && !VITE_PLUS_VERSION.startsWith("file:") ? catalogDependencyResolver?.preferredCatalogSpec ?? "catalog:" : VITE_PLUS_VERSION;
|
|
6304
6431
|
const existingVitePlusGroup = pkg.devDependencies?.["vite-plus"] !== void 0 ? pkg.devDependencies : pkg.dependencies?.["vite-plus"] !== void 0 ? pkg.dependencies : void 0;
|
|
6305
6432
|
const existingVitePlus = existingVitePlusGroup?.[VITE_PLUS_NAME];
|
|
6306
|
-
const shouldNormalizeExistingVitePlus = !!existingVitePlus &&
|
|
6433
|
+
const shouldNormalizeExistingVitePlus = !!existingVitePlus && existingVitePlus !== canonicalVitePlusSpec && !isProtocolPinnedSpec(existingVitePlus);
|
|
6307
6434
|
if (!existingVitePlus && (isVitestAdjacent || effectiveBrowserMode)) needVitePlus = true;
|
|
6308
6435
|
const needDirectVitest = needVitePlus || effectiveBrowserMode || isVitestAdjacent || retainedVitestModule || requiredVitestPeer || hasNuxtTestUtils;
|
|
6309
6436
|
if (existingVitePlusGroup) {
|
|
@@ -7582,7 +7709,10 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
|
|
|
7582
7709
|
migratePnpmSettingsToWorkspaceYaml(projectPath, movedPnpmSettings);
|
|
7583
7710
|
if (packageManager === PackageManager.pnpm && (usePnpmWorkspaceYaml || supportCatalog)) rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserProviderBuilds, usesVitest, vitestEcosystemPackages, usePnpmWorkspaceYaml, providerCatalogAdditions, usesWebdriverio);
|
|
7584
7711
|
if (shouldAddPnpmWorkspaceVitePlusOverride) migratePnpmOverridesToWorkspaceYaml(projectPath, { [VITE_PLUS_NAME]: VITE_PLUS_VERSION });
|
|
7585
|
-
if (packageManager === PackageManager.pnpm)
|
|
7712
|
+
if (packageManager === PackageManager.pnpm) {
|
|
7713
|
+
ensurePnpmWorkspaceExoticSubdepsSetting(projectPath);
|
|
7714
|
+
if (pnpmRequiresWorkspacePackages(workspaceInfo.downloadPackageManager.version) && fs.existsSync(path.join(projectPath, "pnpm-workspace.yaml"))) ensurePnpmWorkspacePackages(projectPath, ["."]);
|
|
7715
|
+
}
|
|
7586
7716
|
if (packageManager === PackageManager.yarn) rewriteYarnrcYml(projectPath, usesVitest, vitestEcosystemPackages, providerCatalogAdditions, supportCatalog);
|
|
7587
7717
|
if (extractedStagedConfig) {
|
|
7588
7718
|
if (mergeStagedConfigToViteConfig(projectPath, extractedStagedConfig, silent, report)) removeLintStagedFromPackageJson(packageJsonPath);
|
|
@@ -7614,14 +7744,14 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
|
|
|
7614
7744
|
const workspaceUsesVitest = workspaceUsesVitestDirectly(workspaceInfo.rootDir, workspaceInfo.packages, true);
|
|
7615
7745
|
const vitestEcosystemPackages = collectVitestEcosystemInstallDependencyNames(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
7616
7746
|
const providerCatalogAdditions = collectInjectedProviderNames(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
7617
|
-
const supportCatalog = supportsCatalog(workspaceInfo.packageManager, workspaceInfo.downloadPackageManager.version,
|
|
7747
|
+
const supportCatalog = supportsCatalog(workspaceInfo.packageManager, workspaceInfo.downloadPackageManager.version, workspaceInfo.packageManager === PackageManager.bun && bunSupportsCatalog(readJsonFile(path.join(workspaceInfo.rootDir, "package.json")), workspaceInfo.downloadPackageManager.version));
|
|
7618
7748
|
const workspaceContext = {
|
|
7619
7749
|
rootDir: workspaceInfo.rootDir,
|
|
7620
7750
|
packages: workspaceInfo.packages,
|
|
7621
7751
|
oxlintConfigs: prepareOxlintConfigs([workspaceInfo.rootDir, ...workspaceInfo.packages.map((pkg) => path.join(workspaceInfo.rootDir, pkg.path))])
|
|
7622
7752
|
};
|
|
7623
7753
|
if (workspaceInfo.packageManager === PackageManager.yarn) rewriteYarnrcYml(workspaceInfo.rootDir, workspaceUsesVitest, vitestEcosystemPackages, providerCatalogAdditions, supportCatalog);
|
|
7624
|
-
else if (workspaceInfo.packageManager === PackageManager.bun) rewriteBunCatalog(workspaceInfo.rootDir, workspaceUsesVitest, vitestEcosystemPackages, usesWebdriverio);
|
|
7754
|
+
else if (workspaceInfo.packageManager === PackageManager.bun && supportCatalog) rewriteBunCatalog(workspaceInfo.rootDir, workspaceUsesVitest, vitestEcosystemPackages, usesWebdriverio);
|
|
7625
7755
|
rewriteRootWorkspacePackageJson(workspaceInfo.rootDir, workspaceInfo.packageManager, skipStagedMigration, catalogDependencyResolver, workspaceInfo.packages, pnpmMajorVersion, workspaceInfo.downloadPackageManager.version, workspaceShouldAllowBrowserBuilds, workspaceUsesVitest, supportCatalog, workspaceContext.oxlintConfigs);
|
|
7626
7756
|
if (workspaceInfo.packageManager === PackageManager.pnpm) {
|
|
7627
7757
|
rewritePnpmWorkspaceYaml(workspaceInfo.rootDir, pnpmMajorVersion, workspaceShouldAllowBrowserBuilds, workspaceUsesVitest, vitestEcosystemPackages, usePnpmWorkspaceSettings, providerCatalogAdditions, usesWebdriverio);
|
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_define_config = require("./define-config-
|
|
1
|
+
const require_define_config = require("./define-config-jt2Hyhp2.cjs");
|
|
2
2
|
// src/index.cts
|
|
3
3
|
const vite = require("vite");
|
|
4
4
|
const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, l as resolveConfigFromFile, o as defineProject } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, l as resolveConfigFromFile, o as defineProject } from "./define-config-CeYkQCqG.js";
|
|
2
2
|
import { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "vite";
|
|
4
4
|
export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins, resolveConfigFromFile };
|
package/dist/lint-plugins.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./define-config-
|
|
2
|
+
require("./define-config-jt2Hyhp2.cjs");
|
|
3
3
|
let _oxlint_plugins = require("@oxlint/plugins");
|
|
4
4
|
Object.defineProperty(exports, "definePlugin", {
|
|
5
5
|
enumerable: true,
|
package/dist/migration/bin.js
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import { C as confirm, D as outro, M as isCancel, O as select, S as normalize$1, T as log, c as selectPackageManager, i as promptGitHooks, k as spinner, l as upgradeYarn, n as defaultInteractive, o as runViteFmt, r as downloadPackageManager$1, s as runViteInstall, t as cancelAndExit, x as getMajor, y as PackageManager } from "../prompts-
|
|
2
|
-
import { a as rangeToComparators, i as normalizeRange, n as findMinimumForRange, o as rangesIntersect, r as isRangeSubset, s as satisfies, t as extractOverrideTargetName } from "../package-overrides-
|
|
3
|
-
import { i as selectAgentTargetPaths, l as displayRelative, n as detectAgentConflicts, r as detectExistingAgentTargetPaths, s as writeAgentInstructions } from "../agent-
|
|
1
|
+
import { C as confirm, D as outro, M as isCancel, O as select, S as normalize$1, T as log, c as selectPackageManager, i as promptGitHooks, k as spinner, l as upgradeYarn, n as defaultInteractive, o as runViteFmt, r as downloadPackageManager$1, s as runViteInstall, t as cancelAndExit, x as getMajor, y as PackageManager } from "../prompts-JkuWOV60.js";
|
|
2
|
+
import { a as rangeToComparators, i as normalizeRange, n as findMinimumForRange, o as rangesIntersect, r as isRangeSubset, s as satisfies, t as extractOverrideTargetName } from "../package-overrides-nw4zcITi.js";
|
|
3
|
+
import { i as selectAgentTargetPaths, l as displayRelative, n as detectAgentConflicts, r as detectExistingAgentTargetPaths, s as writeAgentInstructions } from "../agent-CTG3B-ec.js";
|
|
4
4
|
import { t as unwrapCliParseOutcome } from "../cli-parse-aeUeFDlC.js";
|
|
5
|
-
import {
|
|
6
|
-
import { A as detectVitePlusBootstrapPending, C as removeMigratedOxlintConfigs, Ct as readPackageJsonIfExists, D as mergeViteConfigFiles, E as mergeTsdownConfigFile, F as detectYarnPnpMode, I as createCatalogDependencyResolver, J as detectFramework, K as extractOverrideParentSegments, M as sourceTreeMatches, N as usesWebdriverioProvider, O as retryPreservedOxlintConfigs, P as configureYarnNodeModulesMode, Q as migrateTsupToTsdown, R as detectWorkspace$1, S as prepareOxlintConfigs, St as isPlainRecord, T as injectLintTypeCheckDefaults, U as minimatch, W as findGitRoot, X as confirmTsupMigration, Y as hasFrameworkShim, Z as detectTsupProject, _ as hasExistingViteHooksPolicy, _t as SHELL_STATE_COMMANDS, at as warnPackageLevelPrettier, b as preflightGitHooksSetup, bt as checkVitestVersion, ct as detectIncompatibleEslintIntegration, d as finalizeCoreMigrationForExistingVitePlus, dt as warnIncompatibleEslintIntegration, et as warnMissingTsupConfig, f as detectNodeVersionManagerFile, ft as warnLegacyEslintConfig, g as detectLegacyGitHooksMigrationCandidate, gt as RETENTION_SCAN_SKIP_DIRS, ht as LINT_STAGED_JSON_CONFIG_FILES, i as selectEditor, j as ensureVitePlusBootstrap, k as collectToolchainVersionChanges, l as rewriteStandaloneProject, lt as migrateEslintToOxlint, m as migrateSetupVpVersion, mt as detectMigrationWarnings, nt as detectPrettierProject, o as writeEditorConfigs, ot as confirmEslintMigration, p as migrateNodeVersionManagerFile, pt as warnPackageLevelEslint, q as addFrameworkShim, r as isJsonLikeFile, rt as migratePrettierToOxfmt, s as rewriteMonorepo, st as detectEslintProject, t as detectEditorConflicts, tt as confirmPrettierMigration, u as detectPendingCoreMigration, v as installGitHooks, vt as WEBDRIVERIO_PROVIDER, wt as warnMigration, x as shouldSkipStagedMigrationForHooks, xt as getCommandStartIndex, y as isViteHooksSetupComplete, yt as checkViteVersion } from "../editor-
|
|
7
|
-
import { a as hasVitePlusDependency, i as hasPackageManagerDeclaration, n as detectPackageMetadata, o as readNearestPackageJson } from "../package-
|
|
5
|
+
import { a as SETUP_VP_VERSION, d as VITE_PLUS_OVERRIDE_PACKAGES, f as VITE_PLUS_VERSION, m as isForceOverrideMode } from "../constants-DXqV1vWL.js";
|
|
6
|
+
import { A as detectVitePlusBootstrapPending, C as removeMigratedOxlintConfigs, Ct as readPackageJsonIfExists, D as mergeViteConfigFiles, E as mergeTsdownConfigFile, F as detectYarnPnpMode, I as createCatalogDependencyResolver, J as detectFramework, K as extractOverrideParentSegments, M as sourceTreeMatches, N as usesWebdriverioProvider, O as retryPreservedOxlintConfigs, P as configureYarnNodeModulesMode, Q as migrateTsupToTsdown, R as detectWorkspace$1, S as prepareOxlintConfigs, St as isPlainRecord, T as injectLintTypeCheckDefaults, U as minimatch, W as findGitRoot, X as confirmTsupMigration, Y as hasFrameworkShim, Z as detectTsupProject, _ as hasExistingViteHooksPolicy, _t as SHELL_STATE_COMMANDS, at as warnPackageLevelPrettier, b as preflightGitHooksSetup, bt as checkVitestVersion, ct as detectIncompatibleEslintIntegration, d as finalizeCoreMigrationForExistingVitePlus, dt as warnIncompatibleEslintIntegration, et as warnMissingTsupConfig, f as detectNodeVersionManagerFile, ft as warnLegacyEslintConfig, g as detectLegacyGitHooksMigrationCandidate, gt as RETENTION_SCAN_SKIP_DIRS, ht as LINT_STAGED_JSON_CONFIG_FILES, i as selectEditor, j as ensureVitePlusBootstrap, k as collectToolchainVersionChanges, l as rewriteStandaloneProject, lt as migrateEslintToOxlint, m as migrateSetupVpVersion, mt as detectMigrationWarnings, nt as detectPrettierProject, o as writeEditorConfigs, ot as confirmEslintMigration, p as migrateNodeVersionManagerFile, pt as warnPackageLevelEslint, q as addFrameworkShim, r as isJsonLikeFile, rt as migratePrettierToOxfmt, s as rewriteMonorepo, st as detectEslintProject, t as detectEditorConflicts, tt as confirmPrettierMigration, u as detectPendingCoreMigration, v as installGitHooks, vt as WEBDRIVERIO_PROVIDER, wt as warnMigration, x as shouldSkipStagedMigrationForHooks, xt as getCommandStartIndex, y as isViteHooksSetupComplete, yt as checkViteVersion } from "../editor-C0U0Ymqk.js";
|
|
7
|
+
import { a as hasVitePlusDependency, i as hasPackageManagerDeclaration, n as detectPackageMetadata, o as readNearestPackageJson } from "../package-CK48ZXBV.js";
|
|
8
8
|
import { a as muted, c as warnMsg, i as log$1, o as printHeader, r as formatDuration, t as accent } from "../terminal-BcuPUy-j.js";
|
|
9
|
-
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig, t as confirmBaseUrlFix } from "../tsconfig-
|
|
9
|
+
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig, t as confirmBaseUrlFix } from "../tsconfig-DUR3fhIX.js";
|
|
10
10
|
import { i as runCommandSilently } from "../command-rY79K5NI.js";
|
|
11
11
|
import { n as addMigrationWarning, r as createMigrationReport } from "../report-BEdpIQvC.js";
|
|
12
12
|
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../protocol-CkNmY-Mr.js";
|
|
13
13
|
import { a as writeJsonFile, c as modify, i as readJsonFile, l as parse, n as editJsonFile, o as applyEdits$1, r as isJsonFile, s as findNodeAtLocation, u as parseTree } from "../json-kl84kDyH.js";
|
|
14
|
-
import { _ as isGreaterThanOrEqual, p as compare } from "../comparison-CmVirWIW-
|
|
14
|
+
import { _ as isGreaterThanOrEqual, p as compare } from "../comparison-CmVirWIW-Z8p6CfWL.js";
|
|
15
15
|
import { t as require_dist } from "../dist-Bs0SObNC.js";
|
|
16
|
+
import { t as engines } from "../package-Cc9gI1u1.js";
|
|
16
17
|
import { t as documentationUrl$1 } from "../documentation-cv_y0Auv.js";
|
|
17
18
|
import { t as vitest_v5_entry_points_default } from "../vitest-v5-entry-points-NyJsFeux.js";
|
|
18
19
|
import { i as WATCH_OPTIONS_WITH_VALUE, n as SCRIPT_EXTENSIONS, t as NODE_OPTIONS_WITH_VALUE } from "../vpx-script-EXgV5QOf.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { u as VITE_PLUS_NAME } from "./constants-
|
|
1
|
+
import { u as VITE_PLUS_NAME } from "./constants-DXqV1vWL.js";
|
|
2
2
|
// src/oxlint-plugin-config.ts
|
|
3
3
|
const VITE_PLUS_OXLINT_PLUGIN_NAME = VITE_PLUS_NAME;
|
|
4
4
|
const VITE_PLUS_OXLINT_PLUGIN_SPECIFIER = `${VITE_PLUS_NAME}/oxlint-plugin`;
|
package/dist/oxlint-plugin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as PREFER_VITE_PLUS_IMPORTS_RULE_NAME, r as VITE_PLUS_OXLINT_PLUGIN_NAME } from "./oxlint-plugin-config-
|
|
1
|
+
import { n as exports } from "./package-Cc9gI1u1.js";
|
|
2
|
+
import { n as PREFER_VITE_PLUS_IMPORTS_RULE_NAME, r as VITE_PLUS_OXLINT_PLUGIN_NAME } from "./oxlint-plugin-config-DvBRM_Se.js";
|
|
3
3
|
import { t as vitest_v5_entry_points_default } from "./vitest-v5-entry-points-NyJsFeux.js";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs";
|
package/dist/pack-bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as cac } from "./dist-CdkMvIiQ.js";
|
|
3
|
-
import { a as resolveViteConfig } from "./resolve-vite-config-
|
|
3
|
+
import { a as resolveViteConfig } from "./resolve-vite-config-x5QVnaf4.js";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { buildWithConfigs, enableDebug, globalLogger, resolveUserConfig } from "vite/pack";
|