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