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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 563a1df484bc178ed52a362af4fbdebbd6d094ae
4
- data.tar.gz: 5be4216200fe745c4110fd05918c3fa848e7d0dd
3
+ metadata.gz: 423fca19ac5ea5a87c580399a58019d9a307341c
4
+ data.tar.gz: 4805e74ad5aa213e63d6281ef6f7de3be7e227e2
5
5
  SHA512:
6
- metadata.gz: 28f32bb6fdc5b0e176f59417ed983396c70434e53123de567a87dc87ddc60ea86da8ac83cceb760b57dbf9d2c940fb7215acf263b30af2393b49dc2d3ae9e819
7
- data.tar.gz: fa17ebed642439486b9aceaf841a5aa70c0cbb82ce8ba02a23f645704a33f950c1b1c549b6ff794ec04af01326df56afe23352d5b54f808ad39583b711f28530
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 :babel_options, :babel_config_version, :root_dir, :transform_to_umd
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
- es6_transformer = Transformer.new(options)
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
- '.es6',
39
- es6_transformer,
39
+ bumble_d_config.file_extension,
40
+ babel_transformer,
40
41
  mime_type: 'application/javascript',
41
42
  silence_deprecation: true
42
43
  )
@@ -1,5 +1,5 @@
1
1
  module Sprockets
2
2
  module BumbleD
3
- VERSION = '2.0.0'.freeze
3
+ VERSION = '2.1.0'.freeze
4
4
  end
5
5
  end
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.0.0
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-02-27 00:00:00.000000000 Z
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
- Babel + UMD = BumbleD
63
- Facilitate incremental migration of a large Sprockets-powered javascript
64
- codebase to ES6 modules by transforming them to UMD modules that preserve
65
- your existing global references.
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 ES6 modules to UMD
109
+ summary: Let Sprockets use Babel to transpile modern javascript
103
110
  test_files: []