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

fix(core): search for electron in a node_modules folder with electron in it #2326

Merged
merged 3 commits into from
Jul 11, 2021
Merged

fix(core): search for electron in a node_modules folder with electron in it #2326

merged 3 commits into from
Jul 11, 2021

Conversation

vhashimotoo
Copy link
Contributor

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes are appropriately documented (if applicable).
  • The changes have sufficient test coverage (if applicable).
  • The test suite passes successfully on my local machine (if applicable).

Summarize your changes:

This PR tries to fix the case in using with yarn workspaces where yarn also creates a node_modules folder inside the package directory with .bin files. This adds a packageName when searching for the node_modules directory to find the folder with the electron inside.

@codecov
Copy link

codecov bot commented Jun 15, 2021

Codecov Report

Merging #2326 (c7fd715) into master (cd0f052) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2326      +/-   ##
==========================================
- Coverage   72.32%   72.19%   -0.14%     
==========================================
  Files          76       76              
  Lines        2287     2287              
  Branches      437      437              
==========================================
- Hits         1654     1651       -3     
- Misses        471      473       +2     
- Partials      162      163       +1     
Impacted Files Coverage Δ
packages/api/core/src/util/electron-version.ts 88.88% <100.00%> (-4.77%) ⬇️

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 cd0f052...c7fd715. Read the comment docs.

Copy link
Member

@malept malept left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. This seems like a reasonable change. Can you add a test for this? I imagine you'd have to add some fixtures.

@vhashimotoo
Copy link
Contributor Author

@malept the tests were added, not sure why coverage is still low, maybe because this start to exit early when the electron folder is not found in node_modules (on PackageNotFoundError) instead in some other place, so this now returns the different error when a folder doesn't exist (if needed I can check if this doesn't break a more things):

master:

image

this pr:

image

@malept malept changed the title fix(core/electron-version): search for electron in node_modules with electron folder fix(core): search for electron in node_modules with electron folder Jul 11, 2021
@malept malept changed the title fix(core): search for electron in node_modules with electron folder fix(core): search for electron in a node_modules folder with electron in it Jul 11, 2021
@malept malept merged commit 43cbb0a into electron:master Jul 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants