Skip to content

Commit eefe72e

Browse files
antfuclaude
andauthored
refactor(devframe): remove Vite-specific coupling (#314)
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4c2f6c9 commit eefe72e

59 files changed

Lines changed: 301 additions & 486 deletions

Some content is hidden

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

alias.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ export const alias = {
3030
'devframe/adapters/kit': df('devframe/src/adapters/kit.ts'),
3131
'devframe/adapters/embedded': df('devframe/src/adapters/embedded.ts'),
3232
'devframe/adapters/mcp': df('devframe/src/adapters/mcp.ts'),
33-
'devframe/helpers/nuxt/runtime/plugin.client': df('devframe/src/helpers/nuxt/runtime/plugin.client.ts'),
34-
'devframe/helpers/nuxt': df('devframe/src/helpers/nuxt/index.ts'),
33+
'@devframes/nuxt/runtime/plugin.client': df('nuxt/src/runtime/plugin.client.ts'),
34+
'@devframes/nuxt': df('nuxt/src/index.ts'),
3535
'devframe/recipes/open-helpers': df('devframe/src/recipes/open-helpers.ts'),
3636
'devframe/client': df('devframe/src/client/index.ts'),
3737
'devframe': df('devframe/src'),

devframe/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ This directory is staged for extraction into a standalone repository. Until then
99
| Path | Description |
1010
|------|-------------|
1111
| [`packages/devframe`](./packages/devframe) | The published [`devframe`](https://www.npmjs.com/package/devframe) npm package. |
12-
| [`docs`](./docs) | VitePress documentation site, deployed at https://devtools.vite.dev/devframe/. |
12+
| [`docs`](./docs) | VitePress documentation site, deployed at https://devfra.me/. |
1313
| [`examples`](./examples) | End-to-end demos: [`devframe-counter`](./examples/devframe-counter) (smallest cross-adapter demo) and [`devframe-files-inspector`](./examples/devframe-files-inspector) (CLI dev/build/spa + Vite DevTools dock). |
1414
| [`tests`](./tests) | Public-API snapshot tests via [`tsnapi`](https://github.com/posva/tsnapi). |
1515

@@ -21,7 +21,7 @@ pnpm add devframe
2121

2222
## Documentation
2323

24-
See [https://devtools.vite.dev/devframe/](https://devtools.vite.dev/devframe/) for the full guide and API reference.
24+
See [https://devfra.me/](https://devfra.me/) for the full guide and API reference.
2525

2626
## Adapters
2727

devframe/docs/guide/devtool-definition.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ interface DevToolsNodeContext {
7373
readonly workspaceRoot: string
7474
readonly mode: 'dev' | 'build'
7575

76-
host: DevToolsHost // runtime abstraction (mountStatic / resolveOrigin)
76+
host: DevToolsHost // runtime abstraction (mountStatic / resolveOrigin / getStorageDir)
7777
rpc: RpcFunctionsHost // register + broadcast + sharedState
7878
docks: DevToolsDockHost // dock entries
7979
views: DevToolsViewHost // static file hosting

devframe/docs/guide/diagnostics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ docs/errors/
152152
MYP0002.md
153153
```
154154

155-
Each page covers the message, cause, example, and fix — see any [DF code page](https://devtools.vite.dev/devframe/errors/) for the canonical template. Set `docsBase` on `defineDiagnostics({...})` so the URL is auto-attached to every emitted diagnostic.
155+
Each page covers the message, cause, example, and fix — see any [DF code page](https://devfra.me/errors/) for the canonical template. Set `docsBase` on `defineDiagnostics({...})` so the URL is auto-attached to every emitted diagnostic.
156156

157157
## When to Use What
158158

devframe/docs/guide/nuxt.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ outline: deep
44

55
# Nuxt Helper
66

7-
The `devframe/helpers/nuxt` module wires a Nuxt-built SPA up as a devframe client. It's an integration helper, not a deployment adapter — it runs inside the Nuxt app that consumes your devtool, not as part of the CLI that serves it.
7+
The `@devframes/nuxt` module wires a Nuxt-built SPA up as a devframe client. It's an integration helper, not a deployment adapter — it runs inside the Nuxt app that consumes your devtool, not as part of the CLI that serves it.
88

99
It handles the three things every Nuxt-powered standalone devtool needs to get right:
1010

@@ -16,7 +16,7 @@ It handles the three things every Nuxt-powered standalone devtool needs to get r
1616

1717
```ts [nuxt.config.ts]
1818
export default defineNuxtConfig({
19-
modules: ['devframe/helpers/nuxt'],
19+
modules: ['@devframes/nuxt'],
2020
})
2121
```
2222

@@ -44,7 +44,7 @@ export function usePayload() {
4444

4545
```ts [nuxt.config.ts]
4646
export default defineNuxtConfig({
47-
modules: ['devframe/helpers/nuxt'],
47+
modules: ['@devframes/nuxt'],
4848
devframe: {
4949
baseURL: './', // where the devframe snapshot lives, relative to the page
5050
skipAppDefaults: false, // opt out of the app.baseURL / vite.base defaults
@@ -79,14 +79,14 @@ my-tool/
7979
├── bin.mjs # createCli(devtool).parse()
8080
├── src/
8181
│ ├── cli.ts # defineDevtool + setup(ctx) { ctx.rpc.register(...) }
82-
│ └── app/ # Nuxt SPA — uses `devframe/helpers/nuxt`
82+
│ └── app/ # Nuxt SPA — uses `@devframes/nuxt`
8383
└── dist/
8484
├── cli.mjs # bundled Node entry
8585
└── public/ # Nuxt build output, pointed at by cli.distDir
8686
```
8787

8888
- `createCli` (from `devframe/adapters/cli`) runs the Node side — HTTP + WS + static build + MCP.
89-
- `devframe/helpers/nuxt` handles the client side — RPC connection + base-URL plumbing.
89+
- `@devframes/nuxt` handles the client side — RPC connection + base-URL plumbing.
9090

9191
They're decoupled: swap Nuxt for any other SPA framework as long as it calls `connectDevtool()` in the browser.
9292

devframe/docs/guide/standalone-cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ For the Nuxt side, add the devframe helper module — it sets `app.baseURL: './'
9090
```ts [nuxt.config.ts]
9191
export default defineNuxtConfig({
9292
ssr: false,
93-
modules: ['devframe/helpers/nuxt'],
93+
modules: ['@devframes/nuxt'],
9494
nitro: {
9595
preset: 'static',
9696
output: { dir: './dist' }, // matches createCli's distDir of ./dist/public

devframe/examples/devframe-files-inspector/tests/_utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ export async function startInspectorServer(
7171
const origin = `http://${host}:${port}`
7272
const h3Host = createH3DevToolsHost({
7373
origin,
74+
appName: devtool.id,
7475
mount: (base, dir) =>
7576
app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true }))),
7677
})

devframe/examples/devframe-files-inspector/tests/kit-plugin.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ describe('kit-plugin (Vite DevTools dock surface)', () => {
1414
const mount = vi.fn()
1515
const host = createH3DevToolsHost({
1616
origin: 'http://test.localhost',
17+
appName: devtool.id,
1718
mount,
1819
})
1920
const ctx = await createHostContext({ cwd: process.cwd(), mode: 'dev', host })

devframe/examples/devframe-streaming-chat/tests/_utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export async function startStreamingChatServer(): Promise<StartedServer & {
4343
const origin = `http://${host}:${port}`
4444
const h3Host = createH3DevToolsHost({
4545
origin,
46+
appName: devtool.id,
4647
mount: (base, dir) =>
4748
app.use(base, fromNodeMiddleware(sirv(dir, { dev: true, single: true }))),
4849
})

devframe/packages/devframe/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pnpm add devframe
1010

1111
## Docs
1212

13-
See the [DevFrame documentation](https://devtools.vite.dev/devframe/) for the full guide and API reference.
13+
See the [DevFrame documentation](https://devfra.me/) for the full guide and API reference.
1414

1515
## Agent-Native (experimental)
1616

@@ -55,7 +55,7 @@ devframe mcp
5555

5656
`@modelcontextprotocol/sdk` is a peer dependency — add it to your package when you want to ship MCP support.
5757

58-
See the [Agent-Native guide](https://devtools.vite.dev/devframe/agent-native) for the full API, safety model, and Claude Desktop integration example.
58+
See the [Agent-Native guide](https://devfra.me/agent-native) for the full API, safety model, and Claude Desktop integration example.
5959

6060
## License
6161

0 commit comments

Comments
 (0)