Skip to content

Commit

Permalink
chore: use glob to select files in buildTs script (#13850)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrazauskas authored Feb 2, 2023
1 parent 2b313fa commit 485d8fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"execa": "^5.0.0",
"find-process": "^1.4.1",
"glob": "^8.0.0",
"globby": "^11.0.1",
"graceful-fs": "^4.2.9",
"isbinaryfile": "^5.0.0",
"istanbul-lib-coverage": "^3.0.0",
Expand Down
11 changes: 6 additions & 5 deletions scripts/buildTs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import * as os from 'os';
import * as path from 'path';
import chalk from 'chalk';
import execa from 'execa';
import globby from 'globby';
import glob from 'glob';
import fs from 'graceful-fs';
import pLimit from 'p-limit';
import stripJsonComments from 'strip-json-comments';
Expand Down Expand Up @@ -125,12 +125,13 @@ try {
await Promise.all(
packagesWithTs.map(({packageDir, pkg}) =>
mutex(async () => {
const buildDir = path.resolve(packageDir, 'build/**/*.d.ts');

const globbed = await globby([buildDir]);
const matched = glob.sync('build/**/*.d.ts', {
absolute: true,
cwd: packageDir,
});

const files = await Promise.all(
globbed.map(file =>
matched.map(file =>
Promise.all([file, fs.promises.readFile(file, 'utf8')]),
),
);
Expand Down
1 change: 0 additions & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2819,7 +2819,6 @@ __metadata:
execa: ^5.0.0
find-process: ^1.4.1
glob: ^8.0.0
globby: ^11.0.1
graceful-fs: ^4.2.9
isbinaryfile: ^5.0.0
istanbul-lib-coverage: ^3.0.0
Expand Down

0 comments on commit 485d8fb

Please sign in to comment.