Skip to content

Commit 0a8b8c2

Browse files
authored
fix: typo bugs and other spelling fixes (#8621)
Fixes two typo-related bugs: - ignoring bundled edges in the isolate reifier when assigning common properties in the tree - propagating legacy peer deps in children when calculating place-dep.
1 parent 5ac3678 commit 0a8b8c2

36 files changed

+81
-81
lines changed

workspaces/arborist/CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@
172172
* [`e290352`](https://github.com/npm/cli/commit/e290352c6b9fd3bc7fa4b8ea2cc2000fb20fdec7) [#7499](https://github.com/npm/cli/pull/7499) revert DepsQueue to re-sort on pop() (#7499) (@lukekarrys)
173173
* [`56a27fa`](https://github.com/npm/cli/commit/56a27fa400f157fb9a56182900278c41efc6aba1) [#7494](https://github.com/npm/cli/pull/7494) avoid caching manifests as promises (@wraithgar)
174174
* [`722c0fa`](https://github.com/npm/cli/commit/722c0faa387ae6e35886f08eefb238c03ae85db1) [#7463](https://github.com/npm/cli/pull/7463) limit packument cache size based on heap size (@wraithgar)
175-
* [`effe910`](https://github.com/npm/cli/commit/effe9109d6bc7828bf916c4dee49b2a53c72f39d) [#7475](https://github.com/npm/cli/pull/7475) dont omit license from stored manifests (#7475) (@lukekarrys)
175+
* [`effe910`](https://github.com/npm/cli/commit/effe9109d6bc7828bf916c4dee49b2a53c72f39d) [#7475](https://github.com/npm/cli/pull/7475) don't omit license from stored manifests (#7475) (@lukekarrys)
176176

177177
### Dependencies
178178

@@ -213,7 +213,7 @@
213213

214214
### Features
215215

216-
* [`9123de4`](https://github.com/npm/cli/commit/9123de4d282bfd19ea17ad613f5a2acab0e0e162) [#7373](https://github.com/npm/cli/pull/7373) do all ouput over proc-log events (@lukekarrys)
216+
* [`9123de4`](https://github.com/npm/cli/commit/9123de4d282bfd19ea17ad613f5a2acab0e0e162) [#7373](https://github.com/npm/cli/pull/7373) do all output over proc-log events (@lukekarrys)
217217
* [`9622597`](https://github.com/npm/cli/commit/9622597399ec93224fddf90a9209a98dbcfd6b2f) [#7339](https://github.com/npm/cli/pull/7339) refactor terminal display (#7339) (@lukekarrys)
218218

219219
### Bug Fixes
@@ -801,7 +801,7 @@
801801

802802
### Bug Fixes
803803

804-
* **arborist:** dont skip adding advisories to audit based on name/range ([aa4a4da](https://github.com/npm/cli/commit/aa4a4da336a6ec1963394fdbd06acb173c842d26)), closes [#4681](https://github.com/npm/cli/issues/4681)
804+
* **arborist:** don't skip adding advisories to audit based on name/range ([aa4a4da](https://github.com/npm/cli/commit/aa4a4da336a6ec1963394fdbd06acb173c842d26)), closes [#4681](https://github.com/npm/cli/issues/4681)
805805
* **arborist:** when reloading an edge, also refresh overrides ([4d676e3](https://github.com/npm/cli/commit/4d676e31a68f081b8553eff4e79db1f29acf47e1))
806806

807807
### [5.0.5](https://github.com/npm/cli/compare/arborist-v5.0.4...arborist-v5.0.5) (2022-04-06)

workspaces/arborist/bin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ ${message && '\n' + message + '\n'}
3737
3838
Additionally:
3939
40-
* --loglevel=warn|--quiet will supppress the printing of package trees
40+
* --loglevel=warn|--quiet will suppress the printing of package trees
4141
* --logfile <file|bool> will output logs to a file
4242
* --timing will show timing information
4343
* Instead of 'npm install <pkg>', use 'arborist reify --add=<pkg>'.

workspaces/arborist/docs/ideal-tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ dependency can go without causing conflicts.
6666

6767
1. If edge is valid, and dep name is not on the update list, do not place
6868
2. If the node is not a top node, and the dep is a peer dep, then the
69-
starting TARGET is node.parent, otherwise it's node
69+
starting TARGET is node.parent; otherwise, it's node
7070
3. Do until CONFLICT:
7171
1. CHECK if dep can be placed at TARGET
7272
2. If not CONFLICT, set result in CAN PLACE

workspaces/arborist/lib/arborist/build-ideal-tree.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ This is a one-time fix-up, please be patient...
10241024
}
10251025

10261026
// pre-fetch any problem edges, since we'll need these soon
1027-
// if it fails at this point, though, dont' worry because it
1027+
// if it fails at this point, though, don't worry because it
10281028
// may well be an optional dep that has gone missing. it'll
10291029
// fail later anyway.
10301030
for (const e of this.#problemEdges(placed)) {
@@ -1080,7 +1080,7 @@ This is a one-time fix-up, please be patient...
10801080
? await this.#nodeFromSpec(edge.name, spec2, parent, secondEdge)
10811081
: null
10821082

1083-
// pick the second one if they're both happy with that, otherwise first
1083+
// pick the second one if they're both happy with that; otherwise, first
10841084
const node = second && edge.valid ? second : first
10851085
// ensure the one we want is the one that's placed
10861086
node.parent = parent
@@ -1287,7 +1287,7 @@ This is a one-time fix-up, please be patient...
12871287

12881288
// failed to load the spec, either because of enotarget or
12891289
// fetch failure of some other sort. save it so we can verify
1290-
// later that it's optional, otherwise the error is fatal.
1290+
// later that it's optional; otherwise, the error is fatal.
12911291
const n = new Node({
12921292
name,
12931293
parent,
@@ -1444,7 +1444,7 @@ This is a one-time fix-up, please be patient...
14441444
// - if a path under an existing node, then assign that as the fsParent,
14451445
// and add it to the _depsQueue
14461446
//
1447-
// call buildDepStep if anything was added to the queue, otherwise we're done
1447+
// call buildDepStep if anything was added to the queue; otherwise, we're done
14481448
#resolveLinks () {
14491449
for (const link of this.#linkNodes) {
14501450
this.#linkNodes.delete(link)

workspaces/arborist/lib/arborist/isolated-reifier.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ module.exports = cls => class IsolatedReifier extends cls {
140140

141141
async assignCommonProperties (node, result) {
142142
function validEdgesOut (node) {
143-
return [...node.edgesOut.values()].filter(e => e.to && e.to.target && !(node.package.bundledDepenedencies || node.package.bundleDependencies || []).includes(e.to.name))
143+
return [...node.edgesOut.values()].filter(e => e.to && e.to.target && !(node.package.bundledDependencies || node.package.bundleDependencies || []).includes(e.to.name))
144144
}
145145
const edges = validEdgesOut(node)
146146
const optionalDeps = edges.filter(e => e.optional).map(e => e.to.target)

workspaces/arborist/lib/arborist/load-actual.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ module.exports = cls => class ActualLoader extends cls {
3636
// We don't do fsParent as a magic getter/setter, because it'd be too costly
3737
// to keep up to date along the walk.
3838
// And, we know that it can ONLY be relevant when the node is a target of a
39-
// link, otherwise it'd be in a node_modules folder, so take advantage of
39+
// link; otherwise, it'd be in a node_modules folder, so take advantage of
4040
// that to limit the scans later.
4141
#topNodes = new Set()
4242
#transplantFilter

workspaces/arborist/lib/arborist/load-virtual.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ module.exports = cls => class VirtualLoader extends cls {
168168
}
169169
}
170170

171-
// separate out link metadatas, and create Node objects for nodes
171+
// separate out link metadata, and create Node objects for nodes
172172
#resolveNodes (s, root) {
173173
const links = new Map()
174174
const nodes = new Map([['', root]])

workspaces/arborist/lib/arborist/reify.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1323,7 +1323,7 @@ module.exports = cls => class Reifier extends cls {
13231323
const alias = name !== pname
13241324
newSpec = alias ? `npm:${pname}@${range}` : range
13251325
} else if (req.hosted) {
1326-
// save the git+https url if it has auth, otherwise shortcut
1326+
// save the git+https url if it has auth; otherwise, shortcut
13271327
const h = req.hosted
13281328
const opt = { noCommittish: false }
13291329
if (h.https && h.auth) {
@@ -1392,7 +1392,7 @@ module.exports = cls => class Reifier extends cls {
13921392

13931393
// Returns true if any of the edges from this node has a semver
13941394
// range definition that is an exact match to the version installed
1395-
// e.g: should return true if for a given an installed version 1.0.0,
1395+
// e.g: should return true if for a given and installed version 1.0.0,
13961396
// range is either =1.0.0 or 1.0.0
13971397
const exactVersion = node => {
13981398
for (const edge of node.edgesIn) {

workspaces/arborist/lib/gather-dep-set.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const gatherDepSet = (set, edgeFilter) => {
2020
}
2121
}
2222

23-
// now remove all nodes in the set that have a dependant outside the set
23+
// now remove all nodes in the set that have a dependent outside the set
2424
// if any change is made, then re-check
2525
// continue until no changes made, or deps set evaporates fully.
2626
let changed = true

workspaces/arborist/lib/node.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ class Node {
248248
this.fsParent = fsParent || null
249249

250250
// see parent/root setters below.
251-
// root is set to parent's root if we have a parent, otherwise if it's
251+
// root is set to parent's root if we have a parent; otherwise, if it's
252252
// null, then it's set to the node itself.
253253
if (!parent && !fsParent) {
254254
this.root = root || null
@@ -832,7 +832,7 @@ class Node {
832832
edge.reload()
833833
}
834834
}
835-
// reload all edgesOut where root doens't match, or is missing, since
835+
// reload all edgesOut where root doesn't match, or is missing, since
836836
// it might not be missing in the new tree
837837
for (const edge of this.edgesOut.values()) {
838838
if (!edge.to || edge.to.root !== root) {
@@ -1268,7 +1268,7 @@ class Node {
12681268
// with another by the same name (eg, to update or dedupe).
12691269
// This does a couple of walks out on the node_modules tree, recursing
12701270
// into child nodes. However, as setting the parent is typically done
1271-
// with nodes that don't have have many children, and (deduped) package
1271+
// with nodes that don't have many children, and (deduped) package
12721272
// trees tend to be broad rather than deep, it's not that bad.
12731273
// The only walk that starts from the parent rather than this node is
12741274
// limited by edge name.
@@ -1412,7 +1412,7 @@ class Node {
14121412
}
14131413

14141414
recalculateOutEdgesOverrides () {
1415-
// For each edge out propogate the new overrides through.
1415+
// For each edge out propagate the new overrides through.
14161416
for (const edge of this.edgesOut.values()) {
14171417
edge.reload(true)
14181418
if (edge.to) {

0 commit comments

Comments
 (0)