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.
88 lines
2.5 KiB
Python
88 lines
2.5 KiB
Python
from __future__ import annotations
|
|
|
|
from importlib.metadata import version
|
|
|
|
import griffe
|
|
|
|
from .models import Class, Function, Module
|
|
from .simplify_docstring import simplify_docstring
|
|
from .utils import build_signature
|
|
|
|
|
|
def parse_module(m: griffe.Object) -> Module:
|
|
if not isinstance(m, griffe.Module):
|
|
raise ValueError("Module must be a module")
|
|
|
|
out = simplify_docstring(m.docstring, m)
|
|
res: Module = {
|
|
"name": m.name,
|
|
"path": m.path,
|
|
"filepath": m.filepath,
|
|
"description": out.description,
|
|
"docstring": out.remainder,
|
|
"attributes": out.attributes,
|
|
"modules": {
|
|
name: parse_module(value)
|
|
for name, value in m.modules.items()
|
|
if not value.is_alias
|
|
},
|
|
"classes": {
|
|
name: parse_class(value)
|
|
for name, value in m.classes.items()
|
|
if not value.is_alias
|
|
},
|
|
"functions": {
|
|
name: parse_function(value)
|
|
for name, value in m.functions.items()
|
|
if not value.is_alias
|
|
},
|
|
}
|
|
if m.is_package:
|
|
try:
|
|
res["version"] = version(m.name)
|
|
except AttributeError:
|
|
res["version"] = "unknown"
|
|
|
|
return res
|
|
|
|
|
|
def parse_class(c: griffe.Class) -> Class:
|
|
out = simplify_docstring(c.docstring, c)
|
|
res: Class = {
|
|
"name": c.name,
|
|
"path": c.path,
|
|
"description": out.description,
|
|
"parameters": out.parameters,
|
|
"attributes": out.attributes,
|
|
"docstring": out.remainder,
|
|
"functions": {
|
|
name: parse_function(value)
|
|
for name, value in c.functions.items()
|
|
if not value.is_alias
|
|
},
|
|
"source": c.source,
|
|
"inherited_members": {},
|
|
}
|
|
for member in c.inherited_members.values():
|
|
parent_path = ".".join(member.canonical_path.split(".")[:-1])
|
|
member_info = {"kind": member.kind, "path": member.canonical_path}
|
|
if parent_path not in res["inherited_members"]:
|
|
res["inherited_members"][parent_path] = []
|
|
res["inherited_members"][parent_path].append(member_info)
|
|
return res
|
|
|
|
|
|
def parse_function(f: griffe.Function) -> Function:
|
|
out = simplify_docstring(f.docstring, f)
|
|
res: Function = {
|
|
"name": f.name,
|
|
"path": f.path,
|
|
"signature": build_signature(f),
|
|
"description": out.description,
|
|
"parameters": out.parameters,
|
|
"returns": out.returns,
|
|
"docstring": out.remainder,
|
|
"source": f.source,
|
|
}
|
|
return res
|