autoprefixer-rails 10.4.7.0 → 10.4.15.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: daede92299c67ff8e569b081e8f75e2e7fc50934936115605a38e419a064a39e
4
- data.tar.gz: 2d7a5fb04f55ed57881af6aa7ce444d47b9477a25345392c37aaa5c1b425a13f
3
+ metadata.gz: 8e3706e830d83f7a9c0d05c8a489abca67b7d2ee688c8570a10a8f4a2f6ca57e
4
+ data.tar.gz: 3b85610b1238b10825f1e8d942c09d9d2b91f93c512a482f32e4e49018af47e3
5
5
  SHA512:
6
- metadata.gz: 142859085b4dc649f41122a083d18272dceb2b64e44652499f6a4152d959fce0c90980e67706c053ba11a3592a54809f851ac283ee33af239a3579ef2cfb31f7
7
- data.tar.gz: 63e283ec2cfa1ddf8ce75a840c786404f6c29a85eb8d78dfa3d164799a2527717487debdf2245abb1f6129ee3b87e28af8ec423cfd44df4a1f30936e110d6df1
6
+ metadata.gz: 46af2ba9144e6d018d6eaeffe1e689be827ed05d9ec48d6008a54bc2e5e1a97f47bae5ec35c177526085a4ff447740d26921a56c751be00d3fb903d7081b4c3f
7
+ data.tar.gz: feb0ddb7d4a293c504daf67c56e2ad1fd7478f6099c8ea673b7604f20e2a747f8a46902d84fcbc979974dfde15e8e1f634b7399076ef24f3e980aa09706c59b6
data/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
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
+
7
+ ## 10.4.13.0
8
+ * Fixed missed prefixes on vendor prefixes in name of CSS Custom Property.
9
+ * Fixed support of unit-less zero angle in backgrounds (by 一丝).
10
+ * Fixed `text-decoration` prefixes by moving to MDN data (by Romain Menke).
11
+ * Fixed `unicode-bidi` prefixes by moving to MDN data.
12
+ * Fixed `css-unicode-bidi` issue from latest Can I Use.
13
+ * Do not print `color-adjust` warning if `print-color-adjust` also is in rule.
14
+
3
15
  ## 10.4.7.0
4
16
  * Fixed `print-color-adjust` support in Firefox.
5
17
  * Fixed `print-color-adjust` support.
data/README.md CHANGED
@@ -15,8 +15,8 @@ and Ruby on Rails integration with this JavaScript tool.
15
15
  [Autoprefixer]: https://github.com/postcss/autoprefixer
16
16
  [Can I Use]: http://caniuse.com/
17
17
  [PostCSS]: https://postcss.org/
18
- [ci-img]: https://travis-ci.org/ai/autoprefixer-rails.svg
19
- [ci]: https://travis-ci.org/ai/autoprefixer-rails
18
+ [ci-img]: https://github.com/ai/autoprefixer-rails/actions/workflows/ci.yml/badge.svg
19
+ [ci]: https://github.com/ai/autoprefixer-rails/actions/workflows/ci.yml
20
20
 
21
21
  ## Differences
22
22
 
@@ -4,9 +4,9 @@ require "pathname"
4
4
  require "execjs"
5
5
  require "json"
6
6
 
7
- IS_SECTION = /^\s*\[(.+)\]\s*$/.freeze
8
-
9
7
  module AutoprefixerRails
8
+ IS_SECTION = /^\s*\[(.+)\]\s*$/.freeze
9
+
10
10
  # Ruby to JS wrapper for Autoprefixer processor instance
11
11
  class Processor
12
12
  SUPPORTED_RUNTIMES = [ExecJS::Runtimes::Node, ExecJS::Runtimes::MiniRacer]
@@ -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.7.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