vite-plus 0.2.8 → 0.2.9
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 +7 -0
- package/README.md +9 -3
- package/binding/index.cjs +54 -54
- package/binding/index.d.cts +7 -3
- package/dist/{agent-CI79DuSy.js → agent-DQU8uS6P.js} +4 -188
- package/dist/bin.js +288 -278
- package/dist/config/bin.js +27 -15
- package/dist/{constants-BppDcRc1.js → constants-CG513DRa.js} +10 -2
- package/dist/create/bin.js +178 -204
- package/dist/{define-config-DPnHe1Mx.js → define-config-CV4bQG_8.js} +3 -3
- package/dist/{define-config-CEm_MtvJ.cjs → define-config-DyNLA_f0.cjs} +1 -1
- package/dist/define-config.cjs +1 -1
- package/dist/define-config.js +1 -1
- package/dist/{dist-CSQWHI6y.js → dist-BDYZP12R.js} +193 -149
- package/dist/dist-Dqv1-Clg.js +3 -0
- package/dist/{editor-CGWdbLgD.js → editor-g4PosU99.js} +188 -108
- package/dist/hooks/bin.d.ts +1 -0
- package/dist/hooks/bin.js +130 -0
- package/dist/hooks-pNCBWtFT.js +570 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{json-BU88uu6o.js → json-qlK6UH0r.js} +38 -32
- package/dist/migration/bin.js +15 -18
- package/dist/{oxlint-plugin-config-BHOzlwMw.js → oxlint-plugin-config-BEZ9IUf7.js} +1 -1
- package/dist/oxlint-plugin.js +1 -1
- package/dist/pack-bin.js +1 -1
- package/dist/{package-hV-77cBb.js → package-B4T8RGMG.js} +2 -2
- package/dist/{prompts-DYap08te.js → prompts-CHz_98bJ.js} +142 -50
- package/dist/{resolve-vite-config-EWXclqvV.js → resolve-vite-config-Dmeyeyj-.js} +2 -9
- package/dist/staged/bin.js +224 -206
- package/dist/{terminal-CrqqK8WT.js → terminal-Bz-ps6rJ.js} +33 -3
- package/dist/test/browser/providers/playwright/context.d.ts +1 -1
- package/dist/test/browser/providers/playwright.d.ts +6 -6
- package/dist/test/browser/providers/preview/context.d.ts +1 -1
- package/dist/test/browser/providers/preview.d.ts +4 -4
- package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
- package/dist/test/browser/providers/webdriverio.d.ts +6 -6
- package/dist/test/browser-playwright/context.d.ts +1 -1
- package/dist/test/browser-playwright.d.ts +6 -6
- package/dist/test/browser-preview/context.d.ts +1 -1
- package/dist/test/browser-preview.d.ts +4 -4
- package/dist/test/browser-webdriverio/context.d.ts +1 -1
- package/dist/test/browser-webdriverio.d.ts +6 -6
- package/dist/test/context.d.ts +3 -3
- package/dist/test/locators.d.ts +1 -1
- package/dist/toolchain.d.ts +25 -0
- package/dist/toolchain.js +194 -0
- package/dist/toolchain.json +193 -0
- package/dist/{tsconfig-CVUKLfL8.js → tsconfig-7v_BHagU.js} +3 -3
- package/dist/tsgolint-path.js +1 -1
- package/dist/version.js +4 -4
- package/dist/versions.d.ts +3 -3
- package/dist/versions.js +6 -6
- package/docs/guide/ci.md +37 -4
- package/docs/guide/commit-hooks.md +87 -14
- package/docs/guide/create.md +7 -4
- package/docs/guide/fmt.md +2 -2
- package/docs/guide/github-actions-cache.md +5 -1
- package/docs/guide/ide-integration.md +61 -2
- package/docs/guide/index.md +3 -1
- package/docs/guide/install.md +25 -0
- package/docs/guide/installer-env-vars.md +12 -1
- package/docs/guide/lint.md +3 -1
- package/docs/guide/migrate.md +39 -2
- package/docs/guide/monorepo.md +4 -4
- package/docs/guide/troubleshooting.md +12 -4
- package/docs/guide/upgrade.md +27 -4
- package/docs/package.json +1 -1
- package/docs/pnpm-workspace.yaml +7 -0
- package/docs/vite.config.ts +3 -0
- package/package.json +18 -14
- package/rules/vite-tools.yml +0 -7
- package/dist/dist-DT25H9pj.js +0 -3
- package/dist/{tsgolint-path-eMZT-oea.js → tsgolint-path-CbDReEOx.js} +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-
|
|
4
|
-
import { M as runCommandSilently } from "./prompts-
|
|
5
|
-
import { i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-
|
|
6
|
-
import { t as resolveTsgolintExecutable } from "./tsgolint-path-
|
|
7
|
-
import { i as resolveUniversalViteConfig } from "./resolve-vite-config-
|
|
1
|
+
import { c as warnMsg, i as log, l as renderCliDoc, n as errorMsg, o as printHeader, t as accent } from "./terminal-Bz-ps6rJ.js";
|
|
2
|
+
import { c as VITE_PLUS_NAME, i as DEFAULT_ENVS, m as resolveBundled, n as BASEURL_TSCONFIG_WARNING, p as resolve$1, r as CONFIG_METADATA_ENV, s as VITE_CONFIG_FILES } from "./constants-CG513DRa.js";
|
|
3
|
+
import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BEZ9IUf7.js";
|
|
4
|
+
import { M as runCommandSilently } from "./prompts-CHz_98bJ.js";
|
|
5
|
+
import { i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-7v_BHagU.js";
|
|
6
|
+
import { t as resolveTsgolintExecutable } from "./tsgolint-path-CbDReEOx.js";
|
|
7
|
+
import { i as resolveUniversalViteConfig } from "./resolve-vite-config-Dmeyeyj-.js";
|
|
8
8
|
import path, { dirname, join } from "node:path";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
9
10
|
import { ensureBlockingStdio, hasConfigKey, mergeJsonConfig, run } from "../binding/index.js";
|
|
10
11
|
import fs, { readFileSync } from "node:fs";
|
|
11
|
-
import { fileURLToPath } from "node:url";
|
|
12
12
|
//#region src/help.ts
|
|
13
13
|
const commandHelpDocs = {
|
|
14
14
|
dev: {
|
|
@@ -26,60 +26,60 @@ const commandHelpDocs = {
|
|
|
26
26
|
title: "Options",
|
|
27
27
|
rows: [
|
|
28
28
|
{
|
|
29
|
-
label: "--host [
|
|
30
|
-
description: "
|
|
29
|
+
label: "--host [host]",
|
|
30
|
+
description: "[string] specify hostname"
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
|
-
label: "--port <
|
|
34
|
-
description: "
|
|
33
|
+
label: "--port <port>",
|
|
34
|
+
description: "[number] specify port"
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
|
-
label: "--open [
|
|
38
|
-
description: "
|
|
37
|
+
label: "--open [path]",
|
|
38
|
+
description: "[boolean | string] open browser on startup"
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
label: "--cors",
|
|
42
|
-
description: "
|
|
42
|
+
description: "[boolean] enable CORS"
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
label: "--strictPort",
|
|
46
|
-
description: "
|
|
46
|
+
description: "[boolean] exit if specified port is already in use"
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
49
|
label: "--force",
|
|
50
|
-
description: "
|
|
50
|
+
description: "[boolean] force the optimizer to ignore the cache and re-bundle"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
53
53
|
label: "--experimentalBundle",
|
|
54
|
-
description: "
|
|
54
|
+
description: "[boolean] use experimental full bundle mode (this is highly experimental)"
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
|
-
label: "--base <
|
|
58
|
-
description: "
|
|
57
|
+
label: "--base <path>",
|
|
58
|
+
description: "[string] public base path (default: /)"
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
|
-
label: "-l, --logLevel <
|
|
62
|
-
description: "
|
|
61
|
+
label: "-l, --logLevel <level>",
|
|
62
|
+
description: "[string] info | warn | error | silent"
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
label: "--clearScreen",
|
|
66
|
-
description: "
|
|
66
|
+
description: "[boolean] allow/disable clear screen when logging"
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
|
-
label: "-d, --debug [
|
|
70
|
-
description: "
|
|
69
|
+
label: "-d, --debug [feat]",
|
|
70
|
+
description: "[string | boolean] show debug logs"
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
|
-
label: "-f, --filter <
|
|
74
|
-
description: "
|
|
73
|
+
label: "-f, --filter <filter>",
|
|
74
|
+
description: "[string] filter debug logs"
|
|
75
75
|
},
|
|
76
76
|
{
|
|
77
|
-
label: "-m, --mode <
|
|
78
|
-
description: "
|
|
77
|
+
label: "-m, --mode <mode>",
|
|
78
|
+
description: "[string] set env mode"
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
label: "-h, --help",
|
|
82
|
-
description: "
|
|
82
|
+
description: "Display this message"
|
|
83
83
|
}
|
|
84
84
|
]
|
|
85
85
|
},
|
|
@@ -109,80 +109,80 @@ const commandHelpDocs = {
|
|
|
109
109
|
title: "Options",
|
|
110
110
|
rows: [
|
|
111
111
|
{
|
|
112
|
-
label: "--target <
|
|
113
|
-
description: "
|
|
112
|
+
label: "--target <target>",
|
|
113
|
+
description: "[string] transpile target (default: 'baseline-widely-available')"
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
|
-
label: "--outDir <
|
|
117
|
-
description: "
|
|
116
|
+
label: "--outDir <dir>",
|
|
117
|
+
description: "[string] output directory (default: dist)"
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
|
-
label: "--assetsDir <
|
|
121
|
-
description: "
|
|
120
|
+
label: "--assetsDir <dir>",
|
|
121
|
+
description: "[string] directory under outDir to place assets in (default: assets)"
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
|
-
label: "--assetsInlineLimit <
|
|
125
|
-
description: "
|
|
124
|
+
label: "--assetsInlineLimit <number>",
|
|
125
|
+
description: "[number] static asset base64 inline threshold in bytes (default: 4096)"
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
|
-
label: "--ssr [
|
|
129
|
-
description: "
|
|
128
|
+
label: "--ssr [entry]",
|
|
129
|
+
description: "[string] build specified entry for server-side rendering"
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
|
-
label: "--sourcemap [
|
|
133
|
-
description: "
|
|
132
|
+
label: "--sourcemap [output]",
|
|
133
|
+
description: "[boolean | \"inline\" | \"hidden\"] output source maps for build (default: false)"
|
|
134
134
|
},
|
|
135
135
|
{
|
|
136
|
-
label: "--minify [
|
|
137
|
-
description: "
|
|
136
|
+
label: "--minify [minifier]",
|
|
137
|
+
description: "[boolean | \"oxc\" | \"terser\" | \"esbuild\"] enable/disable minification, or specify minifier to use (default: oxc)"
|
|
138
138
|
},
|
|
139
139
|
{
|
|
140
|
-
label: "--manifest [
|
|
141
|
-
description: "
|
|
140
|
+
label: "--manifest [name]",
|
|
141
|
+
description: "[boolean | string] emit build manifest json"
|
|
142
142
|
},
|
|
143
143
|
{
|
|
144
|
-
label: "--ssrManifest [
|
|
145
|
-
description: "
|
|
144
|
+
label: "--ssrManifest [name]",
|
|
145
|
+
description: "[boolean | string] emit ssr manifest json"
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
label: "--emptyOutDir",
|
|
149
|
-
description: "
|
|
149
|
+
description: "[boolean] force empty outDir when it's outside of root"
|
|
150
150
|
},
|
|
151
151
|
{
|
|
152
152
|
label: "-w, --watch",
|
|
153
|
-
description: "
|
|
153
|
+
description: "[boolean] rebuilds when modules have changed on disk"
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
label: "--app",
|
|
157
|
-
description: "
|
|
157
|
+
description: "[boolean] same as `builder: {}`"
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
|
-
label: "--base <
|
|
161
|
-
description: "
|
|
160
|
+
label: "--base <path>",
|
|
161
|
+
description: "[string] public base path (default: /)"
|
|
162
162
|
},
|
|
163
163
|
{
|
|
164
|
-
label: "-l, --logLevel <
|
|
165
|
-
description: "
|
|
164
|
+
label: "-l, --logLevel <level>",
|
|
165
|
+
description: "[string] info | warn | error | silent"
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
label: "--clearScreen",
|
|
169
|
-
description: "
|
|
169
|
+
description: "[boolean] allow/disable clear screen when logging"
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
|
-
label: "-d, --debug [
|
|
173
|
-
description: "
|
|
172
|
+
label: "-d, --debug [feat]",
|
|
173
|
+
description: "[string | boolean] show debug logs"
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
|
-
label: "-f, --filter <
|
|
177
|
-
description: "
|
|
176
|
+
label: "-f, --filter <filter>",
|
|
177
|
+
description: "[string] filter debug logs"
|
|
178
178
|
},
|
|
179
179
|
{
|
|
180
|
-
label: "-m, --mode <
|
|
181
|
-
description: "
|
|
180
|
+
label: "-m, --mode <mode>",
|
|
181
|
+
description: "[string] set env mode"
|
|
182
182
|
},
|
|
183
183
|
{
|
|
184
184
|
label: "-h, --help",
|
|
185
|
-
description: "
|
|
185
|
+
description: "Display this message"
|
|
186
186
|
}
|
|
187
187
|
]
|
|
188
188
|
},
|
|
@@ -212,52 +212,52 @@ const commandHelpDocs = {
|
|
|
212
212
|
title: "Options",
|
|
213
213
|
rows: [
|
|
214
214
|
{
|
|
215
|
-
label: "--host [
|
|
216
|
-
description: "
|
|
215
|
+
label: "--host [host]",
|
|
216
|
+
description: "[string] specify hostname"
|
|
217
217
|
},
|
|
218
218
|
{
|
|
219
|
-
label: "--port <
|
|
220
|
-
description: "
|
|
219
|
+
label: "--port <port>",
|
|
220
|
+
description: "[number] specify port"
|
|
221
221
|
},
|
|
222
222
|
{
|
|
223
223
|
label: "--strictPort",
|
|
224
|
-
description: "
|
|
224
|
+
description: "[boolean] exit if specified port is already in use"
|
|
225
225
|
},
|
|
226
226
|
{
|
|
227
|
-
label: "--open [
|
|
228
|
-
description: "
|
|
227
|
+
label: "--open [path]",
|
|
228
|
+
description: "[boolean | string] open browser on startup"
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
|
-
label: "--outDir <
|
|
232
|
-
description: "
|
|
231
|
+
label: "--outDir <dir>",
|
|
232
|
+
description: "[string] output directory (default: dist)"
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
|
-
label: "--base <
|
|
236
|
-
description: "
|
|
235
|
+
label: "--base <path>",
|
|
236
|
+
description: "[string] public base path (default: /)"
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
|
-
label: "-l, --logLevel <
|
|
240
|
-
description: "
|
|
239
|
+
label: "-l, --logLevel <level>",
|
|
240
|
+
description: "[string] info | warn | error | silent"
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
label: "--clearScreen",
|
|
244
|
-
description: "
|
|
244
|
+
description: "[boolean] allow/disable clear screen when logging"
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
|
-
label: "-d, --debug [
|
|
248
|
-
description: "
|
|
247
|
+
label: "-d, --debug [feat]",
|
|
248
|
+
description: "[string | boolean] show debug logs"
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
|
-
label: "-f, --filter <
|
|
252
|
-
description: "
|
|
251
|
+
label: "-f, --filter <filter>",
|
|
252
|
+
description: "[string] filter debug logs"
|
|
253
253
|
},
|
|
254
254
|
{
|
|
255
|
-
label: "-m, --mode <
|
|
256
|
-
description: "
|
|
255
|
+
label: "-m, --mode <mode>",
|
|
256
|
+
description: "[string] set env mode"
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
label: "-h, --help",
|
|
260
|
-
description: "
|
|
260
|
+
description: "Display this message"
|
|
261
261
|
}
|
|
262
262
|
]
|
|
263
263
|
},
|
|
@@ -312,11 +312,11 @@ const commandHelpDocs = {
|
|
|
312
312
|
title: "Options",
|
|
313
313
|
rows: [
|
|
314
314
|
{
|
|
315
|
-
label: "-r, --root <
|
|
315
|
+
label: "-r, --root <path>",
|
|
316
316
|
description: "Root path"
|
|
317
317
|
},
|
|
318
318
|
{
|
|
319
|
-
label: "-u, --update [
|
|
319
|
+
label: "-u, --update [type]",
|
|
320
320
|
description: "Update snapshot (accepts boolean, \"new\", \"all\" or \"none\")"
|
|
321
321
|
},
|
|
322
322
|
{
|
|
@@ -324,11 +324,11 @@ const commandHelpDocs = {
|
|
|
324
324
|
description: "Enable watch mode"
|
|
325
325
|
},
|
|
326
326
|
{
|
|
327
|
-
label: "-t, --testNamePattern <
|
|
327
|
+
label: "-t, --testNamePattern <pattern>",
|
|
328
328
|
description: "Run tests with full names matching the specified regexp pattern"
|
|
329
329
|
},
|
|
330
330
|
{
|
|
331
|
-
label: "--dir <
|
|
331
|
+
label: "--dir <path>",
|
|
332
332
|
description: "Base directory to scan for the test files"
|
|
333
333
|
},
|
|
334
334
|
{
|
|
@@ -340,72 +340,72 @@ const commandHelpDocs = {
|
|
|
340
340
|
description: "Open UI automatically (default: !process.env.CI)"
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
|
-
label: "--api [
|
|
344
|
-
description: "Specify server port
|
|
343
|
+
label: "--api [port]",
|
|
344
|
+
description: "Specify server port. Note if the port is already being used, Vite will automatically try the next available port so this may not be the actual port the server ends up listening on. If true will be set to 51204. Use '--help --api' for more info."
|
|
345
345
|
},
|
|
346
346
|
{
|
|
347
|
-
label: "--silent [
|
|
348
|
-
description: "Silent console output from tests. Use 'passed-only' to see logs from failing tests only"
|
|
347
|
+
label: "--silent [value]",
|
|
348
|
+
description: "Silent console output from tests. Use 'passed-only' to see logs from failing tests only."
|
|
349
349
|
},
|
|
350
350
|
{
|
|
351
351
|
label: "--hideSkippedTests",
|
|
352
352
|
description: "Hide logs for skipped tests"
|
|
353
353
|
},
|
|
354
354
|
{
|
|
355
|
-
label: "--reporter <
|
|
355
|
+
label: "--reporter <name>",
|
|
356
356
|
description: "Specify reporters (default, agent, minimal, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)"
|
|
357
357
|
},
|
|
358
358
|
{
|
|
359
|
-
label: "--outputFile <
|
|
360
|
-
description: "Write test results to a file
|
|
359
|
+
label: "--outputFile <filename/-s>",
|
|
360
|
+
description: "Write test results to a file when supporter reporter is also specified, use cac's dot notation for individual outputs of multiple reporters (example: --outputFile.tap=./tap.txt)"
|
|
361
361
|
},
|
|
362
362
|
{
|
|
363
363
|
label: "--coverage",
|
|
364
|
-
description: "Enable coverage
|
|
364
|
+
description: "Enable coverage report. Use '--help --coverage' for more info."
|
|
365
365
|
},
|
|
366
366
|
{
|
|
367
|
-
label: "--mode <
|
|
367
|
+
label: "--mode <name>",
|
|
368
368
|
description: "Override Vite mode (default: test or benchmark)"
|
|
369
369
|
},
|
|
370
370
|
{
|
|
371
371
|
label: "--isolate",
|
|
372
|
-
description: "Run every test file in isolation.
|
|
372
|
+
description: "Run every test file in isolation. To disable isolation, use --no-isolate (default: true)"
|
|
373
373
|
},
|
|
374
374
|
{
|
|
375
375
|
label: "--globals",
|
|
376
|
-
description: "Inject
|
|
376
|
+
description: "Inject apis globally"
|
|
377
377
|
},
|
|
378
378
|
{
|
|
379
379
|
label: "--dom",
|
|
380
380
|
description: "Mock browser API with happy-dom"
|
|
381
381
|
},
|
|
382
382
|
{
|
|
383
|
-
label: "--browser <
|
|
384
|
-
description: "Run tests in the browser
|
|
383
|
+
label: "--browser <name>",
|
|
384
|
+
description: "Run tests in the browser. Equivalent to --browser.enabled (default: false). Use '--help --browser' for more info."
|
|
385
385
|
},
|
|
386
386
|
{
|
|
387
|
-
label: "--pool <
|
|
388
|
-
description: "Specify pool
|
|
387
|
+
label: "--pool <pool>",
|
|
388
|
+
description: "Specify pool, if not running in the browser (default: forks)"
|
|
389
389
|
},
|
|
390
390
|
{
|
|
391
|
-
label: "--execArgv <
|
|
392
|
-
description: "Pass additional arguments to
|
|
391
|
+
label: "--execArgv <option>",
|
|
392
|
+
description: "Pass additional arguments to node process when spawning worker_threads or child_process."
|
|
393
393
|
},
|
|
394
394
|
{
|
|
395
|
-
label: "--vmMemoryLimit <
|
|
396
|
-
description: "Memory limit for VM pools"
|
|
395
|
+
label: "--vmMemoryLimit <limit>",
|
|
396
|
+
description: "Memory limit for VM pools. If you see memory leaks, try to tinker this value."
|
|
397
397
|
},
|
|
398
398
|
{
|
|
399
399
|
label: "--fileParallelism",
|
|
400
|
-
description: "
|
|
400
|
+
description: "Should all test files run in parallel. Use --no-file-parallelism to disable (default: true)"
|
|
401
401
|
},
|
|
402
402
|
{
|
|
403
|
-
label: "--maxWorkers <
|
|
403
|
+
label: "--maxWorkers <workers>",
|
|
404
404
|
description: "Maximum number or percentage of workers to run tests in"
|
|
405
405
|
},
|
|
406
406
|
{
|
|
407
|
-
label: "--environment <
|
|
408
|
-
description: "Specify runner environment (default: node)"
|
|
407
|
+
label: "--environment <name>",
|
|
408
|
+
description: "Specify runner environment, if not running in the browser (default: node)"
|
|
409
409
|
},
|
|
410
410
|
{
|
|
411
411
|
label: "--passWithNoTests",
|
|
@@ -413,67 +413,67 @@ const commandHelpDocs = {
|
|
|
413
413
|
},
|
|
414
414
|
{
|
|
415
415
|
label: "--logHeapUsage",
|
|
416
|
-
description: "Show the size of
|
|
416
|
+
description: "Show the size of heap for each test when running in node"
|
|
417
417
|
},
|
|
418
418
|
{
|
|
419
419
|
label: "--detectAsyncLeaks",
|
|
420
|
-
description: "Detect asynchronous resources leaking from test
|
|
420
|
+
description: "Detect asynchronous resources leaking from the test file (default: false)"
|
|
421
421
|
},
|
|
422
422
|
{
|
|
423
423
|
label: "--allowOnly",
|
|
424
|
-
description: "Allow tests and suites marked as only (default: !process.env.CI)"
|
|
424
|
+
description: "Allow tests and suites that are marked as only (default: !process.env.CI)"
|
|
425
425
|
},
|
|
426
426
|
{
|
|
427
427
|
label: "--dangerouslyIgnoreUnhandledErrors",
|
|
428
428
|
description: "Ignore any unhandled errors that occur"
|
|
429
429
|
},
|
|
430
430
|
{
|
|
431
|
-
label: "--shard <
|
|
432
|
-
description: "Test suite shard to execute in
|
|
431
|
+
label: "--shard <shards>",
|
|
432
|
+
description: "Test suite shard to execute in a format of <index>/<count>"
|
|
433
433
|
},
|
|
434
434
|
{
|
|
435
|
-
label: "--changed [
|
|
436
|
-
description: "Run tests affected by changed files (default: false)"
|
|
435
|
+
label: "--changed [since]",
|
|
436
|
+
description: "Run tests that are affected by the changed files (default: false)"
|
|
437
437
|
},
|
|
438
438
|
{
|
|
439
|
-
label: "--sequence <
|
|
440
|
-
description: "
|
|
439
|
+
label: "--sequence <options>",
|
|
440
|
+
description: "Options for how tests should be sorted. Use '--help --sequence' for more info."
|
|
441
441
|
},
|
|
442
442
|
{
|
|
443
|
-
label: "--inspect [[
|
|
443
|
+
label: "--inspect [[host:]port]",
|
|
444
444
|
description: "Enable Node.js inspector (default: 127.0.0.1:9229)"
|
|
445
445
|
},
|
|
446
446
|
{
|
|
447
|
-
label: "--inspectBrk [[
|
|
448
|
-
description: "Enable Node.js inspector and break before
|
|
447
|
+
label: "--inspectBrk [[host:]port]",
|
|
448
|
+
description: "Enable Node.js inspector and break before the test starts"
|
|
449
449
|
},
|
|
450
450
|
{
|
|
451
|
-
label: "--testTimeout <
|
|
452
|
-
description: "Default test
|
|
451
|
+
label: "--testTimeout <timeout>",
|
|
452
|
+
description: "Default timeout of a test in milliseconds (default: 5000). Use 0 to disable timeout completely."
|
|
453
453
|
},
|
|
454
454
|
{
|
|
455
|
-
label: "--hookTimeout <
|
|
456
|
-
description: "Default hook timeout in milliseconds (default: 10000
|
|
455
|
+
label: "--hookTimeout <timeout>",
|
|
456
|
+
description: "Default hook timeout in milliseconds (default: 10000). Use 0 to disable timeout completely."
|
|
457
457
|
},
|
|
458
458
|
{
|
|
459
|
-
label: "--bail <
|
|
460
|
-
description: "Stop test execution
|
|
459
|
+
label: "--bail <number>",
|
|
460
|
+
description: "Stop test execution when given number of tests have failed (default: 0)"
|
|
461
461
|
},
|
|
462
462
|
{
|
|
463
|
-
label: "--retry <
|
|
464
|
-
description: "Retry
|
|
463
|
+
label: "--retry <times>",
|
|
464
|
+
description: "Retry the test specific number of times if it fails (default: 0). Use '--help --retry' for more info."
|
|
465
465
|
},
|
|
466
466
|
{
|
|
467
|
-
label: "--diff <
|
|
468
|
-
description: "DiffOptions object or path to a module
|
|
467
|
+
label: "--diff <path>",
|
|
468
|
+
description: "DiffOptions object or a path to a module which exports DiffOptions object. Use '--help --diff' for more info."
|
|
469
469
|
},
|
|
470
470
|
{
|
|
471
|
-
label: "--exclude <
|
|
472
|
-
description: "Additional file globs to
|
|
471
|
+
label: "--exclude <glob>",
|
|
472
|
+
description: "Additional file globs to be excluded from test"
|
|
473
473
|
},
|
|
474
474
|
{
|
|
475
475
|
label: "--expandSnapshotDiff",
|
|
476
|
-
description: "Show
|
|
476
|
+
description: "Show full diff when snapshot fails"
|
|
477
477
|
},
|
|
478
478
|
{
|
|
479
479
|
label: "--disableConsoleIntercept",
|
|
@@ -481,31 +481,31 @@ const commandHelpDocs = {
|
|
|
481
481
|
},
|
|
482
482
|
{
|
|
483
483
|
label: "--typecheck",
|
|
484
|
-
description: "Enable typechecking alongside tests (default: false)"
|
|
484
|
+
description: "Enable typechecking alongside tests (default: false). Use '--help --typecheck' for more info."
|
|
485
485
|
},
|
|
486
486
|
{
|
|
487
|
-
label: "--project <
|
|
488
|
-
description: "
|
|
487
|
+
label: "--project <name>",
|
|
488
|
+
description: "The name of the project to run if you are using Vitest workspace feature. This can be repeated for multiple projects: --project=1 --project=2. You can also filter projects using wildcards like --project=packages*, and exclude projects with --project=!pattern."
|
|
489
489
|
},
|
|
490
490
|
{
|
|
491
|
-
label: "--slowTestThreshold <
|
|
492
|
-
description: "Threshold for a test or suite to be considered slow (default:
|
|
491
|
+
label: "--slowTestThreshold <threshold>",
|
|
492
|
+
description: "Threshold in milliseconds for a test or suite to be considered slow (default: 300)"
|
|
493
493
|
},
|
|
494
494
|
{
|
|
495
|
-
label: "--teardownTimeout <
|
|
496
|
-
description: "Default teardown
|
|
495
|
+
label: "--teardownTimeout <timeout>",
|
|
496
|
+
description: "Default timeout of a teardown function in milliseconds (default: 10000)"
|
|
497
497
|
},
|
|
498
498
|
{
|
|
499
499
|
label: "--cache",
|
|
500
|
-
description: "Enable cache"
|
|
500
|
+
description: "Enable cache. Use '--help --cache' for more info."
|
|
501
501
|
},
|
|
502
502
|
{
|
|
503
|
-
label: "--maxConcurrency <
|
|
504
|
-
description: "Maximum number of concurrent tests and suites (default: 5)"
|
|
503
|
+
label: "--maxConcurrency <number>",
|
|
504
|
+
description: "Maximum number of concurrent tests and suites during test file execution (default: 5)"
|
|
505
505
|
},
|
|
506
506
|
{
|
|
507
507
|
label: "--expect",
|
|
508
|
-
description: "
|
|
508
|
+
description: "Configuration options for expect() matches. Use '--help --expect' for more info."
|
|
509
509
|
},
|
|
510
510
|
{
|
|
511
511
|
label: "--printConsoleTrace",
|
|
@@ -516,8 +516,8 @@ const commandHelpDocs = {
|
|
|
516
516
|
description: "Collect test and suite locations in the location property"
|
|
517
517
|
},
|
|
518
518
|
{
|
|
519
|
-
label: "--attachmentsDir <
|
|
520
|
-
description: "
|
|
519
|
+
label: "--attachmentsDir <dir>",
|
|
520
|
+
description: "The directory where attachments from context.annotate are stored in (default: .vitest-attachments)"
|
|
521
521
|
},
|
|
522
522
|
{
|
|
523
523
|
label: "--run",
|
|
@@ -525,39 +525,39 @@ const commandHelpDocs = {
|
|
|
525
525
|
},
|
|
526
526
|
{
|
|
527
527
|
label: "--no-color",
|
|
528
|
-
description: "
|
|
528
|
+
description: "Removes colors from the console output (default: true)"
|
|
529
529
|
},
|
|
530
530
|
{
|
|
531
531
|
label: "--clearScreen",
|
|
532
|
-
description: "Clear
|
|
532
|
+
description: "Clear terminal screen when re-running tests during watch mode (default: true)"
|
|
533
533
|
},
|
|
534
534
|
{
|
|
535
535
|
label: "--standalone",
|
|
536
|
-
description: "Start Vitest without running tests
|
|
536
|
+
description: "Start Vitest without running tests. Tests will be running only on change. If browser mode is enabled, the UI will be opened automatically. This option is ignored when CLI file filters are passed. (default: false)"
|
|
537
537
|
},
|
|
538
538
|
{
|
|
539
|
-
label: "--mergeReports [
|
|
540
|
-
description: "
|
|
539
|
+
label: "--mergeReports [path]",
|
|
540
|
+
description: "Path to a blob reports directory. If this options is used, Vitest won't run any tests, it will only report previously recorded tests"
|
|
541
541
|
},
|
|
542
542
|
{
|
|
543
|
-
label: "--listTags [
|
|
544
|
-
description: "List available tags
|
|
543
|
+
label: "--listTags [type]",
|
|
544
|
+
description: "List all available tags instead of running tests. --list-tags=json will output tags in JSON format, unless there are no tags."
|
|
545
545
|
},
|
|
546
546
|
{
|
|
547
547
|
label: "--clearCache",
|
|
548
|
-
description: "Delete all Vitest caches without running tests"
|
|
548
|
+
description: "Delete all Vitest caches, including experimental.fsModuleCache, without running any tests. This will reduce the performance in the subsequent test run."
|
|
549
549
|
},
|
|
550
550
|
{
|
|
551
|
-
label: "--tagsFilter <
|
|
552
|
-
description: "Run only tests
|
|
551
|
+
label: "--tagsFilter <expression>",
|
|
552
|
+
description: "Run only tests with the specified tags. You can use logical operators && (and), || (or) and ! (not) to create complex expressions, see https://vitest.dev/guide/test-tags#syntax for more information."
|
|
553
553
|
},
|
|
554
554
|
{
|
|
555
555
|
label: "--strictTags",
|
|
556
|
-
description: "
|
|
556
|
+
description: "Should Vitest throw an error if test has a tag that is not defined in the config. (default: true)"
|
|
557
557
|
},
|
|
558
558
|
{
|
|
559
|
-
label: "--experimental <
|
|
560
|
-
description: "
|
|
559
|
+
label: "--experimental <features>",
|
|
560
|
+
description: "Experimental features.. Use '--help --experimental' for more info."
|
|
561
561
|
},
|
|
562
562
|
{
|
|
563
563
|
label: "-h, --help",
|
|
@@ -568,10 +568,10 @@ const commandHelpDocs = {
|
|
|
568
568
|
{
|
|
569
569
|
title: "Bench Options",
|
|
570
570
|
rows: [{
|
|
571
|
-
label: "--compare <
|
|
571
|
+
label: "--compare <filename>",
|
|
572
572
|
description: "Benchmark output file to compare against"
|
|
573
573
|
}, {
|
|
574
|
-
label: "--outputJson <
|
|
574
|
+
label: "--outputJson <filename>",
|
|
575
575
|
description: "Benchmark output file"
|
|
576
576
|
}]
|
|
577
577
|
},
|
|
@@ -579,20 +579,20 @@ const commandHelpDocs = {
|
|
|
579
579
|
title: "List Options",
|
|
580
580
|
rows: [
|
|
581
581
|
{
|
|
582
|
-
label: "--json [
|
|
583
|
-
description: "Print collected tests as JSON or write to a file (
|
|
582
|
+
label: "--json [true/path]",
|
|
583
|
+
description: "Print collected tests as JSON or write to a file (Default: false)"
|
|
584
584
|
},
|
|
585
585
|
{
|
|
586
586
|
label: "--filesOnly",
|
|
587
|
-
description: "Print only test files
|
|
587
|
+
description: "Print only test files with out the test cases"
|
|
588
588
|
},
|
|
589
589
|
{
|
|
590
590
|
label: "--staticParse",
|
|
591
|
-
description: "Parse files statically instead of running them (default: false)"
|
|
591
|
+
description: "Parse files statically instead of running them to collect tests (default: false)"
|
|
592
592
|
},
|
|
593
593
|
{
|
|
594
|
-
label: "--staticParseConcurrency <
|
|
595
|
-
description: "
|
|
594
|
+
label: "--staticParseConcurrency <limit>",
|
|
595
|
+
description: "How many tests to process at the same time (default: os.availableParallelism())"
|
|
596
596
|
}
|
|
597
597
|
]
|
|
598
598
|
},
|
|
@@ -612,94 +612,107 @@ const commandHelpDocs = {
|
|
|
612
612
|
summary: ["Lint code.", "Options are forwarded to Oxlint."],
|
|
613
613
|
sections: [
|
|
614
614
|
{
|
|
615
|
-
title: "
|
|
615
|
+
title: "Available positional items",
|
|
616
616
|
rows: [{
|
|
617
617
|
label: "[PATH]...",
|
|
618
|
-
description: "
|
|
618
|
+
description: "Single file, single path or list of paths"
|
|
619
619
|
}]
|
|
620
620
|
},
|
|
621
621
|
{
|
|
622
622
|
title: "Basic Configuration",
|
|
623
623
|
rows: [{
|
|
624
|
-
label: "--tsconfig
|
|
625
|
-
description: "Override the TypeScript config used for import resolution"
|
|
624
|
+
label: "--tsconfig=<./tsconfig.json>",
|
|
625
|
+
description: "Override the TypeScript config used for import resolution. Oxlint automatically discovers the relevant `tsconfig.json` for each file. Use this only when your project uses a non-standard tsconfig name or location."
|
|
626
626
|
}]
|
|
627
627
|
},
|
|
628
628
|
{
|
|
629
|
-
title: "
|
|
629
|
+
title: "Allowing / Denying Multiple Lints",
|
|
630
|
+
lines: [
|
|
631
|
+
" Accumulate rules and categories from left to right on the command-line.",
|
|
632
|
+
" For example `-D correctness -A no-debugger` or `-A all -D no-debugger`.",
|
|
633
|
+
" The categories are:",
|
|
634
|
+
" * `correctness` - Code that is outright wrong or useless (default)",
|
|
635
|
+
" * `suspicious` - Code that is most likely wrong or useless",
|
|
636
|
+
" * `pedantic` - Lints which are rather strict or have occasional false positives",
|
|
637
|
+
" * `perf` - Code that could be written in a more performant way",
|
|
638
|
+
" * `style` - Code that should be written in a more idiomatic way",
|
|
639
|
+
" * `restriction` - Lints which prevent the use of language and library features",
|
|
640
|
+
" * `nursery` - New lints that are still under development",
|
|
641
|
+
" * `all` - All categories listed above except `nursery`. Does not enable plugins automatically."
|
|
642
|
+
],
|
|
630
643
|
rows: [
|
|
631
644
|
{
|
|
632
|
-
label: "-A, --allow
|
|
633
|
-
description: "Allow
|
|
645
|
+
label: "-A, --allow=NAME",
|
|
646
|
+
description: "Allow the rule or category (suppress the lint)"
|
|
634
647
|
},
|
|
635
648
|
{
|
|
636
|
-
label: "-W, --warn
|
|
637
|
-
description: "
|
|
649
|
+
label: "-W, --warn=NAME",
|
|
650
|
+
description: "Warn on the rule or category (emit a warning)"
|
|
638
651
|
},
|
|
639
652
|
{
|
|
640
|
-
label: "-D, --deny
|
|
641
|
-
description: "
|
|
653
|
+
label: "-D, --deny=NAME",
|
|
654
|
+
description: "Deny the rule or category (emit an error)"
|
|
642
655
|
}
|
|
643
656
|
]
|
|
644
657
|
},
|
|
645
658
|
{
|
|
646
|
-
title: "Plugins",
|
|
659
|
+
title: "Enable/Disable Plugins",
|
|
647
660
|
rows: [
|
|
648
661
|
{
|
|
649
662
|
label: "--disable-unicorn-plugin",
|
|
650
|
-
description: "Disable
|
|
663
|
+
description: "Disable unicorn plugin, which is turned on by default"
|
|
651
664
|
},
|
|
652
665
|
{
|
|
653
666
|
label: "--disable-oxc-plugin",
|
|
654
|
-
description: "Disable
|
|
667
|
+
description: "Disable oxc unique rules, which is turned on by default"
|
|
655
668
|
},
|
|
656
669
|
{
|
|
657
670
|
label: "--disable-typescript-plugin",
|
|
658
|
-
description: "Disable
|
|
671
|
+
description: "Disable TypeScript plugin, which is turned on by default"
|
|
659
672
|
},
|
|
660
673
|
{
|
|
661
674
|
label: "--import-plugin",
|
|
662
|
-
description: "Enable
|
|
675
|
+
description: "Enable import plugin and detect ESM problems."
|
|
663
676
|
},
|
|
664
677
|
{
|
|
665
678
|
label: "--react-plugin",
|
|
666
|
-
description: "Enable
|
|
679
|
+
description: "Enable react plugin, which is turned off by default"
|
|
667
680
|
},
|
|
668
681
|
{
|
|
669
682
|
label: "--jsdoc-plugin",
|
|
670
|
-
description: "Enable
|
|
683
|
+
description: "Enable jsdoc plugin and detect JSDoc problems"
|
|
671
684
|
},
|
|
672
685
|
{
|
|
673
686
|
label: "--jest-plugin",
|
|
674
|
-
description: "Enable the Jest plugin"
|
|
687
|
+
description: "Enable the Jest plugin and detect test problems"
|
|
675
688
|
},
|
|
676
689
|
{
|
|
677
690
|
label: "--vitest-plugin",
|
|
678
|
-
description: "Enable the Vitest plugin"
|
|
691
|
+
description: "Enable the Vitest plugin and detect test problems"
|
|
679
692
|
},
|
|
680
693
|
{
|
|
681
694
|
label: "--jsx-a11y-plugin",
|
|
682
|
-
description: "Enable the JSX accessibility
|
|
695
|
+
description: "Enable the JSX-a11y plugin and detect accessibility problems"
|
|
683
696
|
},
|
|
684
697
|
{
|
|
685
698
|
label: "--nextjs-plugin",
|
|
686
|
-
description: "Enable the Next.js plugin"
|
|
699
|
+
description: "Enable the Next.js plugin and detect Next.js problems"
|
|
687
700
|
},
|
|
688
701
|
{
|
|
689
702
|
label: "--react-perf-plugin",
|
|
690
|
-
description: "Enable the React performance plugin"
|
|
703
|
+
description: "Enable the React performance plugin and detect rendering performance problems"
|
|
691
704
|
},
|
|
692
705
|
{
|
|
693
706
|
label: "--promise-plugin",
|
|
694
|
-
description: "Enable the promise plugin"
|
|
707
|
+
description: "Enable the promise plugin and detect promise usage problems"
|
|
695
708
|
},
|
|
696
709
|
{
|
|
697
710
|
label: "--node-plugin",
|
|
698
|
-
description: "Enable the
|
|
711
|
+
description: "Enable the node plugin and detect node usage problems"
|
|
699
712
|
},
|
|
700
713
|
{
|
|
701
714
|
label: "--vue-plugin",
|
|
702
|
-
description: "Enable the
|
|
715
|
+
description: "Enable the vue plugin and detect vue usage problems"
|
|
703
716
|
}
|
|
704
717
|
]
|
|
705
718
|
},
|
|
@@ -708,11 +721,11 @@ const commandHelpDocs = {
|
|
|
708
721
|
rows: [
|
|
709
722
|
{
|
|
710
723
|
label: "--fix",
|
|
711
|
-
description: "Fix issues
|
|
724
|
+
description: "Fix as many issues as possible. Only unfixed issues are reported in the output."
|
|
712
725
|
},
|
|
713
726
|
{
|
|
714
727
|
label: "--fix-suggestions",
|
|
715
|
-
description: "Apply auto-fixable suggestions"
|
|
728
|
+
description: "Apply auto-fixable suggestions. May change program behavior."
|
|
716
729
|
},
|
|
717
730
|
{
|
|
718
731
|
label: "--fix-dangerously",
|
|
@@ -724,16 +737,16 @@ const commandHelpDocs = {
|
|
|
724
737
|
title: "Ignore Files",
|
|
725
738
|
rows: [
|
|
726
739
|
{
|
|
727
|
-
label: "--ignore-path
|
|
728
|
-
description: "
|
|
740
|
+
label: "--ignore-path=PATH",
|
|
741
|
+
description: "Specify the file to use as your `.eslintignore`"
|
|
729
742
|
},
|
|
730
743
|
{
|
|
731
|
-
label: "--ignore-pattern
|
|
732
|
-
description: "
|
|
744
|
+
label: "--ignore-pattern=PAT",
|
|
745
|
+
description: "Specify patterns of files to ignore (in addition to those in `.eslintignore`)"
|
|
733
746
|
},
|
|
734
747
|
{
|
|
735
748
|
label: "--no-ignore",
|
|
736
|
-
description: "Disable
|
|
749
|
+
description: "Disable excluding files from `.eslintignore` files, --ignore-path flags and --ignore-pattern flags"
|
|
737
750
|
}
|
|
738
751
|
]
|
|
739
752
|
},
|
|
@@ -742,26 +755,30 @@ const commandHelpDocs = {
|
|
|
742
755
|
rows: [
|
|
743
756
|
{
|
|
744
757
|
label: "--quiet",
|
|
745
|
-
description: "
|
|
758
|
+
description: "Disable reporting on warnings, only errors are reported"
|
|
746
759
|
},
|
|
747
760
|
{
|
|
748
761
|
label: "--deny-warnings",
|
|
749
|
-
description: "
|
|
762
|
+
description: "Ensure warnings produce a non-zero exit code"
|
|
750
763
|
},
|
|
751
764
|
{
|
|
752
|
-
label: "--max-warnings
|
|
753
|
-
description: "
|
|
765
|
+
label: "--max-warnings=INT",
|
|
766
|
+
description: "Specify a warning threshold, which can be used to force exit with an error status if there are too many warning-level rule violations in your project"
|
|
754
767
|
}
|
|
755
768
|
]
|
|
756
769
|
},
|
|
757
770
|
{
|
|
758
771
|
title: "Output",
|
|
759
772
|
rows: [{
|
|
760
|
-
label: "-f, --format
|
|
761
|
-
description: "
|
|
773
|
+
label: "-f, --format=ARG",
|
|
774
|
+
description: "Use a specific output format. Possible values: `checkstyle`, `default`, `agent`, `github`, `gitlab`, `json`, `junit`, `sarif`, `stylish`, `unix`"
|
|
762
775
|
}, {
|
|
763
|
-
label: "--debug
|
|
764
|
-
description:
|
|
776
|
+
label: "--debug=OPTIONS",
|
|
777
|
+
description: [
|
|
778
|
+
"Enable debug output options. Options are comma-separated. Possible values:",
|
|
779
|
+
" * `files` - Print the list of files that will be linted, then exit.",
|
|
780
|
+
" * `timings` - Enable per-rule timing information."
|
|
781
|
+
]
|
|
765
782
|
}]
|
|
766
783
|
},
|
|
767
784
|
{
|
|
@@ -769,50 +786,50 @@ const commandHelpDocs = {
|
|
|
769
786
|
rows: [
|
|
770
787
|
{
|
|
771
788
|
label: "--silent",
|
|
772
|
-
description: "Do not display diagnostics"
|
|
789
|
+
description: "Do not display any diagnostics"
|
|
773
790
|
},
|
|
774
791
|
{
|
|
775
792
|
label: "--no-error-on-unmatched-pattern",
|
|
776
|
-
description: "Do not exit with an error when no files are selected for linting"
|
|
793
|
+
description: "Do not exit with an error when no files are selected for linting (for example, after applying ignore patterns)"
|
|
777
794
|
},
|
|
778
795
|
{
|
|
779
|
-
label: "--threads
|
|
780
|
-
description: "Number of threads to use
|
|
796
|
+
label: "--threads=INT",
|
|
797
|
+
description: "Number of threads to use. Set to 1 for using only 1 CPU core."
|
|
781
798
|
},
|
|
782
799
|
{
|
|
783
800
|
label: "--print-config",
|
|
784
|
-
description: "
|
|
801
|
+
description: "This option outputs the configuration to be used. When present, no linting is performed and only config-related options are valid."
|
|
785
802
|
}
|
|
786
803
|
]
|
|
787
804
|
},
|
|
788
805
|
{
|
|
789
|
-
title: "Inline Configuration",
|
|
806
|
+
title: "Inline Configuration Comments",
|
|
790
807
|
rows: [{
|
|
791
808
|
label: "--report-unused-disable-directives",
|
|
792
|
-
description: "Report
|
|
809
|
+
description: "Report directive comments like `// oxlint-disable-line`, when no errors would have been reported on that line anyway"
|
|
793
810
|
}, {
|
|
794
|
-
label: "--report-unused-disable-directives-severity
|
|
795
|
-
description: "
|
|
811
|
+
label: "--report-unused-disable-directives-severity=SEVERITY",
|
|
812
|
+
description: "Same as `--report-unused-disable-directives`, but allows you to specify the severity level of the reported errors. Only one of these two options can be used at a time."
|
|
796
813
|
}]
|
|
797
814
|
},
|
|
798
815
|
{
|
|
799
|
-
title: "
|
|
816
|
+
title: "Available options",
|
|
800
817
|
rows: [
|
|
801
818
|
{
|
|
802
819
|
label: "--rules",
|
|
803
|
-
description: "List all
|
|
820
|
+
description: "List all the rules that are currently registered"
|
|
804
821
|
},
|
|
805
822
|
{
|
|
806
823
|
label: "--type-aware",
|
|
807
|
-
description: "Enable rules
|
|
824
|
+
description: "Enable rules that require type information"
|
|
808
825
|
},
|
|
809
826
|
{
|
|
810
827
|
label: "--type-check",
|
|
811
|
-
description: "Enable experimental type checking
|
|
828
|
+
description: "Enable experimental type checking (includes TypeScript compiler diagnostics)"
|
|
812
829
|
},
|
|
813
830
|
{
|
|
814
831
|
label: "-h, --help",
|
|
815
|
-
description: "
|
|
832
|
+
description: "Prints help information"
|
|
816
833
|
}
|
|
817
834
|
]
|
|
818
835
|
},
|
|
@@ -832,17 +849,17 @@ const commandHelpDocs = {
|
|
|
832
849
|
summary: ["Format code.", "Options are forwarded to Oxfmt."],
|
|
833
850
|
sections: [
|
|
834
851
|
{
|
|
835
|
-
title: "
|
|
852
|
+
title: "Available positional items",
|
|
836
853
|
rows: [{
|
|
837
854
|
label: "[PATH]...",
|
|
838
|
-
description: "
|
|
855
|
+
description: "Single file, path or list of paths. Glob patterns are also supported. (Be sure to quote them, otherwise your shell may expand them before passing.) Exclude patterns with `!` prefix like `'!**/fixtures/*.js'` are also supported. If not provided, current working directory is used."
|
|
839
856
|
}]
|
|
840
857
|
},
|
|
841
858
|
{
|
|
842
859
|
title: "Mode Options",
|
|
843
860
|
rows: [{
|
|
844
|
-
label: "--stdin-filepath
|
|
845
|
-
description: "Specify the file name
|
|
861
|
+
label: "--stdin-filepath=PATH",
|
|
862
|
+
description: "Specify the file name to use to infer which parser to use"
|
|
846
863
|
}]
|
|
847
864
|
},
|
|
848
865
|
{
|
|
@@ -850,11 +867,11 @@ const commandHelpDocs = {
|
|
|
850
867
|
rows: [
|
|
851
868
|
{
|
|
852
869
|
label: "--write",
|
|
853
|
-
description: "Format and write files in place"
|
|
870
|
+
description: "Format and write files in place (default)"
|
|
854
871
|
},
|
|
855
872
|
{
|
|
856
873
|
label: "--check",
|
|
857
|
-
description: "Check
|
|
874
|
+
description: "Check if files are formatted, also show statistics"
|
|
858
875
|
},
|
|
859
876
|
{
|
|
860
877
|
label: "--list-different",
|
|
@@ -865,28 +882,28 @@ const commandHelpDocs = {
|
|
|
865
882
|
{
|
|
866
883
|
title: "Ignore Options",
|
|
867
884
|
rows: [{
|
|
868
|
-
label: "--ignore-path
|
|
869
|
-
description: "Path to
|
|
885
|
+
label: "--ignore-path=PATH",
|
|
886
|
+
description: "Path to ignore file(s). Can be specified multiple times. If not specified, .gitignore and .prettierignore in the current directory are used."
|
|
870
887
|
}, {
|
|
871
888
|
label: "--with-node-modules",
|
|
872
|
-
description: "Format
|
|
889
|
+
description: "Format code in node_modules directory (skipped by default)"
|
|
873
890
|
}]
|
|
874
891
|
},
|
|
875
892
|
{
|
|
876
893
|
title: "Runtime Options",
|
|
877
894
|
rows: [{
|
|
878
895
|
label: "--no-error-on-unmatched-pattern",
|
|
879
|
-
description: "Do not exit with
|
|
896
|
+
description: "Do not exit with error when pattern is unmatched"
|
|
880
897
|
}, {
|
|
881
|
-
label: "--threads
|
|
882
|
-
description: "Number of threads to use
|
|
898
|
+
label: "--threads=INT",
|
|
899
|
+
description: "Number of threads to use. Set to 1 for using only 1 CPU core."
|
|
883
900
|
}]
|
|
884
901
|
},
|
|
885
902
|
{
|
|
886
|
-
title: "
|
|
903
|
+
title: "Available options",
|
|
887
904
|
rows: [{
|
|
888
905
|
label: "-h, --help",
|
|
889
|
-
description: "
|
|
906
|
+
description: "Prints help information"
|
|
890
907
|
}]
|
|
891
908
|
},
|
|
892
909
|
{
|
|
@@ -948,21 +965,21 @@ const commandHelpDocs = {
|
|
|
948
965
|
documentationUrl: "https://viteplus.dev/guide/check"
|
|
949
966
|
},
|
|
950
967
|
pack: {
|
|
951
|
-
usage: "vp pack [...
|
|
968
|
+
usage: "vp pack [...files] [OPTIONS]",
|
|
952
969
|
summary: ["Build a library.", "Options are forwarded to Vite+ Pack."],
|
|
953
970
|
sections: [
|
|
954
971
|
{
|
|
955
972
|
title: "Arguments",
|
|
956
973
|
rows: [{
|
|
957
|
-
label: "[...
|
|
958
|
-
description: "
|
|
974
|
+
label: "[...files]",
|
|
975
|
+
description: "Bundle files"
|
|
959
976
|
}]
|
|
960
977
|
},
|
|
961
978
|
{
|
|
962
979
|
title: "Options",
|
|
963
980
|
rows: [
|
|
964
981
|
{
|
|
965
|
-
label: "-f, --format <
|
|
982
|
+
label: "-f, --format <format>",
|
|
966
983
|
description: "Bundle format: esm, cjs, iife, umd (default: esm)"
|
|
967
984
|
},
|
|
968
985
|
{
|
|
@@ -970,7 +987,7 @@ const commandHelpDocs = {
|
|
|
970
987
|
description: "Clean output directory, --no-clean to disable"
|
|
971
988
|
},
|
|
972
989
|
{
|
|
973
|
-
label: "--deps.never-bundle <
|
|
990
|
+
label: "--deps.never-bundle <module>",
|
|
974
991
|
description: "Mark dependencies as external"
|
|
975
992
|
},
|
|
976
993
|
{
|
|
@@ -982,15 +999,15 @@ const commandHelpDocs = {
|
|
|
982
999
|
description: "Enable devtools integration"
|
|
983
1000
|
},
|
|
984
1001
|
{
|
|
985
|
-
label: "--debug [
|
|
1002
|
+
label: "--debug [feat]",
|
|
986
1003
|
description: "Show debug logs"
|
|
987
1004
|
},
|
|
988
1005
|
{
|
|
989
|
-
label: "--target <
|
|
1006
|
+
label: "--target <target>",
|
|
990
1007
|
description: "Bundle target, e.g \"es2015\", \"esnext\""
|
|
991
1008
|
},
|
|
992
1009
|
{
|
|
993
|
-
label: "-l, --logLevel <
|
|
1010
|
+
label: "-l, --logLevel <level>",
|
|
994
1011
|
description: "Set log level: info, warn, error, silent"
|
|
995
1012
|
},
|
|
996
1013
|
{
|
|
@@ -1002,7 +1019,7 @@ const commandHelpDocs = {
|
|
|
1002
1019
|
description: "Disable writing files to disk, incompatible with watch mode (default: true)"
|
|
1003
1020
|
},
|
|
1004
1021
|
{
|
|
1005
|
-
label: "-d, --out-dir <
|
|
1022
|
+
label: "-d, --out-dir <dir>",
|
|
1006
1023
|
description: "Output directory (default: dist)"
|
|
1007
1024
|
},
|
|
1008
1025
|
{
|
|
@@ -1018,7 +1035,7 @@ const commandHelpDocs = {
|
|
|
1018
1035
|
description: "Enable cjs and esm shims (default: false)"
|
|
1019
1036
|
},
|
|
1020
1037
|
{
|
|
1021
|
-
label: "--platform <
|
|
1038
|
+
label: "--platform <platform>",
|
|
1022
1039
|
description: "Target platform (default: node)"
|
|
1023
1040
|
},
|
|
1024
1041
|
{
|
|
@@ -1038,15 +1055,15 @@ const commandHelpDocs = {
|
|
|
1038
1055
|
description: "Enable unused dependencies check (default: false)"
|
|
1039
1056
|
},
|
|
1040
1057
|
{
|
|
1041
|
-
label: "-w, --watch [
|
|
1058
|
+
label: "-w, --watch [path]",
|
|
1042
1059
|
description: "Watch mode"
|
|
1043
1060
|
},
|
|
1044
1061
|
{
|
|
1045
|
-
label: "--ignore-watch <
|
|
1062
|
+
label: "--ignore-watch <path>",
|
|
1046
1063
|
description: "Ignore custom paths in watch mode"
|
|
1047
1064
|
},
|
|
1048
1065
|
{
|
|
1049
|
-
label: "--from-vite [
|
|
1066
|
+
label: "--from-vite [vitest]",
|
|
1050
1067
|
description: "Reuse config from Vite or Vitest"
|
|
1051
1068
|
},
|
|
1052
1069
|
{
|
|
@@ -1054,31 +1071,31 @@ const commandHelpDocs = {
|
|
|
1054
1071
|
description: "Size report (default: true)"
|
|
1055
1072
|
},
|
|
1056
1073
|
{
|
|
1057
|
-
label: "--env.* <
|
|
1074
|
+
label: "--env.* <value>",
|
|
1058
1075
|
description: "Define compile-time env variables"
|
|
1059
1076
|
},
|
|
1060
1077
|
{
|
|
1061
|
-
label: "--env-file <
|
|
1078
|
+
label: "--env-file <file>",
|
|
1062
1079
|
description: "Load environment variables from a file, when used together with --env, variables in --env take precedence"
|
|
1063
1080
|
},
|
|
1064
1081
|
{
|
|
1065
|
-
label: "--env-prefix <
|
|
1066
|
-
description: "Prefix for env variables to inject into the bundle (default:
|
|
1082
|
+
label: "--env-prefix <prefix>",
|
|
1083
|
+
description: "Prefix for env variables to inject into the bundle (default: TSDOWN_)"
|
|
1067
1084
|
},
|
|
1068
1085
|
{
|
|
1069
|
-
label: "--on-success <
|
|
1086
|
+
label: "--on-success <command>",
|
|
1070
1087
|
description: "Command to run on success"
|
|
1071
1088
|
},
|
|
1072
1089
|
{
|
|
1073
|
-
label: "--copy <
|
|
1090
|
+
label: "--copy <dir>",
|
|
1074
1091
|
description: "Copy files to output dir"
|
|
1075
1092
|
},
|
|
1076
1093
|
{
|
|
1077
|
-
label: "--public-dir <
|
|
1094
|
+
label: "--public-dir <dir>",
|
|
1078
1095
|
description: "Alias for --copy, deprecated"
|
|
1079
1096
|
},
|
|
1080
1097
|
{
|
|
1081
|
-
label: "--tsconfig <
|
|
1098
|
+
label: "--tsconfig <tsconfig>",
|
|
1082
1099
|
description: "Set tsconfig path"
|
|
1083
1100
|
},
|
|
1084
1101
|
{
|
|
@@ -1086,7 +1103,7 @@ const commandHelpDocs = {
|
|
|
1086
1103
|
description: "Unbundle mode"
|
|
1087
1104
|
},
|
|
1088
1105
|
{
|
|
1089
|
-
label: "--root <
|
|
1106
|
+
label: "--root <dir>",
|
|
1090
1107
|
description: "Root directory of input files"
|
|
1091
1108
|
},
|
|
1092
1109
|
{
|
|
@@ -1094,15 +1111,15 @@ const commandHelpDocs = {
|
|
|
1094
1111
|
description: "Bundle as executable"
|
|
1095
1112
|
},
|
|
1096
1113
|
{
|
|
1097
|
-
label: "-W, --workspace [
|
|
1114
|
+
label: "-W, --workspace [dir]",
|
|
1098
1115
|
description: "Enable workspace mode"
|
|
1099
1116
|
},
|
|
1100
1117
|
{
|
|
1101
|
-
label: "--concurrency <
|
|
1118
|
+
label: "--concurrency <count>",
|
|
1102
1119
|
description: "Maximum number of Rolldown builds to run in parallel"
|
|
1103
1120
|
},
|
|
1104
1121
|
{
|
|
1105
|
-
label: "-F, --filter <
|
|
1122
|
+
label: "-F, --filter <pattern>",
|
|
1106
1123
|
description: "Filter configs (cwd or name), e.g. /pkg-name$/ or pkg-name"
|
|
1107
1124
|
},
|
|
1108
1125
|
{
|
|
@@ -1325,11 +1342,7 @@ function maybePrintCommandHelp(args) {
|
|
|
1325
1342
|
const doc = commandHelpDocs[command];
|
|
1326
1343
|
if (!doc) return false;
|
|
1327
1344
|
const commandArgs = args.slice(1);
|
|
1328
|
-
|
|
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
|
-
}
|
|
1345
|
+
if (!(commandArgs.length === 1 && (commandArgs[0] === "-h" || commandArgs[0] === "--help"))) return false;
|
|
1333
1346
|
printHeader();
|
|
1334
1347
|
log(renderCliDoc(doc));
|
|
1335
1348
|
return true;
|
|
@@ -1385,14 +1398,6 @@ const INIT_COMMAND_SPECS = {
|
|
|
1385
1398
|
function normalizeInitCommand(command) {
|
|
1386
1399
|
return command === "format" ? "fmt" : command;
|
|
1387
1400
|
}
|
|
1388
|
-
const VITE_CONFIG_FILES = [
|
|
1389
|
-
"vite.config.ts",
|
|
1390
|
-
"vite.config.mts",
|
|
1391
|
-
"vite.config.cts",
|
|
1392
|
-
"vite.config.js",
|
|
1393
|
-
"vite.config.mjs",
|
|
1394
|
-
"vite.config.cjs"
|
|
1395
|
-
];
|
|
1396
1401
|
function optionTerminatorIndex(args) {
|
|
1397
1402
|
const index = args.indexOf("--");
|
|
1398
1403
|
return index === -1 ? args.length : index;
|
|
@@ -1713,7 +1718,7 @@ async function vite() {
|
|
|
1713
1718
|
/**
|
|
1714
1719
|
* Unified entry point for both the local CLI (via bin/vp) and the global CLI (via Rust vp binary).
|
|
1715
1720
|
*
|
|
1716
|
-
* Global commands (create, migrate, config, staged, --version) are handled by tsdown-bundled modules.
|
|
1721
|
+
* Global commands (create, migrate, config, hooks, staged, --version) are handled by tsdown-bundled modules.
|
|
1717
1722
|
* All other commands are delegated to the Rust core through NAPI bindings, which
|
|
1718
1723
|
* uses JavaScript tool resolver functions to locate tool binaries.
|
|
1719
1724
|
*
|
|
@@ -1764,9 +1769,12 @@ if (args[0] === "help" && args[1]) {
|
|
|
1764
1769
|
process.argv = process.argv.slice(0, 2).concat(args);
|
|
1765
1770
|
}
|
|
1766
1771
|
const command = args[0];
|
|
1772
|
+
const cliDistDir = path.dirname(fileURLToPath(import.meta.url));
|
|
1773
|
+
const vitePlusPackagePath = path.dirname(cliDistDir);
|
|
1767
1774
|
if (maybePrintCommandHelp(args)) {} else if (command === "create") await import("./create/bin.js");
|
|
1768
1775
|
else if (command === "migrate") await import("./migration/bin.js");
|
|
1769
1776
|
else if (command === "config") await import("./config/bin.js");
|
|
1777
|
+
else if (command === "hooks") await import("./hooks/bin.js");
|
|
1770
1778
|
else if (command === "--version" || command === "-V") await import("./version.js");
|
|
1771
1779
|
else if (command === "staged") await import("./staged/bin.js");
|
|
1772
1780
|
else try {
|
|
@@ -1782,6 +1790,8 @@ else try {
|
|
|
1782
1790
|
vite,
|
|
1783
1791
|
test,
|
|
1784
1792
|
doc,
|
|
1793
|
+
toolchainManifestPath: path.join(cliDistDir, "toolchain.json"),
|
|
1794
|
+
vitePlusPackagePath,
|
|
1785
1795
|
resolveUniversalViteConfig,
|
|
1786
1796
|
args: rustCliArgs
|
|
1787
1797
|
});
|