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.
Files changed (74) hide show
  1. package/AGENTS.md +7 -0
  2. package/README.md +9 -3
  3. package/binding/index.cjs +54 -54
  4. package/binding/index.d.cts +7 -3
  5. package/dist/{agent-CI79DuSy.js → agent-DQU8uS6P.js} +4 -188
  6. package/dist/bin.js +288 -278
  7. package/dist/config/bin.js +27 -15
  8. package/dist/{constants-BppDcRc1.js → constants-CG513DRa.js} +10 -2
  9. package/dist/create/bin.js +178 -204
  10. package/dist/{define-config-DPnHe1Mx.js → define-config-CV4bQG_8.js} +3 -3
  11. package/dist/{define-config-CEm_MtvJ.cjs → define-config-DyNLA_f0.cjs} +1 -1
  12. package/dist/define-config.cjs +1 -1
  13. package/dist/define-config.js +1 -1
  14. package/dist/{dist-CSQWHI6y.js → dist-BDYZP12R.js} +193 -149
  15. package/dist/dist-Dqv1-Clg.js +3 -0
  16. package/dist/{editor-CGWdbLgD.js → editor-g4PosU99.js} +188 -108
  17. package/dist/hooks/bin.d.ts +1 -0
  18. package/dist/hooks/bin.js +130 -0
  19. package/dist/hooks-pNCBWtFT.js +570 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.js +1 -1
  22. package/dist/{json-BU88uu6o.js → json-qlK6UH0r.js} +38 -32
  23. package/dist/migration/bin.js +15 -18
  24. package/dist/{oxlint-plugin-config-BHOzlwMw.js → oxlint-plugin-config-BEZ9IUf7.js} +1 -1
  25. package/dist/oxlint-plugin.js +1 -1
  26. package/dist/pack-bin.js +1 -1
  27. package/dist/{package-hV-77cBb.js → package-B4T8RGMG.js} +2 -2
  28. package/dist/{prompts-DYap08te.js → prompts-CHz_98bJ.js} +142 -50
  29. package/dist/{resolve-vite-config-EWXclqvV.js → resolve-vite-config-Dmeyeyj-.js} +2 -9
  30. package/dist/staged/bin.js +224 -206
  31. package/dist/{terminal-CrqqK8WT.js → terminal-Bz-ps6rJ.js} +33 -3
  32. package/dist/test/browser/providers/playwright/context.d.ts +1 -1
  33. package/dist/test/browser/providers/playwright.d.ts +6 -6
  34. package/dist/test/browser/providers/preview/context.d.ts +1 -1
  35. package/dist/test/browser/providers/preview.d.ts +4 -4
  36. package/dist/test/browser/providers/webdriverio/context.d.ts +1 -1
  37. package/dist/test/browser/providers/webdriverio.d.ts +6 -6
  38. package/dist/test/browser-playwright/context.d.ts +1 -1
  39. package/dist/test/browser-playwright.d.ts +6 -6
  40. package/dist/test/browser-preview/context.d.ts +1 -1
  41. package/dist/test/browser-preview.d.ts +4 -4
  42. package/dist/test/browser-webdriverio/context.d.ts +1 -1
  43. package/dist/test/browser-webdriverio.d.ts +6 -6
  44. package/dist/test/context.d.ts +3 -3
  45. package/dist/test/locators.d.ts +1 -1
  46. package/dist/toolchain.d.ts +25 -0
  47. package/dist/toolchain.js +194 -0
  48. package/dist/toolchain.json +193 -0
  49. package/dist/{tsconfig-CVUKLfL8.js → tsconfig-7v_BHagU.js} +3 -3
  50. package/dist/tsgolint-path.js +1 -1
  51. package/dist/version.js +4 -4
  52. package/dist/versions.d.ts +3 -3
  53. package/dist/versions.js +6 -6
  54. package/docs/guide/ci.md +37 -4
  55. package/docs/guide/commit-hooks.md +87 -14
  56. package/docs/guide/create.md +7 -4
  57. package/docs/guide/fmt.md +2 -2
  58. package/docs/guide/github-actions-cache.md +5 -1
  59. package/docs/guide/ide-integration.md +61 -2
  60. package/docs/guide/index.md +3 -1
  61. package/docs/guide/install.md +25 -0
  62. package/docs/guide/installer-env-vars.md +12 -1
  63. package/docs/guide/lint.md +3 -1
  64. package/docs/guide/migrate.md +39 -2
  65. package/docs/guide/monorepo.md +4 -4
  66. package/docs/guide/troubleshooting.md +12 -4
  67. package/docs/guide/upgrade.md +27 -4
  68. package/docs/package.json +1 -1
  69. package/docs/pnpm-workspace.yaml +7 -0
  70. package/docs/vite.config.ts +3 -0
  71. package/package.json +18 -14
  72. package/rules/vite-tools.yml +0 -7
  73. package/dist/dist-DT25H9pj.js +0 -3
  74. package/dist/{tsgolint-path-eMZT-oea.js → tsgolint-path-CbDReEOx.js} +1 -1
