Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 67 additions & 11 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import vueJsx from '@vitejs/plugin-vue-jsx'
import react from '@vitejs/plugin-react'
import { defineConfig } from 'vitepress'
import { vitepressDemoPlugin } from 'vitepress-demo-plugin'
import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
Expand Down Expand Up @@ -168,6 +169,8 @@ const robotSidebarItems = [
}
]


const reactDemoRE = /\/demos\/(?:[a-z-]+\/)?react\/.*\.[jt]sx$/
// https://vitepress.dev/reference/site-config
export default defineConfig({
title: 'OpenTiny NEXT',
Expand Down Expand Up @@ -213,7 +216,9 @@ export default defineConfig({
// 允许以大写扩展名结尾的图片/静态资源被当作资产处理,避免被 import-analyze 当作 JS 解析
assetsInclude: ['**/*.{png,PNG,jpg,JPG,jpeg,JPEG,gif,GIF,webp,WEBP,svg,SVG}'],
plugins: [
vueJsx(),
// vueJsx忽略对react demo的解析
vueJsx({ exclude: [reactDemoRE] }),
react({ include: /\.(jsx|tsx)$/ }),
resolveSubmoduleRelativePathsPlugin([
{
source: path.resolve(rootDir, 'demos'),
Expand All @@ -222,12 +227,17 @@ export default defineConfig({
])
],
server: { open: true },
esbuild: {
include: [/\.ts$/, reactDemoRE]
},
// 子模块里有大量独立站点的 index.html。依赖扫描如果把它们都当成入口,
// 会扫到无效的 import.meta.glob,导致文档站起不来。
optimizeDeps: {
entries: ['.vitepress/theme/index.ts']
entries: ['.vitepress/theme/index.ts'],
include: ['react', 'react-dom', 'react/jsx-runtime', 'antd']
},
resolve: {
dedupe: ['react', 'react-dom'],
alias: {
'@opentiny/tiny-robot-style': '../../tiny-robot/packages/components/dist/style.css',
'@demos': '../' // 根据你的项目结构调整路径
Expand Down Expand Up @@ -335,7 +345,7 @@ export default defineConfig({
activeMatch: '/guide/'
},
{
text: '组件文档',
text: '参考文档',
link: '/genui-sdk/components/renderer',
activeMatch: '/components/'
},
Expand Down Expand Up @@ -451,6 +461,14 @@ export default defineConfig({
{ text: '使用 Renderer 组件', link: 'guide/angular/start-with-renderer' }
]
},
{
text: 'GenUI SDK React 指引',
base: '/genui-sdk/',
items: [
{ text: '安装与配置', link: 'guide/react/install' },
{ text: '使用 Renderer 组件', link: 'guide/react/start-with-renderer' }
]
},
{
text: 'GenUI SDK Server 指引',
base: '/genui-sdk',
Expand All @@ -459,45 +477,63 @@ export default defineConfig({
],
'/genui-sdk/components/': [
{
text: 'Vue 组件文档',
text: 'Vue 文档',
base: '/genui-sdk/components/',
items: [
{ text: 'GenuiRenderer', link: 'renderer' },
{ text: 'GenuiChat', link: 'chat' },
{ text: 'GenuiConfigProvider', link: 'config-provider' }
{ text: 'GenuiConfigProvider', link: 'config-provider' },
{ text: 'generateCode', link: 'code-generator' }
]
},
{
text: 'Angular 文档',
base: '/genui-sdk/components/',
items: [
{ text: 'GenuiRenderer', link: 'angular/renderer' },
{ text: 'GenuiConfigProvider', link: 'angular/config-provider' }
]
},
{
text: 'Angular 组件文档',
text: 'React 文档',
base: '/genui-sdk/components/',
items: [{ text: 'GenuiRenderer', link: 'angular/renderer' }]
items: [
{ text: 'GenuiRenderer', link: 'react/renderer' },
{ text: 'GenuiConfigProvider', link: 'react/config-provider' }
]
},
{
text: 'Server 库文档',
text: 'Server 文档',
base: '/genui-sdk/components/',
items: [
{ text: 'API 参考', link: 'server/api' },
{ text: 'CLI', link: 'server/cli' }
]
},
{
text: 'Core 库文档',
text: 'Core 文档',
base: '/genui-sdk/components/',
items: [{ text: 'API 文档', link: 'core/api' }]
},
{
text: 'Skill Generator 文档',
base: '/genui-sdk/components/',
items: [{ text: 'API 文档', link: 'skill-generator/api' }]
},
{
text: '物料包文档',
base: '/genui-sdk/components/',
items: [
{ text: 'Vue OpenTiny Vue', link: 'materials/vue-opentiny-vue' },
{ text: 'Vue Element Plus', link: 'materials/vue-element-plus' },
{ text: 'Angular OpenTiny NG', link: 'materials/angular-opentiny-ng' }
{ text: 'Angular OpenTiny NG', link: 'materials/angular-opentiny-ng' },
{ text: 'React Ant Design', link: 'materials/react-antd' }
]
}
],
'/genui-sdk/examples/': [
{
text: 'Vue组件 特性示例',
text: 'Vue组件特性示例',
collapsed: false,
items: [
{
Expand Down Expand Up @@ -539,6 +575,12 @@ export default defineConfig({
{ text: '自定义主题', link: 'custom-theme' },
{ text: '国际化配置', link: 'i18n' }
]
},
{
text: '物料库',
collapsed: false,
base: '/genui-sdk/examples/',
items: [{ text: '自定义物料库', link: 'custom-materials' }]
}
]
},
Expand All @@ -559,6 +601,20 @@ export default defineConfig({
]
}
]
},
{
text: 'React 组件特性示例',
collapsed: false,
items: [
{
text: 'Renderer 组件',
base: '/genui-sdk',
items: [
{ text: '自定义 Actions', link: '/examples/react/renderer/custom-actions' },
{ text: '传递合并 State', link: '/examples/react/renderer/state' }
]
}
]
}
],
'/tiny-vue/guide/': [
Expand Down
2 changes: 1 addition & 1 deletion genui/genui-sdk
Submodule genui-sdk updated 537 files
6 changes: 4 additions & 2 deletions genui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
"license": "MIT",
"dependencies": {
"@opentiny/genui-sdk-angular": "workspace:*",
"@opentiny/genui-sdk-materials-vue-opentiny-vue": "1.3.0",
"@opentiny/genui-sdk-vue": "1.3.0"
"@opentiny/genui-sdk-materials-react-antd": "1.4.0",
"@opentiny/genui-sdk-materials-vue-opentiny-vue": "1.4.0",
"@opentiny/genui-sdk-react": "1.4.0",
"@opentiny/genui-sdk-vue": "1.4.0"
},
"devDependencies": {
"vitepress": "^1.6.3",
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
"@opentiny/fluent-editor": "^4.1.0",
"@opentiny/tiny-robot": "workspace:^",
"@opentiny/tiny-robot-playground": "workspace:^",
"@types/react": "^18.3.29",
"@types/react-dom": "^18.3.7",
"@vitejs/plugin-react": "^4.7.0",
"@vitejs/plugin-vue-jsx": "^4.1.2",
"antd": "^5.29.3",
"cross-env": "^7.0.3",
"emoji-mart": "^5.6.0",
"gh-pages": "^2.1.1",
Expand All @@ -36,6 +40,8 @@
"quill-markdown-shortcuts": "^0.0.10",
"quill-table-up": "^3.3.0",
"quill-toolbar-tip": "^0.0.13",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"simple-mind-map": "0.14.0-fix.1",
"simple-mind-map-plugin-themes": "^1.0.1",
"vitepress": "^1.6.3",
Expand Down
Loading