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 bundled 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
- Maps enum selections from
packages/core/src/types.tsto integration config arrays. - Every enum value must map to at least one config array branch.
- Maps enum selections from
Data Flow
Section titled “Data Flow”detectProjectOptions()infers defaults.resolvePreset()provides preset defaults.eslintConfig()merges detected + preset + explicit options.- Frameworks are resolved through
resolveFramework(). - Integrations are appended via
getIntegrationConfigs(). - Prettier is appended last via
getPrettierConfig(). - Strict mode is applied at the end with
applyStrictMode().
Contract Rules
Section titled “Contract Rules”- types.ts is the single source of truth for enums and option types.
- New enum values require mapping updates in:
- integrations.ts (integrations),
- resolvers.ts (presets when applicable),
- integration tests under
packages/tests/src/.
- 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 vs v1 archive lives in:
Did this page help?
Your answer stays in this browser. Share details on GitHub to help improve the docs.