package/dist/bin.js CHANGED
@@ -1,14 +1,14 @@
1
- import { a as printHeader, c as renderCliDoc, n as errorMsg, r as log, s as warnMsg, t as accent } from "./terminal-CrqqK8WT.js";
2
- import { f as resolve$1, i as DEFAULT_ENVS, n as BASEURL_TSCONFIG_WARNING, p as resolveBundled, r as CONFIG_METADATA_ENV, s as VITE_PLUS_NAME } from "./constants-BppDcRc1.js";
3
- import { r as createDefaultVitePlusLintConfig } from "./oxlint-plugin-config-BHOzlwMw.js";
4
- import { M as runCommandSilently } from "./prompts-DYap08te.js";
5
- import { i as hasBaseUrlInTsconfig, r as fixBaseUrlInTsconfig } from "./tsconfig-CVUKLfL8.js";
6
- import { t as resolveTsgolintExecutable } from "./tsgolint-path-eMZT-oea.js";
7
- import { i as resolveUniversalViteConfig } from "./resolve-vite-config-EWXclqvV.js";
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 [HOST]",
30
- description: "Specify hostname"
29
+ label: "--host [host]",
30
+ description: "[string] specify hostname"
31
31
  },
32
32
  {
33
- label: "--port <PORT>",
34
- description: "Specify port"
33
+ label: "--port <port>",
34
+ description: "[number] specify port"
35
35
  },
36
36
  {
37
- label: "--open [PATH]",
38
- description: "Open browser on startup"
37
+ label: "--open [path]",
38
+ description: "[boolean | string] open browser on startup"
39
39
  },
40
40
  {
41
41
  label: "--cors",
42
- description: "Enable CORS"
42
+ description: "[boolean] enable CORS"
43
43
  },
44
44
  {
45
45
  label: "--strictPort",
46
- description: "Exit if specified port is already in use"
46
+ description: "[boolean] exit if specified port is already in use"
47
47
  },
48
48
  {
49
49
  label: "--force",
50
- description: "Ignore the optimizer cache and re-bundle"
50
+ description: "[boolean] force the optimizer to ignore the cache and re-bundle"
51
51
  },
52
52
  {
53
53
  label: "--experimentalBundle",
54
- description: "Use experimental full bundle mode"
54
+ description: "[boolean] use experimental full bundle mode (this is highly experimental)"
55
55
  },
56
56
  {
57
- label: "--base <PATH>",
58
- description: "Public base path"
57
+ label: "--base <path>",
58
+ description: "[string] public base path (default: /)"
59
59
  },
60
60
  {
61
- label: "-l, --logLevel <LEVEL>",
62
- description: "Set log level"
61
+ label: "-l, --logLevel <level>",
62
+ description: "[string] info | warn | error | silent"
63
63
  },
64
64
  {
65
65
  label: "--clearScreen",
66
- description: "Allow or disable clearing the screen"
66
+ description: "[boolean] allow/disable clear screen when logging"
67
67
  },
68
68
  {
69
- label: "-d, --debug [FEAT]",
70
- description: "Show debug logs"
69
+ label: "-d, --debug [feat]",
70
+ description: "[string | boolean] show debug logs"
71
71
  },
72
72
  {
73
- label: "-f, --filter <FILTER>",
74
- description: "Filter debug logs"
73
+ label: "-f, --filter <filter>",
74
+ description: "[string] filter debug logs"
75
75
  },
76
76
  {
77
- label: "-m, --mode <MODE>",
78
- description: "Set env mode"
77
+ label: "-m, --mode <mode>",
78
+ description: "[string] set env mode"
79
79
  },
80
80
  {
81
81
  label: "-h, --help",
82
- description: "Print help"
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 <TARGET>",
113
- description: "Transpile target"
112
+ label: "--target <target>",
113
+ description: "[string] transpile target (default: 'baseline-widely-available')"
114
114
  },
