Skip to content

refactor: refactor tinyShield into publishable library workspace#74

Open
piquark6046 wants to merge 2 commits into
mainfrom
feat/lib
Open

refactor: refactor tinyShield into publishable library workspace#74
piquark6046 wants to merge 2 commits into
mainfrom
feat/lib

Conversation

@piquark6046

@piquark6046 piquark6046 commented Jun 8, 2026

Copy link
Copy Markdown
Member

Summary

  • Add @filteringdev/tinyshield-lib as a new workspace package with ESM exports.
  • Move userscript monkey patches and utilities into libs/source/monkey-patches.
  • Move reference domain loading and domain utilities into libs/source/references.
  • Keep userscript/source/index.ts as the distributed userscript entrypoint.
  • Update builder to load domains through @filteringdev/tinyshield-lib/references.
  • Update npm release workflow to publish both @filteringdev/tinyshield and @filteringdev/tinyshield-lib.

Details

  • Adds patch-level controller APIs for enabling/disabling tinyShield monkey patches.
  • Uses switch-only disable behavior: installed wrappers remain in place, but disabled patches delegate to the original target.
  • Adds package exports for:
    • @filteringdev/tinyshield-lib
    • @filteringdev/tinyshield-lib/monkey-patches
    • @filteringdev/tinyshield-lib/references
  • Moves builder reference tests into the new library package and adds controller tests.

Verification

  • npm run lint
  • npm run test
  • npm run build -w libs
  • npm run build:userscript
  • npm pack --dry-run --json
  • cd libs && npm pack --dry-run --json

- Add SafeArrayToString utility for safe array string conversion.
- Introduce custom-defined matches and exclusion sets for domain filtering.
- Create functions to fetch Ad-Shield domains from AdGuard and uBlock Origin filter lists.
- Implement logic to parse and filter Ad-Shield domains, including CDN checks.
- Add IAB sellers fetching functionality with validation.
- Develop utility functions for domain wildcard handling and grouping by TLD.
- Enhance testing suite with comprehensive tests for new functionalities.
- Update TypeScript configuration for libraries and userscript.
- Modify package.json scripts for improved build processes and workspace management.
@piquark6046 piquark6046 marked this pull request as ready for review June 8, 2026 16:21
@piquark6046 piquark6046 changed the title feat: Implement Ad-Shield domain filtering and wildcard handling refactor: refactor tinyShield into publishable library workspace Jun 8, 2026
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