-
Notifications
You must be signed in to change notification settings - Fork 105
Open
Description
Motivation
Related to #330. After some research, the original dependency-checking scope is mostly addressed by nuxt upgrade --dedupe. But there's an interesting opportunity here:
A hook-based nuxt doctor command where the CLI provides core checks and exposes a doctor:check hook for modules to contribute their own.
Example output
$ nuxt doctor
[✓] Config - validated against schema
[✓] Versions - Nuxt 3.15.0, Node 20.10.0
[!] Modules (via nuxt-care) - @old/module 45/100 ⚠
[✓] A11y (via @nuxt/a11y) - 0 violations
Core checks (built-in)
- config validation against @nuxt/schema
- Node/Nuxt version checks
- module compatibility
Hook for modules
nuxt.hook('doctor:check', (ctx) => {
ctx.addCheck({ name: 'My Check', status: 'success', message: '...' })
})This would allow modules like @nuxt/a11y to contribute a11y violation checks, nuxt-care module to report module health scores.
Implementation
The pattern follows analyze.ts which calls the build:analyze:done hook.
| Component | Location |
|---|---|
| Hook type | @nuxt/schema (PR to nuxt/nuxt) |
| Command | packages/nuxi/src/commands/doctor.ts |
Open questions
- should hooks run in parallel or sequentially?
- for module checks that need the dev server (like a11y), would a separate
--fullflag make sense?
I'd love feedback before starting implementation 🙏
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels