tenex / rails-assets

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

Missing javascript and stylesheet assets #191

Closed iainbeeston closed 9 years ago

iainbeeston commented 10 years ago

I'm using codemirror via rails assets, but there are a number of assets that are in the bower package which are missing in the rails-assets version.

In the bower package I can see:

AUTHORS                             mode/apl/apl.js                     mode/ruby/ruby.js
CONTRIBUTING.md                     mode/asterisk/asterisk.js           mode/ruby/test.js
LICENSE                             mode/clike/clike.js                 mode/rust/rust.js
README.md                           mode/clike/scala.html               mode/sass/sass.js
addon/comment/comment.js            mode/clojure/clojure.js             mode/scheme/scheme.js
addon/comment/continuecomment.js    mode/cobol/cobol.js                 mode/shell/shell.js
addon/dialog/dialog.css             mode/coffeescript/coffeescript.js   mode/shell/test.js
addon/dialog/dialog.js              mode/commonlisp/commonlisp.js       mode/sieve/sieve.js
addon/display/fullscreen.css        mode/css/css.js                     mode/slim/slim.js
addon/display/fullscreen.js         mode/css/less.html                  mode/slim/test.js
addon/display/placeholder.js        mode/css/less_test.js               mode/smalltalk/smalltalk.js
addon/display/rulers.js             mode/css/scss.html                  mode/smarty/smarty.js
addon/edit/closebrackets.js         mode/css/scss_test.js               mode/smartymixed/smartymixed.js
addon/edit/closetag.js              mode/css/test.js                    mode/solr/solr.js
addon/edit/continuelist.js          mode/cypher/cypher.js               mode/sparql/sparql.js
addon/edit/matchbrackets.js         mode/d/d.js                         mode/sql/sql.js
addon/edit/matchtags.js             mode/diff/diff.js                   mode/stex/stex.js
addon/edit/trailingspace.js         mode/django/django.js               mode/stex/test.js
addon/fold/brace-fold.js            mode/dtd/dtd.js                     mode/tcl/tcl.js
addon/fold/comment-fold.js          mode/dylan/dylan.js                 mode/textile/test.js
addon/fold/foldcode.js              mode/ecl/ecl.js                     mode/textile/textile.js
addon/fold/foldgutter.css           mode/eiffel/eiffel.js               mode/tiddlywiki/tiddlywiki.css
addon/fold/foldgutter.js            mode/erlang/erlang.js               mode/tiddlywiki/tiddlywiki.js
addon/fold/indent-fold.js           mode/fortran/fortran.js             mode/tiki/tiki.css
addon/fold/markdown-fold.js         mode/gas/gas.js                     mode/tiki/tiki.js
addon/fold/xml-fold.js              mode/gfm/gfm.js                     mode/toml/toml.js
addon/hint/anyword-hint.js          mode/gfm/test.js                    mode/tornado/tornado.js
addon/hint/css-hint.js              mode/gherkin/gherkin.js             mode/turtle/turtle.js
addon/hint/html-hint.js             mode/go/go.js                       mode/vb/vb.js
addon/hint/javascript-hint.js       mode/groovy/groovy.js               mode/vbscript/vbscript.js
addon/hint/python-hint.js           mode/haml/haml.js                   mode/velocity/velocity.js
addon/hint/show-hint.css            mode/haml/test.js                   mode/verilog/test.js
addon/hint/show-hint.js             mode/haskell/haskell.js             mode/verilog/verilog.js
addon/hint/sql-hint.js              mode/haxe/haxe.js                   mode/xml/test.js
addon/hint/xml-hint.js              mode/htmlembedded/htmlembedded.js   mode/xml/xml.js
addon/lint/coffeescript-lint.js     mode/htmlmixed/htmlmixed.js         mode/xquery/test.js
addon/lint/css-lint.js              mode/http/http.js                   mode/xquery/xquery.js
addon/lint/javascript-lint.js       mode/jade/jade.js                   mode/yaml/yaml.js
addon/lint/json-lint.js             mode/javascript/javascript.js       mode/z80/z80.js
addon/lint/lint.css                 mode/javascript/json-ld.html        theme/3024-day.css
addon/lint/lint.js                  mode/javascript/test.js             theme/3024-night.css
addon/lint/yaml-lint.js             mode/javascript/typescript.html     theme/ambiance-mobile.css
addon/merge/merge.css               mode/jinja2/jinja2.js               theme/ambiance.css
addon/merge/merge.js                mode/julia/julia.js                 theme/base16-dark.css
addon/mode/loadmode.js              mode/kotlin/kotlin.js               theme/base16-light.css
addon/mode/multiplex.js             mode/livescript/livescript.js       theme/blackboard.css
addon/mode/multiplex_test.js        mode/lua/lua.js                     theme/cobalt.css
addon/mode/overlay.js               mode/markdown/markdown.js           theme/eclipse.css
addon/mode/simple.js                mode/markdown/test.js               theme/elegant.css
addon/runmode/colorize.js           mode/meta.js                        theme/erlang-dark.css
addon/runmode/runmode-standalone.js mode/mirc/mirc.js                   theme/lesser-dark.css
addon/runmode/runmode.js            mode/mllike/mllike.js               theme/mbo.css
addon/runmode/runmode.node.js       mode/modelica/modelica.js           theme/mdn-like.css
addon/scroll/scrollpastend.js       mode/nginx/nginx.js                 theme/midnight.css
addon/search/match-highlighter.js   mode/ntriples/ntriples.js           theme/monokai.css
addon/search/search.js              mode/octave/octave.js               theme/neat.css
addon/search/searchcursor.js        mode/pascal/pascal.js               theme/neo.css
addon/selection/active-line.js      mode/pegjs/pegjs.js                 theme/night.css
addon/selection/mark-selection.js   mode/perl/perl.js                   theme/paraiso-dark.css
addon/tern/tern.css                 mode/php/php.js                     theme/paraiso-light.css
addon/tern/tern.js                  mode/php/test.js                    theme/pastel-on-dark.css
addon/tern/worker.js                mode/pig/pig.js                     theme/rubyblue.css
addon/wrap/hardwrap.js              mode/properties/properties.js       theme/solarized.css
bower.json                          mode/puppet/puppet.js               theme/the-matrix.css
keymap/emacs.js                     mode/python/python.js               theme/tomorrow-night-eighties.css
keymap/sublime.js                   mode/q/q.js                         theme/twilight.css
keymap/vim.js                       mode/r/r.js                         theme/vibrant-ink.css
lib/codemirror.css                  mode/rpm/rpm.js                     theme/xq-dark.css
lib/codemirror.js                   mode/rst/rst.js                     theme/xq-light.css

