Skip to main content

Contribute to the docs

Version: V2
View Markdown

Propose a documentation change that a reviewer can reproduce and verify against the same source you used.

Before you start​

Check existing issues and pull requests for the problem. Fork the documentation repository and create a feature branch from its current main. From your checkout’s root, install the site and example dependencies with Node.js 22.22.0+ (22.x) or 24.13.0+ (24.x), and npm. Documentation repository

npm ci
npm ci --ignore-scripts --prefix examples/v2

Steps​

1. Identify the page and the evidence​

Record the page URL, what you tried and what you expected to happen. For example, if a snippet differs from its linked TypeScript example, name the page, source file and command that reports the difference. For a package or Core behavior change, cite the file at the full commit that the docs cover. Versions and release status

New behavior belongs in V2. Its source is under docs/_data/ and its public routes start at /docs. For example, docs/_data/community/ecosystem.md supplies /docs/community/ecosystem. The archive at _data_versioned_docs/version-v1/ supplies /docs/v1 and is frozen. If you find an archive error, report it with the V1 URL so maintainers can determine whether an approved exception applies.

2. Use the page template​

Choose a kind that fits the reader’s task. For a how-to, state the goal in one sentence, then use the headings Before you start, Steps, Check the result and Related, in that order. An optional Troubleshooting section follows Check the result. Give each step an action and describe something the reader can observe when it succeeds.

For a tutorial, show the estimated time and step count, then explain what the reader will build and how to run it. For a concept, follow a neighboring concept page’s structure and link its prerequisites. For a reference, organize the facts around what a reader needs to look up. Use a page of the same kind and section as your starting point.

Set title, sidebar_label, a description of up to 160 characters, kind, reader and packages in front matter. Write lists as single-line JSON arrays. For example, reader: ["app"] addresses application developers. Use packages: [] when no specific package applies. Otherwise list the relevant manifest package names and place <AppliesTo /> at the end of the page, after all content and related links. Pages under concepts/ also declare depends_on. The file path determines the route, and the title supplies the page heading.

3. Update the source and its navigation​

Edit the Markdown source. The launch inventory in scripts/v2-launch-routes.txt defines the 148 routes and their sidebar order. For a planned page, put its document ID in that position in sidebars.js and link it from the section landing. If you propose a route outside the inventory, discuss the scope change with maintainers so the inventory, expected counts and navigation can be updated together. The ID for the ecosystem example is community/ecosystem. A correction on an existing route can keep its current navigation.

For a runnable TypeScript snippet, edit its named region in the strict project under examples/v2/. For example, the Create atoms guide uses the create region in examples/v2/first-write/src/create-atoms-guide.ts. Run the first command to copy the source region into the guide’s marked fence. The second command checks that the two match. Create atoms

node scripts/sync-example-snippets.js --write --file docs/_data/build/create-atoms.md
node scripts/sync-example-snippets.js --check --file docs/_data/build/create-atoms.md

4. Verify the change and submit it for review​

Run the template, link and release checks from the repository root. If your change includes a runnable example, also run npm run validate-sdk-examples -- --version v2. Build the site from the edited source and run the type check.

npm run validate-v2-structure -- --templates
npm run validate-links
npm run check-release-pins
npm run build
npm run typecheck

Review your diff, commit the change with a descriptive docs: message, and push the branch to your fork. Open a pull request against main. Include the affected route, the original symptom, the expected result, your source evidence, and the commands you ran. That gives reviewers a way to repeat the check and discuss corrections.

Check the result​

The validators should exit successfully and the build should emit the edited page under build/docs/. For a snippet correction, the scoped sync check should report the verified region and the V2 example check should pass. A drift error gives the page and region to compare. Correct the source region, sync it again and rerun the failed check.

  • Ecosystem illustrates a reference page with a file-derived route.
  • Core releases shows how to identify the Core source behind a change.