vite-plus 0.1.22 → 0.1.24

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 (67) hide show
  1. package/binding/index.cjs +119 -52
  2. package/binding/index.d.cts +3222 -2
  3. package/dist/agent-Nuk-9l77.js +2470 -0
  4. package/dist/bin.js +13 -8
  5. package/dist/cli-truncate-CWsmbK3p.js +867 -0
  6. package/dist/{compat-OlmU9EQz.js → compat-DXZgnEyq.js} +1 -1
  7. package/dist/config/bin.js +18 -5
  8. package/dist/{constants-kDaYqyWd.js → constants-DCBWlNrn.js} +7 -2
  9. package/dist/create/bin.d.ts +1 -1
  10. package/dist/create/bin.js +194 -87
  11. package/dist/{define-config-IMCGDS2K.d.ts → define-config-COdn-tsn.d.ts} +7 -5
  12. package/dist/define-config.cjs +1 -1
  13. package/dist/define-config.d.ts +1 -1
  14. package/dist/define-config.js +1 -1
  15. package/dist/dist-Bapm49IR.js +3 -0
  16. package/dist/{dist-owlRxmBM.js → dist-BgQuvbtq.js} +136 -110
  17. package/dist/fmt.d.ts +1 -1
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.ts +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/is-fullwidth-code-point-BUNlIICg.js +8 -0
  22. package/dist/lint.d.ts +1 -1
  23. package/dist/{log-update-NRrY6krx.js → log-update-lyIiuflf.js} +111 -24
  24. package/dist/migration/bin.js +81 -39
  25. package/dist/{oxlint-plugin-config-BkQeR4FR.js → oxlint-plugin-config-B89iKTKN.js} +1 -1
  26. package/dist/oxlint-plugin.d.ts +2 -4
  27. package/dist/oxlint-plugin.js +1 -1
  28. package/dist/pack-bin.js +1 -1
  29. package/dist/pack.d.ts +1 -1
  30. package/dist/{package-BoLLED6j.js → package-PmBUZ-ve.js} +2 -2
  31. package/dist/staged/bin.js +157 -424
  32. package/dist/strip-ansi-C3wrWz9t.js +853 -0
  33. package/dist/{agent-BWLe0i9g.js → tsconfig-DFb5BKyT.js} +681 -2114
  34. package/dist/version.js +5 -5
  35. package/dist/versions.js +7 -7
  36. package/dist/{workspace-Bi_9spVt.js → workspace-NL-m9wgM.js} +22 -21
  37. package/dist/wrap-ansi-CeQuiQ31.js +2 -0
  38. package/dist/{wrap-ansi-DtUeUCjE.js → wrap-ansi-k7Dn4VtV.js} +1 -1
  39. package/docs/_data/team.ts +3 -3
  40. package/docs/config/run.md +39 -4
  41. package/docs/guide/cache.md +10 -1
  42. package/docs/guide/env.md +3 -0
  43. package/docs/guide/ide-integration.md +2 -2
  44. package/docs/guide/index.md +4 -0
  45. package/docs/guide/install.md +19 -0
  46. package/docs/guide/migrate.md +1 -1
  47. package/docs/guide/run.md +2 -0
  48. package/docs/guide/troubleshooting.md +6 -29
  49. package/docs/guide/upgrade.md +12 -1
  50. package/package.json +20 -20
  51. package/templates/monorepo/_gitignore +1 -0
  52. package/dist/cli-truncate-B62YnW2m.js +0 -138
  53. package/dist/dist-DZfItHAr.js +0 -3
  54. package/dist/slice-ansi-e4todZeH.js +0 -113
  55. package/dist/strip-ansi-D-eYYcD2.js +0 -198
  56. package/dist/tsconfig-BVyzXJ_o.js +0 -517
  57. package/dist/wrap-ansi-3S3qJ7j8.js +0 -2
  58. /package/dist/{chunk-q7NCDQ7-.js → chunk-DnnnRqeS.js} +0 -0
  59. /package/dist/{define-config-GqLoRwH9.cjs → define-config-BR1Y88zz.cjs} +0 -0
  60. /package/dist/{define-config-CzWdQTt2.js → define-config-BRC7qPNE.js} +0 -0
  61. /package/dist/{help-DK5wuu34.js → help-YP84FSEz.js} +0 -0
  62. /package/dist/{lib-DpwyUJWo.js → lib-L3DWSRQp.js} +0 -0
  63. /package/dist/{main-DhsO6ndq.js → main-DpJl3LoU.js} +0 -0
  64. /package/dist/{pack-K7H72Cum.d.ts → pack-Ciiho0Tq.d.ts} +0 -0
  65. /package/dist/{report-CYPv1VK1.js → report-DgSBQUdz.js} +0 -0
  66. /package/dist/{resolve-vite-config-C5AjksTj.js → resolve-vite-config-TTvhycU1.js} +0 -0
  67. /package/dist/{terminal-D_Kg-AA6.js → terminal-uTv0ZaMr.js} +0 -0
package/dist/fmt.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import { format } from "oxfmt";
2
- export * from "oxfmt";
2
+ export type * from "oxfmt";
3
3
  export { format };
