做馒头
基于TypeScript的本地桌面应用。你的应用运行在一个Bun Worker中;一个Rust核心加载了 bun:ffi 拥有窗口并使用wgpu在GPU上绘制UI。没有webview。
早期的发展。 线程模型适用于Linux、macOS和Windows。实体风格的JSX, flexbox布局,文本,文本输入,滚动,圆角和边框,剪切,按,键和车轮工作。
import { Text, View, createSignal, run } from "mantou-ui";
function App() {
const [on, setOn] = createSignal(false);
return (
<View style={{ width: 120, height: 48, borderRadius: 8, justifyContent: "center", backgroundColor: on() ? "#16a34a" : "#4b5563" }} onPress={() => setOn(!on())}>
<Text style={{ color: "#ffffff", fontWeight: 600, textAlign: "center" }}>{on() ? "On" : "Off"}</Text>
</View>
);
}
run(() => <App />);
试一试
bun install
bun run build:core
bun run counter
对于更大的应用程序, 馒头的邮件 是一个以包形式构建在Mantou上的三窗格邮件客户端。
在应用程序中使用它
bun add mantou-ui
bunx mantou run src/main.tsx
原生内核是为Linux (x64、arm64)、macOS (arm64、x64)和Windows (x64)预先构建的。在其他地方,或使用GitHub的mantouu -ui (bun add github:dunkbing/mantou),用它建一次 bunx mantou build-core (需要生锈)。
集 "jsx": "preserve" 和 "jsxImportSource": "mantou-ui" 在 tsconfig.json、预加载 mantou-ui/preload 为 bun test (bunfig.toml). 发现了一个bug或者需要一个特性? 打开一个问题。
文档
给出了设计、方案和测试结果 website/ (Astro + Starlight, on Bun):
bun run docs
以个人身份还是代理人的身份执行代码?开始 AGENTS.md。