Skip to content

Commit

Permalink
Fixing typos
Browse files Browse the repository at this point in the history
  • Loading branch information
deining committed Feb 22, 2023
1 parent a60b34e commit e4ed784
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/help.js
Original file line number Diff line number Diff line change
Expand Up @@ -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-/
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/link.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions lib/utils/queryable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 => {
Expand All @@ -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])
Expand All @@ -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 [
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/workspaces/update-workspaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function updateWorkspaces ({
? false
: config.get('save')

// runs a minimalistic reify update, targetting only the workspaces
// runs a minimalistic reify update, targeting only the workspaces
// that had version updates and skipping fund/audit/save
const opts = {
...flatOptions,
Expand Down
2 changes: 1 addition & 1 deletion scripts/bundle-and-gitignore-deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/create-node-pr.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 })
Expand Down
14 changes: 7 additions & 7 deletions scripts/dependency-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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'))
Expand All @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 optionally be an options object
const getArgs = (allArgs) => {
let args = allArgs.flat().filter(Boolean)
let opts = {}
Expand Down
4 changes: 2 additions & 2 deletions workspaces/arborist/docs/workspace.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion workspaces/arborist/test/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')

Expand Down

0 comments on commit e4ed784

Please sign in to comment.