Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: revert #12718 and simply do not bundle type declarations of @jest/globals #12721

Merged
merged 2 commits into from
Apr 24, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 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" />';

(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 excludedPackages = ['@jest/globals'];

mrazauskas marked this conversation as resolved.
Show resolved Hide resolved
const packagesToBundle = packages.filter(
p => isTsPackage(p) && hasMoreThanOneDefinitionFile(p),
p => isTsPackage(p) && !excludedPackages.includes(p.pkg.name),
);

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

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

const sharedExtractorConfig = {
Expand Down