mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-25 04:20:02 +00:00
Finish the fumadocs→Hanzo Docs rebrand: rename the remaining fuma-named
workspace packages and every reference so the framework is uniformly
@hanzo/docs-*. One brand, no Fuma in package names or product surface.
Package renames (name field + all refs: deps, imports, CSS @import,
configs, .changeset, next/vite build config):
fumadocs-core → @hanzo/docs-core
fumadocs-mdx → @hanzo/docs-mdx
fumadocs-ui → @hanzo/docs-ui (packages/radix-ui)
fumadocs-openapi → @hanzo/docs-openapi
fumadocs-preview → @hanzo/docs-preview
@fumadocs/base-ui → @hanzo/docs-base-ui
@fumadocs/basehub → @hanzo/docs-basehub
@fumadocs/language → @hanzo/docs-language
@fumadocs/local-md → @hanzo/docs-local-md
@fumadocs/sanity → @hanzo/docs-sanity
@fumadocs/shadcn → @hanzo/docs-shadcn
@fumadocs/vite → @hanzo/docs-vite
@fumari/stf → @hanzo/docs-stf
create-fumadocs-app → @hanzo/create-docs
create-fumadocs-versions → @hanzo/docs-create-versions
Stale @fumadocs/{cli,story,tailwind,mdx-remote,...} references collapsed to
their existing @hanzo/docs-* canonical packages (no dup created).
De-branded product strings: Fumadocs/Fuma prose → Hanzo Docs/Hanzo; site
branding, CLI output, doc copy, AI-assistant name, metadata. URLs
fumadocs.dev → docs.hanzo.ai, repo fuma-nama/fumadocs → hanzoai/docs.
Filesystem renames: packages/python/fumapy → hanzodocs_py, preview config,
what-is-fumadocs.mdx → what-is-hanzo-docs.mdx, api/fumadocs-ui route.
KEPT (real external npm deps / attribution — NOT renamed):
fuma-cli, fuma-content, @fumari/json-schema-ts (published upstream pkgs),
typesense-/trieve-fumadocs-adapter (3rd-party search adapters),
LICENSE "Copyright (c) 2023 Fuma" (OSS attribution, all 7 LICENSE files
untouched), CHANGELOG.md history (accurate release records, left as-is).
Build: node 24, pnpm install clean; all 4 target apps next build GREEN
(spec, gui-docs, zen-docs, base-docs) + full package closure (18/18 turbo).
Gate: zero @hanzo-package fumadocs-/@fumadocs/ references remain.
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
/**
|
|
* Strip duplicate H1 headings from MDX files.
|
|
* Hanzo Docs renders title from frontmatter, so body H1s are redundant.
|
|
*/
|
|
import { readdir, readFile, writeFile } from 'fs/promises';
|
|
import { join } from 'path';
|
|
|
|
const DEST = '/Users/z/work/hanzo/docs/apps/bot-docs/content/docs';
|
|
|
|
async function* walkMdx(dir: string): AsyncGenerator<string> {
|
|
const entries = await readdir(dir, { withFileTypes: true });
|
|
for (const entry of entries) {
|
|
const fullPath = join(dir, entry.name);
|
|
if (entry.isDirectory()) {
|
|
yield* walkMdx(fullPath);
|
|
} else if (entry.name.endsWith('.mdx')) {
|
|
yield fullPath;
|
|
}
|
|
}
|
|
}
|
|
|
|
async function main() {
|
|
let fixed = 0;
|
|
for await (const path of walkMdx(DEST)) {
|
|
let content = await readFile(path, 'utf-8');
|
|
|
|
// Match frontmatter
|
|
const fmMatch = content.match(/^---\n([\s\S]*?)\n---\n([\s\S]*)$/);
|
|
if (!fmMatch) continue;
|
|
|
|
const fm = fmMatch[1];
|
|
let body = fmMatch[2];
|
|
|
|
// Extract title from frontmatter
|
|
const titleMatch = fm.match(/^title:\s*"(.+)"$/m);
|
|
if (!titleMatch) continue;
|
|
|
|
// Strip first H1 if it matches or exists
|
|
const h1Match = body.match(/^\s*#\s+(.+)\n+/);
|
|
if (h1Match) {
|
|
body = body.replace(/^\s*#\s+.+\n+/, '\n');
|
|
const newContent = `---\n${fm}\n---\n${body}`;
|
|
await writeFile(path, newContent, 'utf-8');
|
|
fixed++;
|
|
}
|
|
}
|
|
console.log(`Stripped H1 from ${fixed} files`);
|
|
}
|
|
|
|
main().catch(console.error);
|