Problem
stx plugins can contribute resources, but sharing a whole application foundation—configuration, layouts, pages, components, and composables—needs a defined inheritance and override model.
This would let related apps share an application shell or design-system foundation while replacing selected resources locally.
Existing foundation
Reviewed at 7d93c4c: config.ts and plugin-system.ts.
Build on existing plugin/resource resolution rather than replacing it.
Scope and acceptance criteria
- Support explicitly configured local and installed-package layers.
- Define deterministic precedence between the app, its layers, and nested layers.
- Resolve paths relative to the layer that declares them.
- Specify merging rules for config objects, arrays, hooks, and resource collisions.
- Support local overrides for shared components, layouts, and pages.
- Detect cycles and provide useful conflict diagnostics.
- Track layer dependencies for development invalidation and reproducible builds.
- Include a two-app example demonstrating reuse and local overrides.
Remote Git fetching and a layer marketplace are outside the initial scope.
Prior art: Nuxt layers.