feat(plugin-inspect): serve the SPA from a lockstep assets package - #239
Open
antfubot wants to merge 3 commits into
Open
feat(plugin-inspect): serve the SPA from a lockstep assets package#239antfubot wants to merge 3 commits into
antfubot wants to merge 3 commits into
Conversation
…kage Pilot of the deferred-client-assets pattern: the inspector's Vue SPA now ships in a new @devframes/plugin-inspect-client package instead of inside the node tarball, which drops from ~409 KB (90% SPA) to ~18 KB. Its Vite build emits into plugins/inspect/client-pkg/dist, and cli.distDir points at a RemoteAssets declaration (package + version + resolveFrom). In this monorepo the client package is a dev-only workspace link, so resolveFrom short-circuits to its built dist (zero network); published consumers get the assets on demand through devframe's caching CDN back-proxy, or by installing the client package for an offline/air-gap UI. Wires the nested workspace glob (plugins/*/client-pkg), turbo outputs, a knip override for the runtime-string dependency, and updates the plugin's test harness to resolve the source.
'client' is overloaded in devframe (devframe/client is the RPC client;
each plugin's ./client export is its panel script), so a package holding
prebuilt browser assets reads wrong as '…-client'. Rename
@devframes/plugin-inspect-client -> @devframes/plugin-inspect-assets and
the directory client-pkg -> assets-pkg, and adopt '${pkg.name}-assets' as
the convention for deferred SPA-asset packages.
Separate the '--assets' companion suffix from the plugin's own name
segments: @devframes/plugin-inspect-assets -> @devframes/plugin-inspect--assets.
The '--' makes the auto-derived assets package visually distinct from a
plugin whose name legitimately ends in a single-dash segment. Convention
is now '${pkg.name}--assets'; the directory stays plugins/*/assets-pkg.
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.
Stacked on #236
Base branch is
feat/remote-client-assets(the remote-assets engine), notmain— review/merge #236 first. This PR is the wave-1 pilot that proves the deferred-assets pattern end to end on one plugin.What
The inspector's Vue SPA moves out of the
@devframes/plugin-inspectnode tarball into a new lockstep-versioned@devframes/plugin-inspect--assetspackage:dist/client).cli.distDirnow points at aRemoteAssetsdeclaration —{ package: '@devframes/plugin-inspect--assets', version: pkg.version, resolveFrom: import.meta.url }.plugins/inspect/assets-pkg/dist; the assets package ships just thatdistto npm.Naming:
${pkg.name}--assetsTwo decisions:
assets, notclient— 'client' is overloaded in devframe (devframe/clientis the RPC clientconnectDevframe; each plugin's./clientexport is its panel script). A package of prebuilt browser assets is…--assets.Directory convention:
plugins/*/assets-pkg.Resolution (unchanged engine from #236)
workspace:*link, soresolveFromshort-circuits to its builtdistwith zero network. Air-gapped users get the same bynpm install-ing it.@devframes/plugin-inspect--assets@<version>/dist/…for everyone else, on demand.Wiring
pnpm-workspace.yaml: newplugins/*/assets-pkgglob.turbo.json: the plugin build declaresassets-pkg/dist/**as an output (verified cache-hit restores it).knip.jsonc: override for the runtime-string dependency + the assets-only package.distDirviaresolveStaticAssetsSource(monorepo link → local dir).bumpp -r.Verification
typecheck 30/30 · unit tests 1162 pass (1 skipped: tsnapi no-exports for the assets-only pkg) · lint clean · knip clean · full build green · turbo cache restores the nested dist.
Follow-ups (rest of wave 1)
The remaining 8 plugins +
json-render-ui, and the community docs guide — each mirrors this shape.Created with the help of an agent.