sprockets 3.0.0 → 4.0.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 +68 -0
- data/README.md +397 -408
- data/bin/sprockets +12 -7
- data/lib/rake/sprocketstask.rb +3 -2
- data/lib/sprockets/add_source_map_comment_to_asset_processor.rb +60 -0
- data/lib/sprockets/asset.rb +19 -23
- 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 +59 -11
- data/lib/sprockets/bower.rb +5 -2
- data/lib/sprockets/bundle.rb +44 -4
- data/lib/sprockets/cache/file_store.rb +32 -7
- data/lib/sprockets/cache/memory_store.rb +9 -0
- data/lib/sprockets/cache/null_store.rb +8 -0
- data/lib/sprockets/cache.rb +42 -5
- data/lib/sprockets/cached_environment.rb +14 -19
- data/lib/sprockets/closure_compressor.rb +6 -11
- data/lib/sprockets/coffee_script_processor.rb +19 -5
- data/lib/sprockets/compressing.rb +62 -2
- data/lib/sprockets/configuration.rb +3 -7
- data/lib/sprockets/context.rb +98 -23
- data/lib/sprockets/dependencies.rb +9 -8
- data/lib/sprockets/digest_utils.rb +104 -60
- data/lib/sprockets/directive_processor.rb +45 -35
- data/lib/sprockets/eco_processor.rb +3 -2
- data/lib/sprockets/ejs_processor.rb +3 -2
- data/lib/sprockets/encoding_utils.rb +8 -4
- data/lib/sprockets/environment.rb +9 -4
- data/lib/sprockets/erb_processor.rb +28 -21
- data/lib/sprockets/errors.rb +1 -1
- data/lib/sprockets/exporters/base.rb +72 -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 +26 -6
- data/lib/sprockets/jsminc_compressor.rb +32 -0
- data/lib/sprockets/jst_processor.rb +11 -10
- data/lib/sprockets/loader.rb +236 -69
- data/lib/sprockets/manifest.rb +97 -44
- 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 +106 -21
- data/lib/sprockets/paths.rb +1 -0
- data/lib/sprockets/preprocessors/default_source_map.rb +49 -0
- data/lib/sprockets/processing.rb +31 -51
- data/lib/sprockets/processor_utils.rb +81 -15
- data/lib/sprockets/resolve.rb +182 -95
- 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 +45 -17
- data/lib/sprockets/sassc_compressor.rb +56 -0
- data/lib/sprockets/sassc_processor.rb +297 -0
- data/lib/sprockets/server.rb +57 -34
- 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 +15 -14
- data/lib/sprockets/utils/gzip.rb +99 -0
- data/lib/sprockets/utils.rb +43 -59
- data/lib/sprockets/version.rb +2 -1
- data/lib/sprockets/yui_compressor.rb +5 -14
- data/lib/sprockets.rb +103 -33
- metadata +151 -22
- data/LICENSE +0 -21
- 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,3 +1,6 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
1
4
|
require 'sprockets/version'
|
2
5
|
require 'sprockets/cache'
|
3
6
|
require 'sprockets/environment'
|
@@ -21,20 +24,21 @@ module Sprockets
|
|
21
24
|
dependencies: Set.new.freeze,
|
22
25
|
dependency_resolvers: {}.freeze,
|
23
26
|
digest_class: Digest::SHA256,
|
24
|
-
engine_mime_types: {}.freeze,
|
25
|
-
engines: {}.freeze,
|
26
27
|
mime_exts: {}.freeze,
|
27
28
|
mime_types: {}.freeze,
|
28
29
|
paths: [].freeze,
|
29
30
|
pipelines: {}.freeze,
|
31
|
+
pipeline_exts: {}.freeze,
|
30
32
|
postprocessors: Hash.new { |h, k| [].freeze }.freeze,
|
31
33
|
preprocessors: Hash.new { |h, k| [].freeze }.freeze,
|
32
|
-
registered_transformers:
|
33
|
-
root:
|
34
|
+
registered_transformers: [].freeze,
|
35
|
+
root: __dir__.dup.freeze,
|
34
36
|
transformers: Hash.new { |h, k| {}.freeze }.freeze,
|
35
|
-
|
37
|
+
exporters: Hash.new { |h, k| Set.new.freeze }.freeze,
|
38
|
+
version: "",
|
39
|
+
gzip_enabled: true,
|
40
|
+
export_concurrent: true
|
36
41
|
}.freeze
|
37
|
-
self.computed_config = {}
|
38
42
|
|
39
43
|
@context_class = Context
|
40
44
|
|
@@ -45,6 +49,7 @@ module Sprockets
|
|
45
49
|
# Common asset text types
|
46
50
|
register_mime_type 'application/javascript', extensions: ['.js'], charset: :unicode
|
47
51
|
register_mime_type 'application/json', extensions: ['.json'], charset: :unicode
|
52
|
+
register_mime_type 'application/ruby', extensions: ['.rb']
|
48
53
|
register_mime_type 'application/xml', extensions: ['.xml']
|
49
54
|
register_mime_type 'text/css', extensions: ['.css'], charset: :css
|
50
55
|
register_mime_type 'text/html', extensions: ['.html', '.htm'], charset: :html
|
@@ -67,83 +72,139 @@ module Sprockets
|
|
67
72
|
register_mime_type 'audio/aiff', extensions: ['.aiff']
|
68
73
|
register_mime_type 'audio/mpeg', extensions: ['.mp3', '.mp2', '.m2a', '.m3a']
|
69
74
|
register_mime_type 'application/ogg', extensions: ['.ogx']
|
75
|
+
register_mime_type 'audio/ogg', extensions: ['.ogg', '.oga']
|
70
76
|
register_mime_type 'audio/midi', extensions: ['.midi', '.mid']
|
71
77
|
register_mime_type 'video/avi', extensions: ['.avi']
|
72
78
|
register_mime_type 'audio/wave', extensions: ['.wav', '.wave']
|
73
79
|
register_mime_type 'video/mp4', extensions: ['.mp4', '.m4v']
|
80
|
+
register_mime_type 'audio/aac', extensions: ['.aac']
|
81
|
+
register_mime_type 'audio/mp4', extensions: ['.m4a']
|
82
|
+
register_mime_type 'audio/flac', extensions: ['.flac']
|
74
83
|
|
75
84
|
# Common font types
|
76
85
|
register_mime_type 'application/vnd.ms-fontobject', extensions: ['.eot']
|
86
|
+
register_mime_type 'application/x-font-opentype', extensions: ['.otf']
|
77
87
|
register_mime_type 'application/x-font-ttf', extensions: ['.ttf']
|
78
88
|
register_mime_type 'application/font-woff', extensions: ['.woff']
|
89
|
+
register_mime_type 'application/font-woff2', extensions: ['.woff2']
|
90
|
+
|
91
|
+
require 'sprockets/source_map_processor'
|
92
|
+
register_mime_type 'application/js-sourcemap+json', extensions: ['.js.map']
|
93
|
+
register_mime_type 'application/css-sourcemap+json', extensions: ['.css.map']
|
94
|
+
register_transformer 'application/javascript', 'application/js-sourcemap+json', SourceMapProcessor
|
95
|
+
register_transformer 'text/css', 'application/css-sourcemap+json', SourceMapProcessor
|
79
96
|
|
80
97
|
register_pipeline :source do |env|
|
81
98
|
[]
|
82
99
|
end
|
83
100
|
|
84
|
-
register_pipeline :self do |env, type, file_type
|
85
|
-
env.self_processors_for(type, file_type
|
101
|
+
register_pipeline :self do |env, type, file_type|
|
102
|
+
env.self_processors_for(type, file_type)
|
86
103
|
end
|
87
104
|
|
88
|
-
register_pipeline :default do |env, type, file_type
|
89
|
-
env.default_processors_for(type, file_type
|
105
|
+
register_pipeline :default do |env, type, file_type|
|
106
|
+
env.default_processors_for(type, file_type)
|
107
|
+
end
|
108
|
+
|
109
|
+
require 'sprockets/add_source_map_comment_to_asset_processor'
|
110
|
+
register_pipeline :debug do
|
111
|
+
[AddSourceMapCommentToAssetProcessor]
|
90
112
|
end
|
91
113
|
|
92
114
|
require 'sprockets/directive_processor'
|
93
|
-
register_preprocessor 'text/css', DirectiveProcessor.new(
|
94
|
-
|
95
|
-
)
|
96
|
-
register_preprocessor 'application/javascript', DirectiveProcessor.new(
|
97
|
-
comments: ["//", ["/*", "*/"]] + ["#", ["###", "###"]]
|
98
|
-
)
|
115
|
+
register_preprocessor 'text/css', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
116
|
+
register_preprocessor 'application/javascript', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
99
117
|
|
100
118
|
require 'sprockets/bundle'
|
101
119
|
register_bundle_processor 'application/javascript', Bundle
|
102
120
|
register_bundle_processor 'text/css', Bundle
|
103
121
|
|
104
|
-
register_bundle_metadata_reducer '*/*', :data,
|
105
|
-
register_bundle_metadata_reducer 'application/javascript', :data, Utils.method(:concat_javascript_sources)
|
122
|
+
register_bundle_metadata_reducer '*/*', :data, proc { +"" }, :concat
|
123
|
+
register_bundle_metadata_reducer 'application/javascript', :data, proc { +"" }, Utils.method(:concat_javascript_sources)
|
106
124
|
register_bundle_metadata_reducer '*/*', :links, :+
|
125
|
+
register_bundle_metadata_reducer '*/*', :sources, proc { [] }, :+
|
107
126
|
|
108
127
|
require 'sprockets/closure_compressor'
|
109
128
|
require 'sprockets/sass_compressor'
|
129
|
+
require 'sprockets/sassc_compressor'
|
130
|
+
require 'sprockets/jsminc_compressor'
|
110
131
|
require 'sprockets/uglifier_compressor'
|
111
132
|
require 'sprockets/yui_compressor'
|
112
133
|
register_compressor 'text/css', :sass, SassCompressor
|
134
|
+
register_compressor 'text/css', :sassc, SasscCompressor
|
113
135
|
register_compressor 'text/css', :scss, SassCompressor
|
136
|
+
register_compressor 'text/css', :scssc, SasscCompressor
|
114
137
|
register_compressor 'text/css', :yui, YUICompressor
|
115
138
|
register_compressor 'application/javascript', :closure, ClosureCompressor
|
139
|
+
register_compressor 'application/javascript', :jsmin, JSMincCompressor
|
140
|
+
register_compressor 'application/javascript', :jsminc, JSMincCompressor
|
116
141
|
register_compressor 'application/javascript', :uglifier, UglifierCompressor
|
117
142
|
register_compressor 'application/javascript', :uglify, UglifierCompressor
|
118
143
|
register_compressor 'application/javascript', :yui, YUICompressor
|
119
144
|
|
145
|
+
# Babel, TheFuture™ is now
|
146
|
+
require 'sprockets/babel_processor'
|
147
|
+
register_mime_type 'application/ecmascript-6', extensions: ['.es6'], charset: :unicode
|
148
|
+
register_transformer 'application/ecmascript-6', 'application/javascript', BabelProcessor
|
149
|
+
register_preprocessor 'application/ecmascript-6', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
150
|
+
|
120
151
|
# Mmm, CoffeeScript
|
121
152
|
require 'sprockets/coffee_script_processor'
|
122
|
-
|
153
|
+
register_mime_type 'text/coffeescript', extensions: ['.coffee', '.js.coffee']
|
154
|
+
register_transformer 'text/coffeescript', 'application/javascript', CoffeeScriptProcessor
|
155
|
+
register_preprocessor 'text/coffeescript', DirectiveProcessor.new(comments: ["#", ["###", "###"]])
|
123
156
|
|
124
|
-
# JST
|
157
|
+
# JST processors
|
125
158
|
require 'sprockets/eco_processor'
|
126
159
|
require 'sprockets/ejs_processor'
|
127
160
|
require 'sprockets/jst_processor'
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
161
|
+
register_mime_type 'text/eco', extensions: ['.eco', '.jst.eco']
|
162
|
+
register_mime_type 'text/ejs', extensions: ['.ejs', '.jst.ejs']
|
163
|
+
register_transformer 'text/eco', 'application/javascript+function', EcoProcessor
|
164
|
+
register_transformer 'text/ejs', 'application/javascript+function', EjsProcessor
|
165
|
+
register_transformer 'application/javascript+function', 'application/javascript', JstProcessor
|
166
|
+
|
167
|
+
# CSS processors
|
168
|
+
require 'sprockets/sassc_processor'
|
169
|
+
register_mime_type 'text/sass', extensions: ['.sass', '.css.sass']
|
170
|
+
register_mime_type 'text/scss', extensions: ['.scss', '.css.scss']
|
171
|
+
register_transformer 'text/sass', 'text/css', SasscProcessor
|
172
|
+
register_transformer 'text/scss', 'text/css', ScsscProcessor
|
173
|
+
register_preprocessor 'text/sass', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
174
|
+
register_preprocessor 'text/scss', DirectiveProcessor.new(comments: ["//", ["/*", "*/"]])
|
136
175
|
register_bundle_metadata_reducer 'text/css', :sass_dependencies, Set.new, :+
|
137
176
|
|
138
|
-
#
|
177
|
+
# ERB
|
139
178
|
require 'sprockets/erb_processor'
|
140
|
-
|
179
|
+
register_transformer_suffix(%w(
|
180
|
+
application/ecmascript-6
|
181
|
+
application/javascript
|
182
|
+
application/json
|
183
|
+
application/xml
|
184
|
+
text/coffeescript
|
185
|
+
text/css
|
186
|
+
text/html
|
187
|
+
text/plain
|
188
|
+
text/sass
|
189
|
+
text/scss
|
190
|
+
text/yaml
|
191
|
+
text/eco
|
192
|
+
), 'application/\2+ruby', '.erb', ERBProcessor)
|
193
|
+
|
194
|
+
register_mime_type 'application/html+ruby', extensions: ['.html.erb', '.erb', '.rhtml'], charset: :html
|
195
|
+
register_mime_type 'application/xml+ruby', extensions: ['.xml.erb', '.rxml']
|
196
|
+
|
197
|
+
require 'sprockets/exporters/file_exporter'
|
198
|
+
require 'sprockets/exporters/zlib_exporter'
|
199
|
+
require 'sprockets/exporters/zopfli_exporter'
|
200
|
+
register_exporter '*/*', Exporters::FileExporter
|
201
|
+
register_exporter '*/*', Exporters::ZlibExporter
|
141
202
|
|
142
203
|
register_dependency_resolver 'environment-version' do |env|
|
143
204
|
env.version
|
144
205
|
end
|
145
206
|
register_dependency_resolver 'environment-paths' do |env|
|
146
|
-
env.paths
|
207
|
+
env.paths.map {|path| env.compress_from_root(path) }
|
147
208
|
end
|
148
209
|
register_dependency_resolver 'file-digest' do |env, str|
|
149
210
|
env.file_digest(env.parse_file_digest_uri(str))
|
@@ -151,9 +212,18 @@ module Sprockets
|
|
151
212
|
register_dependency_resolver 'processors' do |env, str|
|
152
213
|
env.resolve_processors_cache_key_uri(str)
|
153
214
|
end
|
215
|
+
register_dependency_resolver 'env' do |env, str|
|
216
|
+
_, var = str.split(':', 2)
|
217
|
+
ENV[var]
|
218
|
+
end
|
154
219
|
|
155
220
|
depend_on 'environment-version'
|
156
221
|
depend_on 'environment-paths'
|
157
|
-
end
|
158
222
|
|
159
|
-
require 'sprockets/
|
223
|
+
require 'sprockets/preprocessors/default_source_map'
|
224
|
+
register_preprocessor 'text/css', Preprocessors::DefaultSourceMap.new
|
225
|
+
register_preprocessor 'application/javascript', Preprocessors::DefaultSourceMap.new
|
226
|
+
|
227
|
+
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)
|
228
|
+
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)
|
229
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sprockets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Stephenson
|
@@ -9,10 +9,30 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2019-10-08 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: '1'
|
21
|
+
- - "<"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '3'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - ">"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '1'
|
31
|
+
- - "<"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3'
|
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
|
@@ -157,40 +233,54 @@ dependencies:
|
|
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,26 @@ executables:
|
|
217
335
|
extensions: []
|
218
336
|
extra_rdoc_files: []
|
219
337
|
files:
|
220
|
-
-
|
338
|
+
- CHANGELOG.md
|
221
339
|
- README.md
|
222
340
|
- bin/sprockets
|
223
341
|
- lib/rake/sprocketstask.rb
|
224
342
|
- lib/sprockets.rb
|
343
|
+
- lib/sprockets/add_source_map_comment_to_asset_processor.rb
|
225
344
|
- lib/sprockets/asset.rb
|
226
345
|
- lib/sprockets/autoload.rb
|
346
|
+
- lib/sprockets/autoload/babel.rb
|
227
347
|
- lib/sprockets/autoload/closure.rb
|
228
348
|
- lib/sprockets/autoload/coffee_script.rb
|
229
349
|
- lib/sprockets/autoload/eco.rb
|
230
350
|
- lib/sprockets/autoload/ejs.rb
|
351
|
+
- lib/sprockets/autoload/jsminc.rb
|
231
352
|
- lib/sprockets/autoload/sass.rb
|
353
|
+
- lib/sprockets/autoload/sassc.rb
|
232
354
|
- lib/sprockets/autoload/uglifier.rb
|
233
355
|
- lib/sprockets/autoload/yui.rb
|
356
|
+
- lib/sprockets/autoload/zopfli.rb
|
357
|
+
- lib/sprockets/babel_processor.rb
|
234
358
|
- lib/sprockets/base.rb
|
235
359
|
- lib/sprockets/bower.rb
|
236
360
|
- lib/sprockets/bundle.rb
|
@@ -241,7 +365,6 @@ files:
|
|
241
365
|
- lib/sprockets/cached_environment.rb
|
242
366
|
- lib/sprockets/closure_compressor.rb
|
243
367
|
- lib/sprockets/coffee_script_processor.rb
|
244
|
-
- lib/sprockets/coffee_script_template.rb
|
245
368
|
- lib/sprockets/compressing.rb
|
246
369
|
- lib/sprockets/configuration.rb
|
247
370
|
- lib/sprockets/context.rb
|
@@ -249,29 +372,30 @@ files:
|
|
249
372
|
- lib/sprockets/digest_utils.rb
|
250
373
|
- lib/sprockets/directive_processor.rb
|
251
374
|
- lib/sprockets/eco_processor.rb
|
252
|
-
- lib/sprockets/eco_template.rb
|
253
375
|
- lib/sprockets/ejs_processor.rb
|
254
|
-
- lib/sprockets/ejs_template.rb
|
255
376
|
- lib/sprockets/encoding_utils.rb
|
256
|
-
- lib/sprockets/engines.rb
|
257
377
|
- lib/sprockets/environment.rb
|
258
378
|
- lib/sprockets/erb_processor.rb
|
259
|
-
- lib/sprockets/erb_template.rb
|
260
379
|
- lib/sprockets/errors.rb
|
380
|
+
- lib/sprockets/exporters/base.rb
|
381
|
+
- lib/sprockets/exporters/file_exporter.rb
|
382
|
+
- lib/sprockets/exporters/zlib_exporter.rb
|
383
|
+
- lib/sprockets/exporters/zopfli_exporter.rb
|
384
|
+
- lib/sprockets/exporting.rb
|
261
385
|
- lib/sprockets/file_reader.rb
|
262
386
|
- lib/sprockets/http_utils.rb
|
387
|
+
- lib/sprockets/jsminc_compressor.rb
|
263
388
|
- 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
389
|
- lib/sprockets/loader.rb
|
268
390
|
- lib/sprockets/manifest.rb
|
269
391
|
- lib/sprockets/manifest_utils.rb
|
270
392
|
- lib/sprockets/mime.rb
|
393
|
+
- lib/sprockets/npm.rb
|
271
394
|
- lib/sprockets/path_dependency_utils.rb
|
272
395
|
- lib/sprockets/path_digest_utils.rb
|
273
396
|
- lib/sprockets/path_utils.rb
|
274
397
|
- lib/sprockets/paths.rb
|
398
|
+
- lib/sprockets/preprocessors/default_source_map.rb
|
275
399
|
- lib/sprockets/processing.rb
|
276
400
|
- lib/sprockets/processor_utils.rb
|
277
401
|
- lib/sprockets/resolve.rb
|
@@ -280,12 +404,18 @@ files:
|
|
280
404
|
- lib/sprockets/sass_functions.rb
|
281
405
|
- lib/sprockets/sass_importer.rb
|
282
406
|
- lib/sprockets/sass_processor.rb
|
283
|
-
- lib/sprockets/
|
407
|
+
- lib/sprockets/sassc_compressor.rb
|
408
|
+
- lib/sprockets/sassc_processor.rb
|
284
409
|
- lib/sprockets/server.rb
|
410
|
+
- lib/sprockets/source_map_processor.rb
|
411
|
+
- lib/sprockets/source_map_utils.rb
|
285
412
|
- lib/sprockets/transformers.rb
|
286
413
|
- lib/sprockets/uglifier_compressor.rb
|
414
|
+
- lib/sprockets/unloaded_asset.rb
|
415
|
+
- lib/sprockets/uri_tar.rb
|
287
416
|
- lib/sprockets/uri_utils.rb
|
288
417
|
- lib/sprockets/utils.rb
|
418
|
+
- lib/sprockets/utils/gzip.rb
|
289
419
|
- lib/sprockets/version.rb
|
290
420
|
- lib/sprockets/yui_compressor.rb
|
291
421
|
homepage: https://github.com/rails/sprockets
|
@@ -300,15 +430,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
300
430
|
requirements:
|
301
431
|
- - ">="
|
302
432
|
- !ruby/object:Gem::Version
|
303
|
-
version:
|
433
|
+
version: 2.5.0
|
304
434
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
305
435
|
requirements:
|
306
436
|
- - ">="
|
307
437
|
- !ruby/object:Gem::Version
|
308
438
|
version: '0'
|
309
439
|
requirements: []
|
310
|
-
|
311
|
-
rubygems_version: 2.4.5
|
440
|
+
rubygems_version: 3.0.3
|
312
441
|
signing_key:
|
313
442
|
specification_version: 4
|
314
443
|
summary: Rack-based asset packaging system
|
data/LICENSE
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
Copyright (c) 2014 Sam Stephenson
|
2
|
-
Copyright (c) 2014 Joshua Peek
|
3
|
-
|
4
|
-
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
-
a copy of this software and associated documentation files (the
|
6
|
-
"Software"), to deal in the Software without restriction, including
|
7
|
-
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
-
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
-
permit persons to whom the Software is furnished to do so, subject to
|
10
|
-
the following conditions:
|
11
|
-
|
12
|
-
The above copyright notice and this permission notice shall be
|
13
|
-
included in all copies or substantial portions of the Software.
|
14
|
-
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
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
|