package/dist/index.cjs CHANGED
@@ -1,4 +1,4 @@
1
- const require_define_config = require("./define-config-GqLoRwH9.cjs");
1
+ const require_define_config = require("./define-config-BR1Y88zz.cjs");
2
2
  //#region src/index.cts
3
3
  const vite = require("@voidzero-dev/vite-plus-core");
4
4
  const vitest = require("@voidzero-dev/vite-plus-test/config");
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { n as lazyPlugins, t as defineConfig } from "./define-config-IMCGDS2K.js";
1
+ import { n as lazyPlugins, t as defineConfig } from "./define-config-COdn-tsn.js";
2
2
  export * from "@voidzero-dev/vite-plus-test/config";
3
3
  export * from "@voidzero-dev/vite-plus-core";
4
4
  export { defineConfig, lazyPlugins };
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { n as lazyPlugins, t as defineConfig } from "./define-config-CzWdQTt2.js";
1
+ import { n as lazyPlugins, t as defineConfig } from "./define-config-BRC7qPNE.js";
2
2
  export * from "@voidzero-dev/vite-plus-test/config";
3
3
  export * from "@voidzero-dev/vite-plus-core";
4
4
  export { defineConfig, lazyPlugins };
@@ -0,0 +1,8 @@
1
+ import { i as isWide, r as isFullWidth } from "./strip-ansi-C3wrWz9t.js";
2
+ //#region ../../node_modules/.pnpm/is-fullwidth-code-point@5.1.0/node_modules/is-fullwidth-code-point/index.js
3
+ function isFullwidthCodePoint(codePoint) {
4
+ if (!Number.isInteger(codePoint)) return false;
5
+ return isFullWidth(codePoint) || isWide(codePoint);
6
+ }
7
+ //#endregion
8
+ export { isFullwidthCodePoint as t };
package/dist/lint.d.ts CHANGED
@@ -1 +1 @@
1
- export * from "oxlint";
1
+ export type * from "oxlint";
@@ -1,6 +1,6 @@
1
- import { t as stripAnsi } from "./strip-ansi-D-eYYcD2.js";
2
- import { t as sliceAnsi } from "./slice-ansi-e4todZeH.js";
3
- import { t as wrapAnsi } from "./wrap-ansi-DtUeUCjE.js";
1
+ import { a as ansiStyles, t as stripAnsi } from "./strip-ansi-C3wrWz9t.js";
2
+ import { t as isFullwidthCodePoint } from "./is-fullwidth-code-point-BUNlIICg.js";
3
+ import { t as wrapAnsi } from "./wrap-ansi-k7Dn4VtV.js";
4
4
  import process$1 from "node:process";
5
5
  import os from "node:os";
6
6
  //#region ../../node_modules/.pnpm/environment@1.1.0/node_modules/environment/index.js
@@ -23,34 +23,18 @@ platform === "Android" || globalThis.navigator?.platform === "Android" || global
23
23
  //#endregion
24
24
  //#region ../../node_modules/.pnpm/ansi-escapes@7.2.0/node_modules/ansi-escapes/base.js
25
25
  const ESC = "\x1B[";
26
- const isTerminalApp = !isBrowser && process$1.env.TERM_PROGRAM === "Apple_Terminal";
26
+ !isBrowser && process$1.env.TERM_PROGRAM;
27
27
  const isWindows = !isBrowser && process$1.platform === "win32";
28
28
  !isBrowser && (process$1.env.TERM?.startsWith("screen") || process$1.env.TERM?.startsWith("tmux") || process$1.env.TMUX);
29
29
  isBrowser || process$1.cwd;
30
30
  const cursorUp = (count = 1) => ESC + count + "A";
31
- ESC + "";
32
- isTerminalApp || ESC + "";
33
- isTerminalApp || ESC + "";
34
- ESC + "";
35
- ESC + "";
36
- ESC + "";
37
- ESC + "";
38
- ESC + "";
39
31
  const eraseLines = (count) => {
40
32
  let clear = "";
41
33
  for (let i = 0; i < count; i++) clear += eraseLine + (i < count - 1 ? cursorUp() : "");
42
34
  if (count) clear += "\x1B[G";
43
35
  return clear;
44
36
  };
