From 5f91a893ed74b206883421efb776a0088bec08e3 Mon Sep 17 00:00:00 2001 From: Ophir Lojkine Date: Sat, 28 Nov 2026 23:46:30 +0000 Subject: [PATCH] Rebuild the official site before checking its component reference --- .github/workflows/ci.yml | 4 +--- CONTRIBUTING.md | 6 +++--- package.json | 1 + tests/js/component_documentation.checks.ts | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01cb8b5f0..0e3d2bbb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,9 +64,7 @@ jobs: save-if: ${{ github.ref == 'refs/heads/main' }} - run: cargo fmt --all -- --check - run: cargo clippy --all-targets --all-features -- -D warnings - - name: Prepare official website - run: npm run site:build - - name: Check prepared component documentation + - name: Prepare and check official website run: npm run site:test - name: Upload prepared website uses: actions/upload-artifact@v7 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e35d71346..ee28efe42 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -67,9 +67,9 @@ built executable. Component suites use `fixtures//{index.sql,test.ts}` an import the shared `fixture.ts` harness; root-level `*.spec.ts` files cover the official site. -For changes to component documentation, run `npm run site:test` after preparing -the site with `npm run site:build`. This checks the same reference the site serves -against the public components and their template properties. +For changes to component documentation, run `npm run site:test`. It rebuilds +the site and checks the prepared reference against public components and their +template properties. Run `npx playwright test --grep @accessibility` from `tests/end-to-end` to audit the official site's component documentation and its live examples in SQLPage's diff --git a/package.json b/package.json index b2702c275..458c667e8 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,7 @@ "typecheck": "tsc && tsc -p tests/js && tsc -p tests/end-to-end", "format": "biome format --write .", "fix": "biome check --fix --unsafe .", + "presite:test": "npm run site:build", "site:build": "node scripts/site-build.mjs", "site:test": "node --test tests/js/component_documentation.checks.ts", "site": "npm run build && npm run site:build && cd target/official-site && cargo run --locked --manifest-path ../../Cargo.toml" diff --git a/tests/js/component_documentation.checks.ts b/tests/js/component_documentation.checks.ts index 71e95374a..d8152250b 100644 --- a/tests/js/component_documentation.checks.ts +++ b/tests/js/component_documentation.checks.ts @@ -228,7 +228,7 @@ function read_templates(): Map { function read_documentation(): Map { const migrations = fs .readdirSync(MIGRATIONS_DIR) - .filter((file) => file.endsWith(".sql")) + .filter((file) => file.endsWith(".sql") && !file.endsWith(".down.sql")) // SQLPage applies migrations in the order of their numeric prefix. .sort( (a, b) =>