feat!: default build outDir to dist/__node-modules-inspector#152
Merged
Conversation
- bump devframe to ^0.1.21 (also vite ^8.0.11, bumpp ^11.1.0) - pass required appName to createH3DevToolsHost in CLI build and Nuxt dev - route the rpcGroup.functions warmup cast through unknown - update e2e tests + playwright config from /.connection.json and /.rpc-dump/ to /__connection.json and /__rpc-dump/ to match the new underscore mount-path convention (vitejs/devtools#315) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
commit: |
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Aligns with the underscore mount-path convention from devframe 0.1.21. Verified both serve modes: - serve dist/__node-modules-inspector (default --base /) — inspector at / - serve dist --base /__node-modules-inspector/ — inspector at sub-path, HTML rewriting in the build action retargets absolute /_nuxt asset paths (Nuxt normalizes app.baseURL './' to '/'). BREAKING CHANGE: the default --outDir changed from .node-modules-inspector to dist/__node-modules-inspector. Pass --outDir explicitly to keep the old layout. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a fourth Playwright project (`build-subbase`, port 13004) that
serves the static export from a parent directory so the inspector lives
at /__node-modules-inspector/ — the deploy shape implied by the new
default --outDir. The orchestrator builds a dedicated fixture with
`--base /__node-modules-inspector/`, and `serve.mjs` gained a
`--spa-base` option so HTML navigation requests under the sub-base fall
back to the right index.html.
The test fixture surfaced two gaps in the build CLI's rewrite that
broke hydration under a sub-base:
- Nuxt's <script type="importmap"> entry (`"#entry":"/_nuxt/..."`) and
`buildAssetsDir:"/_nuxt/"` aren't matched by the `(href|src)="\/`
regex. Added `"/_nuxt/` → `"${baseURL}_nuxt/` to cover both. Without
it the importmap pointed the entry chunk at the deploy origin, the
SPA never hydrated, and the page sat on /__node-modules-inspector/
instead of redirecting to /grid/.
The new spec asserts no 4xx/5xx on JS/CSS/JSON/HTML responses during
SPA load (theme-vitesse fonts are pre-existing 404s in both root and
sub-base builds — they degrade to system fonts and don't gate
hydration, so the filter scopes 4xx checks to hydration-critical
extensions).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Bumps
devframefrom^0.1.19to^0.1.21(plus minorvite/bumppbumps) and adapts the inspector to the upstream API + path-convention changes. The build CLI also moves to a deploy-friendly default output layout.Breaking
node-modules-inspector builddefault--outDirchanged from.node-modules-inspectortodist/__node-modules-inspector. The new path mirrors the underscore mount-path convention (feat(devframe)!: switch DevTools mount-path convention from/.to/__vitejs/devtools#315) and survives static deploy platforms (Vercel, Netlify, GitHub Pages, …) that hide dotfile directories. Pass--outDirexplicitly to keep the old layout..connection.json→__connection.json,.rpc-dump/→__rpc-dump/. The CLI uses the imported devframe constants, so source picks this up automatically — only hardcoded paths in the Playwright config and e2e tests were updated.devframe 0.1.21 adaptation
createH3DevToolsHostnow requiresappName— passeddevtool.idat the two manual call sites (build CLI + Nuxt dev API route).StartedServer.rpcGroup.functionsis strongly typed asDevToolsRpcServerFunctions; the payload-warmup cast goes throughunknownto satisfy the stricter type while preserving runtime semantics.@vitejs/devtools-kit) is transparent — the inspector consumes onlyctx.rpc.*and never used the relocated subsystems.Build CLI: sub-base support hardened
build --base /__node-modules-inspector/now also rewrites Nuxt's<script type=\"importmap\">entry andbuildAssetsDir:\"/_nuxt/\"— neither was caught by the previous(href|src)=\"/regex, so the importmap pointed the entry chunk at the deploy origin and the SPA never hydrated under a sub-base.e2e coverage
A new Playwright project
build-subbase(port 13004) builds the static export with--base /__node-modules-inspector/and serves the parent directory, verifying the inspector hydrates at/__node-modules-inspector/without 4xx/5xx on JS/CSS/JSON/HTML.serve.mjsgained a--spa-baseoption so HTML navigation under the sub-base falls back to the rightindex.html.Test plan
pnpm exec tsc --noEmitclean (the only remaining errors are pre-existingentries/*.vuemodules generated bypnpm dev:prepare)pnpm test:e2e --project build(root mode, 3 tests)pnpm test:e2e --project build-subbase(sub-base mode, 3 tests)pnpm test:e2e(full suite incl. dev + webcontainer projects)node packages/node-modules-inspector/bin.mjs buildproducesdist/__node-modules-inspector/with__connection.jsonand__rpc-dump/serve dist/__node-modules-inspectorworks at `/`serve distwith--base /__node-modules-inspector/works at sub-path🤖 Generated with Claude Code