ember-es6_template 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/build.yml +51 -0
- data/ember-es6_template.gemspec +3 -3
- data/lib/ember/es6_template.rb +3 -4
- data/lib/ember/es6_template/{sprockets2.rb → sprockets-legacy.rb} +4 -4
- data/lib/ember/es6_template/sprockets-legacy/coffee_script.rb +24 -0
- data/lib/ember/es6_template/{sprockets2 → sprockets-legacy}/es6.rb +1 -1
- data/lib/ember/es6_template/{sprockets2 → sprockets-legacy}/es6module.rb +0 -0
- data/lib/ember/es6_template/{sprockets3.rb → sprockets.rb} +6 -7
- data/lib/ember/es6_template/{sprockets3 → sprockets}/coffee_script.rb +2 -0
- data/lib/ember/es6_template/sprockets/coffee_script_helper.rb +41 -0
- data/lib/ember/es6_template/{sprockets3 → sprockets}/coffee_script_module.rb +2 -0
- data/lib/ember/es6_template/{sprockets3 → sprockets}/es6.rb +0 -0
- data/lib/ember/es6_template/{sprockets3 → sprockets}/es6module.rb +0 -0
- data/lib/ember/es6_template/version.rb +1 -1
- metadata +26 -21
- data/.travis.yml +0 -21
- data/lib/ember/es6_template/sprockets2/coffee_script.rb +0 -21
- data/lib/ember/es6_template/sprockets3/coffee_script_helper.rb +0 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: cdec05ac2b5388e5cb8e0b436f3c193b5f5c958f59b64fc32604979e12c7c048
|
4
|
+
data.tar.gz: e7ce8d042b5de55a6a6dbad0510eb72e915118f7108708a81ca34ce3aa239641
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6f53d784ba5da3d31eab09ffc82de35b184366788826653a94d08961149ca3a1d7877e1440e43300cf930ba8e5fc6b053133781e6579dfaa7bd8f5e6cfcdec1
|
7
|
+
data.tar.gz: e4d5a1e8d781ced0df0d58fefa9907621dd3154dab76c11e3f3b54bf3864a6deb950bfb208eec332fbe23f8a3678da04d261ba8013c09d81fd31db938aa68efa
|
@@ -0,0 +1,51 @@
|
|
1
|
+
name: Build
|
2
|
+
|
3
|
+
on: [push, pull_request]
|
4
|
+
|
5
|
+
jobs:
|
6
|
+
build:
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
strategy:
|
10
|
+
matrix:
|
11
|
+
ruby-version:
|
12
|
+
- 2.5.8
|
13
|
+
- 2.6.6
|
14
|
+
- 2.7.1
|
15
|
+
sprockets-version:
|
16
|
+
- "~> 2.2.0"
|
17
|
+
- "~> 2.12.0"
|
18
|
+
- "~> 3.0.0"
|
19
|
+
- "~> 3.1.0"
|
20
|
+
- "~> 3.2.0"
|
21
|
+
- "~> 3.3.0"
|
22
|
+
- "~> 3.4.0"
|
23
|
+
- "~> 3.5.0"
|
24
|
+
- "~> 3.6.0"
|
25
|
+
- "~> 3.7.0"
|
26
|
+
- "~> 4.0.0"
|
27
|
+
|
28
|
+
container:
|
29
|
+
image: ruby:${{ matrix.ruby-version }}
|
30
|
+
|
31
|
+
steps:
|
32
|
+
- uses: actions/checkout@v2
|
33
|
+
- name: Setup Node.js
|
34
|
+
uses: actions/setup-node@v1
|
35
|
+
- uses: actions/cache@v2
|
36
|
+
with:
|
37
|
+
path: vendor/bundle
|
38
|
+
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
39
|
+
restore-keys: |
|
40
|
+
${{ runner.os }}-gems-
|
41
|
+
- name: Install dependencies
|
42
|
+
run: |
|
43
|
+
gem update --system
|
44
|
+
gem install bundler
|
45
|
+
bundle config set path vendor/bundle
|
46
|
+
bundle install --jobs 4 --retry 3
|
47
|
+
env:
|
48
|
+
SPROCKETS_VERSION: ${{ matrix.sprockets-version }}
|
49
|
+
- name: Run tests
|
50
|
+
run: |
|
51
|
+
bundle exec rake test
|
data/ember-es6_template.gemspec
CHANGED
@@ -19,10 +19,10 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
21
|
spec.add_dependency 'babel-transpiler', '>= 0.6.0', '< 0.8'
|
22
|
-
spec.add_dependency 'sprockets', '>= 2.2', '< 4'
|
22
|
+
spec.add_dependency 'sprockets', '>= 2.2', '< 4.1'
|
23
23
|
|
24
|
-
spec.add_development_dependency 'bundler', '
|
25
|
-
spec.add_development_dependency 'rake', '~>
|
24
|
+
spec.add_development_dependency 'bundler', '>= 1.7', '< 3'
|
25
|
+
spec.add_development_dependency 'rake', '~> 12'
|
26
26
|
spec.add_development_dependency 'minitest', '~> 5.0'
|
27
27
|
spec.add_development_dependency 'minitest-power_assert'
|
28
28
|
spec.add_development_dependency 'coffee-script', '~> 2.3'
|
data/lib/ember/es6_template.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'ember/es6_template/version'
|
2
|
+
require 'ember/es6_template/config'
|
2
3
|
|
3
4
|
require 'sprockets'
|
4
5
|
require 'babel/transpiler'
|
@@ -7,15 +8,13 @@ module Ember
|
|
7
8
|
module ES6Template
|
8
9
|
case Sprockets::VERSION
|
9
10
|
when /^2\./
|
10
|
-
require 'ember/es6_template/
|
11
|
+
require 'ember/es6_template/sprockets-legacy'
|
11
12
|
when /^[34]\./
|
12
|
-
require 'ember/es6_template/
|
13
|
+
require 'ember/es6_template/sprockets'
|
13
14
|
else
|
14
15
|
raise "Unsupported sprockets version: #{Sprockets::VERSION}"
|
15
16
|
end
|
16
17
|
|
17
|
-
autoload :Config, 'ember/es6_template/config'
|
18
|
-
|
19
18
|
def self.configure
|
20
19
|
yield config if block_given?
|
21
20
|
end
|
@@ -4,12 +4,12 @@ rescue LoadError => e
|
|
4
4
|
raise e unless ['cannot load such file -- coffee_script', 'no such file to load -- coffee_script'].include?(e.message)
|
5
5
|
end
|
6
6
|
|
7
|
+
require 'ember/es6_template/sprockets-legacy/es6'
|
8
|
+
require 'ember/es6_template/sprockets-legacy/es6module'
|
9
|
+
require 'ember/es6_template/sprockets-legacy/coffee_script'
|
10
|
+
|
7
11
|
module Ember
|
8
12
|
module ES6Template
|
9
|
-
autoload :ES6, 'ember/es6_template/sprockets2/es6'
|
10
|
-
autoload :ES6Module, 'ember/es6_template/sprockets2/es6module'
|
11
|
-
autoload :CoffeeScript, 'ember/es6_template/sprockets2/coffee_script'
|
12
|
-
|
13
13
|
def self.setup(env)
|
14
14
|
env.register_engine '.es6', ES6
|
15
15
|
env.register_engine '.module', ES6Module
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Ember
|
2
|
+
module ES6Template
|
3
|
+
class CoffeeScript < Tilt::CoffeeScriptTemplate
|
4
|
+
self.default_mime_type = 'application/javascript'
|
5
|
+
|
6
|
+
def evaluate(scope, locals, &block)
|
7
|
+
filename = scope.pathname.to_s
|
8
|
+
|
9
|
+
@output ||=
|
10
|
+
if es6?(filename)
|
11
|
+
::CoffeeScript.compile(data, options.merge(bare: true))
|
12
|
+
else
|
13
|
+
::CoffeeScript.compile(data, options)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
|
19
|
+
def es6?(filename)
|
20
|
+
File.basename(filename) =~ /\.(?:module|es6)\.coffee/
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
@@ -1,16 +1,15 @@
|
|
1
|
+
require 'ember/es6_template/sprockets/es6'
|
2
|
+
require 'ember/es6_template/sprockets/es6module'
|
3
|
+
require 'ember/es6_template/sprockets/coffee_script'
|
4
|
+
require 'ember/es6_template/sprockets/coffee_script_module'
|
5
|
+
|
1
6
|
module Ember
|
2
7
|
module ES6Template
|
3
|
-
autoload :ES6, 'ember/es6_template/sprockets3/es6'
|
4
|
-
autoload :ES6Module, 'ember/es6_template/sprockets3/es6module'
|
5
|
-
autoload :CoffeeScript, 'ember/es6_template/sprockets3/coffee_script'
|
6
|
-
autoload :CoffeeScriptModule, 'ember/es6_template/sprockets3/coffee_script_module'
|
7
|
-
autoload :CoffeeScriptHelper, 'ember/es6_template/sprockets3/coffee_script_helper'
|
8
|
-
|
9
8
|
def self.setup(env)
|
10
9
|
env.register_mime_type 'application/ecmascript-6', extensions: %w(.es6)
|
11
10
|
env.register_mime_type 'application/ecmascript-6+module', extensions: %w(.module.es6)
|
12
11
|
env.register_mime_type 'text/coffeescript', extensions: %w(.es6.coffee .coffee)
|
13
|
-
env.register_mime_type 'text/coffeescript+module', extensions: %w(.es6.
|
12
|
+
env.register_mime_type 'text/coffeescript+module', extensions: %w(.module.es6.coffee .module.coffee)
|
14
13
|
|
15
14
|
env.register_transformer 'application/ecmascript-6', 'application/javascript', ES6
|
16
15
|
env.register_transformer 'application/ecmascript-6+module', 'application/javascript', ES6Module
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Ember
|
2
|
+
module ES6Template
|
3
|
+
module CoffeeScriptHelper
|
4
|
+
def call(input)
|
5
|
+
data = input[:data]
|
6
|
+
filename = input[:filename]
|
7
|
+
|
8
|
+
result = input[:cache].fetch(_cache_key + [filename, data]) do
|
9
|
+
if es6?(filename)
|
10
|
+
transform(
|
11
|
+
Sprockets::Autoload::CoffeeScript.compile(data, bare: true),
|
12
|
+
input
|
13
|
+
)
|
14
|
+
else
|
15
|
+
code = Sprockets::Autoload::CoffeeScript.compile(data, bare: false)
|
16
|
+
|
17
|
+
{'code' => code}
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
result['code']
|
22
|
+
end
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
def _cache_key
|
27
|
+
[
|
28
|
+
self.class.name,
|
29
|
+
VERSION,
|
30
|
+
Babel::Transpiler.version,
|
31
|
+
Babel::Transpiler.source_version,
|
32
|
+
Sprockets::Autoload::CoffeeScript.version
|
33
|
+
]
|
34
|
+
end
|
35
|
+
|
36
|
+
def es6?(filename)
|
37
|
+
File.basename(filename) =~ /\.(?:es6|module)\./
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
File without changes
|
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ember-es6_template
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryunosuke SATO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-08-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: babel-transpiler
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
version: '2.2'
|
40
40
|
- - "<"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '4'
|
42
|
+
version: '4.1'
|
43
43
|
type: :runtime
|
44
44
|
prerelease: false
|
45
45
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -49,35 +49,41 @@ dependencies:
|
|
49
49
|
version: '2.2'
|
50
50
|
- - "<"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '4'
|
52
|
+
version: '4.1'
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
54
|
name: bundler
|
55
55
|
requirement: !ruby/object:Gem::Requirement
|
56
56
|
requirements:
|
57
|
-
- - "
|
57
|
+
- - ">="
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '1.7'
|
60
|
+
- - "<"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '3'
|
60
63
|
type: :development
|
61
64
|
prerelease: false
|
62
65
|
version_requirements: !ruby/object:Gem::Requirement
|
63
66
|
requirements:
|
64
|
-
- - "
|
67
|
+
- - ">="
|
65
68
|
- !ruby/object:Gem::Version
|
66
69
|
version: '1.7'
|
70
|
+
- - "<"
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '3'
|
67
73
|
- !ruby/object:Gem::Dependency
|
68
74
|
name: rake
|
69
75
|
requirement: !ruby/object:Gem::Requirement
|
70
76
|
requirements:
|
71
77
|
- - "~>"
|
72
78
|
- !ruby/object:Gem::Version
|
73
|
-
version: '
|
79
|
+
version: '12'
|
74
80
|
type: :development
|
75
81
|
prerelease: false
|
76
82
|
version_requirements: !ruby/object:Gem::Requirement
|
77
83
|
requirements:
|
78
84
|
- - "~>"
|
79
85
|
- !ruby/object:Gem::Version
|
80
|
-
version: '
|
86
|
+
version: '12'
|
81
87
|
- !ruby/object:Gem::Dependency
|
82
88
|
name: minitest
|
83
89
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,8 +133,8 @@ executables: []
|
|
127
133
|
extensions: []
|
128
134
|
extra_rdoc_files: []
|
129
135
|
files:
|
136
|
+
- ".github/workflows/build.yml"
|
130
137
|
- ".gitignore"
|
131
|
-
- ".travis.yml"
|
132
138
|
- Gemfile
|
133
139
|
- LICENSE.txt
|
134
140
|
- README.md
|
@@ -138,16 +144,16 @@ files:
|
|
138
144
|
- ember-es6_template.gemspec
|
139
145
|
- lib/ember/es6_template.rb
|
140
146
|
- lib/ember/es6_template/config.rb
|
141
|
-
- lib/ember/es6_template/
|
142
|
-
- lib/ember/es6_template/
|
143
|
-
- lib/ember/es6_template/
|
144
|
-
- lib/ember/es6_template/
|
145
|
-
- lib/ember/es6_template/
|
146
|
-
- lib/ember/es6_template/
|
147
|
-
- lib/ember/es6_template/
|
148
|
-
- lib/ember/es6_template/
|
149
|
-
- lib/ember/es6_template/
|
150
|
-
- lib/ember/es6_template/
|
147
|
+
- lib/ember/es6_template/sprockets-legacy.rb
|
148
|
+
- lib/ember/es6_template/sprockets-legacy/coffee_script.rb
|
149
|
+
- lib/ember/es6_template/sprockets-legacy/es6.rb
|
150
|
+
- lib/ember/es6_template/sprockets-legacy/es6module.rb
|
151
|
+
- lib/ember/es6_template/sprockets.rb
|
152
|
+
- lib/ember/es6_template/sprockets/coffee_script.rb
|
153
|
+
- lib/ember/es6_template/sprockets/coffee_script_helper.rb
|
154
|
+
- lib/ember/es6_template/sprockets/coffee_script_module.rb
|
155
|
+
- lib/ember/es6_template/sprockets/es6.rb
|
156
|
+
- lib/ember/es6_template/sprockets/es6module.rb
|
151
157
|
- lib/ember/es6_template/version.rb
|
152
158
|
homepage: https://github.com/tricknotes/ember-es6_template
|
153
159
|
licenses:
|
@@ -168,8 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
168
174
|
- !ruby/object:Gem::Version
|
169
175
|
version: '0'
|
170
176
|
requirements: []
|
171
|
-
|
172
|
-
rubygems_version: 2.5.1
|
177
|
+
rubygems_version: 3.0.3
|
173
178
|
signing_key:
|
174
179
|
specification_version: 4
|
175
180
|
summary: The tilt template for Ember specified ES6.
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
cache: bundler
|
3
|
-
sudo: false
|
4
|
-
|
5
|
-
rvm:
|
6
|
-
- 2.0.0
|
7
|
-
- 2.1
|
8
|
-
- 2.2.4
|
9
|
-
- 2.3.0
|
10
|
-
|
11
|
-
env:
|
12
|
-
matrix:
|
13
|
-
- SPROCKETS_VERSION="~> 2.2.0"
|
14
|
-
- SPROCKETS_VERSION="~> 2.12.0"
|
15
|
-
- SPROCKETS_VERSION="~> 3.0.0"
|
16
|
-
- SPROCKETS_VERSION="~> 3.1.0"
|
17
|
-
- SPROCKETS_VERSION="~> 3.2.0"
|
18
|
-
- SPROCKETS_VERSION="~> 3.3.0"
|
19
|
-
- SPROCKETS_VERSION="~> 3.4.0"
|
20
|
-
- SPROCKETS_VERSION="~> 3.5.0"
|
21
|
-
- SPROCKETS_VERSION="~> 4.0.0.beta1"
|
@@ -1,21 +0,0 @@
|
|
1
|
-
module Ember
|
2
|
-
module ES6Template
|
3
|
-
class CoffeeScript < Tilt::CoffeeScriptTemplate
|
4
|
-
def evaluate(scope, locals, &block)
|
5
|
-
filename = scope.pathname.to_s
|
6
|
-
|
7
|
-
if es6?(filename)
|
8
|
-
::CoffeeScript.compile(data, bare: true)
|
9
|
-
else
|
10
|
-
super
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def es6?(filename)
|
17
|
-
filename =~ /\.(?:module|es6)\.coffee/
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
@@ -1,30 +0,0 @@
|
|
1
|
-
module Ember
|
2
|
-
module ES6Template
|
3
|
-
module CoffeeScriptHelper
|
4
|
-
def call(input)
|
5
|
-
data = input[:data]
|
6
|
-
|
7
|
-
result = input[:cache].fetch(_cache_key + [data]) do
|
8
|
-
transform(
|
9
|
-
Sprockets::Autoload::CoffeeScript.compile(data, bare: true),
|
10
|
-
input
|
11
|
-
)
|
12
|
-
end
|
13
|
-
|
14
|
-
result['code']
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
|
-
def _cache_key
|
20
|
-
[
|
21
|
-
self.class.name,
|
22
|
-
VERSION,
|
23
|
-
Babel::Transpiler.version,
|
24
|
-
Babel::Transpiler.source_version,
|
25
|
-
Sprockets::Autoload::CoffeeScript.version
|
26
|
-
]
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|