Skip to content

feat: add external rule source importer - #7

Merged
HexCodeYT merged 1 commit into
mainfrom
dev/external-rule-importers
Jul 19, 2026
Merged

HexCodeYT merged 1 commit into
mainfrom
dev/external-rule-importers

Conversation

@HexCodeYT

Copy link
Copy Markdown
Owner

Summary

Adds the first external rule-source compiler for PlainLink. The new plainlink-rules binary imports a conservative subset of ClearURLs JSON into PlainLink's existing .plainlink runtime format, so the cleaner can interoperate with mature rule ecosystems without changing clipboard/runtime code.

Details

  • add plainlink-rules import-clearurls
  • parse ClearURLs JSON without adding runtime dependencies
  • import only safely representable providers: concrete domains plus simple exact/prefix query parameters
  • skip providers with exceptions, wildcard TLDs, complete-provider rules, raw URL rules, redirections, and unsupported regex params
  • add rules/sources.toml source metadata for ClearURLs, EasyList/uBO, and Firefox query stripping
  • add importer fixture and integration tests
  • document external source architecture, licensing posture, and future importer plan

Validation

  • cargo fmt --check
  • cargo test
  • cargo clippy --all-targets -- -D warnings
  • cargo run --bin plainlink-rules -- import-clearurls --input tests/fixtures/clearurls-sample.json --output /tmp/plainlink-clearurls-sample.plainlink --source-name 'ClearURLs Test Fixture' --source-url 'https://example.test/clearurls.json' --license test-only
  • scripts/package-macos-app.sh

Notes

  • This PR does not vendor generated third-party rules.
  • Licensing/attribution metadata is documented, but generated external rules should stay out of the repo until redistribution terms are reviewed.

@HexCodeYT
HexCodeYT merged commit 0841405 into main Jul 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant