Skip to content

[Types Extraction] Move Shared Global Types to @ever-teams/types in packages/types #3796

@NdekoCode

Description

@NdekoCode

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

  • Identify all reusable types in core/types that are used across domains
  • Move them to packages/types/src/[domain]
  • Ensure all types follow naming conventions: I, T, E
  • Export them via src/index.ts
  • Make sure the package builds properly
  • Update imports in the app to:
  import { IUser } from '@ever-teams/types';
  • Document which types should or should not be added in the shared package

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

Metadata

Metadata

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions