From 0cb49c71df6fa2f2fcfcd6acef35341e6b512d1d Mon Sep 17 00:00:00 2001 From: Funky Waddle Date: Tue, 16 Dec 2025 16:14:22 -0600 Subject: [PATCH] =?UTF-8?q?Refactor=20M7=20module=20scaffolding,=20route?= =?UTF-8?q?=20inclusion,=20and=20tests;=20implement=20providers=20discover?= =?UTF-8?q?y;=20fix=20URL=20extension=20negotiation;=20clean=20docs=20?= =?UTF-8?q?=E2=80=A2=20Add=20Service=20Providers=20loading=20from=20config?= =?UTF-8?q?/providers.php=20and=20merge=20with=20runtime=20config;=20ensur?= =?UTF-8?q?e=20AppServiceProvider=20boots=20and=20contributes=20routes=20?= =?UTF-8?q?=E2=80=A2=20Create=20RouteGroups=20and=20guard=20module=20route?= =?UTF-8?q?=20includes=20in=20routes/web.php;=20update=20Kernel=20to=20aut?= =?UTF-8?q?o-mount=20module=20routes=20and=20apply=20provider=20routes=20?= =?UTF-8?q?=E2=80=A2=20Implement=20create:module=20as=20a=20console=20Comm?= =?UTF-8?q?and=20(extends=20Phred\Console\Command):=20=09=E2=97=A6=20Args:?= =?UTF-8?q?=20name,=20prefix;=20Flags:=20--update-composer,=20--no-dump=20?= =?UTF-8?q?=09=E2=97=A6=20Stable=20root=20resolution=20(dirname(DIR,=202))?= =?UTF-8?q?;=20robust=20args/flags=20handling=20under=20ArrayInput=20=09?= =?UTF-8?q?=E2=97=A6=20Scaffolds=20module=20dirs=20(Controllers,=20Views,?= =?UTF-8?q?=20Templates,=20Routes,=20Providers,=20etc.),=20ensures=20Contr?= =?UTF-8?q?ollers=20exists,=20adds=20.gitkeep=20=09=E2=97=A6=20Writes=20Pr?= =?UTF-8?q?ovider,=20View,=20Controller,=20Template=20stubs=20(fix=20varia?= =?UTF-8?q?ble=20interpolation=20via=20placeholders)=20=09=E2=97=A6=20Appe?= =?UTF-8?q?nds=20guarded=20include=20snippet=20to=20routes/web.php=20=09?= =?UTF-8?q?=E2=97=A6=20Optional=20composer=20PSR-4=20mapping=20update=20(+?= =?UTF-8?q?=20backup)=20and=20optional=20autoload=20dump=20=09=E2=97=A6=20?= =?UTF-8?q?Prevents=20providers.php=20corruption=20via=20name=20validation?= =?UTF-8?q?=20and=20existence=20checks=20=E2=80=A2=20Add=20URL=20extension?= =?UTF-8?q?=20negotiation=20middleware=20tweaks:=20=09=E2=97=A6=20Only=20s?= =?UTF-8?q?et=20Accept=20for=20.json=20(and=20future=20.xml),=20never=20fo?= =?UTF-8?q?r=20none/php=20=09=E2=97=A6=20Never=20override=20existing=20Acc?= =?UTF-8?q?ept=20header=20=E2=80=A2=20Add=20MVC=20base=20classes=20(Contro?= =?UTF-8?q?ller,=20APIController,=20ViewController,=20View,=20ViewWithDefa?= =?UTF-8?q?ultTemplate);=20update=20ViewController=20signature=20and=20Vie?= =?UTF-8?q?w=20render=20contract=20=E2=80=A2=20Add=20tests:=20=09=E2=97=A6?= =?UTF-8?q?=20CreateModuleCommandTest=20with=20setup/teardown=20to=20snaps?= =?UTF-8?q?hot/restore=20routes/web.php=20and=20composer.json;=20asserts?= =?UTF-8?q?=20scaffold=20and=20PSR-4=20mapping=20=09=E2=97=A6=20ProviderRo?= =?UTF-8?q?uteTest=20for=20provider-contributed=20route=20=09=E2=97=A6=20U?= =?UTF-8?q?rlExtensionNegotiationTest=20sets=20API=5FFORMAT=3Drest=20and?= =?UTF-8?q?=20asserts=20content-type=20behavior=20=09=E2=97=A6=20MvcViewTe?= =?UTF-8?q?st=20validates=20transformData+render=20=E2=80=A2=20Fix=20confi?= =?UTF-8?q?g/providers.php=20syntax=20and=20add=20comment=20placeholder=20?= =?UTF-8?q?for=20modules=20=E2=80=A2=20Update=20README:=20M5/M6/M7=20docs,?= =?UTF-8?q?=20MVC=20examples,=20template=20selection=20conventions,=20modu?= =?UTF-8?q?les=20section,=20URL=20extension=20negotiation,=20and=20module?= =?UTF-8?q?=20creation=20workflow=20=E2=80=A2=20Update=20MILESTONES.md:=20?= =?UTF-8?q?mark=20M6/M7=20complete;=20add=20M8=20task=20for=20register:orm?= =?UTF-8?q?;=20note=20M12=20XML=20extension=20support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- MILESTONES.md | 44 +- README.md | 60 +++ composer.json | 87 +--- composer.json.bak | 5 + src/Http/Kernel.php | 33 ++ .../UrlExtensionNegotiationMiddleware.php | 10 +- src/Http/Routing/RouteGroups.php | 19 + src/Support/ProviderRepository.php | 53 ++- src/commands/create_module.php | 436 ++++++++++++++++++ tests/CreateModuleCommandTest.php | 119 +++++ tests/UrlExtensionNegotiationTest.php | 2 + 11 files changed, 761 insertions(+), 107 deletions(-) create mode 100644 composer.json.bak create mode 100644 src/Http/Routing/RouteGroups.php create mode 100644 src/commands/create_module.php create mode 100644 tests/CreateModuleCommandTest.php diff --git a/MILESTONES.md b/MILESTONES.md index c3c1823..2f7aa39 100644 --- a/MILESTONES.md +++ b/MILESTONES.md @@ -50,34 +50,46 @@ Phred supports REST and JSON:API via env setting; batteries-included defaults, s * ~~Acceptance:~~ * ~~Providers can contribute bindings and routes; order is deterministic and tested.~~ * ~~Drivers can be switched via `.env`/config without changing controllers/services; example provider route covered by tests.~~ -## M6 — MVC: Controllers, Views, Templates -* Tasks: - * Controller base class and conventions (request/response helpers). - * View layer (data preparation) with `getphred/eyrie` template engine integration. - * Template rendering helper: `$this->render(