Skip to content

fix: resolve docs from hoisted Next.js installations - #155

Open
gaojude wants to merge 2 commits into
mainfrom
codex/fix-hoisted-docs
Open

fix: resolve docs from hoisted Next.js installations#155
gaojude wants to merge 2 commits into
mainfrom
codex/fix-hoisted-docs

Conversation

@gaojude

@gaojude gaojude commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

When a workspace hoists next above project_path, the docs gateway only checks the child's node_modules. It reports the declared version and points to missing docs despite an installed package being available through normal module resolution.

Resolve next/package.json from the requested project with createRequire, derive both the installed version and docs location from that package, and return an absolute docsPath. Update search instructions and the README, and add a patch changeset.

Validation:

  • The hoisted dependency regression failed against the original implementation.
  • pnpm build, pnpm typecheck, and the complete pnpm exec vitest run: 35 tests passed.
  • Added coverage for hoisted installs and child-local precedence.
  • Queried a workspace child over stdio with a real hoisted Next.js 16.3.4 package and a declared ^16.0.0 range. Verified versionSource: installed, the exact version, and an absolute docs directory that exists.

Local validation used macOS arm64, Node.js 24.19.0, and pnpm 9.15.9. The uploaded GitHub-signed commit has the same Git tree as the tested checkout.

Windows CI caught doubled backslashes in the shell-style search hint. The hint now points directly to the readable filesystem path; the complete 35-test local suite passed again after this correction.

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