# Contributing (/resources/contributing)

Upwell is MIT licensed and developed on [GitHub](https://github.com/updateswell/upwell). Issues and
pull requests are welcome.

## The repository [#the-repository]

<Files>
  <Folder name="upwell" defaultOpen>
    <Folder name="packages" defaultOpen>
      <Folder name="core (published as @upwell/core)" defaultOpen>
        <File name="src/ (types, validation, decision engine, versions, rollout)" />
        <File name="schemas/ (JSON Schemas)" />
      </Folder>
      <Folder name="upwell (the SDK, published as upwell)" defaultOpen>
        <Folder name="src" defaultOpen>
          <File name="controller.ts" />
          <File name="react/" />
          <File name="ui/" />
          <File name="expo-updates/" />
          <File name="simulation/" />
        </Folder>
        <File name="android/ (Kotlin, Play Core)" />
        <File name="ios/ (Swift, StoreKit)" />
        <File name="plugin/ (config plugin)" />
      </Folder>
    </Folder>
    <Folder name="apps">
      <File name="docs/ (this site)" />
    </Folder>
    <File name="example/ (example app)" />
  </Folder>
</Files>

## Library [#library]

The root is an npm workspace; run these from it:

```bash
npm install
npm test                          # engine table tests, controller, hooks, UI, plugin
npm run lint && npm run typecheck
npx changeset                     # describe your change for the changelog
```

Engine changes start with a table test in `packages/core/src/__tests__`. `decide()` is pure, so
every rule can be covered without a device. `@upwell/core` has no dependencies and its tests run
in plain Node; `upwell` depends on it and re-exports everything it exports.

Android native code needs JDK 21 for Gradle. iOS native code is compiled in CI on macOS.

## Docs [#docs]

This site is a [Fumadocs](https://fumadocs.dev) app in `apps/docs/`, deployed separately from the
library. It has its own install, outside the workspace.

```bash
cd apps/docs
npm install
npm run dev     # http://localhost:3000/docs
npm run build
```

Pages are MDX files in `apps/docs/content/docs`, and `meta.json` files set the sidebar order. Every page
has an "Open in GitHub" link, so fixing a typo is one click away.
