@chatbi-v/cli 1.0.9 → 1.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/app/.env.hbs +1 -1
  2. package/dist/index.js +1 -2
  3. package/package.json +5 -5
  4. package/templates/app/.env.hbs +1 -1
  5. package/templates/app/package.json.hbs +6 -1
  6. package/templates/monorepo/package.json.hbs +1 -1
  7. package/templates/plugin/package.json.hbs +1 -1
  8. package/dist/app/README.md.hbs +0 -16
  9. package/dist/app/chatbi.config.ts.hbs +0 -60
  10. package/dist/app/index.html.hbs +0 -12
  11. package/dist/app/package.json.hbs +0 -34
  12. package/dist/app/postcss.config.cjs.hbs +0 -6
  13. package/dist/app/src/App.tsx.hbs +0 -92
  14. package/dist/app/src/components/GlobalErrorBoundary.tsx.hbs +0 -69
  15. package/dist/app/src/components/GlobalSettingsModal.tsx.hbs +0 -35
  16. package/dist/app/src/components/LayoutSkeletons.tsx.hbs +0 -79
  17. package/dist/app/src/components/index.ts.hbs +0 -2
  18. package/dist/app/src/custom-antd.less.hbs +0 -7
  19. package/dist/app/src/features/settings/ConfigRenderStrategy.tsx.hbs +0 -119
  20. package/dist/app/src/features/settings/ExtensionSettings.tsx.hbs +0 -52
  21. package/dist/app/src/features/settings/PluginList.tsx.hbs +0 -115
  22. package/dist/app/src/features/settings/PluginSettings.tsx.hbs +0 -123
  23. package/dist/app/src/features/settings/SchemaSettingsRenderer.tsx.hbs +0 -56
  24. package/dist/app/src/hooks/useAppRoutes.ts.hbs +0 -39
  25. package/dist/app/src/hooks/usePluginLoader.ts.hbs +0 -22
  26. package/dist/app/src/hooks/usePluginSettings.ts.hbs +0 -29
  27. package/dist/app/src/hooks/useThemeSync.ts.hbs +0 -108
  28. package/dist/app/src/index.css.hbs +0 -45
  29. package/dist/app/src/layouts/BackgroundEffects.tsx.hbs +0 -10
  30. package/dist/app/src/layouts/MainContent.tsx.hbs +0 -58
  31. package/dist/app/src/layouts/SidebarNav.tsx.hbs +0 -182
  32. package/dist/app/src/main.tsx.hbs +0 -43
  33. package/dist/app/src/providers/AppProviders.tsx.hbs +0 -36
  34. package/dist/app/src/services/api/index.ts.hbs +0 -37
  35. package/dist/app/src/services/api/modules/auth.ts.hbs +0 -18
  36. package/dist/app/src/services/config-service.ts.hbs +0 -48
  37. package/dist/app/src/stores/storage-adapter.ts.hbs +0 -29
  38. package/dist/app/src/stores/useSessionStore.ts.hbs +0 -22
  39. package/dist/app/src/stores/useUIStore.ts.hbs +0 -64
  40. package/dist/app/tailwind.config.cjs.hbs +0 -14
  41. package/dist/app/tsconfig.json.hbs +0 -26
  42. package/dist/app/vite.config.ts.hbs +0 -89
  43. package/dist/monorepo/README.md.hbs +0 -30
  44. package/dist/monorepo/package.json.hbs +0 -38
  45. package/dist/monorepo/pnpm-workspace.yaml.hbs +0 -10
  46. package/dist/monorepo/tsconfig.json.hbs +0 -26
  47. package/dist/plugin/package.json.hbs +0 -23
  48. package/dist/plugin/src/index.tsx.hbs +0 -90
  49. package/dist/plugin/tsconfig.json.hbs +0 -14
