Files
zeekayandHanzo Dev 012a1a2d4e fix(collections): generate the content collections into one place
`@hanzo/docs-mdx` writes the collection modules to its outDir, `.docs/`.
Nothing read them there. Apps read a committed `docs/` copy instead, reached
three different ways:

  13 apps  `@hanzo/mdx:collections/server` + a webpack alias -> ./docs/*.ts
   3 apps  `@/docs/server`, straight into the committed copy
   2 apps  the alias, with no committed copy at all

The two with no copy — bootnode-docs and tasks-docs — could not build:

    ./lib/source.tsx
    Module not found: Can't resolve '@hanzo/mdx:collections/server'

and four more built from a copy that no longer matched the content beside it:

    ./docs/server.ts
    Module not found: Can't resolve
      '../content/docs/reference/templates/USER.mdx?collection=docs&only=frontmatter'

That is what committing generated code buys: the build reads a snapshot of
the content rather than the content.

One name, one location, every app: `@hanzo/mdx:collections/*`, resolved to
`.docs/` — the generator's own output, rewritten on every build, gitignored.
`tsconfig` gains the matching `paths` entry so the specifier type-checks
instead of relying on `ignoreBuildErrors`; apps/docs stops overriding outDir
in both `next.config.mts` and `gen:collections`; turbo caches `.docs/**`. The
16 committed mirrors are deleted. Examples already did it this way.

`.source` goes with them — this fork's outDir has been `.docs` for a while,
leaving `.source` in the vite plugin's JSDoc, an example's import map, an
oxlint ignore and `.gitignore` pointing at a directory nothing writes.

Also declares in `globalEnv` the env vars the build scripts actually read
(HANZO_DOCS_SYNC, HIPS_REPO_DIR, DOCS_SECTION, the search vars...). Turbo
does not forward undeclared vars, so `HANZO_DOCS_SYNC=0 turbo run build` had
no effect on the sync it names.

  turbo run build --filter='./apps/*' --continue
    before  Tasks: 33 successful, 40 total
            Failed: bootnode-docs, docs, engine-docs, ml-docs, router-docs,
                    spec, tasks-docs
    after   Tasks: 38 successful, 40 total
            Failed: docs, spec        (both for unrelated reasons, fixed next)

(cherry picked from commit 3d11394b092530489b60931e46b4938a88a2bdd5)

Co-authored-by: Hanzo Dev <[email protected]>
2026-08-04 18:39:19 -07:00

67 lines
1.3 KiB
JSON

{
"$schema": "https://turbo.build/schema.json",
"globalEnv": [
"HANZO_PUBLISHABLE_KEY",
"GITHUB_APP_PRIVATE_KEY",
"GITHUB_APP_ID",
"GITHUB_TOKEN",
"GH_TOKEN",
"GH_PAT",
"DOCS_SECTION",
"GITHUB_PAGES",
"NEXT_EXPORT",
"HIPS_REPO_DIR",
"HANZO_DOCS_SYNC",
"HANZO_DOCS_LOCAL_ROOT",
"HANZO_DOCS_ORGS",
"HANZO_DOCS_PRUNE",
"HANZO_DOCS_DRY_RUN",
"HANZO_DOCS_CONCURRENCY",
"HANZO_DOCS_FETCH_REMOTE",
"HANZO_DOCS_INCLUDE_PRIVATE",
"HANZO_SEARCH_BACKEND",
"HANZO_SEARCH_INDEX",
"HANZO_SEARCH_INDEX_ENDPOINT",
"HANZO_SEARCH_ADMIN_KEY"
],
"ui": "stream",
"tasks": {
"build": {
"dependsOn": ["^build"],
"env": [
"NEXT_EXPORT",
"GITHUB_PAGES",
"DOCS_SECTION",
"ANALYZE",
"HANZO_DOCS_*",
"HANZO_SEARCH_*"
],
"passThroughEnv": ["NODE_OPTIONS"],
"outputs": [
".output",
"public/registry",
".docs/**",
".next/**",
"!.next/cache/**",
"dist/**",
"css/generated/**",
"out",
"build",
".vercel"
]
},
"lint": {},
"types:check": {
"dependsOn": [],
"outputs": []
},
"clean": {
"cache": false
},
"dev": {
"cache": false,
"persistent": true
}
}
}