Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ playwright-report

# Copied at publish time from root /skills/ by scripts/copy-skills.mjs
packages/node-modules-inspector/skills/

.pnp*
.yarn
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Visualize your node_modules, inspect dependencies, and more.

## Quick Start

Try it by running following command under your `pnpm`/`npm`/`bun` project.
Try it by running the matching command under your `pnpm`/`npm`/`bun`/Yarn Berry project.

```bash
pnpx node-modules-inspector
Expand All @@ -23,8 +23,11 @@ npx node-modules-inspector
```bash
bunx node-modules-inspector
```
```bash
yarn dlx node-modules-inspector
```

> Currently supports `pnpm`, `npm`, and `bun` projects. We are counting on the community to bring support for other package managers.
> Currently supports `pnpm`, `npm`, `bun`, and Yarn Berry projects using the `node-modules` linker. Yarn Plug'n'Play isn't supported because the inspector needs a physical `node_modules` tree to analyze package files and install sizes. To use Yarn Berry, set `nodeLinker: node-modules` in `.yarnrc.yml` and run `yarn install` first.

### Online Version

Expand Down
5 changes: 4 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ export default antfu({
},
})
.append({
files: ['packages/node-modules-tools/test/*/fixtures/**/package.json'],
files: [
'fixtures/**/package.json',
'packages/node-modules-tools/test/*/fixtures/**/package.json',
],
rules: {
'pnpm/json-enforce-catalog': 'off',
'pnpm/json-valid-catalog': 'off',
Expand Down
1 change: 1 addition & 0 deletions fixtures/yarn/.yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
21 changes: 21 additions & 0 deletions fixtures/yarn/dev.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/* eslint-disable antfu/no-top-level-await */
import process from 'node:process'
import { fileURLToPath } from 'node:url'
import { x } from 'tinyexec'

const cwd = process.cwd()
const inspector = fileURLToPath(new URL('../../packages/node-modules-inspector', import.meta.url))

await x('pnpm', ['run', 'stub'], {
nodeOptions: {
cwd: inspector,
stdio: 'inherit',
},
})

await x('node', ['./bin.mjs', '--root', cwd], {
nodeOptions: {
cwd: inspector,
stdio: 'inherit',
},
})
17 changes: 17 additions & 0 deletions fixtures/yarn/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"name": "node-modules-inspector-yarn-fixture",
"type": "module",
"version": "0.0.0",
"private": true,
"packageManager": "yarn@4.7.0",
"scripts": {
"dev": "node dev.mjs"
},
"dependencies": {
"vite": "^6.0.0",
"vite-plugin-inspect": "^11.0.0"
},
"devDependencies": {
"tinyexec": "^0.3.2"
}
}
Loading
Loading