intools-cli 1.0.0 → 1.0.3

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.
@@ -98,7 +98,31 @@ async function startViteDevServer(cwd) {
98
98
  console.log(chalk_1.default.yellow('跳过 UI 开发服务器: 未找到 vite.config.ts'));
99
99
  return;
100
100
  }
101
+ // 每次启动开发模式都构建 UI
102
+ // 这样应用可以加载最新的插件 UI
103
+ console.log(chalk_1.default.blue('构建 UI...'));
104
+ await new Promise((resolve, reject) => {
105
+ const viteBuild = (0, child_process_1.spawn)('npx', ['vite', 'build'], {
106
+ cwd,
107
+ stdio: 'inherit',
108
+ shell: true
109
+ });
110
+ viteBuild.on('close', (code) => {
111
+ if (code === 0) {
112
+ console.log(chalk_1.default.green('✓ UI 构建完成: ui/'));
113
+ resolve();
114
+ }
115
+ else {
116
+ reject(new Error(`Vite 构建失败,退出码: ${code}`));
117
+ }
118
+ });
119
+ viteBuild.on('error', reject);
120
+ });
121
+ console.log();
101
122
  console.log(chalk_1.default.blue('启动 Vite 开发服务器...'));
123
+ console.log(chalk_1.default.gray(' 💡 提示: Vite 开发服务器提供 UI 预览,修改 UI 代码后'));
124
+ console.log(chalk_1.default.gray(' 在 InTools 中点击「刷新插件」或执行 npm run build 更新'));
125
+ console.log();
102
126
  viteProcess = (0, child_process_1.spawn)('npx', ['vite', '--host'], {
103
127
  cwd,
104
128
  stdio: 'inherit',
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "intools-cli",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "description": "InTools 插件开发 CLI 工具",
5
5
  "main": "dist/index.js",
6
6
  "files": [
7
7
  "dist",
8
- "assets"
8
+ "assets",
9
+ "PLUGIN_API.md"
9
10
  ],
10
11
  "bin": {
11
- "intools": "./dist/index.js"
12
+ "intools": "dist/index.js"
12
13
  },
13
14
  "scripts": {
14
15
  "build": "tsc",