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