@npmcli/arborist 6.1.0 → 6.1.1

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.
@@ -345,7 +345,6 @@ module.exports = cls => class Builder extends cls {
345
345
  event,
346
346
  path,
347
347
  pkg,
348
- stdioString: true,
349
348
  stdio,
350
349
  env,
351
350
  scriptShell: this[_scriptShell],
@@ -9,6 +9,7 @@ const semver = require('semver')
9
9
  const debug = require('../debug.js')
10
10
  const walkUp = require('walk-up-path')
11
11
  const log = require('proc-log')
12
+ const hgi = require('hosted-git-info')
12
13
 
13
14
  const { dirname, resolve, relative } = require('path')
14
15
  const { depth: dfwalk } = require('treeverse')
@@ -640,10 +641,15 @@ module.exports = cls => class Reifier extends cls {
640
641
  // and no 'bundled: true' setting.
641
642
  // Do the best with what we have, or else remove it from the tree
642
643
  // entirely, since we can't possibly reify it.
643
- const res = node.resolved ? `${node.name}@${this[_registryResolved](node.resolved)}`
644
- : node.packageName && node.version
645
- ? `${node.packageName}@${node.version}`
646
- : null
644
+ let res = null
645
+ if (node.resolved) {
646
+ const registryResolved = this[_registryResolved](node.resolved)
647
+ if (registryResolved) {
648
+ res = `${node.name}@${registryResolved}`
649
+ }
650
+ } else if (node.packageName && node.version) {
651
+ res = `${node.packageName}@${node.version}`
652
+ }
647
653
 
648
654
  // no idea what this thing is. remove it from the tree.
649
655
  if (!res) {
@@ -721,12 +727,20 @@ module.exports = cls => class Reifier extends cls {
721
727
  // ${REGISTRY} or something. This has to be threaded through the
722
728
  // Shrinkwrap and Node classes carefully, so for now, just treat
723
729
  // the default reg as the magical animal that it has been.
724
- const resolvedURL = new URL(resolved)
730
+ const resolvedURL = hgi.parseUrl(resolved)
731
+
732
+ if (!resolvedURL) {
733
+ // if we could not parse the url at all then returning nothing
734
+ // here means it will get removed from the tree in the next step
735
+ return
736
+ }
737
+
725
738
  if ((this.options.replaceRegistryHost === resolvedURL.hostname)
726
739
  || this.options.replaceRegistryHost === 'always') {
727
740
  // this.registry always has a trailing slash
728
- resolved = `${this.registry.slice(0, -1)}${resolvedURL.pathname}${resolvedURL.searchParams}`
741
+ return `${this.registry.slice(0, -1)}${resolvedURL.pathname}${resolvedURL.searchParams}`
729
742
  }
743
+
730
744
  return resolved
731
745
  }
732
746
 
@@ -1544,7 +1558,6 @@ module.exports = cls => class Reifier extends cls {
1544
1558
  event,
1545
1559
  path,
1546
1560
  pkg,
1547
- stdioString: true,
1548
1561
  stdio,
1549
1562
  scriptShell: this.options.scriptShell,
1550
1563
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/arborist",
3
- "version": "6.1.0",
3
+ "version": "6.1.1",
4
4
  "description": "Manage node_modules trees",
5
5
  "dependencies": {
6
6
  "@isaacs/string-locale-compare": "^1.1.0",
@@ -12,14 +12,15 @@
12
12
  "@npmcli/node-gyp": "^3.0.0",
13
13
  "@npmcli/package-json": "^3.0.0",
14
14
  "@npmcli/query": "^3.0.0",
15
- "@npmcli/run-script": "^5.0.0",
15
+ "@npmcli/run-script": "^6.0.0",
16
16
  "bin-links": "^4.0.1",
17
17
  "cacache": "^17.0.1",
18
18
  "common-ancestor-path": "^1.0.1",
19
+ "hosted-git-info": "^6.1.1",
19
20
  "json-parse-even-better-errors": "^3.0.0",
20
21
  "json-stringify-nice": "^1.1.4",
21
22
  "minimatch": "^5.1.0",
22
- "nopt": "^6.0.0",
23
+ "nopt": "^7.0.0",
23
24
  "npm-install-checks": "^6.0.0",
24
25
  "npm-package-arg": "^10.0.0",
25
26
  "npm-pick-manifest": "^8.0.1",
@@ -39,7 +40,7 @@
39
40
  },
40
41
  "devDependencies": {
41
42
  "@npmcli/eslint-config": "^4.0.0",
42
- "@npmcli/template-oss": "4.6.2",
43
+ "@npmcli/template-oss": "4.8.0",
43
44
  "benchmark": "^2.1.4",
44
45
  "chalk": "^4.1.0",
45
46
  "minify-registry-metadata": "^2.1.0",
@@ -101,7 +102,7 @@
101
102
  },
102
103
  "templateOSS": {
103
104
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
104
- "version": "4.6.2",
105
+ "version": "4.8.0",
105
106
  "content": "../../scripts/template-oss/index.js"
106
107
  }
107
108
  }