1. Declare workspaces
The root package.json lists workspace globs; packages/* makes every folder under packages/ a workspace package.
"workspaces": ["packages/*"]Typorithm · medium
Step 1 of 8 · intro card
Package Manager
Add "workspaces": ["packages/*"] to the root package.json to turn a repo into a monorepo. One bun install hoists shared deps and symlinks local packages, and bun --filter <name> runs a specific package's script.
A Bun monorepo is declared by a "workspaces" array in the root package.json, where each glob like packages/* marks which folders are workspace packages.
Running bun install once at the root resolves every package, hoists shared dependencies into the root node_modules, and symlinks local packages so imports between them resolve as if they were published.
bun --filter <name> run <script> scopes a command to one workspace by its package name, letting you run, build, or test a single package without leaving the root.
"workspaces": ["packages/*"] declares the monorepo in root package.json.
One bun install hoists deps and symlinks local packages.
bun --filter <name> runs a single package's script.
// root package.json
{
"workspaces": ["packages/*"]
}
bun install
bun --filter web run devConnect each part of the code to the concept before you type.
The root package.json lists workspace globs; packages/* makes every folder under packages/ a workspace package.
"workspaces": ["packages/*"]A single bun install at the root hoists shared dependencies and symlinks local packages so they resolve like published modules.
bun install--filter <name> targets one workspace by its package name, running that package's dev script.
bun --filter web run devRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.