@chatbi-v/cli 1.0.7 → 1.0.8

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 (26) hide show
  1. package/dist/default/apps/main/src/App.tsx.hbs +46 -30
  2. package/dist/default/package.json.hbs +1 -0
  3. package/dist/default/plugins/demo-plugin/package.json.hbs +2 -1
  4. package/dist/default/plugins/demo-plugin/src/index.tsx.hbs +13 -13
  5. package/dist/index.js +926 -471
  6. package/package.json +11 -4
  7. package/templates/default/.gitignore.hbs +0 -3
  8. package/templates/default/README.md.hbs +0 -30
  9. package/templates/default/apps/main/index.html.hbs +0 -13
  10. package/templates/default/apps/main/package.json.hbs +0 -20
  11. package/templates/default/apps/main/postcss.config.cjs.hbs +0 -6
  12. package/templates/default/apps/main/src/App.tsx.hbs +0 -162
  13. package/templates/default/apps/main/src/components/NavIcon.tsx.hbs +0 -41
  14. package/templates/default/apps/main/src/hooks/usePluginLoader.ts.hbs +0 -25
  15. package/templates/default/apps/main/src/index.css.hbs +0 -8
  16. package/templates/default/apps/main/src/main.tsx.hbs +0 -13
  17. package/templates/default/apps/main/src/pages/Guide.tsx.hbs +0 -133
  18. package/templates/default/apps/main/tailwind.config.cjs.hbs +0 -17
  19. package/templates/default/apps/main/tsconfig.json.hbs +0 -10
  20. package/templates/default/apps/main/vite.config.ts.hbs +0 -16
  21. package/templates/default/package.json.hbs +0 -33
  22. package/templates/default/plugins/demo-plugin/package.json.hbs +0 -17
  23. package/templates/default/plugins/demo-plugin/src/index.tsx.hbs +0 -44
  24. package/templates/default/plugins/demo-plugin/tsconfig.json.hbs +0 -10
  25. package/templates/default/pnpm-workspace.yaml.hbs +0 -3
  26. package/templates/default/tsconfig.json.hbs +0 -24
@@ -42,15 +42,23 @@ const App: React.FC = () => {
42
42
  }
43
43
 
