Prefactor: extract Validation Core from CalendarCore

Đang mở
#26 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
45/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
backend

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
620
Fork
6
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của TanStack/time

Tất cả issue của TanStack/time

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.