import { CodeBlock } from '@astryxdesign/core/CodeBlock' import { Divider } from '@astryxdesign/core/Divider' import { Grid } from '@astryxdesign/core/Grid' import { Heading } from '@astryxdesign/core/Heading' import { Icon } from '@astryxdesign/core/Icon' import { List, ListItem } from '@astryxdesign/core/List' import { Text } from '@astryxdesign/core/Text' import { VStack } from '@astryxdesign/core/VStack' import { ArrowRight, Atom, Blocks, BookOpen, ExternalLink, Palette, Route, Shapes, Zap, } from 'lucide-react' import { Page, PageHeader } from '../components/Page' const COMMANDS = `npm run dev # 启动开发服务器 npm run build # 类型检查并构建生产版本 npm run lint # 运行 oxlint npm run preview # 预览生产构建 npm run astryx -- component Button # 查看 Astryx 组件文档` const PROJECT_TREE = `src/ components/ AppLayout.tsx 应用外壳、顶部导航、侧边导航 Page.tsx 共用页面框架与页头 pages/ HomePage.tsx ComponentsPage.tsx AboutPage.tsx NotFoundPage.tsx theme/ ThemeMode.tsx 明暗主题提供者 astryx-themes.ts 生成的主题注册表 router.tsx React Router 路由表 App.tsx 提供者与路由 main.tsx 入口文件` const STACK = [ { name: 'React', version: '19.3', icon: Atom, description: '界面运行时与 Hooks', }, { name: 'Vite', version: '8.3', icon: Zap, description: '开发服务器与生产构建工具', }, { name: 'React Router', version: '7.18', icon: Route, description: '基于数据路由的客户端路由,可在 hash 与 history 模式间切换', }, { name: 'Astryx', version: '0.7.2', icon: Palette, description: '设计系统、组件与 neutral 主题', }, ] export function AboutPage() { return ( 技术栈 {STACK.map(({ name, version, icon, description }) => ( } endContent={ {version} } /> ))} 常用命令 Vite 8 需要 Node 20.19+。 项目结构 在 src/pages 下新建页面,然后在{' '} src/router.tsx 中注册路由,并在{' '} src/components/AppLayout.tsx{' '} 中添加对应的导航项。 继续探索 } endContent={} /> } endContent={} /> } endContent={ } /> } endContent={ } /> 主题 自动生成的 src/astryx-themes.ts{' '} 文件注册了 neutral 主题。可以运行{' '} npm run astryx -- theme add <slug>{' '} 添加其他主题包,然后在{' '} src/theme/ThemeMode.tsx{' '} 中把它传给主题提供者。 Astryx 自带预构建 CSS,因此这个应用不需要 StyleX、PostCSS 或 Babel 插件。 ) }