fix(devframe)!: decouple docks/terminals/messages/commands from devframe#317
Merged
Conversation
Reposition devframe as the portable container for one devtool integration, and the kit as the hub that unites many of them. - Move DocksHost, TerminalsHost, MessagesHost, CommandsHost (plus associated types and built-in dock entries) from `devframe` into `@vitejs/devtools-kit`. Devframe's `DevToolsNodeContext` now exposes only `rpc`, `views`, `diagnostics`, `agent`, `host`, and the JSON renderer factory. - Add `createKitContext` (kit/node) that wraps `createHostContext` and attaches the four hub hosts plus optional `viteConfig`/`viteServer`. - Add `createPluginFromDevframe(d, opts?)` (kit/node) — the bridge from a portable `DevtoolDefinition` into a `Plugin.devtools.setup` Vite plugin. Auto-mounts the SPA via `views.hostStatic`, synthesizes an iframe dock entry from `id`/`name`/`icon`/`basePath`, runs the devtool's own `setup`, then runs the optional kit-only `opts.setup`. - Expose `devframe/internal` as a marked-internal subpath so kit's relocated `DocksHost` can reach `getInternalContext` and `resolveBasePath` without leaking into the public devframe API. - Delete `devframe/adapters/kit` + its package export. Switch core's `createDevToolsContext` to call `createKitContext`. Add new kit-side diagnostics (`DTK0050`–`DTK0057`) for the relocated host operations. - Move `ctx.utils.createSimpleClientScript` to a free function in `@vitejs/devtools-kit/node`; drop `ctx.utils` from devframe's context. - Move `ClientScriptEntry`, `RemoteConnectionInfo`, `DEFAULT_CATEGORIES_ORDER`, `DEFAULT_STATE_USER_SETTINGS`, and the client-side dock contexts (`DocksContext`, `DockEntryState`, etc.) to the kit. Devframe keeps only the JSON-render types and the framework-neutral RPC/view surface. - Update `AGENTS.md`/`CLAUDE.md` to lead with the devframe-vs-kit positioning. Migrate the Dock/Terminals/Commands/Messages docs and the corresponding error pages from the devframe site into the kit site (kit becomes the canonical home for hub-only references). Trim the `devframe` skill to the portable surface and point at the `vite-devtools-kit` skill for hub features. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…terminals # Conflicts: # AGENTS.md # devframe/docs/.vitepress/sidebar.ts # devframe/docs/guide/devtool-definition.md # devframe/docs/guide/dock-system.md # devframe/docs/guide/index.md # devframe/skills/devframe/SKILL.md # docs/.vitepress/config.ts
commit: |
…terminals # Conflicts: # devframe/docs/errors/DF0001.md # devframe/docs/errors/DF0002.md # devframe/docs/errors/DF0003.md # devframe/docs/errors/DF0004.md # devframe/docs/errors/DF0005.md # devframe/docs/errors/DF0009.md # devframe/docs/errors/DF0010.md # devframe/docs/errors/DF0011.md # devframe/docs/errors/DF0018.md # devframe/docs/errors/index.md # docs/errors/index.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Repositions devframe as the portable container for one devtool integration, and
@vitejs/devtools-kitas the hub that unites many of them.DocksHost,TerminalsHost,MessagesHost, andCommandsHost(plus their built-in dock entries, types, client-side contexts, and the dock-related constants) move fromdevframeinto the kit. Devframe'sDevToolsNodeContextnow exposes onlyrpc,views(HTTP file-serving),diagnostics,agent,host, and the JSON-render factory.The kit gains:
createKitContext— wrapscreateHostContextand attaches the four hub hosts plus optionalviteConfig/viteServer.createPluginFromDevframe(d, opts?)— bridges a portableDevtoolDefinitioninto aPlugin.devtools.setupVite plugin. Auto-mounts the SPA viaviews.hostStatic, synthesizes an iframe dock entry fromid/name/icon/basePath, runs the devtool's ownsetup, then runs the optional kit-onlyopts.setupso authors can register terminals / commands / custom-render docks without polluting the portable definition.DTK0050–DTK0057diagnostics range covering the relocated host operations (paired with newdocs/errors/DTK00xx.mdpages).Devframe exposes a marked-internal
devframe/internalsubpath so kit's relocatedDocksHostcan reachgetInternalContextandresolveBasePathwithout leaking those helpers into devframe's public API. The olddevframe/adapters/kitis deleted; core'screateDevToolsContextnow callscreateKitContext. Docs and skills are restructured to match the new positioning:AGENTS.mdleads with the framing, the dock / terminals / messages / commands guide pages move from the devframe site intodocs/kit/*, and thedevframeskill is trimmed to only cover the portable surface (with cross-links into thevite-devtools-kitskill for hub features).Linked Issues
Additional context
pnpm lint,pnpm typecheck,pnpm test(450/450),pnpm build(9/9 packages).packages/rolldown,packages/self-inspect) are unchanged at the source level — theirPlugin.devtools.setup(ctx)callbacks now implicitly receive aKitNodeContext(which is a structural superset of the oldDevToolsNodeContext).devframe/adapters/kitdirectly; ported thedevframe-files-inspectorexample tocreatePluginFromDevframefrom@vitejs/devtools-kit/node.🤖 Generated with Claude Code