vite-plus 0.2.9 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -3
- package/binding/index.cjs +57 -54
- package/binding/index.d.cts +93 -0
- package/dist/{agent-DQU8uS6P.js → agent-Wqx0MPk0.js} +1 -1
- package/dist/bin.js +16 -6
- package/dist/command-CLJK5jGW.js +2 -0
- package/dist/command-CguLh2KL.js +471 -0
- package/dist/config/bin.js +7 -5
- package/dist/{constants-CG513DRa.js → constants-Bn-U8o4v.js} +5 -3
- package/dist/create/bin.js +28 -52
- package/dist/{define-config-CV4bQG_8.js → define-config-GXUdVT-0.js} +2 -2
- package/dist/{define-config-DyNLA_f0.cjs → define-config-WiVlryJ2.cjs} +2 -2
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{editor-g4PosU99.js → editor-CC4DqODz.js} +562 -59
- package/dist/{terminal-Bz-ps6rJ.js → help-BmKpeOP9.js} +1 -38
- package/dist/hooks/bin.js +3 -2
- package/dist/{hooks-pNCBWtFT.js → hooks-DFqViZqZ.js} +5 -2
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/migration/bin.js +60 -11
- package/dist/migration/compat/worker.js +1 -1
- package/dist/{oxlint-plugin-config-BEZ9IUf7.js → oxlint-plugin-config-DX5ezKbB.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +5 -4
- package/dist/{package-B4T8RGMG.js → package-CBe9EWPY.js} +2 -2
- package/dist/{prompts-CHz_98bJ.js → prompts-DF3yU-eU.js} +6 -474
- package/dist/{report-BS7ULx7A.js → report-ZNR1Mk6h.js} +1 -0
- package/dist/{resolve-vite-config-Dmeyeyj-.js → resolve-vite-config-ipGb39Jo.js} +2 -2
- package/dist/staged/bin.js +77 -47
- package/dist/terminal-MKGAuy-p.js +39 -0
- package/dist/toolchain.js +9 -9
- package/dist/toolchain.json +9 -9
- package/dist/tsconfig-BVHG3DpR.js +2 -0
- package/dist/{tsconfig-7v_BHagU.js → tsconfig-LD2QhQ0O.js} +5 -4
- package/dist/version.js +4 -3
- package/dist/versions.js +5 -5
- package/docs/guide/env.md +20 -6
- package/docs/guide/install.md +2 -1
- package/docs/guide/installer-env-vars.md +41 -5
- package/docs/guide/migrate-rules.md +9 -0
- package/docs/guide/migrate.md +5 -5
- package/docs/guide/test.md +8 -0
- package/docs/guide/upgrade.md +48 -1
- package/package.json +32 -33
- package/docs/_data/team.ts +0 -131
- package/docs/package.json +0 -30
- package/docs/pnpm-lock.yaml +0 -4003
- package/docs/pnpm-workspace.yaml +0 -13
- package/docs/public/checkmark.svg +0 -1
- package/docs/public/cta-background.jpg +0 -0
- package/docs/public/favicon.svg +0 -1
- package/docs/public/icon.svg +0 -1
- package/docs/public/logo.svg +0 -1
- package/docs/public/og.jpg +0 -0
- package/docs/vite.config.ts +0 -20
- package/dist/{json-qlK6UH0r.js → json-cULBl7Pi.js} +107 -107
- package/dist/{log-update-CoW8Z4Dl.js → log-update-DHZRyJ2m.js} +1 -1
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { shouldPrintVitePlusHeader, vitePlusHeader } from "../binding/index.js";
|
|
2
1
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
3
2
|
//#region src/utils/help.ts
|
|
4
3
|
const HELP_RIGHT_MARGIN = 4;
|
|
@@ -89,40 +88,4 @@ function renderCliDoc(doc, options = {}) {
|
|
|
89
88
|
return output.join("\n");
|
|
90
89
|
}
|
|
91
90
|
//#endregion
|
|
92
|
-
|
|
93
|
-
function log(message) {
|
|
94
|
-
console.log(message);
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Emit the Vite+ banner (header line + trailing blank line) to stdout.
|
|
98
|
-
* Gating (non-TTY, git hooks) lives in `shouldPrintVitePlusHeader` on the
|
|
99
|
-
* Rust side so both CLIs stay in sync.
|
|
100
|
-
*/
|
|
101
|
-
function printHeader() {
|
|
102
|
-
if (!shouldPrintVitePlusHeader()) return;
|
|
103
|
-
log(vitePlusHeader());
|
|
104
|
-
log("");
|
|
105
|
-
}
|
|
106
|
-
function accent(text) {
|
|
107
|
-
return styleText("blue", text);
|
|
108
|
-
}
|
|
109
|
-
function muted(text) {
|
|
110
|
-
return styleText("gray", text);
|
|
111
|
-
}
|
|
112
|
-
function success(text) {
|
|
113
|
-
return styleText("green", text);
|
|
114
|
-
}
|
|
115
|
-
function formatDuration(durationMs) {
|
|
116
|
-
if (durationMs < 1e3) return `${Math.max(1, durationMs)}ms`;
|
|
117
|
-
const durationSeconds = durationMs / 1e3;
|
|
118
|
-
if (durationSeconds < 10) return `${durationSeconds.toFixed(1)}s`;
|
|
119
|
-
return `${Math.round(durationSeconds)}s`;
|
|
120
|
-
}
|
|
121
|
-
function warnMsg(msg) {
|
|
122
|
-
console.error(styleText(["yellow", "bold"], "warn:"), msg);
|
|
123
|
-
}
|
|
124
|
-
function errorMsg(msg) {
|
|
125
|
-
console.error(styleText(["red", "bold"], "error:"), msg);
|
|
126
|
-
}
|
|
127
|
-
//#endregion
|
|
128
|
-
export { muted as a, warnMsg as c, log as i, renderCliDoc as l, errorMsg as n, printHeader as o, formatDuration as r, success as s, accent as t };
|
|
91
|
+
export { renderCliDoc as t };
|
package/dist/hooks/bin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { t as renderCliDoc } from "../help-BmKpeOP9.js";
|
|
2
|
+
import { i as log, o as printHeader } from "../terminal-MKGAuy-p.js";
|
|
2
3
|
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
3
|
-
import { i as enable,
|
|
4
|
+
import { i as enable, r as disable, t as DEFAULT_HOOKS_DIR, u as status } from "../hooks-DFqViZqZ.js";
|
|
4
5
|
//#region src/hooks/args.ts
|
|
5
6
|
const KNOWN_HOOKS_ARG_KEYS = /* @__PURE__ */ new Set([
|
|
6
7
|
"_",
|
|
@@ -380,8 +380,11 @@ function unsetOwnedHooksPath(target) {
|
|
|
380
380
|
};
|
|
381
381
|
return null;
|
|
382
382
|
}
|
|
383
|
+
function isGitHooksEnvDisabled() {
|
|
384
|
+
return process.env.HUSKY === "0" || process.env.VP_GIT_HOOKS === "0" || process.env.VITE_GIT_HOOKS === "0";
|
|
385
|
+
}
|
|
383
386
|
function install(dir, options = {}) {
|
|
384
|
-
if (
|
|
387
|
+
if (isGitHooksEnvDisabled()) return {
|
|
385
388
|
message: "skip install (git hooks disabled)",
|
|
386
389
|
isError: false
|
|
387
390
|
};
|
|
@@ -567,4 +570,4 @@ function status(dir) {
|
|
|
567
570
|
};
|
|
568
571
|
}
|
|
569
572
|
//#endregion
|
|
570
|
-
export { findUnsafeHookInstallPath as a,
|
|
573
|
+
export { findUnsafeHookInstallPath as a, isHooksUserDisabled as c, enable as i, resolveHooksLocation as l, SUPPORTED_GIT_HOOK_NAMES as n, install as o, disable as r, isGitHooksEnvDisabled as s, DEFAULT_HOOKS_DIR as t, status as u };
|
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-WiVlryJ2.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.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-GXUdVT-0.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 };
|
package/dist/migration/bin.js
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { r as __toESM } from "../rolldown-runtime-CMFfr-1z.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig, t as confirmBaseUrlFix } from "../tsconfig-7v_BHagU.js";
|
|
2
|
+
import { t as renderCliDoc } from "../help-BmKpeOP9.js";
|
|
3
|
+
import { a as muted, c as warnMsg, i as log, o as printHeader, r as formatDuration, t as accent } from "../terminal-MKGAuy-p.js";
|
|
4
|
+
import { f as VITE_PLUS_VERSION, m as isForceOverrideMode } from "../constants-Bn-U8o4v.js";
|
|
5
|
+
import { A as isCancel, C as log$1, D as spinner, E as select, T as outro, b as require_semver, c as selectPackageManager, i as promptGitHooks, l as upgradeYarn, n as defaultInteractive, o as runViteFmt, r as downloadPackageManager, s as runViteInstall, t as cancelAndExit, x as confirm, y as PackageManager } from "../prompts-DF3yU-eU.js";
|
|
7
6
|
import { t as lib_default } from "../lib-L3DWSRQp.js";
|
|
8
|
-
import { a as
|
|
9
|
-
import {
|
|
10
|
-
import { n as
|
|
11
|
-
import {
|
|
7
|
+
import { a as writeJsonFile, i as readJsonFile } from "../json-cULBl7Pi.js";
|
|
8
|
+
import { a as readNearestPackageJson, i as hasVitePlusDependency } from "../package-CBe9EWPY.js";
|
|
9
|
+
import { i as selectAgentTargetPaths, l as displayRelative, n as detectAgentConflicts, r as detectExistingAgentTargetPaths, s as writeAgentInstructions } from "../agent-Wqx0MPk0.js";
|
|
10
|
+
import { n as addMigrationWarning, r as createMigrationReport } from "../report-ZNR1Mk6h.js";
|
|
11
|
+
import { $ as warnLegacyEslintConfig, A as detectWorkspace, C as mergeTsdownConfigFile, D as ensureVitePlusBootstrap, E as detectVitePlusBootstrapPending, F as detectFramework, H as confirmPrettierMigration, I as hasFrameworkShim, J as detectEslintProject, K as warnPackageLevelPrettier, L as confirmTsupMigration, O as configureYarnNodeModulesMode, P as addFrameworkShim, Q as warnIncompatibleEslintIntegration, R as detectTsupProject, S as injectLintTypeCheckDefaults, T as collectToolchainVersionChanges, U as detectPrettierProject, V as warnMissingTsupConfig, W as migratePrettierToOxfmt, X as migrateEslintToOxlint, Y as detectIncompatibleEslintIntegration, _ as preflightGitHooksSetup, d as finalizeCoreMigrationForExistingVitePlus, et as warnPackageLevelEslint, f as detectNodeVersionManagerFile, g as installGitHooks, h as detectLegacyGitHooksMigrationCandidate, i as selectEditor, k as detectYarnPnpMode, l as rewriteStandaloneProject, nt as checkVitestVersion, o as writeEditorConfigs, p as migrateNodeVersionManagerFile, q as confirmEslintMigration, r as isJsonLikeFile, s as rewriteMonorepo, t as detectEditorConflicts, tt as checkViteVersion, u as detectPendingCoreMigration, v as shouldSkipStagedMigrationForHooks, w as mergeViteConfigFiles, z as migrateTsupToTsdown } from "../editor-CC4DqODz.js";
|
|
12
|
+
import { n as runCommandSilently } from "../command-CguLh2KL.js";
|
|
13
|
+
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig, t as confirmBaseUrlFix } from "../tsconfig-LD2QhQ0O.js";
|
|
12
14
|
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../protocol-D99W10Qi.js";
|
|
13
15
|
import path from "node:path";
|
|
14
16
|
import { fileURLToPath } from "node:url";
|
|
@@ -381,6 +383,16 @@ async function collectEslintMigrationDecision(rootDir, options, packages) {
|
|
|
381
383
|
eslintConfigFile: eslintProject.configFile
|
|
382
384
|
};
|
|
383
385
|
}
|
|
386
|
+
async function collectTsupMigrationDecision(rootDir, options, packages) {
|
|
387
|
+
const tsupProject = detectTsupProject(rootDir, packages);
|
|
388
|
+
let migrateTsup = false;
|
|
389
|
+
if (tsupProject.hasDependency && tsupProject.hasConfig) migrateTsup = await confirmTsupMigration(options.interactive);
|
|
390
|
+
else if (tsupProject.hasDependency) warnMissingTsupConfig();
|
|
391
|
+
return {
|
|
392
|
+
migrateTsup,
|
|
393
|
+
tsupConfigFile: tsupProject.configFile
|
|
394
|
+
};
|
|
395
|
+
}
|
|
384
396
|
async function collectMigrationSetupPlan(rootDir, packageManager, options, packages, includeEslint = true) {
|
|
385
397
|
const shouldSetupHooks = await collectGitHooksDecision(rootDir, packageManager, options, packages);
|
|
386
398
|
const agentPlan = await collectAgentInstructionPlan(rootDir, options);
|
|
@@ -656,7 +668,8 @@ function hasExplicitExistingVitePlusSetupRequest(options) {
|
|
|
656
668
|
function hasExistingVitePlusMigrationCandidates(workspaceInfo, options) {
|
|
657
669
|
const eslintProject = detectEslintProject(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
658
670
|
const prettierProject = detectPrettierProject(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
659
|
-
|
|
671
|
+
const tsupProject = detectTsupProject(workspaceInfo.rootDir, workspaceInfo.packages);
|
|
672
|
+
return hasExplicitExistingVitePlusSetupRequest(options) || detectLegacyGitHooksMigrationCandidate(workspaceInfo.rootDir) || hasBaseUrlInWorkspace(workspaceInfo) || eslintProject.hasDependency || prettierProject.hasDependency || tsupProject.hasDependency || detectNodeVersionManagerFile(workspaceInfo.rootDir) !== void 0 || getFrameworkShimCandidates(workspaceInfo.rootDir, workspaceInfo.packages).length > 0;
|
|
660
673
|
}
|
|
661
674
|
function getExistingVitePlusSetupOptions(options, useFullMigrationDefaults = false) {
|
|
662
675
|
if (useFullMigrationDefaults) return options;
|
|
@@ -675,6 +688,7 @@ async function collectMigrationPlan(rootDir, detectedPackageManager, detectedPac
|
|
|
675
688
|
let migratePrettier = false;
|
|
676
689
|
if (prettierProject.hasDependency && prettierProject.configFile) migratePrettier = await confirmPrettierMigration(options.interactive);
|
|
677
690
|
else if (prettierProject.hasDependency) warnPackageLevelPrettier();
|
|
691
|
+
const { migrateTsup, tsupConfigFile } = await collectTsupMigrationDecision(rootDir, options, packages);
|
|
678
692
|
const fixBaseUrl = hasBaseUrlInWorkspace({
|
|
679
693
|
rootDir,
|
|
680
694
|
packages
|
|
@@ -690,6 +704,8 @@ async function collectMigrationPlan(rootDir, detectedPackageManager, detectedPac
|
|
|
690
704
|
migratePrettier,
|
|
691
705
|
hasPrettierDependency: prettierProject.hasDependency,
|
|
692
706
|
prettierConfigFile: prettierProject.configFile,
|
|
707
|
+
migrateTsup,
|
|
708
|
+
tsupConfigFile,
|
|
693
709
|
fixBaseUrl,
|
|
694
710
|
migrateNodeVersionFile,
|
|
695
711
|
nodeVersionDetection,
|
|
@@ -745,6 +761,7 @@ function showMigrationSummary(options) {
|
|
|
745
761
|
if (report.preservedUpstreamVitestImportFileCount > 0) log(`${styleText("gray", "•")} Kept upstream \`vitest\` imports in ${report.preservedUpstreamVitestImportFileCount} ${report.preservedUpstreamVitestImportFileCount === 1 ? "file" : "files"} for @nuxt/test-utils compatibility`);
|
|
746
762
|
if (report.eslintMigrated) log(`${styleText("gray", "•")} ESLint rules migrated to Oxlint`);
|
|
747
763
|
if (report.prettierMigrated) log(`${styleText("gray", "•")} Prettier migrated to Oxfmt`);
|
|
764
|
+
if (report.tsupMigrated) log(`${styleText("gray", "•")} tsup config migrated to tsdown (\`vp pack\`)`);
|
|
748
765
|
if (report.nodeVersionFileMigrated) log(`${styleText("gray", "•")} Node version manager file migrated to .node-version`);
|
|
749
766
|
if (report.wrappedPluginConfigCount > 0) log(`${styleText("gray", "•")} Inline Vite plugins wrapped with lazyPlugins for check/lint/fmt`);
|
|
750
767
|
if (report.gitHooksConfigured) log(`${styleText("gray", "•")} Git hooks configured`);
|
|
@@ -860,6 +877,16 @@ async function executeMigrationPlan(workspaceInfoOptional, plan, interactive, pr
|
|
|
860
877
|
cancelAndExit("Prettier migration failed. Fix the issue and re-run `vp migrate`.", 1);
|
|
861
878
|
}
|
|
862
879
|
}
|
|
880
|
+
if (plan.migrateTsup) {
|
|
881
|
+
updateMigrationProgress("Migrating tsup");
|
|
882
|
+
if (!await migrateTsupToTsdown(workspaceInfo.rootDir, interactive, plan.packageManager, plan.tsupConfigFile, workspaceInfo.packages, {
|
|
883
|
+
silent: true,
|
|
884
|
+
report
|
|
885
|
+
})) {
|
|
886
|
+
failMigrationProgress("Migration failed");
|
|
887
|
+
cancelAndExit("Complete the tsup migration manually, then re-run `vp migrate`.", 1);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
863
890
|
const skipStagedMigration = shouldSkipStagedMigrationForHooks(workspaceInfo.rootDir, plan.shouldSetupHooks, plan.packageManager, workspaceInfo.packages);
|
|
864
891
|
updateMigrationProgress("Rewriting configs");
|
|
865
892
|
if (workspaceInfo.isMonorepo) rewriteMonorepo(workspaceInfo, skipStagedMigration, true, report);
|
|
@@ -1049,6 +1076,23 @@ async function main() {
|
|
|
1049
1076
|
}
|
|
1050
1077
|
} else if (prettierProject.hasDependency) warnPackageLevelPrettier();
|
|
1051
1078
|
}
|
|
1079
|
+
let tsupMigrated = false;
|
|
1080
|
+
if (fullSetup) {
|
|
1081
|
+
if (options.interactive) clearMigrationProgress();
|
|
1082
|
+
const { migrateTsup, tsupConfigFile } = await collectTsupMigrationDecision(workspaceInfoOptional.rootDir, setupOptions, workspaceInfoOptional.packages);
|
|
1083
|
+
if (migrateTsup) {
|
|
1084
|
+
await ensureExistingPackageManager();
|
|
1085
|
+
updateMigrationProgress("Migrating tsup");
|
|
1086
|
+
if (!await migrateTsupToTsdown(workspaceInfoOptional.rootDir, options.interactive, packageManager, tsupConfigFile, workspaceInfoOptional.packages, {
|
|
1087
|
+
silent: true,
|
|
1088
|
+
report
|
|
1089
|
+
})) {
|
|
1090
|
+
clearMigrationProgress();
|
|
1091
|
+
cancelAndExit("Complete the tsup migration manually, then re-run `vp migrate`.", 1);
|
|
1092
|
+
}
|
|
1093
|
+
tsupMigrated = true;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1052
1096
|
if (fullSetup) {
|
|
1053
1097
|
const nodeVersionDetection = detectNodeVersionManagerFile(workspaceInfoOptional.rootDir);
|
|
1054
1098
|
if (nodeVersionDetection) {
|
|
@@ -1066,13 +1110,18 @@ async function main() {
|
|
|
1066
1110
|
}
|
|
1067
1111
|
}
|
|
1068
1112
|
if (addFrameworkShimsForWorkspace(workspaceInfoOptional.rootDir, frameworkShimFrameworks, workspaceInfoOptional.packages, report, updateMigrationProgress)) didMigrate = true;
|
|
1069
|
-
if (eslintMigrated || prettierMigrated) {
|
|
1113
|
+
if (eslintMigrated || prettierMigrated || tsupMigrated) {
|
|
1070
1114
|
updateMigrationProgress("Rewriting configs");
|
|
1071
1115
|
mergeViteConfigFiles(workspaceInfoOptional.rootDir, true, report, workspaceInfoOptional.packages);
|
|
1116
|
+
if (tsupMigrated) {
|
|
1117
|
+
mergeTsdownConfigFile(workspaceInfoOptional.rootDir, true, report);
|
|
1118
|
+
for (const pkg of workspaceInfoOptional.packages ?? []) mergeTsdownConfigFile(path.join(workspaceInfoOptional.rootDir, pkg.path), true, report);
|
|
1119
|
+
}
|
|
1072
1120
|
needsInstall = true;
|
|
1073
1121
|
didMigrate = true;
|
|
1074
1122
|
report.eslintMigrated = eslintMigrated;
|
|
1075
1123
|
report.prettierMigrated = prettierMigrated;
|
|
1124
|
+
report.tsupMigrated = tsupMigrated;
|
|
1076
1125
|
}
|
|
1077
1126
|
if (plan.shouldSetupHooks) {
|
|
1078
1127
|
await ensureExistingPackageManager();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as addMigrationWarning, r as createMigrationReport } from "../../report-
|
|
1
|
+
import { n as addMigrationWarning, r as createMigrationReport } from "../../report-ZNR1Mk6h.js";
|
|
2
2
|
import { t as ROLLDOWN_COMPAT_RESULT_PREFIX } from "../../protocol-D99W10Qi.js";
|
|
3
3
|
import { writeSync } from "node:fs";
|
|
4
4
|
//#region src/migration/compat/manual-chunks.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { u as VITE_PLUS_NAME } from "./constants-Bn-U8o4v.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-DX5ezKbB.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-ipGb39Jo.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
|
|
@@ -684,11 +684,11 @@ cli.command("[...files]", "Bundle files", {
|
|
|
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() {
|
|
687
|
-
const viteConfig = await resolveViteConfig(process.cwd(), { traverseUp:
|
|
687
|
+
const viteConfig = flags.config === false ? void 0 : await resolveViteConfig(process.cwd(), { traverseUp: true });
|
|
688
688
|
const configDeps = /* @__PURE__ */ new Set();
|
|
689
|
-
if (viteConfig
|
|
689
|
+
if (viteConfig?.configFile) configDeps.add(viteConfig.configFile);
|
|
690
690
|
const configs = [];
|
|
691
|
-
const packConfigs = Array.isArray(viteConfig
|
|
691
|
+
const packConfigs = Array.isArray(viteConfig?.pack) ? viteConfig.pack : [viteConfig?.pack ?? {}];
|
|
692
692
|
for (const packConfig of packConfigs) {
|
|
693
693
|
const merged = {
|
|
694
694
|
...packConfig,
|
|
@@ -696,6 +696,7 @@ cli.command("[...files]", "Bundle files", {
|
|
|
696
696
|
};
|
|
697
697
|
if (merged.dts) merged.plugins = [...Array.isArray(merged.plugins) ? merged.plugins : [], externalDtsTypeOnlyPlugin()];
|
|
698
698
|
const resolvedConfig = await resolveUserConfig(merged, flags, configDeps);
|
|
699
|
+
resolvedConfig.forEach((config) => config.configDeps.forEach((dep) => configDeps.add(dep)));
|
|
699
700
|
configs.push(...resolvedConfig);
|
|
700
701
|
}
|
|
701
702
|
await buildWithConfigs(configs, configDeps, runBuild);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import "./constants-
|
|
2
|
-
import { i as readJsonFile } from "./json-
|
|
1
|
+
import "./constants-Bn-U8o4v.js";
|
|
2
|
+
import { i as readJsonFile } from "./json-cULBl7Pi.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import path from "node:path";
|
|
5
5
|
import fs from "node:fs";
|