Skip to content

Commit 0f8a265

Browse files
committed
docs: restructure docs
1 parent 7162a2b commit 0f8a265

5 files changed

Lines changed: 41 additions & 39 deletions

File tree

docs/.vitepress/config.ts

Lines changed: 40 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@ function listErrorCodes(prefix: string): string[] {
1616
.sort()
1717
}
1818

19-
function guideItems(prefix: string): DefaultTheme.NavItemWithLink[] {
19+
function guideItems(prefix: string) {
2020
return [
2121
{ text: 'Introduction', link: `${prefix}/guide/` },
22-
{ text: 'Built with Devframe', link: `${prefix}/guide/built-with` },
2322
{ text: 'Devframe Definition', link: `${prefix}/guide/devframe-definition` },
2423
{ text: 'Scoped Context', link: `${prefix}/guide/scoped-context` },
2524
{ text: 'RPC', link: `${prefix}/guide/rpc` },
@@ -30,14 +29,13 @@ function guideItems(prefix: string): DefaultTheme.NavItemWithLink[] {
3029
{ text: 'Client', link: `${prefix}/guide/client` },
3130
{ text: 'Security', link: `${prefix}/guide/security` },
3231
{ text: 'Standalone CLI', link: `${prefix}/guide/standalone-cli` },
33-
{ text: 'Hub (multi-tool)', link: `${prefix}/guide/hub` },
32+
{ text: 'Hub', link: `${prefix}/guide/hub` },
3433
{ text: 'Client Scripts & Context', link: `${prefix}/guide/client-context` },
3534
{ text: 'Agent-Native (experimental)', link: `${prefix}/guide/agent-native` },
36-
{ text: 'Migrating to 0.6', link: `${prefix}/guide/migration-0.6` },
37-
]
35+
] satisfies DefaultTheme.NavItemWithLink[]
3836
}
3937

40-
function adaptersItems(prefix: string): DefaultTheme.NavItemWithLink[] {
38+
function adaptersItems(prefix: string) {
4139
return [
4240
{ text: 'Overview', link: `${prefix}/adapters/` },
4341
{ text: 'CLI', link: `${prefix}/adapters/cli` },
@@ -46,40 +44,41 @@ function adaptersItems(prefix: string): DefaultTheme.NavItemWithLink[] {
4644
{ text: 'Vite', link: `${prefix}/adapters/vite` },
4745
{ text: 'Embedded', link: `${prefix}/adapters/embedded` },
4846
{ text: 'MCP', link: `${prefix}/adapters/mcp` },
49-
]
47+
] satisfies DefaultTheme.NavItemWithLink[]
5048
}
5149

52-
function helpersItems(prefix: string): DefaultTheme.NavItemWithLink[] {
50+
function helpersItems(prefix: string) {
5351
return [
5452
{ text: 'Overview', link: `${prefix}/helpers/` },
5553
{ text: 'Utilities', link: `${prefix}/helpers/utilities` },
5654
{ text: 'Vite Bridge', link: `${prefix}/helpers/vite-bridge` },
5755
{ text: 'Nuxt Module', link: `${prefix}/helpers/nuxt` },
5856
{ text: 'Open Helpers', link: `${prefix}/helpers/open-helpers` },
5957
{ text: 'Interactive Auth', link: `${prefix}/helpers/interactive-auth` },
60-
]
58+
] satisfies DefaultTheme.NavItemWithLink[]
6159
}
6260

63-
function pluginsItems(prefix: string): DefaultTheme.NavItemWithLink[] {
61+
function pluginsItems(prefix: string) {
6462
return [
6563
{ text: 'Overview', link: `${prefix}/plugins/` },
6664
{ text: 'Devframe Inspector', link: `${prefix}/plugins/inspect` },
6765
{ text: 'Accessibility Inspector', link: `${prefix}/plugins/a11y` },
6866
{ text: 'Git', link: `${prefix}/plugins/git` },
6967
{ text: 'Terminals', link: `${prefix}/plugins/terminals` },
7068
{ text: 'Code Server', link: `${prefix}/plugins/code-server` },
71-
]
69+
] satisfies DefaultTheme.NavItemWithLink[]
7270
}
7371

74-
function examplesItems(prefix: string): DefaultTheme.NavItemWithLink[] {
72+
function examplesItems(prefix: string) {
7573
return [
7674
{ text: 'Overview', link: `${prefix}/examples/` },
75+
{ text: 'Built with Devframe', link: `${prefix}/examples/built-with` },
7776
{ text: 'files-inspector', link: `${prefix}/examples/files-inspector` },
7877
{ text: 'streaming-chat', link: `${prefix}/examples/streaming-chat` },
7978
{ text: 'next-runtime-snapshot', link: `${prefix}/examples/next-runtime-snapshot` },
8079
{ text: 'minimal-vite-devframe-hub', link: `${prefix}/examples/minimal-vite-devframe-hub` },
8180
{ text: 'minimal-next-devframe-hub', link: `${prefix}/examples/minimal-next-devframe-hub` },
82-
]
81+
] satisfies DefaultTheme.NavItemWithLink[]
8382
}
8483

8584
export function devframeSidebar(prefix = ''): DefaultTheme.SidebarItem[] {
@@ -104,31 +103,33 @@ export function devframeSidebar(prefix = ''): DefaultTheme.SidebarItem[] {
104103
text: 'Examples',
105104
items: examplesItems(prefix),
106105
},
107-
{
108-
text: 'Error Reference',
109-
link: `${prefix}/errors/`,
110-
collapsed: true,
111-
items: listErrorCodes('DF').map(code => ({
112-
text: code,
113-
link: `${prefix}/errors/${code}`,
114-
})),
115-
},
116106
]
117107
}
118108

119109
export function devframeNav(prefix = ''): DefaultTheme.NavItem[] {
120110
return [
121111
{ text: 'Guide', items: guideItems(prefix) },
122112
{ text: 'Adapters', items: adaptersItems(prefix) },
123-
{ text: 'Helpers', items: helpersItems(prefix) },
124-
{ text: 'Plugins', items: pluginsItems(prefix) },
125-
{ text: 'Examples', items: examplesItems(prefix) },
113+
{
114+
text: 'Resources',
115+
items: [
116+
{ text: 'Examples', link: `${prefix}/examples/` },
117+
{ text: 'Built with Devframe', link: `${prefix}/examples/built-with` },
118+
{ text: 'Helpers', items: helpersItems(prefix) },
119+
{ text: 'Plugins', items: pluginsItems(prefix) },
120+
],
121+
},
126122
{ text: 'Errors', link: `${prefix}/errors/` },
127123
{
128124
text: `v${pkg.version}`,
129125
items: [
130126
{ text: 'Release Notes', link: `${repo}/releases` },
131127
{ text: 'Contributing', link: `${repo}/blob/main/CONTRIBUTING.md` },
128+
{
129+
items: [
130+
{ text: 'Migrating to 0.6', link: `${prefix}/guide/migration-0.6` },
131+
],
132+
},
132133
],
133134
},
134135
]
@@ -146,7 +147,20 @@ export default withMermaid(defineConfig({
146147
themeConfig: {
147148
logo: { light: '/logo.svg', dark: '/logo.svg' },
148149
nav: devframeNav(),
149-
sidebar: devframeSidebar(),
150+
sidebar: {
151+
'/': devframeSidebar(),
152+
'/errors/': [
153+
{
154+
text: 'Error Reference',
155+
link: '/errors/',
156+
collapsed: true,
157+
items: listErrorCodes('DF').map(code => ({
158+
text: code,
159+
link: `/errors/${code}`,
160+
})),
161+
},
162+
],
163+
},
150164
search: {
151165
provider: 'local',
152166
},
File renamed without changes.

docs/examples/index.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ End-to-end examples that exercise the full adapter surface, each a runnable app
1414
| [minimal-vite-devframe-hub](./minimal-vite-devframe-hub) | Vanilla TypeScript (Vite) | A ~120-line Vite host wiring `@devframes/hub` end to end. |
1515
| [minimal-next-devframe-hub](./minimal-next-devframe-hub) | React (Next.js) | The same hub protocol, hosted from a Next.js route handler. |
1616

17-
## Two kinds of example
18-
19-
The first three are **single-tool devframes** — one `DevframeDefinition` deployed through the [adapters](/adapters/), showing how RPC, streaming, and a chosen SPA framework fit together.
20-
21-
The last two are **hub hosts** built on [`@devframes/hub`](/guide/hub). They are protocol witnesses: each is a small host that exercises every hub subsystem (docks, commands, messages, terminals) so you can read one file and see the whole shape. One is a Vite plugin; the other a Next.js route handler — same hub, different host runtime.
22-
2317
## Run any example
2418

2519
Each example ships its own scripts; from the repository root:

docs/guide/hub.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,10 @@
22
outline: deep
33
---
44

5-
# Hub (multi-tool)
5+
# Hub
66

77
`@devframes/hub` extends devframe with the orchestration features that only make sense when many devtools share a UI: a dock registry, terminal aggregation, message/toast queue, and a command palette. It does not ship UI — each framework kit (e.g. `@vitejs/devtools-kit`) provides its own UI on top of the hub's RPC + shared-state protocol.
88

9-
> [!WARNING] Experimental
10-
> The hub API surface is still being refined. Names may change before 1.0.
11-
129
## What the hub adds
1310

1411
A hub-aware node context (`DevframeHubContext`) extends `DevframeNodeContext` with four subsystems:

docs/guide/index.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ outline: deep
88

99
[Vite DevTools](https://devtools.vite.dev/) is built on top of devframe. If you need an integrated multi-tool host (docks, command palette, terminals, cross-tool toasts), mount your devframe into Vite DevTools via the [`vite` adapter](/adapters/vite) — or build your own host adapter targeting any environment you like.
1010

11-
> [!WARNING] Experimental
12-
> The Devframe API is still in development and may change between versions. The agent-native surface (`agent` on `defineRpcFunction`, `ctx.agent`, and the MCP adapter) is additionally flagged as experimental.
13-
1411
## Design principles
1512

1613
Devframe keeps its surface focused on one tool, so the same definition stays portable across runtimes:

0 commit comments

Comments
 (0)