@42ailab/42plugin 0.1.2 → 0.1.6

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/cli.ts +8 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@42ailab/42plugin",
3
- "version": "0.1.2",
3
+ "version": "0.1.6",
4
4
  "description": "活水插件",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
package/src/cli.ts CHANGED
@@ -15,12 +15,18 @@ import {
15
15
  checkCommand,
16
16
  } from './commands';
17
17
 
18
+ // 动态读取版本号
19
+ const packageJson = await Bun.file(
20
+ new URL('../package.json', import.meta.url)
21
+ ).json();
22
+ const version: string = packageJson.version;
23
+
18
24
  const program = new Command();
19
25
 
20
26
  program
21
27
  .name('42plugin')
22
28
  .description('活水插件 - AI 插件管理工具')
23
- .version('0.1.0');
29
+ .version(version);
24
30
 
25
31
  // 注册命令
26
32
  program.addCommand(authCommand);
@@ -38,7 +44,7 @@ program
38
44
  .command('version')
39
45
  .description('显示版本信息')
40
46
  .action(() => {
41
- console.log('42plugin v0.1.0');
47
+ console.log(`42plugin v${version}`);
42
48
  });
43
49
 
44
50
  export { program };