Files
mpc/docs/package.json
T
zeekayandHanzo Dev 7025aff29b fix(docs): generate .source at build time, and load it the way the runtime expects
With the lockfile resynced the docs job got past install and failed at build:

    Module not found: Can't resolve './.source'   (from lib/source.ts)

.source is GENERATED and gitignored, and this package had no step that produced
it — `build` was a bare `next build` and there was no postinstall. It only ever
worked where a stale .source happened to be lying around, which is why a laptop
built it and a fresh checkout never could.

Three things, each found by making the previous one fail differently:

1. Nothing generated .source. Now `hanzo-mdx source.config.ts .source` runs in
   both build and postinstall, the shape luxfi/consensus already uses.

2. `import { docs } from "@/.source"` is a DIRECTORY import and the generator
   emits no index — it writes browser.ts / dynamic.ts / server.ts. consensus
   imports "@/.source/server"; so does this now.

3. `docs.toFumadocsSource()` did not exist, and neither did `toSource()` — the
   generated code targets `@hanzo/docs/mdx/runtime/server`, while lib/source.ts
   pulled its loader from `fumadocs-core`, mixing two stacks. It resolved
   @hanzo/docs 16.2.7 where consensus runs 16.4.x and works. Loader now comes
   from `@hanzo/docs/core/source` with `toSource()`, and the range is pinned
   ^16.4.1 to match consensus rather than left to drift.

Verified as a fresh checkout would run it — node_modules and .source deleted
first:

    pnpm install --frozen-lockfile   OK
    .source after install            generated by postinstall
    pnpm build                       OK

Only docs/ is touched; the dashboard/ work in this tree is left alone.

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-02 06:22:34 -07:00

45 lines
1.2 KiB
JSON

{
"name": "@luxfi/mpc-docs",
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev --port 3022",
"build": "hanzo-mdx source.config.ts .source && next build",
"export": "TURBOPACK=0 next build",
"start": "next start",
"lint": "next lint",
"postinstall": "hanzo-mdx source.config.ts .source"
},
"dependencies": {
"@hanzo/docs": "^16.4.1",
"@hanzo/docs-core": "^16.9.3",
"@hanzo/mdx": "^14.2.5",
"@hanzo/ui": "^5.3.28",
"fumadocs-core": "^15.0.0",
"fumadocs-mdx": "^12.0.0",
"fumadocs-ui": "^16.0.0",
"geist": "^1.3.0",
"lucide-react": "^0.468.0",
"next": "16.0.1",
"next-themes": "^0.4.6",
"react": "19.2.0",
"react-day-picker": "^9.0.0",
"react-dom": "19.2.0",
"react-resizable-panels": "^2.0.0",
"tailwindcss": "^4.1.16",
"zod": "^4.2.1"
},
"devDependencies": {
"@tailwindcss/postcss": "^4.1.16",
"@types/node": "^22.10.2",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.2",
"autoprefixer": "^10.4.20",
"postcss": "^8.4.49",
"rehype-pretty-code": "^0.14.1",
"shiki": "^1.27.2",
"typescript": "^5.7.2"
},
"packageManager": "[email protected]"
}