Skip to content

feat(devframe)!: switch DevTools mount-path convention from /. to /__#315

Merged
antfu merged 5 commits intomainfrom
antfu/underscore-mount-paths
May 8, 2026
Merged

feat(devframe)!: switch DevTools mount-path convention from /. to /__#315
antfu merged 5 commits intomainfrom
antfu/underscore-mount-paths

Conversation

@antfu
Copy link
Copy Markdown
Member

@antfu antfu commented May 8, 2026

Description

Static deploy platforms (Vercel, Netlify, Cloudflare Pages, GitHub Pages, …) hide files and directories whose names begin with . from the served output, so a createBuild snapshot of a devtool currently 404s on its own ./.connection.json once deployed. This PR flips the leading . to __ everywhere the convention shows up in deployed URLs and deployed filesystem artifacts — mount-path defaults (/__\${id}/), the three Nuxt SPAs (/__devtools-rolldown/, /__devtools-vite/, /__devtools-self-inspect/), the meta/dump filenames (__connection.json, __rpc-dump/, __client-imports.js, __devtools/), and the matching JSDoc / docs / skills / examples. Cache-only paths (node_modules/.vite/, node_modules/.rolldown/, node_modules/.cache/, MCP storage) and project meta (.gitignore, .vitepress/cache) are deliberately untouched. This is a breaking change for anyone with hardcoded mount-path strings or cached deploy snapshots, but the project is at v0.1.20 so the impact surface is small.

Linked Issues

Additional context

Split into four atomic commits so each one keeps pnpm vitest run --project '@*' --project devframe (330 tests / 42 files) green: SPAs first, devframe constants + auth URL + tests next, then JSDoc/comments, then user-facing docs and example basePaths. Verified via pnpm lint (clean) and pnpm build (9/9 turbo tasks). Reviewers may want to focus on devframe/packages/devframe/src/constants.ts and _shared.ts (the source-of-truth flips that propagate everywhere via constants) and on static-serve.test.ts (the deploy-contract guard tests, including the renamed "stray __devtools/ directory" regression). One follow-up worth flagging: the vite-devtools build --outDir default is still .vite-devtools, which would also be filtered by deploy platforms when co-located with an app's publish dir — left out of this PR per the approved plan, but worth a separate change if/when needed.

🤖 Generated with Claude Code

antfu and others added 4 commits May 8, 2026 02:06
Static deploy platforms hide files starting with `.`. Flip the three Nuxt
SPA URLs so deployed builds survive Vercel/Netlify publishing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Flip every dot-prefixed path the build output ships into deploy
publish dirs: mount path defaults, connection meta, RPC dump dir,
client-imports, and the auth URL on the host. Cache paths under
node_modules/.* are unaffected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sweep through guides, error pages, skills, READMEs, example BASE_PATH
overrides, and the lone test fixture URL. Functional bits (example
basePath constants and the kit-plugin test assertion) ride along since
they encode the same convention.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@antfu antfu changed the title refactor: switch DevTools mount-path convention from /. to /__ feat(devframe)!: switch DevTools mount-path convention from /. to /__ May 8, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 8, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@315
npm i https://pkg.pr.new/@vitejs/devtools-kit@315
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@315
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@315

commit: 28e10bc

After a0188c1 ("do not inline immer"), the bundled `Patch as
SharedStatePatch` re-export is collapsed to a plain `SharedStatePatch`
in the emitted dts. The snapshot still encoded the inlined form and
broke CI on every platform.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@antfu antfu changed the title feat(devframe)!: switch DevTools mount-path convention from /. to /__ feat(devframe)!: switch DevTools mount-path convention from /. to /__ May 8, 2026
@antfu antfu merged commit dfeffc2 into main May 8, 2026
9 checks passed
@antfu antfu deleted the antfu/underscore-mount-paths branch May 8, 2026 01:34
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.

1 participant