Skip to content

Latest commit

 

History

History
115 lines (78 loc) · 2.54 KB

File metadata and controls

115 lines (78 loc) · 2.54 KB

Contribution guidelines

Prerequisites

Install dependencies

  1. Install npm dependencies for all workspaces :
npm i
  1. Pull images at first and then once in a while :
docker compose pull
  1. Then run the containers :
npm run dev-deps

Stop the containers with this command :

npm run stop-dev-deps
  1. Generates the types based on schemas :
npm run build-types

Building and running the Docker images

docker build --progress=plain --target=main -t data-fair/openapi-viewer:dev .

All-in-one development

You can run all services at once thanks to Zellij.

First time instructions
  1. Install Rust's Cargo
curl https://sh.rustup.rs -sSf | sh
# choose 1 when prompted
  1. Install Zellij
cargo install --locked zellij
  1. Install NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
nvm install

Run the Zellij command :

npm run dev-zellij

Access the running services at http://localhost:5600/openapi-viewer

Tips :

  • Use Ctrl + Q to quit Zellij.
  • Click on a panel, then use Ctrl + C then Esc to stop a terminal and regain access of the panel.

Tests

Tests use Playwright. Three projects are defined in playwright.config.ts :

  • unit (tests/*.unit.spec.ts) — pure functions (e.g. query params serialization), no browser, no running stack. Run in CI.
  • e2e (tests/*.e2e.spec.ts) — behavioural checks against the running app. Committed but not run in CI (they need the full stack).
  • snapshot (tests/*.snap.spec.ts) — visual screenshots. Local only: spec files and baseline images are gitignored and never committed.
# unit tests only (no stack needed)
npm run test-unit

# e2e / snapshot need the stack running (dev-deps + api + ui, see above)
npm run test-e2e
npm run test-snapshot

# review visual diffs side by side (expected / actual / diff)
npx playwright show-report

The snapshot project is meant for manual visual non-regression review (e.g. before/after a major Vuetify upgrade): capture baselines, re-run after the change, then walk the HTML report to judge each diff.