Skip to content

Conversation

@VikramAditya33
Copy link
Collaborator

This PR implements the CI/QA wiring for the new Vue.js UI and aligns the project’s workflows with the patterns used in other openZIM projects (Mindtouch, freecodecamp). It also adds Prettier and ESLint to pre-commit and ensures Vitest is correctly wired with a minimal smoke test.

Changes

  • QA workflow split (.github/workflows/QA.yaml)

  • Rename the single check-qa job into two jobs:

  • check-scraper-qa: runs Black, Ruff, and Pyright on the Python scraper (same behavior as before).

  • check-zimui-qa: new job for the Vue UI that:

  1. Sets up Node.js 20.
  2. Installs dependencies in ui/ via npm ci.
  3. Runs Prettier in check mode on ui/src (npx prettier --check src/).
  4. Runs ESLint via npm run lint.
  • Tests workflow split (.github/workflows/Tests.yaml)

  • Split the monolithic tests into four jobs:

  • test-scraper: runs Python tests with coverage and uploads to Codecov (using codecov/codecov-action@v5).

  • build-scraper: ensures the scraper can be built as sdist + wheel.

  • build-and-test-zimui: new job for the Vue UI that:

  1. Sets up Node.js 20.
  2. Installs dependencies in ui/ via npm ci.
  3. Runs npm run test:unit.
  4. Builds the UI with npm run build.
  • build_docker: unchanged Docker image build + run check for the scraper image.

  • Pre-commit configuration (.pre-commit-config.yaml)

  • Add Prettier mirror:

  • prettier hook targeting ui/ files (files: ui\/.*$).

  • Add ESLint mirror:

  • eslint hook targeting ui/src JS/TS/Vue files:

  • files: ui\/src\/.*(?:\.[jt]sx?|\.vue)$

  • Uses ui/.eslintrc.cjs as config.

  • Keep existing Python hooks (pre-commit-hooks, Black, Ruff, Pyright) unchanged.

  • Vitest wiring (ui/src/utils/__tests__/placeholder.test.ts)

  • Convert the placeholder test into a minimal but valid Vitest suite:

  • Import describe, it, expect from vitest.

  • Keep a simple “always true” test so the test pipeline is exercised.

  • Intention is to keep this as a temporary smoke test and add real unit tests in a follow‑up issue.

Fixes #362.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Github workflows for Vue.JS UI

2 participants