Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Monorepo (`pnpm` workspaces + `turbo`). ESM TypeScript; bundled with `tsdown`. P
| `packages/vite` | `@vitejs/devtools-vite` | Nuxt UI for the Vite dev server's plugin pipeline and module transforms. Hub-mounted via `Plugin.devtools.setup`. Serves at `/__devtools-vite/`. |
| `packages/oxc` | `@vitejs/devtools-oxc` | Oxc toolchain (oxlint/oxfmt) inspector, donated from [`yuyinws/oxc-inspector`](https://github.com/yuyinws/oxc-inspector) with full history; owned by Leo. Advertised by core as a built-in install launcher in the `viteplus` group (installed on demand), mounted via `DevToolsOxc()` from `@vitejs/devtools-oxc/vite` once present, plus a standalone CLI/client. Its Nuxt client is on the shared stack — UnoCSS via `presetDevToolsUI` and `@vitejs/devtools-ui` components (an oxc-cyan `primary` scale derived from the `BannerOxcDevTools` accent) — and is wired into the turbo build, `vue-tsc` typecheck (own `src/tsconfig.json` reference) and export-snapshot gates. It dogfoods its own oxlint/oxfmt on itself (run `pnpm -C packages/oxc lint`), whose formatting conflicts with the repo-wide antfu ESLint config, so it stays out of the shared ESLint run. |
| `packages/vitest` | `@vitejs/devtools-vitest` | Slim launcher for the Vitest UI, in the `viteplus` dock group. A `launcher` dock (only shown when the project uses Vitest) installs `@vitest/ui` on demand, spawns `vitest --ui`, then swaps to an iframe. Serves its favicon at `/__devtools-vitest/`. |
| `packages/vite-task` | `@vitejs/devtools-vite-task` | Vite Plus task graph and dry-run cache inspector, mounted in the `viteplus` dock group. Serves at `/__devtools-vite-task/`. |
| `packages/webext` | — | Browser extension scaffolding (ancillary). |

Meta-introspection ("DevTools for the DevTools") is provided by the official upstream `@devframes/plugin-inspect`, mounted as a built-in via `createPluginFromDevframe` (replaces the former `packages/self-inspect`).
Expand All @@ -38,10 +39,11 @@ flowchart TD
hub --> devframe
kit --> hub
core --> kit
core --> rolldown & vite & vitest
core --> rolldown & vite & vitest & vite-task
rolldown --> kit & ui
vite --> kit & ui
vitest --> kit
vite-task --> kit
webext --> core
```

Expand Down Expand Up @@ -110,6 +112,7 @@ All node-side warnings and errors use structured diagnostics via [`nostics`](htt
| `RDDT` | `packages/rolldown` | `packages/rolldown/src/node/diagnostics.ts` |
| `VDT` | `packages/vite` | `packages/vite/src/node/diagnostics.ts` |
| `VTDT` | `packages/vitest` | `packages/vitest/src/node/diagnostics.ts` |
| `VTKDT` | `packages/vite-task` | `packages/vite-task/src/node/diagnostics.ts` |
| `OXDT` | `packages/oxc` | `packages/oxc/src/node/diagnostics.ts` |

`DF` codes belong to the upstream devframe/hub projects — file new ones there. The `DF8xxx` sub-range covers `@devframes/hub` (DF8100–DF8199 docks, DF8200–DF8299 terminals, DF8300–DF8399 messages, DF8400–DF8499 commands).
Expand Down
1 change: 1 addition & 0 deletions alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const alias = {
'@vitejs/devtools-kit': r('kit/src/index.ts'),
'@vitejs/devtools-rolldown': r('rolldown/src/index.ts'),
'@vitejs/devtools-vite': r('vite/src/index.ts'),
'@vitejs/devtools-vite-task': r('vite-task/src/index.ts'),
'@vitejs/devtools-vitest': r('vitest/src/index.ts'),
'@vitejs/devtools/internal': r('core/src/internal.ts'),
'@vitejs/devtools/json-render': r('core/src/json-render.ts'),
Expand Down
10 changes: 10 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const BuiltinDevToolsNav = [
{ text: 'DevTools for Rolldown', link: '/rolldown/' },
{ text: 'DevTools for Vite', link: '/vite/' },
{ text: 'DevTools for Vitest', link: '/vitest/' },
{ text: 'DevTools for Vite Task', link: '/vite-task/' },
{ text: 'DevTools for Oxc', link: '/oxc/' },
]

Expand Down Expand Up @@ -123,6 +124,7 @@ export default extendConfig(withMermaid(defineConfig({
{ text: 'DevTools for Rolldown', link: '/rolldown/' },
{ text: 'DevTools for Vite', link: '/vite/' },
{ text: 'DevTools for Vitest', link: '/vitest/' },
{ text: 'DevTools for Vite Task', link: '/vite-task/' },
{ text: 'DevTools for Oxc', link: '/oxc/' },
],
},
Expand Down Expand Up @@ -167,6 +169,14 @@ export default extendConfig(withMermaid(defineConfig({
link: `/errors/${code}`,
})),
},
{
text: 'Vite Task DevTools (VTKDT)',
collapsed: true,
items: listErrorCodes('VTKDT').map(code => ({
text: code,
link: `/errors/${code}`,
})),
},
],
},
],
Expand Down
25 changes: 25 additions & 0 deletions docs/errors/VTKDT0001.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
outline: deep
---

# VTKDT0001: Vite Plus Executable Not Found

## Message

> Local Vite Plus executable not found at "`{executable}`".

## Cause

The task inspector could not find the workspace's local Vite Plus executable in `node_modules/.bin`.

## Example

Opening the task inspector in a workspace where `vite-plus` has not been installed.

## Fix

Install `vite-plus` 1.6.0 or newer in the workspace root.

## Source

- [`packages/vite-task/src/node/tasks.ts`](https://github.com/vitejs/devtools/blob/main/packages/vite-task/src/node/tasks.ts) — `runJson()` throws this when the local executable is missing.
25 changes: 25 additions & 0 deletions docs/errors/VTKDT0002.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
outline: deep
---

# VTKDT0002: Unsupported Vite Plus Version

## Message

> Vite Plus `{version}` does not meet the required version >=1.6.0.

## Cause

The local Vite Plus version is older than the task inspector's required version, 1.6.0.

## Example

Opening the task inspector in a workspace using Vite Plus 1.5.0.

## Fix

Update the workspace's `vite-plus` dependency to 1.6.0 or newer.

## Source

- [`packages/vite-task/src/node/tasks.ts`](https://github.com/vitejs/devtools/blob/main/packages/vite-task/src/node/tasks.ts) — `runJson()` throws this when the local version is unsupported.
25 changes: 25 additions & 0 deletions docs/errors/VTKDT0003.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
outline: deep
---

# VTKDT0003: Vite Plus Command Failed

## Message

> Failed to run "`{command}`": `{reason}`

## Cause

A Vite Plus command failed, or the inspector could not recognize the output of `vp --version`.

## Example

Loading the task graph when a workspace task configuration causes `vp run --json` to fail.

## Fix

Check the local Vite Plus installation and workspace task configuration. Run the command shown in the diagnostic from the workspace root to inspect its output.

## Source

- [`packages/vite-task/src/node/tasks.ts`](https://github.com/vitejs/devtools/blob/main/packages/vite-task/src/node/tasks.ts) — `execute()` throws this on command failure; `runJson()` also throws it for unrecognized version output.
25 changes: 25 additions & 0 deletions docs/errors/VTKDT0004.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
outline: deep
---

# VTKDT0004: Invalid Vite Plus JSON

## Message

> Vite Plus returned invalid JSON for "`{command}`".

## Cause

The inspector could not parse the command's standard output as JSON.

## Example

Loading the task graph while workspace configuration prints additional text to standard output.

## Fix

Check the Vite Plus version and ensure the workspace configuration does not print to standard output.

## Source

- [`packages/vite-task/src/node/tasks.ts`](https://github.com/vitejs/devtools/blob/main/packages/vite-task/src/node/tasks.ts) — `runJson()` throws this when JSON parsing fails.
25 changes: 25 additions & 0 deletions docs/errors/VTKDT0005.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
outline: deep
---

# VTKDT0005: Invalid Task Name

## Message

> Invalid task name "`{task}`".

## Cause

The requested task is empty, starts with a dash, or is absent from the task graph.

## Example

Requesting a run plan for a task that has been removed from the workspace configuration.

## Fix

Refresh the task graph and select a non-empty task name that does not start with a dash.

## Source

- [`packages/vite-task/src/node/tasks.ts`](https://github.com/vitejs/devtools/blob/main/packages/vite-task/src/node/tasks.ts) — `loadRunPlan()` throws this when the task name is invalid or missing from the graph.
14 changes: 13 additions & 1 deletion docs/errors/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Vite DevTools uses structured diagnostics to surface actionable warnings and err
## How error codes work

- Codes follow the pattern **prefix + 4-digit number** (e.g., `DF0001`, `DTK0008`, `RDDT0002`).
- Each prefix maps to a package: `DTK` for `@vitejs/devtools` (Vite-specific pieces), `RDDT` for `@vitejs/devtools-rolldown`, `VDT` for `@vitejs/devtools-vite`, `VTDT` for `@vitejs/devtools-vitest`. The framework-neutral `devframe` package documents its own `DF`-prefixed codes at the [Devframe docs site](https://devfra.me/errors/).
- Each prefix maps to a package: `DTK` for `@vitejs/devtools` (Vite-specific pieces), `RDDT` for `@vitejs/devtools-rolldown`, `VDT` for `@vitejs/devtools-vite`, `VTDT` for `@vitejs/devtools-vitest`, `VTKDT` for `@vitejs/devtools-vite-task`. The framework-neutral `devframe` package documents its own `DF`-prefixed codes at the [Devframe docs site](https://devfra.me/errors/).
- Every error page includes the cause, recommended fix, and a reference to the source file that emits it.
- The diagnostics system is powered by [`nostics`](https://github.com/vercel-labs/nostics), which provides structured diagnostic codes with docs URLs and ANSI-formatted console output.

Expand Down Expand Up @@ -71,6 +71,18 @@ Emitted by `@vitejs/devtools-vitest`.
| [VTDT0001](./VTDT0001) | error | Vitest UI Install Failed |
| [VTDT0002](./VTDT0002) | error | Vitest UI Server Unreachable |

## Vite Task DevTools (VTKDT)

Emitted by `@vitejs/devtools-vite-task`.

| Code | Level | Title |
|------|-------|-------|
| [VTKDT0001](./VTKDT0001) | error | Vite Plus Executable Not Found |
| [VTKDT0002](./VTKDT0002) | error | Unsupported Vite Plus Version |
| [VTKDT0003](./VTKDT0003) | error | Vite Plus Command Failed |
| [VTKDT0004](./VTKDT0004) | error | Invalid Vite Plus JSON |
| [VTKDT0005](./VTKDT0005) | error | Invalid Task Name |

## Oxc DevTools (OXDT)

Emitted by `@vitejs/devtools-oxc`.
Expand Down
23 changes: 23 additions & 0 deletions docs/vite-task/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
outline: deep
---

# DevTools for Vite Task

DevTools for Vite Task (`@vitejs/devtools-vite-task`) lets you explore your Vite+ task graph and track down cache misses.

## What it does

Select a task from the list or graph to see its run plan. DevTools builds the plan with `vp run --dry-run`.

- **Task Flow** — follow the planned order of tasks and expand a task to inspect its steps. When a cached run is available, its duration appears next to the task or step.
- **Commands** — inspect each command and its cache status. **Inputs** and **Outputs** list the paths recorded for the cached run. Look under **Changes** to see which files or settings have changed since then.
- **Dependencies** — see what the selected task depends on and which tasks depend on it. Follow a link to inspect a related task.

After editing an input, click **Refresh tasks** to see how the change affects the plan.

## Getting started

Use `vite-plus` v1.6.0 or later in your workspace root. To set up Vite DevTools, follow [Getting Started](/guide/).

In the DevTools dock, open **Vite Task** under **Vite+**. If you see **Install @vitejs/devtools-vite-task**, click it and restart your dev server once the installation finishes.
Loading
Loading