Prefactor: extract Validation Core from CalendarCore

未關閉
#26 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
45/100
Issue 類型
重構
描述清晰度
基本清楚
活躍度
冷清
技術堆疊
typescript
領域
backend

研究方向

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.

由索引模型根據 Issue 內容生成。

描述

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.

主要語言
TypeScript
星號
620
分支
6
PR 合併指標
30 天內沒有已合併 PR

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

TanStack/time 的其他 Issue

查看 TanStack/time 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。