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).
Follow-up to 4b114df1: the package-name normalization covered JS/TS imports +
package.json but missed four other surfaces that name the same phantom packages,
relocating the breakage from 'pnpm install' to 'next/vite/astro build':
- H1: 46 CSS @import strings (@hanzo/docs-{base-ui,ui,openapi}/css/*) → real pkgs
(preserved legit @hanzo/docs-{twoslash,story} CSS)
- H2: examples/astro .astro imports (base-ui/mdx→fumadocs-ui/mdx, docs-core/toc→fumadocs-core/toc)
- L1: .changeset/config.json fixed-array lockstep names
- L2: removed apps/docs/next.config.mts dead phantom→phantom self-alias + dup keys
Found by adversarial red review of 4b114df1.
The fumadocs-fork rebrand left ~13 apps + examples referencing packages under
names that don't exist in the workspace (in BOTH directions: some kept
fumadocs-*, some became @hanzo/docs-*). pnpm install failed outright. Mapped
every reference (deps + imports, 607 source + 61 package.json) to the package
that actually exists, by suffix:
@hanzo/docs-{core,mdx,ui,base-ui} → fumadocs-{core,mdx,ui} / @fumadocs/base-ui
@fumadocs/{story,cli,mdx-remote,tailwind} → @hanzo/docs-{story,cli,...}
fumadocs-{docgen,epub,twoslash,typescript} → @hanzo/docs-{...}
drop phantom eslint-config-custom
Guarded @hanzo/docs-mdx vs -mdx-remote. Also fixes a pre-existing cli bug
(createConfigSchema referenced undefined isSrc) that blocked the package build.
Verified: pnpm install resolves clean (46.8s, was broken); package dist
regenerates phantom-free from the corrected source (hanzo-docs 430→0). Full
app build-green is blocked only by a node v26 toolchain bug in fumadocs-mdx's
config loader (repo targets node >=24.14; CI node builds it).
Renames the public doc-collection method across runtime, types, examples
and create-app templates so the API carries no upstream brand. The
internal helper and all call sites move together; fumadocs-core package
imports are untouched. Pairs with the .docs default outDir change.
BREAKING CHANGE: docs.toFumadocsSource() is now docs.toDocsSource().
Co-authored-by: Hanzo Dev <[email protected]>
The plugin default outDir was 'docs' while every template and example
tsconfig aliased collections/* -> ./.source/*, so a fresh fork could not
resolve `import { docs } from 'collections/server'` without manually
passing createMDX({ outDir }). Standardize on .docs everywhere:
- packages/mdx/src/core.ts: _Defaults.outDir 'docs' -> '.docs'
- 31 template/example tsconfig: collections/* -> ./.docs/*
- align generated-dir .gitignore entries to .docs
- changeset (patch)
Co-authored-by: Hanzo Dev <[email protected]>
Upstream changes include:
- UI: improved TOC detection, clerk variant, slot support
- Base UI: redesigned home layout navigation menu
- CLI: slot support in customise command
- OpenAPI: unsetting auth fields in playground
- Multiple version package releases
All fumadocs-* imports renamed to @hanzo/docs-* namespace.
tsdown wasn't resolving the @/ tsconfig path alias in our repo,
causing UNRESOLVED_IMPORT errors in CI. Convert all @/utils/* imports
to relative paths for reliable builds.
The upstream remark-include.ts imported from @/utils/fuma-matter which
doesn't exist in our fork — we use @/utils/frontmatter with
parseFrontmatter() instead. Updated the import to use our module.