New JavaScript Engine

I’m trying to build a new JavaScript engine (like coffee-rails, but for purescript), and I’m having an issue with the generators. I cloned coffee-rails to start, and changed the javascript engine generator from :coffee to :purescript, but in test/controller_generator_test.rb I can’t get it to detect --javascript-engine=purescript at all. Is there something special about coffee-rails because it’s part of core? Do I need to do something else to register the generator?

Your purescript-rails gem is going to have to include a Tilt (https://github.com/rtomayko/tilt) template. Sprockets (https://github.com/sstephenson/sprockets) uses Tilt under the hood. You should be able to easily register a new sprockets engine via a Railtie in your gem to tie this all together for the new .purs file type.

  • HTH,

Ken