antfu / antfu/node-modules-inspector

dedupe button

Open
#11 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Image

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.