Skip to content

Commit ec3e020

Browse files
committed
1 parent 99cf197 commit ec3e020

File tree

286 files changed

+170
-14672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

286 files changed

+170
-14672
lines changed

lib/commands/help-search.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
const fs = require('fs')
1+
const { readFile } = require('fs/promises')
22
const path = require('path')
33
const chalk = require('chalk')
4-
const { promisify } = require('util')
5-
const glob = promisify(require('glob'))
6-
const readFile = promisify(fs.readFile)
4+
const glob = require('glob')
75
const BaseCommand = require('../base-command.js')
86

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

2220
const docPath = path.resolve(this.npm.npmRoot, 'docs/content')
23-
const files = await glob(`${globify(docPath)}/*/*.md`)
21+
let files = await glob(`${globify(docPath)}/*/*.md`)
22+
// preserve glob@8 behavior
23+
files = files.sort((a, b) => a.localeCompare(b, 'en'))
2424
const data = await this.readFiles(files)
2525
const results = await this.searchFiles(args, data, files)
2626
const formatted = this.formatResults(args, results)

lib/commands/help.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
const spawn = require('@npmcli/promise-spawn')
22
const path = require('path')
33
const openUrl = require('../utils/open-url.js')
4-
const { promisify } = require('util')
5-
const glob = promisify(require('glob'))
4+
const glob = require('glob')
65
const localeCompare = require('@isaacs/string-locale-compare')('en')
76

87
const globify = pattern => pattern.split('\\').join('/')
@@ -34,7 +33,9 @@ class Help extends BaseCommand {
3433
return []
3534
}
3635
const g = path.resolve(this.npm.npmRoot, 'man/man[0-9]/*.[0-9]')
37-
const files = await glob(globify(g))
36+
let files = await glob(globify(g))
37+
// preserve glob@8 behavior
38+
files = files.sort((a, b) => a.localeCompare(b, 'en'))
3839

3940
return Object.keys(files.reduce(function (acc, file) {
4041
file = path.basename(file).replace(/\.[0-9]+$/, '')
@@ -86,7 +87,9 @@ class Help extends BaseCommand {
8687
if (aManNumberMatch[1] !== bManNumberMatch[1]) {
8788
return aManNumberMatch[1] - bManNumberMatch[1]
8889
}
90+
/* istanbul ignore next */
8991
} else if (bManNumberMatch) {
92+
/* istanbul ignore next */
9093
return 1
9194
}
9295

lib/utils/log-file.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const os = require('os')
22
const { join, dirname, basename } = require('path')
3-
const { format, promisify } = require('util')
4-
const glob = promisify(require('glob'))
3+
const { format } = require('util')
4+
const glob = require('glob')
55
const MiniPass = require('minipass')
66
const fsMiniPass = require('fs-minipass')
77
const fs = require('fs/promises')

node_modules/.gitignore

-9
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
!/@npmcli/map-workspaces
2424
!/@npmcli/map-workspaces/node_modules/
2525
/@npmcli/map-workspaces/node_modules/*
26-
!/@npmcli/map-workspaces/node_modules/glob
2726
!/@npmcli/map-workspaces/node_modules/minimatch
2827
!/@npmcli/metavuln-calculator
2928
!/@npmcli/move-file
@@ -60,10 +59,6 @@
6059
!/buffer
6160
!/builtins
6261
!/cacache
63-
!/cacache/node_modules/
64-
/cacache/node_modules/*
65-
!/cacache/node_modules/glob
66-
!/cacache/node_modules/minimatch
6762
!/chalk
6863
!/chownr
6964
!/ci-info
@@ -242,10 +237,6 @@
242237
!/read-cmd-shim
243238
!/read-package-json-fast
244239
!/read-package-json
245-
!/read-package-json/node_modules/
246-
/read-package-json/node_modules/*
247-
!/read-package-json/node_modules/glob
248-
!/read-package-json/node_modules/minimatch
249240
!/read
250241
!/readable-stream
251242
!/retry

node_modules/@npmcli/map-workspaces/node_modules/glob/LICENSE

-15
This file was deleted.

node_modules/@npmcli/map-workspaces/node_modules/glob/package.json

-98
This file was deleted.

node_modules/cacache/node_modules/glob/LICENSE

-15
This file was deleted.

0 commit comments

Comments
 (0)