autoprefixer-rails 10.4.15.0 → 10.4.16.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
  SHA256:
3
- metadata.gz: 8e3706e830d83f7a9c0d05c8a489abca67b7d2ee688c8570a10a8f4a2f6ca57e
4
- data.tar.gz: 3b85610b1238b10825f1e8d942c09d9d2b91f93c512a482f32e4e49018af47e3
3
+ metadata.gz: c98bfac03efd935510bb9b69e3d6e5e086b22aaf70c5b8efdffbdaf2fc4cf39a
4
+ data.tar.gz: 30d7bde4a5a53a6b248dc17155eaf32f48aa7cfdbb64e672565e9ae234627f0f
5
5
  SHA512:
6
- metadata.gz: 46af2ba9144e6d018d6eaeffe1e689be827ed05d9ec48d6008a54bc2e5e1a97f47bae5ec35c177526085a4ff447740d26921a56c751be00d3fb903d7081b4c3f
7
- data.tar.gz: feb0ddb7d4a293c504daf67c56e2ad1fd7478f6099c8ea673b7604f20e2a747f8a46902d84fcbc979974dfde15e8e1f634b7399076ef24f3e980aa09706c59b6
6
+ metadata.gz: d6614e7a0fc0c90b55e1f84025d5e42d1ad883493289f2daeae92fdc7aefb1aad0b5e24349f51f00eadb9c9e0967cb4e7a40cdf0404731e72f4628485e4eaa8a
7
+ data.tar.gz: 4ad070bd3187eb91d701dc538cfaf9e83a801819922ed004e7aad101cbfe087f9c75315282c48efa3c82cbff1218ee6a5fd7a5cbcf2d207003392b8589c19379
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.4.16.0
4
+ * Improved performance (by Romain Menke).
5
+
3
6
  ## 10.4.15.0
4
7
  * Improved startup time and reduced JS bundle size (by Kārlis Gaņģis).
5
8
  * Fixed `::backdrop` prefixes (by 一丝).
@@ -55,14 +55,14 @@ module AutoprefixerRails
55
55
 
56
56
  # Parse Browserslist config
57
57
  def parse_config(config)
58
- sections = {"defaults" => []}
59
- current = "defaults"
58
+ sections = { "defaults" => [] }
59
+ current = "defaults"
60
60
  config.gsub(/#[^\n]*/, "")
61
- .split(/\n/)
62
- .map(&:strip)
63
- .reject(&:empty?)
64
- .each do |line|
65
- if IS_SECTION.match?(line)
61
+ .split(/\n/)
62
+ .map(&:strip)
63
+ .reject(&:empty?)
64
+ .each do |line|
65
+ if IS_SECTION =~ line
66
66
  current = line.match(IS_SECTION)[1].strip
67
67
  sections[current] ||= []
68
68
  else
@@ -76,16 +76,16 @@ module AutoprefixerRails
76
76
 
77
77
  def params_with_browsers(from = nil)
78
78
  from ||= if defined?(Rails) && Rails.respond_to?(:root) && Rails.root
79
- Rails.root.join("app/assets/stylesheets").to_s
80
- else
81
- "."
82
- end
79
+ Rails.root.join("app/assets/stylesheets").to_s
80
+ else
81
+ "."
82
+ end
83
83
 
84
84
  params = @params
85
85
  if !params.key?(:browsers) && !params.key?(:overrideBrowserslist) && from
86
86
  file = find_config(from)
87
87
  if file
88
- env = params[:env].to_s || "development"
88
+ env = params[:env].to_s || "development"
89
89
  config = parse_config(file)
90
90
  params = params.dup
91
91
  params[:overrideBrowserslist] = (config[env] || config["defaults"])
@@ -100,7 +100,7 @@ module AutoprefixerRails
100
100
  converted = {}
101
101
 
102
102
  opts.each_pair do |name, value|
103
- if /_/.match?(name)
103
+ if /_/ =~ name
104
104
  name = name.to_s.gsub(/_\w/) { |i| i.delete("_").upcase }.to_sym
105
105
  end
106
106
  value = convert_options(value) if value.is_a? Hash
@@ -131,32 +131,28 @@ module AutoprefixerRails
131
131
  def runtime
132
132
  @runtime ||= begin
133
133
  ExecJS.compile(build_js)
134
- rescue ExecJS::RuntimeError
135
- # Only complain about unsupported runtimes when it failed to parse our script.
136
-
137
- case ExecJS.runtime
138
- when ExecJS::Runtimes::Node
139
- node_command = begin
140
- ExecJS.runtime.send(:binary)
141
- rescue
142
- "Unknown"
143
- end
144
-
145
- raise <<~MSG
146
- Your nodejs binary failed to load autoprefixer script file,
147
- please check if you're running a supported version (10, 12, 14+)
148
-
149
- ENV["PATH"] = #{ENV["PATH"]}
150
- binary = #{node_command}
151
- MSG
152
- when *SUPPORTED_RUNTIMES
153
- raise
154
- else
155
- raise <<~MSG
156
- Your ExecJS runtime #{ExecJS.runtime.name} isn't supported by autoprefixer-rails,
157
- please switch to #{SUPPORTED_RUNTIMES.map(&:name).join(" or ")}
158
- MSG
159
- end
134
+ rescue ExecJS::RuntimeError
135
+ # Only complain about unsupported runtimes when it failed to parse our script.
136
+
137
+ case ExecJS.runtime
138
+ when ExecJS::Runtimes::Node
139
+ node_command = ExecJS.runtime.send(:binary) rescue "Unknown"
140
+
141
+ raise <<~MSG
142
+ Your nodejs binary failed to load autoprefixer script file,
143
+ please check if you're running a supported version (10, 12, 14+)
144
+
145
+ ENV["PATH"] = #{ENV["PATH"]}
146
+ binary = #{node_command}
147
+ MSG
148
+ when *SUPPORTED_RUNTIMES
149
+ raise
150
+ else
151
+ raise <<~MSG
152
+ Your ExecJS runtime #{ExecJS.runtime.name} isn't supported by autoprefixer-rails,
153
+ please switch to #{SUPPORTED_RUNTIMES.map(&:name).join(' or ')}
154
+ MSG
155
+ end
160
156
  end
161
157
  end
162
158
 
@@ -14,8 +14,8 @@ module AutoprefixerRails
14
14
 
15
15
  def initialize(css, map, warnings)
16
16
  @warnings = warnings
17
- @css = css
18
- @map = map
17
+ @css = css
18
+ @map = map
19
19
  end
20
20
 
21
21
  # Stringify prefixed CSS
@@ -12,7 +12,7 @@ module AutoprefixerRails
12
12
  # Sprockets 3 and 4 API
13
13
  def self.call(input)
14
14
  filename = input[:filename]
15
- source = input[:data]
15
+ source = input[:data]
16
16
  run(filename, source)
17
17
  end
18
18
 
@@ -32,10 +32,10 @@ module AutoprefixerRails
32
32
  def self.install(env)
33
33
  if ::Sprockets::VERSION.to_f < 4
34
34
  env.register_postprocessor("text/css",
35
- ::AutoprefixerRails::Sprockets)
35
+ ::AutoprefixerRails::Sprockets)
36
36
  else
