hyperbuild 0.0.29 → 0.0.38
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 +18 -20
- data/lib/hyperbuild.rb +1 -1
- data/lib/linux-ruby2.5 +0 -0
- data/lib/linux-ruby2.6 +0 -0
- data/lib/{linux → 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 +8 -4
- data/lib/macos +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c124ffbf973555b640e5fc9463f66be587a161ae82dbeb2aa7a6577a4817a597
|
4
|
+
data.tar.gz: 6b10fe6134e46bee426dca81a78751565142009c457af01157fd5e7ce400ebfc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b82d0143ce5147ca6ebd2777ac2a3765444f70b4b27d01c231eda67f24fed06674620ec25061f118806310843b06bf94d260f0c35da29f6b675daa2feedb89a
|
7
|
+
data.tar.gz: 7b14c5a899a21ec26ab448b5995d0ae759619acd6083fd9ef455e3573037a30d55b89c2ca36f7876c8e121832c59e2a48e162b2c8d6c2ef228996c0877c1aea0
|
data/README.md
CHANGED
@@ -17,7 +17,7 @@ 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.38/average-speeds.png"> <img width="435" alt="Chart showing effectiveness of HTML minifiers" src="https://wilsonl.in/hyperbuild/bench/0.0.38/average-sizes.png">
|
21
21
|
|
22
22
|
## Usage
|
23
23
|
|
@@ -25,9 +25,9 @@ Speed and effectiveness of Node.js version compared to [html-minfier](https://gi
|
|
25
25
|
|
26
26
|
##### Get
|
27
27
|
|
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.
|
28
|
+
[Windows](https://wilsonl.in/hyperbuild/bin/0.0.38-windows-x86_64.exe) |
|
29
|
+
[macOS](https://wilsonl.in/hyperbuild/bin/0.0.38-macos-x86_64) |
|
30
|
+
[Linux](https://wilsonl.in/hyperbuild/bin/0.0.38-linux-x86_64)
|
31
31
|
|
32
32
|
##### Use
|
33
33
|
|
@@ -44,7 +44,7 @@ hyperbuild --src /path/to/src.html --out /path/to/output.min.html
|
|
44
44
|
|
45
45
|
```toml
|
46
46
|
[dependencies]
|
47
|
-
hyperbuild = "0.0.
|
47
|
+
hyperbuild = "0.0.38"
|
48
48
|
```
|
49
49
|
|
50
50
|
##### Use
|
@@ -105,7 +105,7 @@ Add as a Maven dependency:
|
|
105
105
|
<dependency>
|
106
106
|
<groupId>in.wilsonl.hyperbuild</groupId>
|
107
107
|
<artifactId>hyperbuild</artifactId>
|
108
|
-
<version>0.0.
|
108
|
+
<version>0.0.38</version>
|
109
109
|
</dependency>
|
110
110
|
```
|
111
111
|
|
@@ -126,18 +126,14 @@ class Main {
|
|
126
126
|
<details>
|
127
127
|
<summary><strong>Python</strong></summary>
|
128
128
|
|
129
|
-
hyperbuild is available as a [native module](https://github.com/PyO3/pyo3), and supports CPython (the default Python interpreter) versions 3.5 and higher.
|
129
|
+
hyperbuild is [on PyPI](https://pypi.org/project/hyperbuild), available as a [native module](https://github.com/PyO3/pyo3), and supports CPython (the default Python interpreter) versions 3.5 and higher.
|
130
130
|
|
131
131
|
##### Get
|
132
132
|
|
133
|
-
|
134
|
-
|
135
|
-
Rename the file to `hyperbuild.pyd` on Windows or `hyperbuild.so` on macOS/Linux.
|
133
|
+
Add the PyPI project as a dependency and install it using `pip` or `pipenv`.
|
136
134
|
|
137
135
|
##### Use
|
138
136
|
|
139
|
-
Make sure the native module can be [found by Python](https://docs.python.org/3/tutorial/modules.html#the-module-search-path). This is usually done by placing it into a folder declared in the `PYTHONPATH` environment variable or `sys.path` value, or the same folder as the script that will import it.
|
140
|
-
|
141
137
|
```python
|
142
138
|
import hyperbuild
|
143
139
|
|
@@ -160,7 +156,7 @@ Add the library as a dependency to `Gemfile` or `*.gemspec`.
|
|
160
156
|
```ruby
|
161
157
|
require 'hyperbuild'
|
162
158
|
|
163
|
-
print
|
159
|
+
print Hyperbuild.minify "<p> Hello, world! </p>"
|
164
160
|
```
|
165
161
|
|
166
162
|
</details>
|
@@ -369,10 +365,10 @@ Any entities in attribute values are decoded, and then the shortest representati
|
|
369
365
|
- Single quoted, with any `'` encoded.
|
370
366
|
- Unquoted, with `"`/`'` first character (if applicable), `>` last character (if applicable), and any whitespace encoded.
|
371
367
|
|
372
|
-
`class` attributes have their whitespace (after any decoding) trimmed and collapsed.
|
368
|
+
`class` and `d` attributes have their whitespace (after any decoding) trimmed and collapsed.
|
373
369
|
|
374
370
|
[Boolean attribute](./gen/attrs.json) values are removed.
|
375
|
-
[Some attributes](./gen/attrs.json) are completely removed if their value is empty or the default value after any processing.
|
371
|
+
[Some other attributes](./gen/attrs.json) are completely removed if their value is empty or the default value after any processing.
|
376
372
|
|
377
373
|
`type` attributes on `script` tags with a value equaling a [JavaScript MIME type](https://mimesniff.spec.whatwg.org/#javascript-mime-type) are removed.
|
378
374
|
|
@@ -384,10 +380,12 @@ Spaces are removed between attributes if possible.
|
|
384
380
|
|
385
381
|
Entities are decoded if valid (see relevant parsing section) and their decoded characters as UTF-8 is shorter or equal in length.
|
386
382
|
|
387
|
-
Numeric entities that do not refer to a valid Unicode Scalar Value are
|
383
|
+
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).
|
388
384
|
|
389
385
|
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`.
|
390
386
|
|
387
|
+
Right chevrons after any decoding in text are encoded to `>` if possible or `>` otherwise.
|
388
|
+
|
391
389
|
### Comments
|
392
390
|
|
393
391
|
Comments are removed.
|
@@ -404,7 +402,7 @@ hyperbuild simply does HTML minification, and almost does no syntax checking or
|
|
404
402
|
|
405
403
|
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>`
|
406
404
|
|
407
|
-
However, there are some syntax requirements for speed and sanity
|
405
|
+
However, there are some syntax requirements for speed and sanity.
|
408
406
|
|
409
407
|
### Tags
|
410
408
|
|
@@ -429,7 +427,7 @@ Numeric character references that do not reference a valid [Unicode Scalar Value
|
|
429
427
|
Backticks (`` ` ``) are not valid quote marks and not interpreted as such.
|
430
428
|
However, backticks are valid attribute value quotes in Internet Explorer.
|
431
429
|
|
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
|
430
|
+
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.
|
433
431
|
|
434
432
|
### Script and style
|
435
433
|
|
@@ -439,6 +437,6 @@ hyperbuild does **not** handle [escaped and double-escaped](./notes/Script%20dat
|
|
439
437
|
|
440
438
|
## Issues and contributions
|
441
439
|
|
442
|
-
|
440
|
+
Pull requests and any contributions welcome!
|
443
441
|
|
444
|
-
If hyperbuild did something unexpected,
|
442
|
+
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
data/lib/linux-ruby2.5
ADDED
Binary file
|
data/lib/linux-ruby2.6
ADDED
Binary file
|
data/lib/{linux → linux-ruby2.7}
RENAMED
Binary file
|
data/lib/macos-ruby2.5
ADDED
Binary file
|
data/lib/macos-ruby2.6
ADDED
Binary file
|
data/lib/macos-ruby2.7
ADDED
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.38
|
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
|
@@ -33,8 +33,12 @@ extra_rdoc_files: []
|
|
33
33
|
files:
|
34
34
|
- README.md
|
35
35
|
- lib/hyperbuild.rb
|
36
|
-
- lib/linux
|
37
|
-
- lib/
|
36
|
+
- lib/linux-ruby2.5
|
37
|
+
- lib/linux-ruby2.6
|
38
|
+
- lib/linux-ruby2.7
|
39
|
+
- lib/macos-ruby2.5
|
40
|
+
- lib/macos-ruby2.6
|
41
|
+
- lib/macos-ruby2.7
|
38
42
|
homepage: https://github.com/wilsonzlin/hyperbuild
|
39
43
|
licenses:
|
40
44
|
- MIT
|
data/lib/macos
DELETED
Binary file
|