Dev Overflow Logo

Dev Overflow

Global search

Search across questions, answers, users and tags.

Should I use a monorepo for a small side project?

clock icon

asked 3 months ago

message icon

2

eye icon

729

Two packages: a Next.js web app and a small CLI that shares some types with it. Is a monorepo overkill at this size, or does it pay off early?

2 Answers

At two packages sharing types, yes — but keep it boring. npm/pnpm workspaces are enough:

1{ "workspaces": ["apps/*", "packages/*"] }
1{ "workspaces": ["apps/*", "packages/*"] }

The payoff is that a type change and the code reacting to it land in one commit, and there is no publish step between them. That is worth a lot even at this size.

What you should skip is the heavy tooling — Nx, Bazel, remote caching. Those solve problems you get at fifty packages and a twenty-minute CI run, and they cost real setup time now.

Counterpoint: if the shared surface is genuinely just types, a single types.ts copied between two repos costs less than a workspace setup, and you can always merge later. Monorepos are easy to adopt and hard to reverse.

1

of 1

Write your answer here

Introduce the problem and expand on what you've put in the title.

Top Questions