Skip to content

refactor(devframe): remove Vite-specific coupling#314

Merged
antfu merged 2 commits into
mainfrom
antfu/audit-devframe-vite-coupling
May 7, 2026
Merged

refactor(devframe): remove Vite-specific coupling#314
antfu merged 2 commits into
mainfrom
antfu/audit-devframe-vite-coupling

Conversation

@antfu
Copy link
Copy Markdown
Member

@antfu antfu commented May 7, 2026

Description

Audit pass to make devframe more genuinely framework-neutral ahead of its eventual extraction. No host moves out — terminals / docks are universal devtool primitives — but the Vite-flavored leaks living in devframe are cleaned up:

  • Storage paths via DevToolsHost. New getStorageDir(scope) method on the host interface; each host owns its app-name namespace. Kit's vite-host hardcodes vite (no behaviour change — still node_modules/.vite/devtools/ and ~/.vite/devtools/); the standalone h3 host is parameterized via a new appName option, forwarded from def.id by the dev / build / mcp adapters.
  • docsBase repointed to https://devfra.me/errors in both diagnostics modules; doc/README/skill references updated to match.
  • Dead view.when ??= 'mode != build' default removed. The client WhenContext never injects mode, so the clause never reliably hid anything. Static-dump clients should filter remote docks via ConnectionMeta.backend === 'static' if needed.
  • mode: 'dev' | 'build' JSDoc clarified as "interactive vs. one-shot batch" so the inherited Vite vocabulary doesn't read as Vite-specific.
  • @devframes/nuxt extracted into a new sibling package (devframe/packages/nuxt/). devframe drops @nuxt/kit from peerDeps and the ./helpers/nuxt* exports. Old import path devframe/helpers/nuxt@devframes/nuxt.
  • Skill relocated to devframe/skills/devframe/ so it ships with the devframe workspace.

Linked Issues

Additional context

  • Pre-1.0 breaking surface change: anyone consuming devframe/helpers/nuxt needs to switch to @devframes/nuxt. The Nuxt module's configKey: 'devframe' is unchanged.
  • New required option on createH3DevToolsHost: appName: string. All in-tree call sites updated; downstream consumers building their own h3 host will need to add it.
  • pnpm-lock.yaml and packages/core/package.json churn is from pnpm install after adding the new package.

🤖 Generated with Claude Code

- Add `getStorageDir(scope)` to `DevToolsHost`. Hosts own their
  app-name namespace: kit's vite-host returns `.vite/devtools/` (no
  behaviour change), the standalone h3 host is parameterized via a new
  `appName` option (defaults forwarded from `def.id`).
- Repoint diagnostic `docsBase` from `devtools.vite.dev/devframe/` to
  `https://devfra.me/`. Updated docs / READMEs / skills to match.
- Drop the dead `view.when ??= 'mode != build'` default. The client
  `WhenContext` never injects `mode`, so this clause never reliably
  hid anything; static-dump clients should filter via
  `ConnectionMeta.backend === 'static'` if they need to.
- Document `mode: 'dev' | 'build'` semantics ("interactive vs.
  one-shot batch") so the names don't read as Vite-specific.
- Extract `helpers/nuxt/` into a new `@devframes/nuxt` package
  (`devframe/packages/nuxt/`). Drops `@nuxt/kit` from devframe's
  peerDeps and removes the `./helpers/nuxt*` exports.
- Move the `devframe` agent skill into the devframe workspace
  (`devframe/skills/devframe/`).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@314
npm i https://pkg.pr.new/@vitejs/devtools-kit@314
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@314
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@314

commit: 2dc1444

CI's `pnpm build` runs only tasks listed in `turbo.json`. Without the
`@devframes/nuxt#build` entry the new package's `dist/` was never
produced, and tsnapi snapshot tests for `@devframes/nuxt` fail with
ENOENT.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@antfu antfu merged commit eefe72e into main May 7, 2026
9 checks passed
@antfu antfu deleted the antfu/audit-devframe-vite-coupling branch May 7, 2026 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant