sprockets 3.7.2 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (96) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +42 -270
  3. data/README.md +443 -320
  4. data/bin/sprockets +11 -7
  5. data/lib/rake/sprocketstask.rb +3 -2
  6. data/lib/sprockets/add_source_map_comment_to_asset_processor.rb +60 -0
  7. data/lib/sprockets/asset.rb +16 -21
  8. data/lib/sprockets/autoload/babel.rb +8 -0
  9. data/lib/sprockets/autoload/closure.rb +1 -0
  10. data/lib/sprockets/autoload/coffee_script.rb +1 -0
  11. data/lib/sprockets/autoload/eco.rb +1 -0
  12. data/lib/sprockets/autoload/ejs.rb +1 -0
  13. data/lib/sprockets/autoload/jsminc.rb +8 -0
  14. data/lib/sprockets/autoload/sass.rb +1 -0
  15. data/lib/sprockets/autoload/sassc.rb +8 -0
  16. data/lib/sprockets/autoload/uglifier.rb +1 -0
  17. data/lib/sprockets/autoload/yui.rb +1 -0
  18. data/lib/sprockets/autoload/zopfli.rb +7 -0
  19. data/lib/sprockets/autoload.rb +5 -0
  20. data/lib/sprockets/babel_processor.rb +66 -0
  21. data/lib/sprockets/base.rb +47 -10
  22. data/lib/sprockets/bower.rb +5 -2
  23. data/lib/sprockets/bundle.rb +40 -4
  24. data/lib/sprockets/cache/file_store.rb +25 -3
  25. data/lib/sprockets/cache/memory_store.rb +9 -0
  26. data/lib/sprockets/cache/null_store.rb +8 -0
  27. data/lib/sprockets/cache.rb +36 -1
  28. data/lib/sprockets/cached_environment.rb +14 -19
  29. data/lib/sprockets/closure_compressor.rb +1 -0
  30. data/lib/sprockets/coffee_script_processor.rb +18 -4
  31. data/lib/sprockets/compressing.rb +43 -3
  32. data/lib/sprockets/configuration.rb +3 -7
  33. data/lib/sprockets/context.rb +97 -24
  34. data/lib/sprockets/dependencies.rb +1 -0
  35. data/lib/sprockets/digest_utils.rb +25 -5
  36. data/lib/sprockets/directive_processor.rb +45 -35
  37. data/lib/sprockets/eco_processor.rb +1 -0
  38. data/lib/sprockets/ejs_processor.rb +1 -0
  39. data/lib/sprockets/encoding_utils.rb +1 -0
  40. data/lib/sprockets/environment.rb +9 -4
  41. data/lib/sprockets/erb_processor.rb +28 -21
  42. data/lib/sprockets/errors.rb +1 -0
  43. data/lib/sprockets/exporters/base.rb +72 -0
  44. data/lib/sprockets/exporters/file_exporter.rb +24 -0
  45. data/lib/sprockets/exporters/zlib_exporter.rb +33 -0
  46. data/lib/sprockets/exporters/zopfli_exporter.rb +14 -0
  47. data/lib/sprockets/exporting.rb +73 -0
  48. data/lib/sprockets/file_reader.rb +1 -0
  49. data/lib/sprockets/http_utils.rb +25 -7
  50. data/lib/sprockets/jsminc_compressor.rb +32 -0
  51. data/lib/sprockets/jst_processor.rb +11 -10
  52. data/lib/sprockets/loader.rb +85 -67
  53. data/lib/sprockets/manifest.rb +64 -62
  54. data/lib/sprockets/manifest_utils.rb +9 -6
  55. data/lib/sprockets/mime.rb +8 -42
  56. data/lib/sprockets/npm.rb +52 -0
  57. data/lib/sprockets/path_dependency_utils.rb +3 -11
  58. data/lib/sprockets/path_digest_utils.rb +2 -1
  59. data/lib/sprockets/path_utils.rb +87 -7
  60. data/lib/sprockets/paths.rb +1 -0
  61. data/lib/sprockets/preprocessors/default_source_map.rb +49 -0
  62. data/lib/sprockets/processing.rb +31 -61
  63. data/lib/sprockets/processor_utils.rb +24 -35
  64. data/lib/sprockets/resolve.rb +177 -93
  65. data/lib/sprockets/sass_cache_store.rb +2 -6
  66. data/lib/sprockets/sass_compressor.rb +13 -1
  67. data/lib/sprockets/sass_functions.rb +1 -0
  68. data/lib/sprockets/sass_importer.rb +1 -0
  69. data/lib/sprockets/sass_processor.rb +30 -9
  70. data/lib/sprockets/sassc_compressor.rb +56 -0
  71. data/lib/sprockets/sassc_processor.rb +297 -0
  72. data/lib/sprockets/server.rb +26 -23
  73. data/lib/sprockets/source_map_processor.rb +66 -0
  74. data/lib/sprockets/source_map_utils.rb +483 -0
  75. data/lib/sprockets/transformers.rb +63 -35
  76. data/lib/sprockets/uglifier_compressor.rb +21 -11
  77. data/lib/sprockets/unloaded_asset.rb +13 -11
  78. data/lib/sprockets/uri_tar.rb +1 -0
  79. data/lib/sprockets/uri_utils.rb +11 -8
  80. data/lib/sprockets/utils/gzip.rb +46 -14
  81. data/lib/sprockets/utils.rb +41 -74
  82. data/lib/sprockets/version.rb +2 -1
  83. data/lib/sprockets/yui_compressor.rb +1 -0
  84. data/lib/sprockets.rb +99 -39
  85. metadata +127 -23
  86. data/LICENSE +0 -21
  87. data/lib/sprockets/coffee_script_template.rb +0 -17
  88. data/lib/sprockets/deprecation.rb +0 -90
  89. data/lib/sprockets/eco_template.rb +0 -17
  90. data/lib/sprockets/ejs_template.rb +0 -17
  91. data/lib/sprockets/engines.rb +0 -92
  92. data/lib/sprockets/erb_template.rb +0 -11
  93. data/lib/sprockets/legacy.rb +0 -330
  94. data/lib/sprockets/legacy_proc_processor.rb +0 -35
  95. data/lib/sprockets/legacy_tilt_processor.rb +0 -29
  96. data/lib/sprockets/sass_template.rb +0 -19
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46e0f0a150aa8333d2a1d2663167b6f20c1e77db067cea7b545f75927f770807
4
- data.tar.gz: 5acd5cb5c64e240dd8180e91f34620195fa1433e625ee48a132fdae58be71ba5
3
+ metadata.gz: cbc5f0a881069d09632a087bb32f43c8e5d01a631f2ff6fbc6e776e3695bd51c
4
+ data.tar.gz: 580922aaccc4defd65fdf239b441f7e8e96216d98dae8fdfe0a64afc3b40a4bc
5
5
  SHA512:
