Development Setup

Setting up your development environment for BetterSEQTA-Plus

Prerequisites

Before setting up BetterSEQTA-Plus development:

  • Node.js: Version 18 or higher
  • Package Manager: npm, pnpm, or yarn
  • Browser: Chrome, Firefox, or Safari for testing
  • Git: For version control

Initial Setup

1. Clone Repository

git clone https://github.com/betterseqta/betterseqta-plus.git
cd betterseqta-plus

2. Install Dependencies

npm install
# or
pnpm install

3. Build Extension

npm run build

This creates the extension bundle in the dist/ directory.

Loading Extension in Browser

Chrome/Chromium

  1. Open Chrome and navigate to chrome://extensions/
  2. Enable "Developer mode" (toggle in top right)
  3. Click "Load unpacked"
  4. Select the dist/ directory
  5. Extension will be loaded

Firefox

  1. Open Firefox and navigate to about:debugging
  2. Click "This Firefox"
  3. Click "Load Temporary Add-on"
  4. Select dist/manifest.json
  5. Extension will be loaded

Development Mode

Watch Mode

For active development with auto-reload:

npm run dev

This will:

  • Watch for file changes
  • Rebuild automatically
  • Reload extension in browser

Manual Reload

After making changes:

  1. Rebuild: npm run build
  2. Reload extension in browser
  3. Refresh SEQTA Learn page

Project Structure

betterseqta-plus/
├── src/
│   ├── content/          # Content scripts
│   │   ├── main.ts       # Main content script
│   │   └── features/     # Feature modules
│   ├── background/       # Background scripts
│   │   └── service-worker.ts
│   ├── popup/           # Popup UI
│   │   ├── popup.html
│   │   └── popup.ts
│   ├── options/         # Options page
│   │   ├── options.html
│   │   └── options.ts
│   ├── shared/          # Shared code
│   │   ├── utils.ts
│   │   └── types.ts
│   └── styles/          # CSS files
│       └── main.css
├── public/              # Static assets
├── manifest.json        # Extension manifest
├── tsconfig.json        # TypeScript config
├── webpack.config.js    # Build config
└── package.json         # Dependencies

Configuration Files

manifest.json

Extension manifest configuration:

{
  "manifest_version": 3,
  "name": "BetterSEQTA-Plus",
  "version": "1.0.0",
  "description": "Enhanced SEQTA Learn experience",
  "permissions": [
    "storage",
    "scripting",
    "activeTab"
  ],
  "content_scripts": [
    {
      "matches": ["*://*.seqta.com.au/*"],
      "js": ["content.js"]
    }
  ],
  "background": {
    "service_worker": "background.js"
  },
  "action": {
    "default_popup": "popup.html"
  }
}

TypeScript Configuration

tsconfig.json for type checking:

{
  "compilerOptions": {
    "target": "ES2020",
    "module": "ESNext",
    "lib": ["ES2020", "DOM"],
    "strict": true,
    "moduleResolution": "node"
  }
}

Development Tools

VS Code Setup

Recommended extensions:

  • ESLint: Code linting
  • Prettier: Code formatting
  • TypeScript: Type checking
  • Chrome Extension: Extension development

Debugging

Content Scripts

  1. Open SEQTA Learn page
  2. Open DevTools (F12)
  3. Go to Sources tab
  4. Find extension files
  5. Set breakpoints

Background Scripts

  1. Go to chrome://extensions/
  2. Find BetterSEQTA-Plus
  3. Click "service worker" link
  4. DevTools opens for background script
  1. Right-click extension icon
  2. Select "Inspect popup"
  3. DevTools opens for popup

Testing

Manual Testing

  1. Load extension in browser
  2. Navigate to SEQTA Learn
  3. Test features manually
  4. Check console for errors

Automated Testing

npm run test

Building for Production

Production Build

npm run build:prod

Creating Release Package

npm run package

Creates a zip file ready for distribution.

Troubleshooting

Extension Not Loading

  • Check manifest.json for errors
  • Verify all files are built
  • Check browser console for errors
  • Ensure permissions are correct

Changes Not Appearing

  • Rebuild extension
  • Reload extension in browser
  • Hard refresh SEQTA page (Ctrl+Shift+R)
  • Clear browser cache

Type Errors

npm run typecheck

Fix TypeScript errors before building.

Next Steps