Skip to content

Contributing

Use Node.js 22.12+ for development and tests (Vitest 5 requires it). The published library continues to support Node.js 18+.

First clone the repository and install dependencies with pnpm install. The repository pins pnpm@12.11.2 for local, CI, and Vercel builds. Vercel installs the docs package with pnpm install --frozen-lockfile.

Building release artifacts uses Rolldown and requires Node.js 20.19+ or 22.12+.

Terminal window
pnpm build

Run pnpm test:unit for the unit suite; it does not require provider credentials. Also run pnpm typecheck, pnpm lint, pnpm test:consumer, and pnpm test:examples.

For live provider integration tests, configure a .env file from .env.example:

Terminal window
cp .env.example .env

and fill in the missing values.

If you did not add any new API, set MOCK_FETCH="true". If you added a new API and need to test against cloud providers, set MOCK_FETCH="false" and RECORD_NETWORK_REQUESTS="true" to update recorded network fixtures.

The documentation site lives under docs/ and is built with Astro Starlight:

Terminal window
pnpm --dir docs dev # Local dev server
pnpm --dir docs typecheck # Astro + TypeScript checks
pnpm --dir docs build # Production build to docs/dist/
pnpm --dir docs test # Post-build link, HTML, LLM route, and converter checks

WebDAV uses XML for all metadata communication. The basic element is an object, multiple objects form a collection, a WebDAV server has accounts, each account has a principal resource (the user’s main resource), and under that principal we discover the home set where calendars or address books live.

syncToken and ctag act like change tokens for a collection: whenever its contents change, the token changes.

For CalDAV, calendar data uses the RFC 5545 iCalendar format. You can parse and serialize iCalendar data with libraries such as ical.js or pretty-jcal.

Here is a cheat sheet comparing WebDAV operations with REST:

Operation WebDAV REST
Create collection
  • Predefined ID: MKCOL /entities/$predefined_id
  • No predefined ID: not possible
  • Can set properties right away with Extended MKCOL (RFC 5689)
  • Status: 201 Created
  • POST /entities with JSON body; response contains new ID
  • Status: 200/201 with new ID and optionally the full object
Create entity
  • Predefined ID: PUT /entities/$predefined_id with body
  • No predefined ID: POST /entities, receive ID via Location
  • Cannot set WebDAV properties at creation; requires subsequent PROPPATCH
  • Status: 201 Created
Update entity body
  • PUT /entities/$predefined_id with new body (no properties)
  • Status: 204 No Content
  • Full: PUT /entities/$id with full JSON body
  • Partial: PATCH /entities/$id with partial JSON body
  • Status: 200 OK
Update entity attributes
  • PROPPATCH /entities/$id with XML body of properties to change
  • Status: 207 Multi-Status
Delete entity
  • DELETE /entities/$id
  • Status: 204 No Content
List entities
  • PROPFIND /entities with XML body of properties to fetch
  • Status: 207 Multi-Status XML response
  • GET /entities
  • Status: 200 OK JSON array
Get entity
  • GET /entities/$id
  • Status: 200 OK with entity body
  • GET /entities/$id
  • Status: 200 OK JSON body
Get entity attributes
  • PROPFIND /entities/$id with XML body of properties to fetch
  • Status: 207 Multi-Status XML response
Notes
  • Cannot always set properties at creation time; use subsequent PROPPATCH
  • No separation of entity body vs. WebDAV properties
  • Entities can be collections or items (for collections: /entities/$collectionId/$itemId)