Skip to content

Commit 3bc0856

Browse files
Update BUILD.md for current CI, testing, and build system
- Fix output locations (build/bundle/, not build/{browser}/) - Add visual regression testing section - Add CI matrix documentation - Remove outdated symlink workflow - Update version tracking with VERSION_TAG for CI releases 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a65b8d1 commit 3bc0856

1 file changed

Lines changed: 32 additions & 32 deletions

File tree

BUILD.md

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ npm run build
2929

3030
## Output Locations
3131

32-
- Firefox XPI: `build/firefox/github-bookmarked-issues-{version}.xpi`
33-
- Chrome ZIP: `build/chrome/github-bookmarked-issues-{version}.zip`
32+
- Firefox XPI: `build/bundle/github-bookmarked-issues-{version}.xpi`
33+
- Chrome ZIP: `build/bundle/github-bookmarked-issues-{version}.zip`
3434

3535
## Build System Architecture
3636

@@ -98,9 +98,7 @@ Our build system uses `web-ext` where appropriate (Firefox packaging/linting) wh
9898

9999
## Development Workflow
100100

101-
### Option 1: Auto-rebuild with File Watcher (Recommended)
102-
103-
Test both browsers simultaneously with automatic rebuilds on file changes:
101+
Use the file watcher for automatic rebuilds during development:
104102

105103
```bash
106104
# Terminal 1: Start file watcher
@@ -124,35 +122,37 @@ npm run dev:watch
124122
2. Watcher detects change and rebuilds (~2-3 seconds)
125123
3. Reload extension in browser to see changes
126124

127-
### Option 2: Manual Development (Firefox only)
128-
129-
Firefox can load directly from source without building:
125+
### Running Tests
130126

131127
```bash
132-
# Create symlink to Firefox manifest
133-
ln -sf manifest-firefox.json extension/manifest.json
134-
135-
# Load in Firefox
136-
# about:debugging → "Load Temporary Add-on" → select extension/manifest.json
128+
npm test # All tests
129+
npm run test:chrome # Chrome-specific
130+
npm run test:visual # Visual regression tests only
131+
npm run lint # Lint Firefox build
137132
```
138133

139-
**Note**: Chrome does not follow symlinks, so it always requires building. For Chrome development, use Option 1.
140-
141-
### Making Changes (Manual mode)
134+
### Visual Regression Tests
142135

143-
1. Edit files in `extension/` directory
144-
2. **Firefox**: Click "Reload" in `about:debugging` (no rebuild needed)
145-
3. **Chrome**: Run `npm run build:chrome` and reload extension
136+
Visual tests compare screenshots against baseline images to detect unintended UI changes.
146137

147-
### Running Tests
138+
- Baselines stored in `tests/screenshots/`
139+
- Tests tagged with `@visual` in test names
140+
- Tolerances: 2% pixel diff ratio, 0.2 per-pixel threshold (accounts for font rendering differences)
148141

149142
```bash
150-
npm test # All tests
151-
npm run test:chrome # Chrome-specific
152-
npm run test:visual # Visual regression tests only
153-
npm run lint # Lint Firefox build
143+
npm run test:visual # Run visual tests
144+
npm run test:visual:update # Update baseline screenshots
154145
```
155146

147+
### CI Testing
148+
149+
Tests run on macOS, Ubuntu, and Windows via GitHub Actions matrix. Each OS uploads:
150+
- Built Chrome extension (`.zip`)
151+
- Playwright HTML report
152+
- Test results directory
153+
154+
Artifacts are retained for 7 days for debugging failed runs.
155+
156156
### Authenticated Tests
157157

158158
Some tests require GitHub authentication (bookmarks view, error handling). These skip gracefully if not configured.
@@ -172,11 +172,12 @@ Dev builds include git commit info in `version_name` (visible in `chrome://exten
172172

173173
| Build Type | version_name Example |
174174
|----------------------------|-------------------------------------------|
175-
| Production (tagged commit) | `1.0.0` |
175+
| Release (CI with tag) | `1.0.0-rc1` (from tag `v1.0.0-rc1`) |
176+
| Release (local tagged) | `1.0.0-rc1` (detected via git describe) |
176177
| Dev (clean) | `1.0.0-dev+abc1234` |
177178
| Dev (uncommitted changes) | `1.0.0-dev+abc1234-dirty:worktree-name` |
178179

179-
The dirty suffix includes the worktree directory name to distinguish between multiple worktrees.
180+
CI release builds receive the tag name via `VERSION_TAG` environment variable. Local builds detect tags via `git describe --exact-match HEAD`. The dirty suffix includes the worktree directory name to distinguish between multiple worktrees.
180181

181182
## Dependency Information
182183

@@ -200,19 +201,18 @@ npm install
200201
npm run build:firefox
201202
```
202203

203-
Output: `build/firefox/github-bookmarked-issues-{version}.xpi`
204+
Output: `build/bundle/github-bookmarked-issues-{version}.xpi`
204205

205206
Source code is in `extension/`, build scripts in `scripts/`. Same source + dependencies = same output.
206207

207208
## Troubleshooting
208209

209210
**"File does not contain a valid manifest" in Firefox**:
210-
- When loading from source, ensure `extension/manifest.json` symlink points to `manifest-firefox.json`
211-
- Firefox rejects manifests containing `$schema` field
212-
- When using file watcher, load from `build/firefox/manifest.json`
211+
- Load from `build/firefox/manifest.json`, not from `extension/` directory
212+
- Firefox rejects manifests containing `$schema` field (Chrome manifest has this)
213213

214-
**Chrome won't load extension**:
215-
- Chrome does not follow symlinks - always load from `build/chrome/` directory
214+
**Extension not loading**:
215+
- Always load from `build/{browser}/` directory, not from `extension/`
216216
- Use `npm run dev:watch` for automatic rebuilds during development
217217

218218
**Watcher not detecting changes**:

0 commit comments

Comments
 (0)