vite-plus 0.2.6 → 0.2.8
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 +5 -1
- package/README.md +1 -1
- package/bin/vpr +3 -2
- package/binding/index.cjs +193 -80
- package/binding/index.d.cts +99 -8
- package/dist/agent-CI79DuSy.js +600 -0
- package/dist/bin.js +1367 -11
- package/dist/{cli-truncate-BVOlIIPy.js → cli-truncate-Bg3RDXpi.js} +0 -2
- package/dist/client/bundledDevClient.mjs +1 -0
- package/dist/config/bin.js +13 -126
- package/dist/{constants-CaXMuYUG.js → constants-BppDcRc1.js} +1 -1
- package/dist/create/bin.js +90 -77
- package/dist/{define-config-iGV0CGUk.cjs → define-config-CEm_MtvJ.cjs} +1 -1
- package/dist/{define-config-hV8qyU8p.js → define-config-DPnHe1Mx.js} +2 -2
- package/dist/{define-config-eLQH9us2.d.ts → define-config-DWoAkNdp.d.ts} +16 -0
- 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-CKz3vcoG.js → dist-CSQWHI6y.js} +3 -8
- package/dist/dist-DT25H9pj.js +3 -0
- package/dist/{agent-0gFJkIKu.js → editor-CGWdbLgD.js} +709 -579
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-DiRs8ceZ.js → json-BU88uu6o.js} +2 -6
- package/dist/migration/bin.js +60 -50
- package/dist/{oxlint-plugin-config-CMSCIkks.js → oxlint-plugin-config-BHOzlwMw.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +2 -2
- package/dist/{package-CP5EUXlu.js → package-hV-77cBb.js} +2 -2
- package/dist/{tsconfig-Cac-NNdT.js → prompts-DYap08te.js} +32 -174
- package/dist/{resolve-vite-config-BY7PB-LW.js → resolve-vite-config-EWXclqvV.js} +1 -1
- package/dist/{rolldown-runtime-C7HZzL1F.js → rolldown-runtime-CMFfr-1z.js} +1 -1
- package/dist/staged/bin.js +20 -23
- package/dist/{help-YP84FSEz.js → terminal-CrqqK8WT.js} +39 -2
- package/dist/tsconfig-CVUKLfL8.js +151 -0
- package/dist/{tsgolint-path-B-yOos8p.js → tsgolint-path-eMZT-oea.js} +4 -2
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +5 -5
- package/dist/versions.js +5 -5
- package/docs/config/index.md +13 -0
- package/docs/config/staged.md +2 -1
- package/docs/guide/build.md +1 -1
- package/docs/guide/ci.md +28 -3
- package/docs/guide/commit-hooks.md +76 -9
- package/docs/guide/dev.md +4 -0
- package/docs/guide/env.md +8 -4
- package/docs/guide/index.md +1 -1
- package/docs/guide/install.md +2 -0
- package/docs/guide/installer-env-vars.md +3 -3
- package/docs/guide/migrate.md +11 -3
- package/docs/guide/monorepo.md +94 -6
- package/docs/guide/run.md +15 -0
- package/docs/guide/test.md +4 -0
- package/docs/guide/troubleshooting.md +9 -5
- package/package.json +18 -24
- package/dist/dist-CtM2JRbM.js +0 -3
- package/dist/editor-D4T70tKk.js +0 -675
- package/dist/terminal-uTv0ZaMr.js +0 -33
- package/dist/{log-update-DHZRyJ2m.js → log-update-CoW8Z4Dl.js} +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,13 +1,1340 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { r as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { a as printHeader, c as renderCliDoc, n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-CrqqK8WT.js";
|
|
2
|
+
import { f as resolve$1, i as DEFAULT_ENVS, n as BASEURL_TSCONFIG_WARNING, p as resolveBundled, r as CONFIG_METADATA_ENV, s as VITE_PLUS_NAME } from "./constants-BppDcRc1.js";
|
|
3
|
+
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BHOzlwMw.js";
|
|
4
|
+
import { M as runCommandSilently } from "./prompts-DYap08te.js";
|
|
5
|
+
import { i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-CVUKLfL8.js";
|
|
6
|
+
import { t as resolveTsgolintExecutable } from "./tsgolint-path-eMZT-oea.js";
|
|
7
|
+
import { i as resolveUniversalViteConfig } from "./resolve-vite-config-EWXclqvV.js";
|
|
7
8
|
import path, { dirname, join } from "node:path";
|
|
8
9
|
import { ensureBlockingStdio, hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
|
|
9
10
|
import fs, { readFileSync } from "node:fs";
|
|
10
11
|
import { fileURLToPath } from "node:url";
|
|
12
|
+
//#region src/help.ts
|
|
13
|
+
const commandHelpDocs = {
|
|
14
|
+
dev: {
|
|
15
|
+
usage: "vp dev [ROOT] [OPTIONS]",
|
|
16
|
+
summary: ["Run the development server.", "Options are forwarded to Vite."],
|
|
17
|
+
sections: [
|
|
18
|
+
{
|
|
19
|
+
title: "Arguments",
|
|
20
|
+
rows: [{
|
|
21
|
+
label: "[ROOT]",
|
|
22
|
+
description: "Project root directory (default: current directory)"
|
|
23
|
+
}]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
title: "Options",
|
|
27
|
+
rows: [
|
|
28
|
+
{
|
|
29
|
+
label: "--host [HOST]",
|
|
30
|
+
description: "Specify hostname"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
label: "--port <PORT>",
|
|
34
|
+
description: "Specify port"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
label: "--open [PATH]",
|
|
38
|
+
description: "Open browser on startup"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
label: "--cors",
|
|
42
|
+
description: "Enable CORS"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
label: "--strictPort",
|
|
46
|
+
description: "Exit if specified port is already in use"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
label: "--force",
|
|
50
|
+
description: "Ignore the optimizer cache and re-bundle"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
label: "--experimentalBundle",
|
|
54
|
+
description: "Use experimental full bundle mode"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
label: "--base <PATH>",
|
|
58
|
+
description: "Public base path"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
label: "-l, --logLevel <LEVEL>",
|
|
62
|
+
description: "Set log level"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
label: "--clearScreen",
|
|
66
|
+
description: "Allow or disable clearing the screen"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
label: "-d, --debug [FEAT]",
|
|
70
|
+
description: "Show debug logs"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
label: "-f, --filter <FILTER>",
|
|
74
|
+
description: "Filter debug logs"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
label: "-m, --mode <MODE>",
|
|
78
|
+
description: "Set env mode"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
label: "-h, --help",
|
|
82
|
+
description: "Print help"
|
|
83
|
+
}
|
|
84
|
+
]
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
title: "Examples",
|
|
88
|
+
lines: [
|
|
89
|
+
" vp dev",
|
|
90
|
+
" vp dev --open",
|
|
91
|
+
" vp dev --host localhost --port 5173"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
],
|
|
95
|
+
documentationUrl: "https://viteplus.dev/guide/dev"
|
|
96
|
+
},
|
|
97
|
+
build: {
|
|
98
|
+
usage: "vp build [ROOT] [OPTIONS]",
|
|
99
|
+
summary: ["Build for production.", "Options are forwarded to Vite."],
|
|
100
|
+
sections: [
|
|
101
|
+
{
|
|
102
|
+
title: "Arguments",
|
|
103
|
+
rows: [{
|
|
104
|
+
label: "[ROOT]",
|
|
105
|
+
description: "Project root directory (default: current directory)"
|
|
106
|
+
}]
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
title: "Options",
|
|
110
|
+
rows: [
|
|
111
|
+
{
|
|
112
|
+
label: "--target <TARGET>",
|
|
113
|
+
description: "Transpile target"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
label: "--outDir <DIR>",
|
|
117
|
+
description: "Output directory"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
label: "--assetsDir <DIR>",
|
|
121
|
+
description: "Directory for generated assets"
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
label: "--assetsInlineLimit <NUMBER>",
|
|
125
|
+
description: "Static asset inline threshold"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
label: "--ssr [ENTRY]",
|
|
129
|
+
description: "Build for server-side rendering"
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
label: "--sourcemap [MODE]",
|
|
133
|
+
description: "Output source maps"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: "--minify [MINIFIER]",
|
|
137
|
+
description: "Enable or disable minification"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
label: "--manifest [NAME]",
|
|
141
|
+
description: "Emit a build manifest"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
label: "--ssrManifest [NAME]",
|
|
145
|
+
description: "Emit an SSR manifest"
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
label: "--emptyOutDir",
|
|
149
|
+
description: "Empty outDir even when it is outside root"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
label: "-w, --watch",
|
|
153
|
+
description: "Rebuild when files change"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: "--app",
|
|
157
|
+
description: "Build an application with the builder API"
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
label: "--base <PATH>",
|
|
161
|
+
description: "Public base path"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: "-l, --logLevel <LEVEL>",
|
|
165
|
+
description: "Set log level"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
label: "--clearScreen",
|
|
169
|
+
description: "Allow or disable clearing the screen"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
label: "-d, --debug [FEAT]",
|
|
173
|
+
description: "Show debug logs"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: "-f, --filter <FILTER>",
|
|
177
|
+
description: "Filter debug logs"
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
label: "-m, --mode <MODE>",
|
|
181
|
+
description: "Set env mode"
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
label: "-h, --help",
|
|
185
|
+
description: "Print help"
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
},
|
|
189
|
+
{
|
|
190
|
+
title: "Examples",
|
|
191
|
+
lines: [
|
|
192
|
+
" vp build",
|
|
193
|
+
" vp build --watch",
|
|
194
|
+
" vp build --sourcemap"
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
],
|
|
198
|
+
documentationUrl: "https://viteplus.dev/guide/build"
|
|
199
|
+
},
|
|
200
|
+
preview: {
|
|
201
|
+
usage: "vp preview [ROOT] [OPTIONS]",
|
|
202
|
+
summary: ["Preview a production build.", "Options are forwarded to Vite."],
|
|
203
|
+
sections: [
|
|
204
|
+
{
|
|
205
|
+
title: "Arguments",
|
|
206
|
+
rows: [{
|
|
207
|
+
label: "[ROOT]",
|
|
208
|
+
description: "Project root directory (default: current directory)"
|
|
209
|
+
}]
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
title: "Options",
|
|
213
|
+
rows: [
|
|
214
|
+
{
|
|
215
|
+
label: "--host [HOST]",
|
|
216
|
+
description: "Specify hostname"
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
label: "--port <PORT>",
|
|
220
|
+
description: "Specify port"
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
label: "--strictPort",
|
|
224
|
+
description: "Exit if specified port is already in use"
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
label: "--open [PATH]",
|
|
228
|
+
description: "Open browser on startup"
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
label: "--outDir <DIR>",
|
|
232
|
+
description: "Output directory to preview"
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: "--base <PATH>",
|
|
236
|
+
description: "Public base path"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
label: "-l, --logLevel <LEVEL>",
|
|
240
|
+
description: "Set log level"
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
label: "--clearScreen",
|
|
244
|
+
description: "Allow or disable clearing the screen"
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
label: "-d, --debug [FEAT]",
|
|
248
|
+
description: "Show debug logs"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
label: "-f, --filter <FILTER>",
|
|
252
|
+
description: "Filter debug logs"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
label: "-m, --mode <MODE>",
|
|
256
|
+
description: "Set env mode"
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
label: "-h, --help",
|
|
260
|
+
description: "Print help"
|
|
261
|
+
}
|
|
262
|
+
]
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
title: "Examples",
|
|
266
|
+
lines: [" vp preview", " vp preview --port 4173"]
|
|
267
|
+
}
|
|
268
|
+
],
|
|
269
|
+
documentationUrl: "https://viteplus.dev/guide/build"
|
|
270
|
+
},
|
|
271
|
+
test: {
|
|
272
|
+
usage: "vp test [COMMAND] [FILTERS]... [OPTIONS]",
|
|
273
|
+
summary: ["Run tests once by default.", "Options are forwarded to Vitest."],
|
|
274
|
+
sections: [
|
|
275
|
+
{
|
|
276
|
+
title: "Commands",
|
|
277
|
+
rows: [
|
|
278
|
+
{
|
|
279
|
+
label: "run",
|
|
280
|
+
description: "Run tests once"
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
label: "watch",
|
|
284
|
+
description: "Run tests in watch mode"
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
label: "dev",
|
|
288
|
+
description: "Run tests in development mode"
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
label: "related",
|
|
292
|
+
description: "Run tests related to changed files"
|
|
293
|
+
},
|
|
294
|
+
{
|
|
295
|
+
label: "bench",
|
|
296
|
+
description: "Run benchmarks"
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
label: "list",
|
|
300
|
+
description: "List matching tests"
|
|
301
|
+
}
|
|
302
|
+
]
|
|
303
|
+
},
|
|
304
|
+
{
|
|
305
|
+
title: "Arguments",
|
|
306
|
+
rows: [{
|
|
307
|
+
label: "[FILTERS]...",
|
|
308
|
+
description: "Test file filters"
|
|
309
|
+
}]
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
title: "Options",
|
|
313
|
+
rows: [
|
|
314
|
+
{
|
|
315
|
+
label: "-r, --root <PATH>",
|
|
316
|
+
description: "Root path"
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
label: "-u, --update [TYPE]",
|
|
320
|
+
description: "Update snapshot (accepts boolean, \"new\", \"all\" or \"none\")"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
label: "-w, --watch",
|
|
324
|
+
description: "Enable watch mode"
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
label: "-t, --testNamePattern <PATTERN>",
|
|
328
|
+
description: "Run tests with full names matching the specified regexp pattern"
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
label: "--dir <PATH>",
|
|
332
|
+
description: "Base directory to scan for the test files"
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
label: "--ui",
|
|
336
|
+
description: "Enable UI"
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
label: "--open",
|
|
340
|
+
description: "Open UI automatically (default: !process.env.CI)"
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
label: "--api [PORT]",
|
|
344
|
+
description: "Specify server port; if true, defaults to 51204"
|
|
345
|
+
},
|
|
346
|
+
{
|
|
347
|
+
label: "--silent [VALUE]",
|
|
348
|
+
description: "Silent console output from tests. Use 'passed-only' to see logs from failing tests only"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
label: "--hideSkippedTests",
|
|
352
|
+
description: "Hide logs for skipped tests"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
label: "--reporter <NAME>",
|
|
356
|
+
description: "Specify reporters (default, agent, minimal, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)"
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
label: "--outputFile <FILENAME/-S>",
|
|
360
|
+
description: "Write test results to a file; use dot notation for individual outputs of multiple reporters (for example, --outputFile.tap=./tap.txt)"
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
label: "--coverage",
|
|
364
|
+
description: "Enable coverage reporting"
|
|
365
|
+
},
|
|
366
|
+
{
|
|
367
|
+
label: "--mode <NAME>",
|
|
368
|
+
description: "Override Vite mode (default: test or benchmark)"
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
label: "--isolate",
|
|
372
|
+
description: "Run every test file in isolation. Use --no-isolate to disable (default: true)"
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
label: "--globals",
|
|
376
|
+
description: "Inject APIs globally"
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
label: "--dom",
|
|
380
|
+
description: "Mock browser API with happy-dom"
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
label: "--browser <NAME>",
|
|
384
|
+
description: "Run tests in the browser; equivalent to --browser.enabled (default: false)"
|
|
385
|
+
},
|
|
386
|
+
{
|
|
387
|
+
label: "--pool <POOL>",
|
|
388
|
+
description: "Specify pool when not running in the browser (default: forks)"
|
|
389
|
+
},
|
|
390
|
+
{
|
|
391
|
+
label: "--execArgv <OPTION>",
|
|
392
|
+
description: "Pass additional arguments to Node.js when spawning worker threads or child processes"
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
label: "--vmMemoryLimit <LIMIT>",
|
|
396
|
+
description: "Memory limit for VM pools"
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
label: "--fileParallelism",
|
|
400
|
+
description: "Run test files in parallel. Use --no-file-parallelism to disable (default: true)"
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
label: "--maxWorkers <WORKERS>",
|
|
404
|
+
description: "Maximum number or percentage of workers to run tests in"
|
|
405
|
+
},
|
|
406
|
+
{
|
|
407
|
+
label: "--environment <NAME>",
|
|
408
|
+
description: "Specify runner environment (default: node)"
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
label: "--passWithNoTests",
|
|
412
|
+
description: "Pass when no tests are found"
|
|
413
|
+
},
|
|
414
|
+
{
|
|
415
|
+
label: "--logHeapUsage",
|
|
416
|
+
description: "Show the size of the heap for each test when running in Node.js"
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
label: "--detectAsyncLeaks",
|
|
420
|
+
description: "Detect asynchronous resources leaking from test files (default: false)"
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
label: "--allowOnly",
|
|
424
|
+
description: "Allow tests and suites marked as only (default: !process.env.CI)"
|
|
425
|
+
},
|
|
426
|
+
{
|
|
427
|
+
label: "--dangerouslyIgnoreUnhandledErrors",
|
|
428
|
+
description: "Ignore any unhandled errors that occur"
|
|
429
|
+
},
|
|
430
|
+
{
|
|
431
|
+
label: "--shard <SHARDS>",
|
|
432
|
+
description: "Test suite shard to execute in the format <index>/<count>"
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
label: "--changed [SINCE]",
|
|
436
|
+
description: "Run tests affected by changed files (default: false)"
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
label: "--sequence <OPTIONS>",
|
|
440
|
+
description: "Configure test sorting"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
label: "--inspect [[HOST:]PORT]",
|
|
444
|
+
description: "Enable Node.js inspector (default: 127.0.0.1:9229)"
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
label: "--inspectBrk [[HOST:]PORT]",
|
|
448
|
+
description: "Enable Node.js inspector and break before tests start"
|
|
449
|
+
},
|
|
450
|
+
{
|
|
451
|
+
label: "--testTimeout <TIMEOUT>",
|
|
452
|
+
description: "Default test timeout in milliseconds (default: 5000; 0 disables)"
|
|
453
|
+
},
|
|
454
|
+
{
|
|
455
|
+
label: "--hookTimeout <TIMEOUT>",
|
|
456
|
+
description: "Default hook timeout in milliseconds (default: 10000; 0 disables)"
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
label: "--bail <NUMBER>",
|
|
460
|
+
description: "Stop test execution after the given number of failures (default: 0)"
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
label: "--retry <TIMES>",
|
|
464
|
+
description: "Retry failed tests (default: 0)"
|
|
465
|
+
},
|
|
466
|
+
{
|
|
467
|
+
label: "--diff <PATH>",
|
|
468
|
+
description: "DiffOptions object or path to a module exporting one"
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
label: "--exclude <GLOB>",
|
|
472
|
+
description: "Additional file globs to exclude from tests"
|
|
473
|
+
},
|
|
474
|
+
{
|
|
475
|
+
label: "--expandSnapshotDiff",
|
|
476
|
+
description: "Show the full diff when a snapshot fails"
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
label: "--disableConsoleIntercept",
|
|
480
|
+
description: "Disable automatic interception of console logging (default: false)"
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
label: "--typecheck",
|
|
484
|
+
description: "Enable typechecking alongside tests (default: false)"
|
|
485
|
+
},
|
|
486
|
+
{
|
|
487
|
+
label: "--project <NAME>",
|
|
488
|
+
description: "Select one or more Vitest workspace projects by name or wildcard"
|
|
489
|
+
},
|
|
490
|
+
{
|
|
491
|
+
label: "--slowTestThreshold <THRESHOLD>",
|
|
492
|
+
description: "Threshold for a test or suite to be considered slow (default: 300ms)"
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
label: "--teardownTimeout <TIMEOUT>",
|
|
496
|
+
description: "Default teardown timeout in milliseconds (default: 10000)"
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
label: "--cache",
|
|
500
|
+
description: "Enable cache"
|
|
501
|
+
},
|
|
502
|
+
{
|
|
503
|
+
label: "--maxConcurrency <NUMBER>",
|
|
504
|
+
description: "Maximum number of concurrent tests and suites (default: 5)"
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
label: "--expect",
|
|
508
|
+
description: "Configure expect matchers"
|
|
509
|
+
},
|
|
510
|
+
{
|
|
511
|
+
label: "--printConsoleTrace",
|
|
512
|
+
description: "Always print console stack traces"
|
|
513
|
+
},
|
|
514
|
+
{
|
|
515
|
+
label: "--includeTaskLocation",
|
|
516
|
+
description: "Collect test and suite locations in the location property"
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
label: "--attachmentsDir <DIR>",
|
|
520
|
+
description: "Directory for attachments created with context.annotate (default: .vitest-attachments)"
|
|
521
|
+
},
|
|
522
|
+
{
|
|
523
|
+
label: "--run",
|
|
524
|
+
description: "Disable watch mode"
|
|
525
|
+
},
|
|
526
|
+
{
|
|
527
|
+
label: "--no-color",
|
|
528
|
+
description: "Remove colors from console output (default: true)"
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
label: "--clearScreen",
|
|
532
|
+
description: "Clear the terminal when rerunning tests in watch mode (default: true)"
|
|
533
|
+
},
|
|
534
|
+
{
|
|
535
|
+
label: "--standalone",
|
|
536
|
+
description: "Start Vitest without running tests until files change (default: false)"
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
label: "--mergeReports [PATH]",
|
|
540
|
+
description: "Merge previously recorded blob reports without running tests"
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
label: "--listTags [TYPE]",
|
|
544
|
+
description: "List available tags; --list-tags=json outputs JSON"
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
label: "--clearCache",
|
|
548
|
+
description: "Delete all Vitest caches without running tests"
|
|
549
|
+
},
|
|
550
|
+
{
|
|
551
|
+
label: "--tagsFilter <EXPRESSION>",
|
|
552
|
+
description: "Run only tests matching the tag expression"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
label: "--strictTags",
|
|
556
|
+
description: "Error when a test uses an undefined tag (default: true)"
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
label: "--experimental <FEATURES>",
|
|
560
|
+
description: "Enable experimental features"
|
|
561
|
+
},
|
|
562
|
+
{
|
|
563
|
+
label: "-h, --help",
|
|
564
|
+
description: "Display this message"
|
|
565
|
+
}
|
|
566
|
+
]
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
title: "Bench Options",
|
|
570
|
+
rows: [{
|
|
571
|
+
label: "--compare <FILENAME>",
|
|
572
|
+
description: "Benchmark output file to compare against"
|
|
573
|
+
}, {
|
|
574
|
+
label: "--outputJson <FILENAME>",
|
|
575
|
+
description: "Benchmark output file"
|
|
576
|
+
}]
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
title: "List Options",
|
|
580
|
+
rows: [
|
|
581
|
+
{
|
|
582
|
+
label: "--json [TRUE/PATH]",
|
|
583
|
+
description: "Print collected tests as JSON or write to a file (default: false)"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
label: "--filesOnly",
|
|
587
|
+
description: "Print only test files without test cases"
|
|
588
|
+
},
|
|
589
|
+
{
|
|
590
|
+
label: "--staticParse",
|
|
591
|
+
description: "Parse files statically instead of running them (default: false)"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
label: "--staticParseConcurrency <LIMIT>",
|
|
595
|
+
description: "Number of test files to process concurrently"
|
|
596
|
+
}
|
|
597
|
+
]
|
|
598
|
+
},
|
|
599
|
+
{
|
|
600
|
+
title: "Examples",
|
|
601
|
+
lines: [
|
|
602
|
+
" vp test",
|
|
603
|
+
" vp test src/foo.test.ts",
|
|
604
|
+
" vp test watch --coverage"
|
|
605
|
+
]
|
|
606
|
+
}
|
|
607
|
+
],
|
|
608
|
+
documentationUrl: "https://viteplus.dev/guide/test"
|
|
609
|
+
},
|
|
610
|
+
lint: {
|
|
611
|
+
usage: "vp lint [PATH]... [OPTIONS]",
|
|
612
|
+
summary: ["Lint code.", "Options are forwarded to Oxlint."],
|
|
613
|
+
sections: [
|
|
614
|
+
{
|
|
615
|
+
title: "Arguments",
|
|
616
|
+
rows: [{
|
|
617
|
+
label: "[PATH]...",
|
|
618
|
+
description: "Files or directories to lint"
|
|
619
|
+
}]
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
title: "Basic Configuration",
|
|
623
|
+
rows: [{
|
|
624
|
+
label: "--tsconfig <PATH>",
|
|
625
|
+
description: "Override the TypeScript config used for import resolution"
|
|
626
|
+
}]
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
title: "Rule Severity",
|
|
630
|
+
rows: [
|
|
631
|
+
{
|
|
632
|
+
label: "-A, --allow <NAME>",
|
|
633
|
+
description: "Allow a rule or category"
|
|
634
|
+
},
|
|
635
|
+
{
|
|
636
|
+
label: "-W, --warn <NAME>",
|
|
637
|
+
description: "Emit a warning for a rule or category"
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
label: "-D, --deny <NAME>",
|
|
641
|
+
description: "Emit an error for a rule or category"
|
|
642
|
+
}
|
|
643
|
+
]
|
|
644
|
+
},
|
|
645
|
+
{
|
|
646
|
+
title: "Plugins",
|
|
647
|
+
rows: [
|
|
648
|
+
{
|
|
649
|
+
label: "--disable-unicorn-plugin",
|
|
650
|
+
description: "Disable the unicorn plugin, which is enabled by default"
|
|
651
|
+
},
|
|
652
|
+
{
|
|
653
|
+
label: "--disable-oxc-plugin",
|
|
654
|
+
description: "Disable Oxc-specific rules, which are enabled by default"
|
|
655
|
+
},
|
|
656
|
+
{
|
|
657
|
+
label: "--disable-typescript-plugin",
|
|
658
|
+
description: "Disable the TypeScript plugin, which is enabled by default"
|
|
659
|
+
},
|
|
660
|
+
{
|
|
661
|
+
label: "--import-plugin",
|
|
662
|
+
description: "Enable the import plugin"
|
|
663
|
+
},
|
|
664
|
+
{
|
|
665
|
+
label: "--react-plugin",
|
|
666
|
+
description: "Enable the React plugin"
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
label: "--jsdoc-plugin",
|
|
670
|
+
description: "Enable the JSDoc plugin"
|
|
671
|
+
},
|
|
672
|
+
{
|
|
673
|
+
label: "--jest-plugin",
|
|
674
|
+
description: "Enable the Jest plugin"
|
|
675
|
+
},
|
|
676
|
+
{
|
|
677
|
+
label: "--vitest-plugin",
|
|
678
|
+
description: "Enable the Vitest plugin"
|
|
679
|
+
},
|
|
680
|
+
{
|
|
681
|
+
label: "--jsx-a11y-plugin",
|
|
682
|
+
description: "Enable the JSX accessibility plugin"
|
|
683
|
+
},
|
|
684
|
+
{
|
|
685
|
+
label: "--nextjs-plugin",
|
|
686
|
+
description: "Enable the Next.js plugin"
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
label: "--react-perf-plugin",
|
|
690
|
+
description: "Enable the React performance plugin"
|
|
691
|
+
},
|
|
692
|
+
{
|
|
693
|
+
label: "--promise-plugin",
|
|
694
|
+
description: "Enable the promise plugin"
|
|
695
|
+
},
|
|
696
|
+
{
|
|
697
|
+
label: "--node-plugin",
|
|
698
|
+
description: "Enable the Node.js plugin"
|
|
699
|
+
},
|
|
700
|
+
{
|
|
701
|
+
label: "--vue-plugin",
|
|
702
|
+
description: "Enable the Vue plugin"
|
|
703
|
+
}
|
|
704
|
+
]
|
|
705
|
+
},
|
|
706
|
+
{
|
|
707
|
+
title: "Fix Problems",
|
|
708
|
+
rows: [
|
|
709
|
+
{
|
|
710
|
+
label: "--fix",
|
|
711
|
+
description: "Fix issues when possible"
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
label: "--fix-suggestions",
|
|
715
|
+
description: "Apply auto-fixable suggestions"
|
|
716
|
+
},
|
|
717
|
+
{
|
|
718
|
+
label: "--fix-dangerously",
|
|
719
|
+
description: "Apply dangerous fixes and suggestions"
|
|
720
|
+
}
|
|
721
|
+
]
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
title: "Ignore Files",
|
|
725
|
+
rows: [
|
|
726
|
+
{
|
|
727
|
+
label: "--ignore-path <PATH>",
|
|
728
|
+
description: "Use the specified .eslintignore file"
|
|
729
|
+
},
|
|
730
|
+
{
|
|
731
|
+
label: "--ignore-pattern <PATTERN>",
|
|
732
|
+
description: "Add file patterns to ignore"
|
|
733
|
+
},
|
|
734
|
+
{
|
|
735
|
+
label: "--no-ignore",
|
|
736
|
+
description: "Disable file exclusion from ignore rules"
|
|
737
|
+
}
|
|
738
|
+
]
|
|
739
|
+
},
|
|
740
|
+
{
|
|
741
|
+
title: "Handle Warnings",
|
|
742
|
+
rows: [
|
|
743
|
+
{
|
|
744
|
+
label: "--quiet",
|
|
745
|
+
description: "Report errors only"
|
|
746
|
+
},
|
|
747
|
+
{
|
|
748
|
+
label: "--deny-warnings",
|
|
749
|
+
description: "Exit non-zero when warnings are reported"
|
|
750
|
+
},
|
|
751
|
+
{
|
|
752
|
+
label: "--max-warnings <INT>",
|
|
753
|
+
description: "Set the warning threshold before exiting non-zero"
|
|
754
|
+
}
|
|
755
|
+
]
|
|
756
|
+
},
|
|
757
|
+
{
|
|
758
|
+
title: "Output",
|
|
759
|
+
rows: [{
|
|
760
|
+
label: "-f, --format <FORMAT>",
|
|
761
|
+
description: "Set output format: checkstyle, default, agent, github, gitlab, json, junit, sarif, stylish, or unix"
|
|
762
|
+
}, {
|
|
763
|
+
label: "--debug <OPTIONS>",
|
|
764
|
+
description: "Enable comma-separated debug output options: files or timings"
|
|
765
|
+
}]
|
|
766
|
+
},
|
|
767
|
+
{
|
|
768
|
+
title: "Miscellaneous",
|
|
769
|
+
rows: [
|
|
770
|
+
{
|
|
771
|
+
label: "--silent",
|
|
772
|
+
description: "Do not display diagnostics"
|
|
773
|
+
},
|
|
774
|
+
{
|
|
775
|
+
label: "--no-error-on-unmatched-pattern",
|
|
776
|
+
description: "Do not exit with an error when no files are selected for linting"
|
|
777
|
+
},
|
|
778
|
+
{
|
|
779
|
+
label: "--threads <INT>",
|
|
780
|
+
description: "Number of threads to use; set to 1 to use one CPU core"
|
|
781
|
+
},
|
|
782
|
+
{
|
|
783
|
+
label: "--print-config",
|
|
784
|
+
description: "Print the resolved configuration without linting"
|
|
785
|
+
}
|
|
786
|
+
]
|
|
787
|
+
},
|
|
788
|
+
{
|
|
789
|
+
title: "Inline Configuration",
|
|
790
|
+
rows: [{
|
|
791
|
+
label: "--report-unused-disable-directives",
|
|
792
|
+
description: "Report unused oxlint-disable directives"
|
|
793
|
+
}, {
|
|
794
|
+
label: "--report-unused-disable-directives-severity <SEVERITY>",
|
|
795
|
+
description: "Report unused disable directives at the specified severity"
|
|
796
|
+
}]
|
|
797
|
+
},
|
|
798
|
+
{
|
|
799
|
+
title: "Options",
|
|
800
|
+
rows: [
|
|
801
|
+
{
|
|
802
|
+
label: "--rules",
|
|
803
|
+
description: "List all registered rules"
|
|
804
|
+
},
|
|
805
|
+
{
|
|
806
|
+
label: "--type-aware",
|
|
807
|
+
description: "Enable rules requiring type information"
|
|
808
|
+
},
|
|
809
|
+
{
|
|
810
|
+
label: "--type-check",
|
|
811
|
+
description: "Enable experimental type checking and compiler diagnostics"
|
|
812
|
+
},
|
|
813
|
+
{
|
|
814
|
+
label: "-h, --help",
|
|
815
|
+
description: "Print help information"
|
|
816
|
+
}
|
|
817
|
+
]
|
|
818
|
+
},
|
|
819
|
+
{
|
|
820
|
+
title: "Examples",
|
|
821
|
+
lines: [
|
|
822
|
+
" vp lint",
|
|
823
|
+
" vp lint src --fix",
|
|
824
|
+
" vp lint --type-aware --tsconfig ./tsconfig.json"
|
|
825
|
+
]
|
|
826
|
+
}
|
|
827
|
+
],
|
|
828
|
+
documentationUrl: "https://viteplus.dev/guide/lint"
|
|
829
|
+
},
|
|
830
|
+
fmt: {
|
|
831
|
+
usage: "vp fmt [PATH]... [OPTIONS]",
|
|
832
|
+
summary: ["Format code.", "Options are forwarded to Oxfmt."],
|
|
833
|
+
sections: [
|
|
834
|
+
{
|
|
835
|
+
title: "Arguments",
|
|
836
|
+
rows: [{
|
|
837
|
+
label: "[PATH]...",
|
|
838
|
+
description: "Files, directories, or glob patterns (default: current directory)"
|
|
839
|
+
}]
|
|
840
|
+
},
|
|
841
|
+
{
|
|
842
|
+
title: "Mode Options",
|
|
843
|
+
rows: [{
|
|
844
|
+
label: "--stdin-filepath <PATH>",
|
|
845
|
+
description: "Specify the file name used to infer the parser for stdin"
|
|
846
|
+
}]
|
|
847
|
+
},
|
|
848
|
+
{
|
|
849
|
+
title: "Output Options",
|
|
850
|
+
rows: [
|
|
851
|
+
{
|
|
852
|
+
label: "--write",
|
|
853
|
+
description: "Format and write files in place"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
label: "--check",
|
|
857
|
+
description: "Check whether files are formatted and show statistics"
|
|
858
|
+
},
|
|
859
|
+
{
|
|
860
|
+
label: "--list-different",
|
|
861
|
+
description: "List files that would be changed"
|
|
862
|
+
}
|
|
863
|
+
]
|
|
864
|
+
},
|
|
865
|
+
{
|
|
866
|
+
title: "Ignore Options",
|
|
867
|
+
rows: [{
|
|
868
|
+
label: "--ignore-path <PATH>",
|
|
869
|
+
description: "Path to an ignore file; may be specified multiple times"
|
|
870
|
+
}, {
|
|
871
|
+
label: "--with-node-modules",
|
|
872
|
+
description: "Format files in node_modules, which are skipped by default"
|
|
873
|
+
}]
|
|
874
|
+
},
|
|
875
|
+
{
|
|
876
|
+
title: "Runtime Options",
|
|
877
|
+
rows: [{
|
|
878
|
+
label: "--no-error-on-unmatched-pattern",
|
|
879
|
+
description: "Do not exit with an error when the pattern is unmatched"
|
|
880
|
+
}, {
|
|
881
|
+
label: "--threads <INT>",
|
|
882
|
+
description: "Number of threads to use; set to 1 to use one CPU core"
|
|
883
|
+
}]
|
|
884
|
+
},
|
|
885
|
+
{
|
|
886
|
+
title: "Options",
|
|
887
|
+
rows: [{
|
|
888
|
+
label: "-h, --help",
|
|
889
|
+
description: "Print help information"
|
|
890
|
+
}]
|
|
891
|
+
},
|
|
892
|
+
{
|
|
893
|
+
title: "Examples",
|
|
894
|
+
lines: [
|
|
895
|
+
" vp fmt",
|
|
896
|
+
" vp fmt src --check",
|
|
897
|
+
" vp fmt . --write"
|
|
898
|
+
]
|
|
899
|
+
}
|
|
900
|
+
],
|
|
901
|
+
documentationUrl: "https://viteplus.dev/guide/fmt"
|
|
902
|
+
},
|
|
903
|
+
check: {
|
|
904
|
+
usage: "vp check [OPTIONS] [PATHS]...",
|
|
905
|
+
summary: "Run format, lint, and type checks.",
|
|
906
|
+
sections: [
|
|
907
|
+
{
|
|
908
|
+
title: "Arguments",
|
|
909
|
+
rows: [{
|
|
910
|
+
label: "[PATHS]...",
|
|
911
|
+
description: "File paths to pass to fmt and lint"
|
|
912
|
+
}]
|
|
913
|
+
},
|
|
914
|
+
{
|
|
915
|
+
title: "Options",
|
|
916
|
+
rows: [
|
|
917
|
+
{
|
|
918
|
+
label: "--fix",
|
|
919
|
+
description: "Auto-fix format and lint issues"
|
|
920
|
+
},
|
|
921
|
+
{
|
|
922
|
+
label: "--no-fmt",
|
|
923
|
+
description: "Skip format check"
|
|
924
|
+
},
|
|
925
|
+
{
|
|
926
|
+
label: "--no-lint",
|
|
927
|
+
description: "Skip lint rules; type-check still runs when `lint.options.typeCheck` is true"
|
|
928
|
+
},
|
|
929
|
+
{
|
|
930
|
+
label: "--no-error-on-unmatched-pattern",
|
|
931
|
+
description: "Do not exit with error when pattern is unmatched"
|
|
932
|
+
},
|
|
933
|
+
{
|
|
934
|
+
label: "-h, --help",
|
|
935
|
+
description: "Print help"
|
|
936
|
+
}
|
|
937
|
+
]
|
|
938
|
+
},
|
|
939
|
+
{
|
|
940
|
+
title: "Examples",
|
|
941
|
+
lines: [
|
|
942
|
+
" vp check",
|
|
943
|
+
" vp check --fix",
|
|
944
|
+
" vp check --no-lint src/index.ts"
|
|
945
|
+
]
|
|
946
|
+
}
|
|
947
|
+
],
|
|
948
|
+
documentationUrl: "https://viteplus.dev/guide/check"
|
|
949
|
+
},
|
|
950
|
+
pack: {
|
|
951
|
+
usage: "vp pack [...FILES] [OPTIONS]",
|
|
952
|
+
summary: ["Build a library.", "Options are forwarded to Vite+ Pack."],
|
|
953
|
+
sections: [
|
|
954
|
+
{
|
|
955
|
+
title: "Arguments",
|
|
956
|
+
rows: [{
|
|
957
|
+
label: "[...FILES]",
|
|
958
|
+
description: "Files to bundle"
|
|
959
|
+
}]
|
|
960
|
+
},
|
|
961
|
+
{
|
|
962
|
+
title: "Options",
|
|
963
|
+
rows: [
|
|
964
|
+
{
|
|
965
|
+
label: "-f, --format <FORMAT>",
|
|
966
|
+
description: "Bundle format: esm, cjs, iife, umd (default: esm)"
|
|
967
|
+
},
|
|
968
|
+
{
|
|
969
|
+
label: "--clean",
|
|
970
|
+
description: "Clean output directory, --no-clean to disable"
|
|
971
|
+
},
|
|
972
|
+
{
|
|
973
|
+
label: "--deps.never-bundle <MODULE>",
|
|
974
|
+
description: "Mark dependencies as external"
|
|
975
|
+
},
|
|
976
|
+
{
|
|
977
|
+
label: "--minify",
|
|
978
|
+
description: "Minify output"
|
|
979
|
+
},
|
|
980
|
+
{
|
|
981
|
+
label: "--devtools",
|
|
982
|
+
description: "Enable devtools integration"
|
|
983
|
+
},
|
|
984
|
+
{
|
|
985
|
+
label: "--debug [FEAT]",
|
|
986
|
+
description: "Show debug logs"
|
|
987
|
+
},
|
|
988
|
+
{
|
|
989
|
+
label: "--target <TARGET>",
|
|
990
|
+
description: "Bundle target, e.g \"es2015\", \"esnext\""
|
|
991
|
+
},
|
|
992
|
+
{
|
|
993
|
+
label: "-l, --logLevel <LEVEL>",
|
|
994
|
+
description: "Set log level: info, warn, error, silent"
|
|
995
|
+
},
|
|
996
|
+
{
|
|
997
|
+
label: "--fail-on-warn",
|
|
998
|
+
description: "Fail on warnings (default: true)"
|
|
999
|
+
},
|
|
1000
|
+
{
|
|
1001
|
+
label: "--no-write",
|
|
1002
|
+
description: "Disable writing files to disk, incompatible with watch mode (default: true)"
|
|
1003
|
+
},
|
|
1004
|
+
{
|
|
1005
|
+
label: "-d, --out-dir <DIR>",
|
|
1006
|
+
description: "Output directory (default: dist)"
|
|
1007
|
+
},
|
|
1008
|
+
{
|
|
1009
|
+
label: "--treeshake",
|
|
1010
|
+
description: "Tree-shake bundle (default: true)"
|
|
1011
|
+
},
|
|
1012
|
+
{
|
|
1013
|
+
label: "--sourcemap",
|
|
1014
|
+
description: "Generate source map (default: false)"
|
|
1015
|
+
},
|
|
1016
|
+
{
|
|
1017
|
+
label: "--shims",
|
|
1018
|
+
description: "Enable cjs and esm shims (default: false)"
|
|
1019
|
+
},
|
|
1020
|
+
{
|
|
1021
|
+
label: "--platform <PLATFORM>",
|
|
1022
|
+
description: "Target platform (default: node)"
|
|
1023
|
+
},
|
|
1024
|
+
{
|
|
1025
|
+
label: "--dts",
|
|
1026
|
+
description: "Generate dts files"
|
|
1027
|
+
},
|
|
1028
|
+
{
|
|
1029
|
+
label: "--publint",
|
|
1030
|
+
description: "Enable publint (default: false)"
|
|
1031
|
+
},
|
|
1032
|
+
{
|
|
1033
|
+
label: "--attw",
|
|
1034
|
+
description: "Enable Are the types wrong integration (default: false)"
|
|
1035
|
+
},
|
|
1036
|
+
{
|
|
1037
|
+
label: "--unused",
|
|
1038
|
+
description: "Enable unused dependencies check (default: false)"
|
|
1039
|
+
},
|
|
1040
|
+
{
|
|
1041
|
+
label: "-w, --watch [PATH]",
|
|
1042
|
+
description: "Watch mode"
|
|
1043
|
+
},
|
|
1044
|
+
{
|
|
1045
|
+
label: "--ignore-watch <PATH>",
|
|
1046
|
+
description: "Ignore custom paths in watch mode"
|
|
1047
|
+
},
|
|
1048
|
+
{
|
|
1049
|
+
label: "--from-vite [VITEST]",
|
|
1050
|
+
description: "Reuse config from Vite or Vitest"
|
|
1051
|
+
},
|
|
1052
|
+
{
|
|
1053
|
+
label: "--report",
|
|
1054
|
+
description: "Size report (default: true)"
|
|
1055
|
+
},
|
|
1056
|
+
{
|
|
1057
|
+
label: "--env.* <VALUE>",
|
|
1058
|
+
description: "Define compile-time env variables"
|
|
1059
|
+
},
|
|
1060
|
+
{
|
|
1061
|
+
label: "--env-file <FILE>",
|
|
1062
|
+
description: "Load environment variables from a file, when used together with --env, variables in --env take precedence"
|
|
1063
|
+
},
|
|
1064
|
+
{
|
|
1065
|
+
label: "--env-prefix <PREFIX>",
|
|
1066
|
+
description: "Prefix for env variables to inject into the bundle (default: VITE_PACK_,TSDOWN_)"
|
|
1067
|
+
},
|
|
1068
|
+
{
|
|
1069
|
+
label: "--on-success <COMMAND>",
|
|
1070
|
+
description: "Command to run on success"
|
|
1071
|
+
},
|
|
1072
|
+
{
|
|
1073
|
+
label: "--copy <DIR>",
|
|
1074
|
+
description: "Copy files to output dir"
|
|
1075
|
+
},
|
|
1076
|
+
{
|
|
1077
|
+
label: "--public-dir <DIR>",
|
|
1078
|
+
description: "Alias for --copy, deprecated"
|
|
1079
|
+
},
|
|
1080
|
+
{
|
|
1081
|
+
label: "--tsconfig <TSCONFIG>",
|
|
1082
|
+
description: "Set tsconfig path"
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
label: "--unbundle",
|
|
1086
|
+
description: "Unbundle mode"
|
|
1087
|
+
},
|
|
1088
|
+
{
|
|
1089
|
+
label: "--root <DIR>",
|
|
1090
|
+
description: "Root directory of input files"
|
|
1091
|
+
},
|
|
1092
|
+
{
|
|
1093
|
+
label: "--exe",
|
|
1094
|
+
description: "Bundle as executable"
|
|
1095
|
+
},
|
|
1096
|
+
{
|
|
1097
|
+
label: "-W, --workspace [DIR]",
|
|
1098
|
+
description: "Enable workspace mode"
|
|
1099
|
+
},
|
|
1100
|
+
{
|
|
1101
|
+
label: "--concurrency <COUNT>",
|
|
1102
|
+
description: "Maximum number of Rolldown builds to run in parallel"
|
|
1103
|
+
},
|
|
1104
|
+
{
|
|
1105
|
+
label: "-F, --filter <PATTERN>",
|
|
1106
|
+
description: "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name"
|
|
1107
|
+
},
|
|
1108
|
+
{
|
|
1109
|
+
label: "--exports",
|
|
1110
|
+
description: "Generate export-related metadata for package.json (experimental)"
|
|
1111
|
+
},
|
|
1112
|
+
{
|
|
1113
|
+
label: "-h, --help",
|
|
1114
|
+
description: "Display this message"
|
|
1115
|
+
}
|
|
1116
|
+
]
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
title: "Examples",
|
|
1120
|
+
lines: [
|
|
1121
|
+
" vp pack",
|
|
1122
|
+
" vp pack src/index.ts --dts",
|
|
1123
|
+
" vp pack --watch"
|
|
1124
|
+
]
|
|
1125
|
+
}
|
|
1126
|
+
],
|
|
1127
|
+
documentationUrl: "https://viteplus.dev/guide/pack"
|
|
1128
|
+
},
|
|
1129
|
+
run: {
|
|
1130
|
+
usage: "vp run [OPTIONS] [TASK_SPECIFIER] [ADDITIONAL_ARGS]...",
|
|
1131
|
+
summary: "Run tasks.",
|
|
1132
|
+
sections: [
|
|
1133
|
+
{
|
|
1134
|
+
title: "Arguments",
|
|
1135
|
+
rows: [{
|
|
1136
|
+
label: "[TASK_SPECIFIER]",
|
|
1137
|
+
description: "`packageName#taskName` or `taskName`. If omitted, shows the task selector"
|
|
1138
|
+
}, {
|
|
1139
|
+
label: "[ADDITIONAL_ARGS]...",
|
|
1140
|
+
description: "Additional arguments to pass to the task"
|
|
1141
|
+
}]
|
|
1142
|
+
},
|
|
1143
|
+
{
|
|
1144
|
+
title: "Options",
|
|
1145
|
+
rows: [
|
|
1146
|
+
{
|
|
1147
|
+
label: "-r, --recursive",
|
|
1148
|
+
description: "Select all packages in the workspace"
|
|
1149
|
+
},
|
|
1150
|
+
{
|
|
1151
|
+
label: "-t, --transitive",
|
|
1152
|
+
description: "Select the current package and its transitive dependencies"
|
|
1153
|
+
},
|
|
1154
|
+
{
|
|
1155
|
+
label: "-w, --workspace-root",
|
|
1156
|
+
description: "Select the workspace root package"
|
|
1157
|
+
},
|
|
1158
|
+
{
|
|
1159
|
+
label: "-F, --filter <FILTERS>",
|
|
1160
|
+
description: "Match packages by name, directory, or glob pattern"
|
|
1161
|
+
},
|
|
1162
|
+
{
|
|
1163
|
+
label: "--fail-if-no-match",
|
|
1164
|
+
description: "Exit with a non-zero status if a filter matches no packages"
|
|
1165
|
+
},
|
|
1166
|
+
{
|
|
1167
|
+
label: "--ignore-depends-on",
|
|
1168
|
+
description: "Do not run dependencies specified in `dependsOn` fields"
|
|
1169
|
+
},
|
|
1170
|
+
{
|
|
1171
|
+
label: "-v, --verbose",
|
|
1172
|
+
description: "Show the full detailed summary after execution"
|
|
1173
|
+
},
|
|
1174
|
+
{
|
|
1175
|
+
label: "--cache",
|
|
1176
|
+
description: "Force caching on for all tasks and scripts"
|
|
1177
|
+
},
|
|
1178
|
+
{
|
|
1179
|
+
label: "--no-cache",
|
|
1180
|
+
description: "Force caching off for all tasks and scripts"
|
|
1181
|
+
},
|
|
1182
|
+
{
|
|
1183
|
+
label: "--log <MODE>",
|
|
1184
|
+
description: "Set output mode: interleaved (default), labeled, or grouped"
|
|
1185
|
+
},
|
|
1186
|
+
{
|
|
1187
|
+
label: "--concurrency-limit <N>",
|
|
1188
|
+
description: "Maximum number of tasks to run concurrently (default: 4)"
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
label: "--parallel",
|
|
1192
|
+
description: "Run tasks without dependency ordering; concurrency is unlimited unless `--concurrency-limit` is specified"
|
|
1193
|
+
},
|
|
1194
|
+
{
|
|
1195
|
+
label: "--last-details",
|
|
1196
|
+
description: "Display the detailed summary of the last run"
|
|
1197
|
+
},
|
|
1198
|
+
{
|
|
1199
|
+
label: "-h, --help",
|
|
1200
|
+
description: "Print help"
|
|
1201
|
+
}
|
|
1202
|
+
]
|
|
1203
|
+
},
|
|
1204
|
+
{
|
|
1205
|
+
title: "Filter Patterns",
|
|
1206
|
+
lines: [
|
|
1207
|
+
" --filter <pattern> Select by package name (e.g. foo, @scope/*)",
|
|
1208
|
+
" --filter ./<dir> Select packages under a directory",
|
|
1209
|
+
" --filter {<dir>} Same as ./<dir>, but allows traversal suffixes",
|
|
1210
|
+
" --filter <pattern>... Select package and its dependencies",
|
|
1211
|
+
" --filter ...<pattern> Select package and its dependents",
|
|
1212
|
+
" --filter <pattern>^... Select only the dependencies (exclude the package itself)",
|
|
1213
|
+
" --filter !<pattern> Exclude packages matching the pattern"
|
|
1214
|
+
]
|
|
1215
|
+
}
|
|
1216
|
+
],
|
|
1217
|
+
documentationUrl: "https://viteplus.dev/guide/run"
|
|
1218
|
+
},
|
|
1219
|
+
exec: {
|
|
1220
|
+
usage: "vp exec [OPTIONS] [COMMAND]...",
|
|
1221
|
+
summary: "Execute a command from local node_modules/.bin.",
|
|
1222
|
+
sections: [
|
|
1223
|
+
{
|
|
1224
|
+
title: "Arguments",
|
|
1225
|
+
rows: [{
|
|
1226
|
+
label: "[COMMAND]...",
|
|
1227
|
+
description: "Command and arguments to execute"
|
|
1228
|
+
}]
|
|
1229
|
+
},
|
|
1230
|
+
{
|
|
1231
|
+
title: "Options",
|
|
1232
|
+
rows: [
|
|
1233
|
+
{
|
|
1234
|
+
label: "-r, --recursive",
|
|
1235
|
+
description: "Select all packages in the workspace"
|
|
1236
|
+
},
|
|
1237
|
+
{
|
|
1238
|
+
label: "-t, --transitive",
|
|
1239
|
+
description: "Select the current package and its transitive dependencies"
|
|
1240
|
+
},
|
|
1241
|
+
{
|
|
1242
|
+
label: "-w, --workspace-root",
|
|
1243
|
+
description: "Select the workspace root package"
|
|
1244
|
+
},
|
|
1245
|
+
{
|
|
1246
|
+
label: "-F, --filter <FILTERS>",
|
|
1247
|
+
description: "Match packages by name, directory, or glob pattern"
|
|
1248
|
+
},
|
|
1249
|
+
{
|
|
1250
|
+
label: "--fail-if-no-match",
|
|
1251
|
+
description: ["Exit with a non-zero status if a `--filter` expression matches no packages", "Without this flag, unmatched filters only warn and exit successfully"]
|
|
1252
|
+
},
|
|
1253
|
+
{
|
|
1254
|
+
label: "-c, --shell-mode",
|
|
1255
|
+
description: "Execute the command within a shell environment"
|
|
1256
|
+
},
|
|
1257
|
+
{
|
|
1258
|
+
label: "--parallel",
|
|
1259
|
+
description: "Run concurrently without topological ordering"
|
|
1260
|
+
},
|
|
1261
|
+
{
|
|
1262
|
+
label: "--reverse",
|
|
1263
|
+
description: "Reverse execution order"
|
|
1264
|
+
},
|
|
1265
|
+
{
|
|
1266
|
+
label: "--resume-from <PACKAGE>",
|
|
1267
|
+
description: "Resume from a specific package"
|
|
1268
|
+
},
|
|
1269
|
+
{
|
|
1270
|
+
label: "--report-summary",
|
|
1271
|
+
description: "Save results to vp-exec-summary.json"
|
|
1272
|
+
},
|
|
1273
|
+
{
|
|
1274
|
+
label: "-h, --help",
|
|
1275
|
+
description: "Print help"
|
|
1276
|
+
}
|
|
1277
|
+
]
|
|
1278
|
+
},
|
|
1279
|
+
{
|
|
1280
|
+
title: "Filter Patterns",
|
|
1281
|
+
lines: [
|
|
1282
|
+
" --filter <pattern> Select by package name (e.g. foo, @scope/*)",
|
|
1283
|
+
" --filter ./<dir> Select packages under a directory",
|
|
1284
|
+
" --filter {<dir>} Same as ./<dir>, but allows traversal suffixes",
|
|
1285
|
+
" --filter <pattern>... Select package and its dependencies",
|
|
1286
|
+
" --filter ...<pattern> Select package and its dependents",
|
|
1287
|
+
" --filter <pattern>^... Select only the dependencies (exclude the package itself)",
|
|
1288
|
+
" --filter !<pattern> Exclude packages matching the pattern"
|
|
1289
|
+
]
|
|
1290
|
+
},
|
|
1291
|
+
{
|
|
1292
|
+
title: "Examples",
|
|
1293
|
+
lines: [
|
|
1294
|
+
" vp exec node --version # Run local node",
|
|
1295
|
+
" vp exec tsc --noEmit # Run local TypeScript compiler",
|
|
1296
|
+
" vp exec -c 'tsc --noEmit && prettier --check .' # Shell mode",
|
|
1297
|
+
" vp exec -r -- tsc --noEmit # Run in all workspace packages",
|
|
1298
|
+
" vp exec --filter 'app...' -- tsc # Run in filtered packages"
|
|
1299
|
+
]
|
|
1300
|
+
}
|
|
1301
|
+
],
|
|
1302
|
+
documentationUrl: "https://viteplus.dev/guide/vpx"
|
|
1303
|
+
},
|
|
1304
|
+
cache: {
|
|
1305
|
+
usage: "vp cache <COMMAND>",
|
|
1306
|
+
summary: "Manage the task cache.",
|
|
1307
|
+
sections: [{
|
|
1308
|
+
title: "Commands",
|
|
1309
|
+
rows: [{
|
|
1310
|
+
label: "clean",
|
|
1311
|
+
description: "Clean up all the cache"
|
|
1312
|
+
}]
|
|
1313
|
+
}, {
|
|
1314
|
+
title: "Options",
|
|
1315
|
+
rows: [{
|
|
1316
|
+
label: "-h, --help",
|
|
1317
|
+
description: "Print help"
|
|
1318
|
+
}]
|
|
1319
|
+
}],
|
|
1320
|
+
documentationUrl: "https://viteplus.dev/guide/cache"
|
|
1321
|
+
}
|
|
1322
|
+
};
|
|
1323
|
+
function maybePrintCommandHelp(args) {
|
|
1324
|
+
const command = args[0] === "format" ? "fmt" : args[0];
|
|
1325
|
+
const doc = commandHelpDocs[command];
|
|
1326
|
+
if (!doc) return false;
|
|
1327
|
+
const commandArgs = args.slice(1);
|
|
1328
|
+
const terminatorIndex = commandArgs.indexOf("--");
|
|
1329
|
+
if (!(terminatorIndex === -1 ? commandArgs : commandArgs.slice(0, terminatorIndex)).some((arg) => arg === "-h" || arg === "--help")) return false;
|
|
1330
|
+
if (command === "run" || command === "exec" || command === "cache") {
|
|
1331
|
+
if (commandArgs.length !== 1) return false;
|
|
1332
|
+
}
|
|
1333
|
+
printHeader();
|
|
1334
|
+
log(renderCliDoc(doc));
|
|
1335
|
+
return true;
|
|
1336
|
+
}
|
|
1337
|
+
//#endregion
|
|
11
1338
|
//#region src/resolve-fmt.ts
|
|
12
1339
|
/**
|
|
13
1340
|
* Oxfmt tool resolver for the vite-plus CLI.
|
|
@@ -32,8 +1359,9 @@ import { fileURLToPath } from "node:url";
|
|
|
32
1359
|
* including Node.js version information and package manager details.
|
|
33
1360
|
*/
|
|
34
1361
|
async function fmt() {
|
|
1362
|
+
const oxfmtMainPath = resolve$1("oxfmt");
|
|
35
1363
|
return {
|
|
36
|
-
binPath: join(dirname(dirname(
|
|
1364
|
+
binPath: join(dirname(dirname(oxfmtMainPath)), "bin", "oxfmt"),
|
|
37
1365
|
envs: {
|
|
38
1366
|
...DEFAULT_ENVS,
|
|
39
1367
|
[CONFIG_METADATA_ENV]: "1"
|
|
@@ -266,7 +1594,9 @@ async function doc() {
|
|
|
266
1594
|
* including Node.js version information and package manager details.
|
|
267
1595
|
*/
|
|
268
1596
|
async function lint() {
|
|
269
|
-
const
|
|
1597
|
+
const oxlintMainPath = resolve$1("oxlint");
|
|
1598
|
+
const oxlintPackageRoot = dirname(dirname(oxlintMainPath));
|
|
1599
|
+
const binPath = join(oxlintPackageRoot, "bin", "oxlint");
|
|
270
1600
|
const oxlintTsgolintPath = resolveTsgolintExecutable(resolve$1("oxlint-tsgolint/bin/tsgolint"), import.meta.url);
|
|
271
1601
|
return {
|
|
272
1602
|
binPath,
|
|
@@ -369,8 +1699,9 @@ async function test() {
|
|
|
369
1699
|
* It constructs the path to the CLI binary within the resolved package.
|
|
370
1700
|
*/
|
|
371
1701
|
async function vite() {
|
|
1702
|
+
const vitePackagePath = dirname(resolve$1("@voidzero-dev/vite-plus-core"));
|
|
372
1703
|
return {
|
|
373
|
-
binPath: join(
|
|
1704
|
+
binPath: join(vitePackagePath, "cli.js"),
|
|
374
1705
|
envs: process.env.DEBUG_DISABLE_SOURCE_MAP ? {
|
|
375
1706
|
...DEFAULT_ENVS,
|
|
376
1707
|
DEBUG_DISABLE_SOURCE_MAP: process.env.DEBUG_DISABLE_SOURCE_MAP
|
|
@@ -399,6 +1730,31 @@ function getErrorMessage(err) {
|
|
|
399
1730
|
return String(err);
|
|
400
1731
|
}
|
|
401
1732
|
let args = process.argv.slice(2);
|
|
1733
|
+
if (args[0]?.startsWith("-C")) {
|
|
1734
|
+
const inline = args[0].length > 2;
|
|
1735
|
+
const dir = inline ? args[0].slice(args[0][2] === "=" ? 3 : 2) : args[1];
|
|
1736
|
+
if (!dir) {
|
|
1737
|
+
errorMsg("-C requires a directory argument");
|
|
1738
|
+
process.exit(1);
|
|
1739
|
+
}
|
|
1740
|
+
const target = path.resolve(dir);
|
|
1741
|
+
try {
|
|
1742
|
+
process.chdir(target);
|
|
1743
|
+
} catch (err) {
|
|
1744
|
+
const code = typeof err === "object" && err !== null && "code" in err ? err.code : void 0;
|
|
1745
|
+
if (code === "ENOENT" || code === "ENOTDIR") errorMsg(`directory not found: ${dir}`);
|
|
1746
|
+
else errorMsg(`cannot change directory to ${dir}: ${getErrorMessage(err)}`);
|
|
1747
|
+
process.exit(1);
|
|
1748
|
+
}
|
|
1749
|
+
if (process.platform !== "win32") process.env.PWD = target;
|
|
1750
|
+
args = args.slice(inline ? 1 : 2);
|
|
1751
|
+
process.argv = process.argv.slice(0, 2).concat(args);
|
|
1752
|
+
}
|
|
1753
|
+
if (path.basename(process.argv[1] ?? "") === "vpr") {
|
|
1754
|
+
args = ["run", ...args];
|
|
1755
|
+
process.argv = process.argv.slice(0, 2).concat(args);
|
|
1756
|
+
}
|
|
1757
|
+
const rustCliArgs = args;
|
|
402
1758
|
if (args[0] === "help" && args[1]) {
|
|
403
1759
|
args = [
|
|
404
1760
|
args[1],
|
|
@@ -408,7 +1764,7 @@ if (args[0] === "help" && args[1]) {
|
|
|
408
1764
|
process.argv = process.argv.slice(0, 2).concat(args);
|
|
409
1765
|
}
|
|
410
1766
|
const command = args[0];
|
|
411
|
-
if (command === "create") await import("./create/bin.js");
|
|
1767
|
+
if (maybePrintCommandHelp(args)) {} else if (command === "create") await import("./create/bin.js");
|
|
412
1768
|
else if (command === "migrate") await import("./migration/bin.js");
|
|
413
1769
|
else if (command === "config") await import("./config/bin.js");
|
|
414
1770
|
else if (command === "--version" || command === "-V") await import("./version.js");
|
|
@@ -427,7 +1783,7 @@ else try {
|
|
|
427
1783
|
test,
|
|
428
1784
|
doc,
|
|
429
1785
|
resolveUniversalViteConfig,
|
|
430
|
-
args:
|
|
1786
|
+
args: rustCliArgs
|
|
431
1787
|
});
|
|
432
1788
|
let finalExitCode = exitCode;
|
|
433
1789
|
if (exitCode === 0) try {
|