autoprefixer-rails 10.4.13.0 → 10.4.15.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5cd7c80a6311842ce80f7c7139e8e57eec69759fe4d0efe2250c47eca7b154f
4
- data.tar.gz: c0ba140c37bdf7636d4b978332549ad35fbfaf02059c67bc6d28cc474e4d0125
3
+ metadata.gz: 8e3706e830d83f7a9c0d05c8a489abca67b7d2ee688c8570a10a8f4a2f6ca57e
4
+ data.tar.gz: 3b85610b1238b10825f1e8d942c09d9d2b91f93c512a482f32e4e49018af47e3
5
5
  SHA512:
6
- metadata.gz: a26f1084d80956bd910428088cfb96b1e5fdd78a950259027153ebf9fa06d373eb4a0d4e9573e3ebbdc719fb176c7c6625009fbbd3e69a3d056bf3b7a89fb461
7
- data.tar.gz: d4d1e1b5feab933d3e33b487f257feeb3bf336f69291c9f611f58d2d4d0d9cbcf42673299ac3b2a789c83f6bca5c60737d734d9f917a9ccdc5e790e1ce50b3f2
6
+ metadata.gz: 46af2ba9144e6d018d6eaeffe1e689be827ed05d9ec48d6008a54bc2e5e1a97f47bae5ec35c177526085a4ff447740d26921a56c751be00d3fb903d7081b4c3f
7
+ data.tar.gz: feb0ddb7d4a293c504daf67c56e2ad1fd7478f6099c8ea673b7604f20e2a747f8a46902d84fcbc979974dfde15e8e1f634b7399076ef24f3e980aa09706c59b6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Change Log
2
2
 
3
+ ## 10.4.15.0
4
+ * Improved startup time and reduced JS bundle size (by Kārlis Gaņģis).
5
+ * Fixed `::backdrop` prefixes (by 一丝).
6
+
3
7
  ## 10.4.13.0
4
8
  * Fixed missed prefixes on vendor prefixes in name of CSS Custom Property.
5
9
  * Fixed support of unit-less zero angle in backgrounds (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 =~ line
61
+ .split(/\n/)
62
+ .map(&:strip)
63
+ .reject(&:empty?)
64
+ .each do |line|
65
+ if IS_SECTION.match?(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 /_/ =~ name
103
+ if /_/.match?(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,28 +131,32 @@ 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 = 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
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
156
160
  end
157
161
  end
158
162
 
@@ -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.13.0" unless defined? AutoprefixerRails::VERSION
4
+ VERSION = "10.4.15.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