Templarian / MaterialDesign-Webfont

@mdi/font Dist for Material Design Icons.
https://materialdesignicons.com
Other
406 stars 157 forks source link

bower.json main section is "illegal" to bower spec #7

Closed stefan-schweiger closed 8 years ago

stefan-schweiger commented 9 years ago

From the bower.json spec:

[...] Only one file per filetype.

[...]

Image and font files may be used or referenced within the JS or Sass files, but are not main files as they are not entry-points.

  • Use source files with module exports and imports over pre-built distribution files.
  • Do not include minified files.
  • Do not include assets files like images, fonts, audio, or video.
  • Filenames should not be versioned (Bad: package.1.1.0.js; Good: package.js).
  • Globs like js/*.js are not allowed

Because of this with your current configuration wiredep always includes the normal an the minfied css file.

So the main section should only include the css file:

"main": [
    "css/materialdesignicons.css",
]
stefan-schweiger commented 9 years ago

OK, after thinking more about this and looking how other font libraries, like Font Aweseom, handle their bower.json files it kind of makes sense to include the font files and the materialdesignicons.scss. Because else it will be cumbersome to handle the assets and styles dynamically with gulp/grunt tasks.

But I still would suggest to only include one file per filetype, no minified file and no globs.

"main": [
    "css/materialdesignicons.css",
    "scss/materialdesignicons.scss",
    "fonts/materialdesignicons-webfont.eot",
    "fonts/materialdesignicons-webfont.svg",
    "fonts/materialdesignicons-webfont.ttf",
    "fonts/materialdesignicons-webfont.woff",
    "fonts/materialdesignicons-webfont.woff2"
]
tagliala commented 9 years ago

AFAIK, in the new bower specifications, if there is a .less or .scss file, you should not include the .css

People needing .css should override their bower.json

Refers to https://github.com/FortAwesome/Font-Awesome/pull/6227 http://blog.getbootstrap.com/2015/06/15/bootstrap-3-3-5-released/#wiredep-and-bower https://github.com/bower/bower.json-spec/issues/47

Hope it helps

stefan-schweiger commented 9 years ago

@tagliala thanks for pointing this out!

I guess many people are using bower with wiredep, so we should probably not break this until the issues are resolved. But still having the min.css in there also messes with wiredep, so this still not belongs in there.

julienpa commented 9 years ago

+1 on improving this. By now, I am relying on Bower's overrides section, with something like that:

"overrides": {
  "mdi": {
    "main": [
      "scss/materialdesignicons.scss"
    ]
  }
}
Templarian commented 8 years ago

This change will be in the next release by the way. Was an oversight it didn't get into the 1.6.50 release.

Templarian commented 8 years ago

https://github.com/Templarian/MaterialDesign-Webfont/blob/master/bower.json

I think v1.7.12 fixed this. Let me know if there are any other changes needed.