@@ -1,38 +0,0 @@
1
- {
2
- "name": "{{name}}",
3
- "private": true,
4
- "version": "1.0.0",
5
- "description": "ChatBI-V {{#if isBusiness}}Business{{else}}System{{/if}} Plugin Project",
6
- "type": "module",
7
- "scripts": {
8
- "dev": "pnpm --filter @chatbi-v/main dev",
9
- "build": "pnpm -r build",
10
- "create:plugin": "node scripts/create-plugin.js"
11
- },
12
- "workspaces": [
13
- "apps/*",
14
- "plugins/*"
15
- ],
16
- "dependencies": {
17
- "react": "^18.3.1",
18
- "react-dom": "^18.3.1",
19
- "antd": "^5.29.3",
20
- "axios": "^1.13.2",
21
- "clsx": "^2.1.1",
22
- "echarts-for-react": "^3.0.5",
23
- "reactflow": "^11.11.4"
24
- },
25
- "devDependencies": {
26
- "typescript": "^5.0.0",
27
- "@chatbi-v/cli": "link:./.chatbi/cli",
28
- "@ant-design/icons": "^5.6.1",
29
- "@types/react": "^18.3.1",
30
- "@types/react-dom": "^18.3.1",
31
- "vite": "^5.4.0",
32
- "@vitejs/plugin-react": "^4.3.1",
33
- "tailwindcss": "^3.4.0",
34
- "postcss": "^8.4.0",
35
- "autoprefixer": "^10.4.0",
36
- "pnpm": ">=9.0.0"
37
- }
38
- }
@@ -1,10 +0,0 @@
1
- # ChatBI Monorepo Workspace Configuration
2
- packages:
3
- # 宿主应用目录
4
- - 'apps/*'
5
- # 插件目录
6
- - 'plugins/*'
7
-
8
- # 增量配置:如果添加了核心库或工具库,可在此处包含
9
- # - 'packages/*'
10
- # - 'libs/*'
@@ -1,26 +0,0 @@
1
- {
2
- "extends": "./.chatbi/tsconfig.paths.json",
3
- "compilerOptions": {
4
- "target": "ESNext",
5
- "useDefineForClassFields": true,
6
- "lib": ["DOM", "DOM.Iterable", "ESNext"],
7
- "allowJs": false,
8
- "skipLibCheck": true,
9
- "esModuleInterop": false,
10
- "allowSyntheticDefaultImports": true,
11
- "strict": true,
12
- "forceConsistentCasingInFileNames": true,
13
- "module": "ESNext",
14
- "moduleResolution": "Node",
15
- "resolveJsonModule": true,
16
- "isolatedModules": true,
17
- "noEmit": true,
18
- "jsx": "react-jsx",
19
- "baseUrl": ".",
20
- "paths": {
21
- "@chatbi-plugins/*": ["./plugins/*/src"],
22
- "@chatbi-apps/*": ["./apps/*/src"]
23
- }
24
- },
25
- "include": ["apps/main/src", "plugins/*/src"]
26
- }
@@ -1,23 +0,0 @@
1
- {
2
- "name": "{{name}}",
3
- "version": "1.0.0",
4
- "type": "module",
5
- "plugin": true,
6
- "pluginType": "{{pluginType}}",
7
- "main": "src/index.tsx",
8
- "module": "src/index.tsx",
9
- "exports": {
10
- ".": "./src/index.tsx"
11
- },
12
- "scripts": {
13
- "build": "chatbi-cli build"
14
- },
15
- "devDependencies": {
16
- },
17
- "peerDependencies": {
18
- "@chatbi-v/core": "*",
19
- "react": ">=18.0.0",
20
- "react-dom": ">=18.0.0",
21
- "antd": ">=5.0.0"
22
- }
23
- }
@@ -1,90 +0,0 @@
1
- import React from 'react'
2
- import { Plugin, PluginContext, Slot } from '@chatbi-v/core'
3
- import { MessageOutlined } from '@ant-design/icons'
4
-
5
- /**
6
- * 插件入口类
7
- * 必须实现 Plugin 接口,并导出为 default
8
- *
9
- * 生命周期说明:
10
- * - onLoad: 插件加载时调用,用于初始化状态、注册服务等
11
- * - onUnload: 插件卸载时调用,用于清理资源
12
- */
13
- export class {{className}} implements Plugin {
14
- // 插件唯一标识,必须与 metadata.id 保持一致
15
- id = '{{pluginId}}'
16
-
17
- // 插件元数据定义
18
- metadata = {
19
- id: '{{pluginId}}',
20
- name: '{{pluginId}} Plugin',
21
- version: '1.0.0',
22
- type: '{{pluginType}}' as const, // business | system
23
-
24
- /**
25
- * 路由配置 (可选)
26
- * 如果插件需要注册页面路由,在此处定义
27
- */
28
- routes: [
29
- {
30
- path: '/{{pluginId}}',
31
- // 路由对应的组件
32
- component: () => <div style=\{{ padding: '20px', background: '#f5f5f5', borderRadius: '8px' }}>
33
- <h3>Hello from {{pluginId}} Plugin!</h3>
34
- <p>This is a {{pluginType}} plugin generated by ChatBI CLI.</p>
35
- </div>,
36
- meta: {
37
- title: '{{pluginId}}',
38
- icon: 'MessageOutlined' // 对应 AntD Icon 名称
39
- }
40
- }
41
- ],
42
-
43
- /**
44
- * 扩展插槽配置 (可选)
45
- * 用于将组件注入到系统的各个位置 (如侧边栏、顶部栏等)
46
- */
47
- extensions: [
48
- {
49
- slot: Slot.Sidebar, // 注入到侧边栏
50
- component: () => null, // 侧边栏通常不需要组件实体,只需要 meta 信息
51
- order: 10, // 排序权重,越小越靠前
52
- meta: {
53
- title: '{{pluginId}}',
54
- icon: <MessageOutlined />, // 直接传入 ReactNode
55
- path: '/{{pluginId}}' // 点击跳转的路径
56
- }
57
- }
58
- // 示例:注入到顶部栏
59
- // {
60
- // slot: Slot.TopBar,
61
- // component: () => <MyTopBarComponent />,
62
- // order: 5
63
- // }
64
- ]
65
- }
66
-
67
- /**
68
- * 插件加载回调
69
- * @param context 插件上下文,包含 logger, eventBus, serviceRegistry 等
70
- */
71
- onLoad(context: PluginContext) {
72
- context.logger.info('{{className}} Loaded!')
73
-
74
- // 示例:监听事件
75
- // context.eventBus.on('some-event', () => { ... })
76
-
77
- // 示例:注册服务
78
- // context.serviceRegistry.register('myService', new MyService())
79
- }
80
-
81
- /**
82
- * 插件卸载回调 (可选)
83
- */
84
- onUnload() {
85
- // 清理资源
86
- console.log('{{className}} Unloaded')
87
- }
88
- }
89
-
90
- export default {{className}}
@@ -1,14 +0,0 @@
1
- {
2
- "extends": "{{tsconfigPath}}",
3
- "compilerOptions": {
4
- "baseUrl": ".",
5
- "noEmit": false,
6
- "declaration": true,
7
- "emitDeclarationOnly": true,
8
- "declarationDir": "./dist",
9
- "paths": {
10
- "@/*": ["./src/*"]
11
- }
12
- },
13
- "include": ["src"]
14
- }