6
- metadata.gz: 97a06eb2e0767903da7bcda387211d881f3b98d57269a8abed5045e277db5f133f381c4f8fd23fcccf45a4032c85309841abba13b9218a52b21121a5a9bfc02a
7
- data.tar.gz: 1d9c8d75bab64c366473226cc61806cd64c1951a67d90cc1220c1474e6a02cc5003b2dffb1b6324abefb7e7c8b292145635ac0bed6ae947a35393d67acd3c40e
6
+ metadata.gz: f474ef02d068783020ae4a3833bded8783d1a1bfa1ee5ae106dd7e8dfbcf12723c8582155cb44c0594b0c36bcad476b7139814f2577fa2e25a82ad6675763dc4
7
+ data.tar.gz: 853bbac33f50b2097126190c01bdc182306b7aa7132d50b91248efd1dcc1b7a35863fa1a5e529eacc8d967ee9d2de8083ae68b72e02889e01a821d794d0ad147
data/CHANGELOG.md CHANGED
@@ -1,296 +1,68 @@
1
- **3.7.2** (June 19, 2018)
1
+ **Master**
2
2
 
3
- * Security release for [CVE-2018-3760](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3760).
3
+ Get upgrade notes from Sprockets 3.x to 4.x at https://github.com/rails/sprockets/blob/master/UPGRADING.md
4
4
 
5
- **3.7.1** (December 19, 2016)
5
+ ## Master
6
6
 
7
- * Ruby 2.4 support for Sprockets 3.
7
+ ## 4.0.0
8
8
 
