autoprefixer-rails 10.4.15.0 → 10.4.16.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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/autoprefixer-rails/processor.rb +35 -39
- data/lib/autoprefixer-rails/result.rb +2 -2
- data/lib/autoprefixer-rails/sprockets.rb +6 -6
- data/lib/autoprefixer-rails/version.rb +1 -1
- data/lib/autoprefixer-rails.rb +3 -3
- data/lib/rake/autoprefixer_tasks.rb +1 -1
- data/vendor/autoprefixer.js +137 -110
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c98bfac03efd935510bb9b69e3d6e5e086b22aaf70c5b8efdffbdaf2fc4cf39a
|
4
|
+
data.tar.gz: 30d7bde4a5a53a6b248dc17155eaf32f48aa7cfdbb64e672565e9ae234627f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6614e7a0fc0c90b55e1f84025d5e42d1ad883493289f2daeae92fdc7aefb1aad0b5e24349f51f00eadb9c9e0967cb4e7a40cdf0404731e72f4628485e4eaa8a
|
7
|
+
data.tar.gz: 4ad070bd3187eb91d701dc538cfaf9e83a801819922ed004e7aad101cbfe087f9c75315282c48efa3c82cbff1218ee6a5fd7a5cbcf2d207003392b8589c19379
|
data/CHANGELOG.md
CHANGED
@@ -55,14 +55,14 @@ module AutoprefixerRails
|
|
55
55
|
|
56
56
|
# Parse Browserslist config
|
57
57
|
def parse_config(config)
|
58
|
-
sections = {"defaults" => []}
|
59
|
-
current
|
58
|
+
sections = { "defaults" => [] }
|
59
|
+
current = "defaults"
|
60
60
|
config.gsub(/#[^\n]*/, "")
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
if IS_SECTION
|
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
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
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
|
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 /_
|
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
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
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
|
|
@@ -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
|
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
|
-
|
35
|
+
::AutoprefixerRails::Sprockets)
|
36
36
|
else
|
37
37
|
env.register_bundle_processor("text/css",
|
38
|
-
|
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
|
-
|
46
|
+
::AutoprefixerRails::Sprockets)
|
47
47
|
else
|
48
48
|
env.unregister_bundle_processor("text/css",
|
49
|
-
|
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
|
56
|
+
@source = yield
|
57
57
|
end
|
58
58
|
|
59
59
|
# Sprockets 2 API new and render
|
data/lib/autoprefixer-rails.rb
CHANGED
@@ -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]
|
14
|
-
params[:remove]
|
15
|
-
params[: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
|
|