vite-plus 1.2.0 → 1.4.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/AGENTS.md +4 -0
- package/LICENSE +1 -849
- package/README.md +1 -1
- package/bin/vpx +9 -0
- package/binding/index.cjs +59 -54
- package/binding/index.d.cts +132 -2
- package/dist/{agent-KeDc6vmg.js → agent-D8oxxhVR.js} +7 -9
- package/dist/bin.js +27 -34
- package/dist/{cli-parse-DHE8NrBU.js → cli-parse-aeUeFDlC.js} +2 -3
- package/dist/command-TjS_6y9O.js +1 -0
- package/dist/{command-CguLh2KL.js → command-rY79K5NI.js} +40 -42
- package/dist/{comparison-CmVirWIW-DUGaiYqF.js → comparison-CmVirWIW-UlEf2maz.js} +1 -2
- package/dist/config/bin.js +8 -10
- package/dist/{constants-BW3g7VnD.js → constants-DRUnJ_Dz.js} +4 -6
- package/dist/create/bin.d.ts +4 -8
- package/dist/create/bin.js +64 -68
- package/dist/{define-config-CIlk9scU.js → define-config-ChwJcu5e.js} +6 -9
- package/dist/{define-config-Dq_23Eyr.cjs → define-config-Cv2P6NT2.cjs} +8 -13
- package/dist/{define-config-Bexdd6RZ.d.ts → define-config-rPhYIFSn.d.ts} +1 -11
- 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-Bi7ZEK3c.js → dist-Bs0SObNC.js} +77 -149
- package/dist/{dist-Cqz8OtiO.js → dist-CdkMvIiQ.js} +11 -5
- package/dist/dist-zDZV5eEc.js +3 -0
- package/dist/{documentation-DqcZSthV.js → documentation-cv_y0Auv.js} +1 -2
- package/dist/{editor-b1XUwt9v.js → editor-ClL78D8u.js} +1492 -4211
- package/dist/{help-BmKpeOP9.js → help-B03t_iQ4.js} +1 -2
- package/dist/hooks/bin.js +4 -5
- package/dist/{hooks-DhwsWb46.js → hooks-xRcJPc-O.js} +5 -4
- package/dist/index.cjs +2 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-JP24qHUF.js → json-kl84kDyH.js} +9 -18
- package/dist/lint-plugins.cjs +1 -1
- package/dist/migration/bin.js +719 -184
- package/dist/migration/compat/worker.js +4 -6
- package/dist/{oxlint-plugin-config-Dx-ZY2MN.js → oxlint-plugin-config-BVpqYdcC.js} +3 -4
- package/dist/oxlint-plugin.d.ts +0 -2
- package/dist/oxlint-plugin.js +6 -7
- package/dist/{pack-BK38MLVZ.d.ts → pack-ARPFMefW.d.ts} +0 -2
- package/dist/pack-bin.d.ts +1 -3
- package/dist/pack-bin.js +3 -4
- package/dist/pack.d.ts +1 -1
- package/dist/{package-BP16iQby.js → package-DzsomcUD.js} +10 -95
- package/dist/{package-overrides-D1RcXSFl.js → package-overrides-Ci8GXouY.js} +5 -8
- package/dist/picomatch-DEUoj81q.js +1916 -0
- package/dist/{prompts-BGpQtC5z.js → prompts-GL1vj0wk.js} +113 -239
- package/dist/{protocol-D99W10Qi.js → protocol-CkNmY-Mr.js} +1 -2
- package/dist/{report-NhQk8VHb.js → report-DLHO30yZ.js} +2 -2
- package/dist/{resolve-vite-config-x47JetlI.js → resolve-vite-config-Dn5896A4.js} +9 -25
- package/dist/resolve-vite-config-QO6cC0SP.js +1 -0
- package/dist/{rolldown-runtime-CMFfr-1z.js → rolldown-runtime-DegdyBIC.js} +2 -3
- package/dist/script-esm-hooks.d.ts +8 -0
- package/dist/script-esm-hooks.js +24 -0
- package/dist/script-hooks-9Fof5UMY.js +176 -0
- package/dist/script-preload.cjs +468 -0
- package/dist/script-register.d.ts +1 -0
- package/dist/script-register.js +22 -0
- package/dist/script-watch.d.ts +1 -0
- package/dist/script-watch.js +1908 -0
- package/dist/staged/bin.js +81 -2011
- package/dist/sync-versions/bin.js +29 -50
- package/dist/sync-versions/bin.mjs +117 -224
- package/dist/{terminal-MKGAuy-p.js → terminal-BcuPUy-j.js} +1 -2
- package/dist/toolchain.js +36 -10
- package/dist/toolchain.json +36 -10
- package/dist/{tsconfig-C5PnJfW4.js → tsconfig-Do6MAG_f.js} +1 -1
- package/dist/{tsconfig-D2DzAQ_D.js → tsconfig-LE_mAwe_.js} +8 -10
- package/dist/version.d.ts +1 -3
- package/dist/version.js +5 -6
- package/dist/versions.js +5 -5
- package/dist/{vitest-ecosystem-BU0AqZq-.js → vitest-ecosystem-BeEYz-qF.js} +1 -2
- package/dist/{vitest-v5-entry-points-DthU1e_O.js → vitest-v5-entry-points-NyJsFeux.js} +1 -2
- package/dist/vpx-bin.d.ts +1 -0
- package/dist/vpx-bin.js +232 -0
- package/dist/vpx-script-EXgV5QOf.js +434 -0
- package/docs/config/run.md +4 -0
- package/docs/guide/check.md +1 -0
- package/docs/guide/ci.md +13 -3
- package/docs/guide/create.md +34 -0
- package/docs/guide/env.md +27 -13
- package/docs/guide/global-cli.md +52 -0
- package/docs/guide/local-cli.md +4 -4
- package/docs/guide/migrate-rules.md +48 -5
- package/docs/guide/migrate.md +6 -6
- package/docs/guide/package-management.md +19 -2
- package/docs/guide/test.md +1 -1
- package/docs/guide/vitest-v5.md +2 -2
- package/docs/guide/vpx.md +170 -9
- package/package.json +32 -29
- package/dist/command-DaRqSNpP.js +0 -1
- package/dist/dist-CBWGibx8.js +0 -3
- package/dist/resolve-vite-config-CGzlyhGr.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stripVTControlCharacters, styleText } from "node:util";
|
|
2
|
-
|
|
2
|
+
// src/utils/help.ts
|
|
3
3
|
const HELP_RIGHT_MARGIN = 4;
|
|
4
4
|
function toLines(value) {
|
|
5
5
|
if (!value) return [];
|
|
@@ -87,5 +87,4 @@ function renderCliDoc(doc, options = {}) {
|
|
|
87
87
|
output.push("");
|
|
88
88
|
return output.join("\n");
|
|
89
89
|
}
|
|
90
|
-
//#endregion
|
|
91
90
|
export { renderCliDoc as t };
|
package/dist/hooks/bin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { i as log } from "../terminal-
|
|
2
|
-
import {
|
|
3
|
-
import { t as unwrapCliParseOutcome } from "../cli-parse-
|
|
1
|
+
import { i as log } from "../terminal-BcuPUy-j.js";
|
|
2
|
+
import { d as status, i as enable, r as disable } from "../hooks-xRcJPc-O.js";
|
|
3
|
+
import { t as unwrapCliParseOutcome } from "../cli-parse-aeUeFDlC.js";
|
|
4
4
|
import { parseHooksArgs } from "../../binding/index.js";
|
|
5
|
-
|
|
5
|
+
// src/hooks/bin.ts
|
|
6
6
|
function applyResult(result) {
|
|
7
7
|
if (result.message) log(result.message);
|
|
8
8
|
if (result.isError) process.exit(1);
|
|
@@ -22,5 +22,4 @@ async function main() {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
main();
|
|
25
|
-
//#endregion
|
|
26
25
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isAbsolute, join, normalize, relative, resolve, sep } from "node:path";
|
|
2
2
|
import { chmodSync, existsSync, lstatSync, mkdirSync, readdirSync, realpathSync, rmSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { spawnSync } from "node:child_process";
|
|
4
|
-
|
|
4
|
+
// src/config/hooks.ts
|
|
5
5
|
const SUPPORTED_GIT_HOOK_NAMES = [
|
|
6
6
|
"pre-commit",
|
|
7
7
|
"pre-merge-commit",
|
|
@@ -58,6 +58,8 @@ c=$?
|
|
|
58
58
|
[ $c = 127 ] && echo "VITE+ - command not found in PATH=$PATH"
|
|
59
59
|
exit $c`;
|
|
60
60
|
}
|
|
61
|
+
/** The per-hook stub written to `<dir>/_/<hook>`; it sources the `h` dispatcher. */
|
|
62
|
+
const HOOK_STUB_SCRIPT = "#!/usr/bin/env sh\n. \"$(dirname \"$0\")/h\"";
|
|
61
63
|
function normalizeHooksPath(hooksPath) {
|
|
62
64
|
let normalized = normalize(hooksPath);
|
|
63
65
|
while (normalized.endsWith(sep)) normalized = normalized.slice(0, -1);
|
|
@@ -421,7 +423,7 @@ function install(dir, options = {}) {
|
|
|
421
423
|
writeFileSync(internal("h"), hookScript(location.dir), { mode: 493 });
|
|
422
424
|
chmodSync(internal("h"), 493);
|
|
423
425
|
for (const hook of SUPPORTED_GIT_HOOK_NAMES) {
|
|
424
|
-
writeFileSync(internal(hook),
|
|
426
|
+
writeFileSync(internal(hook), HOOK_STUB_SCRIPT, { mode: 493 });
|
|
425
427
|
chmodSync(internal(hook), 493);
|
|
426
428
|
}
|
|
427
429
|
if (!gitConfigLocalHas("core.hooksPath", location.target)) {
|
|
@@ -581,5 +583,4 @@ function status(dir) {
|
|
|
581
583
|
status: hooksStatus
|
|
582
584
|
};
|
|
583
585
|
}
|
|
584
|
-
|
|
585
|
-
export { install as a, resolveHooksLocation as c, findUnsafeHookInstallPath as i, status as l, disable as n, isGitHooksEnvDisabled as o, enable as r, isHooksUserDisabled as s, SUPPORTED_GIT_HOOK_NAMES as t };
|
|
586
|
+
export { findUnsafeHookInstallPath as a, isGitHooksEnvDisabled as c, status as d, enable as i, isHooksUserDisabled as l, SUPPORTED_GIT_HOOK_NAMES as n, hookScript as o, disable as r, install as s, HOOK_STUB_SCRIPT as t, resolveHooksLocation as u };
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_define_config = require("./define-config-
|
|
2
|
-
|
|
1
|
+
const require_define_config = require("./define-config-Cv2P6NT2.cjs");
|
|
2
|
+
// src/index.cts
|
|
3
3
|
const vite = require("vite");
|
|
4
4
|
const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
|
|
5
5
|
const { defineConfig, defineProject, lazyPlugins } = (require_define_config.init_define_config(), require_define_config.__toCommonJS(require_define_config.define_config_exports));
|
|
@@ -14,4 +14,3 @@ module.exports = {
|
|
|
14
14
|
defineConfig,
|
|
15
15
|
lazyPlugins
|
|
16
16
|
};
|
|
17
|
-
//#endregion
|
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-rPhYIFSn.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 "vite";
|
|
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-ChwJcu5e.js";
|
|
2
2
|
import { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } from "vitest/config";
|
|
3
3
|
export * from "vite";
|
|
4
4
|
export { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude, defineConfig, defineProject, lazyPlugins };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import fs from "node:fs";
|
|
2
|
-
|
|
2
|
+
// ../../node_modules/.pnpm/detect-indent@7.0.2/node_modules/detect-indent/index.js
|
|
3
3
|
const INDENT_REGEX = /^(?:( )+|\t+)/;
|
|
4
4
|
const INDENT_TYPE_SPACE = "space";
|
|
5
5
|
const INDENT_TYPE_TAB = "tab";
|
|
@@ -96,8 +96,7 @@ function detectIndent(string) {
|
|
|
96
96
|
indent
|
|
97
97
|
};
|
|
98
98
|
}
|
|
99
|
-
|
|
100
|
-
//#region ../../node_modules/.pnpm/detect-newline@4.0.1/node_modules/detect-newline/index.js
|
|
99
|
+
// ../../node_modules/.pnpm/detect-newline@4.0.1/node_modules/detect-newline/index.js
|
|
101
100
|
function detectNewline(string) {
|
|
102
101
|
if (typeof string !== "string") throw new TypeError("Expected a string");
|
|
103
102
|
const newlines = string.match(/(?:\r?\n)/g) || [];
|
|
@@ -105,8 +104,7 @@ function detectNewline(string) {
|
|
|
105
104
|
const crlf = newlines.filter((newline) => newline === "\r\n").length;
|
|
106
105
|
return crlf > newlines.length - crlf ? "\r\n" : "\n";
|
|
107
106
|
}
|
|
108
|
-
|
|
109
|
-
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
107
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/scanner.js
|
|
110
108
|
/**
|
|
111
109
|
* Creates a JSON scanner on the given text.
|
|
112
110
|
* If ignoreTrivia is set, whitespaces or comments are ignored.
|
|
@@ -485,8 +483,7 @@ var CharacterCodes;
|
|
|
485
483
|
CharacterCodes[CharacterCodes["formFeed"] = 12] = "formFeed";
|
|
486
484
|
CharacterCodes[CharacterCodes["tab"] = 9] = "tab";
|
|
487
485
|
})(CharacterCodes || (CharacterCodes = {}));
|
|
488
|
-
|
|
489
|
-
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
486
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/string-intern.js
|
|
490
487
|
const cachedSpaces = new Array(20).fill(0).map((_, index) => {
|
|
491
488
|
return " ".repeat(index);
|
|
492
489
|
});
|
|
@@ -520,8 +517,7 @@ const supportedEols = [
|
|
|
520
517
|
"\r",
|
|
521
518
|
"\r\n"
|
|
522
519
|
];
|
|
523
|
-
|
|
524
|
-
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/format.js
|
|
520
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/format.js
|
|
525
521
|
function format(documentText, range, options) {
|
|
526
522
|
let initialIndentLevel;
|
|
527
523
|
let formatText;
|
|
@@ -689,8 +685,7 @@ function getEOL(options, text) {
|
|
|
689
685
|
function isEOL(text, offset) {
|
|
690
686
|
return "\r\n".indexOf(text.charAt(offset)) !== -1;
|
|
691
687
|
}
|
|
692
|
-
|
|
693
|
-
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
688
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/parser.js
|
|
694
689
|
var ParseOptions;
|
|
695
690
|
(function(ParseOptions) {
|
|
696
691
|
ParseOptions.DEFAULT = { allowTrailingComma: false };
|
|
@@ -1065,8 +1060,7 @@ function getNodeType(value) {
|
|
|
1065
1060
|
default: return "null";
|
|
1066
1061
|
}
|
|
1067
1062
|
}
|
|
1068
|
-
|
|
1069
|
-
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
1063
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/impl/edit.js
|
|
1070
1064
|
function setProperty(text, originalPath, value, options) {
|
|
1071
1065
|
const path = originalPath.slice();
|
|
1072
1066
|
const root = parseTree$1(text, []);
|
|
@@ -1239,8 +1233,7 @@ function withFormatting(text, edit, options) {
|
|
|
1239
1233
|
function applyEdit(text, edit) {
|
|
1240
1234
|
return text.substring(0, edit.offset) + edit.content + text.substring(edit.offset + edit.length);
|
|
1241
1235
|
}
|
|
1242
|
-
|
|
1243
|
-
//#region ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
|
|
1236
|
+
// ../../node_modules/.pnpm/jsonc-parser@3.3.1/node_modules/jsonc-parser/lib/esm/main.js
|
|
1244
1237
|
var ScanError;
|
|
1245
1238
|
(function(ScanError) {
|
|
1246
1239
|
ScanError[ScanError["None"] = 0] = "None";
|
|
@@ -1340,8 +1333,7 @@ function applyEdits(text, edits) {
|
|
|
1340
1333
|
}
|
|
1341
1334
|
return text;
|
|
1342
1335
|
}
|
|
1343
|
-
|
|
1344
|
-
//#region src/utils/json.ts
|
|
1336
|
+
// src/utils/json.ts
|
|
1345
1337
|
/**
|
|
1346
1338
|
* Derive `jsonc-parser` formatting options from existing file text so inserted
|
|
1347
1339
|
* fragments match the file's indentation and newline style.
|
|
@@ -1380,5 +1372,4 @@ function isJsonFile(file) {
|
|
|
1380
1372
|
return false;
|
|
1381
1373
|
}
|
|
1382
1374
|
}
|
|
1383
|
-
//#endregion
|
|
1384
1375
|
export { writeJsonFile as a, modify as c, readJsonFile as i, parse as l, editJsonFile as n, applyEdits as o, isJsonFile as r, findNodeAtLocation as s, detectFormattingOptions as t, parseTree as u };
|
package/dist/lint-plugins.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
require("./define-config-
|
|
2
|
+
require("./define-config-Cv2P6NT2.cjs");
|
|
3
3
|
let _oxlint_plugins = require("@oxlint/plugins");
|
|
4
4
|
Object.defineProperty(exports, "definePlugin", {
|
|
5
5
|
enumerable: true,
|