But in rails assets there is only:

javascripts/codemirror.js                            templates/codemirror/mode/css/less.html
javascripts/codemirror/codemirror.js                 templates/codemirror/mode/css/scss.html
stylesheets/codemirror.scss                          templates/codemirror/mode/javascript/json-ld.html
stylesheets/codemirror/codemirror.scss               templates/codemirror/mode/javascript/typescript.html
templates/codemirror/mode/clike/scala.html

Looks like everything in /mode, /addon and /theme has been missed.

I'm not sure exactly why that is, and I appreciate that codemirror has an unusual directory structure, but is there anything I can do (on the codemirror side perhaps) to help these extra assets get picked up by rails assets?

sheerun commented 10 years ago

It's tough one. I don't think codemirror can do anything on their side except moving their distribution to single directory. Currently we skip all assets that are outside directory we recognize as main one (in case of codemirror it's lib, because main assets are "lib/codemirror.js", "lib/codemirror.css").

I thought about including for each .gem original, not touched files in location like ./vendor instead app/assets/..., and exclude it from default load path, so you could do it manually:

config.assets.paths << RailsAssetsCodeMirror.source_load_path

But this idea needs more discussion.

sheerun commented 10 years ago

For now the only solution for you is to paste templates manually in repo..

bryanlarsen commented 9 years ago

In our current project, 3/13 packages had this problem: font-awesome, pickadate, typeahead.js.

sheerun commented 9 years ago

Due to time constraints and backward-compatibility reasons we won't implement it. Sorry!