Contributing

Development commands

Every development task is a make target that runs in a container. Run make on its own to list them all.


Checks and tests

CommandWhat it does
make testRun the PHP and Go tests, then the PHP type-coverage check.
make test:phpRun the PHP tests only. Narrow them with ARGS="--filter=Instance".
make test:goRun the Go tests only. Narrow them with PKG=./internal/ui.
make test:typesCheck PHP type coverage. 100% is required.
make test:coverageRun both test suites with code coverage. 100% is required.
make sniffRun static analysis: Larastan (opens in a new tab) at the max level, and golangci-lint.
make lintCheck PHP and Go formatting, with Pint (opens in a new tab) and golangci-lint, as CI does.
make formatFix PHP and Go formatting.

Running and building Rift

CommandWhat it does
make rift ARGS="list"Run Rift from source inside the container.
make buildBuild native rift and rift-dash binaries for this machine in builds/.
make demoRecord .github/dash.gif, the dashboard demo, with VHS (opens in a new tab).
make checksumsRe-pin the PHP runtime checksums. See Updating PHP.

This documentation site

CommandWhat it does
make docs:installInstall the site's dependencies in docs/.
make docs:devServe the site with live reload at http://localhost:3000.
make docs:buildBuild the static site into docs/out.
make docs:lintCheck the site with ESLint and Prettier.
make docs:formatFix the site's formatting with Prettier.
make docs:bunRun Bun in docs/, through ARGS: make docs:bun ARGS="outdated".

Editing the docs explains where each page lives.


Containers and images

CommandWhat it does
make shellOpen a shell in the rift-dev container.
make imageRebuild the images, for example after changing docker/Dockerfile.
make cleanRemove the build output, the images and their caches.

Composer, Bun and Go

make composer, make bun and make go pass everything after them to the tool, so they read like the tools themselves:

make composer update
make composer update laravel-zero/framework
make composer require vendor/package
make bun install
make go mod tidy

Make drops a leading ./ from the words it passes on, so give make go no package paths: make test:go PKG=./internal/ui runs one package instead.

Add -- before any option, so Make passes it on instead of reading it itself:

make composer -- update laravel-zero/framework -W
make bun -- add --dev package
Previous
How Rift is built