fop-cli 3.9.3 → 3.9.5

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.
Files changed (3) hide show
  1. package/README.md +46 -5
  2. package/install.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -6,15 +6,36 @@ A Rust port of the EasyList FOP tool for sorting and cleaning ad-blocking filter
6
6
 
7
7
  - **Filter sorting**: Alphabetically sorts blocking rules and element hiding rules
8
8
  - **Domain combining**: Merges rules with identical selectors/patterns but different domains
9
- - **Option normalization**: Converts uBO-specific options to standard ABP format
9
+ - **Option normalization**: Converts uBO-specific options to standard ABP format (can be disabled)
10
10
  - **Wildcard cleanup**: Removes unnecessary wildcards from filters
11
11
  - **Validation**: Removes invalid/overly-broad rules (TLD-only, too short, etc.)
12
- - **Git/Hg integration**: Commit changes directly to repositories (can be disabled)
12
+ - **Git integration**: Commit changes directly to repositories (can be disabled)
13
13
  - **easylist_adservers.txt validation**: Ensures rules start with `|` or `/`
14
+ - **Parallel processing**: Uses all CPU cores for faster processing via Rayon
15
+
16
+ ## Extended Syntax Support
17
+
18
+ FOP preserves extended filter syntax from various adblockers:
19
+
20
+ ### uBlock Origin
21
+ - Scriptlet injection: `##+js(...)`, `##^script:has-text(...)`
22
+ - Procedural cosmetics: `:has-text()`, `:has()`, `:upward()`, `:remove()`, `:style()`, `:matches-css()`, `:xpath()`, `:remove-attr()`, `:remove-class()`, `:watch-attr()`, `:min-text-length()`, `:others()`
23
+ - Network options: `redirect=`, `redirect-rule=`, `removeparam=`, `denyallow=`, `replace=`, `header=`, `permissions=`, `to=`, `from=`, `method=`
24
+ - Regex domain rules: `/regex/##+js(...)`
25
+
26
+ ### AdGuard
27
+ - Scriptlet injection: `#%#//scriptlet(...)`
28
+ - CSS injection: `#$#body { ... }`
29
+ - Exceptions: `#@%#`, `#@$#`
30
+
31
+ ### Adblock Plus
32
+ - Extended selectors: `:-abp-has()`, `:-abp-contains()`, `:-abp-properties()`
33
+ - Action syntax: `{remove: true;}`, `{height:...}`, `{display:...}`
34
+ - Snippets: `#$#hide-if-contains`, `#$#simulate-mouse-event`
14
35
 
15
36
  ## Requirements
16
37
 
17
- - Rust 1.75+ (install from https://rustup.rs)
38
+ - Rust 1.80+ (install from https://rustup.rs)
18
39
 
19
40
  ## Building
20
41
 
@@ -31,6 +52,14 @@ cargo build --release
31
52
 
32
53
  ## Installation
33
54
 
55
+ ### From npm (recommended)
56
+
57
+ ```bash
58
+ npm install -g fop-cli
59
+ ```
60
+
61
+ ### From source
62
+
34
63
  ```bash
35
64
  # Install to /usr/local/bin (may need sudo)
36
65
  make install
@@ -55,6 +84,9 @@ fop /path/to/easylist
55
84
  fop --no-commit /path/to/easylist
56
85
  fop -n .
57
86
 
87
+ # Sort without converting uBO options to ABP format
88
+ fop --no-ubo-convert /path/to/ublock-filters
89
+
58
90
  # Sort multiple directories
59
91
  fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
60
92
  ```
@@ -63,8 +95,9 @@ fop -n ~/easylist ~/easyprivacy ~/fanboy-addon
63
95
 
64
96
  | Option | Description |
65
97
  |--------|-------------|
66
- | `-n, --no-commit` | Just sort files, skip Git/Hg commit prompts |
98
+ | `-n, --no-commit` | Just sort files, skip Git commit prompts |
67
99
  | `--just-sort` | Alias for `--no-commit` |
100
+ | `--no-ubo-convert` | Skip uBO to ABP option conversion (keep `xhr`, `3p`, `1p`, etc.) |
68
101
  | `-h, --help` | Show help message |
69
102
  | `-V, --version` | Show version number |
70
103
 
@@ -98,6 +131,14 @@ This Rust version is a drop-in replacement for both `FOP.py` and `FOP-nocommit.p
98
131
  | `python3 FOP.py` | `fop` |
99
132
  | `python3 FOP-nocommit.py` | `fop --no-commit` or `fop -n` |
100
133
 
134
+ ## Performance
135
+
136
+ The Rust version is significantly faster than Python FOP due to:
137
+ - Compiled native code
138
+ - Parallel file processing with Rayon
139
+ - Optimized regex handling
140
+ - Efficient memory management
141
+
101
142
  ## License
102
143
 
103
144
  GPL-3.0 (same as original Python FOP)
@@ -105,4 +146,4 @@ GPL-3.0 (same as original Python FOP)
105
146
  ## Credits
106
147
 
107
148
  - Original Python FOP by Michael (EasyList project)
108
- - Rust port maintains feature parity with Python version 3.9
149
+ - Rust port maintains feature parity with Python version 3.9
package/install.js CHANGED
@@ -7,7 +7,7 @@ const path = require('path');
7
7
  const { execSync } = require('child_process');
8
8
 
9
9
  // Configuration - UPDATE THESE FOR YOUR RELEASE
10
- const VERSION = '3.9.3';
10
+ const VERSION = '3.9.5';
11
11
  const GITHUB_REPO = 'ryanbr/fop-rs'; // Change to your repo
12
12
  const BINARY_NAME = 'fop';
13
13
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fop-cli",
3
- "version": "3.9.3",
3
+ "version": "3.9.5",
4
4
  "description": "Filter Orderer and Preener - A tool for sorting and cleaning ad-blocking filter lists",
5
5
  "keywords": [
6
6
  "adblock",