vite-plus 0.2.6 → 0.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +4 -0
- package/LICENSE +5 -1
- package/README.md +1 -1
- package/bin/vpr +3 -2
- package/binding/index.cjs +193 -80
- package/binding/index.d.cts +99 -8
- package/dist/agent-CI79DuSy.js +600 -0
- package/dist/bin.js +1367 -11
- package/dist/{cli-truncate-BVOlIIPy.js → cli-truncate-Bg3RDXpi.js} +0 -2
- package/dist/client/bundledDevClient.mjs +1 -0
- package/dist/config/bin.js +13 -126
- package/dist/{constants-CaXMuYUG.js → constants-BppDcRc1.js} +1 -1
- package/dist/create/bin.js +90 -77
- package/dist/{define-config-iGV0CGUk.cjs → define-config-CEm_MtvJ.cjs} +1 -1
- package/dist/{define-config-hV8qyU8p.js → define-config-DPnHe1Mx.js} +2 -2
- package/dist/{define-config-eLQH9us2.d.ts → define-config-DWoAkNdp.d.ts} +16 -0
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CKz3vcoG.js → dist-CSQWHI6y.js} +3 -8
- package/dist/dist-DT25H9pj.js +3 -0
- package/dist/{agent-0gFJkIKu.js → editor-CGWdbLgD.js} +709 -579
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-DiRs8ceZ.js → json-BU88uu6o.js} +2 -6
- package/dist/migration/bin.js +60 -50
- package/dist/{oxlint-plugin-config-CMSCIkks.js → oxlint-plugin-config-BHOzlwMw.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +2 -2
- package/dist/{package-CP5EUXlu.js → package-hV-77cBb.js} +2 -2
- package/dist/{tsconfig-Cac-NNdT.js → prompts-DYap08te.js} +32 -174
- package/dist/{resolve-vite-config-BY7PB-LW.js → resolve-vite-config-EWXclqvV.js} +1 -1
- package/dist/{rolldown-runtime-C7HZzL1F.js → rolldown-runtime-CMFfr-1z.js} +1 -1
- package/dist/staged/bin.js +20 -23
- package/dist/{help-YP84FSEz.js → terminal-CrqqK8WT.js} +39 -2
- package/dist/tsconfig-CVUKLfL8.js +151 -0
- package/dist/{tsgolint-path-B-yOos8p.js → tsgolint-path-eMZT-oea.js} +4 -2
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +5 -5
- package/dist/versions.js +5 -5
- package/docs/config/index.md +13 -0
- package/docs/config/staged.md +2 -1
- package/docs/guide/build.md +1 -1
- package/docs/guide/ci.md +28 -3
- package/docs/guide/commit-hooks.md +76 -9
- package/docs/guide/dev.md +4 -0
- package/docs/guide/env.md +8 -4
- package/docs/guide/index.md +1 -1
- package/docs/guide/install.md +2 -0
- package/docs/guide/installer-env-vars.md +3 -3
- package/docs/guide/migrate.md +11 -3
- package/docs/guide/monorepo.md +94 -6
- package/docs/guide/run.md +15 -0
- package/docs/guide/test.md +4 -0
- package/docs/guide/troubleshooting.md +9 -5
- package/package.json +18 -24
- package/dist/dist-CtM2JRbM.js +0 -3
- package/dist/editor-D4T70tKk.js +0 -675
- package/dist/terminal-uTv0ZaMr.js +0 -33
- package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_define_config = require("./define-config-
|
|
1
|
+
const require_define_config = require("./define-config-CEm_MtvJ.cjs");
|
|
2
2
|
//#region src/index.cts
|
|
3
3
|
const vite = require("@voidzero-dev/vite-plus-core");
|
|
4
4
|
const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-DWoAkNdp.js";
|
|
2
2
|
import { TestProjectConfiguration, TestProjectInlineConfiguration, TestTagDefinition, TestUserConfig, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig, ViteUserConfig, ViteUserConfigExport, ViteUserConfigFn, ViteUserConfigFnObject, ViteUserConfigFnPromise, WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "@voidzero-dev/vite-plus-core";
|
|
4
4
|
export { type TestProjectConfiguration, type TestProjectInlineConfiguration, type TestTagDefinition, type TestUserConfig, type UserProjectConfigExport, type UserProjectConfigFn, type UserWorkspaceConfig, type ViteUserConfig, type ViteUserConfigExport, type ViteUserConfigFn, type ViteUserConfigFnObject, type ViteUserConfigFnPromise, type WatcherTriggerPattern, configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-DPnHe1Mx.js";
|
|
2
2
|
import { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "@voidzero-dev/vite-plus-core";
|
|
4
4
|
export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
|
|
@@ -535,9 +535,7 @@ function format(documentText, range, options) {
|
|
|
535
535
|
else if ((secondToken === 12 || secondToken === 13) && !needsLineBreak) replaceContent = cachedSpaces[1];
|
|
536
536
|
else if (secondToken !== 5 && secondToken !== 17) hasError = true;
|
|
537
537
|
break;
|
|
538
|
-
case 16:
|
|
539
|
-
hasError = true;
|
|
540
|
-
break;
|
|
538
|
+
case 16: hasError = true;
|
|
541
539
|
}
|
|
542
540
|
if (numberLineBreaks > 0 && (secondToken === 12 || secondToken === 13)) replaceContent = newLinesAndIndent();
|
|
543
541
|
}
|
|
@@ -800,9 +798,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
800
798
|
case 2:
|
|
801
799
|
handleError(12);
|
|
802
800
|
break;
|
|
803
|
-
case 6:
|
|
804
|
-
handleError(16);
|
|
805
|
-
break;
|
|
801
|
+
case 6: handleError(16);
|
|
806
802
|
}
|
|
807
803
|
switch (token) {
|
|
808
804
|
case 12:
|
package/dist/migration/bin.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { r as __toESM } from "../rolldown-runtime-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { a as writeJsonFile, i as readJsonFile } from "../json-
|
|
1
|
+
import { r as __toESM } from "../rolldown-runtime-CMFfr-1z.js";
|
|
2
|
+
import { a as printHeader, c as renderCliDoc, i as muted, r as log, s as warnMsg, t as accent } from "../terminal-CrqqK8WT.js";
|
|
3
|
+
import { d as isForceOverrideMode, l as VITE_PLUS_VERSION } from "../constants-BppDcRc1.js";
|
|
4
|
+
import { A as isCancel, C as log$1, D as spinner, E as select, M as runCommandSilently, T as outro, c as selectPackageManager, i as promptGitHooks, l as upgradeYarn, n as defaultInteractive, o as runViteFmt, r as downloadPackageManager, s as runViteInstall, t as cancelAndExit, v as PackageManager, x as confirm, y as require_semver } from "../prompts-DYap08te.js";
|
|
5
|
+
import { a as writeJsonFile, i as readJsonFile } from "../json-BU88uu6o.js";
|
|
6
|
+
import { i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig, t as confirmBaseUrlFix } from "../tsconfig-CVUKLfL8.js";
|
|
6
7
|
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
7
|
-
import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-
|
|
8
|
-
import {
|
|
8
|
+
import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-hV-77cBb.js";
|
|
9
|
+
import { f as displayRelative, i as selectAgentTargetPaths, n as detectAgentConflicts, r as detectExistingAgentTargetPaths, s as writeAgentInstructions } from "../agent-CI79DuSy.js";
|
|
9
10
|
import { n as addMigrationWarning, r as createMigrationReport } from "../report-BS7ULx7A.js";
|
|
10
|
-
import {
|
|
11
|
-
import { t as renderCliDoc } from "../help-YP84FSEz.js";
|
|
11
|
+
import { A as addFrameworkShim, B as detectIncompatibleEslintIntegration, C as ensureVitePlusBootstrap, E as detectWorkspace, F as migratePrettierToOxfmt, G as warnPackageLevelEslint, K as checkViteVersion, L as warnPackageLevelPrettier, M as hasFrameworkShim, N as confirmPrettierMigration, P as detectPrettierProject, R as confirmEslintMigration, S as detectVitePlusBootstrapPending, T as detectYarnPnpMode, U as warnIncompatibleEslintIntegration, V as migrateEslintToOxlint, W as warnLegacyEslintConfig, _ as shouldSkipStagedMigrationForHooks, a as writeEditorConfigs, b as mergeViteConfigFiles, c as rewriteStandaloneProject, d as detectNodeVersionManagerFile, f as migrateNodeVersionManagerFile, g as preflightGitHooksSetup, h as installGitHooks, j as detectFramework, l as detectPendingCoreMigration, m as detectLegacyGitHooksMigrationCandidate, o as rewriteMonorepo, q as checkVitestVersion, r as selectEditor, t as detectEditorConflicts, u as finalizeCoreMigrationForExistingVitePlus, w as configureYarnNodeModulesMode, x as collectToolchainVersionChanges, y as injectLintTypeCheckDefaults, z as detectEslintProject } from "../editor-CGWdbLgD.js";
|
|
12
12
|
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../protocol-D99W10Qi.js";
|
|
13
13
|
import path from "node:path";
|
|
14
|
-
import fs, { existsSync } from "node:fs";
|
|
15
14
|
import { styleText } from "node:util";
|
|
15
|
+
import fs, { existsSync } from "node:fs";
|
|
16
16
|
import { fileURLToPath } from "node:url";
|
|
17
17
|
//#region src/migration/compat/runner.ts
|
|
18
18
|
var import_semver = /* @__PURE__ */ __toESM(require_semver(), 1);
|
|
@@ -290,12 +290,12 @@ function prepareNpmViteAliasReinstall(rootDir, projectPaths = [rootDir]) {
|
|
|
290
290
|
}
|
|
291
291
|
//#endregion
|
|
292
292
|
//#region src/migration/setup-plan.ts
|
|
293
|
-
async function collectGitHooksDecision(rootDir, packageManager, options) {
|
|
293
|
+
async function collectGitHooksDecision(rootDir, packageManager, options, packages = []) {
|
|
294
294
|
let shouldSetupHooks = await promptGitHooks(options);
|
|
295
295
|
if (shouldSetupHooks) {
|
|
296
|
-
const reason = preflightGitHooksSetup(rootDir, packageManager);
|
|
296
|
+
const reason = preflightGitHooksSetup(rootDir, packageManager, packages);
|
|
297
297
|
if (reason) {
|
|
298
|
-
log.warn(`⚠ ${reason}`);
|
|
298
|
+
log$1.warn(`⚠ ${reason}`);
|
|
299
299
|
shouldSetupHooks = false;
|
|
300
300
|
}
|
|
301
301
|
}
|
|
@@ -382,7 +382,7 @@ async function collectEslintMigrationDecision(rootDir, options, packages) {
|
|
|
382
382
|
};
|
|
383
383
|
}
|
|
384
384
|
async function collectMigrationSetupPlan(rootDir, packageManager, options, packages, includeEslint = true) {
|
|
385
|
-
const shouldSetupHooks = await collectGitHooksDecision(rootDir, packageManager, options);
|
|
385
|
+
const shouldSetupHooks = await collectGitHooksDecision(rootDir, packageManager, options, packages);
|
|
386
386
|
const agentPlan = await collectAgentInstructionPlan(rootDir, options);
|
|
387
387
|
const editorPlan = await collectEditorConfigPlan(rootDir, options);
|
|
388
388
|
const eslintPlan = includeEslint ? await collectEslintMigrationDecision(rootDir, options, packages) : { migrateEslint: false };
|
|
@@ -429,7 +429,7 @@ async function confirmYarnNodeModulesMode(rootDir, packageManager, packageManage
|
|
|
429
429
|
if (packageManager !== PackageManager.yarn) return false;
|
|
430
430
|
const pnp = detectYarnPnpMode(rootDir, packageManagerVersion);
|
|
431
431
|
if (!pnp) return false;
|
|
432
|
-
log.warn(`⚠ Vite+ does not currently support Yarn Plug'n'Play (PnP).`);
|
|
432
|
+
log$1.warn(`⚠ Vite+ does not currently support Yarn Plug'n'Play (PnP).`);
|
|
433
433
|
if (pnp.source === "environment") cancelAndExit("YARN_NODE_LINKER=pnp overrides project configuration. Set it to node-modules or unset it, then re-run `vp migrate`.", 1);
|
|
434
434
|
if (interactive) {
|
|
435
435
|
const confirmed = await confirm({
|
|
@@ -451,7 +451,10 @@ async function fixBaseUrlForWorkspace(workspaceInfo, fixBaseUrl, updateProgress,
|
|
|
451
451
|
confirmed: true,
|
|
452
452
|
silent: true
|
|
453
453
|
});
|
|
454
|
-
if (status === "failed")
|
|
454
|
+
if (status === "failed") {
|
|
455
|
+
const projectLabel = displayRelative(projectPath, workspaceInfo.rootDir) || ".";
|
|
456
|
+
addMigrationWarning(report, `Failed to remove tsconfig baseUrl in ${projectLabel}. Run \`vp dlx @andrewbranch/ts5to6 --fixBaseUrl <tsconfig path>\` manually and re-run the migration.`);
|
|
457
|
+
}
|
|
455
458
|
if (status === "fixed") fixedProjectPaths.push(projectPath);
|
|
456
459
|
}
|
|
457
460
|
return fixedProjectPaths;
|
|
@@ -560,8 +563,8 @@ const helpMessage = renderCliDoc({
|
|
|
560
563
|
"",
|
|
561
564
|
" Command mapping:",
|
|
562
565
|
" - `vp run <script>` is the equivalent of `pnpm run <script>`",
|
|
563
|
-
" - `vp test`
|
|
564
|
-
" `test`
|
|
566
|
+
" - `vp dev` and `vp test` always run the built-ins; `vp run dev` and",
|
|
567
|
+
" `vp run test` run the `dev` and `test` scripts from `package.json`",
|
|
565
568
|
" - `vp install`, `vp add`, and `vp remove` delegate through the package",
|
|
566
569
|
" manager declared by `packageManager`",
|
|
567
570
|
" - `vp dev`, `vp build`, `vp preview`, `vp lint`, `vp fmt`, `vp check`,",
|
|
@@ -581,7 +584,8 @@ const helpMessage = renderCliDoc({
|
|
|
581
584
|
]
|
|
582
585
|
});
|
|
583
586
|
function parseArgs() {
|
|
584
|
-
const
|
|
587
|
+
const args = process.argv.slice(3);
|
|
588
|
+
const parsed = lib_default(args, {
|
|
585
589
|
alias: { h: "help" },
|
|
586
590
|
boolean: [
|
|
587
591
|
"help",
|
|
@@ -724,37 +728,42 @@ function showMigrationSummary(options) {
|
|
|
724
728
|
const { projectRoot, packageManager, packageManagerVersion, installDurationMs, finalInstallOk, report, updatedExistingVitePlus, suggestFullMigration } = options;
|
|
725
729
|
const projectLabel = displayRelative(projectRoot) || ".";
|
|
726
730
|
const configUpdates = report.createdViteConfigCount + report.mergedConfigCount + report.mergedStagedConfigCount + report.inlinedLintStagedConfigCount + report.removedConfigCount + report.tsdownImportCount + report.wrappedPluginConfigCount;
|
|
727
|
-
log
|
|
728
|
-
log
|
|
731
|
+
log(`${styleText("magenta", "◇")} ${updatedExistingVitePlus ? "Updated" : "Migrated"} ${accent(projectLabel)} to Vite+ ${VITE_PLUS_VERSION}`);
|
|
732
|
+
log(`${styleText("gray", "•")} Node ${process.versions.node} ${packageManager} ${packageManagerVersion}`);
|
|
729
733
|
if (report.dependencyUpgrades.length > 0) {
|
|
730
734
|
const nameWidth = Math.max(...report.dependencyUpgrades.map((change) => change.name.length));
|
|
731
735
|
const fromWidth = Math.max(...report.dependencyUpgrades.map((change) => (change.from ?? "").length));
|
|
732
|
-
log
|
|
733
|
-
for (const change of report.dependencyUpgrades)
|
|
736
|
+
log(`${styleText("gray", "•")} Dependencies:`);
|
|
737
|
+
for (const change of report.dependencyUpgrades) {
|
|
738
|
+
const name = change.name.padEnd(nameWidth);
|
|
739
|
+
const from = muted((change.from ?? "").padEnd(fromWidth));
|
|
740
|
+
const to = styleText("green", change.to);
|
|
741
|
+
log(` ${name} ${from} → ${to}`);
|
|
742
|
+
}
|
|
734
743
|
}
|
|
735
|
-
if (finalInstallOk && installDurationMs > 0) log
|
|
744
|
+
if (finalInstallOk && installDurationMs > 0) log(`${styleText("green", "✓")} Dependencies installed in ${formatDuration(installDurationMs)}`);
|
|
736
745
|
if (configUpdates > 0 || report.rewrittenImportFileCount > 0) {
|
|
737
746
|
const parts = [];
|
|
738
747
|
if (configUpdates > 0) parts.push(`${configUpdates} ${configUpdates === 1 ? "config update" : "config updates"} applied`);
|
|
739
748
|
if (report.rewrittenImportFileCount > 0) parts.push(`${report.rewrittenImportFileCount} ${report.rewrittenImportFileCount === 1 ? "file had" : "files had"} imports rewritten`);
|
|
740
|
-
log
|
|
749
|
+
log(`${styleText("gray", "•")} ${parts.join(", ")}`);
|
|
741
750
|
}
|
|
742
|
-
if (report.preservedUpstreamVitestImportFileCount > 0) log
|
|
743
|
-
if (report.eslintMigrated) log
|
|
744
|
-
if (report.prettierMigrated) log
|
|
745
|
-
if (report.nodeVersionFileMigrated) log
|
|
746
|
-
if (report.wrappedPluginConfigCount > 0) log
|
|
747
|
-
if (report.gitHooksConfigured) log
|
|
748
|
-
if (report.frameworkShimAdded) log
|
|
749
|
-
if (report.packageManagerBootstrapConfigured) log
|
|
750
|
-
if (suggestFullMigration) log
|
|
751
|
+
if (report.preservedUpstreamVitestImportFileCount > 0) log(`${styleText("gray", "•")} Kept upstream \`vitest\` imports in ${report.preservedUpstreamVitestImportFileCount} ${report.preservedUpstreamVitestImportFileCount === 1 ? "file" : "files"} for @nuxt/test-utils compatibility`);
|
|
752
|
+
if (report.eslintMigrated) log(`${styleText("gray", "•")} ESLint rules migrated to Oxlint`);
|
|
753
|
+
if (report.prettierMigrated) log(`${styleText("gray", "•")} Prettier migrated to Oxfmt`);
|
|
754
|
+
if (report.nodeVersionFileMigrated) log(`${styleText("gray", "•")} Node version manager file migrated to .node-version`);
|
|
755
|
+
if (report.wrappedPluginConfigCount > 0) log(`${styleText("gray", "•")} Inline Vite plugins wrapped with lazyPlugins for check/lint/fmt`);
|
|
756
|
+
if (report.gitHooksConfigured) log(`${styleText("gray", "•")} Git hooks configured`);
|
|
757
|
+
if (report.frameworkShimAdded) log(`${styleText("gray", "•")} TypeScript shim added for framework component files`);
|
|
758
|
+
if (report.packageManagerBootstrapConfigured) log(`${styleText("gray", "•")} Package manager settings configured`);
|
|
759
|
+
if (suggestFullMigration) log(FULL_MIGRATION_HINT);
|
|
751
760
|
if (report.warnings.length > 0) {
|
|
752
|
-
log
|
|
753
|
-
for (const warning of report.warnings) log
|
|
761
|
+
log(`${styleText("yellow", "!")} Warnings:`);
|
|
762
|
+
for (const warning of report.warnings) log(` - ${warning}`);
|
|
754
763
|
}
|
|
755
764
|
if (report.manualSteps.length > 0) {
|
|
756
|
-
log
|
|
757
|
-
for (const step of report.manualSteps) log
|
|
765
|
+
log(`${styleText("blue", "→")} Manual follow-up:`);
|
|
766
|
+
for (const step of report.manualSteps) log(` - ${step}`);
|
|
758
767
|
}
|
|
759
768
|
}
|
|
760
769
|
async function downloadSupportedPackageManager(options) {
|
|
@@ -766,11 +775,11 @@ async function downloadSupportedPackageManager(options) {
|
|
|
766
775
|
await upgradeYarn(rootDir, interactive, true);
|
|
767
776
|
} else if (packageManager === PackageManager.pnpm && import_semver.default.satisfies(downloadResult.version, "< 9.5.0")) {
|
|
768
777
|
failMigrationProgress("Migration failed");
|
|
769
|
-
log.error(`✘ pnpm@${downloadResult.version} is not supported by auto migration, please upgrade pnpm to >=9.5.0 first`);
|
|
778
|
+
log$1.error(`✘ pnpm@${downloadResult.version} is not supported by auto migration, please upgrade pnpm to >=9.5.0 first`);
|
|
770
779
|
cancelAndExit("Vite+ cannot automatically migrate this project yet.", 1);
|
|
771
780
|
} else if (packageManager === PackageManager.npm && import_semver.default.satisfies(downloadResult.version, "< 8.3.0")) {
|
|
772
781
|
failMigrationProgress("Migration failed");
|
|
773
|
-
log.error(`✘ npm@${downloadResult.version} is not supported by auto migration, please upgrade npm to >=8.3.0 first`);
|
|
782
|
+
log$1.error(`✘ npm@${downloadResult.version} is not supported by auto migration, please upgrade npm to >=8.3.0 first`);
|
|
774
783
|
cancelAndExit("Vite+ cannot automatically migrate this project yet.", 1);
|
|
775
784
|
}
|
|
776
785
|
return downloadResult;
|
|
@@ -816,7 +825,7 @@ async function executeMigrationPlan(workspaceInfoOptional, plan, interactive, pr
|
|
|
816
825
|
if (plan.convertYarnPnp) {
|
|
817
826
|
updateMigrationProgress("Configuring Yarn node-modules mode");
|
|
818
827
|
report.packageManagerBootstrapConfigured = configureYarnNodeModulesMode(workspaceInfo.rootDir);
|
|
819
|
-
if (report.packageManagerBootstrapConfigured) log.success("✔ Switched Yarn to node-modules mode");
|
|
828
|
+
if (report.packageManagerBootstrapConfigured) log$1.success("✔ Switched Yarn to node-modules mode");
|
|
820
829
|
}
|
|
821
830
|
if (plan.migrateNodeVersionFile && plan.nodeVersionDetection) {
|
|
822
831
|
updateMigrationProgress("Migrating node version file");
|
|
@@ -857,13 +866,13 @@ async function executeMigrationPlan(workspaceInfoOptional, plan, interactive, pr
|
|
|
857
866
|
cancelAndExit("Prettier migration failed. Fix the issue and re-run `vp migrate`.", 1);
|
|
858
867
|
}
|
|
859
868
|
}
|
|
860
|
-
const skipStagedMigration =
|
|
869
|
+
const skipStagedMigration = shouldSkipStagedMigrationForHooks(workspaceInfo.rootDir, plan.shouldSetupHooks, plan.packageManager, workspaceInfo.packages);
|
|
861
870
|
updateMigrationProgress("Rewriting configs");
|
|
862
871
|
if (workspaceInfo.isMonorepo) rewriteMonorepo(workspaceInfo, skipStagedMigration, true, report);
|
|
863
872
|
else rewriteStandaloneProject(workspaceInfo.rootDir, workspaceInfo, skipStagedMigration, true, report);
|
|
864
873
|
if (plan.shouldSetupHooks) {
|
|
865
874
|
updateMigrationProgress("Configuring git hooks");
|
|
866
|
-
installGitHooks(workspaceInfo.rootDir, true, report, plan.packageManager);
|
|
875
|
+
installGitHooks(workspaceInfo.rootDir, true, report, plan.packageManager, workspaceInfo.packages);
|
|
867
876
|
}
|
|
868
877
|
updateMigrationProgress("Writing agent instructions");
|
|
869
878
|
await writeAgentInstructions({
|
|
@@ -907,7 +916,7 @@ async function main() {
|
|
|
907
916
|
const { projectPath, options } = parseArgs();
|
|
908
917
|
if (options.help) {
|
|
909
918
|
printHeader();
|
|
910
|
-
log
|
|
919
|
+
log(helpMessage);
|
|
911
920
|
return;
|
|
912
921
|
}
|
|
913
922
|
printHeader();
|
|
@@ -915,7 +924,8 @@ async function main() {
|
|
|
915
924
|
const initialChangedPaths = await collectChangedFormatPaths(workspaceInfoOptional.rootDir);
|
|
916
925
|
const preExistingChangedPaths = initialChangedPaths ? new Set(initialChangedPaths) : void 0;
|
|
917
926
|
const resolvedPackageManager = workspaceInfoOptional.packageManager ?? "unknown";
|
|
918
|
-
|
|
927
|
+
const rootPkg = readNearestPackageJson(workspaceInfoOptional.rootDir);
|
|
928
|
+
if (hasVitePlusDependency(rootPkg) && !isForceOverrideMode()) {
|
|
919
929
|
let convertYarnPnp = await confirmYarnNodeModulesMode(workspaceInfoOptional.rootDir, workspaceInfoOptional.packageManager, workspaceInfoOptional.packageManagerVersion, options.interactive);
|
|
920
930
|
let didMigrate = false;
|
|
921
931
|
let installDurationMs = 0;
|
|
@@ -978,7 +988,7 @@ async function main() {
|
|
|
978
988
|
const fullSetup = options.full === true;
|
|
979
989
|
const skippedSetupCandidates = !fullSetup && !hasExplicitExistingVitePlusSetupRequest(options) && hasExistingVitePlusMigrationCandidates(workspaceInfoOptional, options);
|
|
980
990
|
if (!didMigrate && !convertYarnPnp && report.warnings.length === 0 && !vitePlusBootstrapPending && !(fullSetup ? hasExistingVitePlusMigrationCandidates(workspaceInfoOptional, options) : hasExplicitExistingVitePlusSetupRequest(options))) {
|
|
981
|
-
if (skippedSetupCandidates) log
|
|
991
|
+
if (skippedSetupCandidates) log(FULL_MIGRATION_HINT);
|
|
982
992
|
outro(`This project is already using Vite+! ${accent("Happy coding!")}`);
|
|
983
993
|
return;
|
|
984
994
|
}
|
|
@@ -1053,7 +1063,7 @@ async function main() {
|
|
|
1053
1063
|
if (convertYarnPnp) {
|
|
1054
1064
|
updateMigrationProgress("Configuring Yarn node-modules mode");
|
|
1055
1065
|
if (configureYarnNodeModulesMode(workspaceInfoOptional.rootDir)) {
|
|
1056
|
-
log.success("✔ Switched Yarn to node-modules mode");
|
|
1066
|
+
log$1.success("✔ Switched Yarn to node-modules mode");
|
|
1057
1067
|
report.packageManagerBootstrapConfigured = true;
|
|
1058
1068
|
didMigrate = true;
|
|
1059
1069
|
needsInstall = true;
|
|
@@ -1071,7 +1081,7 @@ async function main() {
|
|
|
1071
1081
|
if (plan.shouldSetupHooks) {
|
|
1072
1082
|
await ensureExistingPackageManager();
|
|
1073
1083
|
updateMigrationProgress("Configuring git hooks");
|
|
1074
|
-
if (installGitHooks(workspaceInfoOptional.rootDir, true, report, packageManager)) {
|
|
1084
|
+
if (installGitHooks(workspaceInfoOptional.rootDir, true, report, packageManager, workspaceInfoOptional.packages)) {
|
|
1075
1085
|
didMigrate = true;
|
|
1076
1086
|
needsInstall = true;
|
|
1077
1087
|
}
|
|
@@ -1135,7 +1145,7 @@ async function main() {
|
|
|
1135
1145
|
});
|
|
1136
1146
|
} else {
|
|
1137
1147
|
clearMigrationProgress();
|
|
1138
|
-
if (skippedSetupCandidates) log
|
|
1148
|
+
if (skippedSetupCandidates) log(FULL_MIGRATION_HINT);
|
|
1139
1149
|
outro(`This project is already using Vite+! ${accent("Happy coding!")}`);
|
|
1140
1150
|
}
|
|
1141
1151
|
return;
|
|
@@ -1152,7 +1162,7 @@ async function main() {
|
|
|
1152
1162
|
});
|
|
1153
1163
|
}
|
|
1154
1164
|
main().catch((err) => {
|
|
1155
|
-
log.error(err.message);
|
|
1165
|
+
log$1.error(err.message);
|
|
1156
1166
|
console.error(err);
|
|
1157
1167
|
process.exit(1);
|
|
1158
1168
|
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as VITE_PLUS_NAME } from "./constants-
|
|
1
|
+
import { s as VITE_PLUS_NAME } from "./constants-BppDcRc1.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`;
|
package/dist/oxlint-plugin.js
CHANGED
|
@@ -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-
|
|
1
|
+
import { n as VITE_PLUS_OXLINT_PLUGIN_NAME, t as PREFER_VITE_PLUS_IMPORTS_RULE_NAME } from "./oxlint-plugin-config-BHOzlwMw.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { definePlugin, defineRule } from "@oxlint/plugins";
|
package/dist/pack-bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as resolveViteConfig } from "./resolve-vite-config-
|
|
2
|
+
import { a as resolveViteConfig } from "./resolve-vite-config-EWXclqvV.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
|
|
@@ -680,7 +680,7 @@ const DEFAULT_ENV_PREFIXES = ["VITE_PACK_", "TSDOWN_"];
|
|
|
680
680
|
cli.command("[...files]", "Bundle files", {
|
|
681
681
|
ignoreOptionDefaultValue: true,
|
|
682
682
|
allowUnknownOptions: true
|
|
683
|
-
}).option("--config-loader <loader>", "Config loader to use: auto, native, tsx, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: DEFAULT_ENV_PREFIXES }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
683
|
+
}).option("--config-loader <loader>", "Config loader to use: auto, native, tsx, unrun", { default: "auto" }).option("--no-config", "Disable config file").option("-f, --format <format>", "Bundle format: esm, cjs, iife, umd", { default: "esm" }).option("--clean", "Clean output directory, --no-clean to disable").option("--deps.never-bundle <module>", "Mark dependencies as external").option("--minify", "Minify output").option("--devtools", "Enable devtools integration").option("--debug [feat]", "Show debug logs").option("--target <target>", "Bundle target, e.g \"es2015\", \"esnext\"").option("-l, --logLevel <level>", "Set log level: info, warn, error, silent").option("--fail-on-warn", "Fail on warnings", { default: true }).option("--no-write", "Disable writing files to disk, incompatible with watch mode").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--treeshake", "Tree-shake bundle", { default: true }).option("--sourcemap", "Generate source map", { default: false }).option("--shims", "Enable cjs and esm shims", { default: false }).option("--platform <platform>", "Target platform", { default: "node" }).option("--dts", "Generate dts files").option("--publint", "Enable publint", { default: false }).option("--attw", "Enable Are the types wrong integration", { default: false }).option("--unused", "Enable unused dependencies check", { default: false }).option("-w, --watch [path]", "Watch mode").option("--ignore-watch <path>", "Ignore custom paths in watch mode").option("--from-vite [vitest]", "Reuse config from Vite or Vitest").option("--report", "Size report", { default: true }).option("--env.* <value>", "Define compile-time env variables").option("--env-file <file>", "Load environment variables from a file, when used together with --env, variables in --env take precedence").option("--env-prefix <prefix>", "Prefix for env variables to inject into the bundle", { default: DEFAULT_ENV_PREFIXES }).option("--on-success <command>", "Command to run on success").option("--copy <dir>", "Copy files to output dir").option("--public-dir <dir>", "Alias for --copy, deprecated").option("--tsconfig <tsconfig>", "Set tsconfig path").option("--unbundle", "Unbundle mode").option("--root <dir>", "Root directory of input files").option("--exe", "Bundle as executable").option("-W, --workspace [dir]", "Enable workspace mode").option("--concurrency <count>", "Maximum number of Rolldown builds to run in parallel").option("-F, --filter <pattern>", "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name").option("--exports", "Generate export-related metadata for package.json (experimental)").action(async (input, flags) => {
|
|
684
684
|
if (input.length > 0) flags.entry = input;
|
|
685
685
|
if (flags.envPrefix === void 0) flags.envPrefix = DEFAULT_ENV_PREFIXES;
|
|
686
686
|
async function runBuild() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./constants-
|
|
2
|
-
import { i as readJsonFile } from "./json-
|
|
1
|
+
import "./constants-BppDcRc1.js";
|
|
2
|
+
import { i as readJsonFile } from "./json-BU88uu6o.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs";
|