/typescript-rails

An asset pipeline wrapper for the TypeScript language

Primary LanguageRubyMIT LicenseMIT

TypeScript for Rails

Highly modified from the original [typescript-rails] to get it compiling Angular2 using an external node.

Requirements

The current version requires that node.js is installed on the system.

Installation

Add this line to your application's Gemfile:

gem 'typescript-rails'

And then execute:

$ bundle

Usage

Just add a .ts file in your app/assets/typescripts directory and include it just like you are used to do.

Configurations:

# Its defaults are `--target ES5 --module system --moduleResolution node --sourceMap --experimentalDecorators --emitDecoratorMetadata`.

Typescript::Rails::Compiler.default_options = [ ... ]

Referenced TypeScript dependencies

typescript-rails recurses through all TypeScript-style referenced files and tells its Sprockets::Context that the TS file being processed depends_on each file listed as a reference. This activates Sprocket’s cache-invalidation behavior when any of the descendant references of the root TS file is changed.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Maintainers

Daniel Gaiottino daniel@burtcorp.com

Authors

Daniel Gaiottino daniel@burtcorp.com