Skip to content

Commit cf7b2d0

Browse files
committed
fix(deps): upgrade glob from v8 to v10
1 parent ce0f5b3 commit cf7b2d0

File tree

4 files changed

+87
-59
lines changed

4 files changed

+87
-59
lines changed

package-lock.json

Lines changed: 69 additions & 43 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/zip-it-and-ship-it/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
"fast-glob": "^3.3.2",
5656
"filter-obj": "^5.0.0",
5757
"find-up": "^6.0.0",
58-
"glob": "^8.0.3",
58+
"glob": "^10.4.5",
5959
"is-builtin-module": "^3.1.0",
6060
"is-path-inside": "^4.0.0",
6161
"junk": "^4.0.0",
@@ -78,7 +78,6 @@
7878
},
7979
"devDependencies": {
8080
"@types/archiver": "6.0.3",
81-
"@types/glob": "8.1.0",
8281
"@types/is-ci": "3.0.4",
8382
"@types/node": "20.12.11",
8483
"@types/normalize-path": "3.0.2",

packages/zip-it-and-ship-it/src/runtimes/node/bundlers/esbuild/bundler.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ const includedFilesToEsbuildExternals = async (includedFiles: string[], baseDir:
6262
const resolved = await glob(pattern, {
6363
noglobstar: true,
6464
cwd: baseDir,
65+
dotRelative: true,
6566
})
6667

6768
result.push(...resolved)

packages/zip-it-and-ship-it/src/utils/matching.ts

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
1-
import { promisify } from 'util'
2-
3-
import globFunction from 'glob'
4-
import { minimatch as minimatchFunction, MinimatchOptions } from 'minimatch'
1+
import { glob as originalGlob, type GlobOptions } from 'glob'
2+
import { minimatch as minimatchFunction, type MinimatchOptions } from 'minimatch'
53
import normalizePath from 'normalize-path'
64

7-
const pGlob = promisify(globFunction)
5+
// We don't use this. Specifying that we don't makes typing easier, since otherwise `glob` returns
6+
// either `string[]` or `Path[]` depending on this passed option.
7+
type Options = Omit<GlobOptions, 'withFileTypes'>
88

99
/**
1010
* Both glob and minimatch only support unix style slashes in patterns
11-
* For this reason we wrap them and ensure all patters are always unixified
11+
* For this reason we wrap them and ensure all patterns are always unixified
1212
* We use `normalize-path` here instead of `unixify` because we do not want to remove drive letters
1313
*/
14-
15-
export const glob = function (pattern: string, options: globFunction.IOptions): Promise<string[]> {
16-
let normalizedIgnore
14+
export const glob = function (pattern: string, options: Options): Promise<string[]> {
15+
let normalizedIgnore: string | undefined
1716

1817
if (options.ignore) {
19-
normalizedIgnore =
20-
typeof options.ignore === 'string'
21-
? normalizePath(options.ignore)
22-
: options.ignore.map((expression) => normalizePath(expression))
18+
if (typeof options.ignore === 'string') {
19+
normalizedIgnore = normalizePath(options.ignore)
20+
} else if (Array.isArray(options.ignore)) {
21+
options.ignore.map((expression) => normalizePath(expression))
22+
} else {
23+
throw new Error('Custom glob ignore is not supported')
24+
}
2325
}
2426

25-
return pGlob(normalizePath(pattern), { ...options, ignore: normalizedIgnore })
27+
return originalGlob(normalizePath(pattern), { ...options, ignore: normalizedIgnore })
2628
}
2729

2830
export const minimatch = function (target: string, pattern: string, options?: MinimatchOptions): boolean {

0 commit comments

Comments
 (0)