Commit 8b28fa2
refactor(docs): take apps/docs out of the pnpm workspace (#502)
The docs app was the one thing making this a monorepo, and it earned nothing
for it: no shared code, no cross-package imports, its own framework, its own
deploy target. What it did do was break every pnpm install inside a StackBlitz
WebContainer — `ENOENT: apps/docs/.npmrc`, then `ENOENT: apps/docs/node_modules`
— because pnpm's workspace layout and the sandbox fs disagree. The escape
hatch, `--ignore-workspace`, is incompatible with `--frozen-lockfile` precisely
because the lockfile is a workspace lockfile.
So: delete pnpm-workspace.yaml, give apps/docs its own pnpm-lock.yaml, its own
.npmrc (same settings — the app was relying on the root's `shamefully-hoist`),
and pin `packageManager` so Vercel resolves pnpm 10 from the app directory.
The root lockfile is regenerated with a single importer.
Two things this surfaced, both fixed here:
- `build` now runs `fumadocs-mdx` before `next build`. Vercel installs with
`--ignore-scripts` (its own vercel.json says so), and a cold standalone
install + build failed on `Cannot find module 'fumadocs-mdx:collections/
server'` — the generated `.source` has to exist before Turbopack collects
page data. Generating it in `build` makes the cold path deterministic
rather than dependent on a previous run's leftovers.
- `turbopack.root` stays unset. Pinning it to apps/docs looks right for a
standalone app and breaks 231 modules: content lives at the repo root
(`../../../content/**`), so the Turbopack root must stay above this app.
The resulting two-lockfile warning is expected; there's a comment saying so.
Verified locally by rehearsing Vercel's exact sequence in apps/docs:
`rm -rf node_modules && pnpm install --ignore-scripts` → `pnpm build` → 329
static pages, exit 0, from a clean tree. Root `pnpm verify` green.
Co-authored-by: Jack Zhuang <277994282+os-zhuang@users.noreply.github.com>
Co-authored-by: Claude <noreply@anthropic.com>1 parent 7cc6574 commit 8b28fa2
8 files changed
Lines changed: 4581 additions & 4010 deletions
File tree
- .claude
- apps/docs
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
139 | | - | |
| 139 | + | |
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
| |||
146 | 146 | | |
147 | 147 | | |
148 | 148 | | |
149 | | - | |
| 149 | + | |
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
8 | 13 | | |
9 | 14 | | |
10 | 15 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | | - | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | | - | |
| 33 | + | |
0 commit comments