Skip to content

Installing Packages with Bun

This project uses Bun as the package manager for managing dependencies across the monorepo.

Installing Bun (Mac)

To get started, you need to install Bun on your machine. For Mac users, the recommended way is via the install script:

sh
curl -fsSL https://bun.sh/install | bash

This will download and install Bun. After installation, restart your terminal or follow the instructions provided by the installer to add Bun to your PATH.

How Bun Works in This Monorepo

  • All dependencies are installed at the root of the monorepo.
    • Do not install packages inside individual packages or apps.
    • This ensures a single source of truth for dependencies and avoids duplication.

Adding Packages

To add a new package (dependency), run the following command from the root of the monorepo:

sh
bun add <package-name>

For example, to add lodash:

sh
bun add lodash

To add a development dependency:

sh
bun add -d <package-name>

Removing Packages

To remove a package, use:

sh
bun remove <package-name>

What is bun.lock?

  • The bun.lock file is automatically generated and updated by Bun.
  • It locks the exact versions of all installed dependencies, ensuring consistent installs across all environments and machines.
  • You should commit bun.lock to version control.

Installing All Dependencies

After cloning the repository or when dependencies change, install all packages by running:

sh
bun install

This will install all dependencies as specified in the package.json and locked in bun.lock at the root of the monorepo.


For more details, see the Bun documentation or ask in the team chat if you have questions.