3.3 KiB
3.3 KiB
Development Guide
Quick Start
-
Install dependencies:
pnpm install -
Start development mode:
pnpm devThis watches for file changes and rebuilds automatically.
-
Load in Firefox:
- Open
about:debugging#/runtime/this-firefox - Click "Load Temporary Add-on"
- Select
dist/manifest.json
- Open
-
After making changes:
- The extension rebuilds automatically in dev mode
- Click "Reload" in the Firefox debugging page
Development Workflow
Making Changes
- Edit source files in
src/ - Run
pnpm buildor usepnpm dev(watch mode) - Reload the extension in Firefox
- Test your changes
Adding New Features
- Create new service files in
src/services/ - Add type definitions in
src/types/ - Write tests in
src/tests/ - Run
pnpm testto verify - Run
pnpm lintto check code quality
Testing
# Run tests once
pnpm test --run
# Run tests in watch mode
pnpm test
# Run tests with UI
pnpm test:ui
Code Quality
# Check linting
pnpm lint
# Auto-fix linting issues
pnpm lint:fix
# Format code
pnpm format
# Check formatting
pnpm format:check
Debugging
Console Logs
- Background Script: Check Browser Console (Ctrl+Shift+J)
- Content Script: Check Web Console on the page (F12)
- Popup: Right-click popup → Inspect
Common Issues
- Extension not loading: Check console for errors in manifest.json
- Content script not running: Check host_permissions in manifest
- Storage not working: Check permissions in manifest
Browser API Reference
Project Files
Core Files
src/background.ts- Handles storage and message passingsrc/content.ts- Injects into web pages, handles form detectionsrc/popup.ts- Popup UI logicsrc/manifest.json- Extension configuration
Services
src/services/formDetector.ts- Detects form fieldssrc/services/fieldMatcher.ts- Matches fields to resume data
Configuration
tsconfig.json- TypeScript configuration (strict mode)vite.config.ts- Build configuration.eslintrc.json- Linting rules.prettierrc- Formatting rules
Tips
- Use TypeScript's strict mode features
- Write tests for new business logic
- Keep UI and business logic separate
- Use the native browser API (no polyfills needed)
- Follow the existing code style
Packaging for Distribution
When ready to publish:
- Update version in
package.jsonandsrc/manifest.json - Run
pnpm build - Test the
dist/folder thoroughly - Create a zip of the
dist/folder - Submit to Firefox Add-ons