Development
Use PHP 8.3 or newer and a Node version supported by package.json. Install both dependency sets before running the checks:
Run repository tests with Node 22.22.2 or 24.15.0, matching CI. Vitest 5 does not support Node 20. Package build/consumer smoke still runs on Node 20.19.0 to cover the package's declared engine range; that job does not execute Vitest.
composer install
npm ciPHP checks
composer test
composer analyse
vendor/bin/pint --testThe Pest suite uses Orchestra Testbench and SQLite by default. CI also runs the supported Laravel and Inertia combinations plus MySQL and PostgreSQL jobs.
Vue checks
npm run format:check
npm run types:check
npm test
npm run buildVue tests set isolate: false, so each worker reuses its happy-dom environment across test files. The shared setup unmounts wrappers before restoring timers, browser mocks and DOM state. Each test still owns its setup; tests must not depend on another file having run first.
To check for state leaking between files:
npm test -- --maxWorkers=1 --sequence.shuffle.files --sequence.seed=17
npm test -- --maxWorkers=1 --sequence.shuffle.files --sequence.seed=83Documentation
Start the local documentation server with:
npm run docs:devBuild the same static site used by CI and GitHub Pages with:
npm run docs:buildVitePress writes generated files below docs/.vitepress/dist; do not commit that directory.
Contract fixtures
The PHP resource test verifies the committed TypeScript resource fixture:
vendor/bin/pest tests/ContractResourceTest.phpWhen the resource changes intentionally, regenerate it locally with INERTIA_TABLE_UPDATE_CONTRACTS=1 vendor/bin/pest tests/ContractResourceTest.php and review the diff in tests-js/contracts/resource.generated.ts. CI verifies freshness and does not regenerate this file.
For the URL bridge, TypeScript writes URLs and PHP verifies their normalized state. Run these commands in order:
INERTIA_TABLE_URL_CONTRACT_OUTPUT=build/contracts/urls.json npm test -- tests-js/contractUrl.test.ts
INERTIA_TABLE_URL_CONTRACT_INPUT=build/contracts/urls.json vendor/bin/pest tests/ContractUrlTest.phpThe PHP URL test skips when no input path is supplied. The generated URL artifact under build/ is temporary and must not be committed; the TypeScript resource fixture is tracked in Git.
Test ownership and reproduction
| Boundary | Check | What it proves |
|---|---|---|
| PHP query/state/serialization | vendor/bin/pest tests/TableTest.php tests/RelationshipQueryTest.php tests/SelectionTest.php | Server allowlists, scoped queries, pagination and row metadata |
| Summary and exports | vendor/bin/pest tests/SummaryTest.php tests/ExportTest.php | Aggregate query isolation, extension hooks and exported results |
| PHP consumer callback types | composer analyse:consumer and composer analyse:consumer:negative | Valid consumer signatures compile and known invalid callbacks fail |
| Headless state/actions | npm test -- tests-js/useTable.test.ts tests-js/useActions.test.ts | State transitions and request callbacks with the unit router mock |
| Renderer | npm test -- tests-js/DataTable.test.ts | Component composition in happy-dom; not browser layout |
| PHP/Vue bridge | Resource and URL commands above | Resource freshness and frontend URLs accepted by PHP |
| Installed consumer | npm run test:consumer | npm tarball install, public types, CSR/SSR builds and real PHP responses |
| Browser | node tests/Consumer/serve.mjs after the consumer check | Manual focus, navigation and hydration checks |
The consumer uses root-installed peer versions, not every supported peer version. Its PHP bootstrap uses the checkout's Composer installation. See the consumer README and browser catalog for exact scenarios and recorded limitations.
For a bug report include package/host versions, table definition, sanitized URL, expected/actual result, and the smallest relevant request/response. Reproduce against a fixture database. Preserve the failing shuffle seed from test output; do not fix flaky tests by adding retries or shared state. Test query bugs on the affected database driver. For restricted local environments, PHPStan's --debug mode runs without parallel worker sockets.