DevOps: Fix and harden CI pipeline (#5) - #6
Conversation
…fig-paths - Add .github/workflows/ci.yml (Node 20, npm install && npm run build) - Replace jq-based clean_prod_manifest with scripts/clean-manifest.cjs - Update vite.config.ts to import from node:path/node:url and add vite-tsconfig-paths plugin with @ alias - Install vite-tsconfig-paths devDependency Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
SummaryThis PR does three things: (1) adds a GitHub Actions CI workflow that runs CRITICAL (Blocks Merge)None. No security vulnerabilities or guaranteed data-loss bugs in the code that was actually written. MAJOR (Blocks Merge)1. CI uses File:
# Replace:
run: npm install
# With:
run: npm ci2. File:
// Replace the readFileSync line with:
if (!fs.existsSync(manifestPath)) {
console.error(`[clean-manifest] dist/manifest.json not found at ${manifestPath}. Did 'vite build' succeed?`);
process.exit(1);
}
const manifest = JSON.parse(fs.readFileSync(manifestPath, "utf-8"));3. File:
4. CI has no File:
- name: Lint
run: npm run lintMINOR (Does Not Block)5. The Playwright test file ( Files: These are visible in Notably, 6. File: import dotenv from 'dotenv';
7. The Playwright test uses hardcoded absolute paths that only work on the developer's local machine File: const extensionPath = '/tmp/discrub-ext/dist';
const userDataDir = '/tmp/test-user-data-dir';
const stateStr = fs.readFileSync('/tmp/discord-state.json', 'utf8');On any other machine, or in a CI runner where the workspace is not at that exact path, this test will fail with 8. Redundant File:
// tsconfig.json compilerOptions:
"baseUrl": ".",
"paths": {
"@/*": ["src/*"]
}Without this, 9. Nine new production dependencies with no corresponding source usage in this diff File:
NIT (Does Not Block)10. No File: Using 11. CI job name is File: Once a VerdictRequest Changes The
|
…ath aliases, clean-manifest guard, remove @types/uuid, fix test paths - ci.yml: use npm ci, pin node to 20.18.0, add lint step before build - clean-manifest.cjs: guard against missing dist/manifest.json with existsSync check - package.json: remove unused @types/uuid devDependency - tsconfig.json: add baseUrl and @/* path aliases pointing to src/* - tests/export.spec.ts + playwright.config.ts: replace hardcoded /tmp paths with portable path.resolve(__dirname) and os.tmpdir() Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Resolves #5. Hardens the GitHub Actions workflow by fixing npm lockfile mismatches, replacing system jq with a portable node script for manifest manipulation, and resolving vite/path import issues.