fix(docs): nest torvik under Basketball + hockeytech under Hockey, with guide examples #79
Workflow file for this run
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: | |
| permissions: | |
| contents: read | |
| jobs: | |
| build: | |
| name: build + typecheck (node ${{ matrix.node-version }}) | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # cheerio 1.2 (via undici 7) requires Node >= 20.18.1 | |
| node-version: [20.x, 22.x] | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: ${{ matrix.node-version }} | |
| cache: npm | |
| # `npm ci` runs the `prepare` script, which compiles src -> dist via tsc | |
| - run: npm ci | |
| - name: Codegen drift check | |
| run: npm run codegen:check | |
| - name: Type-check | |
| run: npm run typecheck | |
| - name: Verify the build output exists | |
| run: | | |
| node -e "import('./dist/index.js').then(m => { const s = Object.keys(m.default); if (s.length < 29 || !s.includes('nba') || !s.includes('soccer')) { throw new Error('unexpected namespaces ' + s.length); } console.log('OK', s.length, 'namespaces'); })" | |
| # No-network suite: contract tests for every generated wrapper + core + | |
| # legacy surface + playground resolver/proxy. Live-API suites are gated | |
| # behind SDV_LIVE (not set here), so this stays deterministic. | |
| - name: Test | |
| run: npm test | |
| docs: | |
| name: docs build (Docusaurus + TypeDoc) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 | |
| - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4 | |
| with: | |
| node-version: 20.x | |
| cache: npm | |
| # Both installs run in this job (root for TypeDoc's src resolution, docs | |
| # for Docusaurus), so key the cache on both lockfiles. | |
| cache-dependency-path: | | |
| package-lock.json | |
| docs/package-lock.json | |
| # Root deps so docusaurus-plugin-typedoc can resolve the package's src imports. | |
| - run: npm ci | |
| # Drift gate: the guides carry build-time "frozen" parser-output tables | |
| # (tools/docs/inject-outputs.mjs, manifest in tools/docs/examples.mjs). | |
| # `--check` re-runs every example through the committed parser bundle and | |
| # fails if any guide's injected block is stale vs a fresh run, so the | |
| # frozen outputs can never silently drift from the parsers. Regenerate | |
| # locally with `npm run docs:examples` and commit the result. | |
| - name: Docs example-output drift check | |
| run: npm run docs:examples:check | |
| - run: npm ci | |
| working-directory: docs | |
| # Builds the Docusaurus site (generates the TypeDoc API reference) and fails | |
| # on any broken link (onBrokenLinks: 'throw'). | |
| - run: npm run build | |
| working-directory: docs |