---
title: "Contributing"
description: "mise installs Bun and Node at the versions in mise.toml. Run mise install, then install the dependencies:"
url: "https://opensource.rising.sh/solid-motion/docs/contributing"
---

# Contributing

[mise](https://mise.jdx.dev) installs Bun and Node at the versions in
[`mise.toml`](https://github.com/risinghq/motion/blob/master/mise.toml). Run `mise install`, then install the dependencies:

```sh
bun install --frozen-lockfile
```

Run every check before you open a pull request:

```sh
bun run check
```

It runs these scripts:

| Script                     | What it does                                             |
| -------------------------- | -------------------------------------------------------- |
| `bun run lint`             | `oxlint` with warnings as errors, and `oxfmt --check`.   |
| `bun run typecheck`        | `tsc --noEmit` over the library, its tests and the site. |
| `bun run test`             | `vitest run`.                                            |
| `bun run build`            | `tsc` writes the declarations to `dist`.                 |
| `bun run install:browsers` | Installs the Chromium that the site tests drive.         |
| `bun run test:site`        | Builds the site and tests it in Chromium (see below).    |

`bun run fix` applies the safe lint fixes and formats code and Markdown.

## Site

`site/` is the documentation site, built with
[folio](https://github.com/risinghq/folio). folio renders each page of the
manual in `docs/` to a static page, and mounts a demo where the page says
`<!-- island NAME -->`. Each demo runs twice, once with solid-motion and once
with `motion/react`, with the same controls. `docs/index.md` is the home page,
and its `hero` island is `site/src/pages/hero.tsx`. The `bench` island on
`docs/compare.md` is `site/src/pages/bench.tsx`; it is not a demo and has no
probe, and `site/tests/bench.spec.ts` runs it.

```sh
bun run --filter solid-motion-site dev    # dev server on localhost:5173
bun run build:site                        # static files in site/dist
```

The tests drive every demo in Chromium. Install the browser first, then run
them:

```sh
bun run install:browsers
bun run test:site
```

A demo is three files in `site/src/demos`: `<name>.config.ts` for its
parameters, `<name>.tsx` for the solid-motion version and its code, and
`<name>.react.tsx` for the `motion/react` twin. Register it in
`site/src/islands.ts`, put a `<!-- island <name> -->` marker where it belongs on
its manual page, and add a probe for it in `site/tests/probes.ts`. A probe says
where the demo ends and which control changes the result.

Every demo has both sides, and the tests drive both with the same probe. A demo
of something solid-motion cannot do yet lands with the feature.

## Tests

Tests run on jsdom. `tests/clock.ts` fakes the clock and the frame loop, so an
animation's progress depends only on how far the test advances the clock. Use
`useFakeClock()` in a suite and `await advance(ms)` to move time forward.

jsdom does no layout. A layout test gives each element a box, as
`tests/layout.test.tsx` does.

A test drives the behavior through `motion.*` or one of the `create*` functions,
and checks what the element looks like. It does not mock `motion-dom`.

## Docs

The manual is in [`docs/`](https://github.com/risinghq/motion/blob/master/docs/README.md). Each page has an example. Run an
example before you change the text around it.

The manual is for people who use the package. Notes on how the code works stay
in this folder: [Architecture](https://github.com/risinghq/motion/blob/master/.github/architecture.md) covers the source files and
their shared state, and [Profiling](https://github.com/risinghq/motion/blob/master/.github/profiling.md) covers `bun run perf`.

`bun run fix` formats the Markdown.

## Releases

Maintainers publish with a tag. See [Releasing](https://github.com/risinghq/motion/blob/master/.github/releasing.md). A push to
`master` that changes the site deploys it. See
[Deploying the site](https://github.com/risinghq/motion/blob/master/.github/deploying.md).

The manual's pages are listed in [llms.txt](https://opensource.rising.sh/solid-motion/llms.txt).
