Need help? Check out the Reddit Developer Platform community on Reddit.
This is a mono repo whose build is managed by Turborepo, a monorepo build tool for javascript projects.
Different logical parts of the code are split into separate packages/<foo|bar|baz>
folders. Note that not all packages are necessarily pure JavaScript packages, but the scripts to build, install dependencies, and their interdependence on each other are managed through package.json
files so that TurboRepo can manage the build ordering and high-level commands.
Packages will need to each provide their own yarn build
command.
The repo we can look to for examples of how to set things up is turbo's kitchen-sink example
To quickly make a new package you should be able to copy the template-package
directory and rename it and its package.json->name
field
- Node v18 - specifically, v18.18.2 or later, but not v20 (yet!). We recommend you install it using NVM.
- yarn, should be pre-installed on node18 with corepack enabled:
corepack enable
Install javascript dependencies by running yarn
from the repo root. This will install all
dependencies for all packages. It'll also generate a yarn.lock
file, which is ignored - we
maintain that lockfile internally, so we don't need to worry about it in this repo.
- Top level
yarn <foo>
commands run through [turborepo](https://github.com/vercel/turborepo for all packages yarn workspace <package-name> foo
will doyarn run foo
only for the package with matching<package-name>
field from a specificpackage.json
yarn
to installyarn build
to build all packages in order
yarn
to install depsyarn test
to test all packages and check their TypeScript typesyarn lint
to lint all packages
The repo is set up to do some basic and global linting and formatting through package.json's husky config. This is a good way to catch some basic issues before you commit.