Skip to main content
reopt Handbook
reopt Handbook
Enterprise Project Architecture

Monorepo Foundation

Monorepo ArchitectureWorkspace DesignShared PackagesTurbo Pipeline

Apps and Delivery

Next.js PatternsVercel DeploymentCI/CD PipelineTesting Strategy

Agents and Operations

Agentic DevelopmentSkills EcosystemSecurity GovernanceMonitoring and Incident

Appendix

TemplatesReferencesUpdatesVerification
Handbook›Enterprise Project Architecture›Shared Packages
한국어English

Shared Packages

Govern reusable packages for UI, contracts, configuration, and domain logic.

Key takeaways

  • Shared packages create leverage only when contracts are stable; without ownership and release rules they become a hidden dependency network.
  • Package types (UI, config, API contracts, domain logic, utilities) each carry a distinct governance need, from accessibility review to backward compatibility.
  • Export public APIs from a clear entry point, never force consumers to import internal files, and document breaking changes with migration steps.
  • Initialize database, Redis, and service SDK clients lazily inside getters so Next.js builds do not evaluate runtime-only clients too early.
  • Match versioning to reach: workspace deps for internal-only, CI compatibility checks across consuming apps, and semantic versioning for external distribution.

Shared packages create leverage only when their contracts are stable. Without ownership and release rules, shared code becomes a hidden dependency network that slows every team.

Package Types

Package typeExample purposeGovernance need
UIComponents, tokens, layoutsDesign and accessibility review
ConfigTypeScript, lint, test, formatter presetsPlatform ownership
API contractsSchemas, clients, generated typesBackward compatibility
Domain logicPricing, permissions, validationProduct and engineering approval
UtilitiesNarrow reusable helpersStrict scope and naming

Contract Rules

  • Export public APIs from a clear entry point.
  • Do not make consumers import internal files.
  • Document breaking changes and migration steps.
  • Keep package dependencies smaller than app dependencies.
  • Add tests at package boundaries, not only inside consuming apps.
  • Initialize database, Redis, and service SDK clients lazily inside getters so Next.js builds do not evaluate runtime-only clients too early.

Versioning Approach

SituationRecommended action
Internal-only packageUse workspace dependency and changelog notes
Multiple consuming appsRequire compatibility checks in CI
External distributionUse semantic versioning and release notes
Breaking contractProvide migration guide or codemod when possible

Review Checklist

  • Is this package solving a repeated need?
  • Is the API smaller than the implementation?
  • Can the package be tested without a full app?
  • Who owns support when consumers break?
  • Does the package avoid module-scope runtime client initialization?

Related docs

Monorepo Architecture

Design monorepo boundaries for apps, packages, tooling, and teams.

Workspace Design

Define a repository layout and naming system that stays understandable as the project grows.

Scenario: Platform Team

Harness Engineering · Design a harness around invariants, impact analysis, shared modules, release gates, and migration discipline.

SDK 55 Breaking Change Archive

Expo Enterprise Production · Compatibility path for the old SDK 55 breaking changes page. Use the SDK 56 page for the current baseline.

Prompts and Skills

Advanced Codex Usage · Design prompts, repository instructions, and reusable skills for repeatable Codex work.

Workspace Design

Define a repository layout and naming system that stays understandable as the project grows.

Turbo Pipeline

Configure Turborepo tasks, caching, dependencies, and environment rules for enterprise delivery.

On this page

Package TypesContract RulesVersioning ApproachReview Checklist