Skip to content

Commit fd44126

Browse files
committed
chore: update
2 parents 176cb93 + 5d11ef7 commit fd44126

File tree

124 files changed

+7214
-3262
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+7214
-3262
lines changed

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,7 @@
3434
"json",
3535
"jsonc",
3636
"yaml"
37-
]
37+
],
38+
39+
"npm.exclude": "**/{docs,examples/**}"
3840
}

CONTRIBUTING.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,20 @@ You can check the [TODO list](https://github.com/vitejs/devtools/issues/9) (excl
1010

1111
## Setup
1212

13+
Requires `pnpm@10.x`.
14+
1315
```bash
1416
pnpm install
1517
pnpm build # Required: generates Rolldown meta under ./packages/rolldown/node_modules/.rolldown
16-
pnpm dev # Start dev server
18+
19+
# Start Rolldown devtools UI
20+
pnpm dev:rolldown
21+
# Start Vite devtools UI
22+
pnpm dev:vite
23+
# Core playground (host app with DevTools overlay)
24+
pnpm play
25+
# Standalone client dev
26+
pnpm play:standalone
1727
```
1828

1929
**Note**: After pulling latest commits, remove `./packages/rolldown/node_modules/.rolldown` and rebuild to get the latest data format.
@@ -42,8 +52,8 @@ Main entry point and core functionality.
4252

4353
Utility library for integration authors.
4454

45-
- TypeScript types and interfaces
46-
- Utilities for custom docks, views, panels
55+
- TypeScript types and interfaces for docks, views, panels
56+
- `defineRpcFunction` and shared state utilities
4757
- Event system utilities
4858
- RPC client helpers
4959

@@ -66,9 +76,21 @@ Built-in UI panel for Rolldown integration.
6676

6777
---
6878

79+
### `packages/vite` - `@vitejs/devtools-vite`
80+
81+
UI for Vite DevTools (WIP).
82+
83+
---
84+
85+
### `packages/ui` - `@vitejs/devtools-ui`
86+
87+
Shared UI components, composables, and UnoCSS preset (`presetDevToolsUI`).
88+
89+
---
90+
6991
### `packages/rpc` - `@vitejs/devtools-rpc`
7092

71-
RPC layer for component communication.
93+
Typed RPC wrapper over `birpc` with WebSocket presets.
7294

7395
- RPC client/server implementations
7496
- WebSocket presets
@@ -79,6 +101,12 @@ RPC layer for component communication.
79101

80102
---
81103

104+
### `packages/self-inspect` - `@vitejs/devtools-self-inspect`
105+
106+
Meta-introspection — DevTools for the DevTools itself.
107+
108+
---
109+
82110
### `packages/webext` - `@vitejs/devtools-webext`
83111

84112
Browser extension (planned for future dev mode). **Not accepting contributions currently.**
@@ -87,14 +115,16 @@ Browser extension (planned for future dev mode). **Not accepting contributions c
87115

88116
## Scripts
89117

90-
- `pnpm build` - Build all packages
91-
- `pnpm watch` - Watch mode
92-
- `pnpm dev` - Dev server
93-
- `pnpm lint` - ESLint
118+
- `pnpm build` - Build all packages (via turbo)
119+
- `pnpm watch` - Watch mode for all packages
120+
- `pnpm play` - Core playground (host app with DevTools overlay)
121+
- `pnpm play:standalone` - Standalone client dev
122+
- `pnpm dev:rolldown` - Rolldown UI dev server
123+
- `pnpm dev:vite` - Vite UI dev server
124+
- `pnpm docs` - VitePress docs dev server
125+
- `pnpm lint` - ESLint (pass `--fix` to auto-fix)
94126
- `pnpm test` - Vitest
95-
- `pnpm typecheck` - Type check
96-
97-
Package-specific: `pnpm -C packages/core run cli`, `pnpm -C packages/rolldown run dev`
127+
- `pnpm typecheck` - vue-tsc type check
98128

99129
## Workflow
100130

@@ -107,5 +137,5 @@ Package-specific: `pnpm -C packages/core run cli`, `pnpm -C packages/rolldown ru
107137

108138
- **core**: CLI in `cli-commands.ts`, server in `server.ts`, components in `client/webcomponents/`
109139
- **kit**: Keep APIs stable, add types for public APIs, consider backward compatibility
110-
- **vite**: Nuxt 3 app, Vue 3 Composition API, test with `pnpm dev` after build
140+
- **vite**: Nuxt 4 app, Vue 3 Composition API, test with `pnpm dev` after build
111141
- **rpc**: Keep methods type-safe, document new methods, test client/server

alias.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export const alias = {
1717
'@vitejs/devtools-kit/utils/events': r('kit/src/utils/events.ts'),
1818
'@vitejs/devtools-kit/utils/nanoid': r('kit/src/utils/nanoid.ts'),
1919
'@vitejs/devtools-kit/utils/human-id': r('kit/src/utils/human-id.ts'),
20+
'@vitejs/devtools-kit/utils/when': r('kit/src/utils/when.ts'),
2021
'@vitejs/devtools-kit/utils/shared-state': r('kit/src/utils/shared-state.ts'),
2122
'@vitejs/devtools-kit': r('kit/src/index.ts'),
2223
'@vitejs/devtools-rolldown': r('rolldown/src/index.ts'),

docs/.vitepress/config.ts

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const DevToolsKitNav = [
1414
{ text: 'Dock System', link: '/kit/dock-system' },
1515
{ text: 'RPC', link: '/kit/rpc' },
1616
{ text: 'Shared State', link: '/kit/shared-state' },
17+
{ text: 'Commands', link: '/kit/commands' },
18+
{ text: 'When Clauses', link: '/kit/when-clauses' },
1719
{ text: 'Logs & Notifications', link: '/kit/logs' },
1820
{ text: 'Terminals & Processes', link: '/kit/terminals' },
1921
{ text: 'Examples', link: '/kit/examples' },
@@ -30,7 +32,7 @@ const SocialLinks = [
3032
// https://vitepress.dev/reference/site-config
3133
export default extendConfig(withMermaid(defineConfig({
3234
title: 'Vite DevTools',
33-
description: 'Visualize and analyze your Vite build process with powerful developer tools. Extensible architecture for building custom DevTools integrations.',
35+
description: 'An extensible devtools framework for the Vite ecosystem. Build, compose, and integrate developer tools with a unified foundation.',
3436
head: [
3537
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
3638
],
@@ -40,6 +42,12 @@ export default extendConfig(withMermaid(defineConfig({
4042
// https://vitepress.dev/reference/default-theme-config
4143
nav: [
4244
{ text: 'Guide', link: '/guide/' },
45+
{
46+
text: 'Builtin DevTools',
47+
items: [
48+
{ text: 'DevTools for Rolldown', link: '/rolldown/' },
49+
],
50+
},
4351
{
4452
text: 'DevTools Kit',
4553
items: DevToolsKitNav,
@@ -58,7 +66,13 @@ export default extendConfig(withMermaid(defineConfig({
5866
text: 'Guide',
5967
items: [
6068
{ text: 'Getting Started', link: '/guide/' },
61-
{ text: 'Features', link: '/guide/features/' },
69+
],
70+
},
71+
{
72+
text: 'DevTools for Rolldown',
73+
items: [
74+
{ text: 'Introduction', link: '/rolldown/' },
75+
{ text: 'Features', link: '/rolldown/features' },
6276
],
6377
},
6478
{
@@ -69,6 +83,8 @@ export default extendConfig(withMermaid(defineConfig({
6983
{ text: 'Dock System', link: '/kit/dock-system' },
7084
{ text: 'RPC', link: '/kit/rpc' },
7185
{ text: 'Shared State', link: '/kit/shared-state' },
86+
{ text: 'Commands', link: '/kit/commands' },
87+
{ text: 'When Clauses', link: '/kit/when-clauses' },
7288
{ text: 'Logs', link: '/kit/logs' },
7389
{ text: 'JSON Render', link: '/kit/json-render' },
7490
{ text: 'Terminals', link: '/kit/terminals' },
@@ -94,7 +110,7 @@ export default extendConfig(withMermaid(defineConfig({
94110
title: 'Vite DevTools',
95111
items: [
96112
{ text: 'Guide', link: '/guide/' },
97-
{ text: 'Features', link: '/guide/features' },
113+
{ text: 'DevTools for Rolldown', link: '/rolldown/' },
98114
{ text: 'Release Notes', link: 'https://github.com/vitejs/devtools/releases' },
99115
{ text: 'Contributing', link: 'https://github.com/vitejs/devtools/blob/main/CONTRIBUTING.md' },
100116
],
@@ -103,6 +119,12 @@ export default extendConfig(withMermaid(defineConfig({
103119
title: 'DevTools Kit',
104120
items: DevToolsKitNav,
105121
},
122+
{
123+
title: 'Builtin DevTools',
124+
items: [
125+
{ text: 'DevTools for Rolldown', link: '/rolldown/' },
126+
],
127+
},
106128
],
107129
social: SocialLinks,
108130
},

docs/.vitepress/theme/Home.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ import Spacer from '@components/shared/Spacer.vue'
1111

1212
<HeadingSection
1313
heading="Inspect, Analyze, Extend"
14-
subheading="Vite DevTools not only provides built-in features, but also a extensible architecture for custom integrations."
14+
subheading="Vite DevTools provides an extensible framework with built-in integrations like DevTools for Rolldown, plus an open architecture for custom tools."
1515
/>
1616

1717
<FeatureGrid />
1818

1919
<Spacer />
2020

2121
<Footer
22-
heading="Understand your Vite App Better"
23-
subheading="Visually inspect modules, plugins, chunks, assets, packages..." button-text="Get Started"
22+
heading="Understand Your Vite Ecosystem Better"
23+
subheading="Inspect builds, analyze performance, extend with custom integrations..." button-text="Get Started"
2424
button-link="/guide/"
2525
/>
2626
</template>

docs/guide/index.md

Lines changed: 72 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,33 @@ outline: deep
44

55
# Getting Started
66

7-
> [!WARNING]
8-
> Vite DevTools currently only supports build mode of Vite 8+.
9-
> Dev mode and Vite versions under 8 are not supported yet.
10-
117
## What is Vite DevTools?
128

13-
Vite DevTools is a comprehensive set of developer tools for visualizing and analyzing your Vite build process. It provides deep insights into your build pipeline, module dependencies, and build metadata, helping you understand and optimize your Vite applications.
9+
Vite DevTools is a devtools framework for the Vite ecosystem. Instead of each tool building its own devtools from scratch, Vite DevTools provides shared infrastructure — a unified dock system, type-safe RPC, shared state management, and flexible UI hosting — so that different tools compose together seamlessly, users get a consistent experience, and tool authors can focus on what makes their integration unique.
10+
11+
Any Vite plugin can hook into Vite DevTools with just a few lines of code, instantly gaining access to the full platform: panels, action buttons, server-client communication, and more.
12+
13+
### Built-in Integrations
14+
15+
- **[DevTools for Rolldown](/rolldown/)** — Build analysis, module graphs, chunks, assets, plugins, and performance insights
16+
- **DevTools for Vite** — Vite-specific developer tools *(in development)*
17+
18+
### Ecosystem
19+
20+
Vite DevTools Kit is already powering a growing ecosystem of integrations:
21+
22+
- **[Nuxt DevTools v4](https://github.com/nuxt/devtools)** — Built on top of Vite DevTools Kit
23+
- **[Oxc Inspector](https://github.com/yuyinws/oxc-inspector)** — Integrates via DevTools Kit with custom RPC functions
24+
- **[UnoCSS Inspector](https://github.com/unocss/unocss)** — Dock integration for UnoCSS
25+
- **[vite-plugin-vue-tracer](https://github.com/antfu/vite-plugin-vue-tracer)** — Action button that triggers a DOM inspector
1426

1527
### Key Features
1628

17-
- **🔍 Build Analysis**: Visualize module graphs, dependencies, and build metadata
18-
- **📊 Performance Insights**: Understand build performance and bottlenecks
19-
- **🧩 Extensible**: Build custom DevTools integrations with the DevTools Kit
29+
- **🧩 Extensible Framework**: Any Vite plugin can extend the devtools with a simple hook
30+
- **🔍 [DevTools for Rolldown](/rolldown/)**: Built-in build analysis with module graphs, dependencies, and build metadata
2031
- **🎨 Unified Interface**: All DevTools integrations appear in a consistent dock interface
21-
- **⚡ Type-Safe**: Full TypeScript support with type-safe RPC communication
32+
- **🔌 Type-Safe RPC**: Built-in bidirectional communication between server and client
33+
- **⚡ Shared State**: Automatic synchronization of data between server and client
2234

2335
## Installation
2436

@@ -98,30 +110,71 @@ pnpm dev
98110

99111
Then open your app in the browser and open the DevTools panel.
100112

113+
#### Projects without an HTML entry
114+
115+
The embedded DevTools client is usually injected through Vite's `transformIndexHtml` hook. If your app does not start from an HTML entry, keep the `DevTools()` plugin enabled and import the client injector manually in your client entry instead:
116+
117+
```ts twoslash
118+
import '@vitejs/devtools/client/inject'
119+
```
120+
121+
This loads the same DevTools client that would normally be added to `index.html`. Put it in a browser entry such as `main.ts` or `entry.client.ts`, not in server-only files or shared SSR entry files.
122+
123+
If your project does have an HTML entry, avoid importing `@vitejs/devtools/client/inject` in addition to the HTML injection, as that would inject the client twice and create duplicate dock elements.
124+
125+
#### Building with the App
126+
127+
You can also generate a static DevTools build alongside your app's build output by enabling the `build.withApp` option:
128+
129+
```ts [vite.config.ts] twoslash
130+
import { DevTools } from '@vitejs/devtools'
131+
import { defineConfig } from 'vite'
132+
133+
export default defineConfig({
134+
plugins: [
135+
DevTools({
136+
build: {
137+
withApp: true, // generate DevTools output during `vite build`
138+
// outDir: 'custom-dir', // optional, defaults to Vite's build.outDir
139+
},
140+
}),
141+
],
142+
build: {
143+
rolldownOptions: {
144+
devtools: {},
145+
},
146+
}
147+
})
148+
```
149+
150+
When `build.withApp` is enabled, running `pnpm build` will automatically generate the static DevTools output into the build output directory. This captures real build data from the same build context, so DevTools can display accurate build analysis without a separate build step.
151+
101152
## What's Next?
102153

103154
Now that you have Vite DevTools set up, you can:
104155

105-
- **Explore the built-in tools**: Check out the various panels and visualizations available in the DevTools interface
106-
- **Build custom integrations**: Learn how to extend Vite DevTools with your own tools using the [DevTools Kit](/kit/)
156+
- **Explore the built-in tools**: Check out the [DevTools for Rolldown](/rolldown/) panels and visualizations
157+
- **Build custom integrations**: Learn how to extend the devtools with your own tools using the [Vite DevTools Kit](/kit/)
107158
- **Contribute**: Help improve Vite DevTools by checking out our [contributing guide](https://github.com/antfu/contribute)
108159

109160
## Current Limitations
110161

111162
> [!NOTE]
112-
> Vite DevTools is currently in active development with the following limitations:
163+
> Vite DevTools is currently in active development.
113164
114-
- **Build mode only**: Currently works with Vite-Rolldown's build mode
115-
- **Dev mode**: Not yet supported (planned for future releases)
116-
- **Vite Version**: Requires Vite 8 or higher versions for now
165+
- **[DevTools for Rolldown](/rolldown/)**: Currently supports build mode only, requires Vite 8+
166+
- **Dev mode**: Dev mode support is planned for future releases
117167

118168
## Architecture Overview
119169

120170
Vite DevTools consists of several core packages:
121171

122-
- **`@vitejs/devtools`**: The main entry point and CLI
123-
- **`@vitejs/devtools-kit`**: Utilities and types for building custom integrations
124-
- **`@vitejs/devtools-rolldown`**: Built-in UI panel for Rolldown
172+
- **`@vitejs/devtools`**: The core framework, CLI, and runtime hosts
173+
- **`@vitejs/devtools-kit`**: Vite DevTools Kit — utilities and types for building custom integrations
174+
- **`@vitejs/devtools-rolldown`**: [DevTools for Rolldown](/rolldown/) — built-in build analysis UI
175+
- **`@vitejs/devtools-vite`**: DevTools for Vite *(in development)*
125176
- **`@vitejs/devtools-rpc`**: RPC layer for server-client communication
126177

127-
For more details on extending Vite DevTools, see the [DevTools Kit documentation](/kit/).
178+
Third-party integrations like [Oxc Inspector](https://github.com/yuyinws/oxc-inspector) can also integrate via the DevTools Kit plugin API.
179+
180+
For more details on extending the devtools, see the [Vite DevTools Kit documentation](/kit/).

docs/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ theme: dark
44

55
hero:
66
name: Vite DevTools
7-
text: DevTools for Vite.
8-
tagline: Visualize and analyze your Vite build process with powerful developer tools
7+
text: DevTools Framework for the Vite Ecosystem.
8+
tagline: An extensible foundation for building and composing developer tools across the Vite ecosystem
99
actions:
1010
- theme: brand
1111
text: Get Started
@@ -19,11 +19,11 @@ hero:
1919

2020
features:
2121
- icon: 🔍
22-
title: Build Analysis
23-
details: Deep insights into your Vite-Rolldown build process. Visualize module graphs, dependencies, and build metadata to understand what's happening under the hood.
22+
title: DevTools for Rolldown
23+
details: Built-in integration for Rolldown build analysis. Visualize module graphs, dependencies, chunks, assets, and build metadata.
2424
- icon: 🧩
2525
title: Extensible Architecture
26-
details: Build custom DevTools integrations with the DevTools Kit. Extend any Vite plugin with a simple devtools hook to add your own visualizations and tools.
26+
details: Build custom DevTools integrations with the DevTools Kit. Any Vite plugin can extend the devtools with a simple hook to add visualizations, inspectors, and tools.
2727
- icon: 🚀
2828
title: Unified Dock System
2929
details: A familiar dock interface (like macOS Dock) where all DevTools integrations appear together. Switch between tools seamlessly in a consistent UI.

0 commit comments

Comments
 (0)