mirror of
https://github.com/hanzoai/ui.git
synced 2026-11-21 00:18:41 +00:00
Four gaps a consumer had to work around, each closed at the one place it
belongs. 8.23.3 + 8.23.4.
`size-*` converted to nothing — the prefix list did not carry the name, so all
17,928 uses across the estate produced `{}`. A class that maps to an empty
object is indistinguishable from one never written: the element renders,
unsized, and the usual result is an icon flattened inside a flex control.
An svg in a button no longer shrinks. A control is a flex row and an svg is a
flex item, so the initial `flex-shrink: 1` resolves "padding leaves less room
than the icon needs" by zeroing the ICON rather than widening the button.
Nothing reports it: present, visible, correctly coloured, 0px across.
`.hz-prose` restores the list marker `base.css` strips from every list in the
document, and gives `pre` the surface that makes a code block read as one.
Those two are a pair — a reset in one file with no restore in the other is not
an error anywhere, so prose.test.ts reads both files and compares them.
97 lines
2.9 KiB
JavaScript
97 lines
2.9 KiB
JavaScript
// source.config.ts
|
|
import { defineConfig, defineDocs } from "fumadocs-mdx/config";
|
|
import rehypePrettyCode from "rehype-pretty-code";
|
|
|
|
// lib/highlight-code.ts
|
|
import { LRUCache } from "lru-cache";
|
|
import { codeToHtml } from "shiki";
|
|
var highlightCache = new LRUCache({
|
|
max: 500,
|
|
ttl: 1e3 * 60 * 60
|
|
// 1 hour.
|
|
});
|
|
var transformers = [
|
|
{
|
|
code(node) {
|
|
if (node.tagName === "code") {
|
|
const raw = this.source;
|
|
node.properties["__raw__"] = raw;
|
|
if (raw.startsWith("npm install")) {
|
|
node.properties["__npm__"] = raw;
|
|
node.properties["__yarn__"] = raw.replace("npm install", "yarn add");
|
|
node.properties["__pnpm__"] = raw.replace("npm install", "pnpm add");
|
|
node.properties["__bun__"] = raw.replace("npm install", "bun add");
|
|
}
|
|
if (raw.startsWith("npx create-")) {
|
|
node.properties["__npm__"] = raw;
|
|
node.properties["__yarn__"] = raw.replace(
|
|
"npx create-",
|
|
"yarn create "
|
|
);
|
|
node.properties["__pnpm__"] = raw.replace(
|
|
"npx create-",
|
|
"pnpm create "
|
|
);
|
|
node.properties["__bun__"] = raw.replace("npx", "bunx --bun");
|
|
}
|
|
if (raw.startsWith("npm create")) {
|
|
node.properties["__npm__"] = raw;
|
|
node.properties["__yarn__"] = raw.replace("npm create", "yarn create");
|
|
node.properties["__pnpm__"] = raw.replace("npm create", "pnpm create");
|
|
node.properties["__bun__"] = raw.replace("npm create", "bun create");
|
|
}
|
|
if (raw.startsWith("npx")) {
|
|
node.properties["__npm__"] = raw;
|
|
node.properties["__yarn__"] = raw.replace("npx", "yarn");
|
|
node.properties["__pnpm__"] = raw.replace("npx", "pnpm dlx");
|
|
node.properties["__bun__"] = raw.replace("npx", "bunx --bun");
|
|
}
|
|
if (raw.startsWith("npm run")) {
|
|
node.properties["__npm__"] = raw;
|
|
node.properties["__yarn__"] = raw.replace("npm run", "yarn");
|
|
node.properties["__pnpm__"] = raw.replace("npm run", "pnpm");
|
|
node.properties["__bun__"] = raw.replace("npm run", "bun");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
];
|
|
|
|
// source.config.ts
|
|
var source_config_default = defineConfig({
|
|
mdxOptions: {
|
|
rehypePlugins: (plugins) => {
|
|
plugins.shift();
|
|
plugins.push([
|
|
rehypePrettyCode,
|
|
{
|
|
theme: {
|
|
dark: "github-dark",
|
|
light: "github-light-default"
|
|
},
|
|
transformers
|
|
}
|
|
]);
|
|
return plugins;
|
|
}
|
|
}
|
|
});
|
|
var docs = defineDocs({
|
|
dir: "content/docs"
|
|
// TODO: Fix this when we upgrade to zod v4.
|
|
// docs: {
|
|
// schema: frontmatterSchema.extend({
|
|
// links: z.optional(
|
|
// z.object({
|
|
// doc: z.string().optional(),
|
|
// api: z.string().optional(),
|
|
// })
|
|
// ),
|
|
// }),
|
|
// },
|
|
});
|
|
export {
|
|
source_config_default as default,
|
|
docs
|
|
};
|