babel-schmooze-sprockets 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/console +14 -0
- data/bin/export-external-helpers +3 -0
- data/bin/setup +6 -0
- data/bin/update-npm-deps +8 -0
- data/examples/myapp/Gemfile +4 -5
- data/examples/myapp/Gemfile.lock +69 -93
- data/examples/myapp/app/assets/javascripts/code/hello.es6 +5 -1
- data/examples/myapp/app/views/layouts/application.html.erb +1 -0
- data/examples/myapp/app/views/site/home.html.erb +0 -1
- data/lib/babel-schmooze-sprockets/babel_processor.rb +6 -4
- data/lib/babel-schmooze-sprockets/engine.rb +1 -4
- data/lib/babel-schmooze-sprockets/version.rb +1 -1
- data/node_modules/amdefine/package.json +8 -1
- data/node_modules/babel-core/node_modules/babel-runtime/package.json +9 -5
- data/node_modules/babel-core/node_modules/babel-traverse/.npmignore +3 -0
- data/node_modules/babel-core/node_modules/babel-traverse/README.md +1 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/cache.js +20 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/context.js +219 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/hub.js +19 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/index.js +250 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/ancestry.js +317 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/comments.js +55 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js +297 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/conversion.js +48 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/evaluation.js +406 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/family.js +168 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/index.js +245 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/inference/index.js +151 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/inference/inferer-reference.js +225 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/inference/inferers.js +198 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/introspection.js +518 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/lib/hoister.js +166 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/lib/removal-hooks.js +64 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/lib/virtual-types.js +141 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/modification.js +293 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/removal.js +72 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/path/replacement.js +302 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/scope/binding.js +105 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js +1222 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/scope/lib/renamer.js +154 -0
- data/node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js +360 -0
- data/node_modules/babel-core/node_modules/babel-traverse/package.json +107 -0
- data/node_modules/babel-core/node_modules/core-js/package.json +20 -2
- data/node_modules/babel-core/package.json +31 -24
- data/node_modules/babel-generator/lib/buffer.js +69 -70
- data/node_modules/babel-generator/lib/generators/base.js +16 -12
- data/node_modules/babel-generator/lib/generators/classes.js +28 -19
- data/node_modules/babel-generator/lib/generators/expressions.js +76 -99
- data/node_modules/babel-generator/lib/generators/flow.js +178 -119
- data/node_modules/babel-generator/lib/generators/jsx.js +38 -29
- data/node_modules/babel-generator/lib/generators/methods.js +34 -25
- data/node_modules/babel-generator/lib/generators/modules.js +67 -40
- data/node_modules/babel-generator/lib/generators/statements.js +93 -76
- data/node_modules/babel-generator/lib/generators/template-literals.js +12 -11
- data/node_modules/babel-generator/lib/generators/types.js +56 -49
- data/node_modules/babel-generator/lib/index.js +52 -39
- data/node_modules/babel-generator/lib/node/index.js +12 -18
- data/node_modules/babel-generator/lib/node/parentheses.js +23 -27
- data/node_modules/babel-generator/lib/node/whitespace.js +20 -26
- data/node_modules/babel-generator/lib/position.js +5 -5
- data/node_modules/babel-generator/lib/printer.js +52 -81
- data/node_modules/babel-generator/lib/source-map.js +9 -11
- data/node_modules/babel-generator/lib/whitespace.js +13 -13
- data/node_modules/babel-generator/node_modules/babel-runtime/package.json +19 -6
- data/node_modules/babel-generator/node_modules/babel-types/.npmignore +3 -0
- data/node_modules/babel-generator/node_modules/babel-types/README.md +1141 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/constants.js +40 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/converters.js +378 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/core.js +704 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/es2015.js +354 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/experimental.js +85 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/flow.js +319 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/index.js +247 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/init.js +15 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/jsx.js +137 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/definitions/misc.js +21 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/flow.js +129 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/index.js +848 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/react.js +83 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/retrievers.js +123 -0
- data/node_modules/babel-generator/node_modules/babel-types/lib/validators.js +276 -0
- data/node_modules/babel-generator/node_modules/babel-types/package.json +103 -0
- data/node_modules/babel-generator/node_modules/core-js/package.json +10 -5
- data/node_modules/babel-generator/package.json +19 -16
- data/node_modules/babel-helpers/node_modules/babel-runtime/package.json +19 -3
- data/node_modules/babel-helpers/node_modules/core-js/package.json +20 -4
- data/node_modules/babel-helpers/package.json +8 -1
- data/node_modules/babel-register/node_modules/babel-runtime/package.json +19 -3
- data/node_modules/babel-register/node_modules/core-js/package.json +20 -4
- data/node_modules/babel-register/package.json +8 -1
- data/node_modules/balanced-match/package.json +8 -1
- data/node_modules/brace-expansion/package.json +19 -12
- data/node_modules/concat-map/package.json +9 -2
- data/node_modules/convert-source-map/package.json +8 -1
- data/node_modules/detect-indent/package.json +8 -1
- data/node_modules/get-stdin/package.json +8 -1
- data/node_modules/home-or-tmp/package.json +9 -2
- data/node_modules/is-finite/package.json +8 -2
- data/node_modules/json5/package.json +8 -1
- data/node_modules/minimatch/README.md +2 -9
- data/node_modules/minimatch/minimatch.js +15 -3
- data/node_modules/minimatch/package.json +29 -21
- data/node_modules/minimist/package.json +8 -1
- data/node_modules/mkdirp/node_modules/minimist/package.json +8 -1
- data/node_modules/mkdirp/package.json +8 -1
- data/node_modules/number-is-nan/package.json +8 -1
- data/node_modules/os-tmpdir/package.json +8 -1
- data/node_modules/path-exists/package.json +8 -1
- data/node_modules/path-is-absolute/package.json +8 -1
- data/node_modules/repeating/package.json +15 -11
- data/node_modules/shebang-regex/package.json +8 -1
- data/node_modules/slash/package.json +8 -1
- data/node_modules/source-map-support/node_modules/source-map/package.json +8 -1
- data/node_modules/source-map-support/package.json +8 -1
- data/node_modules/source-map/package.json +8 -1
- data/node_modules/user-home/package.json +8 -1
- data/package.json +1 -1
- metadata +54 -6
- data/node_modules/brace-expansion/.npmignore +0 -3
- data/node_modules/brace-expansion/example.js +0 -8
- data/node_modules/minimatch/browser.js +0 -1159
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dcfffdc8b233d145ddc77d28b1fe6dc66ebb0703
|
4
|
+
data.tar.gz: 9848826717d4547ad83560cbdc0b4242cc8f196e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d11df04e3f221b58e2eb0a8420c7a096a5542a240d5e840fd59ccf3f53a4841f3c2c89c1a260c8374626d7c3681d772c4e9285f768d3ae698a9611b4400fe2ec
|
7
|
+
data.tar.gz: 194f3f7259e7621ca7e986a0a5cd508e2add785a833a3721189067ea89a4dbd55edd8bf4798be6350f04e790700d7003879b143af22d7980ef9d1c1327fd5e89
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "babel/schmooze/sprockets"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/bin/update-npm-deps
ADDED
data/examples/myapp/Gemfile
CHANGED
@@ -1,11 +1,10 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
gem "rails",
|
3
|
+
gem "rails", "5.0.0.rc1"
|
4
|
+
gem "sprockets", "~> 4.x"
|
5
|
+
gem "sass-rails", "~> 6.x"
|
6
|
+
gem "babel-schmooze-sprockets", path: "../.."
|
4
7
|
|
5
8
|
gem "puma"
|
6
9
|
gem "uglifier", ">= 1.3.0"
|
7
|
-
gem "coffee-rails", "~> 4.1.0"
|
8
|
-
gem "sprockets", github: "rails/sprockets", branch: "master"
|
9
|
-
gem "sass-rails", github: "rails/sass-rails", branch: "master"
|
10
10
|
gem "pry-meta"
|
11
|
-
gem "babel-schmooze-sprockets", path: "../.."
|
data/examples/myapp/Gemfile.lock
CHANGED
@@ -1,107 +1,58 @@
|
|
1
|
-
|
2
|
-
remote:
|
3
|
-
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
babel-schmooze-sprockets (0.1.2)
|
5
|
+
schmooze
|
6
|
+
sprockets (~> 4.x)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
4
10
|
specs:
|
5
|
-
actioncable (5.0.0.
|
6
|
-
actionpack (= 5.0.0.
|
11
|
+
actioncable (5.0.0.rc1)
|
12
|
+
actionpack (= 5.0.0.rc1)
|
7
13
|
nio4r (~> 1.2)
|
8
14
|
websocket-driver (~> 0.6.1)
|
9
|
-
actionmailer (5.0.0.
|
10
|
-
actionpack (= 5.0.0.
|
11
|
-
actionview (= 5.0.0.
|
12
|
-
activejob (= 5.0.0.
|
15
|
+
actionmailer (5.0.0.rc1)
|
16
|
+
actionpack (= 5.0.0.rc1)
|
17
|
+
actionview (= 5.0.0.rc1)
|
18
|
+
activejob (= 5.0.0.rc1)
|
13
19
|
mail (~> 2.5, >= 2.5.4)
|
14
20
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
15
|
-
actionpack (5.0.0.
|
16
|
-
actionview (= 5.0.0.
|
17
|
-
activesupport (= 5.0.0.
|
21
|
+
actionpack (5.0.0.rc1)
|
22
|
+
actionview (= 5.0.0.rc1)
|
23
|
+
activesupport (= 5.0.0.rc1)
|
18
24
|
rack (~> 2.x)
|
19
25
|
rack-test (~> 0.6.3)
|
20
26
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
21
27
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
22
|
-
actionview (5.0.0.
|
23
|
-
activesupport (= 5.0.0.
|
28
|
+
actionview (5.0.0.rc1)
|
29
|
+
activesupport (= 5.0.0.rc1)
|
24
30
|
builder (~> 3.1)
|
25
31
|
erubis (~> 2.7.0)
|
26
32
|
rails-dom-testing (~> 1.0, >= 1.0.5)
|
27
33
|
rails-html-sanitizer (~> 1.0, >= 1.0.2)
|
28
|
-
activejob (5.0.0.
|
29
|
-
activesupport (= 5.0.0.
|
34
|
+
activejob (5.0.0.rc1)
|
35
|
+
activesupport (= 5.0.0.rc1)
|
30
36
|
globalid (>= 0.3.6)
|
31
|
-
activemodel (5.0.0.
|
32
|
-
activesupport (= 5.0.0.
|
33
|
-
activerecord (5.0.0.
|
34
|
-
activemodel (= 5.0.0.
|
35
|
-
activesupport (= 5.0.0.
|
37
|
+
activemodel (5.0.0.rc1)
|
38
|
+
activesupport (= 5.0.0.rc1)
|
39
|
+
activerecord (5.0.0.rc1)
|
40
|
+
activemodel (= 5.0.0.rc1)
|
41
|
+
activesupport (= 5.0.0.rc1)
|
36
42
|
arel (~> 7.0)
|
37
|
-
activesupport (5.0.0.
|
38
|
-
concurrent-ruby (~> 1.0)
|
43
|
+
activesupport (5.0.0.rc1)
|
44
|
+
concurrent-ruby (~> 1.0, >= 1.0.2)
|
39
45
|
i18n (~> 0.7)
|
40
46
|
minitest (~> 5.1)
|
41
47
|
tzinfo (~> 1.1)
|
42
|
-
rails (5.0.0.beta3)
|
43
|
-
actioncable (= 5.0.0.beta3)
|
44
|
-
actionmailer (= 5.0.0.beta3)
|
45
|
-
actionpack (= 5.0.0.beta3)
|
46
|
-
actionview (= 5.0.0.beta3)
|
47
|
-
activejob (= 5.0.0.beta3)
|
48
|
-
activemodel (= 5.0.0.beta3)
|
49
|
-
activerecord (= 5.0.0.beta3)
|
50
|
-
activesupport (= 5.0.0.beta3)
|
51
|
-
bundler (>= 1.3.0, < 2.0)
|
52
|
-
railties (= 5.0.0.beta3)
|
53
|
-
sprockets-rails (>= 2.0.0)
|
54
|
-
railties (5.0.0.beta3)
|
55
|
-
actionpack (= 5.0.0.beta3)
|
56
|
-
activesupport (= 5.0.0.beta3)
|
57
|
-
method_source
|
58
|
-
rake (>= 0.8.7)
|
59
|
-
thor (>= 0.18.1, < 2.0)
|
60
|
-
|
61
|
-
GIT
|
62
|
-
remote: git://github.com/rails/sass-rails.git
|
63
|
-
revision: 28907966729276f9585b79ca48c28569e37a1d6c
|
64
|
-
branch: master
|
65
|
-
specs:
|
66
|
-
sass-rails (6.0.0.beta1)
|
67
|
-
railties (>= 4.0.0, < 5.0)
|
68
|
-
sass (~> 3.4)
|
69
|
-
sprockets (~> 4.x)
|
70
|
-
sprockets-rails (< 4.0)
|
71
|
-
|
72
|
-
GIT
|
73
|
-
remote: git://github.com/rails/sprockets.git
|
74
|
-
revision: c2bae4a6c95269f44d3f35b7ccd669bea8168af7
|
75
|
-
branch: master
|
76
|
-
specs:
|
77
|
-
sprockets (4.0.0.beta2)
|
78
|
-
concurrent-ruby (~> 1.0)
|
79
|
-
rack (> 1, < 3)
|
80
|
-
|
81
|
-
PATH
|
82
|
-
remote: ../..
|
83
|
-
specs:
|
84
|
-
babel-schmooze-sprockets (0.1.0)
|
85
|
-
schmooze
|
86
|
-
|
87
|
-
GEM
|
88
|
-
remote: https://rubygems.org/
|
89
|
-
specs:
|
90
48
|
arel (7.0.0)
|
91
49
|
awesome_print (1.6.1)
|
92
50
|
builder (3.2.2)
|
93
|
-
byebug (
|
51
|
+
byebug (9.0.5)
|
94
52
|
coderay (1.1.1)
|
95
|
-
|
96
|
-
coffee-script (>= 2.2.0)
|
97
|
-
railties (>= 4.0.0, < 5.1.x)
|
98
|
-
coffee-script (2.4.1)
|
99
|
-
coffee-script-source
|
100
|
-
execjs
|
101
|
-
coffee-script-source (1.10.0)
|
102
|
-
concurrent-ruby (1.0.1)
|
53
|
+
concurrent-ruby (1.0.2)
|
103
54
|
erubis (2.7.0)
|
104
|
-
execjs (2.
|
55
|
+
execjs (2.7.0)
|
105
56
|
globalid (0.3.6)
|
106
57
|
activesupport (>= 4.1.0)
|
107
58
|
i18n (0.7.0)
|
@@ -111,11 +62,11 @@ GEM
|
|
111
62
|
mail (2.6.4)
|
112
63
|
mime-types (>= 1.16, < 4)
|
113
64
|
method_source (0.8.2)
|
114
|
-
mime-types (3.
|
65
|
+
mime-types (3.1)
|
115
66
|
mime-types-data (~> 3.2015)
|
116
|
-
mime-types-data (3.2016.
|
67
|
+
mime-types-data (3.2016.0521)
|
117
68
|
mini_portile2 (2.0.0)
|
118
|
-
minitest (5.
|
69
|
+
minitest (5.9.0)
|
119
70
|
nio4r (1.2.1)
|
120
71
|
nokogiri (1.6.7.2)
|
121
72
|
mini_portile2 (~> 2.0.0.rc2)
|
@@ -123,8 +74,8 @@ GEM
|
|
123
74
|
coderay (~> 1.1.0)
|
124
75
|
method_source (~> 0.8.1)
|
125
76
|
slop (~> 3.4)
|
126
|
-
pry-byebug (3.
|
127
|
-
byebug (~>
|
77
|
+
pry-byebug (3.4.0)
|
78
|
+
byebug (~> 9.0)
|
128
79
|
pry (~> 0.10)
|
129
80
|
pry-meta (0.0.10)
|
130
81
|
awesome_print
|
@@ -135,10 +86,22 @@ GEM
|
|
135
86
|
pry (~> 0.9)
|
136
87
|
slop (~> 3.0)
|
137
88
|
puma (3.4.0)
|
138
|
-
rack (2.0.0.
|
89
|
+
rack (2.0.0.rc1)
|
139
90
|
json
|
140
91
|
rack-test (0.6.3)
|
141
92
|
rack (>= 1.0)
|
93
|
+
rails (5.0.0.rc1)
|
94
|
+
actioncable (= 5.0.0.rc1)
|
95
|
+
actionmailer (= 5.0.0.rc1)
|
96
|
+
actionpack (= 5.0.0.rc1)
|
97
|
+
actionview (= 5.0.0.rc1)
|
98
|
+
activejob (= 5.0.0.rc1)
|
99
|
+
activemodel (= 5.0.0.rc1)
|
100
|
+
activerecord (= 5.0.0.rc1)
|
101
|
+
activesupport (= 5.0.0.rc1)
|
102
|
+
bundler (>= 1.3.0, < 2.0)
|
103
|
+
railties (= 5.0.0.rc1)
|
104
|
+
sprockets-rails (>= 2.0.0)
|
142
105
|
rails-deprecated_sanitizer (1.0.3)
|
143
106
|
activesupport (>= 4.2.0.alpha)
|
144
107
|
rails-dom-testing (1.0.7)
|
@@ -147,10 +110,24 @@ GEM
|
|
147
110
|
rails-deprecated_sanitizer (>= 1.0.1)
|
148
111
|
rails-html-sanitizer (1.0.3)
|
149
112
|
loofah (~> 2.0)
|
113
|
+
railties (5.0.0.rc1)
|
114
|
+
actionpack (= 5.0.0.rc1)
|
115
|
+
activesupport (= 5.0.0.rc1)
|
116
|
+
method_source
|
117
|
+
rake (>= 0.8.7)
|
118
|
+
thor (>= 0.18.1, < 2.0)
|
150
119
|
rake (11.1.2)
|
151
120
|
sass (3.4.22)
|
152
|
-
|
121
|
+
sass-rails (6.0.0.beta1)
|
122
|
+
railties (>= 4.0.0, < 5.0)
|
123
|
+
sass (~> 3.4)
|
124
|
+
sprockets (~> 4.x)
|
125
|
+
sprockets-rails (< 4.0)
|
126
|
+
schmooze (0.1.6)
|
153
127
|
slop (3.6.0)
|
128
|
+
sprockets (4.0.0.beta2)
|
129
|
+
concurrent-ruby (~> 1.0)
|
130
|
+
rack (> 1, < 3)
|
154
131
|
sprockets-rails (3.0.4)
|
155
132
|
actionpack (>= 4.0)
|
156
133
|
activesupport (>= 4.0)
|
@@ -161,7 +138,7 @@ GEM
|
|
161
138
|
thread_safe (~> 0.1)
|
162
139
|
uglifier (3.0.0)
|
163
140
|
execjs (>= 0.3.0, < 3)
|
164
|
-
websocket-driver (0.6.
|
141
|
+
websocket-driver (0.6.4)
|
165
142
|
websocket-extensions (>= 0.1.0)
|
166
143
|
websocket-extensions (0.1.2)
|
167
144
|
|
@@ -170,12 +147,11 @@ PLATFORMS
|
|
170
147
|
|
171
148
|
DEPENDENCIES
|
172
149
|
babel-schmooze-sprockets!
|
173
|
-
coffee-rails (~> 4.1.0)
|
174
150
|
pry-meta
|
175
151
|
puma
|
176
|
-
rails
|
177
|
-
sass-rails
|
178
|
-
sprockets
|
152
|
+
rails (= 5.0.0.rc1)
|
153
|
+
sass-rails (~> 6.x)
|
154
|
+
sprockets (~> 4.x)
|
179
155
|
uglifier (>= 1.3.0)
|
180
156
|
|
181
157
|
BUNDLED WITH
|
@@ -1 +0,0 @@
|
|
1
|
-
<p>Look your web developer tools' console</p>
|
@@ -34,7 +34,7 @@ module BabelSchmoozeSprockets
|
|
34
34
|
|
35
35
|
@cache_key = [
|
36
36
|
self.class.name,
|
37
|
-
|
37
|
+
babel.version,
|
38
38
|
VERSION,
|
39
39
|
@options
|
40
40
|
].freeze
|
@@ -61,9 +61,7 @@ module BabelSchmoozeSprockets
|
|
61
61
|
options[:moduleId] ||= input[:name]
|
62
62
|
end
|
63
63
|
|
64
|
-
|
65
|
-
.new(@options.fetch(:root_dir))
|
66
|
-
.transform(data, options)
|
64
|
+
babel.transform(data, options)
|
67
65
|
end
|
68
66
|
|
69
67
|
map = Sprockets::SourceMapUtils.decode_json_source_map(JSON.generate(result["map"]))
|
@@ -71,5 +69,9 @@ module BabelSchmoozeSprockets
|
|
71
69
|
|
72
70
|
{data: result["code"], map: map}
|
73
71
|
end
|
72
|
+
|
73
|
+
def babel
|
74
|
+
@babel ||= Babel.new(@options.fetch(:root_dir))
|
75
|
+
end
|
74
76
|
end
|
75
77
|
end
|
@@ -1,7 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"_args": [
|
3
3
|
[
|
4
|
-
|
4
|
+
{
|
5
|
+
"name": "amdefine",
|
6
|
+
"raw": "amdefine@>=0.0.4",
|
7
|
+
"rawSpec": ">=0.0.4",
|
8
|
+
"scope": null,
|
9
|
+
"spec": ">=0.0.4",
|
10
|
+
"type": "range"
|
11
|
+
},
|
5
12
|
"/Users/fnando/Projects/babel-schmooze-sprockets/node_modules/source-map-support/node_modules/source-map"
|
6
13
|
]
|
7
14
|
],
|
@@ -1,7 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"_args": [
|
3
3
|
[
|
4
|
-
|
4
|
+
{
|
5
|
+
"name": "babel-runtime",
|
6
|
+
"raw": "babel-runtime@^6.9.1",
|
7
|
+
"rawSpec": "^6.9.1",
|
8
|
+
"scope": null,
|
9
|
+
"spec": ">=6.9.1 <7.0.0",
|
10
|
+
"type": "range"
|
11
|
+
},
|
5
12
|
"/Users/fnando/Projects/babel-schmooze-sprockets/node_modules/babel-core"
|
6
13
|
]
|
7
14
|
],
|
@@ -31,10 +38,7 @@
|
|
31
38
|
},
|
32
39
|
"_requiredBy": [
|
33
40
|
"/babel-core",
|
34
|
-
"/babel-core/babel-
|
35
|
-
"/babel-core/babel-messages",
|
36
|
-
"/babel-core/babel-traverse",
|
37
|
-
"/babel-core/babel-types"
|
41
|
+
"/babel-core/babel-traverse"
|
38
42
|
],
|
39
43
|
"_resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.9.2.tgz",
|
40
44
|
"_shasum": "d7fe391bc2cc29b8087c1d9b39878912e9fcfd59",
|
@@ -0,0 +1 @@
|
|
1
|
+
# babel-traverse
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.scope = exports.path = undefined;
|
5
|
+
|
6
|
+
var _weakMap = require("babel-runtime/core-js/weak-map");
|
7
|
+
|
8
|
+
var _weakMap2 = _interopRequireDefault(_weakMap);
|
9
|
+
|
10
|
+
exports.clear = clear;
|
11
|
+
|
12
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
13
|
+
|
14
|
+
var path = exports.path = new _weakMap2.default();
|
15
|
+
var scope = exports.scope = new _weakMap2.default();
|
16
|
+
|
17
|
+
function clear() {
|
18
|
+
exports.path = path = new _weakMap2.default();
|
19
|
+
exports.scope = scope = new _weakMap2.default();
|
20
|
+
}
|
@@ -0,0 +1,219 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
|
5
|
+
var _getIterator2 = require("babel-runtime/core-js/get-iterator");
|
6
|
+
|
7
|
+
var _getIterator3 = _interopRequireDefault(_getIterator2);
|
8
|
+
|
9
|
+
var _classCallCheck2 = require("babel-runtime/helpers/classCallCheck");
|
10
|
+
|
11
|
+
var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);
|
12
|
+
|
13
|
+
var _path2 = require("./path");
|
14
|
+
|
15
|
+
var _path3 = _interopRequireDefault(_path2);
|
16
|
+
|
17
|
+
var _babelTypes = require("babel-types");
|
18
|
+
|
19
|
+
var t = _interopRequireWildcard(_babelTypes);
|
20
|
+
|
21
|
+
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
22
|
+
|
23
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
24
|
+
|
25
|
+
var testing = process.env.NODE_ENV === "test";
|
26
|
+
|
27
|
+
var TraversalContext = function () {
|
28
|
+
function TraversalContext(scope, opts, state, parentPath) {
|
29
|
+
(0, _classCallCheck3.default)(this, TraversalContext);
|
30
|
+
this.queue = null;
|
31
|
+
|
32
|
+
this.parentPath = parentPath;
|
33
|
+
this.scope = scope;
|
34
|
+
this.state = state;
|
35
|
+
this.opts = opts;
|
36
|
+
}
|
37
|
+
|
38
|
+
/**
|
39
|
+
* This method does a simple check to determine whether or not we really need to attempt
|
40
|
+
* visit a node. This will prevent us from constructing a NodePath.
|
41
|
+
*/
|
42
|
+
|
43
|
+
TraversalContext.prototype.shouldVisit = function shouldVisit(node) {
|
44
|
+
var opts = this.opts;
|
45
|
+
if (opts.enter || opts.exit) return true;
|
46
|
+
|
47
|
+
// check if we have a visitor for this node
|
48
|
+
if (opts[node.type]) return true;
|
49
|
+
|
50
|
+
// check if we're going to traverse into this node
|
51
|
+
var keys = t.VISITOR_KEYS[node.type];
|
52
|
+
if (!keys || !keys.length) return false;
|
53
|
+
|
54
|
+
// we need to traverse into this node so ensure that it has children to traverse into!
|
55
|
+
for (var _iterator = keys, _isArray = Array.isArray(_iterator), _i = 0, _iterator = _isArray ? _iterator : (0, _getIterator3.default)(_iterator);;) {
|
56
|
+
var _ref;
|
57
|
+
|
58
|
+
if (_isArray) {
|
59
|
+
if (_i >= _iterator.length) break;
|
60
|
+
_ref = _iterator[_i++];
|
61
|
+
} else {
|
62
|
+
_i = _iterator.next();
|
63
|
+
if (_i.done) break;
|
64
|
+
_ref = _i.value;
|
65
|
+
}
|
66
|
+
|
67
|
+
var key = _ref;
|
68
|
+
|
69
|
+
if (node[key]) return true;
|
70
|
+
}
|
71
|
+
|
72
|
+
return false;
|
73
|
+
};
|
74
|
+
|
75
|
+
TraversalContext.prototype.create = function create(node, obj, key, listKey) {
|
76
|
+
return _path3.default.get({
|
77
|
+
parentPath: this.parentPath,
|
78
|
+
parent: node,
|
79
|
+
container: obj,
|
80
|
+
key: key,
|
81
|
+
listKey: listKey
|
82
|
+
});
|
83
|
+
};
|
84
|
+
|
85
|
+
TraversalContext.prototype.maybeQueue = function maybeQueue(path, notPriority) {
|
86
|
+
if (this.trap) {
|
87
|
+
throw new Error("Infinite cycle detected");
|
88
|
+
}
|
89
|
+
|
90
|
+
if (this.queue) {
|
91
|
+
if (notPriority) {
|
92
|
+
this.queue.push(path);
|
93
|
+
} else {
|
94
|
+
this.priorityQueue.push(path);
|
95
|
+
}
|
96
|
+
}
|
97
|
+
};
|
98
|
+
|
99
|
+
TraversalContext.prototype.visitMultiple = function visitMultiple(container, parent, listKey) {
|
100
|
+
// nothing to traverse!
|
101
|
+
if (container.length === 0) return false;
|
102
|
+
|
103
|
+
var queue = [];
|
104
|
+
|
105
|
+
// build up initial queue
|
106
|
+
for (var key = 0; key < container.length; key++) {
|
107
|
+
var node = container[key];
|
108
|
+
if (node && this.shouldVisit(node)) {
|
109
|
+
queue.push(this.create(parent, container, key, listKey));
|
110
|
+
}
|
111
|
+
}
|
112
|
+
|
113
|
+
return this.visitQueue(queue);
|
114
|
+
};
|
115
|
+
|
116
|
+
TraversalContext.prototype.visitSingle = function visitSingle(node, key) {
|
117
|
+
if (this.shouldVisit(node[key])) {
|
118
|
+
return this.visitQueue([this.create(node, node, key)]);
|
119
|
+
} else {
|
120
|
+
return false;
|
121
|
+
}
|
122
|
+
};
|
123
|
+
|
124
|
+
TraversalContext.prototype.visitQueue = function visitQueue(queue) {
|
125
|
+
// set queue
|
126
|
+
this.queue = queue;
|
127
|
+
this.priorityQueue = [];
|
128
|
+
|
129
|
+
var visited = [];
|
130
|
+
var stop = false;
|
131
|
+
|
132
|
+
// visit the queue
|
133
|
+
for (var _iterator2 = queue, _isArray2 = Array.isArray(_iterator2), _i2 = 0, _iterator2 = _isArray2 ? _iterator2 : (0, _getIterator3.default)(_iterator2);;) {
|
134
|
+
var _ref2;
|
135
|
+
|
136
|
+
if (_isArray2) {
|
137
|
+
if (_i2 >= _iterator2.length) break;
|
138
|
+
_ref2 = _iterator2[_i2++];
|
139
|
+
} else {
|
140
|
+
_i2 = _iterator2.next();
|
141
|
+
if (_i2.done) break;
|
142
|
+
_ref2 = _i2.value;
|
143
|
+
}
|
144
|
+
|
145
|
+
var path = _ref2;
|
146
|
+
|
147
|
+
path.resync();
|
148
|
+
|
149
|
+
if (path.contexts.length === 0 || path.contexts[path.contexts.length - 1] !== this) {
|
150
|
+
// The context might already have been pushed when this path was inserted and queued.
|
151
|
+
// If we always re-pushed here, we could get duplicates and risk leaving contexts
|
152
|
+
// on the stack after the traversal has completed, which could break things.
|
153
|
+
path.pushContext(this);
|
154
|
+
}
|
155
|
+
|
156
|
+
// this path no longer belongs to the tree
|
157
|
+
if (path.key === null) continue;
|
158
|
+
|
159
|
+
if (testing && queue.length >= 1000) {
|
160
|
+
this.trap = true;
|
161
|
+
}
|
162
|
+
|
163
|
+
// ensure we don't visit the same node twice
|
164
|
+
if (visited.indexOf(path.node) >= 0) continue;
|
165
|
+
visited.push(path.node);
|
166
|
+
|
167
|
+
if (path.visit()) {
|
168
|
+
stop = true;
|
169
|
+
break;
|
170
|
+
}
|
171
|
+
|
172
|
+
if (this.priorityQueue.length) {
|
173
|
+
stop = this.visitQueue(this.priorityQueue);
|
174
|
+
this.priorityQueue = [];
|
175
|
+
this.queue = queue;
|
176
|
+
if (stop) break;
|
177
|
+
}
|
178
|
+
}
|
179
|
+
|
180
|
+
// clear queue
|
181
|
+
for (var _iterator3 = queue, _isArray3 = Array.isArray(_iterator3), _i3 = 0, _iterator3 = _isArray3 ? _iterator3 : (0, _getIterator3.default)(_iterator3);;) {
|
182
|
+
var _ref3;
|
183
|
+
|
184
|
+
if (_isArray3) {
|
185
|
+
if (_i3 >= _iterator3.length) break;
|
186
|
+
_ref3 = _iterator3[_i3++];
|
187
|
+
} else {
|
188
|
+
_i3 = _iterator3.next();
|
189
|
+
if (_i3.done) break;
|
190
|
+
_ref3 = _i3.value;
|
191
|
+
}
|
192
|
+
|
193
|
+
var _path = _ref3;
|
194
|
+
|
195
|
+
_path.popContext();
|
196
|
+
}
|
197
|
+
|
198
|
+
// clear queue
|
199
|
+
this.queue = null;
|
200
|
+
|
201
|
+
return stop;
|
202
|
+
};
|
203
|
+
|
204
|
+
TraversalContext.prototype.visit = function visit(node, key) {
|
205
|
+
var nodes = node[key];
|
206
|
+
if (!nodes) return false;
|
207
|
+
|
208
|
+
if (Array.isArray(nodes)) {
|
209
|
+
return this.visitMultiple(nodes, node, key);
|
210
|
+
} else {
|
211
|
+
return this.visitSingle(node, key);
|
212
|
+
}
|
213
|
+
};
|
214
|
+
|
215
|
+
return TraversalContext;
|
216
|
+
}();
|
217
|
+
|
218
|
+
exports.default = TraversalContext;
|
219
|
+
module.exports = exports["default"];
|