45
- ESC + "";
46
- ESC + "";
47
- const eraseLine = ESC + "2K";
48
- ESC + "";
49
- ESC + "";
50
- const eraseScreen = ESC + "2J";
51
- ESC + "";
52
- ESC + "";
53
- `${eraseScreen}${ESC}`;
37
+ const eraseLine = "\x1B[2K";
54
38
  const isOldWindows = () => {
55
39
  if (isBrowser || !isWindows) return false;
56
40
  const parts = os.release().split(".");
@@ -60,9 +44,7 @@ const isOldWindows = () => {
60
44
  if (major === 10 && build < 10586) return true;
61
45
  return false;
62
46
  };
63
- isOldWindows() ? `${eraseScreen}${ESC}` : `${eraseScreen}${ESC}${ESC}`;
64
- ESC + "";
65
- ESC + "";
47
+ isOldWindows();
66
48
  //#endregion
67
49
  //#region ../../node_modules/.pnpm/mimic-function@5.0.1/node_modules/mimic-function/index.js
68
50
  const copyProperty = (to, from, property, ignoreNonConfigurable) => {
@@ -355,6 +337,111 @@ cliCursor.toggle = (force, writableStream) => {
355
337
  else cliCursor.hide(writableStream);
356
338
  };
357
339
  //#endregion
340
+ //#region ../../node_modules/.pnpm/slice-ansi@7.1.2/node_modules/slice-ansi/index.js
341
+ const ESCAPES = new Set([27, 155]);
342
+ const CODE_POINT_0 = "0".codePointAt(0);
343
+ const CODE_POINT_9 = "9".codePointAt(0);
344
+ const MAX_ANSI_SEQUENCE_LENGTH = 19;
345
+ const endCodesSet = /* @__PURE__ */ new Set();
346
+ const endCodesMap = /* @__PURE__ */ new Map();
347
+ for (const [start, end] of ansiStyles.codes) {
348
+ endCodesSet.add(ansiStyles.color.ansi(end));
349
+ endCodesMap.set(ansiStyles.color.ansi(start), ansiStyles.color.ansi(end));
350
+ }
351
+ function getEndCode(code) {
352
+ if (endCodesSet.has(code)) return code;
353
+ if (endCodesMap.has(code)) return endCodesMap.get(code);
354
+ code = code.slice(2);
355
+ if (code.includes(";")) code = code[0] + "0";
356
+ const returnValue = ansiStyles.codes.get(Number.parseInt(code, 10));
357
+ if (returnValue) return ansiStyles.color.ansi(returnValue);
358
+ return ansiStyles.reset.open;
359
+ }
360
+ function findNumberIndex(string) {
361
+ for (let index = 0; index < string.length; index++) {
362
+ const codePoint = string.codePointAt(index);
363
+ if (codePoint >= CODE_POINT_0 && codePoint <= CODE_POINT_9) return index;
364
+ }
365
+ return -1;
366
+ }
367
+ function parseAnsiCode(string, offset) {
368
+ string = string.slice(offset, offset + MAX_ANSI_SEQUENCE_LENGTH);
369
+ const startIndex = findNumberIndex(string);
370
+ if (startIndex !== -1) {
371
+ let endIndex = string.indexOf("m", startIndex);
372
+ if (endIndex === -1) endIndex = string.length;
373
+ return string.slice(0, endIndex + 1);
374
+ }
375
+ }
376
+ function tokenize(string, endCharacter = Number.POSITIVE_INFINITY) {
377
+ const returnValue = [];
378
+ let index = 0;
379
+ let visibleCount = 0;
380
+ while (index < string.length) {
381
+ const codePoint = string.codePointAt(index);
382
+ if (ESCAPES.has(codePoint)) {
383
+ const code = parseAnsiCode(string, index);
384
+ if (code) {
385
+ returnValue.push({
386
+ type: "ansi",
387
+ code,
388
+ endCode: getEndCode(code)
389
+ });
390
+ index += code.length;
391
+ continue;
392
+ }
393
+ }
394
+ const isFullWidth = isFullwidthCodePoint(codePoint);
395
+ const character = String.fromCodePoint(codePoint);
396
+ returnValue.push({
397
+ type: "character",
398
+ value: character,
399
+ isFullWidth
400
+ });
401
+ index += character.length;
402
+ visibleCount += isFullWidth ? 2 : character.length;
403
+ if (visibleCount >= endCharacter) break;
404
+ }
405
+ return returnValue;
406
+ }
407
+ function reduceAnsiCodes(codes) {
408
+ let returnValue = [];
409
+ for (const code of codes) if (code.code === ansiStyles.reset.open) returnValue = [];
410
+ else if (endCodesSet.has(code.code)) returnValue = returnValue.filter((returnValueCode) => returnValueCode.endCode !== code.code);
411
+ else {
412
+ returnValue = returnValue.filter((returnValueCode) => returnValueCode.endCode !== code.endCode);
413
+ returnValue.push(code);
414
+ }
415
+ return returnValue;
416
+ }
417
+ function undoAnsiCodes(codes) {
418
+ return reduceAnsiCodes(codes).map(({ endCode }) => endCode).reverse().join("");
419
+ }
420
+ function sliceAnsi(string, start, end) {
421
+ const tokens = tokenize(string, end);
422
+ let activeCodes = [];
423
+ let position = 0;
424
+ let returnValue = "";
425
+ let include = false;
426
+ for (const token of tokens) {
427
+ if (end !== void 0 && position >= end) break;
428
+ if (token.type === "ansi") {
429
+ activeCodes.push(token);
430
+ if (include) returnValue += token.code;
431
+ } else {
432
+ if (!include && position >= start) {
433
+ include = true;
434
+ activeCodes = reduceAnsiCodes(activeCodes);
435
+ returnValue = activeCodes.map(({ code }) => code).join("");
436
+ }
437
+ if (include) returnValue += token.value;
438
+ position += token.isFullWidth ? 2 : token.value.length;
439
+ }
440
+ }
441
+ returnValue += undoAnsiCodes(activeCodes);
442
+ return returnValue;
443
+ }
444
+ //#endregion
358
445
  //#region ../../node_modules/.pnpm/log-update@6.1.0/node_modules/log-update/index.js
359
446
  const defaultTerminalHeight = 24;
360
447
  const getWidth = ({ columns = 80 }) => columns;
@@ -1,12 +1,13 @@
1
- import { r as __toESM } from "../chunk-q7NCDQ7-.js";
2
- import { o as isForceOverrideMode } from "../constants-kDaYqyWd.js";
3
- import { a as printHeader, i as muted, r as log, t as accent } from "../terminal-D_Kg-AA6.js";
4
- import { $ as log$1, C as migratePrettierToOxfmt, D as rewriteMonorepo, E as promptPrettierMigration, G as displayRelative, H as runViteInstall, I as cancelAndExit, J as PackageManager, L as defaultInteractive, M as warnPackageLevelEslint, N as warnPackageLevelPrettier, R as downloadPackageManager, S as migrateNodeVersionManagerFile, T as promptEslintMigration, U as selectPackageManager, W as upgradeYarn, Y as require_semver, Z as confirm, a as writeAgentInstructions, b as mergeViteConfigFiles, c as checkVitestVersion, d as detectEslintProject, f as detectFramework, g as hasFrameworkShim, j as warnLegacyEslintConfig, k as rewriteStandaloneProject, l as confirmEslintMigration, m as detectPrettierProject, n as detectExistingAgentTargetPaths, nt as select, o as addFrameworkShim, ot as q, p as detectNodeVersionManagerFile, r as selectAgentTargetPaths, rt as spinner, s as checkViteVersion, t as detectAgentConflicts, tt as outro, u as confirmPrettierMigration, w as preflightGitHooksSetup, x as migrateEslintToOxlint, y as installGitHooks, z as promptGitHooks } from "../agent-BWLe0i9g.js";
5
- import { t as lib_default } from "../lib-DpwyUJWo.js";
6
- import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-BoLLED6j.js";
7
- import { r as createMigrationReport } from "../report-CYPv1VK1.js";
8
- import { c as writeEditorConfigs, i as detectEditorConflicts, o as selectEditor, t as detectWorkspace } from "../workspace-Bi_9spVt.js";
9
- import { t as renderCliDoc } from "../help-DK5wuu34.js";
1
+ import { r as __toESM } from "../chunk-DnnnRqeS.js";
2
+ import { c as isForceOverrideMode } from "../constants-DCBWlNrn.js";
3
+ import { A as R, C as log, D as spinner, E as select, T as outro, c as defaultInteractive, d as promptGitHooks, g as upgradeYarn, h as selectPackageManager, i as hasBaseUrlInTsconfig, l as downloadPackageManager, m as runViteInstall, r as fixBaseUrlInTsconfig, s as cancelAndExit, t as confirmBaseUrlFix, v as PackageManager, x as confirm, y as require_semver } from "../tsconfig-DFb5BKyT.js";
4
+ import { a as printHeader, i as muted, r as log$1, t as accent } from "../terminal-uTv0ZaMr.js";
5
+ import { t as lib_default } from "../lib-L3DWSRQp.js";
6
+ import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-PmBUZ-ve.js";
7
+ import { A as promptEslintMigration, C as injectLintTypeCheckDefaults, D as migrateNodeVersionManagerFile, E as migrateEslintToOxlint, H as displayRelative, I as warnIncompatibleEslintIntegration, L as warnLegacyEslintConfig, M as rewriteMonorepo, O as migratePrettierToOxfmt, P as rewriteStandaloneProject, R as warnPackageLevelEslint, T as mergeViteConfigFiles, _ as detectNodeVersionManagerFile, b as hasFrameworkShim, d as checkVitestVersion, f as confirmEslintMigration, g as detectIncompatibleEslintIntegration, h as detectFramework, i as selectAgentTargetPaths, j as promptPrettierMigration, k as preflightGitHooksSetup, l as addFrameworkShim, m as detectEslintProject, n as detectAgentConflicts, p as confirmPrettierMigration, r as detectExistingAgentTargetPaths, s as writeAgentInstructions, u as checkViteVersion, v as detectPrettierProject, w as installGitHooks, z as warnPackageLevelPrettier } from "../agent-Nuk-9l77.js";
8
+ import { n as addMigrationWarning, r as createMigrationReport } from "../report-DgSBQUdz.js";
9
+ import { c as writeEditorConfigs, i as detectEditorConflicts, o as selectEditor, t as detectWorkspace } from "../workspace-NL-m9wgM.js";
10
+ import { t as renderCliDoc } from "../help-YP84FSEz.js";
10
11
  import path from "node:path";
11
12
  import { styleText } from "node:util";
12
13
  //#region src/migration/bin.ts
@@ -21,7 +22,7 @@ async function confirmNodeVersionFileMigration(interactive, detection) {
21
22
  message,
22
23
  initialValue: true
23
24
  });
24
- if (q(confirmed)) cancelAndExit();
25
+ if (R(confirmed)) cancelAndExit();
25
26
  return confirmed;
26
27
  }
