@pnpm/deps.inspection.tree-builder 1100.0.20 → 1100.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/lib/buildDependenciesTree.js +4 -2
- package/package.json +12 -11
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @pnpm/reviewing.dependencies-hierarchy
|
|
2
2
|
|
|
3
|
+
## 1100.0.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- `pnpm list` and `pnpm why` no longer crash with `EMFILE: too many open files` when a project has a large number of unsaved dependencies (packages present in `node_modules` but not in the lockfile). The reads of those packages are now concurrency-limited.
|
|
8
|
+
|
|
9
|
+
- Updated dependencies:
|
|
10
|
+
- @pnpm/config.normalize-registries@1100.0.9
|
|
11
|
+
- @pnpm/deps.path@1100.0.9
|
|
12
|
+
- @pnpm/installing.modules-yaml@1100.0.10
|
|
13
|
+
- @pnpm/lockfile.detect-dep-types@1100.0.14
|
|
14
|
+
- @pnpm/lockfile.fs@1100.1.11
|
|
15
|
+
- @pnpm/lockfile.utils@1100.1.3
|
|
16
|
+
- @pnpm/pkg-manifest.reader@1100.0.10
|
|
17
|
+
- @pnpm/store.cafs@1100.1.13
|
|
18
|
+
- @pnpm/types@1101.4.0
|
|
19
|
+
|
|
3
20
|
## 1100.0.20
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -8,11 +8,13 @@ import { safeReadPackageJsonFromDir } from '@pnpm/pkg-manifest.reader';
|
|
|
8
8
|
import { StoreIndex } from '@pnpm/store.index';
|
|
9
9
|
import { DEPENDENCIES_FIELDS } from '@pnpm/types';
|
|
10
10
|
import normalizePath from 'normalize-path';
|
|
11
|
+
import pLimit from 'p-limit';
|
|
11
12
|
import { pathAbsolute } from 'path-absolute';
|
|
12
13
|
import { realpathMissing } from 'realpath-missing';
|
|
13
14
|
import { resolveLinkTarget } from 'resolve-link-target';
|
|
14
15
|
import { buildDependencyGraph } from './buildDependencyGraph.js';
|
|
15
16
|
import { getTree } from './getTree.js';
|
|
17
|
+
const limitUnsavedReads = pLimit(4);
|
|
16
18
|
export async function buildDependenciesTree(projectPaths, maybeOpts) {
|
|
17
19
|
if (!maybeOpts?.lockfileDir) {
|
|
18
20
|
throw new TypeError('opts.lockfileDir is required');
|
|
@@ -148,7 +150,7 @@ async function dependenciesHierarchyForPackage(opts, projectPath) {
|
|
|
148
150
|
const savedDeps = getAllDirectDependencies(currentLockfile.importers[importerId]);
|
|
149
151
|
const unsavedDeps = ((await readModulesDir(modulesDir)) ?? []).filter((directDep) => !savedDeps[directDep]);
|
|
150
152
|
if (unsavedDeps.length > 0)
|
|
151
|
-
await Promise.all(unsavedDeps.map(async (
|
|
153
|
+
await Promise.all(unsavedDeps.map((unsavedDep) => limitUnsavedReads(async () => {
|
|
152
154
|
let pkgPath = path.join(modulesDir, unsavedDep);
|
|
153
155
|
let version;
|
|
154
156
|
try {
|
|
@@ -171,7 +173,7 @@ async function dependenciesHierarchyForPackage(opts, projectPath) {
|
|
|
171
173
|
};
|
|
172
174
|
result.unsavedDependencies = result.unsavedDependencies ?? [];
|
|
173
175
|
result.unsavedDependencies.push(pkg);
|
|
174
|
-
}));
|
|
176
|
+
})));
|
|
175
177
|
}
|
|
176
178
|
return result;
|
|
177
179
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pnpm/deps.inspection.tree-builder",
|
|
3
|
-
"version": "1100.0.
|
|
3
|
+
"version": "1100.0.21",
|
|
4
4
|
"description": "Creates a dependencies hierarchy for a symlinked `node_modules`",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pnpm",
|
|
@@ -31,21 +31,22 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@pnpm/config.matcher": "1100.0.1",
|
|
34
|
-
"@pnpm/config.normalize-registries": "1100.0.
|
|
35
|
-
"@pnpm/deps.path": "1100.0.
|
|
34
|
+
"@pnpm/config.normalize-registries": "1100.0.9",
|
|
35
|
+
"@pnpm/deps.path": "1100.0.9",
|
|
36
36
|
"@pnpm/fs.read-modules-dir": "1100.0.1",
|
|
37
|
-
"@pnpm/installing.modules-yaml": "1100.0.
|
|
38
|
-
"@pnpm/lockfile.detect-dep-types": "1100.0.
|
|
39
|
-
"@pnpm/lockfile.fs": "1100.1.
|
|
40
|
-
"@pnpm/lockfile.utils": "1100.1.
|
|
37
|
+
"@pnpm/installing.modules-yaml": "1100.0.10",
|
|
38
|
+
"@pnpm/lockfile.detect-dep-types": "1100.0.14",
|
|
39
|
+
"@pnpm/lockfile.fs": "1100.1.11",
|
|
40
|
+
"@pnpm/lockfile.utils": "1100.1.3",
|
|
41
41
|
"@pnpm/npm-package-arg": "^2.0.0",
|
|
42
|
-
"@pnpm/pkg-manifest.reader": "1100.0.
|
|
43
|
-
"@pnpm/store.cafs": "1100.1.
|
|
42
|
+
"@pnpm/pkg-manifest.reader": "1100.0.10",
|
|
43
|
+
"@pnpm/store.cafs": "1100.1.13",
|
|
44
44
|
"@pnpm/store.index": "1100.2.1",
|
|
45
|
-
"@pnpm/types": "1101.
|
|
45
|
+
"@pnpm/types": "1101.4.0",
|
|
46
46
|
"@pnpm/util.lex-comparator": "^4.0.1",
|
|
47
47
|
"load-json-file": "^7.0.1",
|
|
48
48
|
"normalize-path": "^3.0.0",
|
|
49
|
+
"p-limit": "^7.3.0",
|
|
49
50
|
"path-absolute": "^2.0.0",
|
|
50
51
|
"realpath-missing": "^2.0.0",
|
|
51
52
|
"resolve-link-target": "^3.0.0",
|
|
@@ -54,7 +55,7 @@
|
|
|
54
55
|
"devDependencies": {
|
|
55
56
|
"@jest/globals": "30.4.1",
|
|
56
57
|
"@pnpm/constants": "1100.0.0",
|
|
57
|
-
"@pnpm/deps.inspection.tree-builder": "1100.0.
|
|
58
|
+
"@pnpm/deps.inspection.tree-builder": "1100.0.21",
|
|
58
59
|
"@pnpm/test-fixtures": "1100.0.0",
|
|
59
60
|
"@types/normalize-path": "^3.0.2",
|
|
60
61
|
"@types/semver": "7.7.1"
|