44
44
  return (
45
- <div className="flex h-screen flex-col overflow-hidden bg-gray-50 font-sans">
45
+ <div className={`flex h-screen flex-col overflow-hidden font-sans ${
46
+ {{#if isNebula}}'bg-purple-50'{{else if isGlass}}'bg-slate-100'{{else}}'bg-gray-50'{{/if}}
47
+ }`}>
46
48
  {/* Header */}
47
- <header className="flex h-16 items-center justify-between bg-slate-900 px-6 text-white shadow-md z-10">
49
+ <header className={`flex h-16 items-center justify-between px-6 text-white shadow-md z-10 ${
50
+ {{#if isNebula}}'bg-gradient-to-r from-indigo-900 to-purple-900'{{else if isGlass}}'bg-white/70 backdrop-blur-md text-slate-900 border-b border-white/20'{{else}}'bg-slate-900'{{/if}}
51
+ }`}>
48
52
  <div className="flex items-center gap-4">
49
53
  <div className="flex items-center gap-2 group cursor-pointer" onClick={() => navigate('/')}>
50
- <div className="w-8 h-8 rounded-lg bg-indigo-500 flex items-center justify-center shadow-lg shadow-indigo-500/20 group-hover:scale-105 transition-transform">
54
+ <div className={`w-8 h-8 rounded-lg flex items-center justify-center shadow-lg transition-transform group-hover:scale-105 ${
55
+ {{#if isNebula}}'bg-purple-500 shadow-purple-500/20'{{else if isGlass}}'bg-blue-500 shadow-blue-500/20'{{else}}'bg-indigo-500 shadow-indigo-500/20'{{/if}}
56
+ }`}>
51
57
  <ThunderboltOutlined className="text-lg text-white" />
52
58
  </div>
53
- <h2 className="m-0 text-lg font-bold tracking-tight text-white uppercase">
59
+ <h2 className={`m-0 text-lg font-bold tracking-tight uppercase ${
60
+ {{#if isGlass}}'text-slate-800'{{else}}'text-white'{{/if}}
61
+ }`}>
54
62
  {{name}}
55
63
  </h2>
56
64
  </div>
@@ -58,7 +66,9 @@ const App: React.FC = () => {
58
66
  <Link
59
67
  to="/guide"
60
68
  className={`flex items-center gap-1.5 px-3 py-1 rounded transition-colors ${
61
- location.pathname === '/guide' ? 'bg-indigo-500/20 text-indigo-300' : 'text-gray-400 hover:text-white'
69
+ location.pathname === '/guide'
70
+ ? ({{#if isGlass}}'bg-blue-500/10 text-blue-600'{{else}}'bg-indigo-500/20 text-indigo-300'{{/if}})
71
+ : ({{#if isGlass}}'text-slate-500 hover:text-slate-800'{{else}}'text-gray-400 hover:text-white'{{/if}})
62
72
  }`}
63
73
  >
64
74
  <QuestionCircleOutlined />
@@ -74,11 +84,15 @@ const App: React.FC = () => {
74
84
  <div className="flex flex-1 overflow-hidden">
75
85
  {/* Sidebar */}
76
86
  <aside
77
- className={`flex flex-col border-r border-gray-200 bg-white shadow-sm transition-all duration-300 ease-in-out ${
87
+ className={`flex flex-col border-r transition-all duration-300 ease-in-out ${
78
88
  collapsed ? 'w-16' : 'w-64'
89
+ } ${
90
+ {{#if isGlass}}'bg-white/40 backdrop-blur-lg border-white/20 shadow-xl shadow-slate-200/50'{{else if isNebula}}'bg-white border-purple-100 shadow-sm'{{else}}'bg-white border-gray-200 shadow-sm'{{/if}}
79
91
  }`}
80
92
  >
81
- <div className={`p-4 border-b border-gray-50 bg-gray-50/50 text-xs font-semibold text-gray-400 uppercase tracking-wider overflow-hidden whitespace-nowrap ${collapsed ? 'text-center px-0' : ''}`}>
93
+ <div className={`p-4 border-b text-xs font-semibold uppercase tracking-wider overflow-hidden whitespace-nowrap ${collapsed ? 'text-center px-0' : ''} ${
94
+ {{#if isNebula}}'bg-purple-50/50 text-purple-400 border-purple-50'{{else if isGlass}}'bg-blue-50/30 text-blue-500 border-white/20'{{else}}'bg-gray-50/50 text-gray-400 border-gray-50'{{/if}}
95
+ }`}>
82
96
  {collapsed ? '···' : '插件菜单'}
83
97
  </div>
84
98
  <div className="flex-1 overflow-y-auto no-scrollbar py-4 px-2">
@@ -119,29 +133,31 @@ const App: React.FC = () => {
119
133
  </aside>
120
134
 
121
135
  {/* Main Content */}
122
- <main className="relative flex-1 overflow-y-auto bg-gray-50 p-6 scroll-smooth">
123
- <Routes>
124
- <Route path="/guide" element={<GuidePage />} />
125
- {routes.map(route => (
126
- <Route
127
- key={route.path}
128
- path={route.path}
129
- element={<route.component />}
130
- />
131
- ))}
132
- <Route path="/" element={<Navigate to={defaultRoute} replace />} />
133
- <Route path="*" element={
134
- <div className="mt-24 text-center">
135
- <h3 className="text-2xl font-bold text-gray-800">404 Not Found</h3>
136
- <p className="mt-2 text-gray-500">请求的页面不存在或插件未加载。</p>
137
- <Link to="/guide" className="mt-6 inline-block text-indigo-500 hover:text-indigo-600">
138
- 返回开发指南
139
- </Link>
140
- </div>
141
- } />
142
- </Routes>
143
- <div className="mt-8">
144
- <PluginSlot slot={Slot.Custom} />
136
+ <main className="flex-1 relative overflow-hidden flex flex-col">
137
+ <div className={`absolute top-0 left-0 right-0 h-1 z-20 ${
138
+ {{#if isNebula}}'bg-purple-500/20'{{else if isGlass}}'bg-blue-500/20'{{else}}'bg-indigo-500/10'{{/if}}
139
+ }`} />
140
+
141
+ <div className="flex-1 overflow-y-auto p-6 scroll-smooth bg-transparent">
142
+ <div className={`mx-auto max-w-7xl h-full ${
143
+ {{#if isGlass}}'bg-white/60 backdrop-blur-md rounded-2xl border border-white/40 shadow-xl p-8'{{else}}''{{/if}}
144
+ }`}>
145
+ <Routes>
146
+ <Route path="/guide" element={<GuidePage />} />
147
+ {routes.map(route => (
148
+ <Route key={route.path} path={route.path} element={<route.component />} />
149
+ ))}
150
+ <Route path="/" element={<Navigate to={defaultRoute} replace />} />
151
+ </Routes>
152
+ </div>
153
+ </div>
154
+
155
+ {/* Footer Slot */}
156
+ <div className={`mt-auto px-6 py-3 border-t text-xs text-gray-400 flex justify-between items-center ${
157
+ {{#if isGlass}}'bg-white/30 border-white/20'{{else if isNebula}}'bg-purple-50/30 border-purple-50'{{else}}'bg-white border-gray-100'{{/if}}
158
+ }`}>
159
+ <div>ChatBI-V Plugin Container v1.0.0</div>
160
+ <PluginSlot slot={Slot.Footer} />
145
161
  </div>
146
162
  </main>
147
163
  </div>
@@ -2,6 +2,7 @@
2
2
  "name": "{{name}}",
3
3
  "private": true,
4
4
  "version": "1.0.0",
5
+ "description": "ChatBI-V {{#if isBusiness}}Business{{else}}System{{/if}} Plugin Project",
5
6
  "type": "module",
6
7
  "scripts": {
7
8
  "dev": "pnpm --filter @chatbi-v/main dev",
@@ -1,8 +1,9 @@
1
1
  {
2
- "name": "@chatbi-v/plugin-demo-plugin",
2
+ "name": "{{name}}",
3
3
  "version": "1.0.0",
4
4
  "type": "module",
5
5
  "plugin": true,
6
+ "pluginType": "{{pluginType}}",
6
7
  "main": "src/index.tsx",
7
8
  "module": "src/index.tsx",
8
9
  "exports": {
@@ -2,22 +2,22 @@ import React from 'react'
2
2
  import { Plugin, PluginContext, Slot } from '@chatbi-v/core'
3
3
  import { MessageOutlined } from '@ant-design/icons'
4
4
 
5
- export class DemoPlugin implements Plugin {
6
- id = 'demo-plugin'
5
+ export class {{className}} implements Plugin {
6
+ id = '{{pluginId}}'
7
7
  metadata = {
8
- id: 'demo-plugin',
9
- name: 'Demo Business Plugin',
8
+ id: '{{pluginId}}',
9
+ name: '{{pluginId}} Plugin',
10
10
  version: '1.0.0',
11
- type: 'business' as const,
11
+ type: '{{pluginType}}' as const,
12
12
  routes: [
13
13
  {
14
- path: '/demo',
14
+ path: '/{{pluginId}}',
15
15
  component: () => <div style=\{{ padding: '20px', background: '#f5f5f5', borderRadius: '8px' }}>
16
- <h3>Hello from Demo Plugin!</h3>
17
- <p>This is a business plugin generated by ChatBI CLI.</p>
16
+ <h3>Hello from {{pluginId}} Plugin!</h3>
17
+ <p>This is a {{pluginType}} plugin generated by ChatBI CLI.</p>
18
18
  </div>,
19
19
  meta: {
20
- title: '演示',
20
+ title: '{{pluginId}}',
21
21
  icon: 'MessageOutlined'
22
22
  }
23
23
  }
@@ -28,17 +28,17 @@ export class DemoPlugin implements Plugin {
28
28
  component: () => null,
29
29
  order: 10,
30
30
  meta: {
31
- title: '演示',
31
+ title: '{{pluginId}}',
32
32
  icon: <MessageOutlined />,
33
- path: '/demo'
33
+ path: '/{{pluginId}}'
34
34
  }
35
35
  }
36
36
  ]
37
37
  }
38
38
 
39
39
  onLoad(context: PluginContext) {
40
- context.logger.info('Demo Plugin Loaded!')
40
+ context.logger.info('{{className}} Loaded!')
41
41
  }
42
42
  }
43
43
 
44
- export default DemoPlugin
44
+ export default {{className}}