# Contributing json-render accepts bug reports, feature requests, and pull requests. This guide covers local setup, the commands CI runs, the repository layout, and the release process. ## Setup json-render requires Node.js 24 or later and pnpm 11 or later. These versions come from `engines` in `package.json` and from `.node-version`. The root `dev` script and the docs dev server use [portless](https://github.com/vercel-labs/portless) to assign ports and `.localhost` hostnames. Install it globally before running `pnpm dev`: ```console $ npm i -g portless ``` Install dependencies from the repository root: ```console $ pnpm install ``` Examples that call a model read credentials from the environment. `turbo.json` lists the accepted variables in `globalEnv`, including `AI_GATEWAY_API_KEY` and `ANTHROPIC_API_KEY`. ## Commands Run these from the repository root. | Command | Description | | --- | --- | | `pnpm dev` | Start the docs site, playground, and example dev servers with Turbo. The docs and playground run at http://json-render.localhost:1355. | | `pnpm --filter web dev` | Start only the docs site and playground. | | `pnpm build` | Build all workspaces with Turbo. | | `pnpm --filter web build` | Build the docs site. | | `pnpm test` | Run the Vitest suite. | | `pnpm test:watch` | Run Vitest in watch mode. | | `pnpm test:coverage` | Run Vitest with coverage. | | `pnpm test:e2e` | Run the end-to-end tests in `tests/e2e`. | | `pnpm lint` | Run ESLint across the workspace. | | `pnpm type-check` | Run TypeScript checks across the workspace. `pnpm check-types` is an alias. | | `pnpm format` | Format TypeScript and TSX files with Prettier. | | `pnpm version:check` | Check that every public package matches the core package version. | | `pnpm version:sync` | Set every public package to the core package version. | CI builds the packages before running unit tests: ```console $ pnpm turbo run build --filter='./packages/*' $ pnpm test ``` CI checks the docs with: ```console $ pnpm turbo run build --filter='web^...' $ pnpm --filter web build $ pnpm --filter web test:routes ``` The Swift package has its own build and tests: ```console $ cd swift/JSONRender $ swift build $ swift test ``` CI also checks the generated Swift spec model and the React conformance fixtures: ```console $ node swift/JSONRender/Scripts/generate-spec-model.mjs --check $ node swift/JSONRender/Tools/conformance/render-fixtures.mjs --check ``` ## Repository layout - `apps/web`: documentation site and playground (Next.js). - `packages/`: published `@json-render/*` packages plus private `@internal/*` workspace packages. - `examples/`: runnable apps for the renderers and integrations. - `tests/e2e`: end-to-end tests. - `swift/JSONRender`: Swift package. The root `Package.swift` exposes it for SwiftPM and Xcode. - `skills/`: skills for packages and workflows. - `scripts/`: version sync and Open Graph image scripts. ## Pull requests Open pull requests against `main` and keep each one focused on a single change. Before opening a pull request, run: ```console $ pnpm lint $ pnpm type-check $ pnpm turbo run build --filter='./packages/*' $ pnpm test ``` Add tests for behavior changes. For user-facing changes, update the documentation that describes the behavior: - The affected package README under `packages//README.md`. - The root README when the package table, install commands, or examples change. - Pages under `apps/web/content/docs/` for guides and API references. - `CHANGELOG.md` when the change should appear in release notes. Do not add `--port` flags to dev scripts; portless assigns the ports. ### Adding a public package A new public `@json-render/*` package needs: - A README at `packages//README.md`. - A row in the root README package table. - An API reference page in `apps/web/content/docs/api/`. - Entries in `apps/web/content/docs/api/meta.json`, `apps/web/lib/docs-navigation.ts`, and `apps/web/lib/page-titles.ts`. - A skill under `skills//`. - The same version as `@json-render/core`. Run `pnpm version:sync` after setting the version in `packages/core/package.json`. ## Releases Releases are handled by maintainers in a single pull request. The repository does not use Changesets. Every public `@json-render/*` package uses the version in `packages/core/package.json`. To prepare a release: 1. Bump `version` in `packages/core/package.json`. 2. Run `pnpm version:sync` to update every public package. 3. Run `pnpm version:check` to confirm the versions match. 4. Add the release notes between the `` and `` markers in `CHANGELOG.md`. 5. Open a pull request to `main` and merge it. After the merge, the Release workflow compares the local `@json-render/core` version with the version on npm. When they differ, it builds and publishes every public package, then creates a GitHub release from the changelog section between the markers. ## Issues and discussions - Report reproducible bugs with the [bug report form](https://github.com/vercel-labs/json-render/issues/new?template=bug_report.yml). - Request features in [Discussions](https://github.com/vercel-labs/json-render/discussions/new?category=ideas). - Ask usage questions in [Discussions](https://github.com/vercel-labs/json-render/discussions/new?category=help). Search existing issues and discussions before opening a new one.