Skip to content

Commit

Permalink
chore: revert #12718 and simply do not bundle type declarations of `@…
Browse files Browse the repository at this point in the history
…jest/globals` (#12721)
  • Loading branch information
mrazauskas authored Apr 24, 2022
1 parent 4f1d199 commit 62afb83
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions scripts/bundleTs.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,23 +36,20 @@ const copyrightSnippet = `
*/
`.trim();

const typesNodeReferenceDirective = '/// <reference types="node" />';

const excludedPackages = new Set(['@jest/globals']);

(async () => {
const packages = getPackages();

const isTsPackage = p =>
fs.existsSync(path.resolve(p.packageDir, 'tsconfig.json'));

const hasMoreThanOneDefinitionFile = p =>
fs
.readdirSync(path.resolve(p.packageDir, 'build'))
.filter(f => f.endsWith('.d.ts')).length > 1;

const packagesToBundle = packages.filter(
p => isTsPackage(p) && hasMoreThanOneDefinitionFile(p),
p => isTsPackage(p) && !excludedPackages.has(p.pkg.name),
);

const typesNodeReferenceDirective = '/// <reference types="node" />';

console.log(chalk.inverse(' Extracting TypeScript definition files '));

const sharedExtractorConfig = {
Expand Down

0 comments on commit 62afb83

Please sign in to comment.