Is it possible to have multiple packages in the dependents view of a repo ? #181457
Replies: 5 comments 8 replies
-
|
Generally no, GitHub does not allow you to manually populate the package dropdown or automatically list all dependents unless your project meets the requirements of the GitHub Dependency Graph.You cannot manually add packages to this dropdown. |
Beta Was this translation helpful? Give feedback.
-
|
Hey! 😊 What you’re asking about – having a dropdown that lists all packages in your repo and their dependents – is not something GitHub does automatically. Next.js looks like it does it, but that’s actually a custom feature on their website, not part of GitHub itself. They get it by reading their packages and querying the npm registry. Here’s how you can do something similar:
If you use a monorepo, these commands can show all your packages: npm workspaces: npm workspaces list Yarn workspaces: yarn workspaces list pnpm workspaces: pnpm -w list Lerna: lerna list Turborepo: turbo ls This gives you a list of every package in your repo.
You can use: npm ls or to see the full dependency tree: npm ls --all This will show which packages are dependent on others.
GitHub has a built-in dependency graph, which you can enable under: It shows dependencies and dependents for your repo, but it doesn’t create a dropdown like Next.js.
If you want the same dropdown style, you need to create it yourself: Read all package.json files in your repo Extract package names and dependencies Render a dropdown in your website or documentation Example script: import fg from "fast-glob"; const packages = fg.sync("packages/**/package.json").map(path => { console.log(packages); This will give you all packages and their dependencies, which you can show in a dropdown. |
Beta Was this translation helpful? Give feedback.
This comment was marked as off-topic.
This comment was marked as off-topic.
-
|
🕒 Discussion Activity Reminder 🕒 This Discussion has been labeled as dormant by an automated system for having no activity in the last 60 days. Please consider one the following actions: 1️⃣ Close as Out of Date: If the topic is no longer relevant, close the Discussion as 2️⃣ Provide More Information: Share additional details or context — or let the community know if you've found a solution on your own. 3️⃣ Mark a Reply as Answer: If your question has been answered by a reply, mark the most helpful reply as the solution. Note: This dormant notification will only apply to Discussions with the Thank you for helping bring this Discussion to a resolution! 💬 |
Beta Was this translation helpful? Give feedback.
-
|
Yes. The Dependents tab doesn’t represent one package — it represents everything published from that repository. If your repo publishes multiple packages (for example a monorepo like
So the view is repo-level, not package-level. If you want separation, each package needs its own repository (or its own GitHub package namespace). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Select Topic Area
Question
Body
I would like to have all the packages contained in my repo in this dropdown view and also have all the dependents of my packages listed here. Is that possible ?
I know that nextjs made it happen

Thanks in advance for anybody that can help :) 🤗
Beta Was this translation helpful? Give feedback.
All reactions