Kits and the starter project
A board starts as a copy of the starter project, carrier/app. The board's features come as
kits: folders inside the carrier/framework package that php carrier install copies into your
project. Once copied, the files are yours. A framework upgrade never changes them.
This is how Tempest publishes optional pieces with #[Installer], and what laravel/laravel is
to laravel/framework.
- Create a board
- Add a kit
- Bring in kit changes after an upgrade
- Ship your own installer
- The bundled kits
- The install command
- How this repository is laid out
Create a board
composer create-project carrier/app my-boardComposer downloads the starter project and carrier/framework from Packagist, then runs the
starter project's post-create scripts:
- copy
.env.exampleto.env php carrier install boardphp carrier install webphp carrier migrate --seed
Then cd my-board and php carrier serve start the board. Continue with
getting started.
To build a board from a checkout of this repository instead, for example to try unreleased
changes, see Testing the starter project: composer test:skeleton does exactly that, and KEEP=1 keeps the board it builds.
Add a kit
php carrier install games✓ // Installed the games kit: 5 filesA kit that needs another one installs that one first. Every kit needs board. A file that
already exists is kept, and the command lists what it kept:
✓ // Installed the board kit: 0 files
70 files already exist and were kept (app/Config/BoardConfig.php, app/Config/bbs.config.php, app/Config/board.config.php and 67 more). Use --force to replace them.Restart php carrier serve afterwards. Discovery finds the new classes at boot: the games kit's
doors appear in the door menu, and the amber theme under Settings → Theme.
Bring in kit changes after an upgrade
composer update carrier/framework updates the kits inside vendor/carrier/framework/kits/.
It doesn't touch the copies in your project. To take a kit's new version:
- Commit your board, so the next step shows up as a diff.
- Run
php carrier install <kit> --force. This overwrites every file the kit ships. - Review the diff and put back the changes you want to keep.
Ship your own installer
Any class in your board or in a Composer package can add an installer. Mark a public method
with Tempest's #[Installer] attribute:
namespace App\Install;
use Tempest\Console\Console;
use Tempest\Core\Installer;
final readonly class RumorsInstaller
{
public function __construct(private Console $console)
{
}
#[Installer('rumors')]
public function __invoke(): void
{
// copy files, write config, run migrations…
$this->console->success('Rumor mill installed');
}
}php carrier install lists it, and php carrier install rumors runs it. If the method has a
bool $force parameter, it receives the --force flag. Its dependencies come from the
container, like any other class.
The bundled kits
| Kit | Files | Needs | Installs |
|---|---|---|---|
board |
70 | — | app/Menus.php; app/Config/ (bbs, board, database, servers); modules for login, apply, messages, mail, teleconference, oneliners, voting, bulletins, settings, sysop tools; models, migrations, the starter seeder; resources/themes/default/, resources/bulletins/ |
web |
11 | board |
resources/web/ (the xterm.js terminal page, VGA font, favicon, licences) and app/Web/StatusApi.php |
games |
5 | board |
app/Doors/Glowcrawl.php, HiLo.php, Viper.php, app/Config/doors.config.php and the external door doors/fortune/ |
amber |
8 | board |
resources/themes/amber/ |
The kits live in packages/framework/kits. board also ships the
door base class, app/Doors/DoorGame.php, and the door score tables, because System info
reads them. Without games the board has no doors, but app/Menus.php still offers
Door games; take that option out if you leave the kit out.
The board kit is one piece for now: Apply sends a welcome letter through Mail, and System info
counts messages, oneliners and door scores. Splitting messages, mail and voting into kits of
their own needs those links removed first.
The install command
install [name] [--force]| Argument | Meaning |
|---|---|
name |
The installer to run. Without it, the command lists every installer and marks the installed kits. |
--force |
Replace files that already exist. Without it, they're kept. |
A kit counts as installed when its marker file exists: app/Menus.php (board),
resources/web/index.html (web), app/Doors/Glowcrawl.php (games),
resources/themes/amber/theme.php (amber).
The command takes over the name of Tempest's built-in install, and lists installers from your
board and its packages but not Tempest's own. It refuses to run in this repository: see below.
Source: InstallCommand.php,
Kit.php.
How this repository is laid out
This repository is the development monorepo, as tempestphp/tempest-framework and
laravel/framework are for theirs.
packages/framework/ carrier/framework: src/ and kits/
skeleton/ carrier/app: the starter project
app/ (none) the root maps App\ onto packages/framework/kits/{board,web,games}/app/
resources/, doors/ symlinks into the kits
tests/ the Pest suite, run against every kit
tools/skeleton/ builds a board from skeleton/ and calls it
.github/workflows/ tests, and the package splitphp carrier serve in the root runs every kit straight from packages/framework/kits, so an edit
there takes effect on the next start, with nothing to copy. That's also why install refuses to
run here: the copies would duplicate classes that are already loaded.
composer test:skeleton runs tools/skeleton/test.sh. It builds a
board the way the steps above do, from this checkout. Then it installs games and amber,
checks that reinstalling keeps existing files, calls in over telnet to apply as the first user,
and loads the web terminal.
The Split packages workflow (split.yml) pushes
packages/framework, skeleton/ and docs/ to their own read-only repositories on every push
to main and every v* tag, the way Tempest's subsplit-packages.yml does. It does nothing until two
things are set in the repository settings:
| Setting | Kind | Value |
|---|---|---|
SPLIT_ORG |
variable | the GitHub organization that holds framework, app and docs |
SPLIT_TOKEN |
secret | a token that can push to those repositories |
packages/framework/composer.json aliases dev-main to 0.2.x-dev, so the starter project's
"carrier/framework": "^0.2" also matches the main branch, which the starter project's
"minimum-stability": "dev" with "prefer-stable": true allows when no stable release fits.