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
227 changes: 136 additions & 91 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -20,62 +20,62 @@ const WebAgentSidebar = [
}
]
const TinyEditorSidebar = [
{
text: '基础',
base: '/tiny-editor/guide/',
items: [
{ text: '快速开始', link: 'quick-start' },
{ text: '在前端框架中使用', link: 'used-in-framework' },
{ text: '封装成组件', link: 'componentize' },
],
},
{
text: '使用示例',
base: '/tiny-editor/demo/',
items: [
{ text: '基本用法', link: 'basic-usage' },
{ text: '内容初始化', link: 'set-content' },
{ text: '获取内容', link: 'get-content' },
{ text: '自定义工具栏', link: 'custom-toolbar' },
{ text: '增加工具栏', link: 'add-toolbar-item' },
{ text: '文件上传', link: 'file-upload' },
{ text: '代码块高亮', link: 'code-block-highlight' },
{ text: '表格', link: 'table-up' },
{ text: '@提醒', link: 'mention' },
{ text: '快捷菜单', link: 'shortcut-key' },
{ text: '插入表情', link: 'emoji' },
{ text: '格式刷', link: 'format-painter' },
{ text: '公式', link: 'formula' },
{ text: 'Markdown', link: 'markdown' },
{ text: '字符统计', link: 'counter' },
{ text: '截屏', link: 'screenshot' },
{ text: '国际化', link: 'i18n' },
{ text: '标题列表', link: 'header-list' },
{ text: '工具栏提示', link: 'toolbar-tip' },
{ text: '只读模式', link: 'readonly' },
{ text: '模拟语雀文档', link: 'https://opentiny.github.io/tiny-editor/projects' },
{ text: '图片工具栏', link: 'image-tool' },
{ text: '协同编辑', link: 'collaborative-editing' },
],
},
{
text: 'API 参考',
base: '/tiny-editor/api/',
items: [
{ text: '配置项', link: 'options' },
{ text: 'TinyEditor 实例', link: 'fluent-editor-instance' },
{ text: 'TinyEditor 类', link: 'fluent-editor-class' },
],
},
{
text: '模块生态',
base: '/tiny-editor/modules/',
items: [
{ text: '工具栏提示', link: 'toolbar-tip' },
{ text: '标题列表', link: 'header-list' },
],
},
]
{
text: '基础',
base: '/tiny-editor/guide/',
items: [
{ text: '快速开始', link: 'quick-start' },
{ text: '在前端框架中使用', link: 'used-in-framework' },
{ text: '封装成组件', link: 'componentize' }
]
},
{
text: '使用示例',
base: '/tiny-editor/demo/',
items: [
{ text: '基本用法', link: 'basic-usage' },
{ text: '内容初始化', link: 'set-content' },
{ text: '获取内容', link: 'get-content' },
{ text: '自定义工具栏', link: 'custom-toolbar' },
{ text: '增加工具栏', link: 'add-toolbar-item' },
{ text: '文件上传', link: 'file-upload' },
{ text: '代码块高亮', link: 'code-block-highlight' },
{ text: '表格', link: 'table-up' },
{ text: '@提醒', link: 'mention' },
{ text: '快捷菜单', link: 'shortcut-key' },
{ text: '插入表情', link: 'emoji' },
{ text: '格式刷', link: 'format-painter' },
{ text: '公式', link: 'formula' },
{ text: 'Markdown', link: 'markdown' },
{ text: '字符统计', link: 'counter' },
{ text: '截屏', link: 'screenshot' },
{ text: '国际化', link: 'i18n' },
{ text: '标题列表', link: 'header-list' },
{ text: '工具栏提示', link: 'toolbar-tip' },
{ text: '只读模式', link: 'readonly' },
{ text: '模拟语雀文档', link: 'https://opentiny.github.io/tiny-editor/projects' },
{ text: '图片工具栏', link: 'image-tool' },
{ text: '协同编辑', link: 'collaborative-editing' }
]
},
{
text: 'API 参考',
base: '/tiny-editor/api/',
items: [
{ text: '配置项', link: 'options' },
{ text: 'TinyEditor 实例', link: 'fluent-editor-instance' },
{ text: 'TinyEditor 类', link: 'fluent-editor-class' }
]
},
{
text: '模块生态',
base: '/tiny-editor/modules/',
items: [
{ text: '工具栏提示', link: 'toolbar-tip' },
{ text: '标题列表', link: 'header-list' }
]
}
]
const normalizePath = (path: string, targetStyle: 'windows' | 'linux' = 'linux') => {
if (targetStyle === 'windows') {
return path.replace(/\//g, '\\')
Expand Down Expand Up @@ -274,7 +274,7 @@ export default defineConfig({
],
genuiNav: [
{
text: '使用指南',
text: '快速开始',
link: '/genui-sdk/guide/quick-start',
activeMatch: '/guide/'
},
Expand All @@ -287,6 +287,11 @@ export default defineConfig({
text: '特性示例',
link: '/genui-sdk/examples/renderer/custom-actions',
activeMatch: '/examples/'
},
{
text: '协议规范',
link: '/genui-sdk/schema/protocol',
activeMatch: '/schema/'
}
],
sidebar: {
Expand Down Expand Up @@ -360,13 +365,26 @@ export default defineConfig({
],
'/genui-sdk/guide/': [
{
text: '指引',
text: 'GenUI SDK Vue 指引',
base: '/genui-sdk/guide/',
items: [
{ text: '快速开始', link: 'quick-start' },
{ text: '使用 Renderer 组件', link: 'start-with-renderer' },
{ text: '搭配 TinyRobot 使用', link: 'renderer-with-tiny-robot' }
]
},
{
text: 'GenUI SDK Angular 指引',
base: '/genui-sdk/',
items: [
{ text: '安装与配置', link: 'guide/angular/install' },
{ text: '使用 Renderer 组件', link: 'guide/angular/start-with-renderer' }
]
},
{
text: 'GenUI SDK Server 指引',
base: '/genui-sdk',
items: [{ text: 'Server 包使用文档', link: '/guide/server-usage' }]
}
],
'/genui-sdk/components/': [
Expand All @@ -382,53 +400,80 @@ export default defineConfig({
{
text: 'Angular组件文档',
base: '/genui-sdk/components/',
items: [{ text: 'GenuiRenderer(未开放)', link: 'angular-renderer' }]
items: [{ text: 'GenuiRenderer', link: 'angular/renderer' }]
},
{
text: 'Server包文档',
base: '/genui-sdk/components/server/',
items: [{ text: '使用文档', link: 'usage' }]
text: 'Server 库文档',
base: '/genui-sdk/components/',
items: [
{ text: 'API 参考', link: 'server/api' },
{ text: 'CLI', link: 'server/cli' }
]
}
],
'/genui-sdk/examples/': [
{
text: 'Renderer 组件',
text: 'Vue 组件特性示例',
collapsed: false,
base: '/genui-sdk/examples/renderer/',
items: [
{ text: '自定义 Actions', link: 'custom-actions' },
{ text: '自定义 Components', link: 'custom-components' },
{
text: '配置缓冲字段',
link: 'required-complete-field-selectors'
text: 'Renderer 组件',
collapsed: false,
base: '/genui-sdk/examples/renderer/',
items: [
{ text: '自定义 Actions', link: 'custom-actions' },
{ text: '自定义 Components', link: 'custom-components' },
{
text: '配置缓冲字段',
link: 'required-complete-field-selectors'
},
{ text: '传递合并 State', link: 'state' }
]
},
{ text: '传递合并 State', link: 'state' }
]
},
{
text: 'Chat 组件',
collapsed: false,
base: '/genui-sdk/examples/chat/',
items: [
{ text: '自定义 Actions', link: 'custom-actions' },
{ text: '自定义 Components', link: 'custom-components' },
{ text: '自定义 Snippets', link: 'custom-snippets' },
{ text: '自定义 Examples', link: 'custom-examples' },
{ text: '自定义底部工具栏', link: 'footer-toolbar' },
{ text: '自定义思考过程', link: 'thinking-process' },
{ text: '自定义 Fetch', link: 'custom-fetch' },
{ text: '上传图片', link: 'image-upload' },
{ text: '历史会话管理', link: 'history' }
{
text: 'Chat 组件',
collapsed: false,
base: '/genui-sdk/examples/chat/',
items: [
{ text: '自定义 Actions', link: 'custom-actions' },
{ text: '自定义 Components', link: 'custom-components' },
{ text: '自定义 Snippets', link: 'custom-snippets' },
{ text: '自定义 Examples', link: 'custom-examples' },
{ text: '自定义底部工具栏', link: 'footer-toolbar' },
{ text: '自定义思考过程', link: 'thinking-process' },
{ text: '自定义 Fetch', link: 'custom-fetch' },
{ text: '上传图片', link: 'image-upload' },
{ text: '历史会话管理', link: 'history' }
]
},
{
text: 'ConfigProvider 组件',
collapsed: false,
base: '/genui-sdk/examples/config-provider/',
items: [
{ text: '切换主题', link: 'theme' },
{ text: '自定义主题', link: 'custom-theme' },
{ text: '国际化配置', link: 'i18n' }
]
}
]
},
{
text: 'ConfigProvider 组件',
text: 'Angular 组件特性示例',
collapsed: false,
base: '/genui-sdk/examples/config-provider/',
items: [
{ text: '切换主题', link: 'theme' },
{ text: '自定义主题', link: 'custom-theme' },
{ text: '国际化配置', link: 'i18n' }
{
text: 'Renderer 组件',
base: '/genui-sdk',
items: [
{ text: '自定义 Actions', link: '/examples/angular/renderer/custom-actions' },
{
text: '配置缓冲字段',
link: '/examples/angular/renderer/required-complete-field-selectors'
},
{ text: '传递合并 State', link: '/examples/angular/renderer/state' }
]
}
Comment on lines +465 to +476
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Same broken base/link pattern — Angular example links will misroute.

Same issue as the Server 指引 section: base: '/genui-sdk' with absolute links (leading /) means the base is ignored, resolving to /examples/angular/renderer/... instead of /genui-sdk/examples/angular/renderer/....

🐛 Proposed fix — use trailing slash on base and relative links
             {
               text: 'Renderer 组件',
-              base: '/genui-sdk',
+              base: '/genui-sdk/examples/angular/renderer/',
               items: [
-                { text: '自定义 Actions', link: '/examples/angular/renderer/custom-actions' },
+                { text: '自定义 Actions', link: 'custom-actions' },
                 {
                   text: '配置缓冲字段',
-                  link: '/examples/angular/renderer/required-complete-field-selectors'
+                  link: 'required-complete-field-selectors'
                 },
-                { text: '传递合并 State', link: '/examples/angular/renderer/state' }
+                { text: '传递合并 State', link: 'state' }
               ]
             }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
{
text: 'Renderer 组件',
base: '/genui-sdk',
items: [
{ text: '自定义 Actions', link: '/examples/angular/renderer/custom-actions' },
{
text: '配置缓冲字段',
link: '/examples/angular/renderer/required-complete-field-selectors'
},
{ text: '传递合并 State', link: '/examples/angular/renderer/state' }
]
}
{
text: 'Renderer 组件',
base: '/genui-sdk/examples/angular/renderer/',
items: [
{ text: '自定义 Actions', link: 'custom-actions' },
{
text: '配置缓冲字段',
link: 'required-complete-field-selectors'
},
{ text: '传递合并 State', link: 'state' }
]
}
🤖 Prompt for AI Agents
In @.vitepress/config.mts around lines 465 - 476, The menu object with text
'Renderer 组件' currently sets base: '/genui-sdk' and uses absolute item links
(leading '/'), causing the base to be ignored; update the base to include a
trailing slash (e.g., '/genui-sdk/') and change each item link in the items
array ({ text: '自定义 Actions', { text: '配置缓冲字段', { text: '传递合并 State' }) to
relative paths (remove the leading '/') so links resolve under the base (e.g.,
'examples/angular/renderer/custom-actions', etc.).

]
}
],
Expand Down Expand Up @@ -694,7 +739,7 @@ export default defineConfig({
]
}
],
'/tiny-editor/guide/':TinyEditorSidebar,
'/tiny-editor/guide/': TinyEditorSidebar,
'/tiny-editor/demo/': TinyEditorSidebar,
'/tiny-editor/api/': TinyEditorSidebar,
'/tiny-editor/modules/': TinyEditorSidebar,
Expand Down
2 changes: 1 addition & 1 deletion genui/genui-sdk
3 changes: 2 additions & 1 deletion genui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"author": "",
"license": "MIT",
"dependencies": {
"@opentiny/genui-sdk-vue": "1.0.0-beta.1"
"@opentiny/genui-sdk-angular": "workspace:*",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check pnpm-workspace.yaml for angular package inclusion
echo "=== pnpm-workspace.yaml ===" 
cat pnpm-workspace.yaml 2>/dev/null || echo "File not found"

echo -e "\n=== Root package.json build scripts ===" 
cat package.json | grep -A10 '"scripts"'

Repository: opentiny/docs

Length of output: 833


🏁 Script executed:

#!/bin/bash
# Check the angular package.json to verify the package name
find . -path "*genui-sdk/packages/frameworks/angular/package.json" -type f | head -1 | xargs cat

echo -e "\n=== Check genui/package.json dependencies ===" 
cat genui/package.json | grep -A5 -B5 "@opentiny/genui-sdk-angular"

Repository: opentiny/docs

Length of output: 371


🏁 Script executed:

#!/bin/bash
# Find and display angular package.json
cat genui/genui-sdk/packages/frameworks/angular/package.json 2>/dev/null | head -20 || echo "File not found at expected path"

# Alternative: search for it
echo -e "\n=== Searching for angular package.json ===" 
find . -name "package.json" -path "*/frameworks/angular/*" -type f -exec cat {} \; 2>/dev/null | head -20

Repository: opentiny/docs

Length of output: 100


🏁 Script executed:

#!/bin/bash
# List the directory structure to understand the workspace layout
echo "=== Checking genui-sdk structure ===" 
ls -la genui/genui-sdk/packages/frameworks/ 2>/dev/null || echo "Directory not found"

echo -e "\n=== List all files in genui-sdk ===" 
find genui/genui-sdk -maxdepth 3 -type d | head -20

echo -e "\n=== Search for any angular package.json ===" 
find . -name "package.json" | grep -i angular

Repository: opentiny/docs

Length of output: 211


🏁 Script executed:

#!/bin/bash
# Check what's actually in genui directory
echo "=== Contents of genui directory ===" 
ls -la genui/

echo -e "\n=== Contents of genui-sdk directory ===" 
ls -la genui/genui-sdk/

echo -e "\n=== All package.json files in the repo ===" 
find . -name "package.json" -type f | grep -v node_modules | sort

Repository: opentiny/docs

Length of output: 552


🏁 Script executed:

#!/bin/bash
# Check if the packages declared in pnpm-workspace.yaml actually exist
echo "=== Verifying packages declared in pnpm-workspace.yaml ===" 
pnpm_packages=(
  "tiny-robot"
  "genui"
  "genui/genui-sdk/packages/frameworks/angular"
  "genui/genui-sdk/packages/core"
  "genui/genui-sdk/projects/tiny-schema-renderer-ng"
)

for pkg in "${pnpm_packages[@]}"; do
  if [ -d "$pkg" ]; then
    echo "$pkg exists"
  else
    echo "$pkg DOES NOT EXIST"
  fi
done

echo -e "\n=== Check tiny-robot packages ===" 
find tiny-robot -maxdepth 2 -type f -name "package.json" 2>/dev/null | head -10

Repository: opentiny/docs

Length of output: 359


🏁 Script executed:

#!/bin/bash
# Check git status to see if packages are being ignored or missing
echo "=== Check git status ===" 
git status 2>/dev/null | head -30

echo -e "\n=== Check .gitignore for genui-sdk ===" 
cat .gitignore 2>/dev/null | grep -i genui

echo -e "\n=== Look for any `@opentiny` packages in node_modules (after install) ===" 
find node_modules/@opentiny -maxdepth 2 -type d 2>/dev/null | grep -i angular | head -10

Repository: opentiny/docs

Length of output: 394


Fix workspace package paths in pnpm-workspace.yaml — referenced packages do not exist.

The pnpm-workspace.yaml declares packages at paths that don't exist:

  • genui/genui-sdk/packages/frameworks/angular
  • genui/genui-sdk/packages/core
  • genui/genui-sdk/projects/tiny-schema-renderer-ng

The workspace:* reference to @opentiny/genui-sdk-angular in genui/package.json cannot resolve. The prebuild script will also fail attempting to build a non-existent package. Verify the correct paths for these workspace packages in the repository and update pnpm-workspace.yaml accordingly.

🤖 Prompt for AI Agents
In `@genui/package.json` at line 14, The workspace reference
"@opentiny/genui-sdk-angular" in genui/package.json cannot be resolved because
pnpm-workspace.yaml lists incorrect package paths; open pnpm-workspace.yaml and
update the package globs to the actual repository locations for the SDK (the
entries that currently point to genui/genui-sdk/packages/frameworks/angular,
genui/genui-sdk/packages/core, genui/genui-sdk/projects/tiny-schema-renderer-ng)
so they match where those packages live, or remove/replace the workspace:*
dependency in genui/package.json if the package is not part of the monorepo;
also verify the prebuild script in genui/package.json references the corrected
workspace package names and paths so pnpm can resolve and build
`@opentiny/genui-sdk-angular` successfully.

"@opentiny/genui-sdk-vue": "1.0.0"
},
"devDependencies": {
"vitepress": "^1.6.3",
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"version": "0.1.0",
"scripts": {
"dev": "cross-env VP_MODE=development vitepress dev",
"build": "cross-env VP_MODE=production vitepress build",
"prebuild": "pnpm -F @opentiny/genui-sdk-core build && pnpm -F @opentiny/genui-sdk-angular build:element",
"build": "cross-env VP_MODE=production NODE_OPTIONS=\"--max-old-space-size=8192\" vitepress build",
"preview": "vitepress preview",
"postinstall": "pnpm -F robot-root build"
},
Expand Down
3 changes: 3 additions & 0 deletions pnpm-workspace.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
packages:
- tiny-robot/**
- genui
- genui/genui-sdk/packages/frameworks/angular
- genui/genui-sdk/packages/core
- genui/genui-sdk/projects/tiny-schema-renderer-ng
Loading