> For AI agents: the complete documentation index is available at https://anyformat.swc.rs/llms.txt, the full documentation bundle is available at https://anyformat.swc.rs/llms-full.txt.

# Development

anyformat is a [Turborepo](https://turborepo.dev) monorepo on a pnpm workspace.
The Rust crates are one Cargo workspace, and the Python packages are one uv
workspace.

## Repository layout

```text
apps/
  docs/               This documentation site (Rspress)
crates/
  anyformat_core/     Shared container helpers (ISO BMFF, RIFF) and macros
  anyformat_<family>/ One crate per format family
bindings/
  node/<family>/      napi-rs binding, published as @swc/anyformat-<family>
  python/<family>/    PyO3 binding, published as anyformat-<family>
```

## Requirements

- A stable Rust toolchain (see `rust-toolchain.toml`)
- Node.js 18 or later and pnpm
- uv, for the Python bindings
- [Git LFS](https://git-lfs.com), for the binary sample files

Run `git lfs install` once before you clone. If you cloned without Git LFS, run
`git lfs pull` to replace the pointer files with the sample files.

## Commands

Run the commands from the repository root.

```sh
pnpm install

pnpm test          # Rust tests and the tests of every binding
pnpm lint          # rustfmt and clippy
pnpm build         # release builds of every binding, and this site
pnpm build:debug   # debug builds of the Node.js bindings
```

Use `turbo` filters to work on a subset:

```sh
pnpm turbo run test --filter=@swc/anyformat-image          # one Node.js package
pnpm turbo run test --filter='./bindings/python/*'          # all Python packages
```

## Work on this site

The site is the `@swc/anyformat-docs` package in `apps/docs`. It uses
[Rspress](https://rspress.rs). The pages are in `apps/docs/docs`.

```sh
pnpm --filter @swc/anyformat-docs dev       # start a development server
pnpm --filter @swc/anyformat-docs build     # build the site into apps/docs/dist
pnpm --filter @swc/anyformat-docs preview   # serve the built site
```

When you change the API of a binding, update the page of its family in
`apps/docs/docs/api`.

## Contributing

Read `AGENTS.md` and the `AGENTS.md` file of each directory that you change.
They describe the rules for the Rust crates and the bindings.