115
115
  {
116
- label: "--outDir <DIR>",
117
- description: "Output directory"
116
+ label: "--outDir <dir>",
117
+ description: "[string] output directory (default: dist)"
118
118
  },
119
119
  {
120
- label: "--assetsDir <DIR>",
121
- description: "Directory for generated assets"
120
+ label: "--assetsDir <dir>",
121
+ description: "[string] directory under outDir to place assets in (default: assets)"
122
122
  },
123
123
  {
124
- label: "--assetsInlineLimit <NUMBER>",
125
- description: "Static asset inline threshold"
124
+ label: "--assetsInlineLimit <number>",
125
+ description: "[number] static asset base64 inline threshold in bytes (default: 4096)"
126
126
  },
127
127
  {
128
- label: "--ssr [ENTRY]",
129
- description: "Build for server-side rendering"
128
+ label: "--ssr [entry]",
129
+ description: "[string] build specified entry for server-side rendering"
130
130
  },
131
131
  {
132
- label: "--sourcemap [MODE]",
133
- description: "Output source maps"
132
+ label: "--sourcemap [output]",
133
+ description: "[boolean | \"inline\" | \"hidden\"] output source maps for build (default: false)"
134
134
  },
135
135
  {
136
- label: "--minify [MINIFIER]",
137
- description: "Enable or disable minification"
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 [NAME]",
141
- description: "Emit a build manifest"
140
+ label: "--manifest [name]",
141
+ description: "[boolean | string] emit build manifest json"
142
142
  },
143
143
  {
144
- label: "--ssrManifest [NAME]",
145
- description: "Emit an SSR manifest"
144
+ label: "--ssrManifest [name]",
145
+ description: "[boolean | string] emit ssr manifest json"
146
146
  },
147
147
  {
148
148
  label: "--emptyOutDir",
149
- description: "Empty outDir even when it is outside root"
149
+ description: "[boolean] force empty outDir when it's outside of root"
150
150
  },
151
151
  {
152
152
  label: "-w, --watch",
153
- description: "Rebuild when files change"
153
+ description: "[boolean] rebuilds when modules have changed on disk"
154
154
  },
155
155
  {
156
156
  label: "--app",
157
- description: "Build an application with the builder API"
157
+ description: "[boolean] same as `builder: {}`"
158
158
  },
159
159
  {
160
- label: "--base <PATH>",
161
- description: "Public base path"
160
+ label: "--base <path>",
161
+ description: "[string] public base path (default: /)"
162
162
  },
163
163
  {
164
- label: "-l, --logLevel <LEVEL>",
165
- description: "Set log level"
164
+ label: "-l, --logLevel <level>",
165
+ description: "[string] info | warn | error | silent"
166
166
  },
167
167
  {
168
168
  label: "--clearScreen",
169
- description: "Allow or disable clearing the screen"
169
+ description: "[boolean] allow/disable clear screen when logging"
170
170
  },
171
171
  {
172
- label: "-d, --debug [FEAT]",
173
- description: "Show debug logs"
172
+ label: "-d, --debug [feat]",
173
+ description: "[string | boolean] show debug logs"
174
174
  },
175
175
  {
176
- label: "-f, --filter <FILTER>",
177
- description: "Filter debug logs"
176
+ label: "-f, --filter <filter>",
177
+ description: "[string] filter debug logs"
178
178
  },
179
179
  {
180
- label: "-m, --mode <MODE>",
181
- description: "Set env mode"
180
+ label: "-m, --mode <mode>",
181
+ description: "[string] set env mode"
182
182
  },
183
183
  {
184
184
  label: "-h, --help",
185
- description: "Print help"
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 [HOST]",
216
- description: "Specify hostname"
215
+ label: "--host [host]",
216
+ description: "[string] specify hostname"
217
217
  },
218
218
  {
219
- label: "--port <PORT>",
220
- description: "Specify port"
219
+ label: "--port <port>",
220
+ description: "[number] specify port"
221
221
  },
222
222
  {
223
223
  label: "--strictPort",
224
- description: "Exit if specified port is already in use"
224
+ description: "[boolean] exit if specified port is already in use"
225
225
  },
226
226
  {
227
- label: "--open [PATH]",
228
- description: "Open browser on startup"
227
+ label: "--open [path]",
228
+ description: "[boolean | string] open browser on startup"
229
229
  },
230
230
  {
231
- label: "--outDir <DIR>",
232
- description: "Output directory to preview"
231
+ label: "--outDir <dir>",
232
+ description: "[string] output directory (default: dist)"
233
233
  },
