@npmcli/arborist 8.0.0 → 8.0.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.
@@ -447,7 +447,7 @@ module.exports = cls => class IdealTreeBuilder extends cls {
447
447
  .catch(/* istanbul ignore next */ () => null)
448
448
  if (st && st.isSymbolicLink()) {
449
449
  const target = await readlink(dir)
450
- const real = resolve(dirname(dir), target).replace(/#/g, '%23')
450
+ const real = resolve(dirname(dir), target)
451
451
  tree.package.dependencies[name] = `file:${real}`
452
452
  } else {
453
453
  tree.package.dependencies[name] = '*'
@@ -522,12 +522,12 @@ module.exports = cls => class IdealTreeBuilder extends cls {
522
522
 
523
523
  const { name } = spec
524
524
  if (spec.type === 'file') {
525
- spec = npa(`file:${relpath(path, spec.fetchSpec).replace(/#/g, '%23')}`, path)
525
+ spec = npa(`file:${relpath(path, spec.fetchSpec)}`, path)
526
526
  spec.name = name
527
527
  } else if (spec.type === 'directory') {
528
528
  try {
529
529
  const real = await realpath(spec.fetchSpec, this[_rpcache], this[_stcache])
530
- spec = npa(`file:${relpath(path, real).replace(/#/g, '%23')}`, path)
530
+ spec = npa(`file:${relpath(path, real)}`, path)
531
531
  spec.name = name
532
532
  } catch {
533
533
  // TODO: create synthetic test case to simulate realpath failure
@@ -216,7 +216,7 @@ module.exports = cls => class ActualLoader extends cls {
216
216
  const actualRoot = tree.isLink ? tree.target : tree
217
217
  const { dependencies = {} } = actualRoot.package
218
218
  for (const [name, kid] of actualRoot.children.entries()) {
219
- const def = kid.isLink ? `file:${kid.realpath.replace(/#/g, '%23')}` : '*'
219
+ const def = kid.isLink ? `file:${kid.realpath}` : '*'
220
220
  dependencies[name] = dependencies[name] || def
221
221
  }
222
222
  actualRoot.package = { ...actualRoot.package, dependencies }
@@ -149,7 +149,7 @@ module.exports = cls => class VirtualLoader extends cls {
149
149
  })
150
150
 
151
151
  for (const [name, path] of workspaces.entries()) {
152
- lockWS[name] = `file:${path.replace(/#/g, '%23')}`
152
+ lockWS[name] = `file:${path}`
153
153
  }
154
154
 
155
155
  // Should rootNames exclude optional?
@@ -1364,7 +1364,7 @@ module.exports = cls => class Reifier extends cls {
1364
1364
  // path initially, in which case we can end up with the wrong
1365
1365
  // thing, so just get the ultimate fetchSpec and relativize it.
1366
1366
  const p = req.fetchSpec.replace(/^file:/, '')
1367
- const rel = relpath(addTree.realpath, p).replace(/#/g, '%23')
1367
+ const rel = relpath(addTree.realpath, p)
1368
1368
  newSpec = `file:${rel}`
1369
1369
  }
1370
1370
  } else {
@@ -20,7 +20,7 @@ const consistentResolve = (resolved, fromPath, toPath, relPaths = false) => {
20
20
  raw,
21
21
  } = npa(resolved, fromPath)
22
22
  if (type === 'file' || type === 'directory') {
23
- const cleanFetchSpec = fetchSpec.replace(/#/g, '%23')
23
+ const cleanFetchSpec = fetchSpec
24
24
  if (relPaths && toPath) {
25
25
  return `file:${relpath(toPath, cleanFetchSpec)}`
26
26
  }
package/lib/link.js CHANGED
@@ -99,7 +99,7 @@ class Link extends Node {
99
99
  // the path/realpath guard is there for the benefit of setting
100
100
  // these things in the "wrong" order
101
101
  return this.path && this.realpath
102
- ? `file:${relpath(dirname(this.path), this.realpath).replace(/#/g, '%23')}`
102
+ ? `file:${relpath(dirname(this.path), this.realpath)}`
103
103
  : null
104
104
  }
105
105
 
package/lib/node.js CHANGED
@@ -842,7 +842,7 @@ class Node {
842
842
  }
843
843
 
844
844
  for (const [name, path] of this.#workspaces.entries()) {
845
- new Edge({ from: this, name, spec: `file:${path.replace(/#/g, '%23')}`, type: 'workspace' })
845
+ new Edge({ from: this, name, spec: `file:${path}`, type: 'workspace' })
846
846
  }
847
847
  }
848
848
 
package/lib/shrinkwrap.js CHANGED
@@ -817,7 +817,7 @@ class Shrinkwrap {
817
817
  if (!/^file:/.test(resolved)) {
818
818
  pathFixed = resolved
819
819
  } else {
820
- pathFixed = `file:${resolve(this.path, resolved.slice(5)).replace(/#/g, '%23')}`
820
+ pathFixed = `file:${resolve(this.path, resolved.slice(5))}`
821
821
  }
822
822
  }
823
823
 
@@ -1011,7 +1011,7 @@ class Shrinkwrap {
1011
1011
  }
1012
1012
 
1013
1013
  if (node.isLink) {
1014
- lock.version = `file:${relpath(this.path, node.realpath).replace(/#/g, '%23')}`
1014
+ lock.version = `file:${relpath(this.path, node.realpath)}`
1015
1015
  } else if (spec && (spec.type === 'file' || spec.type === 'remote')) {
1016
1016
  lock.version = spec.saveSpec
1017
1017
  } else if (spec && spec.type === 'git' || rSpec.type === 'git') {
@@ -1089,7 +1089,7 @@ class Shrinkwrap {
1089
1089
  // this especially shows up with workspace edges when the root
1090
1090
  // node is also a workspace in the set.
1091
1091
  const p = resolve(node.realpath, spec.slice('file:'.length))
1092
- set[k] = `file:${relpath(node.realpath, p).replace(/#/g, '%23')}`
1092
+ set[k] = `file:${relpath(node.realpath, p)}`
1093
1093
  } else {
1094
1094
  set[k] = spec
1095
1095
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@npmcli/arborist",
3
- "version": "8.0.0",
3
+ "version": "8.0.1",
4
4
  "description": "Manage node_modules trees",
5
5
  "dependencies": {
6
6
  "@isaacs/string-locale-compare": "^1.1.0",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@npmcli/eslint-config": "^5.0.1",
44
- "@npmcli/template-oss": "4.23.3",
44
+ "@npmcli/template-oss": "4.24.4",
45
45
  "benchmark": "^2.1.4",
46
46
  "minify-registry-metadata": "^4.0.0",
47
47
  "nock": "^13.3.3",
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "templateOSS": {
95
95
  "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
96
- "version": "4.23.3",
96
+ "version": "4.24.4",
97
97
  "content": "../../scripts/template-oss/index.js"
98
98
  }
99
99
  }