Contributing
This guide covers how to contribute code, tests, and documentation to podkit.
Getting Started
- Fork and clone the repository
- Follow the Development Setup guide to install dependencies
- Run
bun run testto verify your environment works
Development Workflow
- Create a branch for your change
- Make your changes, following the conventions below
- Build native tools:
mise run tools:build(required for integration tests) - Run tests:
bun run test - Run linting:
bun run lint - Run type checking:
bun run typecheck - Submit a pull request
Code Conventions
- TypeScript strict mode is enabled across all packages
- ESM modules — use
.jsextensions in imports (TypeScript resolves these) - Bun test runner for all tests
- Prettier for formatting (
bun run format) - oxlint for linting (
bun run lint)
Monorepo Structure
podkit uses Bun workspaces with Turborepo for build orchestration. Each package under packages/ is independently buildable and testable.
Key packages:
| Package | Purpose | Public API? |
|---|---|---|
podkit-cli | CLI application | Yes (binary) |
podkit-core | Core sync logic, adapters, transcoding | Yes (library) |
libgpod-node | Native bindings for libgpod | Internal |
gpod-testing | Test utilities | Internal |
e2e-tests | End-to-end tests | Internal |
Important: Application code should use IpodDatabase from @podkit/core, not @podkit/libgpod-node directly. The libgpod-node package is an internal implementation detail.
Writing Tests
See the Testing guide for full details. Key points:
- Co-locate unit tests with source files (
foo.test.tsnext tofoo.ts) - Name integration tests
*.integration.test.ts - Use
@podkit/gpod-testingfor tests that need an iPod database - Integration tests should fail early with clear messages when dependencies are missing
Documentation
Documentation lives in docs/ and is structured for Starlight. All markdown files need frontmatter:
---title: Page Titledescription: Brief description.sidebar: order: N---When making code changes, update relevant docs if behavior changes. When you find docs that are incorrect or incomplete, fix them.
Architecture Decision Records
For significant technical decisions, create an ADR in the adr/ directory. See the ADR index for the format and existing records.
See Also
- Development Setup - Environment setup
- Testing - Testing strategy
- Architecture - System design