docs: note default bundle size and opt-in theme imports #31
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: | |
| workflow_dispatch: | |
| # A second push to the same branch makes the first run's result irrelevant. | |
| concurrency: | |
| group: ci-${{ github.ref }} | |
| cancel-in-progress: true | |
| permissions: | |
| contents: read | |
| jobs: | |
| verify: | |
| name: Lint, typecheck, test, build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - run: npm ci | |
| # Run each gate as its own step so a failure names itself in the UI | |
| # rather than hiding inside a composite `npm run verify`. | |
| - name: Lint | |
| run: npm run lint | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Typecheck | |
| run: npm run typecheck | |
| - name: Test | |
| run: npm run test | |
| # Layout assertions need a real engine. jsdom has no layout at all — every | |
| # element measures 0px and there is no ResizeObserver — so row geometry is | |
| # not merely untested there, it is untestable. A virtual-scroll bug that | |
| # overlapped every wrapped row passed the whole jsdom suite. | |
| - name: Install Chromium | |
| run: npx playwright install chromium --with-deps | |
| - name: Test layout in a browser | |
| run: npm run test:browser | |
| - name: Build | |
| run: npm run build | |
| # The library's central claim is that it ships smaller than the original. | |
| # An unenforced claim drifts, so this fails the build when it stops holding. | |
| - name: Size budget | |
| run: npm run size | |
| # Catches broken `exports` maps and type declarations that resolve for us | |
| # locally but not for a consumer under node16 resolution. | |
| - name: Check packaging | |
| run: npm run check:exports | |
| # The demo imports from src/, so it breaks when a public API changes. Building | |
| # it here catches that in the gates rather than at deploy time. | |
| - name: Build demo | |
| run: npm run build:demo | |
| # A matrix job kept separate from the gate job: it re-runs only the parts whose | |
| # result can vary by Node version, and does not duplicate lint/format/packaging. | |
| # | |
| # Node 20 is absent deliberately: jsdom 30 requires | |
| # ^22.22.2 || ^24.15.0 || >=26.0.0, so the test environment cannot run there | |
| # even though the library itself can. The `floor` job below covers it. | |
| test-matrix: | |
| name: Test on Node ${{ matrix.node }} | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| # Current LTS and current. | |
| node: [22, 24] | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| node-version: ${{ matrix.node }} | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run test | |
| - run: npm run build | |
| # Guards the `engines.node` floor. The published library is ESM with no Node | |
| # APIs, so what matters is that it builds and packages correctly on the oldest | |
| # version consumers are told they can use. Tests are excluded because the dev | |
| # toolchain, not the library, is what requires newer Node. | |
| floor: | |
| name: Build on oldest supported Node | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/setup-node@v7 | |
| with: | |
| # Pinned exactly, not `20`: this is the version `engines.node` claims, | |
| # so testing "latest 20.x" would let the claim rot unnoticed. | |
| node-version: 20.19.0 | |
| cache: npm | |
| - run: npm ci | |
| - run: npm run build | |
| - run: npm run check:exports |