vite-plus 0.3.1 → 0.3.2
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 +1 -1
- package/bin/vp +1 -1
- package/binding/index.cjs +54 -55
- package/binding/index.d.cts +12 -0
- package/dist/{agent-C5jMYVfB.js → agent-C59HKB4Y.js} +2 -2
- package/dist/bin.js +6 -5
- package/dist/config/bin.js +2 -2
- package/dist/{constants-0IAVgpox.js → constants-IhOditRA.js} +2 -2
- package/dist/create/bin.js +19 -9
- package/dist/{define-config-U3_xg7i-.js → define-config-DAaCa0U_.js} +2 -2
- package/dist/{define-config-DIE9de46.cjs → define-config-DpAPETDf.cjs} +1 -1
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{editor-B5-lvRaU.js → editor-QOIGtmH4.js} +143 -36
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins-dev.d.ts +3 -0
- package/dist/lint-plugins-dev.js +2 -0
- package/dist/lint-plugins.cjs +21 -0
- package/dist/lint-plugins.d.ts +3 -0
- package/dist/lint-plugins.js +2 -0
- package/dist/migration/bin.js +7 -7
- package/dist/{oxlint-plugin-config-Drdl67Xp.js → oxlint-plugin-config-BU42tr8y.js} +1 -1
- package/dist/oxlint-plugin.js +93 -32
- package/dist/pack-bin.js +1 -1
- package/dist/{package-BZz2Ij68.js → package-BB-Jh_z3.js} +1 -1
- package/dist/{prompts-CtzEgFY-.js → prompts-CujFOJXu.js} +1 -1
- package/dist/{resolve-vite-config-Dnmc-lBc.js → resolve-vite-config-6Nox70uP.js} +1 -1
- package/dist/{resolve-vite-config-CGks1xR7.js → resolve-vite-config-CHHjsjKJ.js} +2 -2
- package/dist/staged/bin.js +1 -1
- package/dist/toolchain.js +8 -8
- package/dist/toolchain.json +8 -8
- package/dist/{tsconfig-CUggNuJR.js → tsconfig-DCtWfQPA.js} +2 -2
- package/dist/{tsconfig-VAbm4ZzJ.js → tsconfig-MXktI3SX.js} +1 -1
- package/dist/version.js +2 -2
- package/dist/versions.js +4 -4
- package/docs/config/fmt.md +4 -2
- package/docs/config/lint.md +4 -2
- package/docs/guide/env.md +29 -5
- package/docs/guide/fmt.md +3 -1
- package/docs/guide/install.md +1 -0
- package/docs/guide/installer-env-vars.md +35 -1
- package/docs/guide/lint.md +58 -1
- package/docs/guide/migrate-rules.md +38 -0
- package/docs/guide/migrate.md +1 -1
- package/docs/guide/monorepo.md +2 -0
- package/docs/guide/troubleshooting.md +14 -0
- package/package.json +23 -14
- package/templates/generator/README.md +14 -0
- package/templates/generator/bin/index.ts +54 -5
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-BU42tr8y.js";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import fs from "node:fs";
|
|
4
4
|
import { definePlugin, defineRule } from "@oxlint/plugins";
|
|
@@ -23,12 +23,33 @@ function isVitestFamilyDeclareModuleSpecifier(specifier) {
|
|
|
23
23
|
return specifier === "vitest" || specifier.startsWith("vitest/") || specifier === "@vitest/browser" || specifier.startsWith("@vitest/browser/") || specifier.startsWith("@vitest/browser-");
|
|
24
24
|
}
|
|
25
25
|
const VITE_CONFIG_FILE_BASENAMES = new Set(vite_config_entry_basenames_default);
|
|
26
|
+
function isOxlintFamilyDeclareModuleSpecifier(specifier) {
|
|
27
|
+
return specifier === OXLINT_PACKAGE || specifier.startsWith(`${OXLINT_PACKAGE}/`) || specifier === OXLINT_PLUGINS_PACKAGE;
|
|
28
|
+
}
|
|
26
29
|
function isViteSpecifier(specifier) {
|
|
27
30
|
return specifier === "vite" || specifier.startsWith("vite/");
|
|
28
31
|
}
|
|
29
32
|
function isViteConfigFile(filename) {
|
|
30
33
|
return VITE_CONFIG_FILE_BASENAMES.has(path.basename(filename));
|
|
31
34
|
}
|
|
35
|
+
const OXLINT_PACKAGE = "oxlint";
|
|
36
|
+
const OXLINT_PLUGINS_PACKAGE = "@oxlint/plugins";
|
|
37
|
+
const OXLINT_PLUGINS_DEV_SUBPATH = "oxlint/plugins-dev";
|
|
38
|
+
const VITE_PLUS_LINT_PLUGINS = "vite-plus/lint/plugins";
|
|
39
|
+
const VITE_PLUS_LINT_PLUGINS_DEV = "vite-plus/lint/plugins-dev";
|
|
40
|
+
const OXLINT_CONFIG_SURFACE_EXPORTS = /* @__PURE__ */ new Set([
|
|
41
|
+
"defineConfig",
|
|
42
|
+
"AllowWarnDeny",
|
|
43
|
+
"DummyRule",
|
|
44
|
+
"DummyRuleMap",
|
|
45
|
+
"ExternalPluginEntry",
|
|
46
|
+
"ExternalPluginsConfig",
|
|
47
|
+
"OxlintConfig",
|
|
48
|
+
"OxlintEnv",
|
|
49
|
+
"OxlintGlobals",
|
|
50
|
+
"OxlintOverride",
|
|
51
|
+
"RuleCategories"
|
|
52
|
+
]);
|
|
32
53
|
function rewriteVitePlusImportSpecifier(specifier) {
|
|
33
54
|
if (specifier === "vite") return "vite-plus";
|
|
34
55
|
if (specifier.startsWith("vite/")) return `vite-plus/${specifier.slice(5)}`;
|
|
@@ -54,17 +75,26 @@ function rewriteVitePlusImportSpecifier(specifier) {
|
|
|
54
75
|
if (specifier === `${prefix}/context`) return "vite-plus/test/browser/context";
|
|
55
76
|
if (specifier === `${prefix}/provider`) return `vite-plus/test/browser/providers/${provider}`;
|
|
56
77
|
}
|
|
78
|
+
if (specifier === OXLINT_PLUGINS_PACKAGE) return VITE_PLUS_LINT_PLUGINS;
|
|
79
|
+
if (specifier === OXLINT_PLUGINS_DEV_SUBPATH) return VITE_PLUS_LINT_PLUGINS_DEV;
|
|
57
80
|
return null;
|
|
58
81
|
}
|
|
82
|
+
function moduleBindingName(node) {
|
|
83
|
+
return node.type === "Identifier" ? node.name : node.value;
|
|
84
|
+
}
|
|
85
|
+
function importsOxlintPluginApi(node) {
|
|
86
|
+
return node.specifiers.length > 0 && node.specifiers.every((specifier) => specifier.type === "ImportSpecifier" && !OXLINT_CONFIG_SURFACE_EXPORTS.has(moduleBindingName(specifier.imported)));
|
|
87
|
+
}
|
|
59
88
|
function quoteSpecifier(literal, replacement) {
|
|
60
89
|
const quote = literal.raw?.startsWith("'") ? "'" : "\"";
|
|
61
90
|
return `${quote}${replacement}${quote}`;
|
|
62
91
|
}
|
|
63
92
|
const nuxtTestUtilsPackageCache = /* @__PURE__ */ new Map();
|
|
93
|
+
const oxlintOwnerPackageCache = /* @__PURE__ */ new Map();
|
|
64
94
|
function isUpstreamVitestSpecifier(specifier) {
|
|
65
95
|
return specifier === "vitest" || specifier.startsWith("vitest/");
|
|
66
96
|
}
|
|
67
|
-
function
|
|
97
|
+
function nearestPackageMatches(filename, cache, matchesPackage) {
|
|
68
98
|
if (!path.isAbsolute(filename)) return false;
|
|
69
99
|
let directory = path.dirname(filename);
|
|
70
100
|
while (true) {
|
|
@@ -74,34 +104,34 @@ function nearestPackageUsesNuxtTestUtils(filename) {
|
|
|
74
104
|
try {
|
|
75
105
|
mtimeMs = fs.statSync(packageJsonPath).mtimeMs;
|
|
76
106
|
} catch {}
|
|
77
|
-
const cached = mtimeMs === void 0 ? void 0 :
|
|
78
|
-
if (cached !== void 0 && cached.mtimeMs === mtimeMs) return cached.
|
|
79
|
-
let
|
|
107
|
+
const cached = mtimeMs === void 0 ? void 0 : cache.get(packageJsonPath);
|
|
108
|
+
if (cached !== void 0 && cached.mtimeMs === mtimeMs) return cached.matches;
|
|
109
|
+
let matches = false;
|
|
80
110
|
try {
|
|
81
|
-
|
|
82
|
-
usesNuxtTestUtils = [
|
|
83
|
-
pkg.dependencies,
|
|
84
|
-
pkg.devDependencies,
|
|
85
|
-
pkg.optionalDependencies
|
|
86
|
-
].some((dependencies) => dependencies?.["@nuxt/test-utils"] !== void 0);
|
|
111
|
+
matches = matchesPackage(JSON.parse(fs.readFileSync(packageJsonPath, "utf8")));
|
|
87
112
|
} catch {}
|
|
88
|
-
if (mtimeMs !== void 0)
|
|
113
|
+
if (mtimeMs !== void 0) cache.set(packageJsonPath, {
|
|
89
114
|
mtimeMs,
|
|
90
|
-
|
|
115
|
+
matches
|
|
91
116
|
});
|
|
92
|
-
return
|
|
117
|
+
return matches;
|
|
93
118
|
}
|
|
94
119
|
const parent = path.dirname(directory);
|
|
95
120
|
if (parent === directory) return false;
|
|
96
121
|
directory = parent;
|
|
97
122
|
}
|
|
98
123
|
}
|
|
99
|
-
function
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
124
|
+
function nearestPackageUsesNuxtTestUtils(filename) {
|
|
125
|
+
return nearestPackageMatches(filename, nuxtTestUtilsPackageCache, (pkg) => [
|
|
126
|
+
pkg.dependencies,
|
|
127
|
+
pkg.devDependencies,
|
|
128
|
+
pkg.optionalDependencies
|
|
129
|
+
].some((dependencies) => dependencies?.["@nuxt/test-utils"] !== void 0));
|
|
130
|
+
}
|
|
131
|
+
function nearestPackageOwnsOxlintApi(filename) {
|
|
132
|
+
return nearestPackageMatches(filename, oxlintOwnerPackageCache, (pkg) => pkg.optionalDependencies?.[OXLINT_PLUGINS_PACKAGE] !== void 0 || [pkg.dependencies, pkg.peerDependencies].some((dependencies) => dependencies?.[OXLINT_PACKAGE] !== void 0 || dependencies?.[OXLINT_PLUGINS_PACKAGE] !== void 0));
|
|
133
|
+
}
|
|
134
|
+
function reportSpecifier(context, literal, replacement) {
|
|
105
135
|
context.report({
|
|
106
136
|
node: literal,
|
|
107
137
|
messageId: "preferVitePlusImports",
|
|
@@ -114,6 +144,30 @@ function maybeReportLiteral(context, literal, preserveUpstreamVitest = false, fi
|
|
|
114
144
|
}
|
|
115
145
|
});
|
|
116
146
|
}
|
|
147
|
+
function isOxlintApiSpecifier(specifier) {
|
|
148
|
+
return specifier === OXLINT_PLUGINS_PACKAGE || specifier === OXLINT_PLUGINS_DEV_SUBPATH;
|
|
149
|
+
}
|
|
150
|
+
function maybeReportLiteral(context, literal, { preserveUpstreamVitest, fileIsViteConfig, ownsOxlintApi }) {
|
|
151
|
+
if (!literal || literal.type !== "Literal" || typeof literal.value !== "string") return;
|
|
152
|
+
if (preserveUpstreamVitest && isUpstreamVitestSpecifier(literal.value)) return;
|
|
153
|
+
if (!fileIsViteConfig && isViteSpecifier(literal.value)) return;
|
|
154
|
+
const replacement = rewriteVitePlusImportSpecifier(literal.value);
|
|
155
|
+
if (!replacement) return;
|
|
156
|
+
if (ownsOxlintApi && isOxlintApiSpecifier(literal.value)) return;
|
|
157
|
+
reportSpecifier(context, literal, replacement);
|
|
158
|
+
}
|
|
159
|
+
function reportLegacyOxlintPluginApiExport(context, node, ownsOxlintApi) {
|
|
160
|
+
const literal = node.source;
|
|
161
|
+
if (!literal || literal.value !== OXLINT_PACKAGE || ownsOxlintApi) return;
|
|
162
|
+
if (node.specifiers.length === 0) return;
|
|
163
|
+
if (!node.specifiers.every((specifier) => !OXLINT_CONFIG_SURFACE_EXPORTS.has(moduleBindingName(specifier.local)))) return;
|
|
164
|
+
reportSpecifier(context, literal, VITE_PLUS_LINT_PLUGINS);
|
|
165
|
+
}
|
|
166
|
+
function reportLegacyOxlintPluginApiImport(context, node, ownsOxlintApi) {
|
|
167
|
+
const literal = node.source;
|
|
168
|
+
if (literal.value !== OXLINT_PACKAGE || ownsOxlintApi || !importsOxlintPluginApi(node)) return;
|
|
169
|
+
reportSpecifier(context, literal, VITE_PLUS_LINT_PLUGINS);
|
|
170
|
+
}
|
|
117
171
|
const preferVitePlusImportsRule = defineRule({
|
|
118
172
|
meta: {
|
|
119
173
|
type: "problem",
|
|
@@ -126,36 +180,43 @@ const preferVitePlusImportsRule = defineRule({
|
|
|
126
180
|
messages: { preferVitePlusImports: "Use '{{to}}' instead of '{{from}}' in Vite+ projects." }
|
|
127
181
|
},
|
|
128
182
|
createOnce(context) {
|
|
129
|
-
|
|
130
|
-
|
|
183
|
+
const options = {
|
|
184
|
+
preserveUpstreamVitest: false,
|
|
185
|
+
fileIsViteConfig: false,
|
|
186
|
+
ownsOxlintApi: false
|
|
187
|
+
};
|
|
131
188
|
return {
|
|
132
189
|
Program() {
|
|
133
|
-
preserveUpstreamVitest = nearestPackageUsesNuxtTestUtils(context.filename);
|
|
134
|
-
fileIsViteConfig = isViteConfigFile(context.filename);
|
|
190
|
+
options.preserveUpstreamVitest = nearestPackageUsesNuxtTestUtils(context.filename);
|
|
191
|
+
options.fileIsViteConfig = isViteConfigFile(context.filename);
|
|
192
|
+
options.ownsOxlintApi = nearestPackageOwnsOxlintApi(context.filename);
|
|
135
193
|
},
|
|
136
194
|
ImportDeclaration(node) {
|
|
137
|
-
maybeReportLiteral(context, node.source,
|
|
195
|
+
maybeReportLiteral(context, node.source, options);
|
|
196
|
+
reportLegacyOxlintPluginApiImport(context, node, options.ownsOxlintApi);
|
|
138
197
|
},
|
|
139
198
|
ExportAllDeclaration(node) {
|
|
140
|
-
maybeReportLiteral(context, node.source,
|
|
199
|
+
maybeReportLiteral(context, node.source, options);
|
|
141
200
|
},
|
|
142
201
|
ExportNamedDeclaration(node) {
|
|
143
|
-
maybeReportLiteral(context, node.source,
|
|
202
|
+
maybeReportLiteral(context, node.source, options);
|
|
203
|
+
reportLegacyOxlintPluginApiExport(context, node, options.ownsOxlintApi);
|
|
144
204
|
},
|
|
145
205
|
ImportExpression(node) {
|
|
146
|
-
maybeReportLiteral(context, node.source,
|
|
206
|
+
maybeReportLiteral(context, node.source, options);
|
|
147
207
|
},
|
|
148
208
|
TSImportType(node) {
|
|
149
|
-
maybeReportLiteral(context, node.source,
|
|
209
|
+
maybeReportLiteral(context, node.source, options);
|
|
150
210
|
},
|
|
151
211
|
TSExternalModuleReference(node) {
|
|
152
|
-
|
|
212
|
+
if (node.expression.type === "Literal" && typeof node.expression.value === "string" && isOxlintApiSpecifier(node.expression.value)) return;
|
|
213
|
+
maybeReportLiteral(context, node.expression, options);
|
|
153
214
|
},
|
|
154
215
|
TSModuleDeclaration(node) {
|
|
155
216
|
if (node.global) return;
|
|
156
217
|
const id = node.id;
|
|
157
|
-
if (id?.type === "Literal" && typeof id.value === "string" && isVitestFamilyDeclareModuleSpecifier(id.value)) return;
|
|
158
|
-
maybeReportLiteral(context, id,
|
|
218
|
+
if (id?.type === "Literal" && typeof id.value === "string" && (isVitestFamilyDeclareModuleSpecifier(id.value) || isOxlintFamilyDeclareModuleSpecifier(id.value))) return;
|
|
219
|
+
maybeReportLiteral(context, id, options);
|
|
159
220
|
}
|
|
160
221
|
};
|
|
161
222
|
}
|
package/dist/pack-bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { t as cac } from "./dist-DfmT__Aw.js";
|
|
3
|
-
import { o as resolveViteConfig } from "./resolve-vite-config-
|
|
3
|
+
import { o as resolveViteConfig } from "./resolve-vite-config-CHHjsjKJ.js";
|
|
4
4
|
import module from "node:module";
|
|
5
5
|
import { buildWithConfigs, enableDebug, globalLogger, resolveUserConfig } from "vite/pack";
|
|
6
6
|
//#region src/pack-bin.ts
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "./rolldown-runtime-CMFfr-1z.js";
|
|
2
2
|
import { t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
-
import { f as VITE_PLUS_VERSION } from "./constants-
|
|
3
|
+
import { f as VITE_PLUS_VERSION } from "./constants-IhOditRA.js";
|
|
4
4
|
import { a as writeJsonFile, i as readJsonFile } from "./json-cULBl7Pi.js";
|
|
5
5
|
import { t as require_semver } from "./semver-CaDAb8vV.js";
|
|
6
6
|
import { n as runCommandSilently } from "./command-CguLh2KL.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as resolveUniversalViteConfig } from "./resolve-vite-config-
|
|
1
|
+
import { a as resolveUniversalViteConfig } from "./resolve-vite-config-CHHjsjKJ.js";
|
|
2
2
|
export { resolveUniversalViteConfig };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { l as VITE_CONFIG_FILES } from "./constants-
|
|
2
|
-
import { u as withConfigMetadataResolution } from "./define-config-
|
|
1
|
+
import { l as VITE_CONFIG_FILES } from "./constants-IhOditRA.js";
|
|
2
|
+
import { u as withConfigMetadataResolution } from "./define-config-DAaCa0U_.js";
|
|
3
3
|
import path from "node:path";
|
|
4
4
|
import fs from "node:fs";
|
|
5
5
|
//#region src/resolve-vite-config.ts
|
package/dist/staged/bin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as __toESM, t as __commonJSMin } from "../rolldown-runtime-CMFfr-1z.js";
|
|
2
2
|
import { i as log, n as errorMsg, o as printHeader } from "../terminal-MKGAuy-p.js";
|
|
3
|
-
import { o as resolveViteConfig } from "../resolve-vite-config-
|
|
3
|
+
import { o as resolveViteConfig } from "../resolve-vite-config-CHHjsjKJ.js";
|
|
4
4
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
5
5
|
import { createRequire } from "node:module";
|
|
6
6
|
import path, { basename, delimiter, dirname, normalize, resolve } from "node:path";
|
package/dist/toolchain.js
CHANGED
|
@@ -4,7 +4,7 @@ export const toolchain = {
|
|
|
4
4
|
{
|
|
5
5
|
"id": "vite-plus",
|
|
6
6
|
"name": "vite-plus",
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.2",
|
|
8
8
|
"kind": "package",
|
|
9
9
|
"delivery": [
|
|
10
10
|
"dependency"
|
|
@@ -14,7 +14,7 @@ export const toolchain = {
|
|
|
14
14
|
{
|
|
15
15
|
"id": "vite-plus-core",
|
|
16
16
|
"name": "@voidzero-dev/vite-plus-core",
|
|
17
|
-
"version": "0.3.
|
|
17
|
+
"version": "0.3.2",
|
|
18
18
|
"kind": "package",
|
|
19
19
|
"delivery": [
|
|
20
20
|
"dependency"
|
|
@@ -26,7 +26,7 @@ export const toolchain = {
|
|
|
26
26
|
{
|
|
27
27
|
"id": "vite",
|
|
28
28
|
"name": "vite",
|
|
29
|
-
"version": "8.
|
|
29
|
+
"version": "8.3.0",
|
|
30
30
|
"kind": "tool",
|
|
31
31
|
"delivery": [
|
|
32
32
|
"bundled"
|
|
@@ -36,7 +36,7 @@ export const toolchain = {
|
|
|
36
36
|
{
|
|
37
37
|
"id": "rolldown",
|
|
38
38
|
"name": "rolldown",
|
|
39
|
-
"version": "1.2.
|
|
39
|
+
"version": "1.2.8",
|
|
40
40
|
"kind": "tool",
|
|
41
41
|
"delivery": [
|
|
42
42
|
"bundled",
|
|
@@ -57,7 +57,7 @@ export const toolchain = {
|
|
|
57
57
|
{
|
|
58
58
|
"id": "oxlint",
|
|
59
59
|
"name": "oxlint",
|
|
60
|
-
"version": "1.
|
|
60
|
+
"version": "1.82.0",
|
|
61
61
|
"kind": "tool",
|
|
62
62
|
"delivery": [
|
|
63
63
|
"dependency"
|
|
@@ -67,7 +67,7 @@ export const toolchain = {
|
|
|
67
67
|
{
|
|
68
68
|
"id": "oxfmt",
|
|
69
69
|
"name": "oxfmt",
|
|
70
|
-
"version": "0.
|
|
70
|
+
"version": "0.67.0",
|
|
71
71
|
"kind": "tool",
|
|
72
72
|
"delivery": [
|
|
73
73
|
"dependency"
|
|
@@ -100,7 +100,7 @@ export const toolchain = {
|
|
|
100
100
|
"id": "vite-task",
|
|
101
101
|
"name": "vite-task",
|
|
102
102
|
"revision": "d05b1dcdbaabaa69643ee0b89cebe3cd390957e9",
|
|
103
|
-
"builtAt": "2026-09-
|
|
103
|
+
"builtAt": "2026-09-14T14:39:37Z",
|
|
104
104
|
"kind": "tool",
|
|
105
105
|
"delivery": [
|
|
106
106
|
"compiled"
|
|
@@ -110,7 +110,7 @@ export const toolchain = {
|
|
|
110
110
|
{
|
|
111
111
|
"id": "oxc",
|
|
112
112
|
"name": "oxc",
|
|
113
|
-
"version": "0.
|
|
113
|
+
"version": "0.149.0",
|
|
114
114
|
"kind": "engine",
|
|
115
115
|
"delivery": [
|
|
116
116
|
"compiled"
|
package/dist/toolchain.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"id": "vite-plus",
|
|
6
6
|
"name": "vite-plus",
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.2",
|
|
8
8
|
"kind": "package",
|
|
9
9
|
"delivery": [
|
|
10
10
|
"dependency"
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
{
|
|
15
15
|
"id": "vite-plus-core",
|
|
16
16
|
"name": "@voidzero-dev/vite-plus-core",
|
|
17
|
-
"version": "0.3.
|
|
17
|
+
"version": "0.3.2",
|
|
18
18
|
"kind": "package",
|
|
19
19
|
"delivery": [
|
|
20
20
|
"dependency"
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
{
|
|
27
27
|
"id": "vite",
|
|
28
28
|
"name": "vite",
|
|
29
|
-
"version": "8.
|
|
29
|
+
"version": "8.3.0",
|
|
30
30
|
"kind": "tool",
|
|
31
31
|
"delivery": [
|
|
32
32
|
"bundled"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
{
|
|
37
37
|
"id": "rolldown",
|
|
38
38
|
"name": "rolldown",
|
|
39
|
-
"version": "1.2.
|
|
39
|
+
"version": "1.2.8",
|
|
40
40
|
"kind": "tool",
|
|
41
41
|
"delivery": [
|
|
42
42
|
"bundled",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
{
|
|
58
58
|
"id": "oxlint",
|
|
59
59
|
"name": "oxlint",
|
|
60
|
-
"version": "1.
|
|
60
|
+
"version": "1.82.0",
|
|
61
61
|
"kind": "tool",
|
|
62
62
|
"delivery": [
|
|
63
63
|
"dependency"
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
{
|
|
68
68
|
"id": "oxfmt",
|
|
69
69
|
"name": "oxfmt",
|
|
70
|
-
"version": "0.
|
|
70
|
+
"version": "0.67.0",
|
|
71
71
|
"kind": "tool",
|
|
72
72
|
"delivery": [
|
|
73
73
|
"dependency"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
"id": "vite-task",
|
|
101
101
|
"name": "vite-task",
|
|
102
102
|
"revision": "d05b1dcdbaabaa69643ee0b89cebe3cd390957e9",
|
|
103
|
-
"builtAt": "2026-09-
|
|
103
|
+
"builtAt": "2026-09-14T14:39:37Z",
|
|
104
104
|
"kind": "tool",
|
|
105
105
|
"delivery": [
|
|
106
106
|
"compiled"
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
{
|
|
111
111
|
"id": "oxc",
|
|
112
112
|
"name": "oxc",
|
|
113
|
-
"version": "0.
|
|
113
|
+
"version": "0.149.0",
|
|
114
114
|
"kind": "engine",
|
|
115
115
|
"delivery": [
|
|
116
116
|
"compiled"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-
|
|
1
|
+
import { p as createBaseUrlTsconfigFixArgs, t as BASEURL_TSCONFIG_FIX_PACKAGE } from "./constants-IhOditRA.js";
|
|
2
2
|
import { c as parse, o as applyEdits, s as modify } from "./json-cULBl7Pi.js";
|
|
3
|
-
import { S as log, b as confirm, k as isCancel, t as cancelAndExit } from "./prompts-
|
|
3
|
+
import { S as log, b as confirm, k as isCancel, t as cancelAndExit } from "./prompts-CujFOJXu.js";
|
|
4
4
|
import { n as runCommandSilently } from "./command-CguLh2KL.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { styleText } from "node:util";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig } from "./tsconfig-
|
|
1
|
+
import { a as hasBaseUrlInTsconfig, i as fixBaseUrlInTsconfig } from "./tsconfig-DCtWfQPA.js";
|
|
2
2
|
export { fixBaseUrlInTsconfig, hasBaseUrlInTsconfig };
|
package/dist/version.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as renderCliDoc } from "./help-BmKpeOP9.js";
|
|
2
2
|
import { i as log, o as printHeader, t as accent } from "./terminal-MKGAuy-p.js";
|
|
3
|
-
import { _ as version } from "./constants-
|
|
4
|
-
import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-
|
|
3
|
+
import { _ as version } from "./constants-IhOditRA.js";
|
|
4
|
+
import { i as hasVitePlusDependency, n as detectPackageMetadata } from "./package-BB-Jh_z3.js";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import fs from "node:fs";
|
|
7
7
|
//#region src/version.ts
|
package/dist/versions.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export const versions = {
|
|
2
|
-
"vite": "8.
|
|
3
|
-
"rolldown": "1.2.
|
|
2
|
+
"vite": "8.3.0",
|
|
3
|
+
"rolldown": "1.2.8",
|
|
4
4
|
"vitest": "4.1.11",
|
|
5
|
-
"oxfmt": "0.
|
|
6
|
-
"oxlint": "1.
|
|
5
|
+
"oxfmt": "0.67.0",
|
|
6
|
+
"oxlint": "1.82.0",
|
|
7
7
|
"oxlint-tsgolint": "7.0.2001",
|
|
8
8
|
"tsdown": "0.23.0"
|
|
9
9
|
};
|
package/docs/config/fmt.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Format Config
|
|
2
2
|
|
|
3
|
-
`vp fmt` and `vp check` read Oxfmt settings from the `fmt` block in `vite.config.ts`. See [Oxfmt's configuration](https://oxc.rs/docs/guide/usage/formatter/config.html) for details.
|
|
3
|
+
`vp fmt` and `vp check` read Oxfmt settings from the `fmt` block in the root `vite.config.ts`. See [Oxfmt's configuration](https://oxc.rs/docs/guide/usage/formatter/config.html) for details.
|
|
4
4
|
|
|
5
5
|
## Example
|
|
6
6
|
|
|
@@ -17,4 +17,6 @@ export default defineConfig({
|
|
|
17
17
|
});
|
|
18
18
|
```
|
|
19
19
|
|
|
20
|
-
For package-specific formatting settings
|
|
20
|
+
For file- or package-specific formatting settings, use [`fmt.overrides`](/guide/monorepo#format-overrides) from the root `vite.config.ts`.
|
|
21
|
+
|
|
22
|
+
Vite+ does not currently support nested format configuration. See [troubleshooting](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) for details and how to give feedback on future support.
|
package/docs/config/lint.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Lint Config
|
|
2
2
|
|
|
3
|
-
`vp lint` and `vp check` read Oxlint settings from the `lint` block in `vite.config.ts`. See [Oxlint's configuration](https://oxc.rs/docs/guide/usage/linter/config.html) for details.
|
|
3
|
+
`vp lint` and `vp check` read Oxlint settings from the `lint` block in the root `vite.config.ts`. See [Oxlint's configuration](https://oxc.rs/docs/guide/usage/linter/config.html) for details.
|
|
4
4
|
|
|
5
5
|
## Example
|
|
6
6
|
|
|
@@ -23,4 +23,6 @@ export default defineConfig({
|
|
|
23
23
|
|
|
24
24
|
We recommend enabling both `options.typeAware` and `options.typeCheck` so `vp lint` and `vp check` can use the full type-aware path.
|
|
25
25
|
|
|
26
|
-
For package-specific lint rules
|
|
26
|
+
For file- or package-specific lint rules, use [`lint.overrides`](/guide/monorepo#root-config-with-overrides) from the root `vite.config.ts`.
|
|
27
|
+
|
|
28
|
+
Vite+ does not currently support nested lint configuration. See [troubleshooting](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) for details and how to give feedback on future support.
|
package/docs/guide/env.md
CHANGED
|
@@ -47,14 +47,36 @@ This setting also disables pnpm's automatic management of other declared runtime
|
|
|
47
47
|
Package-manager selection uses this priority:
|
|
48
48
|
|
|
49
49
|
1. Explicit command override
|
|
50
|
-
2. `VP_PACKAGE_MANAGER`
|
|
50
|
+
2. `VP_PACKAGE_MANAGER`
|
|
51
51
|
3. Top-level `packageManager`
|
|
52
52
|
4. `devEngines.packageManager`
|
|
53
53
|
5. Lockfile or manager-specific configuration
|
|
54
54
|
6. The named package manager's global default version
|
|
55
55
|
7. The named shim's latest release
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
`VP_PACKAGE_MANAGER` selects the manager and version for commands such as `vp install`. Direct package-manager shims ignore this variable and use independent version overrides:
|
|
58
|
+
|
|
59
|
+
| Variable | Shims |
|
|
60
|
+
| ----------------- | ----------------- |
|
|
61
|
+
| `VP_NPM_VERSION` | `npm`, `npx` |
|
|
62
|
+
| `VP_PNPM_VERSION` | `pnpm`, `pnpx` |
|
|
63
|
+
| `VP_YARN_VERSION` | `yarn`, `yarnpkg` |
|
|
64
|
+
| `VP_BUN_VERSION` | `bun`, `bunx` |
|
|
65
|
+
|
|
66
|
+
These variables accept a version or range, such as `10.18.0`, `10`, or `latest`, and override the matching shim's project and default versions. They do not change the manager or version selected by `vp install`.
|
|
67
|
+
|
|
68
|
+
`vp env use pnpm@10.20.0` sets `VP_PNPM_VERSION` for the current shell, just as `vp env use node@22` sets `VP_NODE_VERSION`. Each package manager has its own override, so switching Yarn does not clear a pnpm override. `vp env use` does not set or clear `VP_PACKAGE_MANAGER`.
|
|
69
|
+
|
|
70
|
+
Direct shims resolve their version from the matching environment variable, then the matching session file when no shell wrapper is available, then project configuration and the family default. `vp env current pnpm` and `vp env which pnpm` inspect this shim selection; `vp env current pm` reports the manager selected for vp commands.
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
VP_PACKAGE_MANAGER=pnpm@10.18.0 vp install
|
|
74
|
+
VP_PNPM_VERSION=10.20.0 pnpm --version
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
The overrides apply in managed mode. A package manager can also perform its own version switching after Vite+ launches it; for example, pnpm's `managePackageManagerVersions` setting may switch back to the version in `package.json`.
|
|
78
|
+
|
|
79
|
+
A project selection applies only to its matching shims. For example, pnpm controls `pnpm` and `pnpx`; invoking `npm` still resolves npm independently. Without a matching project selection, a named shim uses its configured default version and otherwise uses the latest release without prompting. The resolved version is cached for one hour and an expired cache remains available when the registry cannot be reached. The directly invoked npm shim keeps its Node-bundled fallback, while an explicit `vp env ... npm` family scope uses standalone npm's latest release.
|
|
58
80
|
|
|
59
81
|
A fresh install uses the split platform layout by default. On Unix, Vite+
|
|
60
82
|
stores managed runtimes and related files in `~/.local/share/vite-plus`. It
|
|
@@ -130,13 +152,14 @@ vp-use --unset
|
|
|
130
152
|
Only `vp env use` needs this alternate command. Other `vp env` commands work normally in Command Prompt. `vp env setup` creates `vp-use.cmd` in the bin directory on Windows.
|
|
131
153
|
|
|
132
154
|
In CI, `vp env use` can run without shell initialization. It writes a temporary
|
|
133
|
-
|
|
155
|
+
session file per runtime or package manager in the resolved state directory,
|
|
156
|
+
such as `.session-node-version` or `.session-pnpm-version`. Later
|
|
134
157
|
shim calls in the same job use these files to resolve the same environment.
|
|
135
158
|
|
|
136
159
|
### Manage
|
|
137
160
|
|
|
138
161
|
- `vp env default` shows the global Node.js default and each configured package-manager version. Bare versions set Node.js; qualified specs such as `pnpm@10.18.0` set that package manager's shim default without replacing the defaults for Bun, Yarn, or npm. `--unset` clears all defaults unless scoped.
|
|
139
|
-
- `vp env pin` shows or writes project pins. Existing `.node-version` and top-level `packageManager` fields keep being updated for compatibility;
|
|
162
|
+
- `vp env pin` shows or writes project pins. Existing `.node-version` and top-level `packageManager` fields keep being updated for compatibility. An existing `.nvmrc` is updated when it is the effective Node source in the current directory; its comments and other non-version content are preserved. Otherwise Vite+ writes the matching `devEngines` entry. Use `--target node-version`, `--target nvmrc`, `--target dev-engines`, or `--target package-manager` to choose explicitly. Pinning in a child directory does not modify an inherited `.nvmrc`.
|
|
140
163
|
- `vp env unpin` removes both effective pins by default; append a selector to remove one. Lower-priority declarations are not deleted.
|
|
141
164
|
- `vp env use` activates the complete project environment. Explicit specs override selected components; `--unset` clears both unless scoped.
|
|
142
165
|
- `vp env install` installs the complete resolved environment, a selected component, or explicit specs.
|
|
@@ -175,7 +198,8 @@ vp env install # Install the complete resolved environment
|
|
|
175
198
|
vp env default node@24 # Set the global Node.js default
|
|
176
199
|
vp env default pnpm@10 # Set pnpm's global default version
|
|
177
200
|
vp env use 20 pnpm@10 # Override both components for this shell
|
|
178
|
-
vp env use --unset
|
|
201
|
+
vp env use --unset pnpm # Remove only the pnpm session version
|
|
202
|
+
vp env use --unset pm # Remove all package-manager session versions
|
|
179
203
|
vp env clean # Remove unused managed Node.js and package manager versions
|
|
180
204
|
|
|
181
205
|
# Inspect
|
package/docs/guide/fmt.md
CHANGED
|
@@ -18,7 +18,9 @@ vp fmt . --write
|
|
|
18
18
|
|
|
19
19
|
## Configuration
|
|
20
20
|
|
|
21
|
-
Put formatting configuration directly in the `fmt` block in `vite.config.ts` so all your configuration stays in one place. We do not recommend using `.oxfmtrc.json` with Vite+.
|
|
21
|
+
Put formatting configuration directly in the `fmt` block in the root `vite.config.ts` so all your configuration stays in one place. We do not recommend using `.oxfmtrc.json` with Vite+.
|
|
22
|
+
|
|
23
|
+
Vite+ does not currently support nested format configuration. For now, use [`fmt.overrides`](/guide/monorepo#format-overrides) in the root `vite.config.ts` for file- or package-specific options. The long-term behavior is open for discussion; [share your use case and expectations](/guide/troubleshooting#nested-lint-or-format-config-is-not-applied) to help shape it.
|
|
22
24
|
|
|
23
25
|
For editors, disable nested formatter configs so format-on-save uses the root Vite+ `fmt` block:
|
|
24
26
|
|
package/docs/guide/install.md
CHANGED
|
@@ -140,6 +140,7 @@ Use `vp add` and `vp remove` for day-to-day dependency edits instead of editing
|
|
|
140
140
|
- `vp add -D typescript vitest`
|
|
141
141
|
- `vp add -O fsevents`
|
|
142
142
|
- `vp add --save-peer react`
|
|
143
|
+
- `vp add react --ignore-scripts`
|
|
143
144
|
- `vp remove react`
|
|
144
145
|
- `vp remove --filter web react`
|
|
145
146
|
|
|
@@ -81,7 +81,7 @@ These variables control the installer scripts and the standalone Windows install
|
|
|
81
81
|
|
|
82
82
|
### `VP_NODE_MANAGER`
|
|
83
83
|
|
|
84
|
-
- **Purpose**: Control Node.js version manager setup during installation
|
|
84
|
+
- **Purpose**: Control Node.js version manager setup during installation.
|
|
85
85
|
- **Values**: `yes` or `no`
|
|
86
86
|
- **Default**: Auto-detected
|
|
87
87
|
- **CLI equivalent**: `--no-node-manager` (inverted)
|
|
@@ -91,6 +91,40 @@ These variables control the installer scripts and the standalone Windows install
|
|
|
91
91
|
curl -fsSL https://vite.plus | VP_NODE_MANAGER=no bash
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
### `VP_PM_MANAGER`
|
|
95
|
+
|
|
96
|
+
- **Purpose**: Set the management preference for all four package-manager
|
|
97
|
+
families: npm, pnpm, Yarn, and Bun.
|
|
98
|
+
- **Values**: `yes` uses Vite+ management; `no` prefers system tools, with
|
|
99
|
+
managed tools as a fallback when a system tool is unavailable.
|
|
100
|
+
- **Default**: Unset. The installer's combined Node.js and package-manager
|
|
101
|
+
choice remains the default. With the script installers, setting only
|
|
102
|
+
`VP_NODE_MANAGER` preserves existing package-manager preferences.
|
|
103
|
+
|
|
104
|
+
### `VP_NPM_MANAGER` / `VP_PNPM_MANAGER` / `VP_YARN_MANAGER` / `VP_BUN_MANAGER`
|
|
105
|
+
|
|
106
|
+
- **Purpose**: Set the management preference for an individual package-manager
|
|
107
|
+
family. Each variable overrides `VP_PM_MANAGER` for that family.
|
|
108
|
+
- **Values**: `yes` or `no`, with the same meaning as `VP_PM_MANAGER`.
|
|
109
|
+
- **Default**: Unset (use `VP_PM_MANAGER`, then the combined installer choice,
|
|
110
|
+
or preserve the existing preference).
|
|
111
|
+
- **Example**:
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
# Keep system Node.js and package managers, but let Vite+ manage pnpm.
|
|
115
|
+
curl -fsSL https://vite.plus | VP_NODE_MANAGER=no VP_PM_MANAGER=no VP_PNPM_MANAGER=yes bash
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
These management variables are installation choices, saved in Vite+'s config.
|
|
119
|
+
The interactive prompt still controls both Node.js and package managers;
|
|
120
|
+
explicit package-manager variables override that combined choice. The standalone
|
|
121
|
+
`vp-setup` installer uses its existing combined option as the default for both
|
|
122
|
+
variables, in interactive and silent installations alike.
|
|
123
|
+
In-place upgrades preserve the saved choices. Unrecognized values are ignored.
|
|
124
|
+
They select management behavior, not package-manager versions, and do not
|
|
125
|
+
prevent the installer from creating shims. Older releases installed through
|
|
126
|
+
the legacy installer retain their original behavior.
|
|
127
|
+
|
|
94
128
|
### `VP_PR_VERSION`
|
|
95
129
|
|
|
96
130
|
- **Purpose**: Install a preview build from a pull request or commit SHA
|