vite-plus 0.1.23 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/LICENSE +30 -0
  2. package/README.md +8 -6
  3. package/bin/oxfmt +5 -2
  4. package/bin/oxlint +12 -2
  5. package/binding/index.cjs +84 -67
  6. package/binding/index.d.cts +155 -4
  7. package/dist/{agent-aSGY0osq.js → agent-BD31CsvU.js} +969 -89
  8. package/dist/bin.js +29 -33
  9. package/dist/{compat-DXZgnEyq.js → compat-Cql3K40m.js} +1 -1
  10. package/dist/config/bin.js +30 -14
  11. package/dist/constants-CrfJQIUX.js +66 -0
  12. package/dist/create/bin.d.ts +7 -1
  13. package/dist/create/bin.js +578 -266
  14. package/dist/define-config-2tfJoXr1.d.ts +305 -0
  15. package/dist/define-config-BGSjF6Xp.cjs +488 -0
  16. package/dist/define-config-DJUehepE.js +445 -0
  17. package/dist/define-config.cjs +8 -1
  18. package/dist/define-config.d.ts +2 -2
  19. package/dist/define-config.js +2 -2
  20. package/dist/dist-DRJUd9bL.js +3 -0
  21. package/dist/{dist-BgQuvbtq.js → dist-Oxo16Y0q.js} +4 -4
  22. package/dist/index.cjs +9 -4
  23. package/dist/index.d.ts +3 -3
  24. package/dist/index.js +3 -3
  25. package/dist/{main-DpJl3LoU.js → json-Dn87fvjk.js} +137 -1
  26. package/dist/migration/bin.js +301 -84
  27. package/dist/{oxlint-plugin-config-B89iKTKN.js → oxlint-plugin-config-q8a5PFch.js} +1 -1
  28. package/dist/oxlint-plugin.js +11 -3
  29. package/dist/pack-bin.js +44 -15
  30. package/dist/{package-PmBUZ-ve.js → package-BHirM1_v.js} +3 -138
  31. package/dist/{report-DgSBQUdz.js → report-BHSkWqRR.js} +2 -0
  32. package/dist/{resolve-vite-config-TTvhycU1.js → resolve-vite-config-CmdsfQzS.js} +13 -4
  33. package/dist/staged/bin.js +150 -417
  34. package/dist/test/_at-vitest-browser/context.d.ts +2 -0
  35. package/dist/test/_at-vitest-browser.d.ts +2 -0
  36. package/dist/test/browser/context.d.ts +2 -2
  37. package/dist/test/browser/context.js +1 -1
  38. package/dist/test/browser/providers/playwright/context.d.ts +1 -0
  39. package/dist/test/browser/providers/playwright/context.js +1 -0
  40. package/dist/test/browser/providers/playwright.d.ts +124 -2
  41. package/dist/test/browser/providers/playwright.js +1 -1
  42. package/dist/test/browser/providers/preview/context.d.ts +1 -0
  43. package/dist/test/browser/providers/preview/context.js +1 -0
  44. package/dist/test/browser/providers/preview.d.ts +32 -2
  45. package/dist/test/browser/providers/preview.js +1 -1
  46. package/dist/test/browser/providers/webdriverio/context.d.ts +1 -0
  47. package/dist/test/browser/providers/webdriverio/context.js +1 -0
  48. package/dist/test/browser/providers/webdriverio.d.ts +77 -2
  49. package/dist/test/browser/providers/webdriverio.js +1 -1
  50. package/dist/test/browser-compat.d.ts +2 -0
  51. package/dist/test/browser-compat.js +1 -1
  52. package/dist/test/browser-playwright/context.d.ts +1 -0
  53. package/dist/test/browser-playwright/context.js +1 -0
  54. package/dist/test/browser-playwright.d.ts +124 -2
  55. package/dist/test/browser-playwright.js +1 -1
  56. package/dist/test/browser-preview/context.d.ts +1 -0
  57. package/dist/test/browser-preview/context.js +1 -0
  58. package/dist/test/browser-preview.d.ts +32 -2
  59. package/dist/test/browser-preview.js +1 -1
  60. package/dist/test/browser-webdriverio/context.d.ts +1 -0
  61. package/dist/test/browser-webdriverio/context.js +1 -0
  62. package/dist/test/browser-webdriverio.d.ts +77 -2
  63. package/dist/test/browser-webdriverio.js +1 -1
  64. package/dist/test/browser.d.ts +2 -2
  65. package/dist/test/browser.js +1 -1
  66. package/dist/test/client.js +1 -1
  67. package/dist/test/config.cjs +1 -1
  68. package/dist/test/config.d.ts +2 -2
  69. package/dist/test/config.js +1 -1
  70. package/dist/test/context.d.ts +942 -2
  71. package/dist/test/context.js +1 -1
  72. package/dist/test/coverage.d.ts +2 -2
  73. package/dist/test/coverage.js +1 -1
  74. package/dist/test/environments.d.ts +2 -2
  75. package/dist/test/environments.js +1 -1
  76. package/dist/test/globals.d.ts +2 -2
  77. package/dist/test/import-meta.d.ts +2 -2
  78. package/dist/test/importMeta.d.ts +2 -2
  79. package/dist/test/index.cjs +1 -1
  80. package/dist/test/index.d.cts +2 -2
  81. package/dist/test/index.d.ts +2 -2
  82. package/dist/test/index.js +1 -1
  83. package/dist/test/internal/browser.d.ts +2 -2
  84. package/dist/test/internal/browser.js +1 -1
  85. package/dist/test/jsdom.d.ts +2 -2
  86. package/dist/test/locators.d.ts +294 -0
  87. package/dist/test/locators.js +1 -1
  88. package/dist/test/matchers.d.ts +29 -0
  89. package/dist/test/matchers.js +1 -1
  90. package/dist/test/node.d.ts +2 -2
  91. package/dist/test/node.js +1 -1
  92. package/dist/test/optional-runtime-types.js.d.ts +2 -2
  93. package/dist/test/optional-types.js.d.ts +2 -2
  94. package/dist/test/plugins/browser-client.js +1 -1
  95. package/dist/test/plugins/browser-context.js +1 -1
  96. package/dist/test/plugins/browser-locators.js +1 -1
  97. package/dist/test/plugins/browser-playwright.js +1 -1
  98. package/dist/test/plugins/browser-preview.js +1 -1
  99. package/dist/test/plugins/browser-webdriverio.js +1 -1
  100. package/dist/test/plugins/browser.js +1 -1
  101. package/dist/test/plugins/expect.js +1 -1
  102. package/dist/test/plugins/mocker-automock.js +1 -1
  103. package/dist/test/plugins/mocker-browser.js +1 -1
  104. package/dist/test/plugins/mocker-node.js +1 -1
  105. package/dist/test/plugins/mocker-redirect.js +1 -1
  106. package/dist/test/plugins/mocker-register.js +1 -1
  107. package/dist/test/plugins/mocker-transforms.js +1 -1
  108. package/dist/test/plugins/mocker.js +1 -1
  109. package/dist/test/plugins/pretty-format.js +1 -1
  110. package/dist/test/plugins/runner-types.js +1 -1
  111. package/dist/test/plugins/runner-utils.js +1 -1
  112. package/dist/test/plugins/runner.js +1 -1
  113. package/dist/test/plugins/snapshot-environment.js +1 -1
  114. package/dist/test/plugins/snapshot-manager.js +1 -1
  115. package/dist/test/plugins/snapshot.js +1 -1
  116. package/dist/test/plugins/spy.js +1 -1
  117. package/dist/test/plugins/utils-constants.js +1 -1
  118. package/dist/test/plugins/utils-diff.js +1 -1
  119. package/dist/test/plugins/utils-display.js +1 -1
  120. package/dist/test/plugins/utils-error.js +1 -1
  121. package/dist/test/plugins/utils-helpers.js +1 -1
  122. package/dist/test/plugins/utils-offset.js +1 -1
  123. package/dist/test/plugins/utils-resolver.js +1 -1
  124. package/dist/test/plugins/utils-serialize.js +1 -1
  125. package/dist/test/plugins/utils-source-map-node.js +1 -1
  126. package/dist/test/plugins/utils-source-map.js +1 -1
  127. package/dist/test/plugins/utils-timers.js +1 -1
  128. package/dist/test/plugins/utils.js +1 -1
  129. package/dist/test/reporters.d.ts +2 -2
  130. package/dist/test/reporters.js +1 -1
  131. package/dist/test/runners.d.ts +2 -2
  132. package/dist/test/runners.js +1 -1
  133. package/dist/test/runtime.d.ts +2 -2
  134. package/dist/test/runtime.js +1 -1
  135. package/dist/test/snapshot.d.ts +2 -2
  136. package/dist/test/snapshot.js +1 -1
  137. package/dist/test/suite.d.ts +2 -2
  138. package/dist/test/suite.js +1 -1
  139. package/dist/test/utils.js +1 -1
  140. package/dist/test/worker.d.ts +2 -2
  141. package/dist/test/worker.js +1 -1
  142. package/dist/{tsconfig-DlUVXT3J.js → tsconfig-CJ_StdFc.js} +605 -263
  143. package/dist/tsgolint-path-B-yOos8p.js +32 -0
  144. package/dist/tsgolint-path.d.ts +8 -0
  145. package/dist/tsgolint-path.js +2 -0
  146. package/dist/version.js +3 -3
  147. package/dist/versions.d.ts +1 -1
  148. package/dist/versions.js +7 -7
  149. package/dist/{workspace-DElv730L.js → workspace-Cjoc1c_A.js} +20 -18
  150. package/docs/_data/team.ts +5 -4
  151. package/docs/config/create.md +36 -1
  152. package/docs/config/index.md +7 -5
  153. package/docs/guide/commit-hooks.md +9 -0
  154. package/docs/guide/create.md +106 -2
  155. package/docs/guide/env.md +33 -5
  156. package/docs/guide/index.md +9 -3
  157. package/docs/guide/install.md +46 -10
  158. package/docs/guide/migrate.md +13 -3
  159. package/docs/guide/troubleshooting.md +3 -29
  160. package/docs/guide/upgrade.md +36 -6
  161. package/docs/package.json +3 -3
  162. package/docs/pnpm-lock.yaml +298 -395
  163. package/package.json +104 -56
  164. package/templates/generator/bin/index.ts +6 -3
  165. package/templates/generator/package.json +2 -3
  166. package/templates/generator/src/template.ts +0 -2
  167. package/templates/monorepo/package.json +1 -1
  168. package/dist/constants-DCBWlNrn.js +0 -33
  169. package/dist/define-config-BR1Y88zz.cjs +0 -84
  170. package/dist/define-config-BRC7qPNE.js +0 -21
  171. package/dist/define-config-COdn-tsn.d.ts +0 -177
  172. package/dist/dist-Bapm49IR.js +0 -3
  173. package/dist/test/plugins/utils-highlight.js +0 -1
  174. /package/dist/{chunk-DnnnRqeS.js → rolldown-runtime-DnnnRqeS.js} +0 -0
