Architecture Notes
This document defines contributor-facing architecture boundaries for the monorepo.
Composition Responsibilities
Section titled “Composition Responsibilities”detection.ts- Reads project signals (
package.json, tsconfig presence, GraphQL schema files). - Produces detected options (
detectedFrameworks, runtime, integrations, preset hints). - Must stay side-effect free beyond filesystem reads.
- Reads project signals (
resolvers.ts- Resolves preset defaults and framework inputs.
- Accepts installed optional framework flags (
true) and imported config arrays/factories.
index.ts- Composes final flat-config order.
- Applies merge strategy, framework dependencies, integrations, and strict mode.
- Keeps final ordering contract: core -> frameworks -> TypeScript -> integrations -> Prettier.
integrations.ts- Loads only the installed feature-pack registries required by the selected categories.
- Resolves the shared
ConfigFeaturecontract without importing plugin implementations into the composer.
feature.ts- Defines the ecosystem-neutral feature adapter contract.
- Sorts selected features and separates normal configs from finalizers such as Prettier.
- Feature packs (
packages/extensions,packages/formats,packages/libraries,packages/testing, andpackages/tools)- Own their plugin dependencies, public factories, and feature registries.
- Keep adding one category from installing unrelated categories.
packages/integrations- Is a compatibility aggregate over the five feature packs.
- Does not own plugin implementations.
Data Flow
Section titled “Data Flow”detectProjectOptions()infers defaults.resolvePreset()provides preset defaults.defineConfig()merges detected + preset + explicit options.- Frameworks are resolved through
resolveFramework(). - Selected feature-pack registries are resolved through
getIntegrationConfigs(). - Prettier is appended last via
getPrettierConfig(). - Strict mode is applied at the end with
applyStrictMode().
Contract Rules
Section titled “Contract Rules”types.tsis the single source of truth for enums and option types.- New enum values require mapping updates in:
- the matching feature pack registry,
resolvers.ts(presets when applicable),- integration tests under
packages/tests/src/.
- Feature adapters must use globally stable
ordervalues. Prettier and other final overrides use thefinalizerphase. - Detection precedence must remain deterministic:
Worker > Node > Browser > Universal.
- Framework implication rules (for example,
nextandexpoimplyreact) must stay covered by tests.
Documentation Governance
Section titled “Documentation Governance”Docs lifecycle policy for current docs and the frozen version archives lives in:
Did this page help?
One click helps us spot documentation that needs another pass. No personal data is sent.