vite-plus 1.1.0 → 1.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/LICENSE +58 -1
- package/binding/index.cjs +54 -54
- package/binding/index.d.cts +7 -0
- package/dist/{agent-eISuMXJb.js → agent-97KmGCyL.js} +4 -4
- package/dist/bin.js +12 -12
- package/dist/{command-CguLh2KL.js → command-CdMBoZFD.js} +13 -13
- package/dist/command-DVTILtS-.js +1 -0
- package/dist/comparison-CmVirWIW-DUGaiYqF.js +121 -0
- package/dist/config/bin.js +4 -4
- package/dist/{constants-CCQkpaxK.js → constants-DR55DpRm.js} +3 -3
- package/dist/create/bin.d.ts +2 -1
- package/dist/create/bin.js +112 -29
- package/dist/{define-config-CeW9DETl.d.ts → define-config-Bexdd6RZ.d.ts} +1 -1
- package/dist/{define-config-CREUiMmM.cjs → define-config-BxDc_9BK.cjs} +89 -3
- package/dist/{define-config-Ro6PS4dP.js → define-config-CvE5pHqB.js} +111 -6
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.d.ts +1 -1
- package/dist/define-config.js +1 -2
- package/dist/{dist-DfmT__Aw.js → dist-Cqz8OtiO.js} +24 -21
- package/dist/{dist-BsAzy8OW.js → dist-DIpm7mot.js} +6 -7
- package/dist/dist-Dhu07wmN.js +3 -0
- package/dist/{editor-B8tkz7nL.js → editor-CtJGQP7C.js} +34 -27
- package/dist/fmt.js +1 -2
- package/dist/hooks/bin.js +1 -1
- package/dist/{hooks-C-4gykWR.js → hooks-DhwsWb46.js} +34 -22
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lint-plugins-dev.js +1 -2
- package/dist/lint-plugins.cjs +1 -1
- package/dist/lint-plugins.js +1 -2
- package/dist/migration/bin.js +18 -16
- package/dist/{oxlint-plugin-config-CbG58Kzr.js → oxlint-plugin-config-BIzrO2y2.js} +1 -1
- package/dist/oxlint-plugin.js +2 -2
- package/dist/pack-bin.js +2 -2
- package/dist/{package-BS84eWrW.js → package-CQDXTm6j.js} +1 -1
- package/dist/{package-overrides-CpoQngt3.js → package-overrides-D1RcXSFl.js} +1 -1
- package/dist/{prompts-ByOzbMBG.js → prompts-1xNz_ne0.js} +103 -208
- package/dist/resolve-vite-config-7WDtXO4G.js +1 -0
- package/dist/{resolve-vite-config-Be237LWp.js → resolve-vite-config-BVr1SUNg.js} +2 -2
- package/dist/{rolldown-runtime-CMFfr-1z.js → rolldown-runtime-kJ_i4yPo.js} +1 -1
- package/dist/staged/bin.js +33 -5
- package/dist/sync-versions/bin.js +4760 -3369
- package/dist/sync-versions/bin.mjs +4899 -3505
- package/dist/test/browser/providers/playwright.d.ts +7 -2
- package/dist/test/browser-playwright.d.ts +7 -2
- package/dist/toolchain.js +12 -12
- package/dist/toolchain.json +12 -12
- package/dist/{tsconfig-DzZ-nrx2.js → tsconfig-BZu7kl-x.js} +3 -3
- package/dist/tsconfig-zWgHiQ3X.js +1 -0
- package/dist/version.js +2 -2
- package/dist/versions.js +7 -7
- package/docs/config/run.md +9 -5
- package/docs/config/staged.md +1 -1
- package/docs/guide/automatic-data-tracking.md +7 -6
- package/docs/guide/cache.md +3 -3
- package/docs/guide/check.md +7 -7
- package/docs/guide/commit-hooks.md +3 -1
- package/docs/guide/create.md +48 -4
- package/docs/guide/env.md +25 -11
- package/docs/guide/github-actions-cache.md +1 -1
- package/docs/guide/global-cli.md +36 -10
- package/docs/guide/ide-integration.md +1 -1
- package/docs/guide/index.md +8 -8
- package/docs/guide/local-cli.md +24 -8
- package/docs/guide/migrate-rules.md +3 -3
- package/docs/guide/migrate.md +9 -9
- package/docs/guide/{install.md → package-management.md} +42 -4
- package/docs/guide/run.md +10 -8
- package/docs/guide/test.md +3 -1
- package/docs/guide/troubleshooting.md +7 -5
- package/docs/guide/upgrade-project.md +1 -5
- package/docs/guide/upgrade.md +6 -0
- package/docs/guide/vitest-v5.md +2 -2
- package/docs/guide/vpx.md +3 -3
- package/package.json +32 -31
- package/templates/generator/bin/index.ts +0 -0
- package/templates/generator/package.json +2 -2
- package/templates/generator/src/template.ts +1 -0
- package/dist/command-CLJK5jGW.js +0 -2
- package/dist/dist-DUsqQuw8.js +0 -6774
- package/dist/resolve-vite-config-CofpYgnY.js +0 -2
- package/dist/tsconfig-3ONY2k2K.js +0 -2
|
@@ -1,15 +1,73 @@
|
|
|
1
|
-
import { c as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-
|
|
1
|
+
import { c as VITEST_VERSION, r as CONFIG_METADATA_ENV } from "./constants-DR55DpRm.js";
|
|
2
2
|
import { t as VITEST_RESOLVER_PACKAGES } from "./vitest-ecosystem-BU0AqZq-.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
|
-
import path, { resolve } from "node:path";
|
|
4
|
+
import path, { join, resolve } from "node:path";
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
import { readFileSync } from "node:fs";
|
|
7
|
+
import { searchForWorkspaceRoot } from "vite";
|
|
7
8
|
import { defineConfig, defineProject } from "vitest/config";
|
|
8
|
-
//#region ../../node_modules/.pnpm/tsdown@0.23.
|
|
9
|
+
//#region ../../node_modules/.pnpm/tsdown@0.23.1_@arethetypeswrong+core@0.18.2_@tsdown+css@0.23.1_@tsdown+exe@0.23.1_@type_1c5668b23b89ab367f1fd43e24d0d72d/node_modules/tsdown/esm-shims.js
|
|
9
10
|
const getFilename = () => fileURLToPath(import.meta.url);
|
|
10
11
|
const getDirname = () => path.dirname(getFilename());
|
|
11
12
|
const __dirname = /* @__PURE__ */ getDirname();
|
|
12
13
|
//#endregion
|
|
14
|
+
//#region ../../node_modules/.pnpm/@voidzero-dev+vite-task-client@0.2.0/node_modules/@voidzero-dev/vite-task-client/src/index.js
|
|
15
|
+
/**
|
|
16
|
+
* @typedef {{ tracked?: boolean }} GetEnvOptions
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {string | { prefix: string }} GetEnvsQuery
|
|
20
|
+
*/
|
|
21
|
+
/**
|
|
22
|
+
* Methods exposed by the napi addon. Keep this shape in sync with the
|
|
23
|
+
* `RunnerClient` returned by `load()` in
|
|
24
|
+
* `crates/vite_task_client_napi/src/lib.rs` — any new method added there
|
|
25
|
+
* needs a matching entry here, and vice versa.
|
|
26
|
+
*
|
|
27
|
+
* @type {{
|
|
28
|
+
* ignoreInput: (path: string) => void,
|
|
29
|
+
* ignoreOutput: (path: string) => void,
|
|
30
|
+
* disableCache: () => void,
|
|
31
|
+
* getEnv: (name: string, options?: GetEnvOptions) => string | undefined,
|
|
32
|
+
* getEnvs: (query: GetEnvsQuery, options?: GetEnvOptions) => Record<string, string>,
|
|
33
|
+
* } | null | undefined}
|
|
34
|
+
*/
|
|
35
|
+
let addon;
|
|
36
|
+
function load() {
|
|
37
|
+
if (addon !== void 0) return addon;
|
|
38
|
+
try {
|
|
39
|
+
const path = process.env["VP_RUN_NODE_CLIENT_PATH"];
|
|
40
|
+
if (path) {
|
|
41
|
+
addon = createRequire(import.meta.url)(path).load();
|
|
42
|
+
return addon;
|
|
43
|
+
}
|
|
44
|
+
} catch {}
|
|
45
|
+
addon = null;
|
|
46
|
+
return addon;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Tell the runner to ignore reads under `path` when inferring cache inputs.
|
|
50
|
+
*
|
|
51
|
+
* No-op when not running inside a runner.
|
|
52
|
+
*
|
|
53
|
+
* @param {string} path
|
|
54
|
+
* @returns {void}
|
|
55
|
+
*/
|
|
56
|
+
function ignoreInput(path) {
|
|
57
|
+
load()?.ignoreInput(path);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Tell the runner to ignore writes under `path` when inferring cache outputs.
|
|
61
|
+
*
|
|
62
|
+
* No-op when not running inside a runner.
|
|
63
|
+
*
|
|
64
|
+
* @param {string} path
|
|
65
|
+
* @returns {void}
|
|
66
|
+
*/
|
|
67
|
+
function ignoreOutput(path) {
|
|
68
|
+
load()?.ignoreOutput(path);
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
13
71
|
//#region src/define-config.ts
|
|
14
72
|
/**
|
|
15
73
|
* `require` anchored at THIS module's location so `require.resolve` reaches
|
|
@@ -434,8 +492,53 @@ function vitePlusCoverageVersionGuardPlugin() {
|
|
|
434
492
|
};
|
|
435
493
|
}
|
|
436
494
|
/**
|
|
437
|
-
*
|
|
438
|
-
*
|
|
495
|
+
* Vitest 5.0.4 enables its on-disk caches by default: the results cache
|
|
496
|
+
* (`<cacheDir>/results.json`, written atomically through `.tmp-*` siblings)
|
|
497
|
+
* and the fs module cache (`<workspaceRoot>/node_modules/.vitest-cache`, or
|
|
498
|
+
* `fsModuleCachePath` when overridden). Under `vp run`, file-system tracking
|
|
499
|
+
* would record those cache reads/writes as task inputs the run itself
|
|
500
|
+
* modifies, so every `vp test` task would stay permanently uncacheable
|
|
501
|
+
* ("not cached because it modified its input"). Tell the runner these
|
|
502
|
+
* tool-managed paths are neither inputs nor outputs, mirroring what Vite
|
|
503
|
+
* does for `.vite-temp` and the optimizer cache dir.
|
|
504
|
+
*
|
|
505
|
+
* Runtime project injection appends to `vitest.projects` without calling
|
|
506
|
+
* `configureVitest` again. Observe those attachments as well as the initial
|
|
507
|
+
* list. Both ignore calls are no-ops outside `vp run`.
|
|
508
|
+
*/
|
|
509
|
+
function vitePlusVitestCachePathsPlugin() {
|
|
510
|
+
const observedProjectLists = /* @__PURE__ */ new WeakSet();
|
|
511
|
+
return {
|
|
512
|
+
name: "vite-plus:vitest-cache-paths",
|
|
513
|
+
configureVitest(context) {
|
|
514
|
+
const { vitest } = context;
|
|
515
|
+
const { projects } = vitest;
|
|
516
|
+
if (observedProjectLists.has(projects)) return;
|
|
517
|
+
observedProjectLists.add(projects);
|
|
518
|
+
const ignoredPaths = /* @__PURE__ */ new Set();
|
|
519
|
+
const ignoreCachePath = (path) => {
|
|
520
|
+
if (!path || ignoredPaths.has(path)) return;
|
|
521
|
+
ignoredPaths.add(path);
|
|
522
|
+
ignoreInput(path);
|
|
523
|
+
ignoreOutput(path);
|
|
524
|
+
};
|
|
525
|
+
ignoreCachePath(vitest.viteConfig.cacheDir);
|
|
526
|
+
const rootCache = vitest.config.fsModuleCachePath || join(searchForWorkspaceRoot(vitest.viteConfig.root), "node_modules", ".vitest-cache");
|
|
527
|
+
ignoreCachePath(rootCache);
|
|
528
|
+
for (const project of projects) ignoreCachePath(project.config.fsModuleCachePath || rootCache);
|
|
529
|
+
const push = projects.push;
|
|
530
|
+
projects.push = function(...addedProjects) {
|
|
531
|
+
const length = push.apply(this, addedProjects);
|
|
532
|
+
for (const project of addedProjects) ignoreCachePath(project.config.fsModuleCachePath || rootCache);
|
|
533
|
+
return length;
|
|
534
|
+
};
|
|
535
|
+
}
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
/**
|
|
539
|
+
* Inject the vitest resolver plugin, the auto-inline matcher plugin, the
|
|
540
|
+
* coverage version guard, and the cache-paths plugin into a single inline
|
|
541
|
+
* project config. Used both for
|
|
439
542
|
* root configs and for object-shaped entries inside `test.projects`.
|
|
440
543
|
*
|
|
441
544
|
* The shapes overlap (both have an optional top-level `plugins` array and
|
|
@@ -445,7 +548,8 @@ function vitePlusCoverageVersionGuardPlugin() {
|
|
|
445
548
|
const VITE_PLUS_TEST_PLUGIN_NAMES = /* @__PURE__ */ new Set([
|
|
446
549
|
"vite-plus:vitest-resolver",
|
|
447
550
|
"vite-plus:auto-inline-matcher-deps",
|
|
448
|
-
"vite-plus:coverage-version-guard"
|
|
551
|
+
"vite-plus:coverage-version-guard",
|
|
552
|
+
"vite-plus:vitest-cache-paths"
|
|
449
553
|
]);
|
|
450
554
|
function withoutVitePlusTestPlugins(plugin) {
|
|
451
555
|
if (Array.isArray(plugin)) return plugin.filter(keepUserPlugin).map(withoutVitePlusTestPlugins);
|
|
@@ -462,6 +566,7 @@ function injectPluginIntoInlineConfig(config) {
|
|
|
462
566
|
vitePlusVitestResolverPlugin(),
|
|
463
567
|
vitePlusAutoInlineMatcherPlugin(),
|
|
464
568
|
vitePlusCoverageVersionGuardPlugin(),
|
|
569
|
+
vitePlusVitestCachePathsPlugin(),
|
|
465
570
|
...(config.plugins ?? []).filter(keepUserPlugin).map(withoutVitePlusTestPlugins)
|
|
466
571
|
]
|
|
467
572
|
};
|
package/dist/define-config.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_define_config = require("./define-config-
|
|
2
|
+
const require_define_config = require("./define-config-BxDc_9BK.cjs");
|
|
3
3
|
require_define_config.init_define_config();
|
|
4
4
|
exports.AUTO_INLINE_DEPS = require_define_config.AUTO_INLINE_DEPS;
|
|
5
5
|
exports.assertCoverageProviderVersionMatch = require_define_config.assertCoverageProviderVersionMatch;
|
package/dist/define-config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, i as computeAutoInlineList, l as resolveCoverageProviderToCheck, n as assertCoverageProviderVersionMatch, o as defineProject, r as checkCoverageProviderVersion, s as isVitestFamilySpecifier, t as AUTO_INLINE_DEPS, u as withConfigMetadataResolution } from "./define-config-Bexdd6RZ.js";
|
|
2
2
|
export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
|
package/dist/define-config.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { AUTO_INLINE_DEPS, assertCoverageProviderVersionMatch, checkCoverageProviderVersion, computeAutoInlineList, defineConfig, defineProject, isVitestFamilySpecifier, lazyPlugins, resolveCoverageProviderToCheck, withConfigMetadataResolution };
|
|
1
|
+
export { t as AUTO_INLINE_DEPS, n as assertCoverageProviderVersionMatch, r as checkCoverageProviderVersion, i as computeAutoInlineList, a as defineConfig, o as defineProject, s as isVitestFamilySpecifier, c as lazyPlugins, l as resolveCoverageProviderToCheck, u as withConfigMetadataResolution } from "./define-config-CvE5pHqB.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/cac@7.0.
|
|
1
|
+
//#region ../../node_modules/.pnpm/cac@7.0.1/node_modules/cac/dist/index.js
|
|
2
2
|
function toArr(any) {
|
|
3
3
|
return any == null ? [] : Array.isArray(any) ? any : [any];
|
|
4
4
|
}
|
|
@@ -99,23 +99,23 @@ function findAllBrackets(v) {
|
|
|
99
99
|
}
|
|
100
100
|
function getMriOptions(options) {
|
|
101
101
|
const result = {
|
|
102
|
-
alias:
|
|
102
|
+
alias: Object.create(null),
|
|
103
103
|
boolean: []
|
|
104
104
|
};
|
|
105
105
|
for (const [index, option] of options.entries()) {
|
|
106
106
|
if (option.names.length > 1) result.alias[option.names[0]] = option.names.slice(1);
|
|
107
|
-
if (option.isBoolean)
|
|
108
|
-
if (
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
107
|
+
if (option.isBoolean) {
|
|
108
|
+
if (option.negated) {
|
|
109
|
+
if (!options.some((o, i) => {
|
|
110
|
+
return i !== index && o.names.some((name) => option.names.includes(name)) && typeof o.required === "boolean";
|
|
111
|
+
})) result.boolean.push(option.names[0]);
|
|
112
|
+
} else result.boolean.push(option.names[0]);
|
|
113
|
+
}
|
|
112
114
|
}
|
|
113
115
|
return result;
|
|
114
116
|
}
|
|
115
117
|
function findLongest(arr) {
|
|
116
|
-
return arr.sort((a, b) =>
|
|
117
|
-
return a.length > b.length ? -1 : 1;
|
|
118
|
-
})[0];
|
|
118
|
+
return arr.sort((a, b) => b.length - a.length)[0];
|
|
119
119
|
}
|
|
120
120
|
function padRight(str, length) {
|
|
121
121
|
return str.length >= length ? str : `${str}${" ".repeat(length - str.length)}`;
|
|
@@ -125,7 +125,13 @@ function camelcase(input) {
|
|
|
125
125
|
return p1 + p2.toUpperCase();
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
+
const UNSAFE_KEYS = /* @__PURE__ */ new Set([
|
|
129
|
+
"__proto__",
|
|
130
|
+
"constructor",
|
|
131
|
+
"prototype"
|
|
132
|
+
]);
|
|
128
133
|
function setDotProp(obj, keys, val) {
|
|
134
|
+
if (keys.some((key) => UNSAFE_KEYS.has(key))) return;
|
|
129
135
|
let current = obj;
|
|
130
136
|
for (let i = 0; i < keys.length; i++) {
|
|
131
137
|
const key = keys[i];
|
|
@@ -141,12 +147,9 @@ function setDotProp(obj, keys, val) {
|
|
|
141
147
|
}
|
|
142
148
|
}
|
|
143
149
|
function setByType(obj, transforms) {
|
|
144
|
-
for (const key of Object.
|
|
145
|
-
|
|
146
|
-
if (transform.
|
|
147
|
-
obj[key] = [obj[key]].flat();
|
|
148
|
-
if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
|
|
149
|
-
}
|
|
150
|
+
for (const [key, transform] of Object.entries(transforms)) if (transform.shouldTransform) {
|
|
151
|
+
obj[key] = [obj[key]].flat();
|
|
152
|
+
if (typeof transform.transformFunction === "function") obj[key] = obj[key].map(transform.transformFunction);
|
|
150
153
|
}
|
|
151
154
|
}
|
|
152
155
|
function getFileName(input) {
|
|
@@ -189,7 +192,7 @@ var Option = class {
|
|
|
189
192
|
name = name.replace(/^no-/, "");
|
|
190
193
|
}
|
|
191
194
|
return camelcaseOptionName(name);
|
|
192
|
-
}).sort((a, b) => a.length
|
|
195
|
+
}).sort((a, b) => a.length - b.length);
|
|
193
196
|
this.name = this.names.at(-1);
|
|
194
197
|
if (this.negated && this.config.default == null) this.config.default = true;
|
|
195
198
|
if (rawName.includes("<")) this.required = true;
|
|
@@ -292,7 +295,7 @@ var Command = class {
|
|
|
292
295
|
* @param name Option name
|
|
293
296
|
*/
|
|
294
297
|
hasOption(name) {
|
|
295
|
-
name = name.split(".")[0];
|
|
298
|
+
name = name.split(".", 1)[0];
|
|
296
299
|
return this.options.find((option) => {
|
|
297
300
|
return option.names.includes(name);
|
|
298
301
|
});
|
|
@@ -367,7 +370,7 @@ var Command = class {
|
|
|
367
370
|
const { options: parsedOptions, globalCommand } = this.cli;
|
|
368
371
|
const options = [...globalCommand.options, ...this.options];
|
|
369
372
|
for (const option of options) {
|
|
370
|
-
const value = parsedOptions[option.name.split(".")[0]];
|
|
373
|
+
const value = parsedOptions[option.name.split(".", 1)[0]];
|
|
371
374
|
if (option.required) {
|
|
372
375
|
const hasNegated = options.some((o) => o.negated && o.names.includes(option.name));
|
|
373
376
|
if (value === true || value === false && !hasNegated) throw new CACError(`option \`${option.rawName}\` value is missing`);
|
|
@@ -586,8 +589,8 @@ var CAC = class extends EventTarget {
|
|
|
586
589
|
transforms[cliOption.name].transformFunction = cliOption.config.type[0];
|
|
587
590
|
}
|
|
588
591
|
}
|
|
589
|
-
for (const key of Object.
|
|
590
|
-
setDotProp(options, key.split("."),
|
|
592
|
+
for (const [key, value] of Object.entries(parsed)) if (key !== "_") {
|
|
593
|
+
setDotProp(options, key.split("."), value);
|
|
591
594
|
setByType(options, transforms);
|
|
592
595
|
}
|
|
593
596
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as __require, t as __commonJSMin } from "./rolldown-runtime-
|
|
1
|
+
import { n as __require, t as __commonJSMin } from "./rolldown-runtime-kJ_i4yPo.js";
|
|
2
2
|
//#region ../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/nodes/identity.js
|
|
3
3
|
var require_identity = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4
4
|
const ALIAS = Symbol.for("yaml.alias");
|
|
@@ -1462,13 +1462,13 @@ var require_stringifyPair = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
1462
1462
|
//#endregion
|
|
1463
1463
|
//#region ../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/log.js
|
|
1464
1464
|
var require_log = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
1465
|
-
var node_process
|
|
1465
|
+
var node_process = __require("process");
|
|
1466
1466
|
function debug(logLevel, ...messages) {
|
|
1467
1467
|
if (logLevel === "debug") console.log(...messages);
|
|
1468
1468
|
}
|
|
1469
1469
|
function warn(logLevel, warning) {
|
|
1470
1470
|
if (logLevel === "debug" || logLevel === "warn") {
|
|
1471
|
-
if (typeof node_process
|
|
1471
|
+
if (typeof node_process.emitWarning === "function") node_process.emitWarning(warning);
|
|
1472
1472
|
else console.warn(warning);
|
|
1473
1473
|
}
|
|
1474
1474
|
}
|
|
@@ -4387,7 +4387,7 @@ var require_compose_doc = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4387
4387
|
//#endregion
|
|
4388
4388
|
//#region ../../node_modules/.pnpm/yaml@2.9.1/node_modules/yaml/dist/compose/composer.js
|
|
4389
4389
|
var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
4390
|
-
var node_process
|
|
4390
|
+
var node_process = __require("process");
|
|
4391
4391
|
var directives = require_directives();
|
|
4392
4392
|
var Document = require_Document();
|
|
4393
4393
|
var errors = require_errors();
|
|
@@ -4504,7 +4504,7 @@ var require_composer = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4504
4504
|
}
|
|
4505
4505
|
/** Advance the composer by one CST token. */
|
|
4506
4506
|
*next(token) {
|
|
4507
|
-
if (node_process
|
|
4507
|
+
if (node_process.env.LOG_STREAM) console.dir(token, { depth: null });
|
|
4508
4508
|
switch (token.type) {
|
|
4509
4509
|
case "directive":
|
|
4510
4510
|
this.directives.add(token.source, (offset, message, warning) => {
|
|
@@ -6655,5 +6655,4 @@ var require_dist = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
6655
6655
|
exports.visitAsync = visit.visitAsync;
|
|
6656
6656
|
}));
|
|
6657
6657
|
//#endregion
|
|
6658
|
-
export
|
|
6659
|
-
export {};
|
|
6658
|
+
export { require_dist as t };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { r as __toESM } from "./rolldown-runtime-
|
|
1
|
+
import { r as __toESM } from "./rolldown-runtime-kJ_i4yPo.js";
|
|
2
2
|
import { t as documentationUrl$1 } from "./documentation-DqcZSthV.js";
|
|
3
|
-
import { a as SETUP_VP_VERSION, c as VITEST_VERSION, d as VITE_PLUS_OVERRIDE_PACKAGES, f as VITE_PLUS_VERSION, l as VITE_CONFIG_FILES, m as isForceOverrideMode, n as BASEURL_TSCONFIG_WARNING, o as TSDOWN_MIGRATION_SKILL_URL, s as VITEST_AGE_GATE_EXEMPT_PACKAGES, u as VITE_PLUS_NAME } from "./constants-
|
|
4
|
-
import { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-
|
|
3
|
+
import { a as SETUP_VP_VERSION, c as VITEST_VERSION, d as VITE_PLUS_OVERRIDE_PACKAGES, f as VITE_PLUS_VERSION, l as VITE_CONFIG_FILES, m as isForceOverrideMode, n as BASEURL_TSCONFIG_WARNING, o as TSDOWN_MIGRATION_SKILL_URL, s as VITEST_AGE_GATE_EXEMPT_PACKAGES, u as VITE_PLUS_NAME } from "./constants-DR55DpRm.js";
|
|
4
|
+
import { i as ensureVitePlusImportRuleDefaults, r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BIzrO2y2.js";
|
|
5
5
|
import { a as writeJsonFile, c as modify, i as readJsonFile, l as parse, n as editJsonFile, o as applyEdits, r as isJsonFile, t as detectFormattingOptions } from "./json-JP24qHUF.js";
|
|
6
|
-
import { c as getNpmRegistry, n as detectPackageMetadata, r as getScopeFromPackageName, s as fetchNpmResource } from "./package-
|
|
6
|
+
import { c as getNpmRegistry, n as detectPackageMetadata, r as getScopeFromPackageName, s as fetchNpmResource } from "./package-CQDXTm6j.js";
|
|
7
7
|
import { n as isAlignableVitestEcosystemPackage } from "./vitest-ecosystem-BU0AqZq-.js";
|
|
8
|
-
import { C as confirm, E as multiselect, M as isCancel, O as select, S as normalize$2, T as log, _ as getSpinner, b as coerce, d as readYamlFile, f as scalarString, g as getSilentSpinner, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-
|
|
9
|
-
import {
|
|
10
|
-
import { i as normalizeRange, s as satisfies, t as extractOverrideTargetName } from "./package-overrides-
|
|
11
|
-
import { l as displayRelative, u as rulesDir } from "./agent-
|
|
8
|
+
import { C as confirm, E as multiselect, M as isCancel, O as select, S as normalize$2, T as log, _ as getSpinner, b as coerce, d as readYamlFile, f as scalarString, g as getSilentSpinner, t as cancelAndExit, u as editYamlFile, y as PackageManager } from "./prompts-1xNz_ne0.js";
|
|
9
|
+
import { _ as isGreaterThanOrEqual, h as compareReversed, v as isLessThanOrEqual } from "./comparison-CmVirWIW-DUGaiYqF.js";
|
|
10
|
+
import { i as normalizeRange, s as satisfies, t as extractOverrideTargetName } from "./package-overrides-D1RcXSFl.js";
|
|
11
|
+
import { l as displayRelative, u as rulesDir } from "./agent-97KmGCyL.js";
|
|
12
12
|
import { n as addMigrationWarning, t as addManualStep } from "./report-NhQk8VHb.js";
|
|
13
|
-
import { n as runCommandSilently, r as require_cross_spawn } from "./command-
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
13
|
+
import { n as runCommandSilently, r as require_cross_spawn } from "./command-CdMBoZFD.js";
|
|
14
|
+
import { t as require_dist } from "./dist-DIpm7mot.js";
|
|
15
|
+
import { a as hasBaseUrlInTsconfig, c as hasVitestTypesInTsconfig, l as removeDeprecatedTsconfigFalseOption, n as findTsconfigFiles, s as hasTypesToRewriteInTsconfig, u as rewriteTypesInTsconfig } from "./tsconfig-BZu7kl-x.js";
|
|
16
|
+
import { i as findUnsafeHookInstallPath, t as SUPPORTED_GIT_HOOK_NAMES } from "./hooks-DhwsWb46.js";
|
|
16
17
|
import path, { posix, win32 } from "node:path";
|
|
17
18
|
import { fileURLToPath } from "node:url";
|
|
18
19
|
import { detectWorkspace, getVpDirs, hasConfigKey, mergeJsonConfig, mergeTsdownConfig, migrateTaskCacheConfig, rewriteEslint, rewriteImportsInDirectory, rewritePrettier, rewriteScripts, wrapLazyPlugins } from "../binding/index.js";
|
|
19
20
|
import { styleText } from "node:util";
|
|
20
|
-
import * as actualFS from "node:fs";
|
|
21
|
-
import fs from "node:fs";
|
|
21
|
+
import fs, * as actualFS from "node:fs";
|
|
22
22
|
import os from "node:os";
|
|
23
23
|
import "oxlint";
|
|
24
24
|
import { lstatSync as lstatSync$1, readdir, readdirSync as readdirSync$1, readlinkSync, realpathSync as realpathSync$1 } from "fs";
|
|
@@ -908,7 +908,7 @@ function detectPrettierProject(projectPath, packages) {
|
|
|
908
908
|
}
|
|
909
909
|
/**
|
|
910
910
|
* Run `vp fmt --migrate=prettier` step with graceful error handling.
|
|
911
|
-
*
|
|
911
|
+
* Unsupported config formats are skipped; other errors still fail migration.
|
|
912
912
|
*/
|
|
913
913
|
async function runPrettierMigrateStep(vpBin, cwd, spinner, failMessage, manualHint) {
|
|
914
914
|
try {
|
|
@@ -919,17 +919,22 @@ async function runPrettierMigrateStep(vpBin, cwd, spinner, failMessage, manualHi
|
|
|
919
919
|
envs: process.env
|
|
920
920
|
});
|
|
921
921
|
if (result.exitCode !== 0) {
|
|
922
|
-
spinner.stop(failMessage);
|
|
923
922
|
const stderr = result.stderr.toString().trim();
|
|
923
|
+
const unsupportedConfig = stderr.includes("Failed to load Prettier config at:") && (stderr.includes("YAML, JSON5 and TOML formats are not supported.") || stderr.includes("Only JSON format is supported for `.prettierrc`."));
|
|
924
|
+
spinner.stop(unsupportedConfig ? "Prettier migration skipped" : failMessage);
|
|
924
925
|
if (stderr) log.warn(`⚠ ${stderr}`);
|
|
926
|
+
if (unsupportedConfig) {
|
|
927
|
+
log.info("Keeping Prettier. Convert its config to JSON or JS and run `vp migrate --full` to migrate it later.");
|
|
928
|
+
return "skipped";
|
|
929
|
+
}
|
|
925
930
|
log.info(manualHint);
|
|
926
|
-
return
|
|
931
|
+
return "failed";
|
|
927
932
|
}
|
|
928
|
-
return
|
|
933
|
+
return "migrated";
|
|
929
934
|
} catch {
|
|
930
935
|
spinner.stop(failMessage);
|
|
931
936
|
log.info(manualHint);
|
|
932
|
-
return
|
|
937
|
+
return "failed";
|
|
933
938
|
}
|
|
934
939
|
}
|
|
935
940
|
async function migratePrettierToOxfmt(projectPath, interactive, prettierConfigFile, packages, options) {
|
|
@@ -943,11 +948,12 @@ async function migratePrettierToOxfmt(projectPath, interactive, prettierConfigFi
|
|
|
943
948
|
if (pkg.prettier) {
|
|
944
949
|
tempPrettierConfig = path.join(projectPath, ".prettierrc.json");
|
|
945
950
|
fs.writeFileSync(tempPrettierConfig, JSON.stringify(pkg.prettier, null, 2));
|
|
946
|
-
} else return
|
|
951
|
+
} else return "skipped";
|
|
947
952
|
}
|
|
948
953
|
try {
|
|
949
954
|
spinner.start("Migrating Prettier config to Oxfmt...");
|
|
950
|
-
|
|
955
|
+
const result = await runPrettierMigrateStep(vpBin, projectPath, spinner, "Prettier migration failed", "You can run `vp fmt --migrate=prettier` manually later");
|
|
956
|
+
if (result !== "migrated") return result;
|
|
951
957
|
spinner.stop("Prettier config migrated to .oxfmtrc.json");
|
|
952
958
|
} finally {
|
|
953
959
|
if (tempPrettierConfig) try {
|
|
@@ -962,7 +968,7 @@ async function migratePrettierToOxfmt(projectPath, interactive, prettierConfigFi
|
|
|
962
968
|
rewritePrettierLintStagedConfigFiles(projectPath, options?.report);
|
|
963
969
|
const prettierIgnorePath = path.join(projectPath, ".prettierignore");
|
|
964
970
|
if (fs.existsSync(prettierIgnorePath)) warnMigration(`${displayRelative(prettierIgnorePath)} found — Oxfmt supports .prettierignore, but using the \`ignorePatterns\` option is recommended.`, options?.report);
|
|
965
|
-
return
|
|
971
|
+
return "migrated";
|
|
966
972
|
}
|
|
967
973
|
function deletePrettierConfigFiles(basePath, report, silent = false) {
|
|
968
974
|
const configs = detectConfigs(basePath);
|
|
@@ -1049,8 +1055,9 @@ async function promptPrettierMigration(projectPath, interactive, packages) {
|
|
|
1049
1055
|
return false;
|
|
1050
1056
|
}
|
|
1051
1057
|
if (!await confirmPrettierMigration(interactive)) return false;
|
|
1052
|
-
|
|
1053
|
-
|
|
1058
|
+
const result = await migratePrettierToOxfmt(projectPath, interactive, prettierProject.configFile, packages);
|
|
1059
|
+
if (result === "failed") cancelAndExit("Prettier migration failed.", 1);
|
|
1060
|
+
return result === "migrated";
|
|
1054
1061
|
}
|
|
1055
1062
|
//#endregion
|
|
1056
1063
|
//#region src/migration/migrator/tsup.ts
|
|
@@ -1791,7 +1798,7 @@ function vitestEcosystemCatalogReferencesPending(pkg, catalogDependencyResolver)
|
|
|
1791
1798
|
pkg.optionalDependencies
|
|
1792
1799
|
]) {
|
|
1793
1800
|
if (!dependencies) continue;
|
|
1794
|
-
for (const [name, spec] of Object.entries(dependencies)) if (isAlignableVitestEcosystemPackage(name) && spec.startsWith("catalog:") && catalogDependencyResolver(spec, name) !== "5.0.
|
|
1801
|
+
for (const [name, spec] of Object.entries(dependencies)) if (isAlignableVitestEcosystemPackage(name) && spec.startsWith("catalog:") && catalogDependencyResolver(spec, name) !== "5.0.5") return true;
|
|
1795
1802
|
}
|
|
1796
1803
|
return false;
|
|
1797
1804
|
}
|
|
@@ -4354,8 +4361,8 @@ var Minipass = class extends EventEmitter {
|
|
|
4354
4361
|
return this[BUFFER].shift();
|
|
4355
4362
|
}
|
|
4356
4363
|
[FLUSH](noDrain = false) {
|
|
4357
|
-
do
|
|
4358
|
-
while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length);
|
|
4364
|
+
do;
|
|
4365
|
+
while (this[FLUSHCHUNK](this[BUFFERSHIFT]()) && this[BUFFER].length);
|
|
4359
4366
|
if (!noDrain && !this[BUFFER].length && !this[EOF]) this.emit("drain");
|
|
4360
4367
|
}
|
|
4361
4368
|
[FLUSHCHUNK](chunk) {
|
|
@@ -8394,7 +8401,7 @@ function isSemanticVitePlusOverrideSpec(dependencyName, spec) {
|
|
|
8394
8401
|
if (!spec) return false;
|
|
8395
8402
|
if (isLegacyWrapperSpec(spec)) return false;
|
|
8396
8403
|
if (spec === VITE_PLUS_OVERRIDE_PACKAGES[dependencyName]) return true;
|
|
8397
|
-
if (dependencyName === "@vitest/browser" && spec === "5.0.
|
|
8404
|
+
if (dependencyName === "@vitest/browser" && spec === "5.0.5") return true;
|
|
8398
8405
|
return false;
|
|
8399
8406
|
}
|
|
8400
8407
|
function overrideSpecSatisfiesVitePlus(dependencyName, spec, catalogDependencyResolver) {
|
package/dist/fmt.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { format };
|
|
1
|
+
export { format } from "oxfmt";
|
package/dist/hooks/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as log } from "../terminal-MKGAuy-p.js";
|
|
2
|
-
import { l as status, n as disable, r as enable } from "../hooks-
|
|
2
|
+
import { l as status, n as disable, r as enable } from "../hooks-DhwsWb46.js";
|
|
3
3
|
import { t as unwrapCliParseOutcome } from "../cli-parse-DHE8NrBU.js";
|
|
4
4
|
import { parseHooksArgs } from "../../binding/index.js";
|
|
5
5
|
//#region src/hooks/bin.ts
|
|
@@ -50,15 +50,6 @@ d=${nestedDirname(dir.split(separators).filter((s) => s !== "" && s !== ".").len
|
|
|
50
50
|
__vp_shell=/bin/sh
|
|
51
51
|
[ -x "$__vp_shell" ] || __vp_shell=$(command -v sh)
|
|
52
52
|
|
|
53
|
-
if [ -n "\${VP_HOME-}" ]; then
|
|
54
|
-
__vp_bin="$VP_HOME/bin"
|
|
55
|
-
elif [ -n "\${HOME-}" ]; then
|
|
56
|
-
__vp_bin="$HOME/.vite-plus/bin"
|
|
57
|
-
else
|
|
58
|
-
__vp_bin=""
|
|
59
|
-
fi
|
|
60
|
-
[ -n "$__vp_bin" ] && [ -d "$__vp_bin" ] && export PATH="$PATH:$__vp_bin"
|
|
61
|
-
|
|
62
53
|
export PATH="$d/node_modules/.bin:$PATH"
|
|
63
54
|
"$__vp_shell" -e "$s" "$@"
|
|
64
55
|
c=$?
|
|
@@ -158,7 +149,25 @@ function gitConfigGet(key, options) {
|
|
|
158
149
|
if (result.status !== 0) return null;
|
|
159
150
|
return result.stdout?.toString().trim() || null;
|
|
160
151
|
}
|
|
152
|
+
function gitConfigLocalHas(key, value) {
|
|
153
|
+
const result = spawnSync("git", [
|
|
154
|
+
"config",
|
|
155
|
+
"--local",
|
|
156
|
+
"--get-all",
|
|
157
|
+
key
|
|
158
|
+
]);
|
|
159
|
+
return result.status === 0 && result.stdout?.toString() === `${value}\n`;
|
|
160
|
+
}
|
|
161
|
+
function gitConfigLocalMissing(key) {
|
|
162
|
+
return spawnSync("git", [
|
|
163
|
+
"config",
|
|
164
|
+
"--local",
|
|
165
|
+
"--get-all",
|
|
166
|
+
key
|
|
167
|
+
]).status === 1;
|
|
168
|
+
}
|
|
161
169
|
function gitConfigSet(key, value) {
|
|
170
|
+
if (gitConfigLocalHas(key, value)) return { ok: true };
|
|
162
171
|
const result = spawnSync("git", [
|
|
163
172
|
"config",
|
|
164
173
|
"--local",
|
|
@@ -176,6 +185,7 @@ function gitConfigSet(key, value) {
|
|
|
176
185
|
return { ok: true };
|
|
177
186
|
}
|
|
178
187
|
function gitConfigUnset(key) {
|
|
188
|
+
if (gitConfigLocalMissing(key)) return { ok: true };
|
|
179
189
|
const result = spawnSync("git", [
|
|
180
190
|
"config",
|
|
181
191
|
"--local",
|
|
@@ -414,19 +424,21 @@ function install(dir, options = {}) {
|
|
|
414
424
|
writeFileSync(internal(hook), `#!/usr/bin/env sh\n. "$(dirname "$0")/h"`, { mode: 493 });
|
|
415
425
|
chmodSync(internal(hook), 493);
|
|
416
426
|
}
|
|
417
|
-
|
|
418
|
-
"
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
427
|
+
if (!gitConfigLocalHas("core.hooksPath", location.target)) {
|
|
428
|
+
const { status, stderr } = spawnSync("git", [
|
|
429
|
+
"config",
|
|
430
|
+
"core.hooksPath",
|
|
431
|
+
location.target
|
|
432
|
+
]);
|
|
433
|
+
if (status == null) return {
|
|
434
|
+
message: "git command not found",
|
|
435
|
+
isError: true
|
|
436
|
+
};
|
|
437
|
+
if (status) return {
|
|
438
|
+
message: "" + stderr,
|
|
439
|
+
isError: true
|
|
440
|
+
};
|
|
441
|
+
}
|
|
430
442
|
const clearDisabled = setHooksUserDisabled(false);
|
|
431
443
|
if (!clearDisabled.ok) return {
|
|
432
444
|
message: clearDisabled.error || "failed to clear hooks disabled preference",
|
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-BxDc_9BK.cjs");
|
|
2
2
|
//#region src/index.cts
|
|
3
3
|
const vite = require("vite");
|
|
4
4
|
const { configDefaults, coverageConfigDefaults, defaultBrowserPort, defaultExclude, defaultInclude } = require("vitest/config");
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-
|
|
1
|
+
import { a as defineConfig, c as lazyPlugins, o as defineProject } from "./define-config-Bexdd6RZ.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-CvE5pHqB.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 };
|
package/dist/lint-plugins-dev.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { RuleTester };
|
|
1
|
+
export { RuleTester } from "oxlint/plugins-dev";
|
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-BxDc_9BK.cjs");
|
|
3
3
|
let _oxlint_plugins = require("@oxlint/plugins");
|
|
4
4
|
Object.defineProperty(exports, "definePlugin", {
|
|
5
5
|
enumerable: true,
|
package/dist/lint-plugins.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { definePlugin, defineRule, eslintCompatPlugin };
|
|
1
|
+
export { definePlugin, defineRule, eslintCompatPlugin } from "@oxlint/plugins";
|