37
37
  env.register_bundle_processor("text/css",
38
- ::AutoprefixerRails::Sprockets)
38
+ ::AutoprefixerRails::Sprockets)
39
39
  end
40
40
  end
41
41
 
@@ -43,17 +43,17 @@ module AutoprefixerRails
43
43
  def self.uninstall(env)
44
44
  if ::Sprockets::VERSION.to_f < 4
45
45
  env.unregister_postprocessor("text/css",
46
- ::AutoprefixerRails::Sprockets)
46
+ ::AutoprefixerRails::Sprockets)
47
47
  else
48
48
  env.unregister_bundle_processor("text/css",
49
- ::AutoprefixerRails::Sprockets)
49
+ ::AutoprefixerRails::Sprockets)
50
50
  end
51
51
  end
52
52
 
53
53
  # Sprockets 2 API new and render
54
54
  def initialize(filename)
55
55
  @filename = filename
56
- @source = yield
56
+ @source = yield
57
57
  end
58
58
 
59
59
  # Sprockets 2 API new and render
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AutoprefixerRails # :nodoc:
4
- VERSION = "10.4.15.0" unless defined? AutoprefixerRails::VERSION
4
+ VERSION = "10.4.16.0" unless defined? AutoprefixerRails::VERSION
5
5
  end
@@ -10,9 +10,9 @@ module AutoprefixerRails
10
10
  params = {}
11
11
  params[:overrideBrowserslist] = opts.delete(:overrideBrowserslist) if opts.key?(:overrideBrowserslist)
12
12
  params[:browsers] = opts.delete(:browsers) if opts.key?(:browsers)
13
- params[:cascade] = opts.delete(:cascade) if opts.key?(:cascade)
14
- params[:remove] = opts.delete(:remove) if opts.key?(:remove)
15
- params[:env] = opts.delete(:env) if opts.key?(:env)
13
+ params[:cascade] = opts.delete(:cascade) if opts.key?(:cascade)
14
+ params[:remove] = opts.delete(:remove) if opts.key?(:remove)
15
+ params[:env] = opts.delete(:env) if opts.key?(:env)
16
16
  processor(params).process(css, opts)
17
17
  end
18
18
 
@@ -13,7 +13,7 @@ module Rake
13
13
  attr_reader :browsers
14
14
 
15
15
  def initialize(params = {})
16
- @params = params
16
+ @params = params
17
17
  @processor = AutoprefixerRails.processor(@params)
18
18
  define
19
19
  end