ci: web CI workflow, lint fixes, unit tests (#48)#63
Merged
Conversation
Closes #48. CI: - Add .github/workflows/web-ci.yml: on PR + push(main) for web/**, .github/scripts/**. Job `web` runs npm ci, lint, vitest, next build, and tsc --noEmit (after build so generated next-env.d.ts / .next/types exist). Job `scripts` runs the Python unittest suite. Actions pinned to SHAs. Lint (npm run lint now exits 0): - Fix the two set-state-in-effect errors (preloader reduced-motion, store localStorage hydration) with justified eslint-disable — both are intentional post-mount syncs where a lazy initializer would cause a hydration mismatch. - deck.tsx: ternary statement -> if/else (no-unused-expressions). - store.tsx: drop the throwaway destructure binding (no-unused-vars). - error.tsx: use <Link> instead of <a> (no-html-link-for-pages). - Ignore components/vendor/** (minified third-party Framer code). Tests: - vitest (dev dep) + `test` script. lib/listings.test.ts and lib/parse-readme.test.ts cover parsePrizeValue, deriveState, splitTitle, themesFor, resolveAssetSrc, and table parsing (happy path + malformed). - .github/scripts/test_scripts.py (stdlib unittest): parse_deadline_date, sanitize_field, is_valid_email, escape_attr, parse_issue_body, parse_state, parse_deadline, and the SSRF guard. - Exported the tested lib functions for direct import. Verified: lint exit 0; 15 JS tests + 13 Python tests pass; next build + tsc --noEmit succeed; workflow YAML valid; production audit (--omit=dev) clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jul 7, 2026
The lock update had deleted the @emnapi/core and @emnapi/runtime package
nodes while five dependency edges (@rolldown/binding-wasm32-wasi,
@napi-rs/wasm-runtime peerDeps, etc.) still referenced them, leaving the
lockfile internally inconsistent. `npm ci` — the first step of the new Web
CI job — failed deterministically ("Missing: @emnapi/runtime / @emnapi/core
from lock file"), so lint/test/build/tsc never ran.
Regenerated with `npm install` (re-adds exactly the two missing nodes).
Verified the full CI pipeline locally on node 24: npm ci, npm run lint,
npm run test (15/15), npm run build, and npx tsc --noEmit all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
My previous lockfile resync used local npm 11.6.2, which resolves the
@emnapi/core and @emnapi/runtime transitive deps to 1.11.2. The CI runner
(node 24.18.0 / npm 11.16.0) computes a tree that needs the 1.11.1 nodes, so
`npm ci` still failed there ("Missing: @emnapi/core@1.11.1 from lock file")
even though it passed locally under 11.6.2.
Reconciled the lockfile with npm@11.16.0 (the exact runner version).
Verified against that version: `npm ci` fails on the old lockfile and passes
on this one; lint, test (15/15), build, and tsc --noEmit all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Jose-Gael-Cruz-Lopez
added a commit
that referenced
this pull request
Jul 7, 2026
Carry the lockfile fix from #63 onto this branch so its Web CI passes rather than failing at `npm ci` on the inherited out-of-sync lockfile. Regenerated with npm@11.16.0 (the CI runner version); verified `npm ci`, lint, test (15/15), build, and tsc --noEmit all pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #48. Stacked on #62 (base
reliability/error-handling-and-freshness). Merge #60 → #61 → #62 → this.CI —
.github/workflows/web-ci.ymlOn PR + push to
main, pathsweb/**/.github/scripts/**. SHA-pinned actions.webjob:npm ci→lint→test(vitest) →build→tsc --noEmit. tsc runs after build becausenext buildgeneratesnext-env.d.ts+.next/types(both gitignored → absent on fresh checkout).scriptsjob: Pythonunittestsuite.Lint —
npm run lintnow exits 0preloaderreduced-motion,storelocalStorage hydration) → justifiedeslint-disable: both are intentional post-mount syncs where a lazy initializer would cause a hydration mismatch.deck.tsx: ternary statement →if/else.store.tsx: dropped the throwaway destructure (no-unused-vars).error.tsx:<a>→<Link>(a lint error I'd introduced in reliability: error boundaries, guarded reads, live deadlines (#46, #47) #62).components/vendor/**(minified third-party Framer code).Tests
parsePrizeValue,deriveState,splitTitle,themesFor,resolveAssetSrc, table parsing — happy path + malformed. (Exported those functions for direct import.)parse_deadline_date,sanitize_field,is_valid_email,escape_attr,parse_issue_body,parse_state,parse_deadline, SSRF guard.Acceptance criteria
web/and fail on errorsnpm run lintexits 0Verification
next build+tsc --noEmitsucceed · workflow YAML valid ·npm audit --omit=devclean🤖 Generated with Claude Code