From 12ed0bee61c92627df9da2e3107dfba7695b2eb9 Mon Sep 17 00:00:00 2001 From: Dave Perera Date: Tue, 30 Jun 2026 13:26:41 +0530 Subject: [PATCH 1/3] Add .gitignore file Initialize .gitignore with common patterns for Node.js projects, OS-specific files, build artifacts, and Chrome extension/certificate files. --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6742e2c --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +.DS_Store +Thumbs.db +node_modules/ +*.zip +*.crx +*.pem From 8606542e2c70c9ecff3decaf8adde459f24d9dfc Mon Sep 17 00:00:00 2001 From: Dave Perera Date: Tue, 30 Jun 2026 13:28:54 +0530 Subject: [PATCH 2/3] Add CI workflow for Chrome extension validation Add GitHub Actions workflow to validate the extension on every push to main and pull request. The workflow checks for valid manifest.json, required files, JS syntax errors, and verifies manifest references match the filesystem. --- .github/workflows/ci.yml | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..a914f57 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,89 @@ +name: CI + +on: + push: + branches: [main] + paths-ignore: + - "**.md" + - "assets/**" + - "LICENSE" + pull_request: + branches: [main] + +jobs: + validate: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Validate manifest.json + run: | + node -e "JSON.parse(require('fs').readFileSync('manifest.json', 'utf8'))" \ + && echo "✓ manifest.json is valid JSON" + + - name: Check manifest_version is 3 + run: | + node -e " + const m = JSON.parse(require('fs').readFileSync('manifest.json', 'utf8')); + if (m.manifest_version !== 3) { + console.error('✗ manifest_version is not 3'); + process.exit(1); + } + console.log('✓ manifest_version is 3'); + " + + - name: Check required files exist + run: | + required_files=( + "background.js" + "popup.html" + "popup.js" + "style.css" + "manifest.json" + "lib/transformers.min.js" + "lib/ort-wasm.wasm" + "lib/ort-wasm-simd.wasm" + "icons/icon16.png" + "icons/icon48.png" + "icons/icon128.png" + ) + missing=0 + for f in "${required_files[@]}"; do + if [ ! -f "$f" ]; then + echo "✗ Missing required file: $f" + missing=1 + fi + done + if [ "$missing" -eq 1 ]; then + exit 1 + fi + echo "✓ All required files present" + + - name: Check JS files for syntax errors + run: | + for f in background.js popup.js; do + node --check "$f" && echo "✓ $f has valid syntax" + done + + - name: Verify manifest references match filesystem + run: | + node -e " + const fs = require('fs'); + const m = JSON.parse(fs.readFileSync('manifest.json', 'utf8')); + const checks = [ + m.background?.service_worker, + m.action?.default_popup, + ...Object.values(m.icons || {}), + ...Object.values(m.action?.default_icon || {}), + ].filter(Boolean); + let ok = true; + for (const path of checks) { + if (!fs.existsSync(path)) { + console.error('✗ manifest references missing file: ' + path); + ok = false; + } + } + if (!ok) process.exit(1); + console.log('✓ All manifest-referenced files exist'); + " \ No newline at end of file From 6c2100575231d2ade132496a2c157fda5f920840 Mon Sep 17 00:00:00 2001 From: Dave Perera Date: Tue, 30 Jun 2026 13:30:03 +0530 Subject: [PATCH 3/3] Skip CI for doc-only PR changes Add paths-ignore to pull_request trigger to prevent CI workflows from running when only documentation or LICENSE files are modified. This reduces unnecessary build overhead for documentation only updates. --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a914f57..ba987d4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,6 +9,9 @@ on: - "LICENSE" pull_request: branches: [main] + paths-ignore: + - "**.md" + - "LICENSE" jobs: validate: