Prefactor: extract Validation Core from CalendarCore

Ouverte
#26 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
4/5
Temps estimé
3-5 jours
Accessibilité débutants
45/100
Type d'issue
Refactorisation
Clarté
Plutôt claire
Activité
Calme
Stack technique
typescript
Domaine
backend

Piste de recherche

Start by reading CalendarCore and tracing its availability, dependency-constraint, and recurrence validation logic, along with the existing tests. Identify how each can operate on plain event objects and config without store, viewport, DOM, database, or Temporal dependencies. Done means CalendarCore delegates to independently tested pure functions and all existing tests pass unchanged.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

enhancement

Parent

https://github.com/TanStack/time/issues/25

What to build

Extract the availability, dependency-propagation, and recurrence validation logic currently fused into `CalendarCore` into pure, isomorphic functions with the signature `validate(write, events, config) → conflicts`. These functions must have zero dependencies on the store, viewport, DOM, or any database.

This is the mandatory first step before any modularization can happen. It is a pure refactor — no new behavior, no public API changes. The existing `CalendarCore` continues to call these functions internally; callers see no difference.

The extraction creates the seam that makes the following possible:

  • the module-stage pipeline (both client and server can run the same stages)
  • the `loadEvents` adapter in the server package
  • the client/server Data Strategy

Acceptance criteria

  • Availability conflict detection, dependency-constraint checking (FS/SS/FF/SF), and recurrence validation each exist as standalone pure functions importable independently of `CalendarCore`
  • Each function accepts plain event objects and config; returns a conflicts/errors array; has no side effects
  • `CalendarCore` delegates to these functions internally — all existing tests continue to pass unchanged
  • No `Temporal` objects, store references, or DOM references appear in the extracted functions' signatures
  • Unit tests cover the extracted functions directly (not through `CalendarCore`)

Blocked by

None — can start immediately.

Langage dominant
TypeScript
Étoiles
620
Forks
6
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de TanStack/time

Toutes les issues de TanStack/time

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.