@pnpm/workspace.project-manifest-reader 1100.0.7 → 1100.0.9

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.
Files changed (2) hide show
  1. package/lib/index.js +13 -9
  2. package/package.json +7 -6
package/lib/index.js CHANGED
@@ -7,18 +7,22 @@ import { writeProjectManifest } from '@pnpm/workspace.project-manifest-writer';
7
7
  import detectIndent from 'detect-indent';
8
8
  import equal from 'fast-deep-equal';
9
9
  import isWindows from 'is-windows';
10
+ import pLimit from 'p-limit';
10
11
  import { readYamlFile } from 'read-yaml-file';
11
12
  import { readJson5File, readJsonFile, } from './readFile.js';
13
+ const limitProjectManifestReads = pLimit(4);
12
14
  export async function safeReadProjectManifestOnly(projectDir) {
13
- try {
14
- return await readProjectManifestOnly(projectDir);
15
- }
16
- catch (err) { // eslint-disable-line
17
- if (err.code === 'ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND') {
18
- return null;
15
+ return limitProjectManifestReads(async () => {
16
+ try {
17
+ return await readProjectManifestOnly(projectDir);
19
18
  }
20
- throw err;
21
- }
19
+ catch (err) { // eslint-disable-line
20
+ if (err.code === 'ERR_PNPM_NO_IMPORTER_MANIFEST_FOUND') {
21
+ return null;
22
+ }
23
+ throw err;
24
+ }
25
+ });
22
26
  }
23
27
  export async function readProjectManifest(projectDir) {
24
28
  const result = await tryReadProjectManifest(projectDir);
@@ -239,7 +243,7 @@ function normalize(manifest) {
239
243
  for (const key in manifest) {
240
244
  if (Object.hasOwn(manifest, key)) {
241
245
  const value = manifest[key];
242
- if (typeof value !== 'object' || !dependencyKeys.has(key)) {
246
+ if (typeof value !== 'object' || value === null || !dependencyKeys.has(key)) {
243
247
  result[key] = structuredClone(value);
244
248
  }
245
249
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnpm/workspace.project-manifest-reader",
3
- "version": "1100.0.7",
3
+ "version": "1100.0.9",
4
4
  "description": "Read a project manifest (called package.json in most cases)",
5
5
  "keywords": [
6
6
  "pnpm",
@@ -28,18 +28,19 @@
28
28
  "fast-deep-equal": "^3.1.3",
29
29
  "is-windows": "^1.0.2",
30
30
  "json5": "^2.2.3",
31
+ "p-limit": "^7.3.0",
31
32
  "parse-json": "^8.3.0",
32
33
  "read-yaml-file": "^3.0.0",
33
34
  "strip-bom": "^5.0.0",
35
+ "@pnpm/pkg-manifest.utils": "1100.2.1",
34
36
  "@pnpm/error": "1100.0.0",
35
- "@pnpm/pkg-manifest.utils": "1100.2.0",
36
37
  "@pnpm/fs.graceful-fs": "1100.1.0",
37
38
  "@pnpm/text.comments-parser": "1100.0.0",
38
- "@pnpm/workspace.project-manifest-writer": "1100.0.4",
39
- "@pnpm/types": "1101.1.1"
39
+ "@pnpm/types": "1101.2.0",
40
+ "@pnpm/workspace.project-manifest-writer": "1100.0.5"
40
41
  },
41
42
  "peerDependencies": {
42
- "@pnpm/logger": ">=1001.0.0 <1002.0.0"
43
+ "@pnpm/logger": "^1001.0.1"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@jest/globals": "30.3.0",
@@ -47,7 +48,7 @@
47
48
  "@types/parse-json": "^4.0.2",
48
49
  "tempy": "3.0.0",
49
50
  "@pnpm/test-fixtures": "1100.0.0",
50
- "@pnpm/workspace.project-manifest-reader": "1100.0.7"
51
+ "@pnpm/workspace.project-manifest-reader": "1100.0.9"
51
52
  },
52
53
  "engines": {
53
54
  "node": ">=22.13"