package/dist/bin.js CHANGED
@@ -1,13 +1,13 @@
1
- import { i as VITE_PLUS_NAME, l as resolve$1, n as BASEURL_TSCONFIG_WARNING, r as DEFAULT_ENVS } from "./constants-DCBWlNrn.js";
2
- import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-B89iKTKN.js";
3
- import { M as runCommandSilently, i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-DlUVXT3J.js";
1
+ import { d as resolve$1, f as resolveBundled, n as BASEURL_TSCONFIG_WARNING, o as VITE_PLUS_NAME, r as DEFAULT_ENVS } from "./constants-CrfJQIUX.js";
2
+ import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-q8a5PFch.js";
3
+ import { I as runCommandSilently, i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-CJ_StdFc.js";
4
4
  import { n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-uTv0ZaMr.js";
5
- import { r as resolveUniversalViteConfig } from "./resolve-vite-config-TTvhycU1.js";
5
+ import { t as resolveTsgolintExecutable } from "./tsgolint-path-B-yOos8p.js";
6
+ import { i as resolveUniversalViteConfig } from "./resolve-vite-config-CmdsfQzS.js";
6
7
  import path, { dirname, join } from "node:path";
7
8
  import { hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
8
- import fs, { existsSync, realpathSync } from "node:fs";
9
+ import fs, { readFileSync } from "node:fs";
9
10
  import { fileURLToPath } from "node:url";
10
- import { relative } from "node:path/win32";
11
11
  //#region src/resolve-fmt.ts
12
12
  /**
13
13
  * Oxfmt tool resolver for the vite-plus CLI.
@@ -51,6 +51,9 @@ const INIT_COMMAND_SPECS = {
51
51
  defaultConfigFiles: [".oxfmtrc.json", ".oxfmtrc.jsonc"]
52
52
  }
53
53
  };
54
+ function normalizeInitCommand(command) {
55
+ return command === "format" ? "fmt" : command;
56
+ }
54
57
  const VITE_CONFIG_FILES = [
55
58
  "vite.config.ts",
56
59
  "vite.config.mts",
@@ -127,8 +130,9 @@ async function vpFmt(cwd, filePath) {
127
130
  if (result.exitCode !== 0) warnMsg(`Failed to format ${filePath} with vp fmt:\n${result.stdout.toString()}${result.stderr.toString()}`);
128
131
  }
129
132
  function resolveInitSpec(command, args) {
130
- if (!command) return null;
131
- const spec = INIT_COMMAND_SPECS[command];
133
+ const normalizedCommand = normalizeInitCommand(command);
134
+ if (!normalizedCommand) return null;
135
+ const spec = INIT_COMMAND_SPECS[normalizedCommand];
132
136
  if (!spec || !hasTriggerFlag(args, spec.triggerFlags)) return null;
133
137
  return spec;
134
138
  }
@@ -157,7 +161,7 @@ function inspectInitCommand(command, args, projectPath = process.cwd()) {
157
161
  async function applyToolInitConfigToViteConfig(command, args, projectPath = process.cwd()) {
158
162
  const inspection = inspectInitCommand(command, args, projectPath);
159
163
  if (!inspection.handled || !inspection.configKey) return { handled: false };
160
- const spec = INIT_COMMAND_SPECS[command];
164
+ const spec = INIT_COMMAND_SPECS[normalizeInitCommand(command)];
161
165
  const viteConfigPath = ensureViteConfigPath(projectPath);
162
166
  const generatedConfigPath = resolveGeneratedConfigPath(projectPath, args, spec.defaultConfigFiles);
163
167
  if (hasConfigKey(viteConfigPath, spec.configKey)) {
@@ -260,26 +264,7 @@ async function doc() {
260
264
  */
261
265
  async function lint() {
262
266
  const binPath = join(dirname(dirname(resolve$1("oxlint"))), "bin", "oxlint");
263
- let oxlintTsgolintPath = resolve$1("oxlint-tsgolint/bin/tsgolint");
264
- if (process.platform === "win32") {
265
- const scriptDir = dirname(fileURLToPath(import.meta.url));
266
- const localBinDir = join(scriptDir, "..", "node_modules", ".bin");
267
- const projectBinDir = join(dirname(dirname(oxlintTsgolintPath)), "..", ".bin");
268
- const pathCandidates = [
269
- join(localBinDir, "tsgolint.exe"),
270
- join(localBinDir, "tsgolint.cmd"),
271
- join(projectBinDir, "tsgolint.exe"),
272
- join(projectBinDir, "tsgolint.cmd")
273
- ];
274
- oxlintTsgolintPath = pathCandidates.find((p) => existsSync(p)) ?? "";
275
- if (!oxlintTsgolintPath) try {
276
- const realBinDir = join(dirname(realpathSync(join(scriptDir, ".."))), ".bin");
277
- oxlintTsgolintPath = [join(realBinDir, "tsgolint.exe"), join(realBinDir, "tsgolint.cmd")].find((p) => existsSync(p)) ?? "";
278
- } catch {}
279
- if (!oxlintTsgolintPath) throw new Error("Unable to resolve oxlint-tsgolint executable, tried:\n" + pathCandidates.map((path) => `- ${path}`).join("\n"));
280
- const relativePath = relative(process.cwd(), oxlintTsgolintPath);
281
- oxlintTsgolintPath = /^[a-zA-Z]:/.test(relativePath) ? relativePath : `.\\${relativePath}`;
282
- }
267
+ const oxlintTsgolintPath = resolveTsgolintExecutable(resolve$1("oxlint-tsgolint/bin/tsgolint"), import.meta.url);
283
268
  return {
284
269
  binPath,
285
270
  envs: {
@@ -320,8 +305,10 @@ async function pack() {
320
305
  * Vitest tool resolver for the vite-plus CLI.
321
306
  *
322
307
  * This module exports a function that resolves the Vitest binary path
323
- * to the bundled Vitest in the CLI distribution. The resolved path is
324
- * passed back to the Rust core, which then executes Vitest for running tests.
308
+ * to the vitest package shipped with the CLI (falling back to the user's
309
+ * project copy only if the bundled one is unreachable). The resolved path
310
+ * is passed back to the Rust core, which then executes Vitest for running
311
+ * tests.
325
312
  *
326
313
  * Used for: `vite-plus test` command
327
314
  */
@@ -334,11 +321,20 @@ async function pack() {
334
321
  *
335
322
  * Vitest is Vite's testing framework that provides a Jest-compatible
336
323
  * testing experience with Vite's fast HMR and transformation pipeline.
337
- * The function points to the bundled Vitest in the CLI's dist directory.
324
+ * The function resolves the bundled vitest shipped with the CLI first,
325
+ * so the runner matches the Vitest that `vite-plus/test*` imports resolve
326
+ * to; it falls back to the project copy only if the bundled one is
327
+ * unreachable. See `resolveBundled` for the rationale (avoiding dual-copy
328
+ * Vitest internal-state / mock-hoisting mismatches).
338
329
  */
339
330
  async function test() {
331
+ const pkgJsonPath = resolveBundled("vitest/package.json");
332
+ const pkgRoot = dirname(pkgJsonPath);
333
+ const pkgJson = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
334
+ const binRel = typeof pkgJson.bin === "string" ? pkgJson.bin : pkgJson.bin?.vitest;
335
+ if (!binRel) throw new Error(`Could not find 'vitest' bin entry in ${pkgJsonPath}`);
340
336
  return {
341
- binPath: join(dirname(resolve$1("@voidzero-dev/vite-plus-test")), "dist", "cli.js"),
337
+ binPath: join(pkgRoot, binRel),
342
338
  envs: process.env.DEBUG_DISABLE_SOURCE_MAP ? {
343
339
  ...DEFAULT_ENVS,
344
340
  DEBUG_DISABLE_SOURCE_MAP: process.env.DEBUG_DISABLE_SOURCE_MAP
@@ -1,4 +1,4 @@
1
- import { n as addMigrationWarning } from "./report-DgSBQUdz.js";
1
+ import { n as addMigrationWarning } from "./report-BHSkWqRR.js";
2
2
  //#region src/migration/compat.ts
3
3
  /**
4
4
  * Check for Rolldown-incompatible manualChunks config patterns.
@@ -1,7 +1,7 @@
1
- import { c as defaultInteractive, d as promptGitHooks } from "../tsconfig-DlUVXT3J.js";
1
+ import { d as promptGitHooks, l as defaultInteractive } from "../tsconfig-CJ_StdFc.js";
2
2
  import { a as printHeader, r as log } from "../terminal-uTv0ZaMr.js";
3
3
  import { t as lib_default } from "../lib-L3DWSRQp.js";
4
- import { o as updateExistingAgentInstructions, x as hasStagedConfigInViteConfig, y as ensurePreCommitHook } from "../agent-aSGY0osq.js";
4
+ import { E as hasStagedConfigInViteConfig, S as ensurePreCommitHook, o as updateExistingAgentInstructions } from "../agent-BD31CsvU.js";
5
5
  import { t as renderCliDoc } from "../help-YP84FSEz.js";
6
6
  import { join } from "node:path";
7
7
  import { existsSync, mkdirSync, rmSync, writeFileSync } from "node:fs";
@@ -121,7 +121,11 @@ function install(dir = ".vite-hooks") {
121
121
  //#region src/config/bin.ts
122
122
  async function main() {
123
123
  const args = lib_default(process.argv.slice(3), {
124
- boolean: ["help", "hooks-only"],
124
+ boolean: [
125
+ "help",
126
+ "hooks",
127
+ "agent"
128
+ ],
125
129
  string: ["hooks-dir"],
126
130
  alias: { h: "help" }
127
131
  });
@@ -132,13 +136,24 @@ async function main() {
132
136
  documentationUrl: "https://viteplus.dev/guide/commit-hooks",
133
137
  sections: [{
134
138
  title: "Options",
135
- rows: [{
136
- label: "--hooks-dir <path>",
137
- description: "Custom hooks directory (default: .vite-hooks)"
138
- }, {
139
- label: "-h, --help",
140
- description: "Show this help message"
141
- }]
139
+ rows: [
140
+ {
141
+ label: "--hooks-dir <path>",
142
+ description: "Custom hooks directory (default: .vite-hooks)"
143
+ },
144
+ {
145
+ label: "--no-hooks",
146
+ description: "Skip hook installation"
147
+ },
148
+ {
149
+ label: "--no-agent",
150
+ description: "Skip updating coding agent instructions"
151
+ },
152
+ {
153
+ label: "-h, --help",
154
+ description: "Show this help message"
155
+ }
156
+ ]
142
157
  }, {
143
158
  title: "Environment",
144
159
  rows: [{
@@ -152,15 +167,16 @@ async function main() {
152
167
  return;
153
168
  }
154
169
  const dir = args["hooks-dir"];
155
- const hooksOnly = args["hooks-only"];
170
+ const skipHooks = args.hooks === false;
171
+ const skipAgent = args.agent === false;
156
172
  const interactive = defaultInteractive();
157
173
  const lifecycleEvent = process.env.npm_lifecycle_event;
158
174
  const isLifecycleScript = lifecycleEvent === "prepare" || lifecycleEvent === "postinstall";
159
175
  const root = process.cwd();
160
176
  const hooksDir = dir ?? ".vite-hooks";
161
177
  const isFirstHooksRun = !existsSync(join(root, hooksDir, "_", "pre-commit"));
162
- let shouldSetupHooks = true;
163
- if (interactive && isFirstHooksRun && !dir && !isLifecycleScript && !hasStagedConfigInViteConfig(root)) shouldSetupHooks = await promptGitHooks({ interactive });
178
+ let shouldSetupHooks = !skipHooks;
179
+ if (shouldSetupHooks && interactive && isFirstHooksRun && !dir && !isLifecycleScript && !hasStagedConfigInViteConfig(root)) shouldSetupHooks = await promptGitHooks({ interactive });
164
180
  if (shouldSetupHooks) {
165
181
  const { message, isError } = install(dir);
166
182
  if (message) {
@@ -169,7 +185,7 @@ async function main() {
169
185
  }
170
186
  if (!message) ensurePreCommitHook(root, hooksDir);
171
187
  }
172
- if (!hooksOnly) updateExistingAgentInstructions(root);
188
+ if (!skipAgent) updateExistingAgentInstructions(root);
173
189
  }
174
190
  main();
175
191
  //#endregion
@@ -0,0 +1,66 @@
1
+ import { createRequire } from "node:module";
2
+ //#region src/utils/constants.ts
3
+ const VITE_PLUS_NAME = "vite-plus";
4
+ const VITE_PLUS_VERSION = process.env.VP_VERSION || "latest";
5
+ const VITEST_VERSION = "4.1.9";
6
+ const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : {
7
+ vite: "npm:@voidzero-dev/vite-plus-core@latest",
8
+ vitest: VITEST_VERSION
9
+ };
10
+ /**
11
+ * Package-name patterns the migrator exempts from a package manager's
12
+ * "minimum release age" gate (pnpm `minimumReleaseAgeExclude` / Yarn
13
+ * `npmPreapprovedPackages`).
14
+ *
15
+ * Vite+ pins `vitest` to an exact, sometimes freshly published version, and the
16
+ * in-tree `@vitest/*` siblings install transitively at that same version, so an
17
+ * age gate would otherwise quarantine the Vite+-managed family and break
18
+ * `vp install`. The `@vitest/*` glob also covers the optional `@vitest/browser-*`
19
+ * peers the migrator pins for browser projects. This does NOT pin or manage any
20
+ * package — it only lets the chosen versions through the user's gate, including
21
+ * the `@vitest/coverage-*` version the coverage guard asks the user to align to
22
+ * the bundled vitest.
23
+ */
24
+ const VITEST_AGE_GATE_EXEMPT_PACKAGES = ["vitest", "@vitest/*"];
25
+ /**
26
+ * When VP_FORCE_MIGRATE is set, force full dependency rewriting
27
+ * even for projects already using vite-plus. Used by ecosystem CI to
28
+ * override dependencies with locally built tgz packages.
29
+ */
30
+ function isForceOverrideMode() {
31
+ return process.env.VP_FORCE_MIGRATE === "1";
32
+ }
33
+ const require = createRequire(import.meta.url);
34
+ function resolve(path) {
35
+ return require.resolve(path, { paths: [process.cwd(), import.meta.dirname] });
36
+ }
37
+ /**
38
+ * Like {@link resolve}, but prefers the copy shipped with the CLI
39
+ * (`import.meta.dirname`) over the project's (`process.cwd()`).
40
+ *
41
+ * Use this for runtime modules that MUST match what `vite-plus/test*`
42
+ * imports resolve to — chiefly the Vitest runner binary. The `vite-plus/test`
43
+ * shims `export * from 'vitest'`, which Node resolves to vite-plus's own
44
+ * bundled (pinned) Vitest. If `vp test` instead spawned a project-local
45
+ * Vitest (a different physical copy/version), the runner and the imported
46
+ * `vi`/`expect`/runner internals would come from two distinct Vitest
47
+ * modules — a classic source of Vitest internal-state and mock-hoisting
48
+ * mismatches. `process.cwd()` stays as a fallback for layouts where the
49
+ * bundled copy is somehow unreachable, so this is never worse than {@link resolve}.
50
+ */
51
+ function resolveBundled(path) {
52
+ return require.resolve(path, { paths: [import.meta.dirname, process.cwd()] });
53
+ }
54
+ const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: a tsconfig file contains baseUrl which is not yet supported by the oxlint type checker.\n Run `vp dlx @andrewbranch/ts5to6 --fixBaseUrl <tsconfig path>` to remove baseUrl from your tsconfig.";
55
+ const BASEURL_TSCONFIG_FIX_PACKAGE = "@andrewbranch/ts5to6";
56
+ const BASEURL_TSCONFIG_FIX_FLAG = "--fixBaseUrl";
57
+ function createBaseUrlTsconfigFixArgs(target = ".") {
58
+ return [BASEURL_TSCONFIG_FIX_FLAG, target];
59
+ }
60
+ const DEFAULT_ENVS = {
61
+ JS_RUNTIME_VERSION: process.versions.node,
62
+ JS_RUNTIME_NAME: process.release.name,
63
+ NODE_PACKAGE_MANAGER: "vite-plus"
64
+ };
65
+ //#endregion
66
+ export { VITEST_VERSION as a, VITE_PLUS_VERSION as c, resolve as d, resolveBundled as f, VITEST_AGE_GATE_EXEMPT_PACKAGES as i, createBaseUrlTsconfigFixArgs as l, BASEURL_TSCONFIG_WARNING as n, VITE_PLUS_NAME as o, DEFAULT_ENVS as r, VITE_PLUS_OVERRIDE_PACKAGES as s, BASEURL_TSCONFIG_FIX_PACKAGE as t, isForceOverrideMode as u };
@@ -6,9 +6,15 @@ interface Options {
6
6
  help: boolean;
7
7
  verbose: boolean;
8
8
  agent?: string | string[] | false;
9
- editor?: string;
9
+ editor?: string | false;
10
+ git?: boolean;
10
11
  hooks?: boolean;
11
12
  packageManager?: string;
13
+ /**
14
+ * Approve and run gated dependency build scripts without prompting. Useful in
15
+ * non-interactive runs that need a ready-to-use project.
16
+ */
17
+ approveBuilds?: boolean;
12
18
  }
13
19
  //#endregion
14
20
  export { Options };