mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-24 20:09:02 +00:00
Unblocks app-build-green for the content-docs apps (spec, gui-docs, zen-docs, base-docs) and advances the docs registry/config app integration. Root causes (upstream-merge artifacts from the 16.x restructure), with the authoritative fix matched to upstream [email protected]: - packages/{base-ui,radix-ui}/src/contexts/i18n.tsx: file was partially overwritten with an older shape — it referenced `defaultTranslations`, `use`, `renderTranslation`, `TranslationValue`, `TranslationObject` without importing/defining any of them, and redeclared a stale local `Translations`. Restored the upstream 16.9.3 context: import the i18n primitives from `fumadocs-core/i18n` + `@/i18n`, use React `use`. This was the `ReferenceError: defaultTranslations is not defined` prerender crash. - packages/core/src/source/page-tree/builder.ts: item `$ref` was emitted as an object `{ file: path }`, violating `PageTree.Item.$ref?: string` and breaking the sort (`aT.localeCompare` on an object → `c.localeCompare is not a function`). Restored upstream string `$ref: path`. - packages/shared/registry.ts: `glob` was imported from `node:fs/promises` (an async generator → `await glob()` is non-iterable → `{} is not iterable`) and `Component` was double-imported. Restored upstream `import { glob } from 'tinyglobby'`. - apps/docs registry codegen aligned to the real `@hanzo/docs-cli/build` (=`fuma-cli/compiler`) API: `components/registry/index.ts` split the merged duplicate `export const registry` back into `compileOptions` + `registry` (restoring the dropped `baseUi`/`sanity` registry imports); `scripts/build-registry.ts` uses `compile({ root, ...compileOptions })` + `writeRegistry` instead of a non-existent `RegistryCompiler`/ `combineRegistry`/`writeDocsRegistry` surface. Restored the dropped `lib/inkeep/inkeep-qa-schema.ts` and declared the inkeep files in the `ai/hanzo` component. - apps/docs/next.config.mts: ESM `__dirname` shim via `fileURLToPath(import.meta.url)`; removed orphaned `createNextStory()` dead line; declared the `@hanzo/docs` workspace dep the config imports. - apps/docs/package.json build:pre/post/lint run via `bun` (resolves `@/` tsconfig aliases) to match every other app — `node` cannot resolve `@/`. - apps/zen-docs/[[...slug]]/page.tsx: reuse the canonical `getMDXComponents()` factory instead of an inline components map whose `next/dynamic` wrappers produced an over-specific `ComponentType` incompatible with `NestedMDXComponents`. Verified `next build` GREEN (exit 0, full static gen): spec 245/245, gui-docs 103/103, zen-docs 129/129, base-docs 19/19. 29/29 packages build green (fumadocs-preview leaf excluded). The `docs` registry/demo app remains blocked only on external `@hanzo/iam`/`@hanzo/logo` packages not present in this tree (the in-flight subject of this branch).