Skip to content

feat: extract admin-panel templates into engine-specific sibling packages#94

Merged
markshust merged 5 commits into
developfrom
feature/admin-panel-engine-siblings
May 27, 2026
Merged

feat: extract admin-panel templates into engine-specific sibling packages#94
markshust merged 5 commits into
developfrom
feature/admin-panel-engine-siblings

Conversation

@markshust
Copy link
Copy Markdown
Collaborator

@markshust markshust commented May 27, 2026

Implements #93. Extracts marko/admin-panel's 5 .latte templates into engine-specific siblings (marko/admin-panel-latte, marko/admin-panel-twig), keeping admin-panel's controllers engine-agnostic. Establishes the marko/{module}-{engine} pattern as the canonical approach for multi-engine UI packages.

What shipped

  • New marko/admin-panel-latte — template-only package with the 5 Latte templates (moved from admin-panel, git history preserved via git mv)
  • New marko/admin-panel-twig — template-only package with 5 hand-translated Twig equivalents producing equivalent HTML
  • ModuleManifest::$extra — new field exposing composer.json extra metadata to the framework (cross-package change in marko/core)
  • ModuleTemplateResolver enhancement — resolves admin-panel::path via extra.marko.templates_for declarations, so siblings hook into the parent's namespace transparently
  • marko/admin-panel slimmedresources/views/ removed entirely; composer.json suggest block points to both siblings
  • packages/view/known-engines.php — canonical registry of core engines (twig first, latte second)
  • CrossEngineTemplateParityTest — mechanically enforces that every registered engine has a template provider for every UI module; adding a new core engine fails the build until parity is restored
  • .claude/architecture.md — documents the marko/{module}-{engine} sibling pattern

No Composer conflict between siblings

Both admin-panel-latte and admin-panel-twig can be installed simultaneously — the resolver picks templates based on view.extension config. Worst case is wasted disk space. Symmetric with PR #92's pattern for view drivers.

Breaking change

Apps that installed marko/admin-panel alone (assuming bundled templates) will hit TemplateNotFoundException on admin routes. Migration: composer require marko/admin-panel-latte (or -twig) alongside marko/admin-panel. Pre-1.0, so this is a minor version bump.

Test plan

  • composer test passes (5513 passed; 6 pre-existing failures unrelated)
  • marko/admin-panel-latte LayoutTemplateTest passes against moved templates
  • marko/admin-panel-twig LayoutTemplateTest passes against new Twig templates
  • ModuleTemplateResolver resolves admin-panel::dashboard/index to admin-panel-latte path (integration test)
  • CrossEngineTemplateParityTest passes (both engine providers exist for admin-panel)
  • All existing admin-panel controller, config, menu tests pass without templates present
  • RootComposerJsonTest updated (72 packages including both new siblings)

Closes #93

markshust and others added 3 commits May 27, 2026 09:41
…packages

Extracts admin-panel's .latte templates into marko/admin-panel-latte and
introduces marko/admin-panel-twig (hand-translated equivalents). Adds
templates_for composer-extra metadata so the resolver finds template
provider packages. CrossEngineTemplateParityTest in marko/view enforces
adopting a new core engine means shipping templates for every UI module.

10 tasks, ~4 parallel batches. WIP — depends on PR #92 (drop view
conflicts) merging first so the symmetric-monorepo pattern is settled
before this plan runs.

Relates to #93

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
plan-orchestrate expects 'ready' status to begin execution.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ific sibling packages

Introduces marko/admin-panel-latte and marko/admin-panel-twig as template-only
sibling packages, establishing the marko/{module}-{engine} pattern for UI packages
that want multi-engine support. ModuleManifest gains an $extra field so
ModuleTemplateResolver can resolve templates from packages declaring
extra.marko.templates_for, making the admin-panel::path namespace work regardless
of which engine sibling is installed. CrossEngineTemplateParityTest in marko/view
mechanically enforces that adding a new core engine requires shipping templates for
every existing UI module.

Closes #93

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@markshust markshust changed the title WIP: extract admin-panel templates into engine-specific sibling packages feat: extract admin-panel templates into engine-specific sibling packages May 27, 2026
@github-actions github-actions Bot added enhancement New feature or request breaking Introduces a breaking change labels May 27, 2026
…l-engine-siblings

# Conflicts:
#	packages/framework/tests/RootComposerJsonTest.php
@markshust markshust marked this pull request as ready for review May 27, 2026 14:27
…rity failures

known-engines.php now ships a human-readable description for each
registered engine, matching the format of known-drivers.php. The
description is surfaced in CrossEngineTemplateParityTest failure
messages when a template provider is missing for some parent module:

  Before:
    "...missing a provider for engine 'twig'. Expected a package..."

  After:
    "...missing a provider for engine 'twig' (Twig — recommended for
     broader PHP ecosystem familiarity (Symfony, Drupal, Craft CMS)).
     Expected a package..."

Also positions known-engines.php for future use by an enhanced
TemplateNotFoundException (out of scope here) to hint at missing
engine-sibling packages with descriptive context.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@markshust markshust merged commit dfdae59 into develop May 27, 2026
@markshust markshust deleted the feature/admin-panel-engine-siblings branch May 27, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Introduces a breaking change enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Extract admin-panel templates into engine-specific sibling packages

1 participant