vite-plus 0.3.3 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/LICENSE +35 -146
  2. package/README.md +6 -4
  3. package/binding/index.cjs +58 -54
  4. package/binding/index.d.cts +36 -4
  5. package/dist/{agent-Cu6-tXIP.js → agent-DIwEez_1.js} +6 -5
  6. package/dist/bin.js +75 -35
  7. package/dist/config/bin.js +3 -3
  8. package/dist/constants-BAsBfS1J.js +356 -0
  9. package/dist/create/bin.js +19 -13
  10. package/dist/{define-config-IgzmnvvV.js → define-config-Bz6dc3fm.js} +165 -43
  11. package/dist/{define-config-D0mevyb3.cjs → define-config-CAeeMTvb.cjs} +179 -44
  12. package/dist/{define-config-DPNEJxPz.d.ts → define-config-Cf_5GHmY.d.ts} +71 -25
  13. package/dist/define-config.cjs +1 -1
  14. package/dist/define-config.d.ts +1 -1
  15. package/dist/define-config.js +1 -1
  16. package/dist/dist-BWiANxFS.js +8052 -0
  17. package/dist/{dist-BDYZP12R.js → dist-BsAzy8OW.js} +109 -105
  18. package/dist/documentation-DqcZSthV.js +11 -0
  19. package/dist/{editor-4sjlHmUh.js → editor-DWgrWTbN.js} +246 -159
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.js +1 -1
  23. package/dist/{json-cULBl7Pi.js → json-JP24qHUF.js} +14 -6
  24. package/dist/lint-plugins.cjs +1 -1
  25. package/dist/migration/bin.js +3127 -18
  26. package/dist/migration/compat/worker.js +1 -1
  27. package/dist/{oxlint-plugin-config-BVqEe9KY.js → oxlint-plugin-config-B-P1a_0g.js} +1 -1
  28. package/dist/oxlint-plugin.js +9 -7
  29. package/dist/pack-bin.js +1 -1
  30. package/dist/{package-CHH8jWan.js → package-BrupPpWA.js} +6 -2
  31. package/dist/{vitest-ecosystem-BiRqcaRI.js → package-overrides-Dpn4scvN.js} +1 -7
  32. package/dist/{prompts-k14KgthC.js → prompts-BW7_fDGJ.js} +3 -4
  33. package/dist/{report-CK5TnTsr.js → report-NhQk8VHb.js} +1 -0
  34. package/dist/{resolve-vite-config-CTOTuqTi.js → resolve-vite-config-D3XIVT6s.js} +1 -1
  35. package/dist/{resolve-vite-config-BqvS2P98.js → resolve-vite-config-DcsMQaYy.js} +2 -2
  36. package/dist/staged/bin.js +1206 -3318
  37. package/dist/sync-versions/bin.js +4 -4
  38. package/dist/sync-versions/bin.mjs +17 -2
  39. package/dist/test/browser/context.js +1 -1
  40. package/dist/test/browser/providers/playwright/context.js +1 -1
  41. package/dist/test/browser/providers/preview/context.js +1 -1
  42. package/dist/test/browser-playwright/context.js +1 -1
  43. package/dist/test/browser-preview/context.js +1 -1
  44. package/dist/test/context.d.ts +2 -942
  45. package/dist/test/context.js +1 -1
  46. package/dist/test/internal/traces.js +1 -0
  47. package/dist/test/locators.d.ts +2 -294
  48. package/dist/test/matchers.d.ts +2 -29
  49. package/dist/test/mocker.d.ts +2 -0
  50. package/dist/test/mocker.js +1 -0
  51. package/dist/test/{browser-webdriverio/context.js → plugins/browser-context.d.ts} +1 -0
  52. package/dist/test/plugins/browser-context.js +1 -1
  53. package/dist/test/plugins/browser-locators.d.ts +2 -0
  54. package/dist/test/plugins/browser-playwright.d.ts +2 -0
  55. package/dist/test/plugins/browser-preview.d.ts +2 -0
  56. package/dist/test/plugins/browser.d.ts +2 -0
  57. package/dist/test/plugins/mocker-automock.d.ts +2 -0
  58. package/dist/test/plugins/mocker-browser.d.ts +2 -0
  59. package/dist/test/plugins/mocker-node.d.ts +2 -0
  60. package/dist/test/plugins/mocker-redirect.d.ts +2 -0
  61. package/dist/test/plugins/mocker-register.d.ts +2 -0
  62. package/dist/test/plugins/mocker-transforms.d.ts +2 -0
  63. package/dist/test/plugins/mocker.d.ts +2 -0
  64. package/dist/test/plugins/pretty-format.d.ts +2 -0
  65. package/dist/test/plugins/snapshot-environment.d.ts +2 -0
  66. package/dist/test/plugins/snapshot-manager.d.ts +2 -0
  67. package/dist/test/plugins/snapshot.d.ts +2 -0
  68. package/dist/test/plugins/spy.d.ts +2 -0
  69. package/dist/test/plugins/utils-constants.d.ts +2 -0
  70. package/dist/test/plugins/utils-diff.d.ts +2 -0
  71. package/dist/test/plugins/utils-display.d.ts +2 -0
  72. package/dist/test/plugins/utils-error.d.ts +2 -0
  73. package/dist/test/plugins/utils-helpers.d.ts +2 -0
  74. package/dist/test/plugins/utils-offset.d.ts +2 -0
  75. package/dist/test/plugins/utils-resolver.d.ts +2 -0
  76. package/dist/test/plugins/utils-serialize.d.ts +2 -0
  77. package/dist/test/plugins/utils-source-map-node.d.ts +2 -0
  78. package/dist/test/plugins/utils-source-map.d.ts +2 -0
  79. package/dist/test/plugins/utils-timers.d.ts +2 -0
  80. package/dist/test/plugins/utils.d.ts +2 -0
  81. package/dist/toolchain.js +11 -11
  82. package/dist/toolchain.json +11 -11
  83. package/dist/{tsconfig-euB-GmIE.js → tsconfig-DESFDzWP.js} +1 -1
  84. package/dist/{tsconfig-C3h9CVTA.js → tsconfig-piorpNV7.js} +8 -4
  85. package/dist/version.js +5 -3
  86. package/dist/versions.js +6 -6
  87. package/dist/vitest-ecosystem-BU0AqZq-.js +23 -0
  88. package/dist/vitest-v5-entry-points-DthU1e_O.js +25 -0
  89. package/docs/config/fmt.md +4 -2
  90. package/docs/config/lint.md +4 -2
  91. package/docs/config/run.md +62 -26
  92. package/docs/guide/automatic-data-tracking.md +20 -15
  93. package/docs/guide/cache.md +12 -8
  94. package/docs/guide/check.md +2 -0
  95. package/docs/guide/commit-hooks.md +8 -1
  96. package/docs/guide/env.md +18 -13
  97. package/docs/guide/fmt.md +6 -2
  98. package/docs/guide/index.md +1 -1
  99. package/docs/guide/install.md +1 -1
  100. package/docs/guide/lint.md +5 -1
  101. package/docs/guide/local-cli.md +3 -3
  102. package/docs/guide/migrate-rules.md +58 -12
  103. package/docs/guide/migrate.md +86 -20
  104. package/docs/guide/monorepo.md +7 -1
  105. package/docs/guide/run.md +3 -1
  106. package/docs/guide/test.md +2 -0
  107. package/docs/guide/troubleshooting.md +3 -3
  108. package/docs/guide/vitest-v5.md +221 -0
  109. package/package.json +64 -87
  110. package/bin/oxfmt +0 -33
  111. package/bin/oxlint +0 -38
  112. package/dist/cli-truncate-Bg3RDXpi.js +0 -865
  113. package/dist/constants-C2dTOTe-.js +0 -80
  114. package/dist/dist-Dqv1-Clg.js +0 -3
  115. package/dist/is-fullwidth-code-point-BUNlIICg.js +0 -8
  116. package/dist/log-update-CoW8Z4Dl.js +0 -491
  117. package/dist/semver-CaDAb8vV.js +0 -1400
  118. package/dist/strip-ansi-C3wrWz9t.js +0 -853
  119. package/dist/test/browser/providers/webdriverio/context.d.ts +0 -1
  120. package/dist/test/browser/providers/webdriverio/context.js +0 -1
  121. package/dist/test/browser/providers/webdriverio.d.ts +0 -77
  122. package/dist/test/browser/providers/webdriverio.js +0 -1
  123. package/dist/test/browser-webdriverio/context.d.ts +0 -1
  124. package/dist/test/browser-webdriverio.d.ts +0 -77
  125. package/dist/test/browser-webdriverio.js +0 -1
  126. package/dist/test/coverage.d.ts +0 -2
  127. package/dist/test/coverage.js +0 -1
  128. package/dist/test/environments.d.ts +0 -2
  129. package/dist/test/environments.js +0 -1
  130. package/dist/test/plugins/browser-webdriverio.js +0 -1
  131. package/dist/test/plugins/expect.js +0 -1
  132. package/dist/test/plugins/runner-types.js +0 -1
  133. package/dist/test/plugins/runner-utils.js +0 -1
  134. package/dist/test/plugins/runner.js +0 -1
  135. package/dist/test/reporters.d.ts +0 -2
  136. package/dist/test/reporters.js +0 -1
  137. package/dist/test/runners.d.ts +0 -2
  138. package/dist/test/runners.js +0 -1
  139. package/dist/test/snapshot.d.ts +0 -2
  140. package/dist/test/snapshot.js +0 -1
  141. package/dist/test/suite.d.ts +0 -2
  142. package/dist/test/suite.js +0 -1
  143. package/dist/tsgolint-path-CbDReEOx.js +0 -34
  144. package/dist/tsgolint-path.d.ts +0 -7
  145. package/dist/tsgolint-path.js +0 -2
  146. package/dist/wrap-ansi-DNjkuBEp.js +0 -157
  147. package/dist/wrap-ansi-DUi52C6W.js +0 -2
@@ -1,20 +1,21 @@
1
1
  import { r as __toESM } from "./rolldown-runtime-CMFfr-1z.js";