27
28
  return true;
@@ -36,11 +37,36 @@ async function confirmFrameworkShim(framework, interactive) {
36
37
  message: `Add TypeScript shim for ${name} component files (*.${framework})?\n ` + styleText("gray", `Lets TypeScript recognize .${framework} files until vp check fully supports them.`),
37
38
  initialValue: true
38
39
  });
39
- if (q(confirmed)) cancelAndExit();
40
+ if (R(confirmed)) cancelAndExit();
40
41
  return confirmed;
41
42
  }
42
43
  return true;
43
44
  }
45
+ async function fixBaseUrlForWorkspace(workspaceInfo, fixBaseUrl, updateProgress, report) {
46
+ if (!fixBaseUrl) return [];
47
+ const fixedProjectPaths = [];
48
+ for (const projectPath of getWorkspaceProjectPaths(workspaceInfo)) {
49
+ if (!hasBaseUrlInTsconfig(projectPath)) continue;
50
+ updateProgress?.(`Fixing tsconfig baseUrl${projectPath === workspaceInfo.rootDir ? "" : ` in ${displayRelative(projectPath, workspaceInfo.rootDir)}`}`);
51
+ const status = await fixBaseUrlInTsconfig(projectPath, {
52
+ confirmed: true,
53
+ silent: true
54
+ });
55
+ if (status === "failed") addMigrationWarning(report, `Failed to remove tsconfig baseUrl in ${displayRelative(projectPath, workspaceInfo.rootDir) || "."}. Run \`vp dlx @andrewbranch/ts5to6 --fixBaseUrl <tsconfig path>\` manually and re-run the migration.`);
56
+ if (status === "fixed") fixedProjectPaths.push(projectPath);
57
+ }
58
+ return fixedProjectPaths;
59
+ }
60
+ function getWorkspaceProjectPaths(workspaceInfo) {
61
+ return [workspaceInfo.rootDir, ...(workspaceInfo.packages ?? []).map((pkg) => path.join(workspaceInfo.rootDir, pkg.path))];
62
+ }
63
+ function hasBaseUrlInWorkspace(workspaceInfo) {
64
+ for (const projectPath of getWorkspaceProjectPaths(workspaceInfo)) {
65
+ if (!hasBaseUrlInTsconfig(projectPath)) continue;
66
+ return true;
67
+ }
68
+ return false;
69
+ }
44
70
  const helpMessage = renderCliDoc({
45
71
  usage: "vp migrate [PATH] [OPTIONS]",
46
72
  summary: "Migrate standalone Vite, Vitest, Oxlint, Oxfmt, and Prettier projects to unified Vite+.",
@@ -118,8 +144,9 @@ const helpMessage = renderCliDoc({
118
144
  " After the migration:",
119
145
  " - Confirm `vite` imports were rewritten to `vite-plus` where needed",
120
146
  " - Confirm `vitest` imports were rewritten to `vite-plus/test` where needed",
121
- " - Remove old `vite` and `vitest` dependencies only after those rewrites",
122
- " are confirmed",
147
+ " - On pnpm, keep the `vite` / `vitest` entries that `vp migrate` aliased to",
148
+ " the Vite+ packages so the workspace override stays effective; with other",
149
+ " package managers you can remove them once those rewrites are confirmed",
123
150
  " - Move remaining tool-specific config into the appropriate blocks in",
124
151
  " `vite.config.ts`",
125
152
  "",
@@ -174,9 +201,9 @@ async function collectMigrationPlan(rootDir, detectedPackageManager, options, pa
174
201
  const packageManager = detectedPackageManager ?? await selectPackageManager(options.interactive, true);
175
202
  let shouldSetupHooks = await promptGitHooks(options);
176
203
  if (shouldSetupHooks) {
177
- const reason = preflightGitHooksSetup(rootDir);
204
+ const reason = preflightGitHooksSetup(rootDir, packageManager);
178
205
  if (reason) {
179
- log$1.warn(`⚠ ${reason}`);
206
+ log.warn(`⚠ ${reason}`);
180
207
  shouldSetupHooks = false;
181
208
  }
182
209
  }
@@ -205,7 +232,7 @@ async function collectMigrationPlan(rootDir, detectedPackageManager, options, pa
205
232
  }],
206
233
  initialValue: "skip"
207
234
  });
208
- if (q(action)) cancelAndExit();
235
+ if (R(action)) cancelAndExit();
209
236
  agentConflictDecisions.set(conflict.targetPath, action);
210
237
  } else agentConflictDecisions.set(conflict.targetPath, "skip");
211
238
  const selectedEditor = await selectEditor({
@@ -232,18 +259,24 @@ async function collectMigrationPlan(rootDir, detectedPackageManager, options, pa
232
259
  }],
233
260
  initialValue: "skip"
234
261
  });
