Prefactor: extract Validation Core from CalendarCore

Aberta
#26 0 comentários 0 reações 0 responsáveis Ver no GitHub

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
45/100
Tipo de issue
Refatoração
Clareza
Razoavelmente clara
Status de atividade
Pouca atividade
Stack de tecnologia
typescript
Domínio
backend

Direção de pesquisa

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.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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.

Linguagem predominante
TypeScript
Estrelas
620
Forks
6
Métricas de merge de PRs
Nenhum PR com merge em 30d

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de TanStack/time

Todas as issues de TanStack/time

Issues semelhantes

Mais issues de TypeScript

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.