Skip to content

feat: add support for all export shapes to package API docs#1728

Draft
serhalp wants to merge 1 commit intomainfrom
serhalp/fix-deno-docs-links
Draft

feat: add support for all export shapes to package API docs#1728
serhalp wants to merge 1 commit intomainfrom
serhalp/fix-deno-docs-links

Conversation

@serhalp
Copy link
Copy Markdown
Member

@serhalp serhalp commented Feb 28, 2026

🔗 Linked issue

Fixes #1479

🧭 Context

There are a couple problems with the current implementation of our "package docs" feature:

  1. Some packages do not have generated package docs at all. This is because we were asking esm.sh for the package root (./), getting a 404 or no types back, and then rendering nothing, even when a package had other perfectly good typed exports.
  2. Some packages really have multiple docs surfaces, not just one. For packages with several typed entrypoints, a single flat docs page is probably the wrong model. Users need to be able to move between entrypoints explicitly, know what they're looking at, share permalinks, etc..

📚 Description

On the backend, broaden entrypoint discovery so we can find all typed subpath exports from package.json#exports, including nested condition objects like import.types.

On the frontend, make the package docs entrypoint-aware:

  • If a package is subpaths-only, the base docs URL redirects to the first listed entrypoint.
  • If a package has both root docs and subpath docs, the base docs URL renders the root docs.
  • In all cases, add an explicit entrypoint selector to the UI.
  • The route now looks like /package-docs/:pkg/v/:version/:entrypoint.

@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 28, 2026

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

Project Deployment Actions Updated (UTC)
npmx.dev Ready Ready Preview, Comment Apr 27, 2026 0:55am
2 Skipped Deployments
Project Deployment Actions Updated (UTC)
docs.npmx.dev Ignored Ignored Preview Apr 27, 2026 0:55am
npmx-lunaria Ignored Ignored Apr 27, 2026 0:55am

Request Review

Comment thread test/unit/server/utils/docs/client.spec.ts Fixed
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

📢 Thoughts on this report? Let us know!

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 8, 2026

Lunaria Status Overview

🌕 This pull request will trigger status changes.

Learn more

By default, every PR changing files present in the Lunaria configuration's files property will be considered and trigger status changes accordingly.

You can change this by adding one of the keywords present in the ignoreKeywords property in your Lunaria configuration file in the PR's title (ignoring all files) or by including a tracker directive in the merged commit's description.

Tracked Files

File Note
i18n/locales/en.json Source changed, localizations will be marked as outdated.
i18n/locales/fr-FR.json Localization changed, will be marked as complete. 🔄️
Warnings reference
Icon Description
🔄️ The source for this localization has been updated since the creation of this pull request, make sure all changes in the source have been applied.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 12, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 391695c9-8bf1-4da9-8503-4a11d372b9b1

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch serhalp/fix-deno-docs-links

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@serhalp serhalp force-pushed the serhalp/fix-deno-docs-links branch from 7204fc8 to 3003b60 Compare April 13, 2026 00:39
@serhalp serhalp force-pushed the serhalp/fix-deno-docs-links branch 2 times, most recently from 265e942 to aec760b Compare April 26, 2026 16:57
@serhalp serhalp changed the title feat(wip): add per-entrypoint API docs pages for multi-export packages feat: add support for all export shapes to package API docs Apr 26, 2026
Packages with only subpath exports (no root export) previously got no
docs because esm.sh returns 404 for their root URL. Fix by falling back
to the npm registry  field to discover typed subpath entries.

Additionally, multi-entrypoint packages now get separate docs pages per
subpath with an EntrypointSelector dropdown, instead of dumping all
symbols into one flat page. The base URL redirects to the first
entrypoint.

URL structure: /package-docs/{pkg}/v/{version}/{entrypoint}

Closes #1479
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.

api docs don't generate when package is missing default export

2 participants