Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
918ae00
Initial plan
Copilot Jan 23, 2026
95289cd
feat: Add 2026 dependencies, configs, WordPress integration, testing,…
Copilot Jan 23, 2026
3c0aa1a
fix: Adjust dependency versions for compatibility with existing build…
Copilot Jan 23, 2026
194a68d
fix: Update compatible Rollup plugin versions and clarify WordPress m…
Copilot Jan 23, 2026
1497a54
security: Fix happy-dom vulnerability and add modernization summary
Copilot Jan 23, 2026
2fe1bd5
security: Update happy-dom to 20.0.2 to fix code generation vulnerabi…
Copilot Jan 23, 2026
c7ef358
docs: Update security summary with final happy-dom version
Copilot Jan 23, 2026
4b60d8c
Merge pull request #1 from mihail-moonz/copilot/modernize-squoosh-pro…
mihail-moonz Jan 23, 2026
b2045f7
Initial plan
Copilot Jan 23, 2026
b145c99
Implement P0-P2 code quality improvements: validation, race condition…
Copilot Jan 23, 2026
e73bf36
Fix TypeScript errors and apply code formatting
Copilot Jan 23, 2026
ccc32e2
Address code review feedback: reduce busy-waiting CPU usage and add c…
Copilot Jan 23, 2026
fda3baa
Merge pull request #2 from mihail-moonz/copilot/add-input-validation-…
mihail-moonz Jan 23, 2026
3134d8d
Initial plan
Copilot Jan 23, 2026
688a5b5
Add index.html, manifest.json, vite-env.d.ts, update vite.config.ts, …
Copilot Jan 23, 2026
961ffb3
Update .gitignore to exclude _codeql_detected_source_root symlink
Copilot Jan 23, 2026
433153c
Fix code review issues: remove duplicate type declarations, improve t…
Copilot Jan 23, 2026
638e73c
Merge pull request #3 from mihail-moonz/copilot/create-index-html-file
mihail-moonz Jan 23, 2026
c28f020
Initial plan
Copilot Jan 23, 2026
1ed57e7
Add preventAssignment: true and upgrade @rollup/plugin-replace to v6
Copilot Jan 23, 2026
01696e9
Merge pull request #4 from mihail-moonz/copilot/fix-chunk-splitting-e…
mihail-moonz Jan 23, 2026
bc8c04c
Initial plan
Copilot Jan 23, 2026
d197b1b
Update dependencies, add Vite custom plugins, and fix Rollup config
Copilot Jan 23, 2026
772aa91
Fix ES module imports and Rollup 4.x compatibility issues
Copilot Jan 23, 2026
fff2c39
Fix Vite config and dev server to work with custom import plugins
Copilot Jan 23, 2026
6bfc8db
Revert to Rollup 2.x for plugin compatibility - dev mode works with Vite
Copilot Jan 23, 2026
a8d86f7
Address code review feedback - translate comments and remove debug logs
Copilot Jan 23, 2026
61d1d68
Merge pull request #5 from mihail-moonz/copilot/fix-rollup-build-errors
mihail-moonz Jan 24, 2026
0d64b3c
Initial plan
Copilot Jan 24, 2026
848280f
Fix Rollup dynamic import issue and add comprehensive tests
Copilot Jan 24, 2026
9328d7f
Initial plan
Copilot Jan 24, 2026
1f0b79d
Address code review feedback - improve comments and type safety
Copilot Jan 24, 2026
8ca99b0
Fix Rollup build error and add test infrastructure
Copilot Jan 24, 2026
dd97f8f
Add comprehensive CI/CD workflows and testing infrastructure
Copilot Jan 24, 2026
cbdc904
Merge pull request #7 from mihail-moonz/copilot/fix-rollup-build-error
mihail-moonz Jan 24, 2026
a0c45bc
Merge branch 'dev' into copilot/fix-dynamic-import-issue
mihail-moonz Jan 24, 2026
da4b360
Merge pull request #6 from mihail-moonz/copilot/fix-dynamic-import-issue
mihail-moonz Jan 24, 2026
7643259
Initial plan
Copilot Jan 24, 2026
1fd2b59
Fix CI/CD build failures: add @vitest/coverage-v8 and PromiseRejectio…
Copilot Jan 24, 2026
90d221d
Address code review: use Promise.reject() instead of Promise.resolve(…
Copilot Jan 24, 2026
c40a0f4
Merge pull request #8 from mihail-moonz/copilot/fix-ci-cd-build-failures
mihail-moonz Jan 24, 2026
6912b68
Initial plan
Copilot Jan 24, 2026
7604b32
Fix TypeScript build error handling in simple-ts.js
Copilot Jan 24, 2026
9bd56ac
Add error handling for watch mode spawn process
Copilot Jan 24, 2026
5eaaaa7
Merge pull request #9 from mihail-moonz/copilot/fix-server-crash-erro…
mihail-moonz Jan 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
/codecs/**/*.js linguist-generated -diff
/codecs/*/pkg*/*.d.ts linguist-generated

# Test fixtures - binary files
test/fixtures/images/*.jpg binary
test/fixtures/images/*.jpeg binary
test/fixtures/images/*.png binary
test/fixtures/images/*.webp binary
test/fixtures/images/*.avif binary
test/fixtures/images/*.gif binary
280 changes: 280 additions & 0 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,280 @@
# GitHub Actions Workflows

This directory contains the CI/CD workflows for the Squoosh project.

## Workflows

### 1. Node.js CI (`node.js.yml`)

**Trigger:** Push and Pull Request events

**Purpose:** Main CI workflow that builds, tests, and validates the codebase.

**Steps:**

- Checkout code
- Setup Node.js (multiple versions: 20.x, 22.x)
- Install dependencies
- Run TypeScript type checking
- Build the project
- Run tests
- Generate test coverage reports
- Archive build artifacts

**Artifacts:**

- `build-output`: Compiled build files
- `coverage-report`: Test coverage reports

**Matrix:**

- OS: Ubuntu, Windows
- Node versions: 20.x, 22.x

---

### 2. Image Compression Tests (`image-compression-test.yml`)

**Trigger:**

- Push to main/develop branches
- Pull requests to main
- Manual workflow dispatch

**Purpose:** Test image compression functionality with real images and generate quality metrics.

**Steps:**

- Setup environment
- Build project
- Create or download test images
- Run compression tests
- Generate metrics report
- Upload results as artifacts
- Post results as PR comment

**Test Images:**

- `test-photo.jpg`: Sample photograph (~2MB)
- `test-graphic.png`: Sample graphic (~500KB)
- `test-small.jpg`: Small image (~100KB)
- `test-large.jpg`: Large image (~5MB)

**Artifacts:**

- `compression-results`: Compression test results and metrics

**Quality Gates:**

- Compression ratio validation
- Processing time limits
- Visual quality checks (when implemented)

---

### 3. Performance Benchmark (`benchmark.yml`)

**Trigger:**

- Weekly schedule (Monday at 00:00 UTC)
- Push to main branch
- Manual workflow dispatch

**Purpose:** Track performance metrics over time and detect regressions.

**Steps:**

- Build project
- Run performance benchmarks
- Compare with baseline
- Store new baseline (on main branch)
- Generate trend reports
- Alert on regressions

**Metrics Tracked:**

- Build time
- Bundle size
- Compression speed by format
- Memory usage (future)
- CPU utilization (future)

**Artifacts:**

- `benchmark-results`: Performance benchmark data

---

## Interpreting Results

### Build Status

The Node.js CI workflow provides the main build status:

- ✅ Green: All builds and tests passed
- ❌ Red: Build or tests failed
- 🟡 Yellow: Workflow still running

### Test Coverage

Coverage reports are generated for the Ubuntu + Node 20.x combination:

- View in the `coverage-report` artifact
- Look for files in `coverage/index.html`

### Compression Metrics

When compression tests run, check the PR comment or workflow summary for:

- Compression ratios by format
- Processing times
- Quality metrics (SSIM, PSNR when available)

### Performance Benchmarks

Benchmark results show:

- Current performance metrics
- Comparison with baseline
- Trend analysis (after multiple runs)
- Regression alerts

---

## Adding New Test Images

To add new test images for compression testing:

1. **Add the image file:**

```bash
cp your-image.jpg test/fixtures/images/
```

2. **Update the image README:**
Edit `test/fixtures/images/README.md` to document the new image

3. **Update .gitattributes:**
If it's a binary format not already listed:

```
test/fixtures/images/*.your-format binary
```

4. **Update the workflow:**
Edit `.github/workflows/image-compression-test.yml` to include the new image in tests

---

## Running Workflows Locally

### Node.js CI

```bash
# Install dependencies
npm ci

# Type check
npx tsc --noEmit

# Build
npm run build

# Run tests
npm run test:run

# Generate coverage
npm run test:run -- --coverage
```

### Image Compression Tests

```bash
# Create test images (requires ImageMagick)
mkdir -p test/fixtures/images
convert -size 800x600 plasma: test/fixtures/images/test-photo.jpg

# Run integration tests
npm run test:run test/integration/compression.test.ts
```

### Performance Benchmarks

```bash
# Build project
npm run build

# Run benchmarks (when implemented)
# npm run benchmark
```

---

## Troubleshooting

### Tests Failing in CI but Passing Locally

- Check Node.js version compatibility
- Verify environment variables are set correctly
- Check for timing issues in tests
- Review logs in the Actions tab

### Compression Tests Not Running

- Verify test images exist in `test/fixtures/images/`
- Check ImageMagick is available in CI (for image generation)
- Review the workflow logs for error messages

### Benchmark Baseline Missing

- First run on main branch will establish baseline
- Baseline is stored in `benchmark/baseline/`
- Re-run workflow to establish new baseline if needed

---

## Best Practices

1. **Always run tests locally before pushing**
2. **Keep test images small** (under 5MB each)
3. **Document any new metrics** added to benchmarks
4. **Review coverage reports** for new code
5. **Monitor benchmark trends** for performance regressions

---

## CI/CD Pipeline Diagram

```
Push/PR
├─→ Node.js CI
│ ├─→ Type Check
│ ├─→ Build
│ ├─→ Test
│ └─→ Coverage
├─→ Image Compression Tests
│ ├─→ Generate Test Images
│ ├─→ Run Compression
│ ├─→ Measure Metrics
│ └─→ Report Results
└─→ Performance Benchmark (weekly/main)
├─→ Run Benchmarks
├─→ Compare Baseline
├─→ Detect Regressions
└─→ Update Baseline
```

---

## Future Enhancements

- [ ] Add E2E tests with Playwright
- [ ] Implement visual regression testing
- [ ] Add Docker container builds
- [ ] Set up automatic deployment
- [ ] Add security scanning (CodeQL, Snyk)
- [ ] Implement performance budgets
- [ ] Add accessibility testing
Loading