9
- **3.7.0** (July 21, 2016)
9
+ - Fixes for Ruby 2.7 keyword arguments warnings [#625](https://github.com/rails/sprockets/pull/625)
10
+ - Manifest files are sorted alphabetically [#626](https://github.com/rails/sprockets/pull/626)
10
11
 
11
- * Deprecated interfaces now emit deprecation warnings #345
12
+ ## 4.0.0.beta10
12
13
 
13
- **3.6.3** (July 1, 2016)
14
+ - Fix YACB (Yet Another Caching Bug) [Fix broken expansion of asset link paths](https://github.com/rails/sprockets/pull/614)
14
15
 
15
- * Faster asset lookup in large directories #336
16
- * Faster PathUtils.match_path_extname https://github.com/rails/sprockets/commit/697269cf81e5261fdd7072e32bd489403027fd7e
17
- * Fixed uglifier comment stripping #326
18
- * Error messages now show load path info #313
16
+ ## 4.0.0.beta9
19
17
 
20
- **3.6.2** (June 21, 2016)
18
+ - Minimum Ruby version for Sprockets 4 is now 2.5+ which matches minimum ruby verision of Rails [#604]
19
+ - Fix threading bug introduced in Sprockets 4 [#603]
20
+ - Warn when two potential manifest files exist. [#560]
21
21
 
22
- * More performance improvements.
22
+ ## 4.0.0.beta8
23
23
 
24
- **3.6.1** (June 17, 2016)
24
+ - Security release for [CVE-2018-3760](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-3760)
25
25
 
26
- * Some performance improvements.
26
+ ## 4.0.0.beta7
27
27
 
28
- **3.6.0** (April 6, 2016)
28
+ - Fix a year long bug that caused `Sprockets::FileNotFound` errors when the asset was present [#547]
29
+ - Raise an error when two assets such as foo.js and foo.js.erb would produce the same output artifact (foo.js) [#549 #530]
30
+ - Process `*.jst.eco.erb` files with ERBProcessor
29
31
 
30
- * Add `Manifest#find_sources` to return the source of the compiled assets.
31
- * Fix the list of compressable mime types.
32
- * Improve performance of the `FileStore` cache.
32
+ ## 4.0.0.beta6
33
33
 
34
- **3.5.2** (December 8, 2015)
34
+ - Fix source map line offsets [#515]
35
+ - Return a `400 Bad Request` when the path encoding is invalid. [#514]
35
36
 
36
- * Fix JRuby bug with concurrent-ruby.
37
- * Fix disabling gzip generation in cached environments.
37
+ ## 4.0.0.beta5
38
38
 
39
- **3.5.1** (December 5, 2015)
39
+ - Reduce string allocations
40
+ - Source map metadata uses compressed form specified by the [source map v3 spec](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k). [#402] **[BREAKING]**
41
+ - Generate [index maps](https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt) when decoding source maps isn't necessary. [#402]
42
+ - Remove fingerprints from source map files. [#402]
40
43
 
41
- * Fix gzip asset generation for assets already on disk.
44
+ ## 4.0.0.beta4
42
45
 
43
- **3.5.0** (December 3, 2015)
46
+ - Changing the version now busts the digest of all assets [#404]
47
+ - Exporter interface added [#386]
48
+ - Using ENV vars in templates will recompile templates when the env vars change. [#365]
49
+ - Source maps for imported sass files with sassc is now fixed [#391]
50
+ - Load paths now in error messages [#322]
51
+ - Cache key added to babel processor [#387]
52
+ - `Environment#find_asset!` can now be used to raise an exception when asset could not be found [#379]
44
53
 
45
- * Reintroduce Gzip file generation for non-binary assets.
54
+ ## 4.0.0.beta3
46
55
 
47
- **3.4.1** (November 25, 2015)
56
+ - Source Map fixes [#255] [#367]
57
+ - Performance improvements
48
58
 
49
- * PathUtils::Entries will no longer error on an empty directory.
59
+ ## 4.0.0.beta2
50
60
 
51
- **3.4.0** (October 5, 2015)
61
+ - Fix load_paths on Sass processors [#223]
52
62
 
53
- * Expose method to override the sass cache in the SassProcessor.
54
63
 
55
- **3.3.5** (September 25, 2015)
64
+ ## 4.0.0.beta1
56
65
 
57
- * Fix bug related to absolute path being reintroduced into history cache #141.
66
+ - Initial release of Sprockets 4
58
67
 
59
- **3.3.4** (September 1, 2015)
60
-
61
- * Relative cache contents now work with windows.
62
-
63
- **3.3.3** (August 21, 2015)
64
-
65
- * Remove more absolute paths from cache contents.
66
-
67
- **3.3.2** (August 19, 2015)
68
-
69
- * Fix cache contents to use relative paths instead of absolute paths.
70
-
71
- **3.3.1** (August 15, 2015)
72
-
73
- * Fix legacy Tilt integration when locals is required argument.
74
-
75
- **3.3.0** (August 12, 2015)
76
-
77
- * Change internal cache key to use relative asset paths instead of absolute paths.
78
-
79
- **3.2.0** (June 2, 2015)
80
-
81
- * Updated SRI integrity to align with spec changes
82
- * Deprecated Manifest integrity attribute
83
- * Cleanup concatenating JS sources with newlines
84
-
85
- **3.1.0** (May 10, 2015)
86
-
87
- * Removed "index" logical path normalization. Asset#logical_path is always the
88
- full logical path to the index file.
89
- * Fixed static asset mtimes
90
- * Fix manifest cleanup by age
91
- * Removed redundant minifier level cache
92
- * Updated SRI format according to spec changes
93
-
94
- **3.0.3** (April 27, 2015)
95
-
96
- * Fix static asset mtime fallback
97
- * Only warn when specified asset version can not be loaded.
98
-
99
- **3.0.2** (April 22, 2015)
100
-
101
- * Ensure legacy Tilt handlers return String class data. Fixes issues with Haml
102
- Tilt handler.
103
- * Type check and improve error messages raised on bad processor returned results.
104
- * Improve error message for relative paths not under load path.
105
- * Changed HTML encoding fallback from ISO-8859-1 to default external.
106
- * Avoid falling back to 0 mtimes which may cause warnings with tar
107
-
108
- **3.0.1** (April 14, 2015)
109
-
110
- * Fixed `Context#depend_on` with paths outside the load path
111
-
112
- **3.0.0** (April 12, 2015)
113
-
114
- [Guide to upgrading from Sprockets 2.x to 3.x](https://github.com/rails/sprockets/blob/3.x/UPGRADING.md)
115
-
116
- * New processor API. Tilt interface is deprecated.
117
- * Improved file store caching backend.
118
- * MIME Types now accept charset custom charset detecters. Improves support for UTF-16/32 files.
119
- * Environment#version no longer affects asset digests. Only used for busting the asset cache.
120
- * Removed builtin support for LESS.
121
- * Removed `//= include` directive support.
122
- * Deprecated `BundledAsset#to_a`. Use `BundledAsset#included` to access debugging subcomponents.
123
- * Support circular dependencies. For parity with ES6 modules.
124
- * Manifest compilation will no longer generate .gz files by default. [Mixing
125
- Content-Encoding and ETags is just a bad
126
- idea](https://issues.apache.org/bugzilla/show_bug.cgi?id=39727)
127
- * Added linked or referenced assets. When an asset is compiled, any of its links will be compiled as well.
128
- * Introduce some limitations around enumerating all logical paths. 4.x will deprecate it and favor linked manifests for compliation.
129
- * Add Asset integrity attribute for Subresource Integrity
130
- * Default digest changed to SHA256. Configuring `digest_class` is deprecated.
131
- * Rename `Asset#digest` to `Asset#hexdigest`. `Asset#digest` is deprecated and will
132
- return a raw byte String in 4.x.
133
- * Added transitional compatibility flag to `Environment#resolve(path, compat: true)`. 2.x mode operates with `compat: true` and 4.x with `compat: false`
134
- * `manifest-abc123.json` renamed to `.sprockets-abc123.json`
135
-
136
- **2.12.3** (October 28, 2014)
137
-
138
- * Security: Fix directory traversal bug in development mode server.
139
-
140
- **2.12.2** (September 5, 2014)
141
-
142
- * Ensure internal asset lookups calls are still restricted to load paths within
143
- asset compiles. Though, you should not depend on internal asset resolves to be
144
- completely restricted for security reasons. Assets themselves should be
145
- considered full scripting environments with filesystem access.
146
-
147
- **2.12.1** (April 17, 2014)
148
-
149
- * Fix making manifest target directory when its different than the output directory.
150
-
151
- **2.12.0** (March 13, 2014)
152
-
153
- * Avoid context reference in SassImporter hack so its Marshallable. Fixes
154
- issues with Sass 3.3.x.
155
-
156
- **2.11.0** (February 19, 2014)
157
-
158
- * Cache store must now be an LRU implementation.
159
- * Default digest changed to SHA1. To continue using MD5.
160
- `env.digest_class = Digest::MD5`.
161
-
162
- **2.10.0** (May 24, 2013)
163
-
164
- * Support for `bower.json`
165
-
166
- **2.9.3** (April 20, 2013)
167
-
168
- * Fixed sass caching bug
169
-
170
- **2.9.2** (April 8, 2013)
171
-
172
- * Improve file freshness check performance
173
- * Directive processor encoding fixes
174
-
175
- **2.9.1** (April 6, 2013)
176
-
177
- * Support for Uglifier 2.x
178
-
179
- **2.9.0** (February 25, 2013)
180
-
181
- * Write out gzipped variants of bundled assets.
182
-
183
- **2.8.2** (December 10, 2012)
184
-
185
- * Fixed top level Sass constant references
186
- * Fixed manifest logger when environment is disabled
187
-
188
- **2.8.1** (October 31, 2012)
189
-
190
- * Fixed Sass importer bug
191
-
192
- **2.8.0** (October 16, 2012)
193
-
194
- * Allow manifest location to be separated from output directory
195
- * Pass logical path and absolute path to each_logical_path iterator
196
-
197
- **2.7.0** (October 10, 2012)
198
-
199
- * Added --css-compressor and --js-compressor command line flags
200
- * Added css/js compressor shorthand
201
- * Change default manifest.json filename to be a randomized manifest-16HEXBYTES.json
202
- * Allow nil environment to be passed to manifest
203
- * Allow manifest instance to be set on rake task
204
-
205
- **2.6.0** (September 19, 2012)
206
-
207
- * Added bower component.json require support
208
-
209
- **2.5.0** (September 4, 2012)
210
-
211
- * Fixed Ruby 2.0 RegExp warning
212
- * Provide stubbed implementation of context *_path helpers
213
- * Add SassCompressor
214
-
215
- **2.4.5** (July 10, 2012)
216
-
217
- * Tweaked some logger levels
218
-
219
- **2.4.4** (July 2, 2012)
220
-
221
- * Canonicalize logical path extensions
222
- * Check absolute paths passed to depend_on
223
-
224
- **2.4.3** (May 16, 2012)
225
-
226
- * Exposed :sprockets in sass options
227
- * Include dependency paths in asset mtime
228
-
229
- **2.4.2** (May 7, 2012)
230
-
231
- * Fixed MultiJson feature detect
232
-
233
- **2.4.1** (April 26, 2012)
234
-
235
- * Fixed MultiJson API change
236
- * Fixed gzip mtime
237
-
238
- **2.4.0** (March 27, 2012)
239
-
240
- * Added global path registry
241
- * Added global processor registry
242
-
243
- **2.3.2** (March 26, 2012)
244
-
245
- * Fix Context#logical_path with dots
246
-
247
- **2.3.1** (February 11, 2012)
248
-
249
- * Added bytesize to manifest
250
- * Added Asset#bytesize alias
251
- * Security: Check path for forbidden access after unescaping
252
-
253
- **2.3.0** (January 16, 2012)
254
-
255
- * Added special Sass importer that automatically tracks any `@import`ed files.
256
-
257
- **2.2.0** (January 10, 2012)
258
-
259
- * Added `sprockets` command line utility.
260
- * Added rake/sprocketstask.
261
- * Added json manifest log of compiled assets.
262
- * Added `stub` directive that allows you to exclude files from the bundle.
263
- * Added per environment external encoding (Environment#default_external_encoding). Defaults to UTF-8. Fixes issues where LANG is not set correctly and Rubys default external is set to ASCII.
264
-
265
- **2.1.2** (November 20, 2011)
266
-
267
- * Disabled If-Modified-Since server checks. Fixes some browser caching issues when serving the asset body only. If-None-Match caching is sufficient.
268
-
269
- **2.1.1** (November 18, 2011)
270
-
271
- * Fix windows absolute path check bug.
272
-
273
- **2.1.0** (November 11, 2011)
274
-
275
- * Directive comment lines are now turned into empty lines instead of removed. This way line numbers in
276
- CoffeeScript syntax errors are correct.
277
- * Performance and caching bug fixes.
278
-
279
- **2.0.3** (October 17, 2011)
280
-
281
- * Detect format extensions from right to left.
282
- * Make JST namespace configurable.
283
-
284
- **2.0.2** (October 4, 2011)
285
-
286
- * Fixed loading stale cache from bundler gems.
287
-
288
- **2.0.1** (September 30, 2011)
289
-
290
- * Fixed bug with fingerprinting file names with multiple dots.
291
- * Decode URIs as default internal.
292
- * Fix symlinked asset directories.
293
-
294
- **2.0.0** (August 29, 2011)
295
-
296
- * Initial public release.
68
+ Please upgrade to the latest Sprockets 3 version before upgrading to Sprockets 4. Check the 3.x branch for previous changes https://github.com/rails/sprockets/blob/3.x/CHANGELOG.md.