234
234
  {
235
- label: "--base <PATH>",
236
- description: "Public base path"
235
+ label: "--base <path>",
236
+ description: "[string] public base path (default: /)"
237
237
  },
238
238
  {
239
- label: "-l, --logLevel <LEVEL>",
240
- description: "Set log level"
239
+ label: "-l, --logLevel <level>",
240
+ description: "[string] info | warn | error | silent"
241
241
  },
242
242
  {
243
243
  label: "--clearScreen",
244
- description: "Allow or disable clearing the screen"
244
+ description: "[boolean] allow/disable clear screen when logging"
245
245
  },
246
246
  {
247
- label: "-d, --debug [FEAT]",
248
- description: "Show debug logs"
247
+ label: "-d, --debug [feat]",
248
+ description: "[string | boolean] show debug logs"
249
249
  },
250
250
  {
251
- label: "-f, --filter <FILTER>",
252
- description: "Filter debug logs"
251
+ label: "-f, --filter <filter>",
252
+ description: "[string] filter debug logs"
253
253
  },
254
254
  {
255
- label: "-m, --mode <MODE>",
256
- description: "Set env mode"
255
+ label: "-m, --mode <mode>",
256
+ description: "[string] set env mode"
257
257
  },
258
258
  {
259
259
  label: "-h, --help",
260
- description: "Print help"
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 <PATH>",
315
+ label: "-r, --root <path>",
316
316
  description: "Root path"
317
317
  },
318
318
  {
319
- label: "-u, --update [TYPE]",
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 <PATTERN>",
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 <PATH>",
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 [PORT]",
344
- description: "Specify server port; if true, defaults to 51204"
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 [VALUE]",
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 <NAME>",
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 <FILENAME/-S>",
360
- description: "Write test results to a file; use dot notation for individual outputs of multiple reporters (for example, --outputFile.tap=./tap.txt)"
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 reporting"
364
+ description: "Enable coverage report. Use '--help --coverage' for more info."
365
365
  },
366
366
  {
367
- label: "--mode <NAME>",
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. Use --no-isolate to disable (default: true)"
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 APIs globally"
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 <NAME>",
384
- description: "Run tests in the browser; equivalent to --browser.enabled (default: false)"
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 <POOL>",
388
- description: "Specify pool when not running in the browser (default: forks)"
387
+ label: "--pool <pool>",
388
+ description: "Specify pool, if not running in the browser (default: forks)"
389
389
  },
390
390
  {
391
- label: "--execArgv <OPTION>",
392
- description: "Pass additional arguments to Node.js when spawning worker threads or child processes"
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 <LIMIT>",
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: "Run test files in parallel. Use --no-file-parallelism to disable (default: true)"
400
+ description: "Should all test files run in parallel. Use --no-file-parallelism to disable (default: true)"
401
401
  },
402
402
  {
403
- label: "--maxWorkers <WORKERS>",
403
+ label: "--maxWorkers <workers>",
404
404
  description: "Maximum number or percentage of workers to run tests in"
405
405
  },
406
406
  {
407
- label: "--environment <NAME>",
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 the heap for each test when running in Node.js"
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 files (default: false)"
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 <SHARDS>",
432
- description: "Test suite shard to execute in the format <index>/<count>"
431
+ label: "--shard <shards>",
432
+ description: "Test suite shard to execute in a format of <index>/<count>"
433
433
  },
434
434
  {
435
- label: "--changed [SINCE]",
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 <OPTIONS>",
440
- description: "Configure test sorting"
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 [[HOST:]PORT]",
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 [[HOST:]PORT]",
448
- description: "Enable Node.js inspector and break before tests start"
447
+ label: "--inspectBrk [[host:]port]",
448
+ description: "Enable Node.js inspector and break before the test starts"
449
449
  },
450
450
  {
451
- label: "--testTimeout <TIMEOUT>",
452
- description: "Default test timeout in milliseconds (default: 5000; 0 disables)"
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 <TIMEOUT>",
456
- description: "Default hook timeout in milliseconds (default: 10000; 0 disables)"
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 <NUMBER>",
460
- description: "Stop test execution after the given number of failures (default: 0)"
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 <TIMES>",
464
- description: "Retry failed tests (default: 0)"
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 <PATH>",
468
- description: "DiffOptions object or path to a module exporting one"
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 <GLOB>",
472
- description: "Additional file globs to exclude from tests"
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 the full diff when a snapshot fails"
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 <NAME>",
488
- description: "Select one or more Vitest workspace projects by name or wildcard"
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 <THRESHOLD>",
492
- description: "Threshold for a test or suite to be considered slow (default: 300ms)"
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 <TIMEOUT>",
496
- description: "Default teardown timeout in milliseconds (default: 10000)"
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 <NUMBER>",
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: "Configure expect matchers"
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 <DIR>",
520
- description: "Directory for attachments created with context.annotate (default: .vitest-attachments)"
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: "Remove colors from console output (default: true)"
528
+ description: "Removes colors from the console output (default: true)"
529
529
  },