235
- if (q(action)) cancelAndExit();
262
+ if (R(action)) cancelAndExit();
236
263
  editorConflictDecisions.set(conflict.fileName, action);
237
264
  } else editorConflictDecisions.set(conflict.fileName, "merge");
238
265
  const eslintProject = detectEslintProject(rootDir, packages);
266
+ const incompatibleEslintIntegration = detectIncompatibleEslintIntegration(rootDir, packages);
239
267
  let migrateEslint = false;
240
- if (eslintProject.hasDependency && !eslintProject.configFile && eslintProject.legacyConfigFile) warnLegacyEslintConfig(eslintProject.legacyConfigFile);
268
+ if (incompatibleEslintIntegration) warnIncompatibleEslintIntegration(incompatibleEslintIntegration);
269
+ else if (eslintProject.hasDependency && !eslintProject.configFile && eslintProject.legacyConfigFile) warnLegacyEslintConfig(eslintProject.legacyConfigFile);
241
270
  else if (eslintProject.hasDependency && eslintProject.configFile) migrateEslint = await confirmEslintMigration(options.interactive);
242
271
  else if (eslintProject.hasDependency) warnPackageLevelEslint();
243
272
  const prettierProject = detectPrettierProject(rootDir, packages);
244
273
  let migratePrettier = false;
