sprockets 3.0.3 → 4.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +101 -0
- data/{LICENSE → MIT-LICENSE} +2 -2
- data/README.md +531 -276
- data/bin/sprockets +12 -7
- data/lib/rake/sprocketstask.rb +9 -4
- data/lib/sprockets/add_source_map_comment_to_asset_processor.rb +60 -0
- data/lib/sprockets/asset.rb +41 -28
- data/lib/sprockets/autoload/babel.rb +8 -0
- data/lib/sprockets/autoload/closure.rb +1 -0
- data/lib/sprockets/autoload/coffee_script.rb +1 -0
- data/lib/sprockets/autoload/eco.rb +1 -0
- data/lib/sprockets/autoload/ejs.rb +1 -0
- data/lib/sprockets/autoload/jsminc.rb +8 -0
- data/lib/sprockets/autoload/sass.rb +1 -0
- data/lib/sprockets/autoload/sassc.rb +8 -0
- data/lib/sprockets/autoload/uglifier.rb +1 -0
- data/lib/sprockets/autoload/yui.rb +1 -0
- data/lib/sprockets/autoload/zopfli.rb +7 -0
- data/lib/sprockets/autoload.rb +5 -0
- data/lib/sprockets/babel_processor.rb +66 -0
- data/lib/sprockets/base.rb +61 -13
- data/lib/sprockets/bower.rb +6 -3
- data/lib/sprockets/bundle.rb +41 -5
- data/lib/sprockets/cache/file_store.rb +32 -7
- data/lib/sprockets/cache/memory_store.rb +28 -10
- data/lib/sprockets/cache/null_store.rb +8 -0
- data/lib/sprockets/cache.rb +43 -6
- data/lib/sprockets/cached_environment.rb +15 -20
- data/lib/sprockets/closure_compressor.rb +6 -11
- data/lib/sprockets/coffee_script_processor.rb +20 -6
- data/lib/sprockets/compressing.rb +62 -2
- data/lib/sprockets/configuration.rb +5 -9
- data/lib/sprockets/context.rb +99 -25
- data/lib/sprockets/dependencies.rb +10 -9
- data/lib/sprockets/digest_utils.rb +103 -62
- data/lib/sprockets/directive_processor.rb +64 -36
- data/lib/sprockets/eco_processor.rb +4 -3
- data/lib/sprockets/ejs_processor.rb +4 -3
- data/lib/sprockets/encoding_utils.rb +1 -0
- data/lib/sprockets/environment.rb +9 -4
- data/lib/sprockets/erb_processor.rb +34 -21
- data/lib/sprockets/errors.rb +1 -0
- data/lib/sprockets/exporters/base.rb +71 -0
- data/lib/sprockets/exporters/file_exporter.rb +24 -0
- data/lib/sprockets/exporters/zlib_exporter.rb +33 -0
- data/lib/sprockets/exporters/zopfli_exporter.rb +14 -0
- data/lib/sprockets/exporting.rb +73 -0
- data/lib/sprockets/file_reader.rb +1 -0
- data/lib/sprockets/http_utils.rb +25 -7
- data/lib/sprockets/jsminc_compressor.rb +32 -0
- data/lib/sprockets/jst_processor.rb +11 -10
- data/lib/sprockets/loader.rb +244 -62
- data/lib/sprockets/manifest.rb +100 -46
- data/lib/sprockets/manifest_utils.rb +9 -6
- data/lib/sprockets/mime.rb +8 -42
- data/lib/sprockets/npm.rb +52 -0
- data/lib/sprockets/path_dependency_utils.rb +3 -11
- data/lib/sprockets/path_digest_utils.rb +2 -1
- data/lib/sprockets/path_utils.rb +107 -22
- data/lib/sprockets/paths.rb +1 -0
- data/lib/sprockets/preprocessors/default_source_map.rb +49 -0
- data/lib/sprockets/processing.rb +32 -52
- data/lib/sprockets/processor_utils.rb +38 -39
- data/lib/sprockets/resolve.rb +177 -97
- data/lib/sprockets/sass_cache_store.rb +1 -0
- data/lib/sprockets/sass_compressor.rb +21 -17
- data/lib/sprockets/sass_functions.rb +1 -0
- data/lib/sprockets/sass_importer.rb +1 -0
- data/lib/sprockets/sass_processor.rb +46 -18
- data/lib/sprockets/sassc_compressor.rb +56 -0
- data/lib/sprockets/sassc_processor.rb +297 -0
- data/lib/sprockets/server.rb +77 -44
- data/lib/sprockets/source_map_processor.rb +66 -0
- data/lib/sprockets/source_map_utils.rb +483 -0
- data/lib/sprockets/transformers.rb +63 -35
- data/lib/sprockets/uglifier_compressor.rb +23 -20
- data/lib/sprockets/unloaded_asset.rb +139 -0
- data/lib/sprockets/uri_tar.rb +99 -0
- data/lib/sprockets/uri_utils.rb +14 -14
- data/lib/sprockets/utils/gzip.rb +99 -0
- data/lib/sprockets/utils.rb +63 -71
- data/lib/sprockets/version.rb +2 -1
- data/lib/sprockets/yui_compressor.rb +5 -14
- data/lib/sprockets.rb +105 -33
- metadata +157 -27
- data/lib/sprockets/coffee_script_template.rb +0 -6
- data/lib/sprockets/eco_template.rb +0 -6
- data/lib/sprockets/ejs_template.rb +0 -6
- data/lib/sprockets/engines.rb +0 -81
- data/lib/sprockets/erb_template.rb +0 -6
- data/lib/sprockets/legacy.rb +0 -314
- data/lib/sprockets/legacy_proc_processor.rb +0 -35
- data/lib/sprockets/legacy_tilt_processor.rb +0 -29
- data/lib/sprockets/sass_template.rb +0 -7
data/lib/sprockets.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
require 'sprockets/version'
|
3
5
|
require 'sprockets/cache'
|
4
6
|
require 'sprockets/environment'
|
@@ -22,20 +24,21 @@ module Sprockets
|
|
22
24
|
dependencies: Set.new.freeze,
|
23
25
|
dependency_resolvers: {}.freeze,
|
24
26
|
digest_class: Digest::SHA256,
|
25
|
-
engine_mime_types: {}.freeze,
|
26
|
-
engines: {}.freeze,
|
27
27
|
mime_exts: {}.freeze,
|
28
28
|
mime_types: {}.freeze,
|
29
29
|
paths: [].freeze,
|
30
30
|
pipelines: {}.freeze,
|
31
|
+
pipeline_exts: {}.freeze,
|
31
32
|
postprocessors: Hash.new { |h, k| [].freeze }.freeze,
|
32
33
|
preprocessors: Hash.new { |h, k| [].freeze }.freeze,
|
33
|
-
registered_transformers:
|
34
|
-
root:
|
34
|
+
registered_transformers: [].freeze,
|
35
|
+
root: __dir__.dup.freeze,
|
35
36
|
transformers: Hash.new { |h, k| {}.freeze }.freeze,
|
36
|
-
|
37
|
+
exporters: Hash.new { |h, k| Set.new.freeze }.freeze,
|
38
|
+
version: "",
|
39
|
+
gzip_enabled: true,
|
40
|
+
export_concurrent: true
|
37
41
|
}.freeze
|
38
|
-
self.computed_config = {}
|
39
42
|
|
40
43
|
@context_class = Context
|
41
44
|
|
@@ -46,7 +49,9 @@ module Sprockets
|
|
46
49
|
# Common asset text types
|
47
50
|
register_mime_type 'application/javascript', extensions: ['.js'], charset: :unicode
|
48
51
|
register_mime_type 'application/json', extensions: ['.json'], charset: :unicode
|
52
|
+
register_mime_type 'application/ruby', extensions: ['.rb']
|
49
53
|
register_mime_type 'application/xml', extensions: ['.xml']
|
54
|
+
register_mime_type 'application/manifest+json', extensions: ['.webmanifest']
|
50
55
|
register_mime_type 'text/css', extensions: ['.css'], charset: :css
|
51
56
|
register_mime_type 'text/html', extensions: ['.html', '.htm'], charset: :html
|
52
57
|
register_mime_type 'text/plain', extensions: ['.txt', '.text']
|
@@ -68,83 +73,141 @@ module Sprockets
|
|
68
73
|
register_mime_type 'audio/aiff', extensions: ['.aiff']
|
69
74
|
register_mime_type 'audio/mpeg', extensions: ['.mp3', '.mp2', '.m2a', '.m3a']
|
70
75
|
register_mime_type 'application/ogg', extensions: ['.ogx']
|
76
|
+
register_mime_type 'audio/ogg', extensions: ['.ogg', '.oga']
|
71
77
|
register_mime_type 'audio/midi', extensions: ['.midi', '.mid']
|
72
78
|
register_mime_type 'video/avi', extensions: ['.avi']
|
73
79
|
register_mime_type 'audio/wave', extensions: ['.wav', '.wave']
|
74
80
|
register_mime_type 'video/mp4', extensions: ['.mp4', '.m4v']
|
81
|
+
register_mime_type 'audio/aac', extensions: ['.aac']
|
82
|
+
register_mime_type 'audio/mp4', extensions: ['.m4a']
|
83
|
+
register_mime_type 'audio/flac', extensions: ['.flac']
|
75
84
|
|
76
85
|
# Common font types
|
77
86
|
register_mime_type 'application/vnd.ms-fontobject', extensions: ['.eot']
|
87
|
+
register_mime_type 'application/x-font-opentype', extensions: ['.otf']
|
78
88
|
register_mime_type 'application/x-font-ttf', extensions: ['.ttf']
|
79
89
|
register_mime_type 'application/font-woff', extensions: ['.woff']
|
90
|
+
register_mime_type 'application/font-woff2', extensions: ['.woff2']
|
91
|
+
|
92
|
+
require 'sprockets/source_map_processor'
|
93
|
+
register_mime_type 'application/js-sourcemap+json', extensions: ['.js.map'], charset: :unicode
|
94
|
+
register_mime_type 'application/css-sourcemap+json', extensions: ['.css.map']
|
95
|
+
register_transformer 'application/javascript', 'application/js-sourcemap+json', SourceMapProcessor
|
96
|
+
register_transformer 'text/css', 'application/css-sourcemap+json', SourceMapProcessor
|
80
97
|
|
81
98
|
register_pipeline :source do |env|
|
82
99
|
[]
|
83
100
|
end
|
84
101
|
|
85
|
-
register_pipeline :self do |env, type, file_type
|
86
|
-
env.self_processors_for(type, file_type
|
102
|
+
register_pipeline :self do |env, type, file_type|
|
103
|
+
env.self_processors_for(type, file_type)
|
87
104
|
end
|
88
105
|
|
89
|
-
register_pipeline :default do |env, type, file_type
|
90
|
-
env.default_processors_for(type, file_type
|
106
|
+
register_pipeline :default do |env, type, file_type|
|
107
|
+
env.default_processors_for(type, file_type)
|
108
|
+
end
|
109
|
+
|
110
|
+
require 'sprockets/add_source_map_comment_to_asset_processor'
|
111
|
+
register_pipeline :debug do
|
112
|
+
[AddSourceMapCommentToAssetProcessor]
|
91
113
|
end
|
92
114
|
|
93
115
|
require 'sprockets/directive_processor'
|
94
|
-
register_preprocessor 'text/css', DirectiveProcessor.new(
|
95
|
-
|
96
|
-
)
|
97
|
-
register_preprocessor 'application/javascript', DirectiveProcessor.new(
|
98
|
-
comments: ["//", ["/*", "*/"]] + ["#", ["###", "###"]]
|
99
|
-
)
|
116
|
+
register_preprocessor 'text/css', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
117
|
+
register_preprocessor 'application/javascript', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
100
118
|
|
101
119
|
require 'sprockets/bundle'
|
102
120
|
register_bundle_processor 'application/javascript', Bundle
|
103
121
|
register_bundle_processor 'text/css', Bundle
|
104
122
|
|
105
|
-
register_bundle_metadata_reducer '*/*', :data, proc { "" }, :concat
|
106
|
-
register_bundle_metadata_reducer 'application/javascript', :data, proc { "" }, Utils.method(:concat_javascript_sources)
|
123
|
+
register_bundle_metadata_reducer '*/*', :data, proc { +"" }, :concat
|
124
|
+
register_bundle_metadata_reducer 'application/javascript', :data, proc { +"" }, Utils.method(:concat_javascript_sources)
|
107
125
|
register_bundle_metadata_reducer '*/*', :links, :+
|
126
|
+
register_bundle_metadata_reducer '*/*', :sources, proc { [] }, :+
|
108
127
|
|
109
128
|
require 'sprockets/closure_compressor'
|
110
129
|
require 'sprockets/sass_compressor'
|
130
|
+
require 'sprockets/sassc_compressor'
|
131
|
+
require 'sprockets/jsminc_compressor'
|
111
132
|
require 'sprockets/uglifier_compressor'
|
112
133
|
require 'sprockets/yui_compressor'
|
113
134
|
register_compressor 'text/css', :sass, SassCompressor
|
135
|
+
register_compressor 'text/css', :sassc, SasscCompressor
|
114
136
|
register_compressor 'text/css', :scss, SassCompressor
|
137
|
+
register_compressor 'text/css', :scssc, SasscCompressor
|
115
138
|
register_compressor 'text/css', :yui, YUICompressor
|
116
139
|
register_compressor 'application/javascript', :closure, ClosureCompressor
|
140
|
+
register_compressor 'application/javascript', :jsmin, JSMincCompressor
|
141
|
+
register_compressor 'application/javascript', :jsminc, JSMincCompressor
|
117
142
|
register_compressor 'application/javascript', :uglifier, UglifierCompressor
|
118
143
|
register_compressor 'application/javascript', :uglify, UglifierCompressor
|
119
144
|
register_compressor 'application/javascript', :yui, YUICompressor
|
120
145
|
|
146
|
+
# Babel, TheFuture™ is now
|
147
|
+
require 'sprockets/babel_processor'
|
148
|
+
register_mime_type 'application/ecmascript-6', extensions: ['.es6'], charset: :unicode
|
149
|
+
register_transformer 'application/ecmascript-6', 'application/javascript', BabelProcessor
|
150
|
+
register_preprocessor 'application/ecmascript-6', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
151
|
+
|
121
152
|
# Mmm, CoffeeScript
|
122
153
|
require 'sprockets/coffee_script_processor'
|
123
|
-
|
154
|
+
register_mime_type 'text/coffeescript', extensions: ['.coffee', '.js.coffee']
|
155
|
+
register_transformer 'text/coffeescript', 'application/javascript', CoffeeScriptProcessor
|
156
|
+
register_preprocessor 'text/coffeescript', DirectiveProcessor.new(comments: ["#", ["###", "###"]])
|
124
157
|
|
125
|
-
# JST
|
158
|
+
# JST processors
|
126
159
|
require 'sprockets/eco_processor'
|
127
160
|
require 'sprockets/ejs_processor'
|
128
161
|
require 'sprockets/jst_processor'
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
162
|
+
register_mime_type 'text/eco', extensions: ['.eco', '.jst.eco']
|
163
|
+
register_mime_type 'text/ejs', extensions: ['.ejs', '.jst.ejs']
|
164
|
+
register_transformer 'text/eco', 'application/javascript+function', EcoProcessor
|
165
|
+
register_transformer 'text/ejs', 'application/javascript+function', EjsProcessor
|
166
|
+
register_transformer 'application/javascript+function', 'application/javascript', JstProcessor
|
167
|
+
|
168
|
+
# CSS processors
|
169
|
+
require 'sprockets/sassc_processor'
|
170
|
+
register_mime_type 'text/sass', extensions: ['.sass', '.css.sass']
|
171
|
+
register_mime_type 'text/scss', extensions: ['.scss', '.css.scss']
|
172
|
+
register_transformer 'text/sass', 'text/css', SasscProcessor
|
173
|
+
register_transformer 'text/scss', 'text/css', ScsscProcessor
|
174
|
+
register_preprocessor 'text/sass', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
175
|
+
register_preprocessor 'text/scss', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
137
176
|
register_bundle_metadata_reducer 'text/css', :sass_dependencies, Set.new, :+
|
138
177
|
|
139
|
-
#
|
178
|
+
# ERB
|
140
179
|
require 'sprockets/erb_processor'
|
141
|
-
|
180
|
+
register_transformer_suffix(%w(
|
181
|
+
application/ecmascript-6
|
182
|
+
application/javascript
|
183
|
+
application/json
|
184
|
+
application/manifest+json
|
185
|
+
application/xml
|
186
|
+
text/coffeescript
|
187
|
+
text/css
|
188
|
+
text/html
|
189
|
+
text/plain
|
190
|
+
text/sass
|
191
|
+
text/scss
|
192
|
+
text/yaml
|
193
|
+
text/eco
|
194
|
+
text/ejs
|
195
|
+
), 'application/\2+ruby', '.erb', ERBProcessor)
|
196
|
+
|
197
|
+
register_mime_type 'application/html+ruby', extensions: ['.html.erb', '.erb', '.rhtml'], charset: :html
|
198
|
+
register_mime_type 'application/xml+ruby', extensions: ['.xml.erb', '.rxml']
|
199
|
+
|
200
|
+
require 'sprockets/exporters/file_exporter'
|
201
|
+
require 'sprockets/exporters/zlib_exporter'
|
202
|
+
require 'sprockets/exporters/zopfli_exporter'
|
203
|
+
register_exporter '*/*', Exporters::FileExporter
|
204
|
+
register_exporter '*/*', Exporters::ZlibExporter
|
142
205
|
|
143
206
|
register_dependency_resolver 'environment-version' do |env|
|
144
207
|
env.version
|
145
208
|
end
|
146
209
|
register_dependency_resolver 'environment-paths' do |env|
|
147
|
-
env.paths
|
210
|
+
env.paths.map {|path| env.compress_from_root(path) }
|
148
211
|
end
|
149
212
|
register_dependency_resolver 'file-digest' do |env, str|
|
150
213
|
env.file_digest(env.parse_file_digest_uri(str))
|
@@ -152,9 +215,18 @@ module Sprockets
|
|
152
215
|
register_dependency_resolver 'processors' do |env, str|
|
153
216
|
env.resolve_processors_cache_key_uri(str)
|
154
217
|
end
|
218
|
+
register_dependency_resolver 'env' do |env, str|
|
219
|
+
_, var = str.split(':', 2)
|
220
|
+
ENV[var]
|
221
|
+
end
|
155
222
|
|
156
223
|
depend_on 'environment-version'
|
157
224
|
depend_on 'environment-paths'
|
158
|
-
end
|
159
225
|
|
160
|
-
require 'sprockets/
|
226
|
+
require 'sprockets/preprocessors/default_source_map'
|
227
|
+
register_preprocessor 'text/css', Preprocessors::DefaultSourceMap.new
|
228
|
+
register_preprocessor 'application/javascript', Preprocessors::DefaultSourceMap.new
|
229
|
+
|
230
|
+
register_bundle_metadata_reducer 'text/css', :map, proc { |input| { "version" => 3, "file" => PathUtils.split_subpath(input[:load_path], input[:filename]), "sections" => [] } }, SourceMapUtils.method(:concat_source_maps)
|
231
|
+
register_bundle_metadata_reducer 'application/javascript', :map, proc { |input| { "version" => 3, "file" => PathUtils.split_subpath(input[:load_path], input[:filename]), "sections" => [] } }, SourceMapUtils.method(:concat_source_maps)
|
232
|
+
end
|
metadata
CHANGED
@@ -1,18 +1,38 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
8
8
|
- Joshua Peek
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2022-12-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rack
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 2.2.4
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '4'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ">="
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: 2.2.4
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4'
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: concurrent-ruby
|
16
36
|
requirement: !ruby/object:Gem::Requirement
|
17
37
|
requirements:
|
18
38
|
- - "~>"
|
@@ -25,6 +45,34 @@ dependencies:
|
|
25
45
|
- - "~>"
|
26
46
|
- !ruby/object:Gem::Version
|
27
47
|
version: '1.0'
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: m
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
type: :development
|
56
|
+
prerelease: false
|
57
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: babel-transpiler
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.6'
|
69
|
+
type: :development
|
70
|
+
prerelease: false
|
71
|
+
version_requirements: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.6'
|
28
76
|
- !ruby/object:Gem::Dependency
|
29
77
|
name: closure-compiler
|
30
78
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,6 +157,34 @@ dependencies:
|
|
109
157
|
- - "~>"
|
110
158
|
- !ruby/object:Gem::Version
|
111
159
|
version: '2.0'
|
160
|
+
- !ruby/object:Gem::Dependency
|
161
|
+
name: jsminc
|
162
|
+
requirement: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '1.1'
|
167
|
+
type: :development
|
168
|
+
prerelease: false
|
169
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '1.1'
|
174
|
+
- !ruby/object:Gem::Dependency
|
175
|
+
name: timecop
|
176
|
+
requirement: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: 0.9.1
|
181
|
+
type: :development
|
182
|
+
prerelease: false
|
183
|
+
version_requirements: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: 0.9.1
|
112
188
|
- !ruby/object:Gem::Dependency
|
113
189
|
name: minitest
|
114
190
|
requirement: !ruby/object:Gem::Requirement
|
@@ -143,54 +219,68 @@ dependencies:
|
|
143
219
|
requirements:
|
144
220
|
- - "~>"
|
145
221
|
- !ruby/object:Gem::Version
|
146
|
-
version:
|
222
|
+
version: 2.0.0
|
147
223
|
type: :development
|
148
224
|
prerelease: false
|
149
225
|
version_requirements: !ruby/object:Gem::Requirement
|
150
226
|
requirements:
|
151
227
|
- - "~>"
|
152
228
|
- !ruby/object:Gem::Version
|
153
|
-
version:
|
229
|
+
version: 2.0.0
|
154
230
|
- !ruby/object:Gem::Dependency
|
155
231
|
name: rake
|
156
232
|
requirement: !ruby/object:Gem::Requirement
|
157
233
|
requirements:
|
158
234
|
- - "~>"
|
159
235
|
- !ruby/object:Gem::Version
|
160
|
-
version: '
|
236
|
+
version: '12.0'
|
161
237
|
type: :development
|
162
238
|
prerelease: false
|
163
239
|
version_requirements: !ruby/object:Gem::Requirement
|
164
240
|
requirements:
|
165
241
|
- - "~>"
|
166
242
|
- !ruby/object:Gem::Version
|
167
|
-
version: '
|
243
|
+
version: '12.0'
|
168
244
|
- !ruby/object:Gem::Dependency
|
169
245
|
name: sass
|
170
246
|
requirement: !ruby/object:Gem::Requirement
|
171
247
|
requirements:
|
172
248
|
- - "~>"
|
173
249
|
- !ruby/object:Gem::Version
|
174
|
-
version: '3.
|
250
|
+
version: '3.4'
|
175
251
|
type: :development
|
176
252
|
prerelease: false
|
177
253
|
version_requirements: !ruby/object:Gem::Requirement
|
178
254
|
requirements:
|
179
255
|
- - "~>"
|
180
256
|
- !ruby/object:Gem::Version
|
181
|
-
version: '3.
|
257
|
+
version: '3.4'
|
182
258
|
- !ruby/object:Gem::Dependency
|
183
|
-
name:
|
259
|
+
name: sassc
|
184
260
|
requirement: !ruby/object:Gem::Requirement
|
185
261
|
requirements:
|
186
262
|
- - "~>"
|
187
263
|
- !ruby/object:Gem::Version
|
188
|
-
version: '2.
|
264
|
+
version: '2.0'
|
189
265
|
type: :development
|
190
266
|
prerelease: false
|
191
267
|
version_requirements: !ruby/object:Gem::Requirement
|
192
268
|
requirements:
|
193
269
|
- - "~>"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '2.0'
|
272
|
+
- !ruby/object:Gem::Dependency
|
273
|
+
name: uglifier
|
274
|
+
requirement: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - ">="
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '2.3'
|
279
|
+
type: :development
|
280
|
+
prerelease: false
|
281
|
+
version_requirements: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - ">="
|
194
284
|
- !ruby/object:Gem::Version
|
195
285
|
version: '2.3'
|
196
286
|
- !ruby/object:Gem::Dependency
|
@@ -207,8 +297,36 @@ dependencies:
|
|
207
297
|
- - "~>"
|
208
298
|
- !ruby/object:Gem::Version
|
209
299
|
version: '0.12'
|
300
|
+
- !ruby/object:Gem::Dependency
|
301
|
+
name: zopfli
|
302
|
+
requirement: !ruby/object:Gem::Requirement
|
303
|
+
requirements:
|
304
|
+
- - "~>"
|
305
|
+
- !ruby/object:Gem::Version
|
306
|
+
version: 0.0.4
|
307
|
+
type: :development
|
308
|
+
prerelease: false
|
309
|
+
version_requirements: !ruby/object:Gem::Requirement
|
310
|
+
requirements:
|
311
|
+
- - "~>"
|
312
|
+
- !ruby/object:Gem::Version
|
313
|
+
version: 0.0.4
|
314
|
+
- !ruby/object:Gem::Dependency
|
315
|
+
name: rubocop-performance
|
316
|
+
requirement: !ruby/object:Gem::Requirement
|
317
|
+
requirements:
|
318
|
+
- - "~>"
|
319
|
+
- !ruby/object:Gem::Version
|
320
|
+
version: '1.3'
|
321
|
+
type: :development
|
322
|
+
prerelease: false
|
323
|
+
version_requirements: !ruby/object:Gem::Requirement
|
324
|
+
requirements:
|
325
|
+
- - "~>"
|
326
|
+
- !ruby/object:Gem::Version
|
327
|
+
version: '1.3'
|
210
328
|
description: Sprockets is a Rack-based asset packaging system that concatenates and
|
211
|
-
serves JavaScript, CoffeeScript, CSS,
|
329
|
+
serves JavaScript, CoffeeScript, CSS, Sass, and SCSS.
|
212
330
|
email:
|
213
331
|
- sstephenson@gmail.com
|
214
332
|
- josh@joshpeek.com
|
@@ -217,20 +335,27 @@ executables:
|
|
217
335
|
extensions: []
|
218
336
|
extra_rdoc_files: []
|
219
337
|
files:
|
220
|
-
-
|
338
|
+
- CHANGELOG.md
|
339
|
+
- MIT-LICENSE
|
221
340
|
- README.md
|
222
341
|
- bin/sprockets
|
223
342
|
- lib/rake/sprocketstask.rb
|
224
343
|
- lib/sprockets.rb
|
344
|
+
- lib/sprockets/add_source_map_comment_to_asset_processor.rb
|
225
345
|
- lib/sprockets/asset.rb
|
226
346
|
- lib/sprockets/autoload.rb
|
347
|
+
- lib/sprockets/autoload/babel.rb
|
227
348
|
- lib/sprockets/autoload/closure.rb
|
228
349
|
- lib/sprockets/autoload/coffee_script.rb
|
229
350
|
- lib/sprockets/autoload/eco.rb
|
230
351
|
- lib/sprockets/autoload/ejs.rb
|
352
|
+
- lib/sprockets/autoload/jsminc.rb
|
231
353
|
- lib/sprockets/autoload/sass.rb
|
354
|
+
- lib/sprockets/autoload/sassc.rb
|
232
355
|
- lib/sprockets/autoload/uglifier.rb
|
233
356
|
- lib/sprockets/autoload/yui.rb
|
357
|
+
- lib/sprockets/autoload/zopfli.rb
|
358
|
+
- lib/sprockets/babel_processor.rb
|
234
359
|
- lib/sprockets/base.rb
|
235
360
|
- lib/sprockets/bower.rb
|
236
361
|
- lib/sprockets/bundle.rb
|
@@ -241,7 +366,6 @@ files:
|
|
241
366
|
- lib/sprockets/cached_environment.rb
|
242
367
|
- lib/sprockets/closure_compressor.rb
|
243
368
|
- lib/sprockets/coffee_script_processor.rb
|
244
|
-
- lib/sprockets/coffee_script_template.rb
|
245
369
|
- lib/sprockets/compressing.rb
|
246
370
|
- lib/sprockets/configuration.rb
|
247
371
|
- lib/sprockets/context.rb
|
@@ -249,29 +373,30 @@ files:
|
|
249
373
|
- lib/sprockets/digest_utils.rb
|
250
374
|
- lib/sprockets/directive_processor.rb
|
251
375
|
- lib/sprockets/eco_processor.rb
|
252
|
-
- lib/sprockets/eco_template.rb
|
253
376
|
- lib/sprockets/ejs_processor.rb
|
254
|
-
- lib/sprockets/ejs_template.rb
|
255
377
|
- lib/sprockets/encoding_utils.rb
|
256
|
-
- lib/sprockets/engines.rb
|
257
378
|
- lib/sprockets/environment.rb
|
258
379
|
- lib/sprockets/erb_processor.rb
|
259
|
-
- lib/sprockets/erb_template.rb
|
260
380
|
- lib/sprockets/errors.rb
|
381
|
+
- lib/sprockets/exporters/base.rb
|
382
|
+
- lib/sprockets/exporters/file_exporter.rb
|
383
|
+
- lib/sprockets/exporters/zlib_exporter.rb
|
384
|
+
- lib/sprockets/exporters/zopfli_exporter.rb
|
385
|
+
- lib/sprockets/exporting.rb
|
261
386
|
- lib/sprockets/file_reader.rb
|
262
387
|
- lib/sprockets/http_utils.rb
|
388
|
+
- lib/sprockets/jsminc_compressor.rb
|
263
389
|
- lib/sprockets/jst_processor.rb
|
264
|
-
- lib/sprockets/legacy.rb
|
265
|
-
- lib/sprockets/legacy_proc_processor.rb
|
266
|
-
- lib/sprockets/legacy_tilt_processor.rb
|
267
390
|
- lib/sprockets/loader.rb
|
268
391
|
- lib/sprockets/manifest.rb
|
269
392
|
- lib/sprockets/manifest_utils.rb
|
270
393
|
- lib/sprockets/mime.rb
|
394
|
+
- lib/sprockets/npm.rb
|
271
395
|
- lib/sprockets/path_dependency_utils.rb
|
272
396
|
- lib/sprockets/path_digest_utils.rb
|
273
397
|
- lib/sprockets/path_utils.rb
|
274
398
|
- lib/sprockets/paths.rb
|
399
|
+
- lib/sprockets/preprocessors/default_source_map.rb
|
275
400
|
- lib/sprockets/processing.rb
|
276
401
|
- lib/sprockets/processor_utils.rb
|
277
402
|
- lib/sprockets/resolve.rb
|
@@ -280,19 +405,25 @@ files:
|
|
280
405
|
- lib/sprockets/sass_functions.rb
|
281
406
|
- lib/sprockets/sass_importer.rb
|
282
407
|
- lib/sprockets/sass_processor.rb
|
283
|
-
- lib/sprockets/
|
408
|
+
- lib/sprockets/sassc_compressor.rb
|
409
|
+
- lib/sprockets/sassc_processor.rb
|
284
410
|
- lib/sprockets/server.rb
|
411
|
+
- lib/sprockets/source_map_processor.rb
|
412
|
+
- lib/sprockets/source_map_utils.rb
|
285
413
|
- lib/sprockets/transformers.rb
|
286
414
|
- lib/sprockets/uglifier_compressor.rb
|
415
|
+
- lib/sprockets/unloaded_asset.rb
|
416
|
+
- lib/sprockets/uri_tar.rb
|
287
417
|
- lib/sprockets/uri_utils.rb
|
288
418
|
- lib/sprockets/utils.rb
|
419
|
+
- lib/sprockets/utils/gzip.rb
|
289
420
|
- lib/sprockets/version.rb
|
290
421
|
- lib/sprockets/yui_compressor.rb
|
291
422
|
homepage: https://github.com/rails/sprockets
|
292
423
|
licenses:
|
293
424
|
- MIT
|
294
425
|
metadata: {}
|
295
|
-
post_install_message:
|
426
|
+
post_install_message:
|
296
427
|
rdoc_options: []
|
297
428
|
require_paths:
|
298
429
|
- lib
|
@@ -300,16 +431,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
300
431
|
requirements:
|
301
432
|
- - ">="
|
302
433
|
- !ruby/object:Gem::Version
|
303
|
-
version:
|
434
|
+
version: 2.5.0
|
304
435
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
305
436
|
requirements:
|
306
437
|
- - ">="
|
307
438
|
- !ruby/object:Gem::Version
|
308
439
|
version: '0'
|
309
440
|
requirements: []
|
310
|
-
|
311
|
-
|
312
|
-
signing_key:
|
441
|
+
rubygems_version: 3.3.7
|
442
|
+
signing_key:
|
313
443
|
specification_version: 4
|
314
444
|
summary: Rack-based asset packaging system
|
315
445
|
test_files: []
|
data/lib/sprockets/engines.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
require 'sprockets/legacy_tilt_processor'
|
2
|
-
require 'sprockets/utils'
|
3
|
-
|
4
|
-
module Sprockets
|
5
|
-
# `Engines` provides a global and `Environment` instance registry.
|
6
|
-
#
|
7
|
-
# An engine is a type of processor that is bound to a filename
|
8
|
-
# extension. `application.js.coffee` indicates that the
|
9
|
-
# `CoffeeScriptProcessor` engine will be ran on the file.
|
10
|
-
#
|
11
|
-
# Extensions can be stacked and will be evaulated from right to
|
12
|
-
# left. `application.js.coffee.erb` will first run `ERBProcessor`
|
13
|
-
# then `CoffeeScriptProcessor`.
|
14
|
-
#
|
15
|
-
# All `Engine`s must follow the `Template` interface. It is
|
16
|
-
# recommended to subclass `Template`.
|
17
|
-
#
|
18
|
-
# Its recommended that you register engine changes on your local
|
19
|
-
# `Environment` instance.
|
20
|
-
#
|
21
|
-
# environment.register_engine '.foo', FooProcessor
|
22
|
-
#
|
23
|
-
# The global registry is exposed for plugins to register themselves.
|
24
|
-
#
|
25
|
-
# Sprockets.register_engine '.sass', SassProcessor
|
26
|
-
#
|
27
|
-
module Engines
|
28
|
-
include Utils
|
29
|
-
|
30
|
-
# Returns a `Hash` of `Engine`s registered on the `Environment`.
|
31
|
-
# If an `ext` argument is supplied, the `Engine` associated with
|
32
|
-
# that extension will be returned.
|
33
|
-
#
|
34
|
-
# environment.engines
|
35
|
-
# # => {".coffee" => CoffeeScriptProcessor, ".sass" => SassProcessor, ...}
|
36
|
-
#
|
37
|
-
def engines
|
38
|
-
config[:engines]
|
39
|
-
end
|
40
|
-
|
41
|
-
# Internal: Returns a `Hash` of engine extensions to mime types.
|
42
|
-
#
|
43
|
-
# # => { '.coffee' => 'application/javascript' }
|
44
|
-
def engine_mime_types
|
45
|
-
config[:engine_mime_types]
|
46
|
-
end
|
47
|
-
|
48
|
-
# Registers a new Engine `klass` for `ext`. If the `ext` already
|
49
|
-
# has an engine registered, it will be overridden.
|
50
|
-
#
|
51
|
-
# environment.register_engine '.coffee', CoffeeScriptProcessor
|
52
|
-
#
|
53
|
-
def register_engine(ext, klass, options = {})
|
54
|
-
ext = Sprockets::Utils.normalize_extension(ext)
|
55
|
-
|
56
|
-
self.computed_config = {}
|
57
|
-
|
58
|
-
if klass.respond_to?(:call)
|
59
|
-
processor = klass
|
60
|
-
self.config = hash_reassoc(config, :engines) do |engines|
|
61
|
-
engines.merge(ext => klass)
|
62
|
-
end
|
63
|
-
if options[:mime_type]
|
64
|
-
self.config = hash_reassoc(config, :engine_mime_types) do |mime_types|
|
65
|
-
mime_types.merge(ext.to_s => options[:mime_type])
|
66
|
-
end
|
67
|
-
end
|
68
|
-
else
|
69
|
-
processor = LegacyTiltProcessor.new(klass)
|
70
|
-
self.config = hash_reassoc(config, :engines) do |engines|
|
71
|
-
engines.merge(ext => processor)
|
72
|
-
end
|
73
|
-
if klass.respond_to?(:default_mime_type) && klass.default_mime_type
|
74
|
-
self.config = hash_reassoc(config, :engine_mime_types) do |mime_types|
|
75
|
-
mime_types.merge(ext.to_s => klass.default_mime_type)
|
76
|
-
end
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|