Skip to content

Commit af5bcc6

Browse files
committed
docs: apply review feedback
- Restore the Nitro, Nuxt, and SvelteKit mount examples in the standard handler page. - Rename the guide nav group to 'Agentic'. - Drop the deprecated `def.cli?.distDir` fallback note from the build adapter. - Consolidate examples into a single guide/built-with page (Real-world DevTools / Builtin Plugins / Playable Examples) and remove the per-example docs pages; example READMEs serve that purpose. Repoint links accordingly. - Rework the Introduction to lead with what Devframe is, why it exists, and who it is for before the technical details. Created with the help of an agent.
1 parent 9df559c commit af5bcc6

27 files changed

Lines changed: 120 additions & 499 deletions

docs/.vitepress/config.ts

Lines changed: 7 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function guideGroups(prefix: string) {
5050
],
5151
},
5252
{
53-
text: 'Visual & agentic',
53+
text: 'Agentic',
5454
items: [
5555
{ text: 'Agent-Native', link: `${prefix}/guide/agent-native` },
5656
],
@@ -73,6 +73,12 @@ function guideGroups(prefix: string) {
7373
{ text: 'Build Your Own Hub UI', link: `${prefix}/guide/build-your-own-hub-ui` },
7474
],
7575
},
76+
{
77+
text: 'Ecosystem',
78+
items: [
79+
{ text: 'Built with Devframe', link: `${prefix}/guide/built-with` },
80+
],
81+
},
7682
] satisfies { text: string, items: DefaultTheme.NavItemWithLink[] }[]
7783
}
7884

@@ -121,27 +127,6 @@ function pluginsItems(prefix: string) {
121127
] satisfies DefaultTheme.NavItemWithLink[]
122128
}
123129

124-
function examplesItems(prefix: string) {
125-
return [
126-
{ text: 'Overview', link: `${prefix}/examples/` },
127-
{ text: 'Built with Devframe', link: `${prefix}/examples/built-with` },
128-
{ text: 'files-inspector', link: `${prefix}/examples/files-inspector` },
129-
{ text: 'json-render', link: `${prefix}/examples/json-render` },
130-
{ text: 'streaming-chat', link: `${prefix}/examples/streaming-chat` },
131-
{ text: 'next-runtime-snapshot', link: `${prefix}/examples/next-runtime-snapshot` },
132-
{ text: 'hub-vite', link: `${prefix}/examples/hub-vite` },
133-
{ text: 'hub-next', link: `${prefix}/examples/hub-next` },
134-
{ text: 'hub-vite-minimal', link: `${prefix}/examples/hub-vite-minimal` },
135-
{ text: 'hub-next-minimal', link: `${prefix}/examples/hub-next-minimal` },
136-
{ text: 'hub-nitro-minimal', link: `${prefix}/examples/hub-nitro-minimal` },
137-
{ text: 'hub-hono-minimal', link: `${prefix}/examples/hub-hono-minimal` },
138-
{ text: 'hub-fastify-minimal', link: `${prefix}/examples/hub-fastify-minimal` },
139-
{ text: 'hub-sveltekit-minimal', link: `${prefix}/examples/hub-sveltekit-minimal` },
140-
{ text: 'hub-deno-minimal', link: `${prefix}/examples/hub-deno-minimal` },
141-
{ text: 'hub-rsbuild-minimal', link: `${prefix}/examples/hub-rsbuild-minimal` },
142-
] satisfies DefaultTheme.NavItemWithLink[]
143-
}
144-
145130
export function devframeSidebar(prefix = ''): DefaultTheme.SidebarItem[] {
146131
return [
147132
{
@@ -165,10 +150,6 @@ export function devframeSidebar(prefix = ''): DefaultTheme.SidebarItem[] {
165150
text: 'Plugins',
166151
items: pluginsItems(prefix),
167152
},
168-
{
169-
text: 'Examples',
170-
items: examplesItems(prefix),
171-
},
172153
]
173154
}
174155

docs/adapters/build.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ await createBuild(devframe, {
2323
| Option | Default | Description |
2424
|--------|---------|-------------|
2525
| `outDir` | `dist-static` | Output directory (cleared). |
26-
| `distDir` | `def.clientAssets` (deprecated `def.cli?.distDir` fallback) | SPA dist override (or [remote assets](/guide/client-assets)). |
26+
| `distDir` | `def.clientAssets` | SPA dist override (or [remote assets](/guide/client-assets)). |
2727
| `pretty` | `false` | Pretty-print dump JSON. |
2828

2929
The client runs read-only. For a custom URL base, build with relative asset paths (`vite.base: './'`).

docs/adapters/initiate.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ export default defineConfig({
4040
})
4141
```
4242

43+
```ts [Nitro]
44+
// routes/__my-tool/[...path].ts
45+
// routes/__my-tool/index.ts
46+
// for the namespace root, since a catch-all doesn't match its own empty path.
47+
import { defineHandler } from 'nitro'
48+
import { devtools } from '../../devtools'
49+
50+
export default defineHandler(event => devtools.handler(event.req))
51+
```
52+
4353
```ts [Hono]
4454
// server.ts
4555
// `serve()` hands back the node server the socket rides on
@@ -71,6 +81,31 @@ const devtools = g.devtools ??= initDevframe(myDevframe, {
7181
export const GET = devtools.handler
7282
```
7383

84+
```ts [Nuxt]
85+
// server/middleware/devtools.ts
86+
import { devtools } from '../devtools'
87+
88+
export default defineEventHandler((event) => {
89+
const { pathname } = new URL(toWebRequest(event).url)
90+
// `devtools.base` is the normalized mount base — no repeated string.
91+
if (pathname.startsWith(devtools.base) || pathname === devtools.base.slice(0, -1))
92+
return devtools.handler(toWebRequest(event))
93+
})
94+
```
95+
96+
```ts [SvelteKit]
97+
// src/routes/%5F_my-tool/[...path]/+server.ts
98+
import myDevframe from '$lib/devframe'
99+
import { initDevframe } from 'devframe/initiate'
100+
101+
const g = globalThis as { devtools?: ReturnType<typeof initDevframe> }
102+
const devtools = g.devtools ??= initDevframe(myDevframe, {
103+
base: '/__my-tool/',
104+
ws: { sidecar: true },
105+
})
106+
export const GET = ({ request }) => devtools.handler(request)
107+
```
108+
74109
:::
75110

76111
Frameworks with dev-time module reloading (Next, Nitro, SvelteKit) re-evaluate the calling module, so memoize the instance on `globalThis` — otherwise every reload leaks the previous socket. `@devframes/next`'s `createDevframeNextHandler` does this for you.

docs/examples/built-with.md

Lines changed: 0 additions & 17 deletions
This file was deleted.

docs/examples/files-inspector.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/examples/hub-deno-minimal.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/examples/hub-fastify-minimal.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

docs/examples/hub-hono-minimal.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

docs/examples/hub-next-minimal.md

Lines changed: 0 additions & 28 deletions
This file was deleted.

docs/examples/hub-next.md

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)