hyperbuild 0.0.35 → 0.0.40
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/README.md +17 -13
- data/lib/hyperbuild.rb +1 -1
- data/lib/linux-ruby2.5 +0 -0
- data/lib/linux-ruby2.6 +0 -0
- data/lib/linux-ruby2.7 +0 -0
- data/lib/macos-ruby2.5 +0 -0
- data/lib/macos-ruby2.6 +0 -0
- data/lib/macos-ruby2.7 +0 -0
- 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: 9f2a6102a9052622a2adcb638efc16b689bec1a2cc081fd1c99aa682536f7707
|
4
|
+
data.tar.gz: 691368c264d4637f41f8b6248b1f902dfd2f5de08dda4d297d49680c169ca8b5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3742bc67d08738a164c6f96a9e77570b3894d3cd2ff1d40d5cf5ee97abf67e3dc95038976c57467eaa2002d2a0b0e48b4e4273e3049fff4aafc9bcb420b4ca8c
|
7
|
+
data.tar.gz: 4bcc6a195bc70b374cc628058d6789dcf0b700f2a15cf9dfd5b469e4defd5e756ef26436e32a1e3f75cba2dedc4140856220f9141bd7d923cad40a70d021e0e7
|
data/README.md
CHANGED
@@ -17,17 +17,19 @@ Available as:
|
|
17
17
|
|
18
18
|
Speed and effectiveness of Node.js version compared to [html-minfier](https://github.com/kangax/html-minifier) and [minimize](https://github.com/Swaagie/minimize). See [bench](./bench) folder for more details.
|
19
19
|
|
20
|
-
<img width="435" alt="Chart showing speed of HTML minifiers" src="
|
20
|
+
<img width="435" alt="Chart showing speed of HTML minifiers" src="https://wilsonl.in/hyperbuild/bench/0.0.40/average-speeds.png"> <img width="435" alt="Chart showing effectiveness of HTML minifiers" src="https://wilsonl.in/hyperbuild/bench/0.0.40/average-sizes.png">
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
24
24
|
### CLI
|
25
25
|
|
26
|
+
Precompiled binaries are available for x86-64 Windows, macOS, and Linux. To compile and install from source, run `cargo install hyperbuild`, which requires [Rust](https://www.rust-lang.org/tools/install).
|
27
|
+
|
26
28
|
##### Get
|
27
29
|
|
28
|
-
[Windows](https://wilsonl.in/hyperbuild/bin/0.0.
|
29
|
-
[macOS](https://wilsonl.in/hyperbuild/bin/0.0.
|
30
|
-
[Linux](https://wilsonl.in/hyperbuild/bin/0.0.
|
30
|
+
[Windows](https://wilsonl.in/hyperbuild/bin/0.0.40-windows-x86_64.exe) |
|
31
|
+
[macOS](https://wilsonl.in/hyperbuild/bin/0.0.40-macos-x86_64) |
|
32
|
+
[Linux](https://wilsonl.in/hyperbuild/bin/0.0.40-linux-x86_64)
|
31
33
|
|
32
34
|
##### Use
|
33
35
|
|
@@ -44,7 +46,7 @@ hyperbuild --src /path/to/src.html --out /path/to/output.min.html
|
|
44
46
|
|
45
47
|
```toml
|
46
48
|
[dependencies]
|
47
|
-
hyperbuild = "0.0.
|
49
|
+
hyperbuild = "0.0.40"
|
48
50
|
```
|
49
51
|
|
50
52
|
##### Use
|
@@ -105,7 +107,7 @@ Add as a Maven dependency:
|
|
105
107
|
<dependency>
|
106
108
|
<groupId>in.wilsonl.hyperbuild</groupId>
|
107
109
|
<artifactId>hyperbuild</artifactId>
|
108
|
-
<version>0.0.
|
110
|
+
<version>0.0.40</version>
|
109
111
|
</dependency>
|
110
112
|
```
|
111
113
|
|
@@ -365,10 +367,10 @@ Any entities in attribute values are decoded, and then the shortest representati
|
|
365
367
|
- Single quoted, with any `'` encoded.
|
366
368
|
- Unquoted, with `"`/`'` first character (if applicable), `>` last character (if applicable), and any whitespace encoded.
|
367
369
|
|
368
|
-
`class` attributes have their whitespace (after any decoding) trimmed and collapsed.
|
370
|
+
`class` and `d` attributes have their whitespace (after any decoding) trimmed and collapsed.
|
369
371
|
|
370
372
|
[Boolean attribute](./gen/attrs.json) values are removed.
|
371
|
-
[Some attributes](./gen/attrs.json) are completely removed if their value is empty or the default value after any processing.
|
373
|
+
[Some other attributes](./gen/attrs.json) are completely removed if their value is empty or the default value after any processing.
|
372
374
|
|
373
375
|
`type` attributes on `script` tags with a value equaling a [JavaScript MIME type](https://mimesniff.spec.whatwg.org/#javascript-mime-type) are removed.
|
374
376
|
|
@@ -380,10 +382,12 @@ Spaces are removed between attributes if possible.
|
|
380
382
|
|
381
383
|
Entities are decoded if valid (see relevant parsing section) and their decoded characters as UTF-8 is shorter or equal in length.
|
382
384
|
|
383
|
-
Numeric entities that do not refer to a valid Unicode Scalar Value are
|
385
|
+
Numeric entities that do not refer to a valid [Unicode Scalar Value](https://www.unicode.org/glossary/#unicode_scalar_value) are replaced with the [replacement character](https://en.wikipedia.org/wiki/Specials_(Unicode_block)#Replacement_character).
|
384
386
|
|
385
387
|
If an entity is unintentionally formed after decoding, the leading ampersand is encoded, e.g. `&amp;` becomes `&amp;`. This is done as `&` is equal to or shorter than all other entity representations of characters part of an entity (`[&#a-zA-Z0-9;]`), and there is no other conflicting entity name that starts with `amp`.
|
386
388
|
|
389
|
+
Right chevrons after any decoding in text are encoded to `>` if possible or `>` otherwise.
|
390
|
+
|
387
391
|
### Comments
|
388
392
|
|
389
393
|
Comments are removed.
|
@@ -400,7 +404,7 @@ hyperbuild simply does HTML minification, and almost does no syntax checking or
|
|
400
404
|
|
401
405
|
For example, this means that it's not an error to have self-closing tags, declare multiple `<body>` elements, use incorrect attribute names and values, or write something like `<br>alert('');</br>`
|
402
406
|
|
403
|
-
However, there are some syntax requirements for speed and sanity
|
407
|
+
However, there are some syntax requirements for speed and sanity.
|
404
408
|
|
405
409
|
### Tags
|
406
410
|
|
@@ -425,7 +429,7 @@ Numeric character references that do not reference a valid [Unicode Scalar Value
|
|
425
429
|
Backticks (`` ` ``) are not valid quote marks and not interpreted as such.
|
426
430
|
However, backticks are valid attribute value quotes in Internet Explorer.
|
427
431
|
|
428
|
-
Special handling of some attributes require case sensitive names and values. For example, `CLASS` won't be recognised as an attribute to minify, and `type="Text/JavaScript"` on a `<script>` will
|
432
|
+
Special handling of some attributes require case sensitive names and values. For example, `CLASS` won't be recognised as an attribute to minify, and `type="Text/JavaScript"` on a `<script>` will not be removed.
|
429
433
|
|
430
434
|
### Script and style
|
431
435
|
|
@@ -435,6 +439,6 @@ hyperbuild does **not** handle [escaped and double-escaped](./notes/Script%20dat
|
|
435
439
|
|
436
440
|
## Issues and contributions
|
437
441
|
|
438
|
-
|
442
|
+
Pull requests and any contributions welcome!
|
439
443
|
|
440
|
-
If hyperbuild did something unexpected,
|
444
|
+
If hyperbuild did something unexpected, misunderstood some syntax, or incorrectly kept/removed some code, [raise an issue](https://github.com/wilsonzlin/hyperbuild/issues) with some relevant code that can be used to reproduce and investigate the issue.
|
data/lib/hyperbuild.rb
CHANGED
@@ -11,7 +11,7 @@ class HyperbuildLoader
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def self.lib_path
|
14
|
-
File.join(__dir__, [operating_system, '-
|
14
|
+
File.join(__dir__, [operating_system, '-ruby', RUBY_VERSION.split('.')[0...-1].join('.')].join(''))
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
data/lib/linux-ruby2.5
CHANGED
Binary file
|
data/lib/linux-ruby2.6
CHANGED
Binary file
|
data/lib/linux-ruby2.7
CHANGED
Binary file
|
data/lib/macos-ruby2.5
CHANGED
Binary file
|
data/lib/macos-ruby2.6
CHANGED
Binary file
|
data/lib/macos-ruby2.7
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hyperbuild
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.40
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wilson Lin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fiddle
|