Skip to content

Commit daa9741

Browse files
committed
docs: modernize README and improve CLAUDE.md
- Replace Travis/Appveyor badges with GitHub Actions - Update all code examples to use React hooks instead of class components - Add dedicated nodeRef section for React Strict Mode compatibility - Update version compatibility table to include React 18/19 - Fix UMD build path references (dist → build/web) - Add TypeScript types mention - Update contributing section to use yarn - Add test utilities documentation to CLAUDE.md
1 parent 19cd9ba commit daa9741

File tree

2 files changed

+284
-239
lines changed

2 files changed

+284
-239
lines changed

CLAUDE.md

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,19 @@ This project uses Make for builds. Key commands:
1313
- `make test` - Runs unit tests via Vitest
1414
- `make test-browser` - Runs browser tests via Puppeteer (requires build first)
1515
- `make test-all` - Runs both unit and browser tests
16-
- `make dev` - Starts webpack dev server with example page
16+
- `make dev` - Starts webpack dev server with example page at localhost:8080
1717

1818
Yarn scripts:
1919
- `yarn test` - Run unit tests (jsdom environment)
2020
- `yarn test:watch` - Run unit tests in watch mode
21+
- `yarn test -- path/to/test.jsx` - Run a single test file
22+
- `yarn test -- -t "test name"` - Run tests matching a pattern
2123
- `yarn test:browser` - Build and run browser tests (Puppeteer)
2224
- `yarn test:all` - Run all tests
2325
- `yarn test:coverage` - Run tests with coverage report
2426

27+
Pre-commit hooks run `make lint` and `make test` automatically.
28+
2529
## Test Architecture
2630

2731
Tests are split into two categories:
@@ -35,6 +39,13 @@ Tests are split into two categories:
3539
- Test actual drag behavior with real coordinate calculations
3640
- Test transforms, axis constraints, bounds, scale
3741

42+
### Test Utilities
43+
44+
`test/testUtils.js` provides helpers for simulating drag events:
45+
- `simulateDrag(element, {from, to})` - Complete drag operation
46+
- `startDrag(element, {x, y})` / `moveDrag({x, y})` / `endDrag(element, {x, y})` - Step-by-step drag
47+
- `simulateTouchDrag(element, {from, to})` - Touch event drag
48+
3849
## Architecture
3950

4051
### Component Hierarchy
@@ -64,7 +75,7 @@ Tests are split into two categories:
6475

6576
### Type Systems
6677

67-
The codebase uses Flow for internal type checking (`// @flow` annotations) and ships TypeScript definitions in `typings/index.d.ts`. Both must stay in sync.
78+
The codebase uses Flow for internal type checking (`// @flow` annotations) and ships TypeScript definitions in `typings/index.d.ts`. Both must stay in sync when modifying component props or types.
6879

6980
## Key Patterns
7081

@@ -82,3 +93,9 @@ Returning `false` from `onStart`, `onDrag`, or `onStop` cancels the drag operati
8293

8394
### CSS Transform Approach
8495
Dragging uses CSS transforms (`translate`) rather than absolute positioning, allowing draggable elements to work regardless of their CSS position value.
96+
97+
## Release Process
98+
99+
- Update CHANGELOG.md
100+
- `make release-patch`, `make release-minor`, or `make release-major`
101+
- `make publish`

0 commit comments

Comments
 (0)