fix: harden websocket limits (#20) #50
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
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| jobs: | |
| build: | |
| name: Typecheck, Test & Build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: oven-sh/setup-bun@v2 | |
| with: | |
| bun-version: latest | |
| - name: Install dependencies | |
| run: bun install --frozen-lockfile | |
| - name: Typecheck (frontend + server) | |
| run: bun run typecheck | |
| - name: Test | |
| run: bun run test | |
| - name: Build frontend | |
| run: bun run build | |
| - name: Check i18n locale key parity | |
| run: | | |
| node --input-type=module -e ' | |
| import { readFileSync, readdirSync } from "fs"; | |
| const dir = "src/messages"; | |
| const files = readdirSync(dir).filter(f => f.endsWith(".json")); | |
| const keysByFile = Object.fromEntries( | |
| files.map(f => [f, new Set(Object.keys(JSON.parse(readFileSync(`${dir}/${f}`, "utf8"))))]) | |
| ); | |
| const ref = keysByFile["en.json"]; | |
| let failed = false; | |
| for (const [file, keys] of Object.entries(keysByFile)) { | |
| const missing = [...ref].filter(k => !keys.has(k)); | |
| const extra = [...keys].filter(k => !ref.has(k)); | |
| if (missing.length || extra.length) { | |
| failed = true; | |
| console.error(`${file}: missing=${JSON.stringify(missing)} extra=${JSON.stringify(extra)}`); | |
| } | |
| } | |
| if (failed) process.exit(1); | |
| console.log(`All ${files.length} locales have matching keys (${ref.size} keys).`); | |
| ' |