sprockets-bumble_d 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sprockets/bumble_d/config.rb +6 -1
- data/lib/sprockets/bumble_d/railtie.rb +4 -3
- data/lib/sprockets/bumble_d/version.rb +1 -1
- metadata +14 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 423fca19ac5ea5a87c580399a58019d9a307341c
|
4
|
+
data.tar.gz: 4805e74ad5aa213e63d6281ef6f7de3be7e227e2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fcd06a0198c3f0b061a8bc66e40568aab4ad61728c4768b62c60b204a5cf64e1baadc4d581bcc1d658d5f719c48bf8efe4ece07348154fd3809f0137a5c60524
|
7
|
+
data.tar.gz: 669dc45db794b55efcac40a2ca7372cfe72ba6fc847d19d7ed6ed7a48b08d01372b8d982c4866411f1a5fcbf2ac36d94418906a933833d799889d4a09b890e95
|
@@ -3,10 +3,15 @@ require 'sprockets/bumble_d/errors'
|
|
3
3
|
module Sprockets
|
4
4
|
module BumbleD
|
5
5
|
class Config
|
6
|
-
attr_accessor :
|
6
|
+
attr_accessor :babel_config_version,
|
7
|
+
:babel_options,
|
8
|
+
:file_extension,
|
9
|
+
:root_dir,
|
10
|
+
:transform_to_umd
|
7
11
|
attr_reader :globals_map
|
8
12
|
|
9
13
|
def initialize
|
14
|
+
@file_extension = '.es6'
|
10
15
|
@globals_map = {}.freeze
|
11
16
|
@transform_to_umd = true
|
12
17
|
@babel_options = {
|
@@ -6,6 +6,7 @@ module Sprockets
|
|
6
6
|
class Railtie < ::Rails::Railtie
|
7
7
|
config.before_configuration do
|
8
8
|
config.sprockets_bumble_d = Config.new
|
9
|
+
config.sprockets_bumble_d.root_dir = ::Rails.root.to_s
|
9
10
|
end
|
10
11
|
|
11
12
|
initializer 'sprockets-bumble_d.configure_transformer' do |app|
|
@@ -28,15 +29,15 @@ module Sprockets
|
|
28
29
|
root_dir: root_dir,
|
29
30
|
babel_config_version: babel_config_version
|
30
31
|
)
|
31
|
-
|
32
|
+
babel_transformer = Transformer.new(options)
|
32
33
|
|
33
34
|
# Using the deprecated register_engine rather than register_mime_type
|
34
35
|
# and register_transformer because otherwise .es6 files that aren't
|
35
36
|
# in the precompile list will get unnecessarily compiled. See
|
36
37
|
# https://github.com/rails/sprockets/issues/384
|
37
38
|
Sprockets.register_engine(
|
38
|
-
|
39
|
-
|
39
|
+
bumble_d_config.file_extension,
|
40
|
+
babel_transformer,
|
40
41
|
mime_type: 'application/javascript',
|
41
42
|
silence_deprecation: true
|
42
43
|
)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets-bumble_d
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Richard Macklin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|
@@ -59,10 +59,17 @@ dependencies:
|
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '3.5'
|
61
61
|
description: |2
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
62
|
+
This gem provides a plugin for Sprockets to transpile modern javascript
|
63
|
+
using Babel.
|
64
|
+
|
65
|
+
Unlike other options in the sprockets ecosystem, it works with the latest
|
66
|
+
version of Babel and any plugins/presets you install.
|
67
|
+
|
68
|
+
A primary use case for this gem is to facilitate incremental migration of a
|
69
|
+
large Sprockets-powered javascript codebase to ES6 modules by transforming
|
70
|
+
them to UMD modules that preserve your existing global variable references
|
71
|
+
(hence the name: Babel + UMD = BumbleD). That said, this gem can be used for
|
72
|
+
general purpose babel transpilation within the Sprockets pipeline.
|
66
73
|
email:
|
67
74
|
executables: []
|
68
75
|
extensions: []
|
@@ -99,5 +106,5 @@ rubyforge_project:
|
|
99
106
|
rubygems_version: 2.6.10
|
100
107
|
signing_key:
|
101
108
|
specification_version: 4
|
102
|
-
summary: Let Sprockets use Babel to transpile
|
109
|
+
summary: Let Sprockets use Babel to transpile modern javascript
|
103
110
|
test_files: []
|