refactor(plugins): standardize built-in plugin layout (app/ + src/{node,client-script} + playgrounds/) - #340
Conversation
… + playgrounds/ Establish the canonical built-in plugin layout on a11y: - app/ holds the framework SPA (was src/spa), built by Vite into the --assets package - src/node/ holds all node-side code (definition, setup, cli, rpc) - src/client-script/ holds both browser scripts (client runtime + page script), built by tsdown - playgrounds/ holds the same-origin playground host (was demo/) - dev serves the panel under its base path with HMR + a live node-side bridge - play builds then boots the playground against the built plugin - rename the ./client export subpath to ./client-script
…pector to app/ + src/{node,client-script} + playgrounds/
Apply the a11y layout to the five model-fitting plugins:
- app/ holds the framework SPA (Vite-built into each --assets package)
- src/node/ consolidates all node-side code (definition, setup, cli, rpc, constants/types/vite, engine/registry where present)
- src/client-script/ holds the browser scripts (client runtime, and the injected page script for data-inspector), built by tsdown
- playgrounds/ boots the built plugin via the play script; dev serves the panel with HMR + a live node bridge
- rename ./client to ./client-script (and ./inject to ./client-script/page-script for data-inspector)
- regenerate alias.ts, tsconfig.base.json paths, knip entries, and API snapshots
… typecheck Adapt the new layout to the three divergent plugins: - messages (Vue) and terminals (Svelte): app/ holds the SPA host plus the Vite-built component library; tsdown builds src/node only; keep the ./client component-lib export; add dev (HMR + node bridge), play, and playgrounds/ - git (Next.js): app/ holds the Next app, src/node/ holds the definition + cli; tsdown builds node, Next builds the app; repoint build/dev scripts and configs - inspect: drop the load-bearing composite tsconfig so its package typechecks fresh (not just via turbo cache), fixing the pre-existing latent type errors it masked (distributive Omit for the history record, string-widened RPC method wrappers, definitions.get access, widened connection backend union, and export DevframeInspectCommandInfo from the root for the dev-server test) - reconcile alias.ts, tsconfig.base.json paths, knip entries, and API snapshots
Next's static export emits entries with restrictive modes that node's cpSync inherits and then trips over (EACCES); recreate the tree with explicit directory/file permissions instead.
◈ PR Lens
Architecture 18 components touched across 5 lanes. Inside the changed components — 3 viewsComponent view — A11y Inspector Architecture Internal modules and runtime communication channels within the accessibility inspector plugin. Component view — Data Inspector Architecture Internal components of the data inspector including the Vue workbench, isomorphic query engine, and source registry. Component view — Code Server Architecture Launcher UI and process supervisor components for the code-server plugin. Data flow
The other flows — 1 sequence
Drill down
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…+ playgrounds/ layout
…ect wrapper Rename the browser/injected surface for clarity, per review: - a11y: the injected browser script is now ./client-script (src/client-script/index.ts, no page-script subfolder); drop the confusing 'page script' term. Keep a11yClientScriptBundlePath (deprecated aliases for the old names). - data-inspector: the node --import module is now ./inject (src/inject/, restored name), since it runs in the user's Node process, not the browser. - inspect/og/assets/code-server: the connectX wrapper was only used by each plugin's own SPA, so move it into app/connect.ts and drop the ./client-script export; these plugins now build only their node side with tsdown. Trim the barrel to the types the app actually uses. - reconcile alias.ts, tsconfig.base.json paths, knip entries, and API snapshots
inspect no longer needs the composite tsconfig that made it opt out of the typecheck gate; it now typechecks cleanly, so remove the exception (its presence fails verify-typecheck-coverage once the package has a typecheck script).
What
Restructure all nine built-in plugins to one consistent layout, so each plugin cleanly separates its frontend web app, node side, injected browser scripts, and playground:
src/nodeandsrc/client-script; the framework (Vite) buildsapp.devmounts the usable web app in dev mode with HMR while bridging the node side live (RPC + WebSocket +__connection.json), mounted as a post-middleware so Vite serves the HMR SPA and the devframe host only answers its own routes.playbuilds first, then boots a playground against the built plugin../clientbecomes./client-script(and a11y/data-inspector./injectbecomes./client-script/page-script); node subpaths retarget underdist/node/.Per-plugin shape
app/holds the SPA host plus the Vite-built component library; tsdown buildssrc/nodeonly; the./clientcomponent-library export is kept.app/holds the Next app,src/node/holds the definition and cli; tsdown builds node, Next builds the app.Incidental fixes
composite: truetsconfig that only passed via turbo cache, and fixed the pre-existing latent type errors it masked, so the package typechecks from a cold cache like every other plugin.cpSyncwas hitting EACCES).alias.ts,tsconfig.base.jsonpaths,knip.jsoncentries, and thetsnapiAPI snapshots to match.Validation
pnpm lint,pnpm knip: cleanpnpm typecheck(--force, cold cache): 39/39devbridge smoke-tested on a11y, og, and messages (panel +__connection.jsonserved with HMR)Note: two unrelated Next examples (
next-runtime-snapshot) hit a pre-existing environment-onlycpSync/Next-export EACCES in the sandbox during a fullpnpm build; that code is untouched here and fails the same way onmainin this environment.This PR was created with the help of an agent.