antfu / antfu/node-modules-inspector
dedupe button
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 90
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 9
Description
Clear and concise description of the problem
Currently inspector hints for pnpm dedupe
I think with https://github.com/unjs/nypm?tab=readme-ov-file#dedupedependenciesoptions we can add a button to dedupe via backend. (only if not built static or not webcontainer)
Suggested solution
use nypm to trigger dedupe, if possible.
POC:
server:
import process from "node:process";
import {dedupeDependencies} from "nypm";
export default defineEventHandler(async () => {
await dedupeDependencies({cwd: process.cwd()})
})
frontend:
// if not built or webcontainer
$fetch('/api/dedupe' )
Alternative
No response
Additional context
No response
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the inspector hints UI and the backend entry point corresponding to the proposed /api/dedupe route. Read nypm's dedupeDependencies options and verify the behavior in non-static, non-WebContainer mode. Done means an available UI action triggers dependency deduplication without appearing in unsupported modes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, devtools
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100