feat!: remove per-plugin vite wrappers; export hub base constants from @devframes/hub/constants - #238
Open
antfubot wants to merge 1 commit into
Open
feat!: remove per-plugin vite wrappers; export hub base constants from @devframes/hub/constants#238antfubot wants to merge 1 commit into
antfubot wants to merge 1 commit into
Conversation
…m @devframes/hub/constants
Deletes three drift-prone hand-copy clusters:
- plugins/{a11y,assets,data-inspector,inspect,messages,og}/src/vite.ts
— each an 8-25 line rename over devframeVite(def, options) from
@devframes/vite/dev-spa, and the sole reason those plugins depended
on @devframes/vite. Consumers now call devframeVite() directly
against the plugin's default export; @devframes/vite moves to
devDependencies where it's still needed for the plugin's own SPA
dev config. plugin-code-server's codeServerVite and
plugin-terminals's terminalsVite are unaffected — they compose a
bridge + static plugin and build their devframe from options, which
is real behaviour beyond delegation, not a mirror.
- DEVFRAMES_HUB_BASE hand-copied across packages/{vite,nuxt,next}'s
hub-client wrappers (each commented "mirrors @devframes/hub's").
Now defined once in the client-safe packages/hub/src/constants.ts
and imported everywhere; packages/hub/src/node/initiate.ts
re-exports it for existing importers of that entry.
- normalizeBase reimplemented ×4 with two different mechanisms (ufo
vs hand-rolled). One canonical normalizeHubBase (ufo-based, hub
already depends on ufo) now lives next to the constant and is used
by @devframes/hub itself and all three framework adapters.
Also deletes packages/hub-ui/src/client/state/renderers.ts, a
30-line shim that only delegated to createDockRenderersContext; its
one call site now calls that directly.
Breaking: the six plugins' /vite export subpath is gone. Migration
documented in docs/guide/migration-0.9.md.
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.
Intent
Deletes three drift-prone hand-copy clusters described in plan 040 ("delete the mirror fringe"). Each was a shallow module — a rename, a hand-copied constant, or a re-implemented helper — with a single canonical home elsewhere in the codebase. This is an intentional breaking change during the 0.9 beta window; there is no deprecation cycle.
A. Six per-plugin
vite.tswrappers deletedplugins/{a11y,assets,data-inspector,inspect,messages,og}/src/vite.tswere each an 8–25 line rename overdevframeVite(def, options)from@devframes/vite/dev-spa, and the sole reason those six plugins depended on@devframes/vite. Deleted, along with their/viteexport subpath,tsdown.config.tsentry, and the now-stale@devframes/vitedependenciesentry (moved todevDependencies, since each plugin's ownsrc/spa/vite.config.tsstill usesdevframeVitedirectly to dogfood the plugin duringpnpm dev/build). Every doc, README, and internalvite.config.tsthat imported the wrapper now callsdevframeVite(pluginDevframe, options)directly.plugin-code-server'scodeServerViteandplugin-terminals'sterminalsViteare intentionally left alone (a STOP condition in the plan) — inventory found they aren't pure delegation: each composesdevframeViteBridge+devframeVitePlugintogether (two plugins where the other six use exactly one) and builds its devframe from the passed options viacreateCodeServerDevframe/createTerminalsDevframe, rather than importing a static default export. That's real behavior, not a mirror.B.
DEVFRAMES_HUB_BASEhand-copied ×4Previously defined in
packages/hub/src/node/initiate.tsand hand-copied (each commented "mirrors@devframes/hub's") intopackages/vite/src/hub-client.ts,packages/nuxt/src/hub.ts,packages/nuxt/src/hub-client.ts, andpackages/next/src/hub-client.tsx. Now defined once in the client-safepackages/hub/src/constants.ts(already a published@devframes/hub/constantssubpath, and confirmed to stay client-safe — it only adds a plain string constant and a pure string-manipulation helper backed byufo, a package hub already depends on).node/initiate.tsre-exports it for existing importers of that entry (no user-facing break there).C.
normalizeBasereimplemented ×4Two different mechanisms were in play (
ufoinhub/node/initiate.tsandnext/src/hub.ts; hand-rolled string concatenation invite/src/hub.tsandnuxt/src/hub.ts). Consolidated into onenormalizeHubBase(ufo-based, since@devframes/hubalready depends onufo) exported next to the constant, and every call site —@devframes/hubitself plus all three framework adapters — now imports it instead of keeping a local copy.Also deleted
packages/hub-ui/src/client/state/renderers.ts, a 30-line shim that only delegated tocreateDockRenderersContext; its one call site (state/context.ts) now calls that directly.Breaking change
The six plugins'
/viteexport subpath (a11yVitePlugin,assetsVitePlugin,dataInspectorVitePlugin,inspectVitePlugin,messagesVitePlugin,ogVitePlugin) is gone. Migration documented indocs/guide/migration-0.9.md(new "Built-in plugins'/vitesubpath is removed" section + overview table row).Verification
pnpm lint && pnpm knip && pnpm test && pnpm typecheck && pnpm build— all green. The four@devframes/hubAPI snapshots that changed (constants/initiate, runtime + dts) were regenerated deliberately withTSNAPI_ALLOW_BREAKING=1(the narrowedDEVFRAMES_HUB_BASEre-export is the intended, non-breaking-in-practice shape — same value, now sourced from one place). The six deleted plugins' stale/viteAPI snapshots were removed.examples/hub-viteend-to-end (pnpm dev, which exercisesviteDevframeHub→@devframes/hub'sinitHub→ the newnormalizeHubBase/DEVFRAMES_HUB_BASE): every built-in plugin dock — includingcode-serverandterminals, whose wrappers were kept — mounted and served200at/__devframes/<id>/, and/__devframes/__index.jsonlisted all frames correctly.Impact
61 files changed, +143/−365 lines. Kills four drift-prone hand-copies and drops
@devframes/vitefrom six plugins' runtime dependency graph.Created with the help of an agent.