sprockets-coffee-jsx 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +9 -9
- data/Rakefile +1 -1
- data/lib/sprockets-coffee-jsx.rb +3 -0
- data/lib/sprockets/{coffee-react-postprocessor.rb → coffee-jsx-postprocessor.rb} +1 -1
- data/lib/sprockets/{coffee-react-script.rb → coffee-jsx-script.rb} +2 -2
- data/lib/sprockets/{coffee-react.rb → coffee-jsx.rb} +4 -4
- data/lib/sprockets/{coffee-react → coffee-jsx}/engine.rb +9 -8
- data/lib/tasks/{sprockets-coffee-react_tasks.rake → sprockets-coffee-jsx_tasks.rake} +1 -1
- metadata +11 -11
- data/lib/sprockets-coffee-react.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed2595e7784f1f1c1041ae56b14a1e830127680a
|
4
|
+
data.tar.gz: f62bd4db2a5431cd70b8e283159a1b46498a0a15
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc488e10b5ecb51a8d24e4875d72dbe5a6cca345e3ae9cd35d09a1ecd9a9adddefcada7a5b917be5638c6ee788108e0cf0bcb1103aa80e47343886853f2d2fa
|
7
|
+
data.tar.gz: 9bbf8b5d0b100d1e96224b645a97c20a61236a5228e80f4a2dcc2fbaaed055208de90216bd6b538b9a644a7e2e7abce586bd2b708236b3262093b1f008c664d3
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Preprocessor for Coffeescript with React JSX (CJSX) support.
|
4
4
|
|
5
|
-
This is an updated version of [sprockets-coffee-
|
5
|
+
This is an updated version of [sprockets-coffee-jsx](https://github.com/jsdf/sprockets-coffee-jsx) gem.
|
6
6
|
|
7
7
|
This gem makes it easy to integrate this into the Rails asset pipeline or other Sprockets chains.
|
8
8
|
|
@@ -24,15 +24,15 @@ the sprockets-coffee-jsx engine:
|
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
require 'sprockets'
|
27
|
-
require 'sprockets/coffee-
|
27
|
+
require 'sprockets/coffee-jsx'
|
28
28
|
map '/assets' do
|
29
29
|
environment = Sprockets::Environment.new
|
30
30
|
environment.append_path 'app/assets/javascripts'
|
31
31
|
environment.append_path 'app/assets/stylesheets'
|
32
32
|
environment.register_mime_type 'text/cjsx', extensions: ['.cjsx', '.js.cjsx', '.js.coffee.cjsx'], charset: :unicode
|
33
|
-
environment.register_transformer 'text/cjsx', 'application/javascript', Sprockets::
|
34
|
-
environment.register_preprocessor 'application/javascript', Sprockets::
|
35
|
-
environment.register_postprocessor 'application/javascript', Sprockets::
|
33
|
+
environment.register_transformer 'text/cjsx', 'application/javascript', Sprockets::CoffeeJsxScript
|
34
|
+
environment.register_preprocessor 'application/javascript', Sprockets::CoffeeJsx
|
35
|
+
environment.register_postprocessor 'application/javascript', Sprockets::CoffeeJsxPostprocessor
|
36
36
|
run environment
|
37
37
|
end
|
38
38
|
|
@@ -46,11 +46,11 @@ end
|
|
46
46
|
Add the following to your config.rb file:
|
47
47
|
|
48
48
|
```ruby
|
49
|
-
require 'sprockets/coffee-
|
49
|
+
require 'sprockets/coffee-jsx'
|
50
50
|
::Sprockets.register_mime_type 'text/cjsx', extensions: ['.cjsx', '.js.cjsx', '.js.coffee.cjsx'], charset: :unicode
|
51
|
-
::Sprockets.register_transformer 'text/cjsx', 'application/javascript', Sprockets::
|
52
|
-
::Sprockets.register_preprocessor 'application/javascript', Sprockets::
|
53
|
-
::Sprockets.register_postprocessor 'application/javascript', Sprockets::
|
51
|
+
::Sprockets.register_transformer 'text/cjsx', 'application/javascript', Sprockets::CoffeeJsxScript
|
52
|
+
::Sprockets.register_preprocessor 'application/javascript', Sprockets::CoffeeJsx
|
53
|
+
::Sprockets.register_postprocessor 'application/javascript', Sprockets::CoffeeJsxPostprocessor
|
54
54
|
```
|
55
55
|
|
56
56
|
# License
|
data/Rakefile
CHANGED
@@ -14,7 +14,7 @@ end
|
|
14
14
|
|
15
15
|
RDoc::Task.new(:rdoc) do |rdoc|
|
16
16
|
rdoc.rdoc_dir = 'rdoc'
|
17
|
-
rdoc.title = '
|
17
|
+
rdoc.title = 'SprocketsCoffeeJsx'
|
18
18
|
rdoc.options << '--line-numbers'
|
19
19
|
rdoc.rdoc_files.include('README.rdoc')
|
20
20
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
@@ -4,9 +4,9 @@ require 'coffee-react'
|
|
4
4
|
require 'coffee_script'
|
5
5
|
|
6
6
|
module Sprockets
|
7
|
-
# Preprocessor that runs CJSX source files through coffee-
|
7
|
+
# Preprocessor that runs CJSX source files through coffee-jsx-transform
|
8
8
|
# then compiles with coffee-script
|
9
|
-
class
|
9
|
+
class CoffeeJsxScript < Tilt::Template
|
10
10
|
COFFEE_CJSX_EXTENSION = /\.coffee\.cjsx/
|
11
11
|
CJSX_EXTENSION = /\.cjsx[^\/]*?$/
|
12
12
|
CJSX_PRAGMA = /^\s*#[ \t]*@cjsx/i
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require 'sprockets'
|
2
2
|
require 'tilt'
|
3
3
|
require 'coffee-react'
|
4
|
-
require 'sprockets/coffee-
|
4
|
+
require 'sprockets/coffee-jsx-postprocessor'
|
5
5
|
|
6
6
|
module Sprockets
|
7
|
-
# Preprocessor that runs CJSX source files through coffee-
|
8
|
-
class
|
7
|
+
# Preprocessor that runs CJSX source files through coffee-jsx-transform
|
8
|
+
class CoffeeJsx < Tilt::Template
|
9
9
|
CJSX_EXTENSION = /\.(:?cjsx|coffee)[^\/]*?$/
|
10
10
|
CJSX_PRAGMA = /^\s*#[ \t]*@cjsx/i
|
11
11
|
|
@@ -31,7 +31,7 @@ module Sprockets
|
|
31
31
|
end
|
32
32
|
|
33
33
|
def self.install(environment = ::Sprockets)
|
34
|
-
Sprockets::
|
34
|
+
Sprockets::CoffeeJsx::Engine.install(environment)
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require 'sprockets'
|
2
|
-
require 'sprockets/coffee-
|
3
|
-
require 'sprockets/coffee-
|
2
|
+
require 'sprockets/coffee-jsx'
|
3
|
+
require 'sprockets/coffee-jsx-postprocessor'
|
4
4
|
|
5
5
|
if defined?(Rails)
|
6
6
|
module Sprockets
|
7
|
-
class
|
7
|
+
class CoffeeJsx
|
8
8
|
class Engine < ::Rails::Engine
|
9
9
|
initializer :setup_coffee_react, :after => "sprockets.environment", :group => :all do |app|
|
10
10
|
if app.assets
|
@@ -17,13 +17,14 @@ if defined?(Rails)
|
|
17
17
|
def self.install(environment)
|
18
18
|
if environment.respond_to?(:register_transformer)
|
19
19
|
environment.register_mime_type 'text/cjsx', extensions: ['.cjsx', '.js.cjsx', '.js.coffee.cjsx'], charset: :unicode
|
20
|
-
environment.register_transformer 'text/cjsx', 'application/javascript', Sprockets::
|
20
|
+
environment.register_transformer 'text/cjsx', 'application/javascript', Sprockets::CoffeeJsxScript
|
21
21
|
else
|
22
|
-
environment.register_engine '.cjsx', Sprockets::
|
23
|
-
environment.register_engine '.js.cjsx', Sprockets::
|
22
|
+
environment.register_engine '.cjsx', Sprockets::CoffeeJsxScript
|
23
|
+
environment.register_engine '.js.cjsx', Sprockets::CoffeeJsxScript
|
24
|
+
environment.register_engine '.js.coffee.cjsx', Sprockets::CoffeeJsxScript
|
24
25
|
end
|
25
|
-
environment.register_preprocessor 'application/javascript', Sprockets::
|
26
|
-
environment.register_postprocessor 'application/javascript', Sprockets::
|
26
|
+
environment.register_preprocessor 'application/javascript', Sprockets::CoffeeJsx
|
27
|
+
environment.register_postprocessor 'application/javascript', Sprockets::CoffeeJsxPostprocessor
|
27
28
|
end
|
28
29
|
end
|
29
30
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-coffee-jsx
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Rael Gugelmin Cunha
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: coffee-react
|
@@ -69,8 +69,8 @@ dependencies:
|
|
69
69
|
description: |2
|
70
70
|
Preprocessor for Coffeescript with React JSX (CJSX).
|
71
71
|
This gem makes it easy to integrate this into the Rails asset pipeline or other Sprockets chains.
|
72
|
-
If you want to use CJSX without Sprockets, see the coffee-
|
73
|
-
This is an update version of sprockets-coffee-
|
72
|
+
If you want to use CJSX without Sprockets, see the coffee-jsx gem, or the coffee-jsx npm module.
|
73
|
+
This is an update version of sprockets-coffee-jsx gem.
|
74
74
|
email: rael.gc@gmail.com
|
75
75
|
executables: []
|
76
76
|
extensions: []
|
@@ -79,12 +79,12 @@ files:
|
|
79
79
|
- LICENSE
|
80
80
|
- README.md
|
81
81
|
- Rakefile
|
82
|
-
- lib/sprockets-coffee-
|
83
|
-
- lib/sprockets/coffee-
|
84
|
-
- lib/sprockets/coffee-
|
85
|
-
- lib/sprockets/coffee-
|
86
|
-
- lib/sprockets/coffee-
|
87
|
-
- lib/tasks/sprockets-coffee-
|
82
|
+
- lib/sprockets-coffee-jsx.rb
|
83
|
+
- lib/sprockets/coffee-jsx-postprocessor.rb
|
84
|
+
- lib/sprockets/coffee-jsx-script.rb
|
85
|
+
- lib/sprockets/coffee-jsx.rb
|
86
|
+
- lib/sprockets/coffee-jsx/engine.rb
|
87
|
+
- lib/tasks/sprockets-coffee-jsx_tasks.rake
|
88
88
|
homepage: https://github.com/raelgc/sprockets-coffee-jsx
|
89
89
|
licenses:
|
90
90
|
- MIT
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.5.1
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: Coffeescript with React JSX (CJSX) via Sprockets
|