From 62afb830bf68031c6846792470a0174055871bc5 Mon Sep 17 00:00:00 2001 From: Tom Mrazauskas Date: Sun, 24 Apr 2022 10:13:15 +0300 Subject: [PATCH] chore: revert #12718 and simply do not bundle type declarations of `@jest/globals` (#12721) --- scripts/bundleTs.mjs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/bundleTs.mjs b/scripts/bundleTs.mjs index 7d87a062e8cd..4961d41ad2c6 100644 --- a/scripts/bundleTs.mjs +++ b/scripts/bundleTs.mjs @@ -36,23 +36,20 @@ const copyrightSnippet = ` */ `.trim(); +const typesNodeReferenceDirective = '/// '; + +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 = '/// '; - console.log(chalk.inverse(' Extracting TypeScript definition files ')); const sharedExtractorConfig = {