tenex / rails-assets

The solution to assets management in Rails
https://rails-assets.org
MIT License
1.63k stars 69 forks source link

depend_on_asset broken on fonts due to namespacing #160

Closed stouset closed 10 years ago

stouset commented 10 years ago

The packages twbs-bootstrap-sass, bootstrap-sass-twbs, and bootstrap-sass-official are broken because they call

//= depend_on_asset "bootstrap/glyphicons-halflings-regular.eot"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.svg"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.ttf"
//= depend_on_asset "bootstrap/glyphicons-halflings-regular.woff"

These end up being namespaced under the #{package_name}/ rather than bootstrap/ or #{package_name}/bootstrap/, and so cannot be found.

sheerun commented 10 years ago

This is not rails assets issue. Those packages use rails initializers to set custom loading paths.

This means those packages are not correctly packaged for bower.

Please open issue on their repositories, they should use ./bootstrap/something instead bootstrap/something in their javascript and scss manifests like this one:

https://github.com/twbs/bootstrap-sass/blob/master/vendor/assets/javascripts/bootstrap.js

sheerun commented 10 years ago

depend_on_asset should also has relative path

stouset commented 10 years ago

Pardon my ignorance, but all of those projects seem to actually point to the https://github.com/twbs/bootstrap-sass/ repo that you recommend as a good example.

sheerun commented 10 years ago

@stouset This component is unusable for consuming in bower.

You can use it as native rails gem though:

gem 'bootstrap-sass', '~> 3.1.1'
stouset commented 10 years ago

Shame. You might want to nuke the several rails-assets gems pointing to it, then.

sheerun commented 10 years ago

It's up to developer which dependencies he includes, so we don't need to nuke anything ;)

Dependencies of packages are not automatically required.

stouset commented 10 years ago

@sheerun I have to imagine that the SCSS sources for Twitter Bootstrap are a pretty popular use-case for rails-assets. What exactly makes the official sources unusable for consuming with bower, and what steps would be necessary to change that?

They do have a bower.json; if it's broken somehow, I'm happy to submit a patch and fix it.

sheerun commented 10 years ago

I already said it in https://github.com/rails-assets/rails-assets/issues/160#issuecomment-45290361 :)

It's theirs issue, not ours.