Skip to content

feat(hub): bake mounts outside the hub base as deploy-root siblings - #355

Merged
antfu merged 1 commit into
mainfrom
fix/hub-bake-sibling-layout
Sep 4, 2026
Merged

feat(hub): bake mounts outside the hub base as deploy-root siblings#355
antfu merged 1 commit into
mainfrom
fix/hub-bake-sibling-layout

Conversation

@antfubot

@antfubot antfubot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

What

buildHub's resolveOutPath threw DF8006 for any mount whose URL base didn't start with the hub base, so it could only bake a hub where every devframe mounts under the hub base. Vite DevTools serves its hub at /__devtools/ but keeps its devframe SPAs and vendored assets as top-level siblings (/__devframes_plugin_inspect/, /__devtools-assets/), so buildHub({ context }) couldn't bake that layout.

This relaxes resolveOutPath (option 2 from the issue): a mount under the hub base still writes into outDir (the hub subtree), and any other absolute base resolves to outDir's parent — the deploy root — by its absolute path. No new option; per-frame metas and the index follow automatically since they already read ctx.frames + ctx.views.buildStaticDirs.

DF8006 now only fires for a non-absolute base, and its message/docs page are updated to match.

Why

The hub base is a protocol namespace deliberately distinct from where each integration's SPA and assets are served. A deploy-root layout where the hub base and the devframe/asset bases are siblings under a common root is a legitimate deploy shape, and this was the last gap before Vite DevTools can retire its hand-rolled build-static.ts and bake purely through buildHub.

Closes #353.

This PR was created with the help of an agent.

Relax buildHub's resolveOutPath so a mount base outside the hub base
resolves to outDir's parent (the deploy root) by its absolute path,
with the hub subtree still at outDir. This lets buildHub bake a context
whose devframe SPAs and assets are served as top-level siblings of the
hub base (Vite DevTools' layout) rather than children of it.

Closes #353
@coldtea-pr-lens

coldtea-pr-lens Bot commented Sep 4, 2026

Copy link
Copy Markdown

◈ PR Lens

🟢 +0 new · 🟠 ~2 changed · 🔴 -0 removed · 1 flow · 6 files · commit 44f7054


Architecture

Architecture diagram for devframes/devframe at 44f7054

2 components touched across 3 lanes.

Open full size


Data flow

Data flow diagram for devframes/devframe at 44f7054

Baking static hub with sibling mounts

Open full size


Drill down
Hub Orchestration — 2 components
🟡 CHANGED Hub Static Builder

Resolves mount URL bases to disk paths, writing mounts under base into outDir and absolute mounts outside base into deployRoot.

🟡 CHANGED Hub Core & Lifecycle

Defines diagnostic error DF8006, updated to trigger only when a mount URL base is neither under the hub base nor an absolute path.


View

  • Architecture lens
  • Data flow lens
  • Expand every detail
  • Show unchanged neighbours

Tip

Draw a diff before it is even a pull request: npx @coldtea/pr-lens-cli analyze --base origin/main reads the diff with your own model key, and npx @coldtea/pr-lens-cli render .pr-lens/graph.json draws the same lenses on your machine.

🪧 More tips
  • Run PR Lens on your own machine: npx skills add coldteadotai/pr-lens installs the agent skill. Then tell your coding agent: "Diagram the change you just made with PR Lens and attach it to the pull request."
  • The boxes under View are live. Tick Architecture lens or Data flow lens to choose which diagrams appear, or Expand every detail to open every drill-down at once. The comment redraws in place a few seconds later.
  • Show unchanged neighbours lists the components this change did not touch alongside the ones it did, so the drill-down shows what the changed code sits next to.
  • GitHub will not let you zoom an image in a comment. The link under each diagram opens it full size on a page of its own, where you can.
  • The CLI's render picks up .github/pr-lens.yml automatically and applies your corrections (renames, exclusions, lane pins) at draw time.
  • Would you rather run it from CI on a key of your own? Add .github/workflows/pr-lens.yml with coldteadotai/pr-lens/packages/action@v0 and a model key in your repository secrets, say GEMINI_API_KEY. The Action asks Gemini by default, or OpenAI and any endpoint speaking /chat/completions through its provider input.
  • PR Lens is free for open source. A star on the repository is what keeps it going.
  • Push a new commit and the whole comment re-renders for the new head. An older run never overwrites a newer one, so a slow render cannot put a stale diagram back.
  • The diagrams follow your GitHub theme, so dark mode gets the dark render and light mode the light one, and the moving dots show this pull request's data in motion.

◈ Rendered by PR Lens · crafted with ❤️ by the Coldtea team · Come say hi on Discord

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
devframe Ready Ready Preview Sep 4, 2026 3:11am UTC

@antfu
antfu merged commit 908f9fd into main Sep 4, 2026
14 checks passed
@antfu
antfu deleted the fix/hub-bake-sibling-layout branch September 4, 2026 03:24
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.

feat(hub): let buildHub bake statics/frames outside the hub base (sibling deploy layout)

2 participants