Commit Graph

10 Commits

Author SHA1 Message Date
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
2786b549d9 chore(eslint): explicit-module-boundary-types (#7926) 2024-04-14 13:37:50 +02:00
Khải
6df750e834 refactor(reviewing): type checking perf (#7888) 2024-04-10 14:03:26 +02:00
Zoltan Kochan
0564745b1d style: use unknown in try/catch (#7709) 2024-03-06 01:47:04 +01: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
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
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
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
4ca53b0b50 refactor: group projects in different subdirectories (#5659) 2022-11-20 01:35:22 +02:00