vite-plus 0.1.24 → 0.2.1
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 +30 -0
- package/README.md +8 -6
- package/bin/oxfmt +5 -2
- package/bin/oxlint +12 -2
- package/binding/index.cjs +84 -67
- package/binding/index.d.cts +155 -4
- package/dist/{agent-Nuk-9l77.js → agent--cKmgD_n.js} +941 -70
- package/dist/bin.js +22 -30
- package/dist/{compat-DXZgnEyq.js → compat-Cql3K40m.js} +1 -1
- package/dist/config/bin.js +30 -14
- package/dist/constants-CrfJQIUX.js +66 -0
- package/dist/create/bin.d.ts +6 -0
- package/dist/create/bin.js +508 -232
- package/dist/define-config-2tfJoXr1.d.ts +305 -0
- package/dist/define-config-BGSjF6Xp.cjs +488 -0
- package/dist/define-config-DJUehepE.js +445 -0
- package/dist/define-config.cjs +8 -1
- package/dist/define-config.d.ts +2 -2
- package/dist/define-config.js +2 -2
- package/dist/dist-DRJUd9bL.js +3 -0
- package/dist/{dist-BgQuvbtq.js → dist-Oxo16Y0q.js} +4 -4
- package/dist/index.cjs +9 -4
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{main-DpJl3LoU.js → json-Dn87fvjk.js} +137 -1
- package/dist/migration/bin.js +292 -76
- package/dist/{oxlint-plugin-config-B89iKTKN.js → oxlint-plugin-config-q8a5PFch.js} +1 -1
- package/dist/oxlint-plugin.js +11 -3
- package/dist/pack-bin.js +44 -15
- package/dist/{package-PmBUZ-ve.js → package-BHirM1_v.js} +3 -138
- package/dist/{report-DgSBQUdz.js → report-BHSkWqRR.js} +2 -0
- package/dist/{resolve-vite-config-TTvhycU1.js → resolve-vite-config-CmdsfQzS.js} +13 -4
- package/dist/staged/bin.js +5 -5
- package/dist/test/_at-vitest-browser/context.d.ts +2 -0
- package/dist/test/_at-vitest-browser.d.ts +2 -0
- package/dist/test/browser/context.d.ts +2 -2
- package/dist/test/browser/context.js +1 -1
- package/dist/test/browser/providers/playwright/context.d.ts +1 -0
- package/dist/test/browser/providers/playwright/context.js +1 -0
- package/dist/test/browser/providers/playwright.d.ts +124 -2
- package/dist/test/browser/providers/playwright.js +1 -1
- package/dist/test/browser/providers/preview/context.d.ts +1 -0
- package/dist/test/browser/providers/preview/context.js +1 -0
- package/dist/test/browser/providers/preview.d.ts +32 -2
- package/dist/test/browser/providers/preview.js +1 -1
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -0
- package/dist/test/browser/providers/webdriverio/context.js +1 -0
- package/dist/test/browser/providers/webdriverio.d.ts +77 -2
- package/dist/test/browser/providers/webdriverio.js +1 -1
- package/dist/test/browser-compat.d.ts +2 -0
- package/dist/test/browser-compat.js +1 -1
- package/dist/test/browser-playwright/context.d.ts +1 -0
- package/dist/test/browser-playwright/context.js +1 -0
- package/dist/test/browser-playwright.d.ts +124 -2
- package/dist/test/browser-playwright.js +1 -1
- package/dist/test/browser-preview/context.d.ts +1 -0
- package/dist/test/browser-preview/context.js +1 -0
- package/dist/test/browser-preview.d.ts +32 -2
- package/dist/test/browser-preview.js +1 -1
- package/dist/test/browser-webdriverio/context.d.ts +1 -0
- package/dist/test/browser-webdriverio/context.js +1 -0
- package/dist/test/browser-webdriverio.d.ts +77 -2
- package/dist/test/browser-webdriverio.js +1 -1
- package/dist/test/browser.d.ts +2 -2
- package/dist/test/browser.js +1 -1
- package/dist/test/client.js +1 -1
- package/dist/test/config.cjs +1 -1
- package/dist/test/config.d.ts +2 -2
- package/dist/test/config.js +1 -1
- package/dist/test/context.d.ts +942 -2
- package/dist/test/context.js +1 -1
- package/dist/test/coverage.d.ts +2 -2
- package/dist/test/coverage.js +1 -1
- package/dist/test/environments.d.ts +2 -2
- package/dist/test/environments.js +1 -1
- package/dist/test/globals.d.ts +2 -2
- package/dist/test/import-meta.d.ts +2 -2
- package/dist/test/importMeta.d.ts +2 -2
- package/dist/test/index.cjs +1 -1
- package/dist/test/index.d.cts +2 -2
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +1 -1
- package/dist/test/internal/browser.d.ts +2 -2
- package/dist/test/internal/browser.js +1 -1
- package/dist/test/jsdom.d.ts +2 -2
- package/dist/test/locators.d.ts +294 -0
- package/dist/test/locators.js +1 -1
- package/dist/test/matchers.d.ts +29 -0
- package/dist/test/matchers.js +1 -1
- package/dist/test/node.d.ts +2 -2
- package/dist/test/node.js +1 -1
- package/dist/test/optional-runtime-types.js.d.ts +2 -2
- package/dist/test/optional-types.js.d.ts +2 -2
- package/dist/test/plugins/browser-client.js +1 -1
- package/dist/test/plugins/browser-context.js +1 -1
- package/dist/test/plugins/browser-locators.js +1 -1
- package/dist/test/plugins/browser-playwright.js +1 -1
- package/dist/test/plugins/browser-preview.js +1 -1
- package/dist/test/plugins/browser-webdriverio.js +1 -1
- package/dist/test/plugins/browser.js +1 -1
- package/dist/test/plugins/expect.js +1 -1
- package/dist/test/plugins/mocker-automock.js +1 -1
- package/dist/test/plugins/mocker-browser.js +1 -1
- package/dist/test/plugins/mocker-node.js +1 -1
- package/dist/test/plugins/mocker-redirect.js +1 -1
- package/dist/test/plugins/mocker-register.js +1 -1
- package/dist/test/plugins/mocker-transforms.js +1 -1
- package/dist/test/plugins/mocker.js +1 -1
- package/dist/test/plugins/pretty-format.js +1 -1
- package/dist/test/plugins/runner-types.js +1 -1
- package/dist/test/plugins/runner-utils.js +1 -1
- package/dist/test/plugins/runner.js +1 -1
- package/dist/test/plugins/snapshot-environment.js +1 -1
- package/dist/test/plugins/snapshot-manager.js +1 -1
- package/dist/test/plugins/snapshot.js +1 -1
- package/dist/test/plugins/spy.js +1 -1
- package/dist/test/plugins/utils-constants.js +1 -1
- package/dist/test/plugins/utils-diff.js +1 -1
- package/dist/test/plugins/utils-display.js +1 -1
- package/dist/test/plugins/utils-error.js +1 -1
- package/dist/test/plugins/utils-helpers.js +1 -1
- package/dist/test/plugins/utils-offset.js +1 -1
- package/dist/test/plugins/utils-resolver.js +1 -1
- package/dist/test/plugins/utils-serialize.js +1 -1
- package/dist/test/plugins/utils-source-map-node.js +1 -1
- package/dist/test/plugins/utils-source-map.js +1 -1
- package/dist/test/plugins/utils-timers.js +1 -1
- package/dist/test/plugins/utils.js +1 -1
- package/dist/test/reporters.d.ts +2 -2
- package/dist/test/reporters.js +1 -1
- package/dist/test/runners.d.ts +2 -2
- package/dist/test/runners.js +1 -1
- package/dist/test/runtime.d.ts +2 -2
- package/dist/test/runtime.js +1 -1
- package/dist/test/snapshot.d.ts +2 -2
- package/dist/test/snapshot.js +1 -1
- package/dist/test/suite.d.ts +2 -2
- package/dist/test/suite.js +1 -1
- package/dist/test/utils.js +1 -1
- package/dist/test/worker.d.ts +2 -2
- package/dist/test/worker.js +1 -1
- package/dist/{tsconfig-DFb5BKyT.js → tsconfig-BWQPmGKz.js} +565 -231
- package/dist/tsgolint-path-B-yOos8p.js +32 -0
- package/dist/tsgolint-path.d.ts +8 -0
- package/dist/tsgolint-path.js +2 -0
- package/dist/version.js +3 -3
- package/dist/versions.d.ts +1 -1
- package/dist/versions.js +6 -6
- package/dist/{workspace-NL-m9wgM.js → workspace-D0AVy4fu.js} +11 -9
- package/docs/_data/team.ts +2 -1
- package/docs/config/create.md +36 -1
- package/docs/config/index.md +7 -5
- package/docs/guide/commit-hooks.md +9 -0
- package/docs/guide/create.md +106 -2
- package/docs/guide/env.md +33 -5
- package/docs/guide/index.md +5 -3
- package/docs/guide/install.md +31 -12
- package/docs/guide/migrate.md +13 -3
- package/docs/guide/troubleshooting.md +2 -2
- package/docs/guide/upgrade.md +26 -7
- package/docs/package.json +3 -3
- package/docs/pnpm-lock.yaml +298 -395
- package/package.json +103 -55
- package/templates/generator/bin/index.ts +6 -3
- package/templates/generator/package.json +2 -3
- package/templates/generator/src/template.ts +0 -2
- package/templates/monorepo/package.json +1 -1
- package/dist/constants-DCBWlNrn.js +0 -33
- package/dist/define-config-BR1Y88zz.cjs +0 -84
- package/dist/define-config-BRC7qPNE.js +0 -21
- package/dist/define-config-COdn-tsn.d.ts +0 -177
- package/dist/dist-Bapm49IR.js +0 -3
- package/dist/test/plugins/utils-highlight.js +0 -1
- /package/dist/{chunk-DnnnRqeS.js → rolldown-runtime-DnnnRqeS.js} +0 -0
|
@@ -0,0 +1,305 @@
|
|
|
1
|
+
import { t as PackUserConfig } from "./pack-Ciiho0Tq.js";
|
|
2
|
+
import { ConfigEnv, UserProjectConfigExport, UserProjectConfigFn, UserWorkspaceConfig } from "vitest/config";
|
|
3
|
+
import { PluginOption, UserConfig } from "@voidzero-dev/vite-plus-core";
|
|
4
|
+
import { OxfmtConfig } from "oxfmt";
|
|
5
|
+
import { OxlintConfig } from "oxlint";
|
|
6
|
+
import { InlineConfig } from "vitest/node";
|
|
7
|
+
|
|
8
|
+
//#region src/create/org-manifest.d.ts
|
|
9
|
+
/**
|
|
10
|
+
* A single template entry shared by org manifests (`createConfig.templates`)
|
|
11
|
+
* and local monorepo config (`create.templates` in `vite.config.ts`).
|
|
12
|
+
*/
|
|
13
|
+
interface CreateTemplateEntry {
|
|
14
|
+
name: string;
|
|
15
|
+
description: string;
|
|
16
|
+
template: string;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/run-config.d.ts
|
|
20
|
+
type AutoInput = {
|
|
21
|
+
/**
|
|
22
|
+
* Automatically track which files the task reads
|
|
23
|
+
*/
|
|
24
|
+
auto: boolean;
|
|
25
|
+
};
|
|
26
|
+
type Command = string | Array<string>;
|
|
27
|
+
type GlobWithBase = {
|
|
28
|
+
/**
|
|
29
|
+
* The glob pattern (positive or negative starting with `!`)
|
|
30
|
+
*/
|
|
31
|
+
pattern: string;
|
|
32
|
+
/**
|
|
33
|
+
* The base directory for resolving the pattern
|
|
34
|
+
*/
|
|
35
|
+
base: InputBase;
|
|
36
|
+
};
|
|
37
|
+
type InputBase = "package" | "workspace";
|
|
38
|
+
type Task = {
|
|
39
|
+
/**
|
|
40
|
+
* Command to run, or an array of commands to run in order.
|
|
41
|
+
*/
|
|
42
|
+
command: Command;
|
|
43
|
+
/**
|
|
44
|
+
* The working directory for the task, relative to the package root (not workspace root).
|
|
45
|
+
*/
|
|
46
|
+
cwd?: string;
|
|
47
|
+
/**
|
|
48
|
+
* Dependencies of this task. Use `package-name#task-name` to refer to tasks in other packages.
|
|
49
|
+
*/
|
|
50
|
+
dependsOn?: Array<string>;
|
|
51
|
+
} & ({
|
|
52
|
+
/**
|
|
53
|
+
* Whether to cache the task
|
|
54
|
+
*/
|
|
55
|
+
cache?: true;
|
|
56
|
+
/**
|
|
57
|
+
* Environment variable names to be fingerprinted and passed to the task.
|
|
58
|
+
*/
|
|
59
|
+
env?: Array<string>;
|
|
60
|
+
/**
|
|
61
|
+
* Environment variable names to be passed to the task without fingerprinting.
|
|
62
|
+
*/
|
|
63
|
+
untrackedEnv?: Array<string>;
|
|
64
|
+
/**
|
|
65
|
+
* Files to include in the cache fingerprint.
|
|
66
|
+
*
|
|
67
|
+
* - Omitted: automatically tracks which files the task reads
|
|
68
|
+
* - `[]` (empty): disables file tracking entirely
|
|
69
|
+
* - Glob patterns (e.g. `"src/**"`) select specific files, relative to the package directory
|
|
70
|
+
* - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory
|
|
71
|
+
* - `{auto: true}` enables automatic file tracking
|
|
72
|
+
* - Negative patterns (e.g. `"!dist/**"`) exclude matched files
|
|
73
|
+
*/
|
|
74
|
+
input?: Array<string | GlobWithBase | AutoInput>;
|
|
75
|
+
/**
|
|
76
|
+
* Output files to archive after a successful run and restore on cache hit.
|
|
77
|
+
*
|
|
78
|
+
* - Omitted or `[]` (empty): no output archiving (default)
|
|
79
|
+
* - Glob patterns (e.g. `"dist/**"`) select specific output files, relative to the package directory
|
|
80
|
+
* - `{pattern: "...", base: "workspace" | "package"}` specifies a glob with an explicit base directory
|
|
81
|
+
* - Negative patterns (e.g. `"!dist/cache/**"`) exclude matched files
|
|
82
|
+
*/
|
|
83
|
+
output?: Array<string | GlobWithBase>;
|
|
84
|
+
} | {
|
|
85
|
+
/**
|
|
86
|
+
* Whether to cache the task
|
|
87
|
+
*/
|
|
88
|
+
cache: false;
|
|
89
|
+
});
|
|
90
|
+
type TaskDefinition = Task | Command;
|
|
91
|
+
type UserGlobalCacheConfig = boolean | {
|
|
92
|
+
/**
|
|
93
|
+
* Enable caching for package.json scripts not defined in the `tasks` map.
|
|
94
|
+
*
|
|
95
|
+
* When `false`, package.json scripts will not be cached.
|
|
96
|
+
* When `true`, package.json scripts will be cached with default settings.
|
|
97
|
+
*
|
|
98
|
+
* Default: `false`
|
|
99
|
+
*/
|
|
100
|
+
scripts?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Global cache kill switch for task entries.
|
|
103
|
+
*
|
|
104
|
+
* When `false`, overrides all tasks to disable caching, even tasks with `cache: true`.
|
|
105
|
+
* When `true`, respects each task's individual `cache` setting
|
|
106
|
+
* (each task's `cache` defaults to `true` if omitted).
|
|
107
|
+
*
|
|
108
|
+
* Default: `true`
|
|
109
|
+
*/
|
|
110
|
+
tasks?: boolean;
|
|
111
|
+
};
|
|
112
|
+
type RunConfig = {
|
|
113
|
+
/**
|
|
114
|
+
* Root-level cache configuration.
|
|
115
|
+
*
|
|
116
|
+
* This option can only be set in the workspace root's config file.
|
|
117
|
+
* Setting it in a package's config will result in an error.
|
|
118
|
+
*/
|
|
119
|
+
cache?: UserGlobalCacheConfig;
|
|
120
|
+
/**
|
|
121
|
+
* Task definitions: full task objects, command strings, or command string arrays.
|
|
122
|
+
*/
|
|
123
|
+
tasks?: { [key in string]: TaskDefinition };
|
|
124
|
+
/**
|
|
125
|
+
* Whether to automatically run `preX`/`postX` package.json scripts as
|
|
126
|
+
* lifecycle hooks when script `X` is executed.
|
|
127
|
+
*
|
|
128
|
+
* When `true` (the default), running script `test` will automatically
|
|
129
|
+
* run `pretest` before and `posttest` after, if they exist.
|
|
130
|
+
*
|
|
131
|
+
* This option can only be set in the workspace root's config file.
|
|
132
|
+
* Setting it in a package's config will result in an error.
|
|
133
|
+
*/
|
|
134
|
+
enablePrePostScripts?: boolean;
|
|
135
|
+
};
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region ../../node_modules/.pnpm/lint-staged@16.4.0/node_modules/lint-staged/lib/index.d.ts
|
|
138
|
+
type SyncGenerateTask = (stagedFileNames: readonly string[]) => string | string[];
|
|
139
|
+
type AsyncGenerateTask = (stagedFileNames: readonly string[]) => Promise<string | string[]>;
|
|
140
|
+
type GenerateTask = SyncGenerateTask | AsyncGenerateTask;
|
|
141
|
+
type TaskFunction = {
|
|
142
|
+
title: string;
|
|
143
|
+
task: (stagedFileNames: readonly string[]) => void | Promise<void>;
|
|
144
|
+
};
|
|
145
|
+
type Configuration = Record<string, string | TaskFunction | GenerateTask | (string | GenerateTask)[]> | GenerateTask;
|
|
146
|
+
//#endregion
|
|
147
|
+
//#region src/staged-config.d.ts
|
|
148
|
+
type StagedConfig = Configuration;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/define-config.d.ts
|
|
151
|
+
declare module '@voidzero-dev/vite-plus-core' {
|
|
152
|
+
interface UserConfig {
|
|
153
|
+
/**
|
|
154
|
+
* Options for oxlint
|
|
155
|
+
*/
|
|
156
|
+
lint?: OxlintConfig;
|
|
157
|
+
fmt?: OxfmtConfig;
|
|
158
|
+
pack?: PackUserConfig | PackUserConfig[];
|
|
159
|
+
run?: RunConfig;
|
|
160
|
+
staged?: StagedConfig;
|
|
161
|
+
/**
|
|
162
|
+
* Options for `vp create`.
|
|
163
|
+
*
|
|
164
|
+
* See `rfcs/create-org-default-templates.md` for the full specification.
|
|
165
|
+
*/
|
|
166
|
+
create?: {
|
|
167
|
+
/**
|
|
168
|
+
* When `vp create` is invoked with no template argument, use this
|
|
169
|
+
* value as if the user had typed it — typically a scope like
|
|
170
|
+
* `'@your-org'` paired with a `@your-org/create` package that exposes a
|
|
171
|
+
* `createConfig.templates` manifest. Can also name a local
|
|
172
|
+
* `create.templates` entry.
|
|
173
|
+
*/
|
|
174
|
+
defaultTemplate?: string;
|
|
175
|
+
/**
|
|
176
|
+
* Local templates available to `vp create` inside this monorepo. Each
|
|
177
|
+
* entry is shown in the `vp create` picker by `name`/`description`; its
|
|
178
|
+
* `template` resolves like any specifier (a workspace package name, a
|
|
179
|
+
* relative `./path`, a `vite:*` builtin, a GitHub URL, or an npm package).
|
|
180
|
+
*/
|
|
181
|
+
templates?: CreateTemplateEntry[];
|
|
182
|
+
};
|
|
183
|
+
/**
|
|
184
|
+
* Vitest test configuration.
|
|
185
|
+
*
|
|
186
|
+
* Vitest augments vite's `UserConfig` with a `test` field via
|
|
187
|
+
* `declare module 'vite'`, but vite-plus-core is a fork of vite so that
|
|
188
|
+
* augmentation does not apply here. Re-declare it locally so user
|
|
189
|
+
* configs like `defineConfig({ test: { globals: true } })` typecheck.
|
|
190
|
+
*/
|
|
191
|
+
test?: InlineConfig;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
type ViteUserConfigFnObject = (env: ConfigEnv) => UserConfig;
|
|
195
|
+
type ViteUserConfigFnPromise = (env: ConfigEnv) => Promise<UserConfig>;
|
|
196
|
+
type ViteUserConfigFn = (env: ConfigEnv) => UserConfig | Promise<UserConfig>;
|
|
197
|
+
type ViteUserConfigExport = UserConfig | Promise<UserConfig> | ViteUserConfigFnObject | ViteUserConfigFnPromise | ViteUserConfigFn;
|
|
198
|
+
/**
|
|
199
|
+
* Match the `vitest` / `@vitest/*` family of bare specifiers — the imports a
|
|
200
|
+
* browser-mode Vite dev server must resolve. Any query string is stripped
|
|
201
|
+
* first; relative (`./`), absolute (`/`), and virtual (`\0`) ids never match.
|
|
202
|
+
*
|
|
203
|
+
* Exported for unit testing.
|
|
204
|
+
*/
|
|
205
|
+
declare function isVitestFamilySpecifier(id: string): boolean;
|
|
206
|
+
/**
|
|
207
|
+
* Packages that register Vitest `expect` matchers via `expect.extend()` from
|
|
208
|
+
* a side-effect import. When Vite serves these from a separate module graph
|
|
209
|
+
* than the test runtime, the matchers register on a different `expect`
|
|
210
|
+
* instance and `expect(...).<matcher>` is undefined at call time (vitest
|
|
211
|
+
* issue #897). Inlining them into the test server's module graph forces
|
|
212
|
+
* registration on the same instance.
|
|
213
|
+
*
|
|
214
|
+
* Only packages that are **installed** in the consumer project are inlined.
|
|
215
|
+
* Absent packages are silently skipped so the server-deps optimizer never
|
|
216
|
+
* tries to resolve a name that does not exist in the project's node_modules.
|
|
217
|
+
*
|
|
218
|
+
* The check is deferred to a `configResolved` plugin hook so that
|
|
219
|
+
* `resolvedConfig.root` points at the actual project root (the value vite has
|
|
220
|
+
* already normalised), rather than relying on `process.cwd()` at config-load
|
|
221
|
+
* time (which can differ in workspace / monorepo setups).
|
|
222
|
+
*
|
|
223
|
+
* Exported for unit testing.
|
|
224
|
+
*/
|
|
225
|
+
declare const AUTO_INLINE_DEPS: ReadonlyArray<string>;
|
|
226
|
+
/**
|
|
227
|
+
* Compute the merged `test.server.deps.inline` list for a given project root,
|
|
228
|
+
* appending only those entries from [[AUTO_INLINE_DEPS]] that are actually
|
|
229
|
+
* installed in the project.
|
|
230
|
+
*
|
|
231
|
+
* Returns `null` when nothing needs to change (either `inline: true` or an
|
|
232
|
+
* empty result), so the caller can skip the mutation step.
|
|
233
|
+
*
|
|
234
|
+
* Exported for unit testing. The `_createRequire` parameter lets tests inject
|
|
235
|
+
* a controlled resolver without needing to spy on Node's ESM module namespace.
|
|
236
|
+
*/
|
|
237
|
+
declare function computeAutoInlineList(existingInline: (string | RegExp)[] | true | undefined, projectRoot: string, _createRequire?: (from: string) => {
|
|
238
|
+
resolve: (id: string) => string;
|
|
239
|
+
}): (string | RegExp)[] | null;
|
|
240
|
+
/**
|
|
241
|
+
* Resolve the coverage provider package name that should be version-checked, or
|
|
242
|
+
* `null` when no check applies (coverage off, or a `custom`/unknown provider
|
|
243
|
+
* vite-plus does not bundle a runner for).
|
|
244
|
+
*
|
|
245
|
+
* Takes Vitest's OWN resolved coverage options (`enabled`/`provider`), which the
|
|
246
|
+
* `configureVitest` hook exposes AFTER Vitest's CLI parser has run — so the
|
|
247
|
+
* `--coverage` family of flags is already folded into `enabled`/`provider` and
|
|
248
|
+
* we never re-parse `process.argv` ourselves. Unset `provider` defaults to `v8`
|
|
249
|
+
* (Vitest's default).
|
|
250
|
+
*
|
|
251
|
+
* Exported for unit testing.
|
|
252
|
+
*/
|
|
253
|
+
declare function resolveCoverageProviderToCheck(coverage: {
|
|
254
|
+
enabled?: boolean;
|
|
255
|
+
provider?: string;
|
|
256
|
+
} | undefined): string | null;
|
|
257
|
+
/**
|
|
258
|
+
* vite-plus bundles `vitest@VITEST_VERSION` as the test runner, but coverage
|
|
259
|
+
* providers (`@vitest/coverage-v8` / `-istanbul`) are project-installed peer
|
|
260
|
+
* deps it does not ship. Vitest only PRINTS A WARNING on a provider/runner
|
|
261
|
+
* version skew and then runs mixed versions (verified in 4.1.9: the provider's
|
|
262
|
+
* `_initialize` calls `logger.warn`, it never throws), silently producing
|
|
263
|
+
* unreliable coverage. Fail fast instead.
|
|
264
|
+
*
|
|
265
|
+
* Exported for unit testing.
|
|
266
|
+
*/
|
|
267
|
+
declare function assertCoverageProviderVersionMatch(providerPackageName: string, installedVersion: string | null | undefined, expectedVersion?: string): void;
|
|
268
|
+
/**
|
|
269
|
+
* Orchestrates the coverage version guard: detect the active provider from
|
|
270
|
+
* Vitest's resolved coverage options, read its installed version from the
|
|
271
|
+
* project root, and throw on a mismatch. A no-op when coverage is off or the
|
|
272
|
+
* provider is not installed.
|
|
273
|
+
*
|
|
274
|
+
* Exported (with injectable `deps`) for unit testing.
|
|
275
|
+
*/
|
|
276
|
+
declare function checkCoverageProviderVersion(coverage: {
|
|
277
|
+
enabled?: boolean;
|
|
278
|
+
provider?: string;
|
|
279
|
+
} | undefined, projectRoot: string, deps?: {
|
|
280
|
+
createRequire?: (from: string) => {
|
|
281
|
+
resolve: (id: string) => string;
|
|
282
|
+
};
|
|
283
|
+
readFile?: (path: string) => string;
|
|
284
|
+
}): void;
|
|
285
|
+
declare function defineConfig$1(config: UserConfig): UserConfig;
|
|
286
|
+
declare function defineConfig$1(config: Promise<UserConfig>): Promise<UserConfig>;
|
|
287
|
+
declare function defineConfig$1(config: ViteUserConfigFnObject): ViteUserConfigFnObject;
|
|
288
|
+
declare function defineConfig$1(config: ViteUserConfigFnPromise): ViteUserConfigFnPromise;
|
|
289
|
+
declare function defineConfig$1(config: ViteUserConfigExport): ViteUserConfigExport;
|
|
290
|
+
/**
|
|
291
|
+
* `defineProject` counterpart of [[defineConfig]]. A migrated project config
|
|
292
|
+
* that uses `defineProject({ test: { browser: ... } })` — e.g. a file named by
|
|
293
|
+
* a string `test.projects` entry — must still receive the vite-plus resolver /
|
|
294
|
+
* auto-inline plugins, or a browser project can fail to resolve `vitest` /
|
|
295
|
+
* `@vitest/*` from its own root under pnpm strict / Yarn PnP. The raw
|
|
296
|
+
* `vitest/config` helper does not add them.
|
|
297
|
+
*/
|
|
298
|
+
declare function defineProject$1(config: UserWorkspaceConfig): UserWorkspaceConfig;
|
|
299
|
+
declare function defineProject$1(config: Promise<UserWorkspaceConfig>): Promise<UserWorkspaceConfig>;
|
|
300
|
+
declare function defineProject$1(config: UserProjectConfigFn): UserProjectConfigFn;
|
|
301
|
+
declare function defineProject$1(config: UserProjectConfigExport): UserProjectConfigExport;
|
|
302
|
+
declare function lazyPlugins(cb: () => PluginOption[]): PluginOption[] | undefined;
|
|
303
|
+
declare function lazyPlugins(cb: () => Promise<PluginOption[]>): PluginOption[] | undefined;
|
|
304
|
+
//#endregion
|
|
305
|
+
export { defineConfig$1 as a, lazyPlugins as c, computeAutoInlineList as i, resolveCoverageProviderToCheck as l, assertCoverageProviderVersionMatch as n, defineProject$1 as o, checkCoverageProviderVersion as r, isVitestFamilySpecifier as s, AUTO_INLINE_DEPS as t };
|