Skip to content

Latest commit

 

History

History
88 lines (57 loc) · 2.98 KB

CONTRIBUTING.md

File metadata and controls

88 lines (57 loc) · 2.98 KB

Contributing

Respository

The repository is a monorepo containing multiple packages.

Repository structure

Directory Description
.github GitHub Actions workflows.
.husky Husky precommit hook configuration.
adrs Architectural decision records for this repository.
configs Shared configuration files for various tools.
packages Reusable library packages for use in applications and other libraries.
scripts Scripts used across the repository like GitHub workflows.

Required tooling

When working on projects you'll need the following tools installed:

Getting started

Before you can work on any packages nstall the repositories dependencies:

pnpm install

To run checks on the entire repository:

pnpm build
pnpm lint
pnpm test
pnpm typecheck

Work on a single package:

# Switch to the package you want to work on
cd packages/<package-name>

# Build that package
pnpm build

# Run the packages tests
pnpm test

# Run the packages tests in watch mode
pnpm test -- --watch

Managing dependencies

We try to keep dev dependencies in the root package.json. This helps us align all out tooling for every package.

To add a new dev dependency:

pnpm add -D -w <package-name>

Any peer dependencies packages have should be added as dev dependencies to the root package.json of the package that depends on them. This ensures that they are available for every package in the repository that may need them.

Publishing packages

We use changesets to orchestrate publishing, changelogs and versioning of packages. There is detailed documentation for how to use changesets in the changesets repository but here is a simple overview of the process.

When you want to publish packages you create a changeset:

pnpm changeset

Work through the CLI options and select which packages to release and what version bump they require (major, minor or patch) and answer any other questions.

Once you have created a changeset you can commit it to your branch and open a PR. When the PR is merged changeset will generate a changelog off your changeset and open its own PR. When that PR is merged changesets will publish unpublished packages to the registry.

Architectural Decision Records

We use ADR's in this repository to document architectural decisions. You can find them in the adrs directory.

The tool we use to manage these is adr-tools.