vite-plus 0.1.15-alpha.4 → 0.1.15-alpha.6
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/dist/global/{agent-CmMz9vxG.js → agent-D-vEue3D.js} +11 -11
- package/dist/global/config.js +1 -1
- package/dist/global/create.js +4 -4
- package/dist/global/migrate.js +3 -3
- package/dist/global/{package-CnlCtq4D.js → package-2ArHHFnA.js} +4 -4
- package/dist/global/staged.js +2 -2
- package/dist/global/version.js +33 -78
- package/dist/global/{workspace-CWMon7nr.js → workspace-CYveUJBn.js} +2 -4
- package/dist/migration/detector.js +1 -1
- package/dist/migration/migrator.js +4 -4
- package/dist/utils/constants.d.ts +1 -1
- package/dist/utils/constants.js +5 -6
- package/dist/utils/editor.js +0 -2
- package/dist/utils/prompts.js +3 -3
- package/dist/versions.d.ts +9 -0
- package/dist/versions.js +9 -0
- package/package.json +19 -15
- package/skills/vite-plus/docs/guide/env.md +2 -2
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./chunk-BoAXSpZd.js";
|
|
2
2
|
import { _ as YAMLMap, g as YAMLSeq, i as parseDocument, n as parse, y as Scalar } from "./browser-09BZLUYM.js";
|
|
3
|
-
import { _ as isForceOverrideMode, c as readJsonFile, d as modify, f as parse$1, g as VITE_PLUS_VERSION, h as VITE_PLUS_OVERRIDE_PACKAGES, m as VITE_PLUS_NAME, n as detectPackageMetadata, o as editJsonFile, p as BASEURL_TSCONFIG_WARNING, s as isJsonFile, u as applyEdits } from "./package-
|
|
3
|
+
import { _ as isForceOverrideMode, c as readJsonFile, d as modify, f as parse$1, g as VITE_PLUS_VERSION, h as VITE_PLUS_OVERRIDE_PACKAGES, m as VITE_PLUS_NAME, n as detectPackageMetadata, o as editJsonFile, p as BASEURL_TSCONFIG_WARNING, s as isJsonFile, u as applyEdits } from "./package-2ArHHFnA.js";
|
|
4
4
|
import { n as accent } from "./help-HviKaKAU.js";
|
|
5
5
|
import { n as addMigrationWarning, t as addManualStep } from "./report-DGaKL5VQ.js";
|
|
6
6
|
import path from "node:path";
|
|
7
7
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
8
8
|
import process$1, { stdin, stdout } from "node:process";
|
|
9
9
|
import * as k from "node:readline";
|
|
10
|
-
import
|
|
10
|
+
import c from "node:readline";
|
|
11
11
|
import { ReadStream } from "node:tty";
|
|
12
12
|
import color from "picocolors";
|
|
13
13
|
import fs from "node:fs";
|
|
@@ -359,7 +359,7 @@ var B = class {
|
|
|
359
359
|
this.state = "cancel", this.close();
|
|
360
360
|
}, { once: !0 });
|
|
361
361
|
}
|
|
362
|
-
this.rl =
|
|
362
|
+
this.rl = c.createInterface({
|
|
363
363
|
input: this.input,
|
|
364
364
|
tabSize: 2,
|
|
365
365
|
prompt: "",
|
|
@@ -2921,7 +2921,7 @@ async function downloadPackageManager$1(packageManager, version, interactive, si
|
|
|
2921
2921
|
return downloadResult;
|
|
2922
2922
|
}
|
|
2923
2923
|
async function runViteInstall(cwd, interactive, extraArgs, options) {
|
|
2924
|
-
if (process.env.
|
|
2924
|
+
if (process.env.VP_SKIP_INSTALL) return {
|
|
2925
2925
|
durationMs: 0,
|
|
2926
2926
|
status: "skipped"
|
|
2927
2927
|
};
|
|
@@ -2929,7 +2929,7 @@ async function runViteInstall(cwd, interactive, extraArgs, options) {
|
|
|
2929
2929
|
const startTime = Date.now();
|
|
2930
2930
|
spinner.start(`Installing dependencies...`);
|
|
2931
2931
|
const { exitCode, stderr, stdout } = await runCommandSilently({
|
|
2932
|
-
command: process.env.
|
|
2932
|
+
command: process.env.VP_CLI_BIN ?? "vp",
|
|
2933
2933
|
args: ["install", ...extraArgs ?? []],
|
|
2934
2934
|
cwd,
|
|
2935
2935
|
envs: process.env
|
|
@@ -2958,7 +2958,7 @@ async function runViteFmt(cwd, interactive, paths, options) {
|
|
|
2958
2958
|
const startTime = Date.now();
|
|
2959
2959
|
spinner.start(`Formatting code...`);
|
|
2960
2960
|
const { exitCode, stderr, stdout } = await runCommandSilently({
|
|
2961
|
-
command: process.env.
|
|
2961
|
+
command: process.env.VP_CLI_BIN ?? "vp",
|
|
2962
2962
|
args: [
|
|
2963
2963
|
"fmt",
|
|
2964
2964
|
"--write",
|
|
@@ -3156,7 +3156,7 @@ function detectConfigs(projectPath) {
|
|
|
3156
3156
|
configs.tsdownConfig = config;
|
|
3157
3157
|
break;
|
|
3158
3158
|
}
|
|
3159
|
-
for (const config of [".oxlintrc.json"]) if (fs.existsSync(path.join(projectPath, config))) {
|
|
3159
|
+
for (const config of [".oxlintrc.json", ".oxlintrc.jsonc"]) if (fs.existsSync(path.join(projectPath, config))) {
|
|
3160
3160
|
configs.oxlintConfig = config;
|
|
3161
3161
|
break;
|
|
3162
3162
|
}
|
|
@@ -3318,7 +3318,7 @@ async function runOxlintMigrateStep(vpBin, cwd, migratePackage, args, spinner, f
|
|
|
3318
3318
|
}
|
|
3319
3319
|
}
|
|
3320
3320
|
async function migrateEslintToOxlint(projectPath, interactive, eslintConfigFile, packages, options) {
|
|
3321
|
-
const vpBin = process.env.
|
|
3321
|
+
const vpBin = process.env.VP_CLI_BIN ?? "vp";
|
|
3322
3322
|
const spinner = options?.silent ? {
|
|
3323
3323
|
start: () => {},
|
|
3324
3324
|
stop: () => {},
|
|
@@ -3462,7 +3462,7 @@ async function runPrettierMigrateStep(vpBin, cwd, spinner, failMessage, manualHi
|
|
|
3462
3462
|
}
|
|
3463
3463
|
}
|
|
3464
3464
|
async function migratePrettierToOxfmt(projectPath, interactive, prettierConfigFile, packages, options) {
|
|
3465
|
-
const vpBin = process.env.
|
|
3465
|
+
const vpBin = process.env.VP_CLI_BIN ?? "vp";
|
|
3466
3466
|
const spinner = options?.silent ? {
|
|
3467
3467
|
start: () => {},
|
|
3468
3468
|
stop: () => {},
|
|
@@ -3940,7 +3940,7 @@ function mergeViteConfigFiles(projectPath, silent = false, report) {
|
|
|
3940
3940
|
const viteConfig = ensureViteConfig(projectPath, configs, silent, report);
|
|
3941
3941
|
if (configs.oxlintConfig) {
|
|
3942
3942
|
const fullOxlintPath = path.join(projectPath, configs.oxlintConfig);
|
|
3943
|
-
const oxlintJson =
|
|
3943
|
+
const oxlintJson = readJsonFile(fullOxlintPath, true);
|
|
3944
3944
|
if (!oxlintJson.options) oxlintJson.options = {};
|
|
3945
3945
|
if (!hasBaseUrlInTsconfig(projectPath)) {
|
|
3946
3946
|
if (oxlintJson.options.typeAware === void 0) oxlintJson.options.typeAware = true;
|
|
@@ -4234,7 +4234,7 @@ function setupGitHooks(projectPath, oldHooksDir, silent = false, report) {
|
|
|
4234
4234
|
stdio: "pipe"
|
|
4235
4235
|
});
|
|
4236
4236
|
}
|
|
4237
|
-
const vpBin = process.env.
|
|
4237
|
+
const vpBin = process.env.VP_CLI_BIN ?? "vp";
|
|
4238
4238
|
const configArgs = isCustomDir ? [
|
|
4239
4239
|
"config",
|
|
4240
4240
|
"--hooks-only",
|
package/dist/global/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as promptGitHooks, T as defaultInteractive, d as ensurePreCommitHook, f as hasStagedConfigInViteConfig, i as updateExistingAgentInstructions } from "./agent-
|
|
1
|
+
import { D as promptGitHooks, T as defaultInteractive, d as ensurePreCommitHook, f as hasStagedConfigInViteConfig, i as updateExistingAgentInstructions } from "./agent-D-vEue3D.js";
|
|
2
2
|
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
3
3
|
import { i as log, t as renderCliDoc } from "./help-HviKaKAU.js";
|
|
4
4
|
import { join } from "node:path";
|
package/dist/global/create.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./chunk-BoAXSpZd.js";
|
|
2
|
-
import { A as selectPackageManager, B as log, D as promptGitHooks, E as downloadPackageManager$1, F as PackageManager, G as text, K as Ct, L as cancel, M as displayRelative, N as templatesDir, O as runViteFmt, P as DependencyType, R as confirm, T as defaultInteractive, U as select, V as multiselect, W as spinner, a as writeAgentInstructions, b as rewriteMonorepoProject, k as runViteInstall, n as detectExistingAgentTargetPaths, p as installGitHooks, r as selectAgentTargetPaths, x as rewriteStandaloneProject, y as rewriteMonorepo, z as intro } from "./agent-
|
|
2
|
+
import { A as selectPackageManager, B as log, D as promptGitHooks, E as downloadPackageManager$1, F as PackageManager, G as text, K as Ct, L as cancel, M as displayRelative, N as templatesDir, O as runViteFmt, P as DependencyType, R as confirm, T as defaultInteractive, U as select, V as multiselect, W as spinner, a as writeAgentInstructions, b as rewriteMonorepoProject, k as runViteInstall, n as detectExistingAgentTargetPaths, p as installGitHooks, r as selectAgentTargetPaths, x as rewriteStandaloneProject, y as rewriteMonorepo, z as intro } from "./agent-D-vEue3D.js";
|
|
3
3
|
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
4
|
-
import { c as readJsonFile, o as editJsonFile, t as checkNpmPackageExists } from "./package-
|
|
4
|
+
import { c as readJsonFile, o as editJsonFile, t as checkNpmPackageExists } from "./package-2ArHHFnA.js";
|
|
5
5
|
import { a as muted, i as log$1, n as accent, o as success, t as renderCliDoc } from "./help-HviKaKAU.js";
|
|
6
|
-
import { a as detectExistingEditor, n as updatePackageJsonWithDeps, o as selectEditor, r as updateWorkspaceConfig, s as writeEditorConfigs, t as detectWorkspace$1 } from "./workspace-
|
|
6
|
+
import { a as detectExistingEditor, n as updatePackageJsonWithDeps, o as selectEditor, r as updateWorkspaceConfig, s as writeEditorConfigs, t as detectWorkspace$1 } from "./workspace-CYveUJBn.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import { styleText } from "node:util";
|
|
9
9
|
import color from "picocolors";
|
|
@@ -3156,7 +3156,7 @@ function getRandomWord() {
|
|
|
3156
3156
|
}
|
|
3157
3157
|
//#endregion
|
|
3158
3158
|
//#region src/create/random-name.ts
|
|
3159
|
-
const isTest = process.env.
|
|
3159
|
+
const isTest = process.env.VP_CLI_TEST === "1";
|
|
3160
3160
|
function getRandomWords() {
|
|
3161
3161
|
const first = getRandomWord();
|
|
3162
3162
|
let second;
|
package/dist/global/migrate.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { r as __toESM } from "./chunk-BoAXSpZd.js";
|
|
2
|
-
import { A as selectPackageManager, B as log, D as promptGitHooks, E as downloadPackageManager$1, F as PackageManager, H as outro, I as require_semver, K as Ct, M as displayRelative, R as confirm, T as defaultInteractive, U as select, W as spinner, _ as migratePrettierToOxfmt, a as writeAgentInstructions, c as detectEslintProject, g as migrateNodeVersionManagerFile, h as migrateEslintToOxlint, j as upgradeYarn, k as runViteInstall, l as detectNodeVersionManagerFile, m as mergeViteConfigFiles, n as detectExistingAgentTargetPaths, o as checkViteVersion, p as installGitHooks, r as selectAgentTargetPaths, s as checkVitestVersion, t as detectAgentConflicts, u as detectPrettierProject, v as preflightGitHooksSetup, w as cancelAndExit, x as rewriteStandaloneProject, y as rewriteMonorepo } from "./agent-
|
|
2
|
+
import { A as selectPackageManager, B as log, D as promptGitHooks, E as downloadPackageManager$1, F as PackageManager, H as outro, I as require_semver, K as Ct, M as displayRelative, R as confirm, T as defaultInteractive, U as select, W as spinner, _ as migratePrettierToOxfmt, a as writeAgentInstructions, c as detectEslintProject, g as migrateNodeVersionManagerFile, h as migrateEslintToOxlint, j as upgradeYarn, k as runViteInstall, l as detectNodeVersionManagerFile, m as mergeViteConfigFiles, n as detectExistingAgentTargetPaths, o as checkViteVersion, p as installGitHooks, r as selectAgentTargetPaths, s as checkVitestVersion, t as detectAgentConflicts, u as detectPrettierProject, v as preflightGitHooksSetup, w as cancelAndExit, x as rewriteStandaloneProject, y as rewriteMonorepo } from "./agent-D-vEue3D.js";
|
|
3
3
|
import { t as lib_default } from "./lib-DxappLRQ.js";
|
|
4
|
-
import { _ as isForceOverrideMode, a as readNearestPackageJson, i as hasVitePlusDependency } from "./package-
|
|
4
|
+
import { _ as isForceOverrideMode, a as readNearestPackageJson, i as hasVitePlusDependency } from "./package-2ArHHFnA.js";
|
|
5
5
|
import { a as muted, i as log$1, n as accent, t as renderCliDoc } from "./help-HviKaKAU.js";
|
|
6
6
|
import { r as createMigrationReport } from "./report-DGaKL5VQ.js";
|
|
7
|
-
import { i as detectEditorConflicts, o as selectEditor, s as writeEditorConfigs, t as detectWorkspace$1 } from "./workspace-
|
|
7
|
+
import { i as detectEditorConflicts, o as selectEditor, s as writeEditorConfigs, t as detectWorkspace$1 } from "./workspace-CYveUJBn.js";
|
|
8
8
|
import path from "node:path";
|
|
9
9
|
import { styleText } from "node:util";
|
|
10
10
|
import { vitePlusHeader } from "../../binding/index.js";
|
|
@@ -3,18 +3,18 @@ import fs from "node:fs";
|
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
//#region src/utils/constants.ts
|
|
5
5
|
const VITE_PLUS_NAME = "vite-plus";
|
|
6
|
-
const VITE_PLUS_VERSION = process.env.
|
|
7
|
-
const VITE_PLUS_OVERRIDE_PACKAGES = process.env.
|
|
6
|
+
const VITE_PLUS_VERSION = process.env.VP_VERSION || "latest";
|
|
7
|
+
const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES ? JSON.parse(process.env.VP_OVERRIDE_PACKAGES) : {
|
|
8
8
|
vite: "npm:@voidzero-dev/vite-plus-core@latest",
|
|
9
9
|
vitest: "npm:@voidzero-dev/vite-plus-test@latest"
|
|
10
10
|
};
|
|
11
11
|
/**
|
|
12
|
-
* When
|
|
12
|
+
* When VP_FORCE_MIGRATE is set, force full dependency rewriting
|
|
13
13
|
* even for projects already using vite-plus. Used by ecosystem CI to
|
|
14
14
|
* override dependencies with locally built tgz packages.
|
|
15
15
|
*/
|
|
16
16
|
function isForceOverrideMode() {
|
|
17
|
-
return process.env.
|
|
17
|
+
return process.env.VP_FORCE_MIGRATE === "1";
|
|
18
18
|
}
|
|
19
19
|
createRequire(import.meta.url);
|
|
20
20
|
const BASEURL_TSCONFIG_WARNING = "Skipped typeAware/typeCheck: tsconfig.json contains baseUrl which is not yet supported by the oxlint type checker.\n Run `npx @andrewbranch/ts5to6 --fixBaseUrl .` to remove baseUrl from your tsconfig.";
|
package/dist/global/staged.js
CHANGED
|
@@ -4,7 +4,7 @@ import { i as log, r as errorMsg, t as renderCliDoc } from "./help-HviKaKAU.js";
|
|
|
4
4
|
import path, { delimiter, dirname, normalize, resolve } from "node:path";
|
|
5
5
|
import { formatWithOptions, inspect, promisify } from "node:util";
|
|
6
6
|
import { cwd } from "node:process";
|
|
7
|
-
import
|
|
7
|
+
import c from "node:readline";
|
|
8
8
|
import nodeTty from "node:tty";
|
|
9
9
|
import fs, { constants } from "node:fs";
|
|
10
10
|
import { vitePlusHeader } from "../../binding/index.js";
|
|
@@ -637,7 +637,7 @@ var L = class {
|
|
|
637
637
|
if (this._streamErr) t.push(this._streamErr);
|
|
638
638
|
if (this._streamOut) t.push(this._streamOut);
|
|
639
639
|
const n = g(t);
|
|
640
|
-
const r =
|
|
640
|
+
const r = c.createInterface({ input: n });
|
|
641
641
|
for await (const e of r) yield e.toString();
|
|
642
642
|
await this._processClosed;
|
|
643
643
|
e.removeAllListeners();
|
package/dist/global/version.js
CHANGED
|
@@ -1,16 +1,27 @@
|
|
|
1
|
-
import { i as hasVitePlusDependency,
|
|
1
|
+
import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-2ArHHFnA.js";
|
|
2
2
|
import { i as log, n as accent, t as renderCliDoc } from "./help-HviKaKAU.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
import { vitePlusHeader } from "../../binding/index.js";
|
|
6
|
-
|
|
6
|
+
//#region package.json
|
|
7
|
+
var version = "0.0.0";
|
|
8
|
+
//#endregion
|
|
7
9
|
//#region src/version.ts
|
|
8
|
-
|
|
10
|
+
/** Tool display names in the order shown by `vp --version`. */
|
|
11
|
+
const TOOL_DISPLAY_ORDER = [
|
|
12
|
+
"vite",
|
|
13
|
+
"rolldown",
|
|
14
|
+
"vitest",
|
|
15
|
+
"oxfmt",
|
|
16
|
+
"oxlint",
|
|
17
|
+
"oxlint-tsgolint",
|
|
18
|
+
"tsdown"
|
|
19
|
+
];
|
|
9
20
|
function getGlobalVersion() {
|
|
10
|
-
return process.env.
|
|
21
|
+
return process.env.VP_GLOBAL_VERSION ?? null;
|
|
11
22
|
}
|
|
12
23
|
function getCliVersion() {
|
|
13
|
-
return
|
|
24
|
+
return version ?? null;
|
|
14
25
|
}
|
|
15
26
|
function getLocalMetadata(cwd) {
|
|
16
27
|
if (!isVitePlusDeclaredInAncestors(cwd)) return null;
|
|
@@ -19,45 +30,26 @@ function getLocalMetadata(cwd) {
|
|
|
19
30
|
function isVitePlusDeclaredInAncestors(cwd) {
|
|
20
31
|
let currentDir = path.resolve(cwd);
|
|
21
32
|
while (true) {
|
|
22
|
-
const
|
|
23
|
-
|
|
33
|
+
const packageJsonPath = path.join(currentDir, "package.json");
|
|
34
|
+
try {
|
|
35
|
+
if (hasVitePlusDependency(JSON.parse(fs.readFileSync(packageJsonPath, "utf8")))) return true;
|
|
36
|
+
} catch {}
|
|
24
37
|
const parentDir = path.dirname(currentDir);
|
|
25
38
|
if (parentDir === currentDir) break;
|
|
26
39
|
currentDir = parentDir;
|
|
27
40
|
}
|
|
28
41
|
return false;
|
|
29
42
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
function resolvePackageJson(packageName, baseDir) {
|
|
43
|
+
/**
|
|
44
|
+
* Resolve all tool versions from the locally installed vite-plus package.
|
|
45
|
+
* Uses the `vite-plus/versions` export generated by `syncVersionsExport()`.
|
|
46
|
+
*/
|
|
47
|
+
async function resolveToolVersions(localPackagePath) {
|
|
38
48
|
try {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let dir = path.dirname(mainPath);
|
|
44
|
-
while (dir !== path.dirname(dir)) {
|
|
45
|
-
const pkg = readPackageJsonFromPath(path.join(dir, "package.json"));
|
|
46
|
-
if (pkg) return pkg;
|
|
47
|
-
dir = path.dirname(dir);
|
|
48
|
-
}
|
|
49
|
-
} catch {}
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
function resolveToolVersion(tool, localPackagePath) {
|
|
54
|
-
const pkg = resolvePackageJson(tool.packageName, localPackagePath);
|
|
55
|
-
const bundledVersion = tool.bundledVersionKey ? pkg?.bundledVersions?.[tool.bundledVersionKey] ?? null : null;
|
|
56
|
-
if (bundledVersion) return bundledVersion;
|
|
57
|
-
const version = pkg?.version ?? null;
|
|
58
|
-
if (version) return version;
|
|
59
|
-
if (tool.fallbackPackageJson) return readPackageJsonFromPath(path.join(localPackagePath, tool.fallbackPackageJson))?.version ?? null;
|
|
60
|
-
return null;
|
|
49
|
+
const mod = await import(`${localPackagePath}/dist/versions.js`);
|
|
50
|
+
if (mod.versions && typeof mod.versions === "object") return mod.versions;
|
|
51
|
+
} catch {}
|
|
52
|
+
return {};
|
|
61
53
|
}
|
|
62
54
|
/**
|
|
63
55
|
* Print version information
|
|
@@ -78,50 +70,13 @@ async function printVersion(cwd) {
|
|
|
78
70
|
description: localVersion ? `v${localVersion}` : "Not found"
|
|
79
71
|
}]
|
|
80
72
|
}];
|
|
81
|
-
const tools = [
|
|
82
|
-
{
|
|
83
|
-
displayName: "vite",
|
|
84
|
-
packageName: "@voidzero-dev/vite-plus-core",
|
|
85
|
-
bundledVersionKey: "vite"
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
displayName: "rolldown",
|
|
89
|
-
packageName: "@voidzero-dev/vite-plus-core",
|
|
90
|
-
bundledVersionKey: "rolldown"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
displayName: "vitest",
|
|
94
|
-
packageName: "@voidzero-dev/vite-plus-test",
|
|
95
|
-
bundledVersionKey: "vitest"
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
displayName: "oxfmt",
|
|
99
|
-
packageName: "oxfmt"
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
displayName: "oxlint",
|
|
103
|
-
packageName: "oxlint"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
displayName: "oxlint-tsgolint",
|
|
107
|
-
packageName: "oxlint-tsgolint"
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
displayName: "tsdown",
|
|
111
|
-
packageName: "@voidzero-dev/vite-plus-core",
|
|
112
|
-
bundledVersionKey: "tsdown"
|
|
113
|
-
}
|
|
114
|
-
];
|
|
115
73
|
if (localMetadata) {
|
|
116
|
-
const
|
|
117
|
-
tool,
|
|
118
|
-
version: resolveToolVersion(tool, localMetadata.path)
|
|
119
|
-
}));
|
|
74
|
+
const versions = await resolveToolVersions(localMetadata.path);
|
|
120
75
|
sections.push({
|
|
121
76
|
title: "Tools",
|
|
122
|
-
rows:
|
|
123
|
-
label: accent(
|
|
124
|
-
description:
|
|
77
|
+
rows: TOOL_DISPLAY_ORDER.map((name) => ({
|
|
78
|
+
label: accent(name),
|
|
79
|
+
description: versions[name] ? `v${versions[name]}` : "Not found"
|
|
125
80
|
}))
|
|
126
81
|
});
|
|
127
82
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as log, C as readYamlFile, F as PackageManager, K as Ct, S as editYamlFile, U as select } from "./agent-
|
|
1
|
+
import { B as log, C as readYamlFile, F as PackageManager, K as Ct, S as editYamlFile, U as select } from "./agent-D-vEue3D.js";
|
|
2
2
|
import { g as YAMLSeq, y as Scalar } from "./browser-09BZLUYM.js";
|
|
3
|
-
import { c as readJsonFile, l as writeJsonFile, o as editJsonFile, r as getScopeFromPackageName } from "./package-
|
|
3
|
+
import { c as readJsonFile, l as writeJsonFile, o as editJsonFile, r as getScopeFromPackageName } from "./package-2ArHHFnA.js";
|
|
4
4
|
import path, { posix, win32 } from "node:path";
|
|
5
5
|
import * as actualFS from "node:fs";
|
|
6
6
|
import fs from "node:fs";
|
|
@@ -23,9 +23,7 @@ const VSCODE_EXTENSIONS = { recommendations: ["VoidZero.vite-plus-extension-pack
|
|
|
23
23
|
const ZED_SETTINGS = {
|
|
24
24
|
lsp: {
|
|
25
25
|
oxlint: { initialization_options: { settings: {
|
|
26
|
-
configPath: "./.oxlintrc.json",
|
|
27
26
|
run: "onType",
|
|
28
|
-
disableNestedConfig: false,
|
|
29
27
|
fixKind: "safe_fix",
|
|
30
28
|
typeAware: true,
|
|
31
29
|
unusedDisableDirectives: "deny"
|
|
@@ -79,7 +79,7 @@ export function detectConfigs(projectPath) {
|
|
|
79
79
|
}
|
|
80
80
|
// Check for oxlint configs
|
|
81
81
|
// https://oxc.rs/docs/guide/usage/linter/config.html#configuration-file-format
|
|
82
|
-
const oxlintConfigs = ['.oxlintrc.json'];
|
|
82
|
+
const oxlintConfigs = ['.oxlintrc.json', '.oxlintrc.jsonc'];
|
|
83
83
|
for (const config of oxlintConfigs) {
|
|
84
84
|
if (fs.existsSync(path.join(projectPath, config))) {
|
|
85
85
|
configs.oxlintConfig = config;
|
|
@@ -144,7 +144,7 @@ async function runOxlintMigrateStep(vpBin, cwd, migratePackage, args, spinner, f
|
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
146
|
export async function migrateEslintToOxlint(projectPath, interactive, eslintConfigFile, packages, options) {
|
|
147
|
-
const vpBin = process.env.
|
|
147
|
+
const vpBin = process.env.VP_CLI_BIN ?? 'vp';
|
|
148
148
|
const spinner = options?.silent
|
|
149
149
|
? {
|
|
150
150
|
start: () => { },
|
|
@@ -326,7 +326,7 @@ async function runPrettierMigrateStep(vpBin, cwd, spinner, failMessage, manualHi
|
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
export async function migratePrettierToOxfmt(projectPath, interactive, prettierConfigFile, packages, options) {
|
|
329
|
-
const vpBin = process.env.
|
|
329
|
+
const vpBin = process.env.VP_CLI_BIN ?? 'vp';
|
|
330
330
|
const spinner = options?.silent
|
|
331
331
|
? {
|
|
332
332
|
start: () => { },
|
|
@@ -1055,7 +1055,7 @@ export function mergeViteConfigFiles(projectPath, silent = false, report) {
|
|
|
1055
1055
|
if (configs.oxlintConfig) {
|
|
1056
1056
|
// Inject options.typeAware and options.typeCheck defaults before merging
|
|
1057
1057
|
const fullOxlintPath = path.join(projectPath, configs.oxlintConfig);
|
|
1058
|
-
const oxlintJson =
|
|
1058
|
+
const oxlintJson = readJsonFile(fullOxlintPath, true);
|
|
1059
1059
|
if (!oxlintJson.options) {
|
|
1060
1060
|
oxlintJson.options = {};
|
|
1061
1061
|
}
|
|
@@ -1448,7 +1448,7 @@ export function setupGitHooks(projectPath, oldHooksDir, silent = false, report)
|
|
|
1448
1448
|
});
|
|
1449
1449
|
}
|
|
1450
1450
|
}
|
|
1451
|
-
const vpBin = process.env.
|
|
1451
|
+
const vpBin = process.env.VP_CLI_BIN ?? 'vp';
|
|
1452
1452
|
// Install git hooks via vp config (--hooks-only to skip agent setup, handled by migration)
|
|
1453
1453
|
const configArgs = isCustomDir
|
|
1454
1454
|
? ['config', '--hooks-only', '--hooks-dir', hooksDir]
|
|
@@ -2,7 +2,7 @@ export declare const VITE_PLUS_NAME = "vite-plus";
|
|
|
2
2
|
export declare const VITE_PLUS_VERSION: string;
|
|
3
3
|
export declare const VITE_PLUS_OVERRIDE_PACKAGES: Record<string, string>;
|
|
4
4
|
/**
|
|
5
|
-
* When
|
|
5
|
+
* When VP_FORCE_MIGRATE is set, force full dependency rewriting
|
|
6
6
|
* even for projects already using vite-plus. Used by ecosystem CI to
|
|
7
7
|
* override dependencies with locally built tgz packages.
|
|
8
8
|
*/
|
package/dist/utils/constants.js
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
export const VITE_PLUS_NAME = 'vite-plus';
|
|
3
|
-
export const VITE_PLUS_VERSION = process.env.
|
|
4
|
-
export const VITE_PLUS_OVERRIDE_PACKAGES = process.env
|
|
5
|
-
.
|
|
6
|
-
? JSON.parse(process.env.VITE_PLUS_OVERRIDE_PACKAGES)
|
|
3
|
+
export const VITE_PLUS_VERSION = process.env.VP_VERSION || 'latest';
|
|
4
|
+
export const VITE_PLUS_OVERRIDE_PACKAGES = process.env.VP_OVERRIDE_PACKAGES
|
|
5
|
+
? JSON.parse(process.env.VP_OVERRIDE_PACKAGES)
|
|
7
6
|
: {
|
|
8
7
|
vite: 'npm:@voidzero-dev/vite-plus-core@latest',
|
|
9
8
|
vitest: 'npm:@voidzero-dev/vite-plus-test@latest',
|
|
10
9
|
};
|
|
11
10
|
/**
|
|
12
|
-
* When
|
|
11
|
+
* When VP_FORCE_MIGRATE is set, force full dependency rewriting
|
|
13
12
|
* even for projects already using vite-plus. Used by ecosystem CI to
|
|
14
13
|
* override dependencies with locally built tgz packages.
|
|
15
14
|
*/
|
|
16
15
|
export function isForceOverrideMode() {
|
|
17
|
-
return process.env.
|
|
16
|
+
return process.env.VP_FORCE_MIGRATE === '1';
|
|
18
17
|
}
|
|
19
18
|
const require = createRequire(import.meta.url);
|
|
20
19
|
export function resolve(path) {
|
package/dist/utils/editor.js
CHANGED
package/dist/utils/prompts.js
CHANGED
|
@@ -44,14 +44,14 @@ export async function downloadPackageManager(packageManager, version, interactiv
|
|
|
44
44
|
}
|
|
45
45
|
export async function runViteInstall(cwd, interactive, extraArgs, options) {
|
|
46
46
|
// install dependencies on non-CI environment
|
|
47
|
-
if (process.env.
|
|
47
|
+
if (process.env.VP_SKIP_INSTALL) {
|
|
48
48
|
return { durationMs: 0, status: 'skipped' };
|
|
49
49
|
}
|
|
50
50
|
const spinner = options?.silent ? getSilentSpinner() : getSpinner(interactive);
|
|
51
51
|
const startTime = Date.now();
|
|
52
52
|
spinner.start(`Installing dependencies...`);
|
|
53
53
|
const { exitCode, stderr, stdout } = await runCommandSilently({
|
|
54
|
-
command: process.env.
|
|
54
|
+
command: process.env.VP_CLI_BIN ?? 'vp',
|
|
55
55
|
args: ['install', ...(extraArgs ?? [])],
|
|
56
56
|
cwd,
|
|
57
57
|
envs: process.env,
|
|
@@ -81,7 +81,7 @@ export async function runViteFmt(cwd, interactive, paths, options) {
|
|
|
81
81
|
const startTime = Date.now();
|
|
82
82
|
spinner.start(`Formatting code...`);
|
|
83
83
|
const { exitCode, stderr, stdout } = await runCommandSilently({
|
|
84
|
-
command: process.env.
|
|
84
|
+
command: process.env.VP_CLI_BIN ?? 'vp',
|
|
85
85
|
args: ['fmt', '--write', ...(paths ?? [])],
|
|
86
86
|
cwd,
|
|
87
87
|
envs: process.env,
|
package/dist/versions.js
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vite-plus",
|
|
3
|
-
"version": "0.1.15-alpha.
|
|
3
|
+
"version": "0.1.15-alpha.6",
|
|
4
4
|
"description": "The Unified Toolchain for the Web",
|
|
5
5
|
"homepage": "https://viteplus.dev/guide",
|
|
6
6
|
"bugs": {
|
|
@@ -75,6 +75,10 @@
|
|
|
75
75
|
"types": "./dist/pack.d.ts",
|
|
76
76
|
"import": "./dist/pack.js"
|
|
77
77
|
},
|
|
78
|
+
"./versions": {
|
|
79
|
+
"types": "./dist/versions.d.ts",
|
|
80
|
+
"default": "./dist/versions.js"
|
|
81
|
+
},
|
|
78
82
|
"./test": {
|
|
79
83
|
"import": {
|
|
80
84
|
"types": "./dist/test/index.d.ts",
|
|
@@ -316,10 +320,10 @@
|
|
|
316
320
|
"jsonc-parser": "^3.3.1",
|
|
317
321
|
"oxfmt": "=0.42.0",
|
|
318
322
|
"oxlint": "=1.57.0",
|
|
319
|
-
"oxlint-tsgolint": "=0.
|
|
323
|
+
"oxlint-tsgolint": "=0.18.1",
|
|
320
324
|
"picocolors": "^1.1.1",
|
|
321
|
-
"@voidzero-dev/vite-plus-
|
|
322
|
-
"@voidzero-dev/vite-plus-
|
|
325
|
+
"@voidzero-dev/vite-plus-core": "0.1.15-alpha.6",
|
|
326
|
+
"@voidzero-dev/vite-plus-test": "0.1.15-alpha.6"
|
|
323
327
|
},
|
|
324
328
|
"devDependencies": {
|
|
325
329
|
"@napi-rs/cli": "^3.4.1",
|
|
@@ -337,12 +341,12 @@
|
|
|
337
341
|
"mri": "^1.2.0",
|
|
338
342
|
"rolldown-plugin-dts": "^0.22.0",
|
|
339
343
|
"semver": "^7.7.3",
|
|
340
|
-
"tsdown": "^0.21.
|
|
344
|
+
"tsdown": "^0.21.7",
|
|
341
345
|
"validate-npm-package-name": "^7.0.2",
|
|
342
346
|
"yaml": "^2.8.1",
|
|
343
347
|
"@voidzero-dev/vite-plus-prompts": "0.0.0",
|
|
344
|
-
"
|
|
345
|
-
"
|
|
348
|
+
"vite": "npm:@voidzero-dev/vite-plus-core@0.1.15-alpha.6",
|
|
349
|
+
"rolldown": "1.0.0-rc.12"
|
|
346
350
|
},
|
|
347
351
|
"napi": {
|
|
348
352
|
"binaryName": "vite-plus",
|
|
@@ -362,14 +366,14 @@
|
|
|
362
366
|
"node": "^20.19.0 || >=22.12.0"
|
|
363
367
|
},
|
|
364
368
|
"optionalDependencies": {
|
|
365
|
-
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.15-alpha.
|
|
366
|
-
"@voidzero-dev/vite-plus-darwin-x64": "0.1.15-alpha.
|
|
367
|
-
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.15-alpha.
|
|
368
|
-
"@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.15-alpha.
|
|
369
|
-
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.15-alpha.
|
|
370
|
-
"@voidzero-dev/vite-plus-linux-x64-musl": "0.1.15-alpha.
|
|
371
|
-
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.15-alpha.
|
|
372
|
-
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.15-alpha.
|
|
369
|
+
"@voidzero-dev/vite-plus-darwin-arm64": "0.1.15-alpha.6",
|
|
370
|
+
"@voidzero-dev/vite-plus-darwin-x64": "0.1.15-alpha.6",
|
|
371
|
+
"@voidzero-dev/vite-plus-linux-arm64-gnu": "0.1.15-alpha.6",
|
|
372
|
+
"@voidzero-dev/vite-plus-linux-arm64-musl": "0.1.15-alpha.6",
|
|
373
|
+
"@voidzero-dev/vite-plus-linux-x64-gnu": "0.1.15-alpha.6",
|
|
374
|
+
"@voidzero-dev/vite-plus-linux-x64-musl": "0.1.15-alpha.6",
|
|
375
|
+
"@voidzero-dev/vite-plus-win32-x64-msvc": "0.1.15-alpha.6",
|
|
376
|
+
"@voidzero-dev/vite-plus-win32-arm64-msvc": "0.1.15-alpha.6"
|
|
373
377
|
},
|
|
374
378
|
"scripts": {
|
|
375
379
|
"build": "oxnode -C dev ./build.ts",
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
Managed mode is on by default, so `node`, `npm`, and related shims resolve through Vite+ and pick the right Node.js version for the current project.
|
|
8
8
|
|
|
9
|
-
By default, Vite+ stores its managed runtime and related files in `~/.vite-plus`. If needed, you can override that location with `
|
|
9
|
+
By default, Vite+ stores its managed runtime and related files in `~/.vite-plus`. If needed, you can override that location with `VP_HOME`.
|
|
10
10
|
|
|
11
11
|
If you want to keep that behavior, run:
|
|
12
12
|
|
|
@@ -28,7 +28,7 @@ This switches to system-first mode, where the shims prefer your system Node.js a
|
|
|
28
28
|
|
|
29
29
|
### Setup
|
|
30
30
|
|
|
31
|
-
- `vp env setup` creates or updates shims in `
|
|
31
|
+
- `vp env setup` creates or updates shims in `VP_HOME/bin`
|
|
32
32
|
- `vp env on` enables managed mode so shims always use Vite+-managed Node.js
|
|
33
33
|
- `vp env off` enables system-first mode so shims prefer system Node.js first
|
|
34
34
|
- `vp env print` prints the shell snippet for the current session
|