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

Installer class #13

Merged
merged 14 commits into from
Jan 22, 2019
Merged

Installer class #13

merged 14 commits into from
Jan 22, 2019

Conversation

malept
Copy link
Member

@malept malept commented Jan 15, 2019

Refactors most of the functions in src/index.js into a structured class. Installer modules can be subclassed.

I have successfully converted 4 of the known electron-installer-* modules to use this:

  • -debian
  • -redhat
  • -flatpak (my fork of it)
  • -windows (a fork of the current -common PR)

I designed -snap a bit differently, so I'm only using extracted functions, but I think this (large) change is ready for some review.

Fixes #8.

@malept malept requested a review from fcastilloec January 15, 2019 21:05
@codecov
Copy link

codecov bot commented Jan 15, 2019

Codecov Report

Merging #13 into master will increase coverage by 27.54%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master    #13       +/-   ##
=========================================
+ Coverage   72.45%   100%   +27.54%     
=========================================
  Files          12     13        +1     
  Lines         167    179       +12     
=========================================
+ Hits          121    179       +58     
+ Misses         46      0       -46
Impacted Files Coverage Δ
src/desktop.js 100% <100%> (ø) ⬆️
src/index.js 100% <100%> (+63.01%) ⬆️
src/installer.js 100% <100%> (ø)

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 08056cf...017f5c3. Read the comment docs.

@malept
Copy link
Member Author

malept commented Jan 15, 2019

I will likely be writing some tests as I ✈️ to :electron: .

@malept
Copy link
Member Author

malept commented Jan 16, 2019

Tests are done, an example of an installer using this is in a PR in -debian: electron-userland/electron-installer-debian#174

Copy link
Collaborator

@fcastilloec fcastilloec left a comment

Choose a reason for hiding this comment

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

Sorry, it took so long to review this code. I've been busy and there were so many changes that I needed the extra time.
Everything looks great, this is an amazing job! I also checked the -debian PR to see how things are working, nicely done. I won't have a lot of time these days, so probably won't be able to help to migrate the other modules to use this new version.

}))).catch(error.wrapError('moving package files'))
},
readElectronVersion: readElectronVersion,
readElectronVersion,
readMeta: readMetadata,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason why we change the name of this function? why not export it as readMetadata or rename the require import to readMeta or rename the function itself?
I know this wasn't changed as part of this PR, but it's just to keep naming export consistency

Copy link
Member Author

@malept malept Jan 22, 2019

Choose a reason for hiding this comment

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

I wasn't really interested in making a minor version bump just for that function. I'd prefer to rename the exported function. (In a separate PR.)

Copy link
Member Author

Choose a reason for hiding this comment

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

#14

@fcastilloec
Copy link
Collaborator

@malept I noticed you force-pushed to this PR after I reviewed it. Given that I don't have a lot of time lately, I'll trust that nothing, or not much, changed from my initial review. Even the commit messages look like the same as the old ones.
Let me know if there's something in particular that you need my opinion, otherwise, this is still approved.

In other news, I created a channel on IRC (Freenode server) called #electron-installer for people to ask for help rather than keep creating issues on Github. I usually stay logged there and in other channels. If you join, let me know to give you ops permissions. I'm not sure if it's worth mentioning on the READMEs of all projects. We could also create a team on Slack or use Gitter or any other one you think might be a good idea to use.

@malept
Copy link
Member Author

malept commented Jan 22, 2019

@malept I noticed you force-pushed to this PR after I reviewed it. Given that I don't have a lot of time lately, I'll trust that nothing, or not much, changed from my initial review. Even the commit messages look like the same as the old ones.
Let me know if there's something in particular that you need my opinion, otherwise, this is still approved.

Yeah, all I did was extract the AVA config commit directly onto master, because I'm going to squash this PR.

In other news, I created a channel on IRC (Freenode server) called #electron-installer for people to ask for help rather than keep creating issues on Github. I usually stay logged there and in other channels. If you join, let me know to give you ops permissions. I'm not sure if it's worth mentioning on the READMEs of all projects. We could also create a team on Slack or use Gitter or any other one you think might be a good idea to use.

I'm usually idling on the #electron channel in the atomio slack, which is one of the (unofficial) support options in the Electron documentation: https://electronjs.org/docs/tutorial/support

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