wyt-cli 1.0.17 → 1.0.18

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.
@@ -42,7 +42,7 @@ export default function () {
42
42
  message: '请选择要运行的项目:' + getInquirerOperationText('checkbox'),
43
43
  when: (answers) => answers.runstyle == 1,
44
44
  choices: projects.map((p) => ({
45
- checked: p.name === 'core' || p.name === 'mw',
45
+ checked: p.name === 'core',
46
46
  name: `${p.name} (端口号: ${p.port || '未配置'})`,
47
47
  value: p,
48
48
  })),
@@ -72,12 +72,19 @@ async function runProject(projects = [], appsDir) {
72
72
 
73
73
  // 运行命令
74
74
  const command = 'npm run dev';
75
+ const commandEnv = {
76
+ ...process.env,
77
+ NODE_ENV: 'development',
78
+ PROJECT_RUN_MODE: 'wyt-cli',
79
+ };
80
+
75
81
  // 运行项目文档
76
82
  log_info(`🚀 启动项目文档...`);
77
83
  const docsPath = path.join(process.cwd(), 'docs');
78
84
  const docsProcess = execa(command, {
79
85
  cwd: docsPath,
80
86
  stdio: 'inherit',
87
+ env: commandEnv,
81
88
  });
82
89
  docsProcess.on('exit', (code) => {
83
90
  if (code !== 0) log_error(`项目文档异常退出 (CODE: ${code})`);
@@ -114,9 +121,14 @@ async function runProject(projects = [], appsDir) {
114
121
  const subprocess = execa(command, {
115
122
  cwd: projectPath,
116
123
  stdio: 'inherit',
117
- env: {
118
- NODE_ENV: 'development',
119
- },
124
+ env: commandEnv,
125
+ });
126
+
127
+ // 新增信号处理逻辑
128
+ process.on('SIGINT', () => {
129
+ log_info('正在优雅关闭进程...');
130
+ subprocess.kill('SIGINT'); // 杀死子进程
131
+ process.exit(0); // 退出父进程
120
132
  });
121
133
  subprocess.on('exit', (code) => {
122
134
  if (code !== 0) log_error(`项目 ${projectName} 异常退出 (CODE: ${code})`);
@@ -13,19 +13,19 @@
13
13
  "preview": "vite preview"
14
14
  },
15
15
  "dependencies": {
16
- "@element-plus/icons-vue": "^2.3.1",
16
+ "@element-plus/icons-vue": "catalog:",
17
17
  "@wyt/components": "workspace:^",
18
18
  "@wyt/utils": "workspace:^",
19
- "element-plus": "^2.10.2",
20
- "pinia": "^2.0.28",
21
- "sass": "^1.89.2",
22
- "vue": "^3.5.13",
23
- "vue-router": "^4.5.0",
24
- "wujie-polyfill": "^1.1.3",
25
- "wujie-vue3": "^1.0.24"
19
+ "element-plus": "catalog:",
20
+ "pinia": "catalog:",
21
+ "sass": "catalog:",
22
+ "vue": "catalog:",
23
+ "vue-router": "catalog:",
24
+ "wujie-polyfill": "catalog:",
25
+ "wujie-vue3": "catalog:"
26
26
  },
27
27
  "devDependencies": {
28
- "@vitejs/plugin-vue": "^5.2.1",
29
- "vite": "^6.0.5"
28
+ "@vitejs/plugin-vue": "catalog:",
29
+ "vite": "catalog:"
30
30
  }
31
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wyt-cli",
3
- "version": "1.0.17",
3
+ "version": "1.0.18",
4
4
  "description": "HRP3.0 项目命令行工具",
5
5
  "main": "index.js",
6
6
  "bin": {