530
530
  {
531
531
  label: "--clearScreen",
532
- description: "Clear the terminal when rerunning tests in watch mode (default: true)"
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 until files change (default: false)"
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 [PATH]",
540
- description: "Merge previously recorded blob reports without running tests"
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 [TYPE]",
544
- description: "List available tags; --list-tags=json outputs JSON"
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 <EXPRESSION>",
552
- description: "Run only tests matching the tag expression"
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: "Error when a test uses an undefined tag (default: true)"
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 <FEATURES>",
560
- description: "Enable experimental features"
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 <FILENAME>",
571
+ label: "--compare <filename>",
572
572
  description: "Benchmark output file to compare against"
573
573
  }, {
574
- label: "--outputJson <FILENAME>",
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 [TRUE/PATH]",
583
- description: "Print collected tests as JSON or write to a file (default: false)"
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 without test cases"
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 <LIMIT>",
595
- description: "Number of test files to process concurrently"
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: "Arguments",
615
+ title: "Available positional items",
616
616
  rows: [{
617
617
  label: "[PATH]...",
618
- description: "Files or directories to lint"
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 <PATH>",
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: "Rule Severity",
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 <NAME>",
633
- description: "Allow a rule or category"
645
+ label: "-A, --allow=NAME",
646
+ description: "Allow the rule or category (suppress the lint)"
634
647
  },
635
648
  {
636
- label: "-W, --warn <NAME>",
637
- description: "Emit a warning for a rule or category"
649
+ label: "-W, --warn=NAME",
650
+ description: "Warn on the rule or category (emit a warning)"
638
651
  },
639
652
  {
640
- label: "-D, --deny <NAME>",
641
- description: "Emit an error for a rule or category"
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 the unicorn plugin, which is enabled by default"
663
+ description: "Disable unicorn plugin, which is turned on by default"
651
664
  },
652
665
  {
653
666
  label: "--disable-oxc-plugin",
654
- description: "Disable Oxc-specific rules, which are enabled by default"
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 the TypeScript plugin, which is enabled by default"
671
+ description: "Disable TypeScript plugin, which is turned on by default"
659
672
  },
660
673
  {
661
674
  label: "--import-plugin",
662
- description: "Enable the import plugin"
675
+ description: "Enable import plugin and detect ESM problems."
663
676
  },
664
677
  {
665
678
  label: "--react-plugin",
666
- description: "Enable the React plugin"
679
+ description: "Enable react plugin, which is turned off by default"
667
680
  },
668
681
  {
669
682
  label: "--jsdoc-plugin",
670
- description: "Enable the JSDoc plugin"
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 plugin"
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 Node.js plugin"
711
+ description: "Enable the node plugin and detect node usage problems"
699
712
  },
700
713
  {
701
714
  label: "--vue-plugin",
702
- description: "Enable the Vue plugin"
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 when possible"
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 <PATH>",
728
- description: "Use the specified .eslintignore file"
740
+ label: "--ignore-path=PATH",
741
+ description: "Specify the file to use as your `.eslintignore`"
729
742
  },
730
743
  {
731
- label: "--ignore-pattern <PATTERN>",
732
- description: "Add file patterns to ignore"
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 file exclusion from ignore rules"
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: "Report errors only"
758
+ description: "Disable reporting on warnings, only errors are reported"
746
759
  },
747
760
  {
748
761
  label: "--deny-warnings",
749
- description: "Exit non-zero when warnings are reported"
762
+ description: "Ensure warnings produce a non-zero exit code"
750
763
  },
751
764
  {
752
- label: "--max-warnings <INT>",
753
- description: "Set the warning threshold before exiting non-zero"
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 <FORMAT>",
761
- description: "Set output format: checkstyle, default, agent, github, gitlab, json, junit, sarif, stylish, or unix"
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 <OPTIONS>",
764
- description: "Enable comma-separated debug output options: files or timings"
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 <INT>",
780
- description: "Number of threads to use; set to 1 to use one CPU core"
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: "Print the resolved configuration without linting"
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 unused oxlint-disable directives"
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 <SEVERITY>",
795
- description: "Report unused disable directives at the specified severity"
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: "Options",
816
+ title: "Available options",
800
817
  rows: [
801
818
  {
802
819
  label: "--rules",
803
- description: "List all registered rules"
820
+ description: "List all the rules that are currently registered"
804
821
  },
805
822
  {
806
823
  label: "--type-aware",
807
- description: "Enable rules requiring type information"
824
+ description: "Enable rules that require type information"
808
825
  },
809
826
  {
810
827
  label: "--type-check",
811
- description: "Enable experimental type checking and compiler diagnostics"
828
+ description: "Enable experimental type checking (includes TypeScript compiler diagnostics)"
812
829
  },
813
830
  {
814
831
  label: "-h, --help",
815
- description: "Print help information"
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: "Arguments",
852
+ title: "Available positional items",
836
853
  rows: [{
837
854
  label: "[PATH]...",
838
- description: "Files, directories, or glob patterns (default: current directory)"
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 <PATH>",
845
- description: "Specify the file name used to infer the parser for stdin"
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 whether files are formatted and show statistics"
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 <PATH>",
869
- description: "Path to an ignore file; may be specified multiple times"
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 files in node_modules, which are skipped by default"
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 an error when the pattern is unmatched"
896
+ description: "Do not exit with error when pattern is unmatched"
880
897
  }, {
881
- label: "--threads <INT>",
882
- description: "Number of threads to use; set to 1 to use one CPU core"
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: "Options",
903
+ title: "Available options",
887
904
  rows: [{
888
905
  label: "-h, --help",
889
- description: "Print help information"
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 [...FILES] [OPTIONS]",
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: "[...FILES]",
958
- description: "Files to bundle"
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 <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 <MODULE>",
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 [FEAT]",
1002
+ label: "--debug [feat]",
986
1003
  description: "Show debug logs"
987
1004
  },
988
1005
  {
989
- label: "--target <TARGET>",
1006
+ label: "--target <target>",
990
1007
  description: "Bundle target, e.g \"es2015\", \"esnext\""
991
1008
  },
992
1009
  {
993
- label: "-l, --logLevel <LEVEL>",
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 <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 <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 [PATH]",
1058
+ label: "-w, --watch [path]",
1042
1059
  description: "Watch mode"
1043
1060
  },
1044
1061
  {
1045
- label: "--ignore-watch <PATH>",
1062
+ label: "--ignore-watch <path>",
1046
1063
  description: "Ignore custom paths in watch mode"
1047
1064
  },
1048
1065
  {
1049
- label: "--from-vite [VITEST]",
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.* <VALUE>",
1074
+ label: "--env.* <value>",
1058
1075
  description: "Define compile-time env variables"
1059
1076
  },
1060
1077
  {
1061
- label: "--env-file <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 <PREFIX>",
1066
- description: "Prefix for env variables to inject into the bundle (default: VITE_PACK_,TSDOWN_)"
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 <COMMAND>",
1086
+ label: "--on-success <command>",
1070
1087
  description: "Command to run on success"
1071
1088
  },
1072
1089
  {
1073
- label: "--copy <DIR>",
1090
+ label: "--copy <dir>",
1074
1091
  description: "Copy files to output dir"
1075
1092
  },
1076
1093
  {
1077
- label: "--public-dir <DIR>",
1094
+ label: "--public-dir <dir>",
1078
1095
  description: "Alias for --copy, deprecated"
1079
1096
  },
1080
1097
  {
1081
- label: "--tsconfig <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 <DIR>",
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 [DIR]",
1114
+ label: "-W, --workspace [dir]",
1098
1115
  description: "Enable workspace mode"
1099
1116
  },
1100
1117
  {
1101
- label: "--concurrency <COUNT>",
1118
+ label: "--concurrency <count>",
1102
1119
  description: "Maximum number of Rolldown builds to run in parallel"
1103
1120
  },
1104
1121
  {
1105
- label: "-F, --filter <PATTERN>",
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
- const terminatorIndex = commandArgs.indexOf("--");
1329
- if (!(terminatorIndex === -1 ? commandArgs : commandArgs.slice(0, terminatorIndex)).some((arg) => arg === "-h" || arg === "--help")) return false;
1330
- if (command === "run" || command === "exec" || command === "cache") {
1331
- if (commandArgs.length !== 1) return false;
1332
- }
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
  });