feat(console): add bin/camelia-orm with seed and make commands
Tests / PHP 8.4 (push) Failing after 3m23s

A command line for the library, kept deliberately small: no console
component, no dependency added to the consumer's tree.

- Application/Command/Input/Output: parsing, dispatch, exit codes and
  capturable output. Commands return an exit code instead of calling exit(),
  so every one is testable.
- seed: runs the registered SeederRunner inside one transaction, with
  --list and --only=name[,name].
- doctor: one round-trip that fails loudly when the DSN is wrong.
- make:model and make:seeder: live scaffolding into the consumer's code,
  sharing name validation, the overwrite guard and directory creation
  through MakeCommand.

The binary ships an empty runner; an application composes SeedCommand into
its own Application to register its seeders.
This commit is contained in:
dgarcia committed 2026-11-15 13:31:14 -03:00
1 parent 2acf2cc099
commit a655a6f3ae
16 files changed
+1576

No files matched your search

+14
View File
@@ -4,6 +4,20 @@ All notable changes to this project are documented here. The format follows
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [Unreleased]
### Added
- `Camelia\Orm\Seeding`: `Seeder` contract, `AbstractSeeder` with an idempotent `seedOnce()`, and
`SeederRunner`, which runs an ordered batch inside one transaction and reports per-seeder counts.
A failing seeder rolls the whole batch back.
- `Camelia\Orm\Console`: a small CLI core (`Application`, `Command`, `Input`, `Output`) with no
external dependency, plus `bin/camelia-orm` exposing `seed`, `doctor`, `make:model` and
`make:seeder`. Commands return exit codes instead of calling `exit()`, and every command can be
driven from a test through a stream-backed `Output`.
- `ConfigurationException::unknownSeeder()`.
- `docs/SEEDING.md`.
## [1.0.0] - 2026-11-15
### Added