Skip to content

feat(plugins): serve every builtin plugin's SPA from a lockstep assets package - #244

Merged
antfu merged 1 commit into
mainfrom
feat/plugins-assets
Aug 17, 2026
Merged

feat(plugins): serve every builtin plugin's SPA from a lockstep assets package#244
antfu merged 1 commit into
mainfrom
feat/plugins-assets

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Stacked on #239

Base branch is feat/plugin-inspect-client (#239#236). Extends the inspect pilot to every remaining builtin plugin.

What

Each builtin plugin's iframe SPA now ships in a lockstep @devframes/plugin-<name>--assets package instead of the node tarball, served on demand through the remote-assets back-proxy. Converted: og, data-inspector, code-server, assets, messages, terminals, a11y, git.

  • The Vite build (or git's Next static export) emits into plugins/<name>/assets-pkg/dist.
  • cli.distDir points at a RemoteAssets declaration ({ package, version, resolveFrom }).
  • Panel clientScript bundles (messages/terminals dist/client) and a11y's dist/inject host-page agent stay in their node packages — only the iframe SPA moves.

Optional peer dependency

Each plugin declares its --assets package as an optional peer dependency (peerDependenciesMeta.optional) so it resolves cleanly when a consumer installs it, alongside the dev-only workspace:* link that lets resolveFrom find the local build in this monorepo. This optional-peer declaration is also added to the inspect pilot for consistency.

Wiring

  • turbo.json: each plugin build declares assets-pkg/dist/** as an output (nested-package outputs, cache-restored).
  • knip.jsonc: per-plugin ignoreDependencies (the --assets string ref) + assets-only package overrides.
  • Each plugin's test harness resolves the SPA via resolveStaticAssetsSource (monorepo link → local dir).
  • pnpm-workspace.yaml's plugins/*/assets-pkg glob (from feat(plugin-inspect): serve the SPA from a lockstep assets package #239) already covers the new packages.

Verification

typecheck 30/30 · unit tests 1162 pass (9 skipped: tsnapi no-exports for the 9 assets-only packages) · lint clean · knip clean · full build green · confirmed each plugin's dist/spa (git's dist/client) moved to assets-pkg/dist and out of the node package.


Created with the help of an agent.

@antfu
antfu changed the base branch from feat/plugin-inspect-client to main August 17, 2026 01:37
…s package

Extends the deferred-assets pattern (piloted on plugin-inspect) to all
remaining builtin plugins: og, data-inspector, code-server, assets,
messages, terminals, a11y, and git. Each plugin's iframe SPA now ships in
a lockstep `@devframes/plugin-<name>--assets` package instead of the node
tarball — the Vite build (or git's Next export) emits into assets-pkg/dist,
and cli.distDir points at a RemoteAssets declaration. Panel clientScript
bundles (messages/terminals dist/client) and a11y's dist/inject agent stay
in their node packages.

Each plugin declares its `--assets` package as an optional peer dependency
(so it resolves when a consumer installs it) alongside the dev-only
workspace link (so resolveFrom finds the local build in the monorepo);
this optional-peer declaration is also added to the inspect pilot.

Wires per-plugin turbo outputs (assets-pkg/dist), knip overrides, and
updates each plugin's test harness to resolve the SPA via
resolveStaticAssetsSource.
@antfubot
antfubot force-pushed the feat/plugins-assets branch from 8a1e85e to aa3d2e1 Compare August 17, 2026 01:52
@netlify

netlify Bot commented Aug 17, 2026

Copy link
Copy Markdown

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit aa3d2e1
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a826969d0a44e0008cb5253
😎 Deploy Preview https://deploy-preview-244--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu
antfu merged commit f95a3a9 into main Aug 17, 2026
12 checks passed
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.

2 participants