Skip to content

Commit 6993450

Browse files
committed
Upgrade precompiled glob
1 parent e0008a9 commit 6993450

File tree

9 files changed

+56
-121
lines changed

9 files changed

+56
-121
lines changed

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@
156156
"@types/cookie": "0.3.3",
157157
"@types/cross-spawn": "6.0.0",
158158
"@types/fs-extra": "8.1.0",
159-
"@types/glob": "7.1.1",
160159
"@types/html-validator": "5.0.3",
161160
"@types/http-proxy": "1.17.3",
162161
"@types/jest": "29.5.5",
@@ -211,7 +210,7 @@
211210
"fs-extra": "9.0.0",
212211
"get-port": "5.1.1",
213212
"get-port-please": "3.1.1",
214-
"glob": "7.1.6",
213+
"glob": "9.3.5",
215214
"globals": "16.4.0",
216215
"gzip-size": "5.1.1",
217216
"html-validator": "5.1.18",

packages/next/package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@
199199
"@types/debug": "4.1.5",
200200
"@types/express-serve-static-core": "4.17.33",
201201
"@types/fresh": "0.5.0",
202-
"@types/glob": "7.1.1",
203202
"@types/jsonwebtoken": "9.0.0",
204203
"@types/lodash": "4.14.198",
205204
"@types/lodash.curry": "4.1.6",
@@ -263,7 +262,7 @@
263262
"events": "3.3.0",
264263
"find-up": "4.1.0",
265264
"fresh": "0.5.2",
266-
"glob": "7.1.7",
265+
"glob": "9.3.5",
267266
"gzip-size": "5.1.1",
268267
"http-proxy": "1.18.1",
269268
"http-proxy-agent": "5.0.0",

packages/next/src/build/collect-build-traces.ts

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -547,18 +547,7 @@ export async function collectBuildTraces({
547547
const globOrig =
548548
require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')
549549
const glob = (pattern: string): Promise<string[]> => {
550-
return new Promise((resolve, reject) => {
551-
globOrig(
552-
pattern,
553-
{ cwd: dir, nodir: true, dot: true },
554-
(err, files) => {
555-
if (err) {
556-
return reject(err)
557-
}
558-
resolve(files)
559-
}
560-
)
561-
})
550+
return globOrig(pattern, { cwd: dir, nodir: true, dot: true })
562551
}
563552

564553
const { entryNameFilesMap } = buildTraceContext?.chunksTrace || {}

packages/next/src/build/index.ts

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,17 +2644,8 @@ export default async function build(
26442644
const globOrig =
26452645
require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')
26462646

2647-
const cssFilePaths = await new Promise<string[]>((resolve, reject) => {
2648-
globOrig(
2649-
'**/*.css',
2650-
{ cwd: path.join(distDir, 'static') },
2651-
(err, files) => {
2652-
if (err) {
2653-
return reject(err)
2654-
}
2655-
resolve(files)
2656-
}
2657-
)
2647+
const cssFilePaths = await globOrig('**/*.css', {
2648+
cwd: path.join(distDir, 'static'),
26582649
})
26592650

26602651
requiredServerFilesManifest.files.push(

packages/next/src/compiled/postcss-preset-env/index.cjs

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

packages/next/src/lib/inline-static-env.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
import fs from 'fs'
22
import path from 'path'
33
import crypto from 'crypto'
4-
import { promisify } from 'util'
5-
import globOriginal from 'next/dist/compiled/glob'
4+
import glob from 'next/dist/compiled/glob'
65
import { Sema } from 'next/dist/compiled/async-sema'
76
import type { NextConfigComplete } from '../server/config-shared'
87
import { getNextConfigEnv, getStaticEnv } from './static-env'
98

10-
const glob = promisify(globOriginal)
11-
129
export async function inlineStaticEnv({
1310
distDir,
1411
config,

packages/next/src/lib/verify-root-layout.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,7 @@ import type { PageExtensions } from '../build/page-extensions-type'
88
const globOrig =
99
require('next/dist/compiled/glob') as typeof import('next/dist/compiled/glob')
1010
const glob = (cwd: string, pattern: string): Promise<string[]> => {
11-
return new Promise((resolve, reject) => {
12-
globOrig(pattern, { cwd }, (err, files) => {
13-
if (err) {
14-
return reject(err)
15-
}
16-
resolve(files)
17-
})
18-
})
11+
return globOrig(pattern, { cwd })
1912
}
2013

2114
function getRootLayout(isTs: boolean) {

0 commit comments

Comments
 (0)