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

Refactor plugin #39

Merged
merged 6 commits into from
Aug 29, 2018
Merged

Refactor plugin #39

merged 6 commits into from
Aug 29, 2018

Conversation

Exelord
Copy link
Collaborator

@Exelord Exelord commented Aug 26, 2018

This PR will:

  • Update dependencies
  • Migrate project to es6
  • Refactor code
  • Add more tests
  • Fix issue where favicon is not passed
  • Fix issue with not saving manifests
  • change config API

Also, this marked the plugin as 2.0 version as I changed api structure. From now on, we can distignish plugin options from favicons.

{
  iconPath: 'favicon.png',
  onSuccess() {}, // called with favicons response
  faviconsConfig: {} // pass here any favicons config
}

This is a first PR from improvements series :)

Copy link
Owner

@davewasmer davewasmer left a comment

Choose a reason for hiding this comment

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

A couple relatively small things, but overall looks great. Thanks so much for taking point on this @Exelord!

src/index.js Outdated
iconPath = path.join(this.inputPaths[0], iconPath);

if (!fs.existsSync(iconPath)) {
return Promise.resolve()
Copy link
Owner

Choose a reason for hiding this comment

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

Should we print out a warning of some kind here? I could imagine someone getting confused about where to put the source file (i.e. they drop in the wrong folder) and then getting frustrated by the fact that the addon appears to not be working. Since all of this is opt-in, I can't imagine a scenario where you'd legitimately want to have this addon installed, but not have the source icon file exist.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, there is a case. Eg you want to test out PWA thanks to generated manifests and add the favicon later.

But sure. That would be appreciated to add a warning like: [WARRNING] Favicon file has been not detected in path "favcon/path/file.png"
I will add that!


const config = {
onSuccess() {},
iconPath: 'favicon.png',
Copy link
Owner

Choose a reason for hiding this comment

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

Shouldn't this default to something like public/favicons.png? I don't think the source image belongs at the project root level.

Copy link
Collaborator Author

@Exelord Exelord Aug 27, 2018

Choose a reason for hiding this comment

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

Not really. This project should be fully independent, and not aware of Ember structure. It's working on a passed input and it should look into the input for the icon directly, by default

Copy link
Owner

Choose a reason for hiding this comment

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

Ah right, ember-cli-favicon should default to that, good point 👍

@Exelord
Copy link
Collaborator Author

Exelord commented Aug 29, 2018

@davewasmer approved? :)

Copy link
Owner

@davewasmer davewasmer left a comment

Choose a reason for hiding this comment

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

💯

@Exelord Exelord merged commit 0ea8b9a into master Aug 29, 2018
@Exelord Exelord mentioned this pull request Aug 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants