vite-plus 1.0.0 → 1.1.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 -5
- package/README.md +7 -7
- package/binding/index.cjs +54 -55
- package/binding/index.d.cts +50 -12
- package/dist/{agent-CKMI1a8W.js → agent-eISuMXJb.js} +2 -2
- package/dist/bin.js +9 -6
- package/dist/config/bin.js +3 -3
- package/dist/{constants-BqJiMVVU.js → constants-CCQkpaxK.js} +2 -2
- package/dist/create/bin.js +42 -10
- package/dist/{define-config-C_KGDLUZ.cjs → define-config-CREUiMmM.cjs} +2 -2
- package/dist/{define-config-Cf_5GHmY.d.ts → define-config-CeW9DETl.d.ts} +24 -8
- package/dist/{define-config-DhEJaYRc.js → define-config-Ro6PS4dP.js} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-BWiANxFS.js → dist-DUsqQuw8.js} +117 -1395
- package/dist/{editor-CHfGUhxP.js → editor-B8tkz7nL.js} +94 -52
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +54 -50
- package/dist/{oxlint-plugin-config-lMMD5fAC.js → oxlint-plugin-config-CbG58Kzr.js} +1 -1
- package/dist/oxlint-plugin.js +2 -2
- package/dist/pack-bin.js +3 -2
- package/dist/{package-Cgdlhamw.js → package-BS84eWrW.js} +7 -2
- package/dist/package-overrides-CpoQngt3.js +411 -0
- package/dist/{prompts-jMH8S4Wp.js → prompts-ByOzbMBG.js} +537 -252
- package/dist/{resolve-vite-config-BJYYtfY3.js → resolve-vite-config-Be237LWp.js} +2 -2
- package/dist/{resolve-vite-config-BPgpYMYp.js → resolve-vite-config-CofpYgnY.js} +1 -1
- package/dist/staged/bin.js +791 -742
- package/dist/sync-versions/bin.js +4 -6
- package/dist/sync-versions/bin.mjs +247 -1419
- package/dist/toolchain.js +9 -9
- package/dist/toolchain.json +9 -9
- package/dist/{tsconfig-CmKidmRD.js → tsconfig-3ONY2k2K.js} +1 -1
- package/dist/{tsconfig-BoYTBNX_.js → tsconfig-DzZ-nrx2.js} +2 -2
- package/dist/version.js +2 -2
- package/dist/versions.js +5 -5
- package/docs/guide/ci.md +3 -4
- package/docs/guide/env.md +10 -5
- package/docs/guide/github-actions-cache.md +1 -3
- package/docs/guide/ide-integration.md +3 -1
- package/docs/guide/implode.md +2 -0
- package/docs/guide/install.md +3 -0
- package/docs/guide/local-cli.md +7 -7
- package/docs/guide/migrate-rules.md +8 -0
- package/docs/guide/migrate.md +7 -7
- package/docs/guide/test.md +1 -1
- package/docs/guide/troubleshooting.md +2 -2
- package/docs/guide/upgrade-project.md +1 -1
- package/docs/guide/vitest-v5.md +2 -2
- package/docs/guide/vpx.md +2 -2
- package/package.json +31 -28
- package/dist/package-overrides-Dpn4scvN.js +0 -17
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { r as __toESM } from "./rolldown-runtime-CMFfr-1z.js";
|
|
2
2
|
import { t as documentationUrl$1 } from "./documentation-DqcZSthV.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 { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } 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-CCQkpaxK.js";
|
|
4
|
+
import { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-CbG58Kzr.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-JP24qHUF.js";
|
|
6
|
-
import {
|
|
6
|
+
import { c as getNpmRegistry, n as detectPackageMetadata, r as getScopeFromPackageName, s as fetchNpmResource } from "./package-BS84eWrW.js";
|
|
7
7
|
import { n as isAlignableVitestEcosystemPackage } from "./vitest-ecosystem-BU0AqZq-.js";
|
|
8
|
-
import { C as multiselect, S as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
8
|
+
import { C as confirm, E as multiselect, M as isCancel, O as select, S as normalize$2, T as log, _ 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-ByOzbMBG.js";
|
|
9
|
+
import { g as compareReversed, t as require_dist, v as isGreaterThanOrEqual, y as isLessThanOrEqual } from "./dist-DUsqQuw8.js";
|
|
10
|
+
import { i as normalizeRange, s as satisfies, t as extractOverrideTargetName } from "./package-overrides-CpoQngt3.js";
|
|
11
|
+
import { l as displayRelative, u as rulesDir } from "./agent-eISuMXJb.js";
|
|
11
12
|
import { n as addMigrationWarning, t as addManualStep } from "./report-NhQk8VHb.js";
|
|
12
13
|
import { n as runCommandSilently, r as require_cross_spawn } from "./command-CguLh2KL.js";
|
|
13
|
-
import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-
|
|
14
|
-
import { t as extractOverrideTargetName } from "./package-overrides-Dpn4scvN.js";
|
|
14
|
+
import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-DzZ-nrx2.js";
|
|
15
15
|
import { i as findUnsafeHookInstallPath, t as SUPPORTED_GIT_HOOK_NAMES } from "./hooks-C-4gykWR.js";
|
|
16
16
|
import path, { posix, win32 } from "node:path";
|
|
17
17
|
import { fileURLToPath } from "node:url";
|
|
@@ -28,7 +28,6 @@ import { EventEmitter } from "node:events";
|
|
|
28
28
|
import Stream from "node:stream";
|
|
29
29
|
import { StringDecoder } from "node:string_decoder";
|
|
30
30
|
//#region src/migration/migrator/shared.ts
|
|
31
|
-
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
32
31
|
const LINT_STAGED_JSON_CONFIG_FILES = [".lintstagedrc.json", ".lintstagedrc"];
|
|
33
32
|
const LINT_STAGED_OTHER_CONFIG_FILES = [
|
|
34
33
|
".lintstagedrc.yaml",
|
|
@@ -144,7 +143,7 @@ function checkVitestVersion(projectPath) {
|
|
|
144
143
|
function checkPackageVersion(projectPath, name, minVersion) {
|
|
145
144
|
const metadata = detectPackageMetadata(projectPath, name);
|
|
146
145
|
if (!metadata || metadata.name !== name) return true;
|
|
147
|
-
if (
|
|
146
|
+
if (satisfies(metadata.version, `<${minVersion}`)) {
|
|
148
147
|
const packageJsonFilePath = path.join(projectPath, "package.json");
|
|
149
148
|
log.error(`✘ ${name}@${metadata.version} in ${displayRelative(packageJsonFilePath)} is not supported by auto migration`);
|
|
150
149
|
log.info(`Please upgrade ${name} to version >=${minVersion} first`);
|
|
@@ -164,8 +163,7 @@ function readPackageJsonIfExists(packageJsonPath) {
|
|
|
164
163
|
}
|
|
165
164
|
}
|
|
166
165
|
function pnpmMajor(version) {
|
|
167
|
-
|
|
168
|
-
return coerced ? import_semver.default.major(coerced) : void 0;
|
|
166
|
+
return version ? coerce(version)?.major : void 0;
|
|
169
167
|
}
|
|
170
168
|
const OXLINT_PLUGINS_PACKAGE = "@oxlint/plugins";
|
|
171
169
|
const OXLINT_PLUGIN_API_PACKAGES = ["oxlint", OXLINT_PLUGINS_PACKAGE];
|
|
@@ -318,6 +316,29 @@ const OXLINT_NATIVE_PLUGINS = /* @__PURE__ */ new Set([
|
|
|
318
316
|
"node",
|
|
319
317
|
"vue"
|
|
320
318
|
]);
|
|
319
|
+
const OXLINT_SCHEMA_PATH = fileURLToPath(new URL("configuration_schema.json", import.meta.resolve("oxlint/package.json")));
|
|
320
|
+
const OXLINT_SCHEMA = readJsonFile(OXLINT_SCHEMA_PATH);
|
|
321
|
+
const OXLINT_BUILTIN_RULES = new Set(Object.keys(OXLINT_SCHEMA.definitions.DummyRuleMap.properties));
|
|
322
|
+
const TYPESCRIPT_COMPATIBLE_ESLINT_RULES = /* @__PURE__ */ new Set([
|
|
323
|
+
"class-methods-use-this",
|
|
324
|
+
"default-param-last",
|
|
325
|
+
"init-declarations",
|
|
326
|
+
"max-params",
|
|
327
|
+
"no-array-constructor",
|
|
328
|
+
"no-dupe-class-members",
|
|
329
|
+
"no-empty-function",
|
|
330
|
+
"no-invalid-this",
|
|
331
|
+
"no-loop-func",
|
|
332
|
+
"no-loss-of-precision",
|
|
333
|
+
"no-magic-numbers",
|
|
334
|
+
"no-redeclare",
|
|
335
|
+
"no-restricted-imports",
|
|
336
|
+
"no-shadow",
|
|
337
|
+
"no-unused-expressions",
|
|
338
|
+
"no-unused-vars",
|
|
339
|
+
"no-use-before-define",
|
|
340
|
+
"no-useless-constructor"
|
|
341
|
+
]);
|
|
321
342
|
function detectEslintProject(projectPath, packages) {
|
|
322
343
|
const packageJsonPath = path.join(projectPath, "package.json");
|
|
323
344
|
if (!fs.existsSync(packageJsonPath)) return { hasDependency: false };
|
|
@@ -370,8 +391,8 @@ async function resolveOxlintMigrateVersion(oxlintVersion) {
|
|
|
370
391
|
if (!response.ok) return oxlintVersion;
|
|
371
392
|
const packument = await response.json();
|
|
372
393
|
if (packument.versions && Object.hasOwn(packument.versions, oxlintVersion)) return oxlintVersion;
|
|
373
|
-
const candidates = Object.keys(packument.versions ?? {}).filter((version) =>
|
|
374
|
-
return candidates.length > 0 ? candidates.toSorted(
|
|
394
|
+
const candidates = Object.keys(packument.versions ?? {}).filter((version) => normalize$2(version) && isLessThanOrEqual(version, oxlintVersion));
|
|
395
|
+
return candidates.length > 0 ? candidates.toSorted(compareReversed)[0] : oxlintVersion;
|
|
375
396
|
} catch {
|
|
376
397
|
return oxlintVersion;
|
|
377
398
|
}
|
|
@@ -654,7 +675,7 @@ function collectInstalledPackageNames(projectPath, packages) {
|
|
|
654
675
|
* prefixes until one matches or we run out of slashes.
|
|
655
676
|
*/
|
|
656
677
|
function ruleKeyMatchesNamespace(key, namespaces) {
|
|
657
|
-
if (!key.includes("/")) return
|
|
678
|
+
if (!key.includes("/")) return false;
|
|
658
679
|
let idx = key.indexOf("/");
|
|
659
680
|
while (idx !== -1) {
|
|
660
681
|
if (namespaces.has(key.slice(0, idx))) return true;
|
|
@@ -662,10 +683,46 @@ function ruleKeyMatchesNamespace(key, namespaces) {
|
|
|
662
683
|
}
|
|
663
684
|
return false;
|
|
664
685
|
}
|
|
665
|
-
|
|
666
|
-
|
|
686
|
+
const OXLINT_PLUGIN_ALIASES = /* @__PURE__ */ new Map([
|
|
687
|
+
["@typescript-eslint", "typescript"],
|
|
688
|
+
["typescript-eslint", "typescript"],
|
|
689
|
+
["typescript_eslint", "typescript"],
|
|
690
|
+
["react-hooks", "react"],
|
|
691
|
+
["react_hooks", "react"],
|
|
692
|
+
["deepscan", "oxc"],
|
|
693
|
+
["import-x", "import"],
|
|
694
|
+
["jsx-a11y-x", "jsx-a11y"],
|
|
695
|
+
["jsx_a11y-x", "jsx-a11y"],
|
|
696
|
+
["jsx_a11y", "jsx-a11y"],
|
|
697
|
+
["react_perf", "react-perf"],
|
|
698
|
+
["@next", "nextjs"],
|
|
699
|
+
["@next/next", "nextjs"]
|
|
700
|
+
]);
|
|
701
|
+
function normalizeOxlintRuleNamespace(key) {
|
|
702
|
+
const separator = key.startsWith("@") ? key.lastIndexOf("/") : key.indexOf("/");
|
|
703
|
+
if (separator < 0) return key;
|
|
704
|
+
const plugin = deriveJsPluginNamespace(key.slice(0, separator));
|
|
705
|
+
return `${OXLINT_PLUGIN_ALIASES.get(plugin) ?? plugin}${key.slice(separator)}`;
|
|
706
|
+
}
|
|
707
|
+
function isBuiltinOxlintRule(key) {
|
|
708
|
+
const normalizedKey = normalizeOxlintRuleNamespace(key);
|
|
709
|
+
const firstSlash = normalizedKey.indexOf("/");
|
|
710
|
+
if (firstSlash === -1) return OXLINT_BUILTIN_RULES.has(normalizedKey) || [...OXLINT_BUILTIN_RULES].some((rule) => rule.endsWith(`/${normalizedKey}`));
|
|
711
|
+
const separator = normalizedKey.startsWith("@") ? normalizedKey.lastIndexOf("/") : firstSlash;
|
|
712
|
+
const plugin = normalizedKey.slice(0, separator);
|
|
713
|
+
const rule = normalizedKey.slice(separator + 1);
|
|
714
|
+
if (plugin === "eslint" || plugin === "typescript" && TYPESCRIPT_COMPATIBLE_ESLINT_RULES.has(rule)) return OXLINT_BUILTIN_RULES.has(rule);
|
|
715
|
+
return OXLINT_BUILTIN_RULES.has(`${plugin}/${rule}`);
|
|
716
|
+
}
|
|
717
|
+
function hasBuiltinOxlintNamespace(key) {
|
|
718
|
+
if (!key.includes("/")) return true;
|
|
719
|
+
return ruleKeyMatchesNamespace(normalizeOxlintRuleNamespace(key), OXLINT_NATIVE_PLUGINS);
|
|
720
|
+
}
|
|
721
|
+
/** Filter a rules object to Oxlint rules or rules under a configured JS plugin namespace. */
|
|
722
|
+
function filterRulesAgainstNamespaces(rules, jsPluginNamespaces, droppedRules) {
|
|
667
723
|
const out = {};
|
|
668
|
-
for (const [key, value] of Object.entries(rules)) if (ruleKeyMatchesNamespace(key,
|
|
724
|
+
for (const [key, value] of Object.entries(rules)) if (isBuiltinOxlintRule(key) || ruleKeyMatchesNamespace(key, jsPluginNamespaces) || ruleKeyMatchesNamespace(normalizeOxlintRuleNamespace(key), jsPluginNamespaces)) out[key] = value;
|
|
725
|
+
else if (hasBuiltinOxlintNamespace(key)) droppedRules.add(key);
|
|
669
726
|
return out;
|
|
670
727
|
}
|
|
671
728
|
/**
|
|
@@ -703,14 +760,6 @@ function jsPluginsToNamespaces(entries) {
|
|
|
703
760
|
ns.delete("");
|
|
704
761
|
return ns;
|
|
705
762
|
}
|
|
706
|
-
function stripUnsupportedReactRefreshOption(rules) {
|
|
707
|
-
const rule = rules?.["react/only-export-components"];
|
|
708
|
-
if (!Array.isArray(rule)) return false;
|
|
709
|
-
const options = rule[1];
|
|
710
|
-
if (!options || typeof options !== "object" || Array.isArray(options) || !("allowCompoundComponents" in options)) return false;
|
|
711
|
-
delete options.allowCompoundComponents;
|
|
712
|
-
return true;
|
|
713
|
-
}
|
|
714
763
|
/**
|
|
715
764
|
* Sanitize the `.oxlintrc.json` produced by `@oxlint/migrate` (in-place)
|
|
716
765
|
* before it gets merged into `vite.config.ts`. Drop references that
|
|
@@ -732,12 +781,13 @@ function stripUnsupportedReactRefreshOption(rules) {
|
|
|
732
781
|
function sanitizeMigratedOxlintConfig(config, availablePackages, report) {
|
|
733
782
|
const allDroppedJsPlugins = /* @__PURE__ */ new Set();
|
|
734
783
|
const allDroppedPlugins = /* @__PURE__ */ new Set();
|
|
735
|
-
|
|
784
|
+
const allDroppedRules = /* @__PURE__ */ new Set();
|
|
736
785
|
const baseSplit = partitionJsPlugins(config.jsPlugins ?? [], availablePackages);
|
|
737
786
|
for (const n of baseSplit.dropped) allDroppedJsPlugins.add(n);
|
|
738
787
|
if (config.jsPlugins && baseSplit.dropped.length > 0) config.jsPlugins = baseSplit.kept;
|
|
788
|
+
const jsPluginNamespaces = jsPluginsToNamespaces(baseSplit.kept);
|
|
739
789
|
const baseNamespaces = new Set(OXLINT_NATIVE_PLUGINS);
|
|
740
|
-
for (const ns of
|
|
790
|
+
for (const ns of jsPluginNamespaces) baseNamespaces.add(ns);
|
|
741
791
|
if (config.plugins) {
|
|
742
792
|
const keptPlugins = [];
|
|
743
793
|
for (const p of config.plugins) if (baseNamespaces.has(p)) keptPlugins.push(p);
|
|
@@ -745,11 +795,10 @@ function sanitizeMigratedOxlintConfig(config, availablePackages, report) {
|
|
|
745
795
|
if (keptPlugins.length !== config.plugins.length) config.plugins = keptPlugins;
|
|
746
796
|
}
|
|
747
797
|
if (config.rules) {
|
|
748
|
-
const filtered = filterRulesAgainstNamespaces(config.rules,
|
|
798
|
+
const filtered = filterRulesAgainstNamespaces(config.rules, jsPluginNamespaces, allDroppedRules);
|
|
749
799
|
if (Object.keys(filtered).length !== Object.keys(config.rules).length) config.rules = filtered;
|
|
750
800
|
}
|
|
751
801
|
if (Array.isArray(config.overrides)) for (const override of config.overrides) {
|
|
752
|
-
if (stripUnsupportedReactRefreshOption(override.rules)) droppedReactRefreshOption = true;
|
|
753
802
|
let overrideSurvivors = [];
|
|
754
803
|
if (override.jsPlugins) {
|
|
755
804
|
const split = partitionJsPlugins(override.jsPlugins, availablePackages);
|
|
@@ -757,8 +806,9 @@ function sanitizeMigratedOxlintConfig(config, availablePackages, report) {
|
|
|
757
806
|
if (split.dropped.length > 0) override.jsPlugins = split.kept;
|
|
758
807
|
overrideSurvivors = split.kept;
|
|
759
808
|
}
|
|
760
|
-
const
|
|
761
|
-
for (const ns of jsPluginsToNamespaces(overrideSurvivors))
|
|
809
|
+
const overrideJsPluginNamespaces = new Set(jsPluginNamespaces);
|
|
810
|
+
for (const ns of jsPluginsToNamespaces(overrideSurvivors)) overrideJsPluginNamespaces.add(ns);
|
|
811
|
+
const overrideNamespaces = /* @__PURE__ */ new Set([...OXLINT_NATIVE_PLUGINS, ...overrideJsPluginNamespaces]);
|
|
762
812
|
if (override.plugins) {
|
|
763
813
|
const keptOverridePlugins = [];
|
|
764
814
|
for (const p of override.plugins) if (overrideNamespaces.has(p)) keptOverridePlugins.push(p);
|
|
@@ -766,13 +816,13 @@ function sanitizeMigratedOxlintConfig(config, availablePackages, report) {
|
|
|
766
816
|
if (keptOverridePlugins.length !== override.plugins.length) override.plugins = keptOverridePlugins;
|
|
767
817
|
}
|
|
768
818
|
if (override.rules) {
|
|
769
|
-
const filtered = filterRulesAgainstNamespaces(override.rules,
|
|
819
|
+
const filtered = filterRulesAgainstNamespaces(override.rules, overrideJsPluginNamespaces, allDroppedRules);
|
|
770
820
|
if (Object.keys(filtered).length !== Object.keys(override.rules).length) override.rules = filtered;
|
|
771
821
|
}
|
|
772
822
|
}
|
|
773
|
-
if (droppedReactRefreshOption) warnMigration("The bundled Oxlint does not support react/only-export-components.allowCompoundComponents. Removed this option from the migrated config; compound component exports may now report lint errors.", report);
|
|
774
823
|
if (allDroppedJsPlugins.size > 0) warnMigration(`Stripped JS plugin reference(s) from the generated lint config: ${[...allDroppedJsPlugins].join(", ")}. No matching package is present in this workspace, so loading them at lint time would fail. If you want their Oxlint coverage back, install each package (e.g. \`vp install <name>\`) and add its name back to \`lint.jsPlugins\` in vite.config.ts.`, report);
|
|
775
824
|
if (allDroppedPlugins.size > 0) warnMigration(`Stripped unknown plugin reference(s) from the generated lint config: ${[...allDroppedPlugins].join(", ")}. These aren't native Oxlint plugins and no surviving JS plugin contributes them.`, report);
|
|
825
|
+
if (allDroppedRules.size > 0) warnMigration(`Stripped unsupported Oxlint rule(s) from the generated lint config: ${[...allDroppedRules].join(", ")}. These rule(s) are not available in Oxlint.`, report);
|
|
776
826
|
}
|
|
777
827
|
function warnPackageLevelEslint() {
|
|
778
828
|
log.warn("ESLint detected in workspace packages but no root config found. Package-level ESLint must be migrated manually.");
|
|
@@ -1741,7 +1791,7 @@ function vitestEcosystemCatalogReferencesPending(pkg, catalogDependencyResolver)
|
|
|
1741
1791
|
pkg.optionalDependencies
|
|
1742
1792
|
]) {
|
|
1743
1793
|
if (!dependencies) continue;
|
|
1744
|
-
for (const [name, spec] of Object.entries(dependencies)) if (isAlignableVitestEcosystemPackage(name) && spec.startsWith("catalog:") && catalogDependencyResolver(spec, name) !== "5.0.
|
|
1794
|
+
for (const [name, spec] of Object.entries(dependencies)) if (isAlignableVitestEcosystemPackage(name) && spec.startsWith("catalog:") && catalogDependencyResolver(spec, name) !== "5.0.3") return true;
|
|
1745
1795
|
}
|
|
1746
1796
|
return false;
|
|
1747
1797
|
}
|
|
@@ -7349,8 +7399,8 @@ const PNPM_MINIMUM_RELEASE_AGE_EXCLUDES = [
|
|
|
7349
7399
|
...VITEST_AGE_GATE_EXEMPT_PACKAGES
|
|
7350
7400
|
];
|
|
7351
7401
|
function versionAtLeast(version, minVersion, tags) {
|
|
7352
|
-
const coerced =
|
|
7353
|
-
if (coerced) return
|
|
7402
|
+
const coerced = coerce(version);
|
|
7403
|
+
if (coerced) return isGreaterThanOrEqual(coerced, minVersion);
|
|
7354
7404
|
return tags.includes(version);
|
|
7355
7405
|
}
|
|
7356
7406
|
const PNPM_WORKSPACE_SETTINGS_MIN_VERSION = "10.6.2";
|
|
@@ -8000,7 +8050,7 @@ function resolveEffectiveYarnConfigValue(workspaceRootDir, key, envVar) {
|
|
|
8000
8050
|
* treated as modern because that is the version `vp` will provision.
|
|
8001
8051
|
*/
|
|
8002
8052
|
function detectYarnPnpMode(projectPath, yarnVersion) {
|
|
8003
|
-
if (
|
|
8053
|
+
if (coerce(yarnVersion)?.major === 1) return;
|
|
8004
8054
|
const environmentLinker = process.env.YARN_NODE_LINKER?.trim();
|
|
8005
8055
|
if (environmentLinker) return environmentLinker.toLowerCase() === "pnp" ? { source: "environment" } : void 0;
|
|
8006
8056
|
const configuredLinker = resolveEffectiveYarnConfigValue(projectPath, "nodeLinker", "YARN_NODE_LINKER");
|
|
@@ -8344,7 +8394,7 @@ function isSemanticVitePlusOverrideSpec(dependencyName, spec) {
|
|
|
8344
8394
|
if (!spec) return false;
|
|
8345
8395
|
if (isLegacyWrapperSpec(spec)) return false;
|
|
8346
8396
|
if (spec === VITE_PLUS_OVERRIDE_PACKAGES[dependencyName]) return true;
|
|
8347
|
-
if (dependencyName === "@vitest/browser" && spec === "5.0.
|
|
8397
|
+
if (dependencyName === "@vitest/browser" && spec === "5.0.3") return true;
|
|
8348
8398
|
return false;
|
|
8349
8399
|
}
|
|
8350
8400
|
function overrideSpecSatisfiesVitePlus(dependencyName, spec, catalogDependencyResolver) {
|
|
@@ -8359,9 +8409,6 @@ function overridesSatisfyVitePlus(overrides, usesVitest, catalogDependencyResolv
|
|
|
8359
8409
|
if (keyStyle === "pnpm-ranged" && Object.keys(managed).some((dependencyName) => typeof overrides?.[dependencyName] === "string")) return false;
|
|
8360
8410
|
return Object.keys(managed).every((dependencyName) => overrideSpecSatisfiesVitePlus(dependencyName, overrides?.[managedOverrideKey(dependencyName, keyStyle)], catalogDependencyResolver));
|
|
8361
8411
|
}
|
|
8362
|
-
function hasPackageManagerPin(pkg) {
|
|
8363
|
-
return Boolean(pkg.packageManager || pkg.devEngines?.packageManager);
|
|
8364
|
-
}
|
|
8365
8412
|
function pinnedPackageManagerVersion(pkg) {
|
|
8366
8413
|
if (typeof pkg.packageManager === "string") {
|
|
8367
8414
|
const separator = pkg.packageManager.indexOf("@");
|
|
@@ -8553,9 +8600,9 @@ function detectVitePlusBootstrapPending(projectPath, packageManager, packages, p
|
|
|
8553
8600
|
const packageJsonPath = path.join(projectPath, "package.json");
|
|
8554
8601
|
if (!fs.existsSync(packageJsonPath)) return false;
|
|
8555
8602
|
const pkg = readJsonFile(packageJsonPath);
|
|
8556
|
-
if (!hasDirectVitePlusInstallEntry(pkg)
|
|
8603
|
+
if (!hasDirectVitePlusInstallEntry(pkg)) return true;
|
|
8557
8604
|
if (packageManager === void 0) return true;
|
|
8558
|
-
const resolvedPackageManagerVersion = packageManagerVersion ?? pinnedPackageManagerVersion(pkg)
|
|
8605
|
+
const resolvedPackageManagerVersion = (packageManagerVersion ?? pinnedPackageManagerVersion(pkg)) || "latest";
|
|
8559
8606
|
const usePnpmWorkspaceYaml = packageManager === PackageManager.pnpm && pnpmSupportsWorkspaceSettings(resolvedPackageManagerVersion);
|
|
8560
8607
|
if (usePnpmWorkspaceYaml && pnpmPackageJsonSettingsPending(pkg)) return true;
|
|
8561
8608
|
const supportCatalog = !VITE_PLUS_VERSION.startsWith("file:") && supportsCatalog(packageManager, resolvedPackageManagerVersion, packageManager === PackageManager.bun && bunWorkspaceDeclaresPackages(pkg.workspaces));
|
|
@@ -8774,10 +8821,7 @@ function ensureVitePlusBootstrap(workspaceInfo, report) {
|
|
|
8774
8821
|
const after = fs.readFileSync(packageJsonPath, "utf-8");
|
|
8775
8822
|
result.packageJson = result.packageJson || before !== after;
|
|
8776
8823
|
}
|
|
8777
|
-
|
|
8778
|
-
setPackageManager(projectPath, workspaceInfo.downloadPackageManager);
|
|
8779
|
-
result.packageManagerField = beforePackageManager !== fs.readFileSync(packageJsonPath, "utf-8");
|
|
8780
|
-
result.changed = result.packageJson || result.packageManagerConfig || result.packageManagerField;
|
|
8824
|
+
result.changed = result.packageJson || result.packageManagerConfig;
|
|
8781
8825
|
if (result.changed && report) report.packageManagerBootstrapConfigured = true;
|
|
8782
8826
|
return result;
|
|
8783
8827
|
}
|
|
@@ -9554,7 +9598,7 @@ function parseNvmrcVersion(alias) {
|
|
|
9554
9598
|
if (version === "iojs" || version === "system" || version === "default") return null;
|
|
9555
9599
|
if (version.startsWith("lts/")) return version;
|
|
9556
9600
|
const normalized = version.startsWith("v") ? version.slice(1) : version;
|
|
9557
|
-
if (!normalized || !
|
|
9601
|
+
if (!normalized || !normalizeRange(normalized)) return null;
|
|
9558
9602
|
return normalized;
|
|
9559
9603
|
}
|
|
9560
9604
|
/**
|
|
@@ -9662,7 +9706,7 @@ function migrateNodeVersionManagerFile(projectPath, detection, report) {
|
|
|
9662
9706
|
if (detection.file === "package.json") {
|
|
9663
9707
|
const { voltaNodeVersion } = detection;
|
|
9664
9708
|
const resolvedVersion = voltaNodeVersion === "lts" ? "lts/*" : voltaNodeVersion;
|
|
9665
|
-
if (!
|
|
9709
|
+
if (!normalize$2(resolvedVersion) && resolvedVersion !== "lts/*") {
|
|
9666
9710
|
warnMigration(`package.json volta.node "${voltaNodeVersion}" is not an exact version. Pin an exact version (e.g. ${voltaNodeVersion}.0 or run \`volta pin node@${voltaNodeVersion}\`) then re-run migration.`, report);
|
|
9667
9711
|
return false;
|
|
9668
9712
|
}
|
|
@@ -9883,7 +9927,6 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
|
|
|
9883
9927
|
dropDeadOxlintPluginsDependency(projectPath, workspaceInfo.packages, originalOxlintDependencies);
|
|
9884
9928
|
wrapLazyPluginsInViteConfig(projectPath, silent, report);
|
|
9885
9929
|
migrateTaskCacheConfigInViteConfig(projectPath, silent, report);
|
|
9886
|
-
setPackageManager(projectPath, workspaceInfo.downloadPackageManager);
|
|
9887
9930
|
}
|
|
9888
9931
|
/**
|
|
9889
9932
|
* Rewrite monorepo to add vite-plus dependencies
|
|
@@ -9929,7 +9972,6 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
|
|
|
9929
9972
|
wrapLazyPluginsInViteConfig(projectPath, silent, report);
|
|
9930
9973
|
migrateTaskCacheConfigInViteConfig(projectPath, silent, report);
|
|
9931
9974
|
}
|
|
9932
|
-
setPackageManager(workspaceInfo.rootDir, workspaceInfo.downloadPackageManager);
|
|
9933
9975
|
}
|
|
9934
9976
|
/**
|
|
9935
9977
|
* Rewrite monorepo project to add vite-plus dependencies
|
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-CREUiMmM.cjs");
|
|
2
2
|
//#region src/index.cts
|
|
3
3
|
const vite = require("vite");
|
|
4
4
|
const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-CeW9DETl.js";
|
|
2
2
|
import { TestProjectConfiguration, TestProjectInlineConfiguration, TestTagDefinition, TestUserConfig, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, ViteUserConfig, ViteUserConfigExport, ViteUserConfigFn, ViteUserConfigFnObject, ViteUserConfigFnPromise, WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "vite";
|
|
4
4
|
export { type TestProjectConfiguration, type TestProjectInlineConfiguration, type TestTagDefinition, type TestUserConfig, type UserProjectConfigExport, type UserProjectConfigFn, type UserWorkspaceConfig, type ViteUserConfig, type ViteUserConfigExport, type ViteUserConfigFn, type ViteUserConfigFnObject, type ViteUserConfigFnPromise, type WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-Ro6PS4dP.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 };
|
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-CREUiMmM.cjs");
|
|
3
3
|
let _oxlint_plugins = require("@oxlint/plugins");
|
|
4
4
|
Object.defineProperty(exports, "definePlugin", {
|
|
5
5
|
enumerable: true,
|