@chatbi-v/cli 2.0.6 → 2.1.0

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.
package/dist/index.js CHANGED
@@ -271,7 +271,14 @@ var init_SandboxRenderer = __esm({
271
271
  "className",
272
272
  "dependencies",
273
273
  "devDependencies",
274
- "json"
274
+ "json",
275
+ "if",
276
+ "else",
277
+ "unless",
278
+ "each",
279
+ "with",
280
+ "log",
281
+ "lookup"
275
282
  ];
276
283
  }
277
284
  /**
@@ -2523,7 +2530,7 @@ async function clean(options) {
2523
2530
  // package.json
2524
2531
  var package_default = {
2525
2532
  name: "@chatbi-v/cli",
2526
- version: "2.0.6",
2533
+ version: "2.1.0",
2527
2534
  description: "Standardized CLI tooling for ChatBI Monorepo",
2528
2535
  type: "module",
2529
2536
  main: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chatbi-v/cli",
3
- "version": "2.0.6",
3
+ "version": "2.1.0",
4
4
  "description": "Standardized CLI tooling for ChatBI Monorepo",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -17,11 +17,6 @@
17
17
  "publishConfig": {
18
18
  "access": "public"
19
19
  },
20
- "scripts": {
21
- "build": "tsup",
22
- "dev": "tsup --watch",
23
- "test": "vitest"
24
- },
25
20
  "dependencies": {
26
21
  "boxen": "^8.0.1",
27
22
  "cac": "^6.7.14",
@@ -49,5 +44,10 @@
49
44
  "@vitest/coverage-v8": "1.6.1",
50
45
  "tsup": "^8.5.1",
51
46
  "vitest": "^1.0.0"
47
+ },
48
+ "scripts": {
49
+ "build": "tsup",
50
+ "dev": "tsup --watch",
51
+ "test": "vitest"
52
52
  }
53
- }
53
+ }
@@ -12,9 +12,9 @@
12
12
  "dependencies": {
13
13
  "@ant-design/icons": "^5.2.6",
14
14
  "@ant-design/x": "^2.1.1",
15
- "@chatbi-v/core": "^2.0.5",
16
- "@chatbi-v/mocks": "^2.0.5",
17
- "@chatbi-v/cli": "^2.0.5",
15
+ "@chatbi-v/core": "^2.1.0",
16
+ "@chatbi-v/mocks": "^2.1.0",
17
+ "@chatbi-v/cli": "^2.1.0",
18
18
  "@chatbi-v/plugin-theme-manager": "2.0.4",
19
19
  "@chatbi-v/plugin-layout-transform": "2.0.4",
20
20
  "@chatbi-v/plugin-system-monitor": "2.0.4",
@@ -25,7 +25,7 @@
25
25
  "zustand": "^5.0.9"
26
26
  },
27
27
  "devDependencies": {
28
- "@chatbi-v/tsconfig":"^2.0.2",
28
+ "@chatbi-v/tsconfig":"^2.1.0",
29
29
  "@types/node": "^25.0.3",
30
30
  "@types/react": "^18.2.43",
31
31
  "@types/react-dom": "^18.2.17",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "devDependencies": {
26
26
  "typescript": "^5.0.0",
27
- "@chatbi-v/cli": "^2.0.2",
27
+ "@chatbi-v/cli": "^2.1.0",
28
28
  "@ant-design/icons": "^5.6.1",
29
29
  "@types/react": "^18.3.1",
30
30
  "@types/react-dom": "^18.3.1",
@@ -21,14 +21,14 @@
21
21
  },
22
22
  "plugin": true,
23
23
  "peerDependencies": {
24
- "@chatbi-v/core": "^2.0.5",
24
+ "@chatbi-v/core": "^2.1.0",
25
25
  "antd": "^5.20.0",
26
26
  "react": ">=18.0.0",
27
27
  "react-dom": ">=18.0.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@chatbi-v/core": "^2.0.5",
31
- "@chatbi-v/tsconfig": "^2.0.5",
30
+ "@chatbi-v/core": "^2.1.0",
31
+ "@chatbi-v/tsconfig": "^2.1.0",
32
32
  "tsup": "^8.5.1",
33
33
  "vite": "^5.0.0"
34
34
  }
@@ -42,7 +42,14 @@ export const {{pluginClassName}} = definePlugin({
42
42
  }
43
43
  ],
44
44
  configuration: [
45
- // 在此定义插件配置项
45
+ // 示例:定义一个可配置项
46
+ // {
47
+ // key: 'apiKey',
48
+ // type: 'string',
49
+ // label: 'API Key',
50
+ // default: '',
51
+ // description: '用于访问外部服务的密钥'
52
+ // }
46
53
  ],
47
54
  storage: [
48
55
  // 在此定义插件持久化状态
@@ -51,6 +58,25 @@ export const {{pluginClassName}} = definePlugin({
51
58
 
52
59
  async onLoad(context: PluginContext) {
53
60
  logger.info('{{pluginDisplayName}} loaded');
61
+
62
+ // [示例] 服务注册 (Service Registry)
63
+ // 推荐模式:通过服务暴露配置或能力,供其他插件消费
64
+ // context.registerService(`${pkg.name}.service`, {
65
+ // getPublicConfig: () => ({
66
+ // // 仅暴露允许公开的配置
67
+ // someConfig: context.storage.get('someConfig')
68
+ // }),
69
+ // doSomething: () => {
70
+ // logger.info('Doing something...');
71
+ // }
72
+ // });
73
+
74
+ // [示例] 服务消费 (Service Consumption)
75
+ // 注意:需要在 metadata.dependencies 中声明依赖的插件 ID
76
+ // const otherService = context.getService('com.example.other-plugin.service');
77
+ // if (otherService) {
78
+ // otherService.doSomething();
79
+ // }
54
80
  }
55
81
  });
56
82