Skip to main content

Contributing

TagDragon is open source and contributions are welcome! Whether you want to add a new provider, fix a bug, or improve documentation — here’s how to get started.

Development Setup

Requirements: Node.js 18+

git clone https://github.com/onbezucha/tagdragon.git
cd tagdragon
npm install
npm run dev        # watch mode (CSS + JS)

Load the extension in Chrome:

  1. Open chrome://extensions/
  2. Enable Developer mode
  3. Click Load unpacked → select the repo folder
  4. Open DevTools on any page → TagDragon tab

Available Scripts

CommandDescription
npm run devWatch mode — rebuilds CSS + JS on changes
npm run buildProduction build
npm run lintESLint check
npm run formatPrettier auto-format
npm run format:checkPrettier check (used in CI)
npm run analyzeBuild with bundle visualizer → opens dist/stats.html
npm run generate-iconsRegenerate provider icons from Lucide

Adding a New Provider

  1. Create a provider file in src/providers/<category>/<name>.ts:
import type { Provider } from '@/types/provider';

export const MyProvider: Provider = {
  name: 'My Provider',
  domains: [/myprovider\.com/],
  decode: (request) => {
    // return Record<string, string> of decoded params
    return {};
  },
};
  1. Register it in src/providers/index.ts — import and add to the PROVIDERS array.
  2. Assign a category group in src/shared/provider-groups.ts — add the provider name to the correct group.
  3. Test manually — load the extension, open a page that fires the tracker, verify it appears in TagDragon.

See existing providers in src/providers/ for reference. Simple providers (URL-parameter based) are just a few lines.

Code Style

  • TypeScript strict mode — no any unless unavoidable (Chrome API edge cases)
  • Single quotes, 2-space indent, semicolons — enforced by Prettier
  • No production dependencies — all logic must be self-contained
  • HTML escaping — always use esc() from src/panel/utils/format.ts for user-visible strings

Pre-commit Hooks

After npm install, Husky is set up automatically. Each commit runs:

  • eslint on staged .ts files
  • prettier --write on staged .ts files

Pull Request Guidelines

  • One feature/fix per PR
  • Describe what the change does and why
  • For new providers: include the provider’s tracking domain and a brief description in the PR body
  • CI must pass (lint + format check + build)

Reporting Issues

Use the GitHub issue tracker:

  • Bug report — unexpected behaviour in the extension
  • Feature request — new functionality
  • New provider — request support for an analytics/marketing tool

For the full contribution guide, see CONTRIBUTING.md on GitHub.

Was this page helpful?

Start typing to search docs...