After organizing core/types, the next step is to isolate and move only the global, app-agnostic types into a separate reusable package: @ever-teams/types.
These types will be used by multiple apps (web, mobile, backend). The package must be lightweight, strictly typed, and independent of Next.js, React or browser-specific code.
Proposed Structure for packages/types
packages/types/
├── src/
│ ├── user/
│ ├── auth/
│ ├── tasks/
│ ├── teams/
│ ├── projects/
│ ├── reports/
│ ├── generics/
│ └── index.ts
├── package.json
├── tsconfig.json
└── README.md
Tasks
import { IUser } from '@ever-teams/types';
Guidelines
- ✅ Migrate only cross-application types (used in web, mobile, future backend)
- ✅ Keep UI-specific types (like layout configs) in
core/types
- ❌ Avoid anything tied to rendering logic or frontend-only behavior
Validation
- Package builds cleanly (e.g. with
tsc, tsup or rollup)
- Imports from
@ever-teams/types resolve in consuming projects
- No circular dependency or browser-specific types
Why Extract to a Package?
Pros:
- Reusability across multiple apps (Next.js, React Native)
- Avoid duplication
- More maintainable and isolated
Cons (to avoid):
- Over-extraction of internal types
- Improper build setup
- Risk of strong coupling if not domain-scoped
Related
After organizing
core/types, the next step is to isolate and move only the global, app-agnostic types into a separate reusable package:@ever-teams/types.These types will be used by multiple apps (web, mobile, backend). The package must be lightweight, strictly typed, and independent of Next.js, React or browser-specific code.
Proposed Structure for
packages/typesTasks
core/typesthat are used across domainspackages/types/src/[domain]I,T,Esrc/index.tsGuidelines
core/typesValidation
tsc,tsupor rollup)@ever-teams/typesresolve in consuming projectsWhy Extract to a Package?
Pros:
Cons (to avoid):
Related
core/types#3795 (types reorganization incore)@ever-teams/hooks,@ever-teams/services