Monorepo Setup and Linking
We use a monorepo to provide the easiest developer experience. All code lives in a single repository, making it simple to work across frontend, backend, and shared packages without managing multiple repositories or complex dependency setups.
Root Package Configuration
Section titled “Root Package Configuration”The root package.json defines Bun workspaces that link all packages together:
{ "private": true, "workspaces": [ "frontend/*", "tests/*", "scripts/*", "packages/*", "backend/*" ]}Running bun install in the root directory installs dependencies for all packages in the monorepo. Bun automatically links workspace packages together, so changes to one package are immediately available to others.
Package Linking Example
Section titled “Package Linking Example”The packages/presentation-creator package demonstrates how workspace linking works:
packages/presentation-creator/package.json:
{ "name": "@slidespeak/presentation-creator", "exports": { "./chart-renderer/browser": "./src/modules/chart-renderer/browser.ts", "./*": "./src/modules/*/index.ts" }}backend/presentation-creator/package.json:
{ "dependencies": { "@slidespeak/presentation-creator": "workspace:*" }}The workspace:* protocol tells Bun to link to the local workspace package. When you import @slidespeak/presentation-creator in the backend, Bun resolves it to the local package instead of fetching from npm.
Usage in code:
import { Chart } from '@slidespeak/presentation-creator/chart-renderer/types';import { ItemsLayoutType } from '@slidespeak/presentation-creator/shared/new-types';Installing Dependencies
Section titled “Installing Dependencies”Run bun install from the root directory to install dependencies for all packages. Bun handles linking workspace packages automatically, so you don’t need to manually link or build packages during development.