You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/pnpm-policy/README.md
+27Lines changed: 27 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -170,6 +170,33 @@ That becomes pnpm's `allowBuilds` map (pnpm ≥ 10.16), with the reasons as inli
170
170
171
171
Unlike the release-age exemptions, this list is **not** derived from anything: a package that runs install scripts is a deliberate trust decision, whoever published it.
172
172
173
+
## Understanding what you depend on
174
+
175
+
Deciding what to exempt means deciding which *projects* you trust, but npm only offers accounts — and an account is as wide as everything its owner will ever publish. The person maintaining a library you want may also co-maintain something enormous you did not mean to exempt.
176
+
177
+
`origins` answers the question npm does not: group the packages a workspace resolves by the repository they publish from.
178
+
179
+
```bash
180
+
pnpm-policy origins # every resolved package, grouped by repo owner
181
+
pnpm-policy origins --from postgraphile # only the subtree that one dependency dragged in
182
+
pnpm-policy origins --owner acme # just that owner's packages
183
+
pnpm-policy origins --owner acme --out acme.inventory.json # written as an inventory
184
+
```
185
+
186
+
```
187
+
$ pnpm-policy origins --from postgraphile
188
+
radix-ui (29)
189
+
<norepositorymetadata> (20)
190
+
graphile (15)
191
+
graphql (8)
192
+
```
193
+
194
+
`--from` reads the lockfile's dependency graph and walks it, so you see what a single decision actually pulled in rather than surveying everything at once. Transitive dependencies are included, because those are the ones an exemption list forgets.
195
+
196
+
`--owner ... --out ...` writes the result as an inventory, ready to pass to `inventory:`. It emits **names only** — no `maintainers`, no scope globs — because the point is a reviewed list, and a glob would re-widen it to whatever gets published into that scope next.
197
+
198
+
The repository field is self-reported, so this is a proxy for provenance, not proof of it. It answers "which project is this package from", not "is this package safe".
199
+
173
200
## The inventory
174
201
175
202
`pnpm-policy inventory` queries `registry.npmjs.org` for `maintainer:<account>`, paginates, and writes:
0 commit comments