Server package: validateOnServer + loadEvents adapter
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 5/5
- Tempo estimado
- Mais de uma semana
- Facilidade para iniciantes
- 32/100
- Tipo de issue
- Funcionalidade
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- typescript
Direção de pesquisa
Start by reading the parent issue #25 and blocked issue #26 to understand the shared Validation Core and what this package depends on. Then trace the existing core's public functions and package conventions; this issue names no files or tests. Done means the new runtime-agnostic package implements the adapter and direct exports, has mock-based unit tests, and documents transactional isolation and the exclusion-constraint recommendation.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Parent
https://github.com/TanStack/time/issues/25
What to build
Build `@tanstack/time-server` — a runtime-agnostic package that exposes the shared isomorphic Validation Core with a `loadEvents` adapter seam for authoritative server-side validation. The library never opens a database connection; the consumer implements `loadEvents` against their own DB inside their own write transaction.
The package's key export:
```ts
validateOnServer(write, { loadEvents }, ctx) → Promise<conflicts[]>
```
The library computes `getRequiredRange(write)`, calls `loadEvents(range, ctx)` to get the relevant events from the consumer's DB, then runs the same pure Validation Core as the client's advisory checks. Same logic, authoritative data.
Documentation must prominently state: read-validate-write is only race-free inside one transaction with a consistent/locked view. The library provides rules; the consumer provides isolation. A DB exclusion constraint is the recommended backstop for raw time-overlap.
Acceptance criteria
- `@tanstack/time-server` is a new package in the monorepo with no DOM or browser dependencies
- `validateOnServer(write, { loadEvents }, ctx)` calls `loadEvents` with the required range, then runs the Validation Core
- `loadEvents(range, ctx) → Promise<Event[]>` is the only DB seam; the package opens no connections
- The package works in Node, Bun, Deno, and edge runtimes (no Node-specific APIs)
- Unit tests use a mock `loadEvents` — no real DB required
- The package exports the same Validation Core pure functions directly for consumers who want to call them without the adapter orchestration
- Documentation clearly states the transactional-isolation requirement and the DB exclusion constraint recommendation
Blocked by
- Linguagem predominante
- TypeScript
- Estrelas
- 620
- Forks
- 6
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de TanStack/time
-
Dependency DashboardAberta
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 5/100
-
Client/server Data StrategyAbertaenhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 25/100
-
enhancement
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 35/100
-
enhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
-
Undo/redo moduleAbertaenhancement
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 35/100
Todas as issues de TanStack/time
Issues semelhantes
-
needs-area
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
Azure/typespec-azure#5936 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 72/100
vercel-labs/scriptc#2910 ·
Mantenedores costumam responder em até 1 dia
-
automation missing-model model-sync provider:fireworks-ai
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
anomalyco/models.dev#12458 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
Mantenedores costumam responder em até 1 dia