How samuelarbibe/dnd-timeline works
Project type and purpose
• This is a monorepo (managed by Turborepo + pnpm) containing:
– A core “dnd-timeline” headless React library (hook-based, zero styling, built on dnd-kit)
– A set of configuration packages (config-biome, config-typescript, config-release-it)
– Multiple example/demo React apps (basic, create, external, home, performance, sortable, timeaxis, virtual)
– Documentation (docs/v1, docs/v2)
– CI/CD workflows (.github/workflows)
• Purpose: develop, test, document, and publish the dnd-timeline library while showcasing its usage via examples.
File structure / architectural patterns
• Top-level / root
– pnpm-workspace.yaml, turbo.json: orchestrate tasks across packages
– .github/workflows: CI pipelines for testing, building, deploying docs and examples
– docs/: static site generator input (versioned guides & API docs)
– packages/:
· config-* packages: share build/test/lint configs
· dnd-timeline: the core library (src/hooks, src/store, src/utils, src/types)
• examples/: independent React/Vite apps, each importing the local dnd-timeline package via pnpm link
• build & release: release-it configs, tsup, biome.json, commitlint, husky hooks
Main components
A. Monorepo Orchestrator
– Turborepo (turbo.json)
– pnpm workspace
B. Configuration Layer
– config-biome, config-typescript, config-release-it
– Shared lint/build/test configurations
C. Core Library: dnd-timeline
– src/hooks (useItem, useRow, useTimelineContext…)
– src/store (shared state management)
– src/utils (positioning, validation, pan strategies)
– Exports headless hooks + styling helpers
D. Examples (8 distinct React/Vite apps)
– Each app imports dnd-timeline and config-* via workspace links
– Uses Vite, React, custom CSS or Tailwind
– Demonstrates features: external drag, virtualization, sorting, creating, time axis, performance
E. Documentation Site
– docs/v1 & docs/v2 Markdown
– Built & deployed via CI workflows
F. CI/CD Pipelines
– .github/workflows/deploy-examples.yml (build & deploy each example)
– deploy-preview.yml, deploy-production.yml (docs site & library release)
– deploy.yml (general pipeline)
Relationships & interactions
• Developer changes core library → Turborepo rebuilds affected packages → local examples auto-reload
• Examples ← imports ← Core Library + config packages
• CI pipelines triggered on PR/merge → run tests/lints → build core + docs + examples → deploy
• Documentation ← Markdown source → static site generator → hosted on docs site
Architectural patterns / design principles
• Monorepo (single repo, many packages)
• Headless-UI library (logic-only, styling-agnostic)
• Hook-based React API (useItem, useRow, useTimelineContext)
• Task orchestration via Turborepo (filtering, incremental builds)
• Workspace linking (pnpm) for zero-install symlinking
Essential elements
• Packages vs. examples vs. CI pipelines vs. external services