2
- 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-C2dTOTe-.js";
3
- import { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BVqEe9KY.js";
4
- import { a as writeJsonFile, c as parse, i as readJsonFile, n as editJsonFile, o as applyEdits, r as isJsonFile, s as modify, t as detectFormattingOptions } from "./json-cULBl7Pi.js";
5
- import { n as detectPackageMetadata, r as getScopeFromPackageName } from "./package-CHH8jWan.js";
6
- import { C as multiselect, S as log, T as select, _ as getSpinner, b as confirm, d as readYamlFile, f as scalarString, g as getSilentSpinner, k as isCancel, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-k14KgthC.js";
7
- import { t as require_semver } from "./semver-CaDAb8vV.js";
8
- import { l as displayRelative, u as rulesDir } from "./agent-Cu6-tXIP.js";
9
- import { n as addMigrationWarning, t as addManualStep } from "./report-CK5TnTsr.js";
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-BAsBfS1J.js";
4
+ import { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-B-P1a_0g.js";
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 { n as detectPackageMetadata, o as fetchNpmResource, r as getScopeFromPackageName, s as getNpmRegistry } from "./package-BrupPpWA.js";
7
+ import { n as isAlignableVitestEcosystemPackage } from "./vitest-ecosystem-BU0AqZq-.js";
8
+ import { C as multiselect, S as log, T as select, _ as getSpinner, b as confirm, d as readYamlFile, f as scalarString, g as getSilentSpinner, k as isCancel, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-BW7_fDGJ.js";
9
+ import { n as require_semver, t as require_dist } from "./dist-BWiANxFS.js";
10
+ import { l as displayRelative, u as rulesDir } from "./agent-DIwEez_1.js";
11
+ import { n as addMigrationWarning, t as addManualStep } from "./report-NhQk8VHb.js";
10
12
  import { n as runCommandSilently, r as require_cross_spawn } from "./command-CguLh2KL.js";
11
- import { t as require_dist } from "./dist-BDYZP12R.js";
12
- import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-C3h9CVTA.js";
13
- import { n as extractOverrideTargetName, t as isAlignableVitestEcosystemPackage } from "./vitest-ecosystem-BiRqcaRI.js";
13
+ import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-piorpNV7.js";
14
+ import { t as extractOverrideTargetName } from "./package-overrides-Dpn4scvN.js";
14
15
  import { i as findUnsafeHookInstallPath, t as SUPPORTED_GIT_HOOK_NAMES } from "./hooks-C-4gykWR.js";
15
16
  import path, { posix, win32 } from "node:path";
16
17
  import { fileURLToPath } from "node:url";
17
- import { detectWorkspace, getVpDirs, hasConfigKey, mergeJsonConfig, mergeTsdownConfig, rewriteEslint, rewriteImportsInDirectory, rewritePrettier, rewriteScripts, wrapLazyPlugins } from "../binding/index.js";
18
+ import { detectWorkspace, getVpDirs, hasConfigKey, mergeJsonConfig, mergeTsdownConfig, migrateTaskCacheConfig, rewriteEslint, rewriteImportsInDirectory, rewritePrettier, rewriteScripts, wrapLazyPlugins } from "../binding/index.js";
18
19
  import { styleText } from "node:util";
19
20
  import * as actualFS from "node:fs";
20
21
  import fs from "node:fs";
@@ -56,28 +57,18 @@ const REMOVE_PACKAGES = [
56
57
  ];
57
58
  const WEBDRIVERIO_PROVIDER = "@vitest/browser-webdriverio";
58
59
  const PLAYWRIGHT_PROVIDER = "@vitest/browser-playwright";
59
- const OPT_IN_BROWSER_PROVIDERS = [WEBDRIVERIO_PROVIDER, PLAYWRIGHT_PROVIDER];
60
+ const OPT_IN_BROWSER_PROVIDERS = [PLAYWRIGHT_PROVIDER];
60
61
  const PROVIDER_OVERRIDE_DROP_NAMES = [...REMOVE_PACKAGES, ...OPT_IN_BROWSER_PROVIDERS];
61
- const BROWSER_PROVIDER_PEER_DEPS = {
62
- "@vitest/browser-playwright": "playwright",
63
- "@vitest/browser-webdriverio": "webdriverio"
64
- };
62
+ const BROWSER_PROVIDER_PEER_DEPS = { "@vitest/browser-playwright": "playwright" };
65
63
  const RUNTIME_PEER_INCLUDED_BY = { playwright: ["@playwright/test"] };
66
- const PROVIDER_PEER_VERSION_SIBLINGS = { webdriverio: ["@wdio/cli", "@wdio/globals"] };
67
64
  function findDeclaredSpec(pkg, name) {
68
65
  return pkg.dependencies?.[name] ?? pkg.devDependencies?.[name] ?? pkg.peerDependencies?.[name] ?? pkg.optionalDependencies?.[name];
69
66
  }
70
67
  function hasProviderPeerDependency(pkg, runtimePeer) {
71
68
  return findDeclaredSpec(pkg, runtimePeer) !== void 0 || (RUNTIME_PEER_INCLUDED_BY[runtimePeer] ?? []).some((packageName) => findDeclaredSpec(pkg, packageName) !== void 0);
72
69
  }
73
- function resolveProviderPeerSpec(pkg, peer, supportCatalog, catalogDependencyResolver) {
74
- if (supportCatalog && catalogDependencyResolver?.("catalog:", peer) !== void 0) return "catalog:";
75
- for (const sibling of PROVIDER_PEER_VERSION_SIBLINGS[peer] ?? []) {
76
- const spec = findDeclaredSpec(pkg, sibling);
77
- const resolved = spec?.startsWith("catalog:") ? catalogDependencyResolver?.(spec, sibling) : spec;
78
- if (resolved && !resolved.includes(":")) return resolved;
79
- }
80
- return "*";
70
+ function resolveProviderPeerSpec(peer, supportCatalog, catalogDependencyResolver) {
71
+ return supportCatalog && catalogDependencyResolver?.("catalog:", peer) !== void 0 ? "catalog:" : "*";
81
72
  }
82
73
  const VITEST_BROWSER_DEP_NAMES = [
83
74
  "@vitest/browser",
@@ -363,6 +354,29 @@ function extractSkippedRules(output) {
363
354
  return block.join("\n");
364
355
  }
365
356
  /**
357
+ * Resolve the `@oxlint/migrate` version to install. `@oxlint/migrate`
358
+ * trails `oxlint` releases (published minutes to days later), so the exact
359
+ * bundled-oxlint pin can name a version the registry does not have yet.
360
+ * Pick the greatest published version that is not newer than the bundled
361
+ * Oxlint. Fall back to the exact pin when the registry cannot be reached
362
+ * and let the dlx step surface the failure.
363
+ */
364
+ async function resolveOxlintMigrateVersion(oxlintVersion) {
365
+ try {
366
+ const response = await fetchNpmResource(`${getNpmRegistry("@oxlint")}/@oxlint/migrate`, {
367
+ headers: { accept: "application/vnd.npm.install-v1+json" },
368
+ timeoutMs: 5e3
369
+ });
370
+ if (!response.ok) return oxlintVersion;
371
+ const packument = await response.json();
372
+ if (packument.versions && Object.hasOwn(packument.versions, oxlintVersion)) return oxlintVersion;
373
+ const candidates = Object.keys(packument.versions ?? {}).filter((version) => import_semver.default.valid(version) && import_semver.default.lte(version, oxlintVersion));
374
+ return candidates.length > 0 ? candidates.toSorted(import_semver.default.rcompare)[0] : oxlintVersion;
375
+ } catch {
376
+ return oxlintVersion;
377
+ }
378
+ }
379
+ /**
366
380
  * Run a `vp dlx @oxlint/migrate` step with graceful error handling.
367
381
  * Returns true on success, false on failure (spawn error or non-zero exit).
368
382
  */
@@ -400,7 +414,7 @@ async function migrateEslintToOxlint(projectPath, interactive, eslintConfigFile,
400
414
  const spinner = options?.silent ? getSilentSpinner() : getSpinner(interactive);
401
415
  if (eslintConfigFile) {
402
416
  const { versions } = await import("./versions.js");
403
- const migratePackage = `@oxlint/migrate@${versions.oxlint}`;
417
+ const migratePackage = `@oxlint/migrate@${await resolveOxlintMigrateVersion(versions.oxlint)}`;
404
418
  const migrateArgs = [
405
419
  "--merge",
406
420
  ...!hasBaseUrlInTsconfig(projectPath) ? ["--type-aware"] : [],
@@ -1572,9 +1586,12 @@ function dropRemovePackageOverrideKeys(overrides, ancestorChain = []) {
1572
1586
  }
1573
1587
  return removed;
1574
1588
  }
1575
- function managedOverridePackages(usesVitest) {
1576
- if (usesVitest) return VITE_PLUS_OVERRIDE_PACKAGES;
1577
- return Object.fromEntries(Object.entries(VITE_PLUS_OVERRIDE_PACKAGES).filter(([key]) => key !== "vitest"));
1589
+ function managedOverridePackages(usesVitest, usesWebdriverioProvider = false) {
1590
+ const managed = usesVitest ? VITE_PLUS_OVERRIDE_PACKAGES : Object.fromEntries(Object.entries(VITE_PLUS_OVERRIDE_PACKAGES).filter(([key]) => key !== "vitest"));
1591
+ return usesWebdriverioProvider && VITEST_IS_MANAGED_OVERRIDE ? {
1592
+ ...managed,
1593
+ "@vitest/browser": VITEST_VERSION
1594
+ } : managed;
1578
1595
  }
1579
1596
  function projectListsVitestEcosystemDep(pkg) {
1580
1597
  return [
@@ -1724,7 +1741,7 @@ function vitestEcosystemCatalogReferencesPending(pkg, catalogDependencyResolver)
1724
1741
  pkg.optionalDependencies
1725
1742
  ]) {
1726
1743
  if (!dependencies) continue;
1727
- for (const [name, spec] of Object.entries(dependencies)) if (isAlignableVitestEcosystemPackage(name) && spec.startsWith("catalog:") && catalogDependencyResolver(spec, name) !== "4.1.11") return true;
1744
+ for (const [name, spec] of Object.entries(dependencies)) if (isAlignableVitestEcosystemPackage(name) && spec.startsWith("catalog:") && catalogDependencyResolver(spec, name) !== "5.0.1") return true;
1728
1745
  }
1729
1746
  return false;
1730
1747
  }
@@ -1743,6 +1760,37 @@ function collectVitestEcosystemInstallDependencyNames(rootDir, packages) {
1743
1760
  return names;
1744
1761
  }
1745
1762
  //#endregion
1763
+ //#region src/utils/git.ts
1764
+ var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
1765
+ /**
1766
+ * Walk up from `startPath` looking for `.git` (directory or file — submodules
1767
+ * use a `.git` file). Returns the directory that contains `.git`, or `null`.
1768
+ */
1769
+ function findGitRoot(startPath) {
1770
+ let dir = startPath;
1771
+ while (true) {
1772
+ if (fs.existsSync(path.join(dir, ".git"))) return dir;
1773
+ const parent = path.dirname(dir);
1774
+ if (parent === dir) return null;
1775
+ dir = parent;
1776
+ }
1777
+ }
1778
+ async function initGitRepository(cwd) {
1779
+ const result = await runCommandSilently({
1780
+ command: "git",
1781
+ args: ["init"],
1782
+ cwd,
1783
+ envs: process.env
1784
+ });
1785
+ if (result.exitCode !== 0) {
1786
+ log.warn("Failed to initialize git repository");
1787
+ const stderr = result.stderr.toString().trim();
1788
+ if (stderr) log.info(stderr);
1789
+ return false;
1790
+ }
1791
+ return true;
1792
+ }
1793
+ //#endregion
1746
1794
  //#region ../../node_modules/.pnpm/balanced-match@4.0.4/node_modules/balanced-match/dist/esm/index.js
1747
1795
  const balanced = (a, b, str) => {
1748
1796
  const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
@@ -3848,7 +3896,7 @@ var L = class c {
3848
3896
  }
3849
3897
  };
3850
3898
  //#endregion
3851
- //#region ../../node_modules/.pnpm/minipass@7.1.2/node_modules/minipass/dist/esm/index.js
3899
+ //#region ../../node_modules/.pnpm/minipass@7.1.3/node_modules/minipass/dist/esm/index.js
3852
3900
  const proc = typeof process === "object" && process ? process : {
3853
3901
  stdout: null,
3854
3902
  stderr: null
@@ -3943,7 +3991,7 @@ var PipeProxyErrors = class extends Pipe {
3943
3991
  }
3944
3992
  constructor(src, dest, opts) {
3945
3993
  super(src, dest, opts);
3946
- this.proxyErrors = (er) => dest.emit("error", er);
3994
+ this.proxyErrors = (er) => this.dest.emit("error", er);
3947
3995
  src.on("error", this.proxyErrors);
3948
3996
  }
3949
3997
  };
@@ -4582,7 +4630,8 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length);
4582
4630
  return: stop,
4583
4631
  [Symbol.asyncIterator]() {
4584
4632
  return this;
4585
- }
4633
+ },
4634
+ [Symbol.asyncDispose]: async () => {}
4586
4635
  };
4587
4636
  }
4588
4637
  /**
@@ -4622,7 +4671,8 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length);
4622
4671
  return: stop,
4623
4672
  [Symbol.iterator]() {
4624
4673
  return this;
4625
- }
4674
+ },
4675
+ [Symbol.dispose]: () => {}
4626
4676
  };
4627
4677
  }
4628
4678
  /**
@@ -4665,7 +4715,7 @@ while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length);
4665
4715
  }
4666
4716
  };
4667
4717
  //#endregion
4668
- //#region ../../node_modules/.pnpm/path-scurry@2.0.1/node_modules/path-scurry/dist/esm/index.js
4718
+ //#region ../../node_modules/.pnpm/path-scurry@2.0.2/node_modules/path-scurry/dist/esm/index.js
4669
4719
  const realpathSync$2 = realpathSync$1.native;
4670
4720
  const defaultFS = {
4671
4721
  lstatSync: lstatSync$1,
@@ -7402,10 +7452,10 @@ function migratePnpmSettingsToWorkspaceYaml(projectPath, settings) {
7402
7452
  * Rewrite pnpm-workspace.yaml to add vite-plus dependencies
7403
7453
  * @param projectPath - The path to the project
7404
7454
  */
7405
- function rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserBuilds, usesVitest, vitestEcosystemPackages, writeWorkspaceSettings = true, catalogAdditions = /* @__PURE__ */ new Set()) {
7455
+ function rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserBuilds, usesVitest, vitestEcosystemPackages, writeWorkspaceSettings = true, catalogAdditions = /* @__PURE__ */ new Set(), usesWebdriverioProvider = false) {
7406
7456
  const pnpmWorkspaceYamlPath = path.join(projectPath, "pnpm-workspace.yaml");
7407
7457
  if (!fs.existsSync(pnpmWorkspaceYamlPath)) fs.writeFileSync(pnpmWorkspaceYamlPath, "");
7408
- const managed = managedOverridePackages(usesVitest);
7458
+ const managed = managedOverridePackages(usesVitest, usesWebdriverioProvider);
7409
7459
  editYamlFile(pnpmWorkspaceYamlPath, (doc) => {
7410
7460
  const preferredCatalogSpec = rewriteCatalog(doc, usesVitest, vitestEcosystemPackages, catalogAdditions);
7411
7461
  if (!writeWorkspaceSettings) return;
@@ -7420,7 +7470,9 @@ function rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrow
7420
7470
  if (!usesVitest) removeYamlMapVitestEntry(doc.getIn(["overrides"]), "pnpm-ranged");
7421
7471
  for (const key of Object.keys(managed)) {
7422
7472
  const overrideKey = pnpmOverrideKey(key);
7423
- const version = getCatalogDependencySpec(getYamlMapScalarStringValue(overrides, overrideKey) ?? getYamlMapScalarStringValue(overrides, key), managed[key], true, { preferredCatalogSpec });
7473
+ const currentVersion = getYamlMapScalarStringValue(overrides, overrideKey) ?? getYamlMapScalarStringValue(overrides, key);
7474
+ // @vitest/browser is an override-only entry: migration removes its direct
7475
+ const version = key === "@vitest/browser" ? managed[key] : getCatalogDependencySpec(currentVersion, managed[key], true, { preferredCatalogSpec });
7424
7476
  if (overrides instanceof import_dist.YAMLMap) overrides.delete(key);
7425
7477
  doc.setIn(["overrides", scalarString(overrideKey)], scalarString(version));
7426
7478
  }
@@ -7439,14 +7491,14 @@ function rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrow
7439
7491
  }
7440
7492
  if (!usesVitest && VITEST_IS_MANAGED_OVERRIDE) allowAny.items = allowAny.items.filter((n) => n.value !== "vitest");
7441
7493
  const existing = new Set(allowAny.items.map((n) => n.value));
7442
- for (const key of Object.keys(managed)) if (!existing.has(key)) allowAny.add(scalarString(key));
7494
+ for (const key of Object.keys(managedOverridePackages(usesVitest))) if (!existing.has(key)) allowAny.add(scalarString(key));
7443
7495
  doc.setIn(["peerDependencyRules", "allowAny"], allowAny);
7444
7496
  const allowedVersionsNode = doc.getIn(["peerDependencyRules", "allowedVersions"]);
7445
7497
  let allowedVersions;
7446
7498
  if (allowedVersionsNode instanceof import_dist.YAMLMap) allowedVersions = allowedVersionsNode;
7447
7499
  else allowedVersions = new import_dist.YAMLMap();
7448
7500
  if (!usesVitest) removeYamlMapVitestEntry(allowedVersions);
7449
- for (const key of Object.keys(managed)) allowedVersions.set(scalarString(key), scalarString("*"));
7501
+ for (const key of Object.keys(managedOverridePackages(usesVitest))) allowedVersions.set(scalarString(key), scalarString("*"));
7450
7502
  doc.setIn(["peerDependencyRules", "allowedVersions"], allowedVersions);
7451
7503
  if (doc.has("minimumReleaseAge")) {
7452
7504
  let minimumReleaseAgeExclude = doc.getIn(["minimumReleaseAgeExclude"]);
@@ -7520,38 +7572,10 @@ function getCatalogDependencySpec(currentValue, version, supportCatalog, options
7520
7572
  return currentValue?.startsWith("catalog:") ? currentValue : options?.preferredCatalogSpec ?? "catalog:";
7521
7573
  }
7522
7574
  /**
7523
- * #1932: under pnpm, an importer that depends on `vite-plus` (which bundles
7524
- * `vitest`) needs a DIRECT `vite` devDep pointing at @voidzero-dev/vite-plus-core
7525
- * so vitest's required `vite` peer binds to it. Without a direct edge, pnpm's
7526
- * `autoInstallPeers` fabricates a separate upstream `vite` to satisfy the
7527
- * peer, splitting vite-plus / vite / vitest into duplicate instances (the extra
7528
- * vite also lacks vite's `@voidzero-dev/vite-task-client` integration, breaking
7529
- * the `vp test` cache). Under a catalog the edge is a `catalog:` reference and
7530
- * the catalog entry carries the alias; the `vite@*` workspace override covers
7531
- * transitive and peer declarations instead of this one (see `pnpmOverrideKey`).
7532
- * npm/yarn/bun redirect transitive/peer vite via root overrides/resolutions (and
7533
- * drop the aliased vite), so this is pnpm-only, mirroring the bun root-package
7534
- * branch in `rewriteRootWorkspacePackageJson`.
7535
- *
7536
- * A package that already declares `vite` in ANY dependency field, including
7537
- * `peerDependencies` (e.g. a vite plugin pinning `vite ^6`), is left untouched
7538
- * so its existing version contract is preserved. Call this AFTER `vite-plus`
7539
- * has been ensured in the package, so the dependency check sees it.
7540
- */
7541
- function ensureDirectViteForPnpm(pkg, packageManager, supportCatalog, catalogDependencyResolver) {
7542
- const viteOverride = VITE_PLUS_OVERRIDE_PACKAGES.vite;
7543
- if (packageManager !== PackageManager.pnpm || !viteOverride) return false;
7544
- const dependsOnVitePlus = pkg.dependencies?.["vite-plus"] !== void 0 || pkg.devDependencies?.["vite-plus"] !== void 0;
7545
- const viteAlreadyDirect = pkg.dependencies?.vite !== void 0 || pkg.devDependencies?.vite !== void 0 || pkg.optionalDependencies?.vite !== void 0 || pkg.peerDependencies?.vite !== void 0;
7546
- if (!dependsOnVitePlus || viteAlreadyDirect) return false;
7547
- setDirectViteEdge(pkg, supportCatalog, catalogDependencyResolver);
7548
- return true;
7549
- }
7550
- /**
7551
7575
  * Insert (or overwrite) a DIRECT `vite` devDependency edge in SORTED position.
7552
7576
  *
7553
7577
  * Several migration paths need a direct `vite` devDep for different reasons
7554
- * (pnpm peer binding #1932; bun peer pre-resolution oven-sh/bun#8406; npm
7578
+ * (bun peer pre-resolution oven-sh/bun#8406; npm
7555
7579
  * `@vitest/mocker` hoisting for opt-in providers), but they all want the SAME
7556
7580
  * spec and the SAME placement, so both are centralized here. Each caller keeps
7557
7581
  * its OWN gate for WHEN a direct edge is needed; this owns only the spec +
@@ -7759,10 +7783,10 @@ function rewriteCatalogsObject(catalogs, usesVitest, vitestEcosystemPackages) {
7759
7783
  * unlike pnpm which uses pnpm-workspace.yaml.
7760
7784
  * @see https://bun.sh/docs/pm/catalogs
7761
7785
  */
7762
- function rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages) {
7786
+ function rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages, usesWebdriverioProvider = false) {
7763
7787
  const packageJsonPath = path.join(projectPath, "package.json");
7764
7788
  if (!fs.existsSync(packageJsonPath)) return;
7765
- const managed = managedOverridePackages(usesVitest);
7789
+ const managed = managedOverridePackages(usesVitest, usesWebdriverioProvider);
7766
7790
  editJsonFile(packageJsonPath, (pkg) => {
7767
7791
  const workspacesObj = pkg.workspaces && !Array.isArray(pkg.workspaces) ? pkg.workspaces : void 0;
7768
7792
  const useWorkspacesCatalog = workspacesObj?.catalog != null || pkg.catalog == null && workspacesObj?.catalogs != null;
@@ -7796,7 +7820,7 @@ function rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages) {
7796
7820
  for (const [key, value] of Object.entries(managed)) {
7797
7821
  const current = overrides[key];
7798
7822
  if (current !== void 0 && typeof current !== "string") continue;
7799
- overrides[key] = getCatalogDependencySpec(current, value, true);
7823
+ overrides[key] = key === "@vitest/browser" ? value : getCatalogDependencySpec(current, value, true);
7800
7824
  }
7801
7825
  pkg.overrides = overrides;
7802
7826
  return pkg;
@@ -7809,7 +7833,7 @@ function rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages) {
7809
7833
  function rewriteRootWorkspacePackageJson(projectPath, packageManager, skipStagedMigration, catalogDependencyResolver, packages, pnpmMajorVersion, pnpmVersion, shouldAllowBrowserBuilds = false, workspaceUsesVitest = true, supportCatalog = true) {
7810
7834
  const packageJsonPath = path.join(projectPath, "package.json");
7811
7835
  if (!fs.existsSync(packageJsonPath)) return;
7812
- const managed = managedOverridePackages(workspaceUsesVitest);
7836
+ const managed = managedOverridePackages(workspaceUsesVitest, workspaceUsesWebdriverioProvider(projectPath, packages));
7813
7837
  let movedPnpmSettings;
7814
7838
  editJsonFile(packageJsonPath, (pkg) => {
7815
7839
  pruneLegacyWrapperAliases(pkg.resolutions);
@@ -7829,9 +7853,14 @@ function rewriteRootWorkspacePackageJson(projectPath, packageManager, skipStaged
7829
7853
  ...pkg.overrides,
7830
7854
  ...managed
7831
7855
  };
7832
- else if (packageManager === PackageManager.bun) setDirectViteEdge(pkg, true, catalogDependencyResolver);
7833
- else if (packageManager === PackageManager.pnpm) {
7834
- const overrideKeys = Object.keys(managed);
7856
+ else if (packageManager === PackageManager.bun) {
7857
+ if (managed["@vitest/browser"]) pkg.overrides = {
7858
+ ...pkg.overrides,
7859
+ "@vitest/browser": managed["@vitest/browser"]
7860
+ };
7861
+ setDirectViteEdge(pkg, true, catalogDependencyResolver);
7862
+ } else if (packageManager === PackageManager.pnpm) {
7863
+ const overrideKeys = Object.keys(managedOverridePackages(workspaceUsesVitest));
7835
7864
  if (!pnpmSupportsWorkspaceSettings(pnpmVersion ?? "")) {
7836
7865
  dropRemovePackageOverrideKeys(pkg.pnpm?.overrides);
7837
7866
  if (!workspaceUsesVitest) removeManagedVitestEntry(pkg.pnpm?.overrides, "pnpm-ranged");
@@ -7862,7 +7891,6 @@ function rewriteRootWorkspacePackageJson(projectPath, packageManager, skipStaged
7862
7891
  ...pkg.devDependencies,
7863
7892
  [VITE_PLUS_NAME]: packageManager === PackageManager.npm || !supportCatalog || VITE_PLUS_VERSION.startsWith("file:") ? VITE_PLUS_VERSION : catalogDependencyResolver?.preferredCatalogSpec ?? "catalog:"
7864
7893
  };
7865
- ensureDirectViteForPnpm(pkg, packageManager, supportCatalog, catalogDependencyResolver);
7866
7894
  return pkg;
7867
7895
  });
7868
7896
  migratePnpmSettingsToWorkspaceYaml(projectPath, movedPnpmSettings);
@@ -7918,6 +7946,12 @@ function readBunCatalogDependencyResolver(pkg) {
7918
7946
  //#endregion
7919
7947
  //#region src/migration/migrator/yarn.ts
7920
7948
  const WEBDRIVERIO_ALLOW_SIGNAL_DEPS = ["webdriverio", WEBDRIVERIO_PROVIDER];
7949
+ function workspaceUsesWebdriverioProvider(rootDir, packages) {
7950
+ return [rootDir, ...(packages ?? []).map((pkg) => path.join(rootDir, pkg.path))].some((dir) => {
7951
+ const pkg = readPackageJsonIfExists(path.join(dir, "package.json"));
7952
+ return Boolean(pkg && findDeclaredSpec(pkg, "@vitest/browser-webdriverio") || usesWebdriverioProvider(dir));
7953
+ });
7954
+ }
7921
7955
  function hasOwnWebdriverioDependency(pkg) {
7922
7956
  for (const name of WEBDRIVERIO_ALLOW_SIGNAL_DEPS) if (pkg.dependencies?.[name] ?? pkg.devDependencies?.[name] ?? pkg.optionalDependencies?.[name] ?? pkg.peerDependencies?.[name]) return true;
7923
7957
  return false;
@@ -8089,10 +8123,7 @@ const PLAYWRIGHT_PROVIDER_SPECIFIER_HINTS = [
8089
8123
  "vite-plus/test/browser/providers/playwright",
8090
8124
  "vite-plus/test/plugins/browser-playwright"
8091
8125
  ];
8092
- const BROWSER_PROVIDER_SPECIFIER_HINTS = {
8093
- [WEBDRIVERIO_PROVIDER]: WEBDRIVERIO_PROVIDER_SPECIFIER_HINTS,
8094
- [PLAYWRIGHT_PROVIDER]: PLAYWRIGHT_PROVIDER_SPECIFIER_HINTS
8095
- };
8126
+ const BROWSER_PROVIDER_SPECIFIER_HINTS = { [PLAYWRIGHT_PROVIDER]: PLAYWRIGHT_PROVIDER_SPECIFIER_HINTS };
8096
8127
  const VITEST_SCAN_EXTENSIONS = /* @__PURE__ */ new Set([
8097
8128
  ".ts",
8098
8129
  ".mts",
@@ -8114,7 +8145,8 @@ const VITEST_SCAN_SKIP_DIRS = /* @__PURE__ */ new Set([
8114
8145
  ".nuxt",
8115
8146
  ".svelte-kit",
8116
8147
  ".vite",
8117
- ".cache"
8148
+ ".cache",
8149
+ ".yarn"
8118
8150
  ]);
8119
8151
  const OXLINT_RETENTION_SKIP_DIRS = /* @__PURE__ */ new Set([
8120
8152
  "node_modules",
@@ -8161,10 +8193,11 @@ function sourceTreeMatches(projectPath, matchesContent, options = {}) {
8161
8193
  if (entry.isDirectory()) {
8162
8194
  if (skipDirs.has(entry.name)) continue;
8163
8195
  if (scanDir(entryPath, false)) return true;
8164
- } else if (entry.isFile() && (VITEST_SCAN_EXTENSIONS.has(path.extname(entry.name)) || options.includePackageReferences && entry.name === "package.json")) try {
8196
+ } else if (entry.isFile() && ![".pnp.cjs", ".pnp.loader.mjs"].includes(entry.name) && (VITEST_SCAN_EXTENSIONS.has(path.extname(entry.name)) || options.includeExtensionless && path.extname(entry.name) === "" || options.includePackageReferences && entry.name === "package.json")) try {
8165
8197
  let content = fs.readFileSync(entryPath, "utf8");
8166
8198
  if (entry.name === "package.json") {
8167
8199
  const pkg = JSON.parse(content);
8200
+ if (options.matchesPackage?.(dir, pkg)) return true;
8168
8201
  content = JSON.stringify({
8169
8202
  imports: pkg.imports,
8170
8203
  scripts: pkg.scripts
@@ -8224,37 +8257,81 @@ function collectProviderSourceModes(projectPath) {
8224
8257
  return modes;
8225
8258
  }
8226
8259
  /**
8227
- * Check final source, build output, package import aliases, and package scripts.
8260
+ * Check final source, build output, aliases, scripts, and dependency peers.
8228
8261
  * A substring scan conservatively retains references the rewriter leaves alone,
8229
8262
  * including require calls, type references, and strings.
8230
8263
  */
8231
- function sourceTreeReferencesOxlintPluginsPackage(projectPath) {
8264
+ function sourceTreeReferencesOxlintPluginsPackage(projectPath, originalDependencies = collectOxlintDependencyNames(projectPath)) {
8232
8265
  return sourceTreeMatches(projectPath, (content) => content.includes(OXLINT_PLUGINS_PACKAGE), {
8233
8266
  crossPackageBoundaries: true,
8234
8267
  includePackageReferences: true,
8268
+ includeExtensionless: true,
8269
+ matchesPackage: (dir, pkg) => projectListsRequiredOxlintPluginsPeer(dir, pkg, {
8270
+ retainUnknownPeers: originalDependencies.has(dir),
8271
+ originalDependencyNames: originalDependencies.get(dir)
8272
+ }),
8235
8273
  skipDirs: OXLINT_RETENTION_SKIP_DIRS
8236
8274
  });
8237
8275
  }
8276
+ function projectListsRequiredOxlintPluginsPeer(projectPath, pkg, { retainUnknownPeers = true, originalDependencyNames } = {}) {
8277
+ const dependencyNames = collectInstallDependencyNames(pkg);
8278
+ dependencyNames.delete(OXLINT_PLUGINS_PACKAGE);
8279
+ dependencyNames.delete(VITE_PLUS_NAME);
8280
+ dependencyNames.delete("vite");
8281
+ for (const name of dependencyNames) {
8282
+ if (originalDependencyNames && !originalDependencyNames.has(name)) continue;
8283
+ const metadata = detectPackageMetadata(projectPath, name);
8284
+ if (!metadata) {
8285
+ if (retainUnknownPeers) return true;
8286
+ continue;
8287
+ }
8288
+ try {
8289
+ const installedPkg = readJsonFile(path.join(metadata.path, "package.json"));
8290
+ if (typeof installedPkg.peerDependencies?.["@oxlint/plugins"] === "string" && installedPkg.peerDependenciesMeta?.["@oxlint/plugins"]?.optional !== true) return true;
8291
+ } catch {
8292
+ if (retainUnknownPeers) return true;
8293
+ }
8294
+ }
8295
+ return false;
8296
+ }
8297
+ function collectInstallDependencyNames(pkg) {
8298
+ return /* @__PURE__ */ new Set([
8299
+ ...Object.keys(pkg?.dependencies ?? {}),
8300
+ ...Object.keys(pkg?.devDependencies ?? {}),
8301
+ ...Object.keys(pkg?.optionalDependencies ?? {})
8302
+ ]);
8303
+ }
8304
+ function collectOxlintDependencyNames(rootDir, packages) {
8305
+ const names = /* @__PURE__ */ new Map();
8306
+ for (const dir of [rootDir, ...(packages ?? []).map((pkg) => path.join(rootDir, pkg.path))]) {
8307
+ const pkg = readPackageJsonIfExists(path.join(dir, "package.json"));
8308
+ names.set(dir, collectInstallDependencyNames(pkg));
8309
+ }
8310
+ return names;
8311
+ }
8238
8312
  /**
8239
8313
  * Drop `@oxlint/plugins` from devDependencies once nothing names it any more.
8240
8314
  *
8241
8315
  * Runs AFTER the import rewrite, so the scan sees final source. Skips a package
8242
8316
  * that owns the API as a runtime or peer dependency, and skips any package
8243
- * whose source or build output still names it.
8317
+ * whose source, build output, or installed dependencies still require it.
8244
8318
  */
8245
- function dropDeadOxlintPluginsDependency(rootDir, packages) {
8319
+ function dropDeadOxlintPluginsDependency(rootDir, packages, originalDependencies = collectOxlintDependencyNames(rootDir, packages)) {
8320
+ let changed = false;
8246
8321
  const dirs = [rootDir, ...(packages ?? []).map((pkg) => path.join(rootDir, pkg.path))];
8247
8322
  for (const dir of dirs) {
8248
8323
  const packageJsonPath = path.join(dir, "package.json");
8249
8324
  const pkg = readPackageJsonIfExists(packageJsonPath);
8250
8325
  if (pkg?.devDependencies?.["@oxlint/plugins"] === void 0) continue;
8251
- if (packageOwnsOxlintApi(pkg) || sourceTreeReferencesOxlintPluginsPackage(dir)) continue;
8326
+ if (packageOwnsOxlintApi(pkg) || sourceTreeReferencesOxlintPluginsPackage(dir, originalDependencies)) continue;
8252
8327
  editJsonFile(packageJsonPath, (json) => {
8253
8328
  if (json.devDependencies?.["@oxlint/plugins"] === void 0) return;
8254
8329
  delete json.devDependencies[OXLINT_PLUGINS_PACKAGE];
8330
+ changed = true;
8255
8331
  return json;
8256
8332
  });
8257
8333
  }
8334
+ return changed;
8258
8335
  }
8259
8336
  //#endregion
8260
8337
  //#region src/migration/migrator/vite-plus-bootstrap.ts
@@ -8267,6 +8344,7 @@ function isSemanticVitePlusOverrideSpec(dependencyName, spec) {
8267
8344
  if (!spec) return false;
8268
8345
  if (isLegacyWrapperSpec(spec)) return false;
8269
8346
  if (spec === VITE_PLUS_OVERRIDE_PACKAGES[dependencyName]) return true;
8347
+ if (dependencyName === "@vitest/browser" && spec === "5.0.1") return true;
8270
8348
  return false;
8271
8349
  }
8272
8350
  function overrideSpecSatisfiesVitePlus(dependencyName, spec, catalogDependencyResolver) {
@@ -8275,8 +8353,8 @@ function overrideSpecSatisfiesVitePlus(dependencyName, spec, catalogDependencyRe
8275
8353
  if (!spec.startsWith("catalog:")) return false;
8276
8354
  return isSemanticVitePlusOverrideSpec(dependencyName, catalogDependencyResolver?.(spec, dependencyName));
8277
8355
  }
8278
- function overridesSatisfyVitePlus(overrides, usesVitest, catalogDependencyResolver, keyStyle = "bare") {
8279
- const managed = managedOverridePackages(usesVitest);
8356
+ function overridesSatisfyVitePlus(overrides, usesVitest, catalogDependencyResolver, keyStyle = "bare", usesWebdriverioProvider = false) {
8357
+ const managed = managedOverridePackages(usesVitest, usesWebdriverioProvider);
8280
8358
  if (!usesVitest && VITEST_IS_MANAGED_OVERRIDE && (typeof overrides?.vitest === "string" || keyStyle === "pnpm-ranged" && typeof overrides?.[pnpmOverrideKey("vitest")] === "string")) return false;
8281
8359
  if (keyStyle === "pnpm-ranged" && Object.keys(managed).some((dependencyName) => typeof overrides?.[dependencyName] === "string")) return false;
8282
8360
  return Object.keys(managed).every((dependencyName) => overrideSpecSatisfiesVitePlus(dependencyName, overrides?.[managedOverrideKey(dependencyName, keyStyle)], catalogDependencyResolver));
@@ -8398,7 +8476,7 @@ function reconcileVitePlusBootstrapPackage(projectPath, pkg, vitePlusVersion, pa
8398
8476
  const frameworkPeer = BROWSER_PROVIDER_PEER_DEPS[provider];
8399
8477
  if (!hasProviderPeerDependency(pkg, frameworkPeer)) {
8400
8478
  pkg.devDependencies ??= {};
8401
- pkg.devDependencies[frameworkPeer] = resolveProviderPeerSpec(pkg, frameworkPeer, supportCatalog, catalogDependencyResolver);
8479
+ pkg.devDependencies[frameworkPeer] = resolveProviderPeerSpec(frameworkPeer, supportCatalog, catalogDependencyResolver);
8402
8480
  }
8403
8481
  }
8404
8482
  for (const bundledPackage of REMOVE_PACKAGES) for (const dependencies of installGroups) if (dependencies?.[bundledPackage] !== void 0) delete dependencies[bundledPackage];
@@ -8419,7 +8497,6 @@ function reconcileVitePlusBootstrapPackage(projectPath, pkg, vitePlusVersion, pa
8419
8497
  pkg.devDependencies.vitest = getCatalogDependencySpec(void 0, VITEST_VERSION, supportCatalog, { preferredCatalogSpec: catalogDependencyResolver?.preferredCatalogSpec });
8420
8498
  }
8421
8499
  } else for (const dependencies of installGroups) removeManagedVitestEntry(dependencies);
8422
- ensureDirectViteForPnpm(pkg, packageManager, supportCatalog, catalogDependencyResolver);
8423
8500
  return before !== JSON.stringify(pkg);
8424
8501
  }
8425
8502
  function bootstrapProjectPaths(rootDir, packages) {
@@ -8493,17 +8570,18 @@ function detectVitePlusBootstrapPending(projectPath, packageManager, packages, p
8493
8570
  if (reconcileVitePlusBootstrapPackage(packagePath, JSON.parse(JSON.stringify(childPkg)), canonicalVitePlusSpec, packageManager, supportCatalog, index === 0, catalogDependencyResolver, providerCatalogAdditions)) return true;
8494
8571
  }
8495
8572
  const usesVitest = workspaceUsesVitestDirectly(projectPath, packages, true);
8496
- if (packageManager === PackageManager.yarn) return !overridesSatisfyVitePlus(pkg.resolutions, usesVitest) || !yarnrcSatisfiesVitePlus(projectPath, usesVitest, supportCatalog) || yarnWorkspaceHoistingOptOutPending(projectPath, packageManager, packages);
8497
- if (packageManager === PackageManager.npm) return vitePlusDependencyNeedsConcreteVersion(pkg) || !overridesSatisfyVitePlus(pkg.overrides, usesVitest) || npmVitePlusManagedDependenciesPending(pkg, usesVitest);
8498
- if (packageManager === PackageManager.bun) return !overridesSatisfyVitePlus(pkg.overrides, usesVitest, supportCatalog ? readBunCatalogDependencyResolver(pkg) : void 0);
8573
+ const usesWebdriverio = workspaceUsesWebdriverioProvider(projectPath, packages);
8574
+ if (packageManager === PackageManager.yarn) return !overridesSatisfyVitePlus(pkg.resolutions, usesVitest, void 0, "bare", usesWebdriverio) || !yarnrcSatisfiesVitePlus(projectPath, usesVitest, supportCatalog) || yarnWorkspaceHoistingOptOutPending(projectPath, packageManager, packages);
8575
+ if (packageManager === PackageManager.npm) return vitePlusDependencyNeedsConcreteVersion(pkg) || !overridesSatisfyVitePlus(pkg.overrides, usesVitest, void 0, "bare", usesWebdriverio) || npmVitePlusManagedDependenciesPending(pkg, usesVitest);
8576
+ if (packageManager === PackageManager.bun) return !overridesSatisfyVitePlus(pkg.overrides, usesVitest, supportCatalog ? readBunCatalogDependencyResolver(pkg) : void 0, "bare", usesWebdriverio);
8499
8577
  if (packageManager === PackageManager.pnpm) {
8500
8578
  if (!pnpmWorkspaceExoticSubdepsSettingSatisfied(projectPath)) return true;
8501
8579
  if (!usePnpmWorkspaceYaml) {
8502
- if (supportCatalog) return catalogVitePlusDependencyPending(pkg, catalogDependencyResolver) || !overridesSatisfyVitePlus(pkg.pnpm?.overrides, usesVitest, catalogDependencyResolver, "pnpm-ranged") || !pnpmPeerDependencyRulesSatisfyVitePlus(pkg.pnpm?.peerDependencyRules, usesVitest);
8503
- return vitePlusDependencyNeedsConcreteVersion(pkg) || !overridesSatisfyVitePlus(pkg.pnpm?.overrides, usesVitest, void 0, "pnpm-ranged") || !pnpmPeerDependencyRulesSatisfyVitePlus(pkg.pnpm?.peerDependencyRules, usesVitest);
8580
+ if (supportCatalog) return catalogVitePlusDependencyPending(pkg, catalogDependencyResolver) || !overridesSatisfyVitePlus(pkg.pnpm?.overrides, usesVitest, catalogDependencyResolver, "pnpm-ranged", usesWebdriverio) || !pnpmPeerDependencyRulesSatisfyVitePlus(pkg.pnpm?.peerDependencyRules, usesVitest);
8581
+ return vitePlusDependencyNeedsConcreteVersion(pkg) || !overridesSatisfyVitePlus(pkg.pnpm?.overrides, usesVitest, void 0, "pnpm-ranged", usesWebdriverio) || !pnpmPeerDependencyRulesSatisfyVitePlus(pkg.pnpm?.peerDependencyRules, usesVitest);
8504
8582
  }
8505
8583
  const resolver = readPnpmWorkspaceCatalogDependencyResolver(projectPath);
8506
- return workspaceCatalogVitePlusDependencyPending(projectPath, packages, resolver) || !overridesSatisfyVitePlus(readPnpmWorkspaceOverrides(projectPath), usesVitest, resolver, "pnpm-ranged") || !pnpmPeerDependencyRulesSatisfyVitePlus(readPnpmWorkspacePeerDependencyRules(projectPath), usesVitest) || pnpmWorkspaceMinimumReleaseAgeExemptionsPending(projectPath);
8584
+ return workspaceCatalogVitePlusDependencyPending(projectPath, packages, resolver) || !overridesSatisfyVitePlus(readPnpmWorkspaceOverrides(projectPath), usesVitest, resolver, "pnpm-ranged", usesWebdriverio) || !pnpmPeerDependencyRulesSatisfyVitePlus(readPnpmWorkspacePeerDependencyRules(projectPath), usesVitest) || pnpmWorkspaceMinimumReleaseAgeExemptionsPending(projectPath);
8507
8585
  }
8508
8586
  return false;
8509
8587
  }
@@ -8542,11 +8620,11 @@ function ensureVitePlusDependencySpecs(pkg, version, ensurePresent = true) {
8542
8620
  function readTextFileIfExists(filePath) {
8543
8621
  return fs.existsSync(filePath) ? fs.readFileSync(filePath, "utf-8") : void 0;
8544
8622
  }
8545
- function ensureOverrideEntries(overrides, usesVitest, catalogDependencyResolver, keyStyle = "bare") {
8623
+ function ensureOverrideEntries(overrides, usesVitest, catalogDependencyResolver, keyStyle = "bare", usesWebdriverioProvider = false) {
8546
8624
  const next = { ...overrides };
8547
8625
  let changed = false;
8548
8626
  if (!usesVitest && removeManagedVitestEntry(next, keyStyle)) changed = true;
8549
- for (const [dependencyName, overrideSpec] of Object.entries(managedOverridePackages(usesVitest))) {
8627
+ for (const [dependencyName, overrideSpec] of Object.entries(managedOverridePackages(usesVitest, usesWebdriverioProvider))) {
8550
8628
  const overrideKey = managedOverrideKey(dependencyName, keyStyle);
8551
8629
  if (overrideKey !== dependencyName && next[dependencyName] !== void 0) {
8552
8630
  next[overrideKey] ??= next[dependencyName];
@@ -8597,6 +8675,7 @@ function ensureVitePlusBootstrap(workspaceInfo, report) {
8597
8675
  };
8598
8676
  if (!fs.existsSync(packageJsonPath)) return result;
8599
8677
  const usesVitest = workspaceUsesVitestDirectly(projectPath, workspaceInfo.packages, true);
8678
+ const usesWebdriverio = workspaceUsesWebdriverioProvider(projectPath, workspaceInfo.packages);
8600
8679
  const pnpmMajorVersion = pnpmMajor(workspaceInfo.downloadPackageManager.version);
8601
8680
  const shouldAllowBrowserBuilds = workspaceUsesWebdriverio(projectPath, workspaceInfo.packages);
8602
8681
  const usePnpmWorkspaceYaml = workspaceInfo.packageManager === PackageManager.pnpm && pnpmSupportsWorkspaceSettings(workspaceInfo.downloadPackageManager.version);
@@ -8612,31 +8691,31 @@ function ensureVitePlusBootstrap(workspaceInfo, report) {
8612
8691
  let pnpmWorkspaceCatalogBefore;
8613
8692
  if (workspaceInfo.packageManager === PackageManager.pnpm && !usePnpmWorkspaceYaml) {
8614
8693
  pnpmWorkspaceCatalogBefore = readTextFileIfExists(pnpmWorkspaceYamlPath);
8615
- if (supportCatalog) rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserBuilds, usesVitest, vitestEcosystemPackages, false, providerCatalogAdditions);
8694
+ if (supportCatalog) rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserBuilds, usesVitest, vitestEcosystemPackages, false, providerCatalogAdditions, usesWebdriverio);
8616
8695
  }
8617
8696
  editJsonFile(packageJsonPath, (pkg) => {
8618
8697
  let packageJsonChanged = reconcileVitePlusBootstrapPackage(projectPath, pkg, canonicalVitePlusSpec, workspaceInfo.packageManager, supportCatalog, true, catalogDependencyResolver, providerCatalogAdditions);
8619
8698
  if (workspaceInfo.packageManager === PackageManager.yarn) {
8620
- const ensured = ensureOverrideEntries(pkg.resolutions, usesVitest);
8699
+ const ensured = ensureOverrideEntries(pkg.resolutions, usesVitest, void 0, "bare", usesWebdriverio);
8621
8700
  if (ensured.changed) {
8622
8701
  pkg.resolutions = ensured.overrides;
8623
8702
  packageJsonChanged = true;
8624
8703
  }
8625
8704
  } else if (workspaceInfo.packageManager === PackageManager.npm) {
8626
- const ensured = ensureOverrideEntries(pkg.overrides, usesVitest);
8705
+ const ensured = ensureOverrideEntries(pkg.overrides, usesVitest, void 0, "bare", usesWebdriverio);
8627
8706
  if (ensured.changed) {
8628
8707
  pkg.overrides = ensured.overrides;
8629
8708
  packageJsonChanged = true;
8630
8709
  }
8631
8710
  } else if (workspaceInfo.packageManager === PackageManager.bun) {
8632
- const ensured = ensureOverrideEntries(pkg.overrides, usesVitest, supportCatalog ? readBunCatalogDependencyResolver(pkg) : void 0);
8711
+ const ensured = ensureOverrideEntries(pkg.overrides, usesVitest, supportCatalog ? readBunCatalogDependencyResolver(pkg) : void 0, "bare", usesWebdriverio);
8633
8712
  if (ensured.changed) {
8634
8713
  pkg.overrides = ensured.overrides;
8635
8714
  packageJsonChanged = true;
8636
8715
  }
8637
8716
  } else if (workspaceInfo.packageManager === PackageManager.pnpm && !usePnpmWorkspaceYaml) {
8638
8717
  pkg.pnpm ??= {};
8639
- const ensured = ensureOverrideEntries(pkg.pnpm.overrides, usesVitest, supportCatalog ? readPnpmWorkspaceCatalogDependencyResolver(projectPath) : void 0, "pnpm-ranged");
8718
+ const ensured = ensureOverrideEntries(pkg.pnpm.overrides, usesVitest, supportCatalog ? readPnpmWorkspaceCatalogDependencyResolver(projectPath) : void 0, "pnpm-ranged", usesWebdriverio);
8640
8719
  if (ensured.changed) {
8641
8720
  pkg.pnpm.overrides = ensured.overrides;
8642
8721
  packageJsonChanged = true;
@@ -8675,7 +8754,7 @@ function ensureVitePlusBootstrap(workspaceInfo, report) {
8675
8754
  const before = readTextFileIfExists(pnpmWorkspaceYamlPath);
8676
8755
  migratePnpmSettingsToWorkspaceYaml(projectPath, movedPnpmSettings);
8677
8756
  const catalogDependencyResolver = readPnpmWorkspaceCatalogDependencyResolver(projectPath);
8678
- if (movedPnpmSettings !== void 0 || result.packageJson || ecosystemCatalogReferencesPending || !pnpmWorkspaceExoticSubdepsSettingSatisfied(projectPath) || pnpmWorkspaceMinimumReleaseAgeExemptionsPending(projectPath) || workspaceCatalogVitePlusDependencyPending(projectPath, workspaceInfo.packages, catalogDependencyResolver) || !overridesSatisfyVitePlus(readPnpmWorkspaceOverrides(projectPath), usesVitest, catalogDependencyResolver, "pnpm-ranged") || !pnpmPeerDependencyRulesSatisfyVitePlus(readPnpmWorkspacePeerDependencyRules(projectPath), usesVitest)) rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserBuilds, usesVitest, vitestEcosystemPackages, true, providerCatalogAdditions);
8757
+ if (movedPnpmSettings !== void 0 || result.packageJson || ecosystemCatalogReferencesPending || !pnpmWorkspaceExoticSubdepsSettingSatisfied(projectPath) || pnpmWorkspaceMinimumReleaseAgeExemptionsPending(projectPath) || workspaceCatalogVitePlusDependencyPending(projectPath, workspaceInfo.packages, catalogDependencyResolver) || !overridesSatisfyVitePlus(readPnpmWorkspaceOverrides(projectPath), usesVitest, catalogDependencyResolver, "pnpm-ranged", usesWebdriverio) || !pnpmPeerDependencyRulesSatisfyVitePlus(readPnpmWorkspacePeerDependencyRules(projectPath), usesVitest)) rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserBuilds, usesVitest, vitestEcosystemPackages, true, providerCatalogAdditions, usesWebdriverio);
8679
8758
  if (fs.existsSync(pnpmWorkspaceYamlPath)) ensurePnpmWorkspacePackages(projectPath, workspaceInfo.workspacePatterns);
8680
8759
  result.packageManagerConfig = before !== readTextFileIfExists(pnpmWorkspaceYamlPath);
8681
8760
  } else {
@@ -8691,7 +8770,7 @@ function ensureVitePlusBootstrap(workspaceInfo, report) {
8691
8770
  result.packageManagerConfig = before !== fs.readFileSync(yarnrcYmlPath, "utf-8");
8692
8771
  } else if (isBunWorkspace) {
8693
8772
  const before = fs.readFileSync(packageJsonPath, "utf-8");
8694
- rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages);
8773
+ rewriteBunCatalog(projectPath, usesVitest, vitestEcosystemPackages, usesWebdriverio);
8695
8774
  const after = fs.readFileSync(packageJsonPath, "utf-8");
8696
8775
  result.packageJson = result.packageJson || before !== after;
8697
8776
  }
@@ -8890,7 +8969,7 @@ function rewritePackageJson(pkg, packageManager, isMonorepo, skipStagedMigration
8890
8969
  const peer = BROWSER_PROVIDER_PEER_DEPS[provider];
8891
8970
  if (!hasProviderPeerDependency(pkg, peer)) {
8892
8971
  pkg.devDependencies ??= {};
8893
- pkg.devDependencies[peer] = resolveProviderPeerSpec(pkg, peer, supportCatalog, catalogDependencyResolver);
8972
+ pkg.devDependencies[peer] = resolveProviderPeerSpec(peer, supportCatalog, catalogDependencyResolver);
8894
8973
  }
8895
8974
  needVitePlus = true;
8896
8975
  }
@@ -8922,7 +9001,6 @@ function rewritePackageJson(pkg, packageManager, isMonorepo, skipStagedMigration
8922
9001
  ...pkg.devDependencies,
8923
9002
  [VITE_PLUS_NAME]: canonicalVitePlusSpec
8924
9003
  };
8925
- ensureDirectViteForPnpm(pkg, packageManager, supportCatalog, catalogDependencyResolver);
8926
9004
  if (needDirectVitest) {
8927
9005
  if (!{
8928
9006
  ...pkg.dependencies,
@@ -8990,7 +9068,7 @@ function rewriteLintStagedConfigFile(projectPath, report) {
8990
9068
  warnMigration(`${displayRelative(configPath)} — please migrate to "staged" in vite.config.ts manually`, report);
8991
9069
  hasUnsupported = true;
8992
9070
  }
8993
- if (hasUnsupported) infoMigration("Only \"staged\" in vite.config.ts is supported. See https://viteplus.dev/guide/migrate#lint-staged", report);
9071
+ if (hasUnsupported) infoMigration(`Only "staged" in vite.config.ts is supported. See ${documentationUrl$1("/guide/migrate#lint-staged")}`, report);
8994
9072
  }
8995
9073
  /**
8996
9074
  * Ensure vite.config.ts exists, create it if not
@@ -9028,7 +9106,7 @@ function mergeTsdownConfigFile(projectPath, silent = false, report) {
9028
9106
  const tsdownRelativePath = `./${configs.tsdownConfig}`;
9029
9107
  if (hasConfigKey(fullViteConfigPath, "pack")) {
9030
9108
  const viteConfigContent = fs.readFileSync(fullViteConfigPath, "utf8");
9031
- if (![tsdownRelativePath, tsdownRelativePath.replace(/\.mts$/, ".mjs").replace(/\.cts$/, ".cjs").replace(/\.ts$/, ".js")].some((importPath) => viteConfigContent.includes(`from '${importPath}'`) || viteConfigContent.includes(`from "${importPath}"`))) infoMigration(`Please manually merge ${displayRelative(fullTsdownConfigPath)} into ${displayRelative(fullViteConfigPath)}, see https://viteplus.dev/guide/migrate#tsdown`, report);
9109
+ if (![tsdownRelativePath, tsdownRelativePath.replace(/\.mts$/, ".mjs").replace(/\.cts$/, ".cjs").replace(/\.ts$/, ".js")].some((importPath) => viteConfigContent.includes(`from '${importPath}'`) || viteConfigContent.includes(`from "${importPath}"`))) infoMigration(`Please manually merge ${displayRelative(fullTsdownConfigPath)} into ${displayRelative(fullViteConfigPath)}, see ${documentationUrl$1("/guide/migrate#tsdown")}`, report);
9032
9110
  return false;
9033
9111
  }
9034
9112
  const result = mergeTsdownConfig(fullViteConfigPath, tsdownRelativePath);
@@ -9037,7 +9115,7 @@ function mergeTsdownConfigFile(projectPath, silent = false, report) {
9037
9115
  if (report) report.tsdownImportCount++;
9038
9116
  if (!silent) log.success(`✔ Added import for ${displayRelative(fullTsdownConfigPath)} in ${displayRelative(fullViteConfigPath)}`);
9039
9117
  }
9040
- infoMigration(`Please manually merge ${displayRelative(fullTsdownConfigPath)} into ${displayRelative(fullViteConfigPath)}, see https://viteplus.dev/guide/migrate#tsdown`, report);
9118
+ infoMigration(`Please manually merge ${displayRelative(fullTsdownConfigPath)} into ${displayRelative(fullViteConfigPath)}, see ${documentationUrl$1("/guide/migrate#tsdown")}`, report);
9041
9119
  return createdViteConfig || result.updated;
9042
9120
  }
9043
9121
  /**
@@ -9121,7 +9199,7 @@ function mergeAndRemoveJsonConfig(projectPath, viteConfigPath, jsonConfigPath, c
9121
9199
  if (!silent) log.success(`✔ Merged ${displayRelative(fullJsonConfigPath)} into ${displayRelative(fullViteConfigPath)}`);
9122
9200
  } else {
9123
9201
  warnMigration(`Failed to merge ${displayRelative(fullJsonConfigPath)} into ${displayRelative(fullViteConfigPath)}`, report);
9124
- infoMigration("Please complete the merge manually and follow the instructions in the documentation: https://viteplus.dev/config/", report);
9202
+ infoMigration(`Please complete the merge manually and follow the instructions in the documentation: ${documentationUrl$1("/config/")}`, report);
9125
9203
  }
9126
9204
  }
9127
9205
  /**
@@ -9146,7 +9224,7 @@ function mergeStagedConfigToViteConfig(projectPath, stagedConfig, silent = false
9146
9224
  return true;
9147
9225
  } else {
9148
9226
  warnMigration(`Failed to merge staged config into ${displayRelative(fullViteConfigPath)}`, report);
9149
- infoMigration(`Please add staged config to ${displayRelative(fullViteConfigPath)} manually, see https://viteplus.dev/guide/migrate#lint-staged`, report);
9227
+ infoMigration(`Please add staged config to ${displayRelative(fullViteConfigPath)} manually, see ${documentationUrl$1("/guide/migrate#lint-staged")}`, report);
9150
9228
  return false;
9151
9229
  }
9152
9230
  }
@@ -9175,6 +9253,29 @@ function wrapLazyPluginsInViteConfig(projectPath, silent = false, report) {
9175
9253
  if (!silent) log.success(`✔ Wrapped inline Vite plugins with lazyPlugins in ${displayRelative(viteConfigPath)}`);
9176
9254
  }
9177
9255
  /**
9256
+ * Move `env`, `untrackedEnv`, `input`, and `output` from the top level of
9257
+ * each `run.tasks` entry into its `cache` object, as Vite Task requires.
9258
+ * Tasks that need manual changes are warned about, or collected into
9259
+ * `manualWarnings` when the caller reports them later.
9260
+ */
9261
+ function migrateTaskCacheConfigInViteConfig(projectPath, silent = false, report, manualWarnings) {
9262
+ const configs = detectConfigs(projectPath);
9263
+ if (!configs.viteConfig) return false;
9264
+ const viteConfigPath = path.join(projectPath, configs.viteConfig);
9265
+ const result = migrateTaskCacheConfig(viteConfigPath);
9266
+ if (result.manualTasks.length > 0) {
9267
+ const tasks = result.manualTasks.map((task) => `\`${task}\``).join(", ");
9268
+ const warning = `${displayRelative(viteConfigPath)}: Move \`env\`, \`untrackedEnv\`, \`input\`, and \`output\` under \`cache\` manually in ${result.manualTasks.length === 1 ? "task" : "tasks"} ${tasks}; ${result.manualTasks.length === 1 ? "it was" : "they were"} left unchanged. See ${documentationUrl$1("/config/run#cache")}`;
9269
+ if (manualWarnings) manualWarnings.push(warning);
9270
+ else warnMigration(warning, report);
9271
+ }
9272
+ if (!result.updated) return false;
9273
+ fs.writeFileSync(viteConfigPath, result.content);
9274
+ if (report) report.migratedTaskCacheConfigCount++;
9275
+ if (!silent) log.success(`✔ Moved task cache settings under \`cache\` in ${displayRelative(viteConfigPath)}`);
9276
+ return true;
9277
+ }
9278
+ /**
9178
9279
  * Rewrite imports in all TypeScript/JavaScript files under a directory
9179
9280
  * This rewrites vite/vitest imports to @voidzero-dev/vite-plus
9180
9281
  * @param projectPath - The root directory to search for files
@@ -9207,37 +9308,6 @@ function rewriteAllImports(projectPath, silent = false, report, preserveNuxtVite
9207
9308
  return modified > 0;
9208
9309
  }
9209
9310
  //#endregion
9210
- //#region src/utils/git.ts
9211
- var import_cross_spawn = /* @__PURE__ */ __toESM(require_cross_spawn(), 1);
9212
- /**
9213
- * Walk up from `startPath` looking for `.git` (directory or file — submodules
9214
- * use a `.git` file). Returns the directory that contains `.git`, or `null`.
9215
- */
9216
- function findGitRoot(startPath) {
9217
- let dir = startPath;
9218
- while (true) {
9219
- if (fs.existsSync(path.join(dir, ".git"))) return dir;
9220
- const parent = path.dirname(dir);
9221
- if (parent === dir) return null;
9222
- dir = parent;
9223
- }
9224
- }
9225
- async function initGitRepository(cwd) {
9226
- const result = await runCommandSilently({
9227
- command: "git",
9228
- args: ["init"],
9229
- cwd,
9230
- envs: process.env
9231
- });
9232
- if (result.exitCode !== 0) {
9233
- log.warn("Failed to initialize git repository");
9234
- const stderr = result.stderr.toString().trim();
9235
- if (stderr) log.info(stderr);
9236
- return false;
9237
- }
9238
- return true;
9239
- }
9240
- //#endregion
9241
9311
  //#region src/migration/migrator/git-hooks.ts
9242
9312
  const OTHER_HOOK_TOOLS = [
9243
9313
  "simple-git-hooks",
@@ -9334,7 +9404,7 @@ function preflightGitHooksSetup(projectPath, _packageManager, packages = []) {
9334
9404
  const configuredHooksPath = gitRoot ? getConfiguredHooksPath(projectPath) : "";
9335
9405
  const normalizedHooksPath = normalizeGitHooksPath(configuredHooksPath);
9336
9406
  if (hasHuskySetup(projectPath, pkgContent) || normalizedHooksPath === ".husky" || normalizedHooksPath.startsWith(".husky/")) return "Detected Husky — leaving its hooks, configuration, and dependencies unchanged. Migrate Husky manually before enabling Vite+ hooks.";
9337
- for (const tool of OTHER_HOOK_TOOLS) if (deps?.[tool] || prodDeps?.[tool] || pkgContent[tool]) return `Detected ${tool} — skipping git hooks setup. Please configure git hooks manually, see https://viteplus.dev/guide/migrate#git-hook-tools`;
9407
+ for (const tool of OTHER_HOOK_TOOLS) if (deps?.[tool] || prodDeps?.[tool] || pkgContent[tool]) return `Detected ${tool} — skipping git hooks setup. Please configure git hooks manually, see ${documentationUrl$1("/guide/migrate#git-hook-tools")}`;
9338
9408
  const workspacePackageReason = findWorkspacePackageHookPolicy(projectPath, packages);
9339
9409
  if (workspacePackageReason) return workspacePackageReason;
9340
9410
  const disabledHooksEnvironment = [
@@ -9687,15 +9757,20 @@ function detectPendingCoreMigration(workspaceInfo) {
9687
9757
  function finalizeCoreMigrationForExistingVitePlus(workspaceInfo, silent = false, report, pending = detectPendingCoreMigration(workspaceInfo)) {
9688
9758
  const projectPaths = getCoreMigrationProjectPaths(workspaceInfo);
9689
9759
  const result = {
9760
+ dependencies: false,
9690
9761
  scripts: false,
9691
9762
  tsconfigTypes: false,
9692
9763
  imports: false,
9693
- tsdownConfig: false
9764
+ tsdownConfig: false,
9765
+ taskCacheConfig: false,
9766
+ taskCacheWarnings: []
9694
9767
  };
9695
9768
  if (pending.scripts) for (const projectPath of projectPaths) result.scripts = rewriteCorePackageScripts(projectPath) || result.scripts;
9696
9769
  if (pending.tsconfigTypes) for (const projectPath of projectPaths) result.tsconfigTypes = rewriteTsconfigTypes(projectPath, silent, report) || result.tsconfigTypes;
9697
9770
  result.imports = rewriteAllImports(workspaceInfo.rootDir, silent, report, true);
9771
+ result.dependencies = dropDeadOxlintPluginsDependency(workspaceInfo.rootDir, workspaceInfo.packages);
9698
9772
  for (const projectPath of projectPaths) result.tsdownConfig = mergeTsdownConfigFile(projectPath, silent, report) || result.tsdownConfig;
9773
+ for (const projectPath of projectPaths) result.taskCacheConfig = migrateTaskCacheConfigInViteConfig(projectPath, silent, report, result.taskCacheWarnings) || result.taskCacheConfig;
9699
9774
  return result;
9700
9775
  }
9701
9776
  //#endregion
@@ -9707,7 +9782,9 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
9707
9782
  const catalogDependencyResolver = createCatalogDependencyResolver(projectPath, packageManager);
9708
9783
  const vitestEcosystemPackages = collectVitestEcosystemInstallDependencyNames(projectPath);
9709
9784
  const oxlintOwnerDirs = collectOxlintOwnerDirs(projectPath, workspaceInfo.packages);
9785
+ const originalOxlintDependencies = collectOxlintDependencyNames(projectPath, workspaceInfo.packages);
9710
9786
  const providerSourceModes = collectProviderSourceModes(projectPath);
9787
+ const usesWebdriverio = workspaceUsesWebdriverioProvider(projectPath);
9711
9788
  const browserMode = usesVitestBrowserMode(projectPath);
9712
9789
  const retainedVitestModule = sourceTreeReferencesRetainedVitestModule(projectPath);
9713
9790
  const providerCatalogAdditions = collectInjectedProviderNames(projectPath, void 0, /* @__PURE__ */ new Map([[projectPath, providerSourceModes]]));
@@ -9726,7 +9803,7 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
9726
9803
  browserMode,
9727
9804
  retainedModule: retainedVitestModule
9728
9805
  });
9729
- const managed = managedOverridePackages(usesVitest);
9806
+ const managed = managedOverridePackages(usesVitest, usesWebdriverio);
9730
9807
  pruneLegacyWrapperAliases(pkg.resolutions);
9731
9808
  pruneLegacyWrapperAliases(pkg.overrides);
9732
9809
  pruneLegacyWrapperAliases(pkg.pnpm?.overrides);
@@ -9748,7 +9825,7 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
9748
9825
  if (packageManager === PackageManager.bun) setDirectViteEdge(pkg, supportCatalog, catalogDependencyResolver);
9749
9826
  } else if (packageManager === PackageManager.pnpm) {
9750
9827
  if (usePnpmWorkspaceYaml) shouldAddPnpmWorkspaceVitePlusOverride = isForceOverrideMode();
9751
- const overrideKeys = Object.keys(managed);
9828
+ const overrideKeys = Object.keys(managedOverridePackages(usesVitest));
9752
9829
  if (!usePnpmWorkspaceYaml) {
9753
9830
  dropRemovePackageOverrideKeys(pkg.pnpm?.overrides);
9754
9831
  if (!usesVitest) {
@@ -9785,11 +9862,10 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
9785
9862
  [VITE_PLUS_NAME]: version
9786
9863
  };
9787
9864
  }
9788
- ensureDirectViteForPnpm(pkg, packageManager, supportCatalog, catalogDependencyResolver);
9789
9865
  return pkg;
9790
9866
  });
9791
9867
  migratePnpmSettingsToWorkspaceYaml(projectPath, movedPnpmSettings);
9792
- if (packageManager === PackageManager.pnpm && (usePnpmWorkspaceYaml || supportCatalog)) rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserProviderBuilds, usesVitest, vitestEcosystemPackages, usePnpmWorkspaceYaml, providerCatalogAdditions);
9868
+ if (packageManager === PackageManager.pnpm && (usePnpmWorkspaceYaml || supportCatalog)) rewritePnpmWorkspaceYaml(projectPath, pnpmMajorVersion, shouldAllowBrowserProviderBuilds, usesVitest, vitestEcosystemPackages, usePnpmWorkspaceYaml, providerCatalogAdditions, usesWebdriverio);
9793
9869
  if (shouldAddPnpmWorkspaceVitePlusOverride) migratePnpmOverridesToWorkspaceYaml(projectPath, { [VITE_PLUS_NAME]: VITE_PLUS_VERSION });
9794
9870
  if (packageManager === PackageManager.pnpm) ensurePnpmWorkspaceExoticSubdepsSetting(projectPath);
9795
9871
  if (packageManager === PackageManager.yarn) rewriteYarnrcYml(projectPath, usesVitest, vitestEcosystemPackages, providerCatalogAdditions, supportCatalog);
@@ -9804,8 +9880,9 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
9804
9880
  injectFmtDefaults(projectPath, silent, report);
9805
9881
  mergeTsdownConfigFile(projectPath, silent, report);
9806
9882
  rewriteAllImports(projectPath, silent, report, true, oxlintOwnerDirs);
9807
- dropDeadOxlintPluginsDependency(projectPath, workspaceInfo.packages);
9883
+ dropDeadOxlintPluginsDependency(projectPath, workspaceInfo.packages, originalOxlintDependencies);
9808
9884
  wrapLazyPluginsInViteConfig(projectPath, silent, report);
9885
+ migrateTaskCacheConfigInViteConfig(projectPath, silent, report);
9809
9886
  setPackageManager(projectPath, workspaceInfo.downloadPackageManager);
9810
9887
  }
9811
9888
  /**
@@ -9815,18 +9892,20 @@ function rewriteStandaloneProject(projectPath, workspaceInfo, skipStagedMigratio
9815
9892
  function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, report) {
9816
9893
  const catalogDependencyResolver = createCatalogDependencyResolver(workspaceInfo.rootDir, workspaceInfo.packageManager);
9817
9894
  const oxlintOwnerDirs = collectOxlintOwnerDirs(workspaceInfo.rootDir, workspaceInfo.packages);
9895
+ const originalOxlintDependencies = collectOxlintDependencyNames(workspaceInfo.rootDir, workspaceInfo.packages);
9818
9896
  const pnpmMajorVersion = pnpmMajor(workspaceInfo.downloadPackageManager.version);
9819
9897
  const usePnpmWorkspaceSettings = pnpmSupportsWorkspaceSettings(workspaceInfo.downloadPackageManager.version);
9820
9898
  const workspaceShouldAllowBrowserBuilds = workspaceUsesWebdriverio(workspaceInfo.rootDir, workspaceInfo.packages);
9899
+ const usesWebdriverio = workspaceUsesWebdriverioProvider(workspaceInfo.rootDir, workspaceInfo.packages);
9821
9900
  const workspaceUsesVitest = workspaceUsesVitestDirectly(workspaceInfo.rootDir, workspaceInfo.packages, true);
9822
9901
  const vitestEcosystemPackages = collectVitestEcosystemInstallDependencyNames(workspaceInfo.rootDir, workspaceInfo.packages);
9823
9902
  const providerCatalogAdditions = collectInjectedProviderNames(workspaceInfo.rootDir, workspaceInfo.packages);
9824
9903
  const supportCatalog = supportsCatalog(workspaceInfo.packageManager, workspaceInfo.downloadPackageManager.version, true);
9825
9904
  if (workspaceInfo.packageManager === PackageManager.yarn) rewriteYarnrcYml(workspaceInfo.rootDir, workspaceUsesVitest, vitestEcosystemPackages, providerCatalogAdditions, supportCatalog);
9826
- else if (workspaceInfo.packageManager === PackageManager.bun) rewriteBunCatalog(workspaceInfo.rootDir, workspaceUsesVitest, vitestEcosystemPackages);
9905
+ else if (workspaceInfo.packageManager === PackageManager.bun) rewriteBunCatalog(workspaceInfo.rootDir, workspaceUsesVitest, vitestEcosystemPackages, usesWebdriverio);
9827
9906
  rewriteRootWorkspacePackageJson(workspaceInfo.rootDir, workspaceInfo.packageManager, skipStagedMigration, catalogDependencyResolver, workspaceInfo.packages, pnpmMajorVersion, workspaceInfo.downloadPackageManager.version, workspaceShouldAllowBrowserBuilds, workspaceUsesVitest, supportCatalog);
9828
9907
  if (workspaceInfo.packageManager === PackageManager.pnpm) {
9829
- rewritePnpmWorkspaceYaml(workspaceInfo.rootDir, pnpmMajorVersion, workspaceShouldAllowBrowserBuilds, workspaceUsesVitest, vitestEcosystemPackages, usePnpmWorkspaceSettings, providerCatalogAdditions);
9908
+ rewritePnpmWorkspaceYaml(workspaceInfo.rootDir, pnpmMajorVersion, workspaceShouldAllowBrowserBuilds, workspaceUsesVitest, vitestEcosystemPackages, usePnpmWorkspaceSettings, providerCatalogAdditions, usesWebdriverio);
9830
9909
  if (usePnpmWorkspaceSettings && isForceOverrideMode()) migratePnpmOverridesToWorkspaceYaml(workspaceInfo.rootDir, { [VITE_PLUS_NAME]: VITE_PLUS_VERSION });
9831
9910
  }
9832
9911
  const workspaceContext = {
@@ -9842,9 +9921,14 @@ function rewriteMonorepo(workspaceInfo, skipStagedMigration, silent = false, rep
9842
9921
  injectFmtDefaults(workspaceInfo.rootDir, silent, report);
9843
9922
  mergeTsdownConfigFile(workspaceInfo.rootDir, silent, report);
9844
9923
  rewriteAllImports(workspaceInfo.rootDir, silent, report, true, oxlintOwnerDirs);
9845
- dropDeadOxlintPluginsDependency(workspaceInfo.rootDir, workspaceInfo.packages);
9924
+ dropDeadOxlintPluginsDependency(workspaceInfo.rootDir, workspaceInfo.packages, originalOxlintDependencies);
9846
9925
  wrapLazyPluginsInViteConfig(workspaceInfo.rootDir, silent, report);
9847
- for (const pkg of workspaceInfo.packages) wrapLazyPluginsInViteConfig(path.join(workspaceInfo.rootDir, pkg.path), silent, report);
9926
+ migrateTaskCacheConfigInViteConfig(workspaceInfo.rootDir, silent, report);
9927
+ for (const pkg of workspaceInfo.packages) {
9928
+ const projectPath = path.join(workspaceInfo.rootDir, pkg.path);
9929
+ wrapLazyPluginsInViteConfig(projectPath, silent, report);
9930
+ migrateTaskCacheConfigInViteConfig(projectPath, silent, report);
9931
+ }
9848
9932
  setPackageManager(workspaceInfo.rootDir, workspaceInfo.downloadPackageManager);
9849
9933
  }
9850
9934
  /**
@@ -9879,7 +9963,10 @@ function rewriteMonorepoProject(projectPath, packageManager, skipStagedMigration
9879
9963
  if (extractedStagedConfig) {
9880
9964
  if (mergeStagedConfigToViteConfig(projectPath, extractedStagedConfig, silent, report)) removeLintStagedFromPackageJson(packageJsonPath);
9881
9965
  }
9882
- if (!deferLazyPluginWrapping) wrapLazyPluginsInViteConfig(projectPath, silent, report);
9966
+ if (!deferLazyPluginWrapping) {
9967
+ wrapLazyPluginsInViteConfig(projectPath, silent, report);
9968
+ migrateTaskCacheConfigInViteConfig(projectPath, silent, report);
9969
+ }
9883
9970
  }
9884
9971
  //#endregion
9885
9972
  //#region src/utils/editor.ts
@@ -10237,4 +10324,4 @@ function resolveEditorIds(editors) {
10237
10324
  return uniqueEditorIds.length === 0 ? void 0 : uniqueEditorIds;
10238
10325
  }
10239
10326
  //#endregion
10240
- export { warnIncompatibleEslintIntegration as $, detectYarnPnpMode as A, migrateTsupToTsdown as B, injectLintTypeCheckDefaults as C, detectVitePlusBootstrapPending as D, collectToolchainVersionChanges as E, addFrameworkShim as F, migratePrettierToOxfmt as G, warnMissingTsupConfig as H, detectFramework as I, confirmEslintMigration as J, promptPrettierMigration as K, hasFrameworkShim as L, isBingoTemplate as M, updatePackageJsonWithDeps as N, ensureVitePlusBootstrap as O, updateWorkspaceConfig as P, promptEslintMigration as Q, confirmTsupMigration as R, injectCreateDefaultTemplate as S, mergeViteConfigFiles as T, confirmPrettierMigration as U, promptTsupMigration as V, detectPrettierProject as W, detectIncompatibleEslintIntegration as X, detectEslintProject as Y, migrateEslintToOxlint as Z, installGitHooks as _, selectEditors as a, findGitRoot as b, rewriteMonorepoProject as c, finalizeCoreMigrationForExistingVitePlus as d, warnLegacyEslintConfig as et, detectNodeVersionManagerFile as f, detectLegacyGitHooksMigrationCandidate as g, setPackageManager as h, selectEditor as i, detectWorkspace$1 as j, configureYarnNodeModulesMode as k, rewriteStandaloneProject as l, migrateSetupVpVersion as m, detectExistingEditors as n, checkViteVersion as nt, writeEditorConfigs as o, migrateNodeVersionManagerFile as p, warnPackageLevelPrettier as q, isJsonLikeFile as r, checkVitestVersion as rt, rewriteMonorepo as s, detectEditorConflicts as t, warnPackageLevelEslint as tt, detectPendingCoreMigration as u, preflightGitHooksSetup as v, mergeTsdownConfigFile as w, initGitRepository as x, shouldSkipStagedMigrationForHooks as y, detectTsupProject as z };
10327
+ export { confirmEslintMigration as $, createCatalogDependencyResolver as A, addFrameworkShim as B, mergeViteConfigFiles as C, usesWebdriverioProvider as D, ensureVitePlusBootstrap as E, updateWorkspaceConfig as F, migrateTsupToTsdown as G, hasFrameworkShim as H, minimatch as I, confirmPrettierMigration as J, promptTsupMigration as K, findGitRoot as L, detectWorkspace$1 as M, isBingoTemplate as N, configureYarnNodeModulesMode as O, updatePackageJsonWithDeps as P, warnPackageLevelPrettier as Q, initGitRepository as R, mergeTsdownConfigFile as S, detectVitePlusBootstrapPending as T, confirmTsupMigration as U, detectFramework as V, detectTsupProject as W, migratePrettierToOxfmt as X, detectPrettierProject as Y, promptPrettierMigration as Z, installGitHooks as _, selectEditors as a, warnLegacyEslintConfig as at, injectCreateDefaultTemplate as b, rewriteMonorepoProject as c, checkViteVersion as ct, finalizeCoreMigrationForExistingVitePlus as d, detectEslintProject as et, detectNodeVersionManagerFile as f, detectLegacyGitHooksMigrationCandidate as g, setPackageManager as h, selectEditor as i, warnIncompatibleEslintIntegration as it, supportsCatalog as j, detectYarnPnpMode as k, rewriteStandaloneProject as l, checkVitestVersion as lt, migrateSetupVpVersion as m, detectExistingEditors as n, migrateEslintToOxlint as nt, writeEditorConfigs as o, warnPackageLevelEslint as ot, migrateNodeVersionManagerFile as p, warnMissingTsupConfig as q, isJsonLikeFile as r, promptEslintMigration as rt, rewriteMonorepo as s, WEBDRIVERIO_PROVIDER as st, detectEditorConflicts as t, detectIncompatibleEslintIntegration as tt, detectPendingCoreMigration as u, preflightGitHooksSetup as v, collectToolchainVersionChanges as w, injectLintTypeCheckDefaults as x, shouldSkipStagedMigrationForHooks as y, extractOverrideParentSegments as z };