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

scripts: Don’t make empty subfolders for ignored files in build folder #7001

Merged
merged 2 commits into from
Sep 29, 2018

Conversation

pedrottimark
Copy link
Contributor

Summary

I noticed empty build/__tests__ folder in the installed [email protected] package.

Although I didn’t find where that problem was fixed between 23.4.0 and 23.4.1, I did find change in assumption as reason for many empty subfolders in build folder.

Comment in scripts/build.js file:

Non-js or files matching IGNORE_PATTERN will be copied without transpiling.

For a long while, files in folders matching IGNORE_PATTERN are not copied, so buildFile function can return early before mkdirp call.

The diff after code is moved with a change takes a second look to understand what happened :(

Test plan

yarn build-clean and yarn build and yarn jest

after yarn build baseline improved
files 250 250
folders 189 56
__tests__ or __mocks__ folders or subfolders 133 0
empty folders 83 0

The improved number of folder 56 = 189 - 133

The baseline number of empty folders 83 < 133 because some intermediate level subfolder do contain subfolders (even though they don’t contain files)

Here are the commands for rows in preceding table:

  • find packages/*/build -type f -print | wc
  • find packages/*/build -type d -print | wc
  • find packages/*/build -type d -print | grep -e __tests__ -e __mocks__ | wc
  • find packages/*/build -type d -empty -print | wc

@codecov-io
Copy link

Codecov Report

Merging #7001 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #7001   +/-   ##
=======================================
  Coverage   66.92%   66.92%           
=======================================
  Files         250      250           
  Lines       10405    10405           
  Branches        4        3    -1     
=======================================
  Hits         6964     6964           
  Misses       3440     3440           
  Partials        1        1

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5cdea2...aae0b31. Read the comment docs.

@SimenB SimenB merged commit 0098f9b into jestjs:master Sep 29, 2018
@pedrottimark pedrottimark deleted the build-ignored branch October 12, 2018 17:49
@github-actions
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants