middleman-typescript 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e9e0fef9355e45c8e1022e30805a7d82f308ed49
4
- data.tar.gz: 8bc4356e30cdae8bb9a898b859ce8996777c9b8c
3
+ metadata.gz: 555c6f88f19d571721387a73c4ba28bd98eba1e7
4
+ data.tar.gz: b32b3776a1749b89cc04ea13342455891a57eaa6
5
5
  SHA512:
6
- metadata.gz: 886da94f729233e17be13a406b4ef916c7b3bba173e24997cbd2a19987df1e8311623f5b8e7ff75320619d23a4805457adb3a5d7cfb4dc832db7c4c45786ab12
7
- data.tar.gz: 9fe3b0830a5b74e309388015ccb409032ca85134663a04c048847e947f6ed111b794eb1558a577997b643a2d38d7505550ff0375046b61bd854a21aa147587a7
6
+ metadata.gz: 7303b0082ca5cd38157669effa6222c20d113e13792fe0f60e92f977484052737b6852606f7229ded0585dbbb98bb7ddfb13986633a927057d34ad81ee4c2a32
7
+ data.tar.gz: 5713f04b0b098553f6dfd4eea745e1e8ce1598a9f6460b5a43c52f7377a27f54d28deb86ce24cce81aeafbfa7e40b9372c61524bfd4cd2416394b079ab018c9b
@@ -4,17 +4,23 @@ require 'pry'
4
4
  module Middleman
5
5
  class TypescriptExtension < Extension
6
6
  option :typescript_dir, 'typescripts', 'Set TypeScript dir.'
7
+ option :target, 'ES5', 'Target version.(Default ES5)'
8
+ option :no_implicit_any, true, 'Use --noImplicitAny option.(Default true)'
7
9
  def initialize(app, options_hash={}, &block)
8
10
  super
9
- app.set :typescript_dir, options.typescript_dir
10
11
  return unless app.environment == :development
11
12
 
13
+ app.set :typescript_dir, options.typescript_dir
14
+ compile_options = ['--target', options.target]
15
+ compile_options << '--noImplicitAny' if options.no_implicit_any
16
+ app.set :typescript_compile_options, compile_options
17
+
12
18
  app.ready do
13
19
  files.changed do |file|
14
20
  next if File.extname(file) != '.ts'
15
21
 
16
22
  file_path = "#{Dir.pwd}/#{file}"
17
- result = TypeScript::Node.compile_file(file_path, '--target', 'ES5')
23
+ result = TypeScript::Node.compile_file(file_path, *app.typescript_compile_options)
18
24
  if result.success?
19
25
  file_name = File.basename(file_path).gsub(/\.ts/, '.js')
20
26
  export_dir = source_dir + File.dirname(file_path).sub(source_dir, '').sub(app.typescript_dir, app.js_dir)
@@ -1,5 +1,5 @@
1
1
  module Middleman
2
2
  module Typescript
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: middleman-typescript
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toyoaki Oko