@npmcli/config 8.3.3 → 8.3.4

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 +3 -3
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -669,12 +669,12 @@ class Config {
669
669
  }
670
670
 
671
671
  if (this.localPrefix && hasPackageJson) {
672
- const rpj = require('read-package-json-fast')
672
+ const pkgJson = require('@npmcli/package-json')
673
673
  // if we already set localPrefix but this dir has a package.json
674
674
  // then we need to see if `p` is a workspace root by reading its package.json
675
675
  // however, if reading it fails then we should just move on
676
- const pkg = await rpj(resolve(p, 'package.json')).catch(() => false)
677
- if (!pkg) {
676
+ const { content: pkg } = await pkgJson.normalize(p).catch(() => ({ content: {} }))
677
+ if (!pkg?.workspaces) {
678
678
  continue
679
679
  }
680
680
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/config",
3
- "version": "8.3.3",
3
+ "version": "8.3.4",
4
4
  "files": [
5
5
  "bin/",
6
6
  "lib/"
@@ -37,11 +37,11 @@
37
37
  },
38
38
  "dependencies": {
39
39
  "@npmcli/map-workspaces": "^3.0.2",
40
+ "@npmcli/package-json": "^5.1.1",
40
41
  "ci-info": "^4.0.0",
41
42
  "ini": "^4.1.2",
42
43
  "nopt": "^7.2.1",
43
44
  "proc-log": "^4.2.0",
44
- "read-package-json-fast": "^3.0.2",
45
45
  "semver": "^7.3.5",
46
46
  "walk-up-path": "^3.0.1"
47
47
  },