Skip to content

Commit 2047e7d

Browse files
committed
docs: update check command RFC to reflect new module structure
1 parent 8e8f0e9 commit 2047e7d

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

rfcs/check-command.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,23 @@ Commands::Check { args } => commands::delegate::execute(cwd, "check", &args).awa
178178

179179
### NAPI Binding
180180

181-
Add `Check` to `SynthesizableSubcommand` in `packages/cli/binding/src/cli.rs`. The check command internally resolves and runs fmt + lint sequentially, reusing existing resolvers.
181+
The `Check` variant is defined in `SynthesizableSubcommand` in `packages/cli/binding/src/cli.rs`. The check command's orchestration logic lives in its own module at `packages/cli/binding/src/check/`, following the same directory-per-command pattern as `exec/`:
182+
183+
- `check/mod.rs``execute_check()` orchestration (runs fmt + lint sequentially, handles `--fix` re-formatting)
184+
- `check/analysis.rs` — Output analysis types (`CheckSummary`, `LintMessageKind`, etc.), parsers, and formatting helpers
185+
186+
The check module reuses `SubcommandResolver` and `resolve_and_capture_output` from `cli.rs` to resolve and run the underlying fmt/lint commands.
182187

183188
### TypeScript Side
184189

185190
No new resolver needed — `vp check` reuses existing `resolve-lint.ts` and `resolve-fmt.ts`.
186191

187-
### Key Files to Modify
192+
### Key Files
188193

189-
1. `crates/vite_global_cli/src/cli.rs` — Add `Check` command variant and routing
190-
2. `packages/cli/binding/src/cli.rs` — Add check subcommand handling (sequential fmt + lint)
191-
3. `packages/cli/src/bin.ts` — (if needed for routing)
194+
1. `crates/vite_global_cli/src/cli.rs``Check` command variant and routing
195+
2. `packages/cli/binding/src/cli.rs``SynthesizableSubcommand::Check` definition, delegates to `check` module
196+
3. `packages/cli/binding/src/check/mod.rs` — Check command orchestration (`execute_check`)
197+
4. `packages/cli/binding/src/check/analysis.rs` — Output parsing and analysis types
192198

193199
## CLI Help Output
194200

@@ -257,7 +263,7 @@ The check command's cache fingerprint includes:
257263
- `node_modules/.vite-temp/**` — config compilation cache (read+written by the vp CLI subprocess)
258264
- `node_modules/.vite/task-cache/**` — task runner state files that change after each run
259265

260-
These exclusions are shared with other synthesized commands via `base_cache_inputs()` in `cli.rs`.
266+
These exclusions are defined by `check_cache_inputs()` in `cli.rs`.
261267

262268
### How it differs from `vp fmt` / `vp lint`
263269

0 commit comments

Comments
 (0)