Commit Graph

39 Commits

Author SHA1 Message Date
Zoltan Kochan
7116f35027 feat: add nameFormatter option to buildDependentsTree for custom display names (#10629)
Allow consumers (e.g. Bit CLI) to provide a nameFormatter callback that
reads the package manifest and returns a custom display name. The resolved
displayName is carried through the DependentsTree/DependentNode data model
and used by all render functions (tree, JSON, parseable).
2026-02-15 22:25:41 +01:00
Zoltan Kochan
892b985db2 feat: add --depth option to pnpm why to limit display depth (#10627) 2026-02-15 22:25:41 +01:00
Zoltan Kochan
cc7da5dc95 refactor: re-export dependents rendering functions from reviewing/list
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-15 22:25:40 +01:00
Zoltan Kochan
7d5ada0701 feat: reverse pnpm why tree and improve list/why output (#10615)
- **`pnpm why` now shows a reverse dependency tree.** The searched package appears at the root with its dependants as branches, walking back to workspace roots. This replaces the previous forward-tree output which was noisy and hard to read for deeply nested dependencies.
- **Replaced `archy` with a new `@pnpm/text.tree-renderer` package** that renders trees using box-drawing characters (├──, └──, │) and supports grouped sections, dim connectors, and deduplication markers.
- **Show peer dependency hash suffixes** in `pnpm list` and `pnpm why` output to distinguish between different peer-dep variants of the same package.
- **Improved `pnpm list` visual output:** bold importer nodes, dimmed workspace paths, dependency grouping, package count summary, and deterministic sort order.
- **Added `--long` support to `pnpm why`** and the ability to read package manifests from the CAS store.
- **Deduplicated shared code** between `list` and `why` commands into a common module, and reused `getPkgInfo` in the why tree builder.
2026-02-15 14:38:43 +01:00
Zoltan Kochan
472d3af93d perf: share dependency graph and materialization cache across importers in list/why (#10596) 2026-02-13 21:13:02 +01:00
Zoltan Kochan
a49b243573 fix: list command should not fail with an OOM error (#10586)
close #8731
2026-02-11 00:38:35 +01:00
Zoltan Kochan
861dd2a8a8 revert: fix(reviewing): fix memory error in pnpm why (#10582)
ref #7122
2026-02-09 15:05:09 +01:00
Ryo Matsukawa
8ffb1a7f0c fix: display npm: protocol for aliased packages in list and why (#10084)
* fix: support alias resolution in pnpm why with npm:
protocol

* refactor: make alias required instead of optional

* refactor: reorder field to put alias first
2025-11-20 01:08:53 +01:00
Ryo Matsukawa
2464485700 feat: add --lockfile-only option to pnpm list (#10066)
close #10020

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2025-11-17 16:57:29 +01:00
Zoltan Kochan
6f861bccaa Merge remote-tracking branch 'origin/main' into v11 2025-09-12 22:35:14 +02:00
Zoltan Kochan
e792927841 feat: support finder functions for performing complex searches with list and why commands (#9946) 2025-09-12 11:46:32 +02:00
Zoltan Kochan
491a84fb26 feat: use ESM instead of commonjs (#9870) 2025-08-25 10:02:00 +02:00
Zoltan Kochan
51bc234712 Merge branch 'main' into v11 2025-08-19 15:29:18 +02:00
Zoltan Kochan
facd7656e8 refactor: always use extensions in relative imports (#9878) 2025-08-19 15:25:11 +02:00
Zoltan Kochan
c4272201b4 refactor: remove @pnpm/crypto.polyfill (#9867) 2025-08-15 16:14:17 +02:00
btea
adb236f1a1 refactor: improve regexp (#9203) 2025-03-02 13:17:09 +01:00
btea
222d10ac79 perf: use hash to replace createHash (#8629)
---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2024-10-21 10:51:33 +02:00
Khải
44b8935997 fix(listing): --json shows wrong private (#8541)
close #8519
2024-09-22 02:37:50 +02:00
Zoltan Kochan
3af07cb839 feat: add an option to list and why to exclude peer dependencies from the output (#8506) 2024-09-08 22:26:33 +02:00
Zoltan Kochan
9719a42d0e feat: configurable max length of directories inside node_modules/.pnpm (#7994)
close #7355
2024-04-28 11:07:29 +02:00
Khải
37c0f48555 refactor(reviewing/list): type checking perf (#7887) 2024-04-10 13:13:56 +02:00
Zoltan Kochan
0564745b1d style: use unknown in try/catch (#7709) 2024-03-06 01:47:04 +01:00
btea
09f6103490 fix(reviewing): filter the same print message (#7430)
close #7429

---------

Co-authored-by: Zoltan Kochan <z@kochan.io>
2023-12-26 12:54:41 +01:00
Zoltan Kochan
733d612ad1 test: check spelling with cspell (#7229) 2023-10-20 15:58:27 +03:00
Zoltan Kochan
122febe472 fix(list): export PackageDependencyHierarchy 2023-09-27 17:14:48 +03:00
Nacho Aldama
40798fb1cd fix(reviewing): fix memory error in pnpm why (#7122)
* fix(reviewing): fix memory error in `pnpm why`

* fix: update comments

* fix: add support for `--depth`

* fix: move implementation to `@pnpm/list`

* fix: revert changes in Dependencies Hierarchy

* fix: add pnpm to patch list

* refactor: rename functions to descriptive names

* refactor: rename `findEndLeafs` to `findEndLeaves`
2023-09-27 15:35:48 +03:00
Zoltan Kochan
101c97ecb8 feat(list): update the API for usage in Bit CLI (#7132)
* feat(list): update the API for usage in Bit CLI

* refactor: move createPackagesSearcher to dependencies-hierarchy package

* docs: add changesets
2023-09-26 15:23:36 +03:00
Zoltan Kochan
f73eeac067 fix: pnpm why should work without package.json files (#6953) 2023-08-18 04:01:38 +03:00
Zoltan Kochan
df11f2c62c style: fix 2023-07-29 22:37:57 +03:00
Zoltan Kochan
4b97f1f07a perf: don't use await inside loops (#6617) 2023-06-05 12:12:47 +03:00
Zoltan Kochan
ee61ca4cb7 style: update eslint (#6236) 2023-03-18 14:57:29 +02:00
await-ovo
185ab01adf feat: when patch package does not specify a version, use locally installed version by default. (#6197)
close #6192
2023-03-13 16:40:21 +02:00
await-ovo
b9ab2e0bf2 feat: show path info for pnpm why --json or --long (#6109)
close #6103
2023-02-20 05:41:57 +02:00
await-ovo
19e823beab fix: path info in dependencies hierarchy tree (#6001)
* fix: get correct path info in dependencies hierarchy tree

* chore: test case for build dependencies hierarchy

* docs: update changeset

* chore: test cases

* fix: show full path in dependencies hierarchy tree
2023-02-02 03:34:16 +02:00
Zoltan Kochan
583e3954be fix: remove suppressImplicitAnyIndexErrors from typescript settings (#5991) 2023-01-28 18:19:26 +02:00
await-ovo
94ef3299ed feat(plugin-commands-audit): show path info in audit output (#5917)
close #3073
2023-01-18 02:04:17 +00:00
Brandon Cheng
395a33a50c feat: traverse through workspace packages in why and list commands (#5863)
* refactor(dependencies-hierarchy): remove keypath argument from getTree

The `keypath` argument is an internal implementation detail of `getTree`
used to detect cycles in the package graph. Removing this from the call
signature of `getTree` since it exposes an implementation detail.

The start of a `getTree` call always passed in the starting node as the
initial value anyway.

```ts
const getChildrenTree = getTree.bind(null, { ... })
getChildrenTree([relativeId], relativeId)
```

It's simpler for that to happen in the first call to `getTreeHelper`
internally and better ensures the keypath is created correctly. A future
refactor makes construction of the keypath more involved.

* refactor(dependencies-hierarchy): remove refToRelative call in getPkgInfo

This removes an extra `refToRelative` call in `getPkgInfo`. The result
of this call wasn't used within the function and was simply passed back
to the caller.

Callers of `getPkgInfo` were checking the result of `refToRelative`,
from `getPkgInfo`'s return object only to call `refToRelative` again.
Calling `refToRelative` directly simplifies code a bit. We can remove an
unnecessary cast and an if statement.

* refactor(dependencies-hierarchy): create enum for getTree nodes

* feature(dependencies-hierarchy): traverse through workspace packages

This updates `pnpm list` and `pnpm why` to traverse through `link:`
packages by simply. This is done by simply implementing a new TreeNodeId
enum variant.

* test(dependencies-hierarchy): test transitive workspace package listing

* refactor(dependencies-hierarchy): create interface for GetPkgInfoOpts

A future commit adds new fields to `getPkgInfo`'s options. The dedicated
interface makes it easier to describe these new options with a JSDoc.

* fix(dependencies-hierarchy): fix path for link: deps in projects

This was a bug before the changes in this pull request. The bug was not
user facing since `pnpm list --json` doesn't print this computed path.

* fix(dependencies-hierarchy): print version paths rel to starting project

* feat(list): add --only-projects flag

* refactor: change description of --only-projects

Co-authored-by: Zoltan Kochan <z@kochan.io>
2023-01-03 15:28:20 +02:00
Zoltan Kochan
313702d76b refactor: all packages should be in the @pnpm scope (#5785) 2022-12-13 03:46:56 +02:00
Zoltan Kochan
4ca53b0b50 refactor: group projects in different subdirectories (#5659) 2022-11-20 01:35:22 +02:00