245
274
  if (prettierProject.hasDependency && prettierProject.configFile) migratePrettier = await confirmPrettierMigration(options.interactive);
246
275
  else if (prettierProject.hasDependency) warnPackageLevelPrettier();
276
+ const fixBaseUrl = hasBaseUrlInWorkspace({
277
+ rootDir,
278
+ packages
279
+ }) ? await confirmBaseUrlFix(options.interactive) : false;
247
280
  const nodeVersionDetection = detectNodeVersionManagerFile(rootDir);
248
281
  let migrateNodeVersionFile = false;
249
282
  if (nodeVersionDetection) migrateNodeVersionFile = await confirmNodeVersionFileMigration(options.interactive, nodeVersionDetection);
@@ -267,6 +300,7 @@ async function collectMigrationPlan(rootDir, detectedPackageManager, options, pa
267
300
  eslintConfigFile: eslintProject.configFile,
268
301
  migratePrettier,
269
302
  prettierConfigFile: prettierProject.configFile,
303
+ fixBaseUrl,
270
304
  migrateNodeVersionFile,
271
305
  nodeVersionDetection,
272
306
  frameworkShimFrameworks: frameworkShimFrameworks.length > 0 ? frameworkShimFrameworks : void 0
@@ -282,33 +316,33 @@ function showMigrationSummary(options) {
282
316
  const { projectRoot, packageManager, packageManagerVersion, installDurationMs, report, updatedExistingVitePlus } = options;
283
317
  const projectLabel = displayRelative(projectRoot) || ".";
284
318
  const configUpdates = report.createdViteConfigCount + report.mergedConfigCount + report.mergedStagedConfigCount + report.inlinedLintStagedConfigCount + report.removedConfigCount + report.tsdownImportCount;
285
- log(`${styleText("magenta", "◇")} ${updatedExistingVitePlus ? "Updated" : "Migrated"} ${accent(projectLabel)}${updatedExistingVitePlus ? "" : " to Vite+"}`);
286
- log(`${styleText("gray", "•")} Node ${process.versions.node} ${packageManager} ${packageManagerVersion}`);
287
- if (installDurationMs > 0) log(`${styleText("green", "✓")} Dependencies installed in ${formatDuration(installDurationMs)}`);
319
+ log$1(`${styleText("magenta", "◇")} ${updatedExistingVitePlus ? "Updated" : "Migrated"} ${accent(projectLabel)}${updatedExistingVitePlus ? "" : " to Vite+"}`);
320
+ log$1(`${styleText("gray", "•")} Node ${process.versions.node} ${packageManager} ${packageManagerVersion}`);
321
+ if (installDurationMs > 0) log$1(`${styleText("green", "✓")} Dependencies installed in ${formatDuration(installDurationMs)}`);
288
322
  if (configUpdates > 0 || report.rewrittenImportFileCount > 0) {
289
323
  const parts = [];
290
324
  if (configUpdates > 0) parts.push(`${configUpdates} ${configUpdates === 1 ? "config update" : "config updates"} applied`);
291
325
  if (report.rewrittenImportFileCount > 0) parts.push(`${report.rewrittenImportFileCount} ${report.rewrittenImportFileCount === 1 ? "file had" : "files had"} imports rewritten`);
292
- log(`${styleText("gray", "•")} ${parts.join(", ")}`);
326
+ log$1(`${styleText("gray", "•")} ${parts.join(", ")}`);
293
327
  }
294
- if (report.eslintMigrated) log(`${styleText("gray", "•")} ESLint rules migrated to Oxlint`);
295
- if (report.prettierMigrated) log(`${styleText("gray", "•")} Prettier migrated to Oxfmt`);
296
- if (report.nodeVersionFileMigrated) log(`${styleText("gray", "•")} Node version manager file migrated to .node-version`);
297
- if (report.gitHooksConfigured) log(`${styleText("gray", "•")} Git hooks configured`);
298
- if (report.frameworkShimAdded) log(`${styleText("gray", "•")} TypeScript shim added for framework component files`);
328
+ if (report.eslintMigrated) log$1(`${styleText("gray", "•")} ESLint rules migrated to Oxlint`);
329
+ if (report.prettierMigrated) log$1(`${styleText("gray", "•")} Prettier migrated to Oxfmt`);
330
+ if (report.nodeVersionFileMigrated) log$1(`${styleText("gray", "•")} Node version manager file migrated to .node-version`);
331
+ if (report.gitHooksConfigured) log$1(`${styleText("gray", "•")} Git hooks configured`);
332
+ if (report.frameworkShimAdded) log$1(`${styleText("gray", "•")} TypeScript shim added for framework component files`);
299
333
  if (report.warnings.length > 0) {
300
- log(`${styleText("yellow", "!")} Warnings:`);
301
- for (const warning of report.warnings) log(` - ${warning}`);
334
+ log$1(`${styleText("yellow", "!")} Warnings:`);
335
+ for (const warning of report.warnings) log$1(` - ${warning}`);
302
336
  }
303
337
  if (report.manualSteps.length > 0) {
304
- log(`${styleText("blue", "→")} Manual follow-up:`);
305
- for (const step of report.manualSteps) log(` - ${step}`);
338
+ log$1(`${styleText("blue", "→")} Manual follow-up:`);
339
+ for (const step of report.manualSteps) log$1(` - ${step}`);
306
340
  }
307
341
  }
308
342
  async function checkRolldownCompatibility(rootDir, report) {
309
343
  try {
310
344
  const { resolveConfig } = await import("../index.js");
311
- const { checkManualChunksCompat } = await import("../compat-OlmU9EQz.js");
345
+ const { checkManualChunksCompat } = await import("../compat-DXZgnEyq.js");
312
346
  checkManualChunksCompat((await resolveConfig({
313
347
  root: rootDir,
314
348
  logLevel: "silent",
@@ -353,11 +387,11 @@ async function executeMigrationPlan(workspaceInfoOptional, plan, interactive) {
353
387
  await upgradeYarn(workspaceInfo.rootDir, interactive, true);
354
388
  } else if (plan.packageManager === PackageManager.pnpm && import_semver.default.satisfies(downloadResult.version, "< 9.5.0")) {
355
389
  failMigrationProgress("Migration failed");
356
- log$1.error(`✘ pnpm@${downloadResult.version} is not supported by auto migration, please upgrade pnpm to >=9.5.0 first`);
390
+ log.error(`✘ pnpm@${downloadResult.version} is not supported by auto migration, please upgrade pnpm to >=9.5.0 first`);
357
391
  cancelAndExit("Vite+ cannot automatically migrate this project yet.", 1);
358
392
  } else if (plan.packageManager === PackageManager.npm && import_semver.default.satisfies(downloadResult.version, "< 8.3.0")) {
359
393
  failMigrationProgress("Migration failed");
360
- log$1.error(`✘ npm@${downloadResult.version} is not supported by auto migration, please upgrade npm to >=8.3.0 first`);
394
+ log.error(`✘ npm@${downloadResult.version} is not supported by auto migration, please upgrade npm to >=8.3.0 first`);
361
395
  cancelAndExit("Vite+ cannot automatically migrate this project yet.", 1);
362
396
  }
363
397
  if (plan.migrateNodeVersionFile && plan.nodeVersionDetection) {
@@ -380,6 +414,7 @@ async function executeMigrationPlan(workspaceInfoOptional, plan, interactive) {
380
414
  updateMigrationProgress("Checking config compatibility");
381
415
  await checkRolldownCompatibility(workspaceInfo.rootDir, report);
382
416
  if (workspaceInfo.packages) for (const pkg of workspaceInfo.packages) await checkRolldownCompatibility(path.join(workspaceInfo.rootDir, pkg.path), report);
417
+ await fixBaseUrlForWorkspace(workspaceInfo, plan.fixBaseUrl, updateMigrationProgress, report);
383
418
  if (plan.migrateEslint) {
384
419
  updateMigrationProgress("Migrating ESLint");
385
420
  if (!await migrateEslintToOxlint(workspaceInfo.rootDir, interactive, plan.eslintConfigFile, workspaceInfo.packages, {
@@ -406,7 +441,7 @@ async function executeMigrationPlan(workspaceInfoOptional, plan, interactive) {
406
441
  else rewriteStandaloneProject(workspaceInfo.rootDir, workspaceInfo, skipStagedMigration, true, report);
407
442
  if (plan.shouldSetupHooks) {
408
443
  updateMigrationProgress("Configuring git hooks");
409
- installGitHooks(workspaceInfo.rootDir, true, report);
444
+ installGitHooks(workspaceInfo.rootDir, true, report, plan.packageManager);
410
445
  }
411
446
  updateMigrationProgress("Writing agent instructions");
412
447
  await writeAgentInstructions({
@@ -452,7 +487,7 @@ async function main() {
452
487
  const { projectPath, options } = parseArgs();
453
488
  if (options.help) {
454
489
  printHeader();
455
- log(helpMessage);
490
+ log$1(helpMessage);
456
491
  return;
457
492
  }
458
493
  printHeader();
@@ -480,6 +515,13 @@ async function main() {
480
515
  migrationProgressStarted = false;
481
516
  }
482
517
  };
518
+ const fixedBaseUrlProjectPaths = await fixBaseUrlForWorkspace(workspaceInfoOptional, hasBaseUrlInWorkspace(workspaceInfoOptional) ? await confirmBaseUrlFix(options.interactive) : false, updateMigrationProgress, report);
519
+ if (fixedBaseUrlProjectPaths.length > 0) {
520
+ updateMigrationProgress("Updating lint defaults");
521
+ for (const projectPath of fixedBaseUrlProjectPaths) injectLintTypeCheckDefaults(projectPath, true, report);
522
+ didMigrate = true;
523
+ }
524
+ clearMigrationProgress();
483
525
  const eslintMigrated = await promptEslintMigration(workspaceInfoOptional.rootDir, options.interactive, workspaceInfoOptional.packages);
484
526
  const prettierMigrated = await promptPrettierMigration(workspaceInfoOptional.rootDir, options.interactive, workspaceInfoOptional.packages);
485
527
  const nodeVersionDetection = detectNodeVersionManagerFile(workspaceInfoOptional.rootDir);
@@ -488,7 +530,7 @@ async function main() {
488
530
  }
489
531
  if (eslintMigrated || prettierMigrated) {
490
532
  updateMigrationProgress("Rewriting configs");
491
- mergeViteConfigFiles(workspaceInfoOptional.rootDir, true, report);
533
+ mergeViteConfigFiles(workspaceInfoOptional.rootDir, true, report, workspaceInfoOptional.packages);
492
534
  updateMigrationProgress("Installing dependencies");
493
535
  let resolvedVersion = workspaceInfoOptional.packageManagerVersion;
494
536
  if (workspaceInfoOptional.packageManager && !import_semver.default.valid(import_semver.default.coerce(resolvedVersion) ?? "")) resolvedVersion = (await downloadPackageManager(workspaceInfoOptional.packageManager, resolvedVersion, options.interactive, true)).version;
@@ -505,7 +547,7 @@ async function main() {
505
547
  if (rootPkg?.devDependencies?.husky || rootPkg?.dependencies?.husky || rootPkg?.devDependencies?.["lint-staged"] || rootPkg?.dependencies?.["lint-staged"]) {
506
548
  const shouldSetupHooks = await promptGitHooks(options);
507
549
  if (shouldSetupHooks) updateMigrationProgress("Configuring git hooks");
508
- if (shouldSetupHooks && installGitHooks(workspaceInfoOptional.rootDir, true, report)) didMigrate = true;
550
+ if (shouldSetupHooks && installGitHooks(workspaceInfoOptional.rootDir, true, report, workspaceInfoOptional.packageManager)) didMigrate = true;
509
551
  }
510
552
  await checkRolldownCompatibility(workspaceInfoOptional.rootDir, report);
511
553
  if (workspaceInfoOptional.packages) for (const pkg of workspaceInfoOptional.packages) await checkRolldownCompatibility(path.join(workspaceInfoOptional.rootDir, pkg.path), report);
@@ -533,7 +575,7 @@ async function main() {
533
575
  });
534
576
  }
535
577
  main().catch((err) => {
536
- log$1.error(err.message);
578
+ log.error(err.message);
537
579
  console.error(err);
538
580
  process.exit(1);
539
581
  });
@@ -1,4 +1,4 @@
1
- import { r as VITE_PLUS_NAME } from "./constants-kDaYqyWd.js";
1
+ import { i as VITE_PLUS_NAME } from "./constants-DCBWlNrn.js";
2
2
  //#region src/oxlint-plugin-config.ts
3
3
  const VITE_PLUS_OXLINT_PLUGIN_NAME = VITE_PLUS_NAME;
4
4
  const VITE_PLUS_OXLINT_PLUGIN_SPECIFIER = `${VITE_PLUS_NAME}/oxlint-plugin`;
@@ -1,8 +1,6 @@
1
- import * as _$_oxlint_plugins0 from "@oxlint/plugins";
2
-
3
1
  //#region src/oxlint-plugin.d.ts
4
2
  declare function rewriteVitePlusImportSpecifier(specifier: string): string | null;
5
- declare const preferVitePlusImportsRule: _$_oxlint_plugins0.Rule;
6
- declare const plugin: _$_oxlint_plugins0.Plugin;
3
+ declare const preferVitePlusImportsRule: import("@oxlint/plugins").Rule;
4
+ declare const plugin: import("@oxlint/plugins").Plugin;
7
5
  //#endregion
8
6
  export { plugin as default, preferVitePlusImportsRule, rewriteVitePlusImportSpecifier };
@@ -1,4 +1,4 @@
1
- import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-BkQeR4FR.js";
1
+ import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-B89iKTKN.js";
2
2
  import { definePlugin, defineRule } from "@oxlint/plugins";
3
3
  //#region src/oxlint-plugin.ts
4
4
  function rewriteVitePlusImportSpecifier(specifier) {
package/dist/pack-bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as resolveViteConfig } from "./resolve-vite-config-C5AjksTj.js";
2
+ import { i as resolveViteConfig } from "./resolve-vite-config-TTvhycU1.js";
3
3
  import module from "node:module";
4
4
  import { buildWithConfigs, enableDebug, globalLogger, resolveUserConfig } from "@voidzero-dev/vite-plus-core/pack";
5
5
  //#region ../../node_modules/.pnpm/cac@7.0.0/node_modules/cac/dist/index.js
package/dist/pack.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { t as PackUserConfig } from "./pack-K7H72Cum.js";
1
+ import { t as PackUserConfig } from "./pack-Ciiho0Tq.js";
2
2
  export * from "@voidzero-dev/vite-plus-core/pack";
3
3
  export { PackUserConfig };
@@ -1,5 +1,5 @@
1
- import "./constants-kDaYqyWd.js";
2
- import { r as parse } from "./main-DhsO6ndq.js";
1
+ import "./constants-DCBWlNrn.js";
2
+ import { r as parse } from "./main-DpJl3LoU.js";
3
3
  import { createRequire } from "node:module";
4
4
  import path from "node:path";
5
5
  import fs from "node:fs";