Skip to content

Commit 485d8fb

Browse files
authored
chore: use glob to select files in buildTs script (#13850)
1 parent 2b313fa commit 485d8fb

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
"execa": "^5.0.0",
4646
"find-process": "^1.4.1",
4747
"glob": "^8.0.0",
48-
"globby": "^11.0.1",
4948
"graceful-fs": "^4.2.9",
5049
"isbinaryfile": "^5.0.0",
5150
"istanbul-lib-coverage": "^3.0.0",

scripts/buildTs.mjs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import * as os from 'os';
1010
import * as path from 'path';
1111
import chalk from 'chalk';
1212
import execa from 'execa';
13-
import globby from 'globby';
13+
import glob from 'glob';
1414
import fs from 'graceful-fs';
1515
import pLimit from 'p-limit';
1616
import stripJsonComments from 'strip-json-comments';
@@ -125,12 +125,13 @@ try {
125125
await Promise.all(
126126
packagesWithTs.map(({packageDir, pkg}) =>
127127
mutex(async () => {
128-
const buildDir = path.resolve(packageDir, 'build/**/*.d.ts');
129-
130-
const globbed = await globby([buildDir]);
128+
const matched = glob.sync('build/**/*.d.ts', {
129+
absolute: true,
130+
cwd: packageDir,
131+
});
131132

132133
const files = await Promise.all(
133-
globbed.map(file =>
134+
matched.map(file =>
134135
Promise.all([file, fs.promises.readFile(file, 'utf8')]),
135136
),
136137
);

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2819,7 +2819,6 @@ __metadata:
28192819
execa: ^5.0.0
28202820
find-process: ^1.4.1
28212821
glob: ^8.0.0
2822-
globby: ^11.0.1
28232822
graceful-fs: ^4.2.9
28242823
isbinaryfile: ^5.0.0
28252824
istanbul-lib-coverage: ^3.0.0

0 commit comments

Comments
 (0)