Skip to content

gar/deps updates #6275

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 4 additions & 1 deletion DEPENDENCIES.md
Original file line number Diff line number Diff line change
Expand Up @@ -312,8 +312,10 @@ graph LR;
glob-->inflight;
glob-->inherits;
glob-->minimatch;
glob-->minipass;
glob-->once;
glob-->path-is-absolute;
glob-->path-scurry;
has-->function-bind;
hosted-git-info-->lru-cache;
http-proxy-agent-->agent-base;
Expand Down Expand Up @@ -653,7 +655,6 @@ graph LR;
npmcli-docs-->yaml;
npmcli-fs-->semver;
npmcli-git-->lru-cache;
npmcli-git-->mkdirp;
npmcli-git-->npm-pick-manifest;
npmcli-git-->npmcli-promise-spawn["@npmcli/promise-spawn"];
npmcli-git-->proc-log;
Expand Down Expand Up @@ -724,6 +725,8 @@ graph LR;
parse-conflict-json-->json-parse-even-better-errors;
parse-conflict-json-->just-diff-apply;
parse-conflict-json-->just-diff;
path-scurry-->lru-cache;
path-scurry-->minipass;
postcss-selector-parser-->cssesc;
postcss-selector-parser-->util-deprecate;
promise-retry-->err-code;
Expand Down
4 changes: 2 additions & 2 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"devDependencies": {
"@isaacs/string-locale-compare": "^1.1.0",
"@npmcli/eslint-config": "^4.0.0",
"@npmcli/template-oss": "4.12.0",
"@npmcli/template-oss": "4.12.1",
"front-matter": "^4.0.2",
"ignore-walk": "^6.0.1",
"jsdom": "^21.1.0",
Expand Down Expand Up @@ -56,7 +56,7 @@
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"ciVersions": "latest",
"engines": "^14.17.0 || ^16.13.0 || >=18.0.0",
"version": "4.12.0",
"version": "4.12.1",
"content": "../scripts/template-oss/index.js",
"workspaceRepo": {
"add": {
Expand Down
10 changes: 5 additions & 5 deletions lib/commands/help-search.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const fs = require('fs')
const { readFile } = require('fs/promises')
const path = require('path')
const chalk = require('chalk')
const { promisify } = require('util')
const glob = promisify(require('glob'))
const readFile = promisify(fs.readFile)
const glob = require('glob')
const BaseCommand = require('../base-command.js')

const globify = pattern => pattern.split('\\').join('/')
Expand All @@ -20,7 +18,9 @@ class HelpSearch extends BaseCommand {
}

const docPath = path.resolve(this.npm.npmRoot, 'docs/content')
const files = await glob(`${globify(docPath)}/*/*.md`)
let files = await glob(`${globify(docPath)}/*/*.md`)
// preserve glob@8 behavior
files = files.sort((a, b) => a.localeCompare(b, 'en'))
const data = await this.readFiles(files)
const results = await this.searchFiles(args, data, files)
const formatted = this.formatResults(args, results)
Expand Down
35 changes: 8 additions & 27 deletions lib/commands/help.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
const spawn = require('@npmcli/promise-spawn')
const path = require('path')
const openUrl = require('../utils/open-url.js')
const { promisify } = require('util')
const glob = promisify(require('glob'))
const glob = require('glob')
const localeCompare = require('@isaacs/string-locale-compare')('en')

const globify = pattern => pattern.split('\\').join('/')
Expand All @@ -12,8 +11,6 @@ const BaseCommand = require('../base-command.js')
// We don't currently compress our man pages but if we ever did this would
// seamlessly continue supporting it
const manNumberRegex = /\.(\d+)(\.[^/\\]*)?$/
// Searches for the "npm-" prefix in page names, to prefer those.
const manNpmPrefixRegex = /\/npm-/
// hardcoded names for mansections
// XXX: these are used in the docs workspace and should be exported
// from npm so section names can changed more easily
Expand All @@ -34,7 +31,9 @@ class Help extends BaseCommand {
return []
}
const g = path.resolve(this.npm.npmRoot, 'man/man[0-9]/*.[0-9]')
const files = await glob(globify(g))
let files = await glob(globify(g))
// preserve glob@8 behavior
files = files.sort((a, b) => a.localeCompare(b, 'en'))

return Object.keys(files.reduce(function (acc, file) {
file = path.basename(file).replace(/\.[0-9]+$/, '')
Expand Down Expand Up @@ -65,31 +64,13 @@ class Help extends BaseCommand {
const f = globify(path.resolve(this.npm.npmRoot, `man/${manSearch}/?(npm-)${arg}.[0-9]*`))

const [man] = await glob(f).then(r => r.sort((a, b) => {
// Prefer the page with an npm prefix, if there's only one.
const aHasPrefix = manNpmPrefixRegex.test(a)
const bHasPrefix = manNpmPrefixRegex.test(b)
if (aHasPrefix !== bHasPrefix) {
/* istanbul ignore next */
return aHasPrefix ? -1 : 1
}

// Because the glob is (subtly) different from manNumberRegex,
// we can't rely on it passing.
const aManNumberMatch = a.match(manNumberRegex)
const bManNumberMatch = b.match(manNumberRegex)
if (aManNumberMatch) {
/* istanbul ignore next */
if (!bManNumberMatch) {
return -1
}
// man number sort first so that 1 aka commands are preferred
if (aManNumberMatch[1] !== bManNumberMatch[1]) {
return aManNumberMatch[1] - bManNumberMatch[1]
}
} else if (bManNumberMatch) {
return 1
const aManNumberMatch = a.match(manNumberRegex)?.[1] || 999
const bManNumberMatch = b.match(manNumberRegex)?.[1] || 999
if (aManNumberMatch !== bManNumberMatch) {
return aManNumberMatch - bManNumberMatch
}

return localeCompare(a, b)
}))

Expand Down
4 changes: 2 additions & 2 deletions lib/utils/log-file.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const os = require('os')
const { join, dirname, basename } = require('path')
const { format, promisify } = require('util')
const glob = promisify(require('glob'))
const { format } = require('util')
const glob = require('glob')
const MiniPass = require('minipass')
const fsMiniPass = require('fs-minipass')
const fs = require('fs/promises')
Expand Down
4 changes: 2 additions & 2 deletions mock-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.12.0"
"version": "4.12.1"
},
"tap": {
"no-coverage": true,
Expand All @@ -46,7 +46,7 @@
"devDependencies": {
"@npmcli/arborist": "^6.1.1",
"@npmcli/eslint-config": "^4.0.1",
"@npmcli/template-oss": "4.12.0",
"@npmcli/template-oss": "4.12.1",
"nock": "^13.3.0",
"npm-package-arg": "^10.1.0",
"pacote": "^15.0.8",
Expand Down
9 changes: 6 additions & 3 deletions node_modules/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@
!/@tufjs/
/@tufjs/*
!/@tufjs/models
!/@tufjs/models/node_modules/
/@tufjs/models/node_modules/*
!/@tufjs/models/node_modules/minimatch
!/abbrev
!/abort-controller
!/agent-base
Expand Down Expand Up @@ -93,9 +96,6 @@
!/function-bind
!/gauge
!/glob
!/glob/node_modules/
/glob/node_modules/*
!/glob/node_modules/minimatch
!/graceful-fs
!/has-flag
!/has-unicode
Expand Down Expand Up @@ -218,6 +218,7 @@
!/pacote
!/parse-conflict-json
!/path-is-absolute
!/path-scurry
!/postcss-selector-parser
!/proc-log
!/process
Expand Down Expand Up @@ -314,3 +315,5 @@ __pycache__
.babelrc*
.nyc_output
.gitkeep
*.map
*.ts
136 changes: 0 additions & 136 deletions node_modules/@colors/colors/index.d.ts

This file was deleted.

48 changes: 0 additions & 48 deletions node_modules/@colors/colors/safe.d.ts

This file was deleted.

Loading