feat(code-server): multi-backend + tunnel, reuse/startOnBoot, Vue launcher#117
Merged
Conversation
…ncher
Bring the code-server plugin toward Nuxt DevTools feature parity and rewrite
its launcher on the shared @antfu/design Vue stack.
- backends: Coder `code-server` (session cookie) and Microsoft `code serve-web`
(connection token via ?tkn=), selected by `backend` or auto-detected
- tunnel mode: `code tunnel` embedding vscode.dev, surfacing the device-login
prompt while it authenticates
- `reuseExistingServer` adopts a server already answering on the target port
- `startOnBoot` launches during setup instead of on demand
- generalize the auth handoff into a backend-aware `CodeServerConnect`
(cookie / query token / absolute URL); detection now reports backend + mode
- rewrite the launcher as a Vue SPA (App/LauncherView/EditorFrame/
ConnectionOverlay + composables), dropping the vanilla-DOM view and
iframe-pane; Storybook moves to @storybook/vue3-vite
Also fix a pre-existing devframe core typing bug: indexing the key-remapped
`Scoped{Server,Client}Functions<NS>` maps with a generic tripped TS2536 once a
plugin augmented the RPC registry. Resolve the scoped name through the plain
registry behind a keyof guard (`ScopedRpcFn`), restoring code-server's
typecheck without changing scope call ergonomics.
Created with the help of an agent.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
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.
What & why
Brings
@devframes/plugin-code-servertoward Nuxt DevTools feature parity (items 1, 3, 4, 5 from the research pass) and rewrites its launcher on the shared@antfu/designVue stack so it looks and behaves like the other devframe surfaces. Legacy options/tools support was intentionally dropped.Feature parity
code-server(password + session cookie, kept) and Microsoftcode serve-web(connection token via?tkn=). Pick withbackend, or leave unset to auto-detect (code-server→code serve-web).mode: 'tunnel'runscode tunneland embedsvscode.dev, surfacing the device-login prompt (verification URL + code) while it authenticates.start()resolves as soon as the login prompt or the tunnel URL appears, so it never blocks on interactive auth.reuseExistingServer— adopts a server already answering a health probe on the target port instead of spawning (auto-auth only applies to servers we launch).startOnBoot— launches during setup instead of waiting for the launcher button.The auth handoff is generalized into a backend-aware
CodeServerConnect(session cookie / query token / absolute tunnel URL), returned only fromstart/statusand never published to shared state. Detection now reportsbackend+mode.Vue rewrite
The vanilla-DOM launcher (
view.ts,design.ts,connection-state.ts,iframe-pane) is replaced by a Vue SPA undersrc/spa/—App.vue(smart) plus presentationalLauncherView.vue/EditorFrame.vue/ConnectionOverlay.vueandrpc/code-servercomposables, importing@antfu/designcomponents directly like theinspectplugin. The persistent iframe survives transient restarts viav-show; the port-agnostic cookie trick is retained. Storybook moves to@storybook/vue3-vitewith per-phase stories. The/cliententry is now a thinconnectCodeServerconnector.Core typing fix
Indexing the key-remapped
Scoped{Server,Client}Functions<NS>maps with a generic trippedTS2536once a plugin augmented the RPC registry (which every real plugin does) — surfacing as 8 pre-existing errors incode-server's typecheck. Resolved by looking the scoped name back up through the plain registry behind akeyofguard (ScopedRpcFn), keeping scope call ergonomics intact.Verification
pnpm build(tsdown + Vite SPA) ✓ ·pnpm build-storybook✓pnpm typecheck(full repo) ✓ 15/15 ·pnpm lint✓@antfu/designcomponents and serves__connection.json(no browser available on the ARM64 sandbox for a screenshot)This PR was created with the help of an agent.