refactor(examples): standardize devframe tool examples to app/ + src/node/ + playgrounds/ - #341
Conversation
…node/ + playgrounds/ Apply the built-in plugin layout to the five examples that define a devframe: - files-inspector, streaming-chat (Preact): app/ = SPA, src/node/ = definition + rpc, playgrounds/ boots the built tool; dev serves the app with HMR + a live node bridge, play builds then runs the playground - sse-basic: extract the inline definition into src/node/, move the client into app/, keep the SSE-only bridge; add dev/play - next-runtime-snapshot (Next): app/ = the Next app, src/node/ = definition + rpc, scripts/build-spa.mjs uses a mode-explicit recursive copy; add playgrounds/ + play - json-render (no own SPA, reuses the prebuilt UI): consolidate the definition, dashboard, and shared code under src/node/; retarget the ./ and ./dashboard exports - update json-render/dashboard alias, tsconfig.base paths, and the next-runtime-snapshot knip postcss config The framework HOST examples (hub-*, a11y-messages-playground, demo-dock-client) mount devframes rather than defining one, so they keep their framework-idiomatic layouts.
◈ PR Lens
Architecture 23 components touched across 4 lanes. Inside the changed components — 4 viewsComponent view — Files Inspector Devframe Internal components of the Files Inspector tool separating the Preact SPA panel, Vite dev bridge plugin, Node RPC service, playground server, and CAC CLI. Component view — SSE Basic Devframe Modular decomposition of the SSE-only devframe into a dedicated Node definition, vanilla client SPA, Vite dev bridge, and standalone playground runner. Component view — Streaming Chat Devframe Internal architecture of the Streaming Chat tool separating the Preact chat panel, token streaming channels, Vite dev bridge, and playground host. Component view — Next Runtime Snapshot Devframe Next.js App Router client SPA, permission-normalizing static build packager, playground host, and runtime metrics RPC service. Data flow
The other flows — 2 sequences
Drill down
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
What
Apply the built-in plugin layout (now on main after #340) to the example projects that define a devframe, so the examples teach the same structure the plugins use:
Each restructured tool gets the convention's run scripts:
devserves the app with HMR while bridging the node side live (RPC + WebSocket/SSE +__connection.json), andplaybuilds then boots the playground against the built output.Per-example
app/= SPA,src/node/= definition +rpc/; newplaygrounds/server.mjs;dev= Vite + serve-only node bridge,play= build then playground.vite.config.tsintosrc/node/, moved the client intoapp/, kept it SSE-only; addeddev/play.app/= the Next app,src/node/= definition +rpc/;scripts/build-spa.mjsnow copies the static export with explicit file modes (Next's export trips node'scpSync); addedplaygrounds/+play.@devframes/json-render-ui): consolidated the definition, dashboard, and shared code undersrc/node/and retargeted the././dashboardexports; its CLI run flow is unchanged since it has no app to serve.Scope
The framework host examples (
hub-vite,hub-next, the minimal Nitro/SvelteKit/Deno/Fastify/Hono/Next/Vite hosts,a11y-messages-playground,demo-dock-client) mount devframes rather than defining one, so they keep their framework-idiomatic layouts (routes/, catch-all handlers, etc.). Only the five tool examples change.Reconciled
json-render/dashboardalias,tsconfig.base.jsonpaths, and thenext-runtime-snapshotknip PostCSS config.Validation
pnpm typecheck(cold cache): coverage OK + 39/39pnpm lint,pnpm knip: cleandevbridge andplayhost smoke-tested on the restructured tools (panel +__connection.jsonserved)This PR was created with the help of an agent.