neo-cmp-cli 1.7.9 → 1.7.10

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.7.9",
3
+ "version": "1.7.10",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -62,19 +62,21 @@ module.exports = function (projectPath, options = {}) {
62
62
 
63
63
  // 输出 shell 命令让用户执行(这样可以真正改变 shell 的工作目录)
64
64
  if (outputShellCommand) {
65
- const command = `neo open -n ${projectName}`;
66
65
  // 输出提示信息
67
66
  console.log('\n' + '='.repeat(60));
68
- console.log('💡 提示:要切换到项目目录,请执行以下命令:');
69
- console.log(`\n ${command}\n`);
67
+ console.log('💡 提示:要切换到新建项目目录,请执行以下命令:');
68
+ console.log(`\n cd ${projectName} \n`);
69
+ console.log(`\n neo open -n ${projectName} \n`);
70
70
  console.log('='.repeat(60));
71
- console.log('\n📝 说明:组件开发工具(neo-cmp-cli)无法直接改变当前命令窗口工作目录,');
72
- console.log(` 您需要手动执行上述命令才能进入刚创建的自定义组件项目(${projectName})。\n`);
71
+ console.log('\n📝 说明1:组件开发工具(neo-cmp-cli)无法直接改变当前命令窗口工作目录,');
72
+ console.log(` 您需要手动执行上述命令才能进入刚创建的自定义组件项目(${projectName})。`);
73
+ console.log(`\n📝 说明2:组件开发工具(neo-cmp-cli)默认自动打开编辑器(neo open -n ${projectName})。\n`);
73
74
 
74
75
  // 自动打开 IDE编辑器(异步执行,不需要等待)
75
- openProject('auto', projectName).catch((error) => {
76
+ openProject('auto', projectPath).catch((error) => {
76
77
  // 错误已在 openProject 内部处理,这里只是防止未处理的 Promise 警告
77
- console.error(`打开编辑器时出错: ${error.message}`);
78
+ console.error(`自动打开编辑器出错(neo open -n ${projectName}): ${error.message}`);
79
+ console.error(`请手动执行命令 neo open -n ${projectName} 打开编辑器。`);
78
80
  });
79
81
  }
80
82
 
@@ -10,7 +10,7 @@ const { errorLog } = require('../common');
10
10
  */
11
11
  module.exports = async function (editorType, targetPath) {
12
12
  const targetDir = targetPath ? path.resolve(targetPath) : process.cwd();
13
-
13
+
14
14
  // 检查目录是否存在
15
15
  if (!fs.existsSync(targetDir)) {
16
16
  errorLog(`目录不存在: ${targetDir}`);
@@ -37,20 +37,14 @@ module.exports = async function (editorType, targetPath) {
37
37
  editorName = 'Cursor';
38
38
  // macOS 可以使用应用名称或命令名称
39
39
  if (isMac) {
40
- editorConfigs = [
41
- { app: { name: 'cursor' } },
42
- { app: { name: 'Cursor' } }
43
- ];
40
+ editorConfigs = [{ app: { name: 'cursor' } }, { app: { name: 'Cursor' } }];
44
41
  } else if (isWindows || isLinux) {
45
42
  editorConfigs = [{ app: { name: 'cursor' } }];
46
43
  }
47
44
  } else if (editorType === 'vscode' || editorType === 'code') {
48
45
  editorName = 'Visual Studio Code';
49
46
  if (isMac) {
50
- editorConfigs = [
51
- { app: { name: 'code' } },
52
- { app: { name: 'Visual Studio Code' } }
53
- ];
47
+ editorConfigs = [{ app: { name: 'code' } }, { app: { name: 'Visual Studio Code' } }];
54
48
  } else if (isWindows || isLinux) {
55
49
  editorConfigs = [{ app: { name: 'code' } }];
56
50
  }
@@ -64,10 +58,7 @@ module.exports = async function (editorType, targetPath) {
64
58
  { app: { name: 'Visual Studio Code' } }
65
59
  ];
66
60
  } else if (isWindows || isLinux) {
67
- editorConfigs = [
68
- { app: { name: 'cursor' } },
69
- { app: { name: 'code' } }
70
- ];
61
+ editorConfigs = [{ app: { name: 'cursor' } }, { app: { name: 'code' } }];
71
62
  }
72
63
  }
73
64
 
@@ -1,7 +1,7 @@
1
1
  const { execSync } = require('child_process');
2
2
 
3
3
  // 所有需要废弃的版本(1.6.2 之前的所有版本)
4
- const versionsToDeprecate = ["1.7.5", "1.7.5-beta.1", "1.7.5-beta.2", "1.7.6", "1.7.7", "1.7.8"];
4
+ const versionsToDeprecate = ["1.7.5", "1.7.5-beta.1", "1.7.5-beta.2", "1.7.6", "1.7.7", "1.7.8", "1.7.9"];
5
5
 
6
6
  const packageName = 'neo-cmp-cli';
7
7
  const deprecateMessage = '此版本为开发中版本(存在 bug),请升级到最新版本。';