Repository navigation
feat: theme resolver (theme-keyed maps) and updated spec-kit documents - #4
Merged
Merged
Conversation
…me injected The resolver prototype for Phase 2b: ThemeResolver takes theme => address => path maps and the active theme name, resolves the active theme's entry for an address, falls back to default per address, and returns false so the aggregate keeps walking. A factory reads theme.active/theme.themes from configuration, so the active theme enters at construction. AggregateResolverFactory states the order outright — theme 100, mezzio's map 50, path stack 1 — because mezzio's own factory attaches the last two at equal priority, which leaves their order to the queue. Composing that aggregate is also why mezzio/mezzio-laminasviewrenderer becomes a dependency: NamespacedPathStackResolver is its class. Whether that dependency is worth the guaranteed ordering is a finding for the prototype to weigh. Tests: unit covers hit, per-address fallback, unknown address, unknown active theme and empty maps; integration uses real files and proves the theme wins an address mezzio's map also carries, and that an address it lacks still resolves through the map. Signed-off-by: Joey Smith <jsmith@webinertia.net>
Adds decisions.md (state, standing rules, decision log D-001 to D-019), brings spec, plan, tasks, data-model, research and quickstart in line with the built resolver, adds the asset helper, default theme and template port phases, and a handoff note. Signed-off-by: Joey Smith <jsmith@webinertia.net>
Keeps the public getDependencies() from 1.0.x with the resolver factories, and tests it directly. Signed-off-by: Joey Smith <jsmith@webinertia.net>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Signed-off-by: Joey Smith <jsmith@webinertia.net>
Signed-off-by: Joey Smith <jsmith@webinertia.net>
Signed-off-by: Joey Smith <jsmith@webinertia.net>
…switches Signed-off-by: Joey Smith <jsmith@webinertia.net>
Signed-off-by: Joey Smith <jsmith@webinertia.net>
Signed-off-by: Joey Smith <jsmith@webinertia.net>
AssetFactory builds the stock Asset helper from theme.assets, default first then the active theme, with per-name fallback. Relative values are served from /theme/<theme>/, absolute URLs pass through, and theme names must be a single path segment. ConfigProvider gains THEME, ACTIVE, THEMES and ASSETS constants. Signed-off-by: Joey Smith <jsmith@webinertia.net>
4 of 5 tasks
Signed-off-by: Joey Smith <jsmith@webinertia.net>
feat: theme-aware asset helper and config key constants
Signed-off-by: Joey Smith <jsmith@webinertia.net>
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Types of changes
Checklist:
specs/001-theme-resolution/.)1.0.x: nothing has been released from this package yet.)Description
Adds the theme resolver and brings the spec-kit documents up to date.
Webware\Theme\Resolver\ThemeResolver: a laminas-viewResolverInterfacethat answers an address fromtheme.themes[<theme>][<address>], with the active theme injected anddefaultas the per-address fallback. No filesystem call per lookup.ThemeResolverFactoryandAggregateResolverFactory: the theme resolver is attached to the aggregate at priority 100, ahead ofTemplateMapResolver(50) and the namespaced path stack (1).ConfigProvidermust be merged afterMezzio\LaminasView\ConfigProvider.ConfigProvider::getDependencies()stays public (from1.0.x) and is tested directly.specs/001-theme-resolution/decisions.md(new): current state, the owner's standing rules, the decision log D-001 to D-019, next actions and gotchas.spec.md,plan.md,tasks.md,data-model.md,research.mdandquickstart.mdare corrected to match what is built. New task phases: 10 (theme-aware asset helper), 11 (default-theme repository), 12 (template port), 13 (cross-repo)..github/instructions/memory.instructions.md: handoff note pointing atdecisions.md.Not in this PR: the theme-aware
asset()helper, asset publishing, the default theme assets, and the template port. They aretasks.mdPhases 10 to 12.Motivation and Context
The app and the component templates need a theme to be a lookup rather than a stack of paths. The prototype showed that a resolver registered in the aggregate gives that with no change to the renderer, and the
webwareapplication already depends on it (path repository pinned at the prototype commit).How has this been tested?
mago format --check,lint,analyzeandguardall exit 0.composer test: 8 tests, 8 assertions.composer test-integration: 5 tests, 9 assertions, against real theme directories.composer mutation-test: 8 mutants, all killed, MSI 100%.Screenshots (if appropriate):