From 72a9221c531f62915cc6f499304530d2cd0dd561 Mon Sep 17 00:00:00 2001 From: Andreas Deininger Date: Tue, 21 Feb 2023 21:50:17 +0100 Subject: [PATCH] Fixing typos --- DEPENDENCIES.md | 2 +- lib/commands/help.js | 2 +- lib/commands/link.js | 2 +- lib/utils/queryable.js | 8 ++++---- scripts/bundle-and-gitignore-deps.js | 2 +- scripts/create-node-pr.js | 2 +- scripts/dependency-graph.js | 14 +++++++------- scripts/util.js | 2 +- workspaces/arborist/docs/workspace.md | 4 ++-- workspaces/arborist/test/node.js | 2 +- 10 files changed, 20 insertions(+), 20 deletions(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index c5d4291e4c14b..89c0eb4103615 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -777,7 +777,7 @@ graph LR; write-file-atomic-->signal-exit; ``` -## npm dependency heirarchy +## npm dependency hierarchy These are the groups of dependencies in npm that depend on each other. Each group depends on packages lower down the chain, nothing depends on diff --git a/lib/commands/help.js b/lib/commands/help.js index 3ab2c56319868..28f18e7edcef7 100644 --- a/lib/commands/help.js +++ b/lib/commands/help.js @@ -10,7 +10,7 @@ const BaseCommand = require('../base-command.js') // Strips out the number from foo.7 or foo.7. or foo.7.tgz // We don't currently compress our man pages but if we ever did this would -// seemlessly continue supporting it +// seamlessly continue supporting it const manNumberRegex = /\.(\d+)(\.[^/\\]*)?$/ // Searches for the "npm-" prefix in page names, to prefer those. const manNpmPrefixRegex = /\/npm-/ diff --git a/lib/commands/link.js b/lib/commands/link.js index 5af2c7c269f8f..6d8027f2b9cb6 100644 --- a/lib/commands/link.js +++ b/lib/commands/link.js @@ -52,7 +52,7 @@ class Link extends ArboristWorkspaceCmd { { code: 'ELINKGLOBAL' } ) } - // install-links is implicitely false when running `npm link` + // install-links is implicitly false when running `npm link` this.npm.config.set('install-links', false) // link with no args: symlink the folder to the global location diff --git a/lib/utils/queryable.js b/lib/utils/queryable.js index 6acc1758ceea7..5ddcf636e8383 100644 --- a/lib/utils/queryable.js +++ b/lib/utils/queryable.js @@ -4,7 +4,7 @@ const _append = Symbol('append') const sqBracketsMatcher = str => str.match(/(.+)\[([^\]]+)\]\.?(.*)$/) -// replaces any occurence of an empty-brackets (e.g: []) with a special +// replaces any occurrence of an empty-brackets (e.g: []) with a special // Symbol(append) to represent it, this is going to be useful for the setter // method that will push values to the end of the array when finding these const replaceAppendSymbols = str => { @@ -29,7 +29,7 @@ const parseKeys = key => { const preSqBracketPortion = index[1] // we want to have a `new String` wrapper here in order to differentiate - // between multiple occurences of the same string, e.g: + // between multiple occurrences of the same string, e.g: // foo.bar[foo.bar] should split into { foo: { bar: { 'foo.bar': {} } } /* eslint-disable-next-line no-new-wrappers */ const foundKey = new String(index[2]) @@ -41,7 +41,7 @@ const parseKeys = key => { sqBracketItems.add(foundKey) // returns an array that contains either dot-separate items (that will - // be splitted appart during the next step OR the fully parsed keys + // be split apart during the next step OR the fully parsed keys // read from square brackets, e.g: // foo.bar[1.0.0].a.b -> ['foo.bar', '1.0.0', 'a.b'] return [ @@ -142,7 +142,7 @@ const setter = ({ data, key, value, force }) => { const keys = parseKeys(key) const setKeys = (_data, _key) => { // handles array indexes, converting valid integers to numbers, - // note that occurences of Symbol(append) will throw, + // note that occurrences of Symbol(append) will throw, // so we just ignore these for now let maybeIndex = Number.NaN try { diff --git a/scripts/bundle-and-gitignore-deps.js b/scripts/bundle-and-gitignore-deps.js index 6057e8bc15e16..421767dd6888d 100644 --- a/scripts/bundle-and-gitignore-deps.js +++ b/scripts/bundle-and-gitignore-deps.js @@ -109,7 +109,7 @@ const getAllowedPaths = (files) => { if (use) { this.use() } - // Allow a previously ignored directy + // Allow a previously ignored directory // Important: this should NOT have a trailing // slash if we are not sure it is a directory. // Since a dep can be a directory or a symlink and diff --git a/scripts/create-node-pr.js b/scripts/create-node-pr.js index 712f71b7ccaef..d3841bc2a465c 100644 --- a/scripts/create-node-pr.js +++ b/scripts/create-node-pr.js @@ -247,7 +247,7 @@ const main = async (spec, branch = 'main', opts) => withTempDir(CWD, async (tmpD } } - log.info('Found exisiting PR', existingPr) + log.info('Found existing PR', existingPr) log.info('Found PRs to close', closePrs) const prBody = await getPrBody({ releases: npmReleases, closePrs }) diff --git a/scripts/dependency-graph.js b/scripts/dependency-graph.js index 2d8a773e03724..f9c177968b848 100644 --- a/scripts/dependency-graph.js +++ b/scripts/dependency-graph.js @@ -86,7 +86,7 @@ const main = async function () { const tree = await arborist.loadVirtual({ path: CWD, name: 'npm' }) tree.name = 'npm' - const [annotationsOurs, heirarchyOurs] = walk(tree, true) + const [annotationsOurs, hierarchyOurs] = walk(tree, true) const [annotationsAll] = walk(tree, false) const out = [ @@ -104,13 +104,13 @@ const main = async function () { ...annotationsAll.sort(), '```', '', - '## npm dependency heirarchy', + '## npm dependency hierarchy', '', 'These are the groups of dependencies in npm that depend on each other.', 'Each group depends on packages lower down the chain, nothing depends on', 'packages higher up the chain.', '', - ` - ${heirarchyOurs.reverse().join('\n - ')}`, + ` - ${hierarchyOurs.reverse().join('\n - ')}`, ] return fs.writeFile(join(CWD, 'DEPENDENCIES.md'), out.join('\n')) @@ -124,7 +124,7 @@ const walk = function (tree, onlyOurs) { const allDeps = new Set(Object.keys(dependedBy)) const foundDeps = new Set() - const heirarchy = [] + const hierarchy = [] if (onlyOurs) { while (allDeps.size) { @@ -158,13 +158,13 @@ const walk = function (tree, onlyOurs) { throw new Error(`Would do an infinite loop here, need to debug. ${remaining}`) } - heirarchy.push(level.join(', ')) - log.silly('HIEARARCHY', heirarchy.length) + hierarchy.push(level.join(', ')) + log.silly('HIERARCHY', hierarchy.length) log.silly('='.repeat(80)) } } - return [annotations, heirarchy] + return [annotations, hierarchy] } const iterate = function (node, dependedBy, annotations, onlyOurs) { diff --git a/scripts/util.js b/scripts/util.js index bb8dd48f8c01e..9ee2d14b2b2f4 100644 --- a/scripts/util.js +++ b/scripts/util.js @@ -30,7 +30,7 @@ const fs = { } // for spawn, allow a flat array of arguments where the -// the last arg can optionall be an options object +// the last arg can optional be an options object const getArgs = (allArgs) => { let args = allArgs.flat().filter(Boolean) let opts = {} diff --git a/workspaces/arborist/docs/workspace.md b/workspaces/arborist/docs/workspace.md index d8c09e937605c..062fb7c91a565 100644 --- a/workspaces/arborist/docs/workspace.md +++ b/workspaces/arborist/docs/workspace.md @@ -52,13 +52,13 @@ root `Node` - be aware it's a **Top-level workspace** - 4 Edges in edgesOut with type=workspace, referencing workspace children - that means we create a link node in root.children.get('app') - targetting `./app` Node, etc. + targeting `./app` Node, etc. - during buildIdeal: - need to know that app is in root's workspace - app.wsParent = root - root.wsChildren.add(app) - if any dep CAN be satisfied by a named dep in the workspace, then - create a Link targetting that workspace child node + create a Link targeting that workspace child node - resolving: _first_ check this.wsParent.get('dep-name'), and if that's ok, then resolve with a link to that target. - no hoisting by default: when doing `_canPlaceDep`, if target is diff --git a/workspaces/arborist/test/node.js b/workspaces/arborist/test/node.js index d89bf804a509a..347a55209644f 100644 --- a/workspaces/arborist/test/node.js +++ b/workspaces/arborist/test/node.js @@ -533,7 +533,7 @@ t.test('load with a virtual filesystem parent', t => { t.equal(normalizePath(packages.path), normalizePath(root.realpath + '/link-target/packages')) t.equal(normalizePath(target3.path), normalizePath(root.realpath + '/link-target/packages/link3')) - t.equal(link3.target, target3, 'still targetting the right node 4') + t.equal(link3.target, target3, 'still targeting the right node 4') t.equal(target3.fsParent, packages, 'link3 target under packages') t.equal(normalizePath(link3.realpath), normalizePath(target3.path), 'link realpath updated')