neo-cmp-cli 1.6.3 → 1.6.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "neo-cmp-cli",
3
- "version": "1.6.3",
3
+ "version": "1.6.6",
4
4
  "description": "前端脚手架:自定义组件开发工具,支持react 和 vue2.0技术栈。",
5
5
  "keywords": [
6
6
  "neo-cli",
@@ -147,7 +147,11 @@ class NeoService {
147
147
  const { access_token, expires_in } = response.data || {};
148
148
 
149
149
  if (!access_token) {
150
- errorLog('获取 token 失败(授权配置错误):响应中未包含 access_token,' + JSON.stringify(response.data), spinner);
150
+ errorLog(
151
+ '获取 token 失败(授权配置错误):响应中未包含 access_token,' +
152
+ JSON.stringify(response.data),
153
+ spinner
154
+ );
151
155
  process.exit(1);
152
156
  }
153
157
 
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.6.3",
51
+ "neo-cmp-cli": "^1.6.5",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5"
@@ -48,7 +48,7 @@
48
48
  "@commitlint/config-conventional": "^9.1.1",
49
49
  "@types/react": "^16.9.11",
50
50
  "@types/react-dom": "^16.9.15",
51
- "neo-cmp-cli": "^1.6.3",
51
+ "neo-cmp-cli": "^1.6.5",
52
52
  "husky": "^4.2.5",
53
53
  "lint-staged": "^10.2.9",
54
54
  "prettier": "^2.0.5",
@@ -46,7 +46,7 @@
46
46
  "@commitlint/config-conventional": "^9.1.1",
47
47
  "@types/react": "^16.9.11",
48
48
  "@types/react-dom": "^16.9.15",
49
- "neo-cmp-cli": "^1.6.3",
49
+ "neo-cmp-cli": "^1.6.5",
50
50
  "husky": "^4.2.5",
51
51
  "lint-staged": "^10.2.9",
52
52
  "prettier": "^2.0.5"
@@ -52,7 +52,7 @@
52
52
  "@types/react": "^16.9.11",
53
53
  "@types/react-dom": "^16.9.15",
54
54
  "@types/axios": "^0.14.0",
55
- "neo-cmp-cli": "^1.6.3",
55
+ "neo-cmp-cli": "^1.6.5",
56
56
  "husky": "^4.2.5",
57
57
  "lint-staged": "^10.2.9",
58
58
  "prettier": "^2.0.5"
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.6.3",
48
+ "neo-cmp-cli": "^1.6.5",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5"
@@ -47,7 +47,7 @@
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
48
  "@types/react": "^16.9.11",
49
49
  "@types/react-dom": "^16.9.15",
50
- "neo-cmp-cli": "^1.6.3",
50
+ "neo-cmp-cli": "^1.6.5",
51
51
  "husky": "^4.2.5",
52
52
  "lint-staged": "^10.2.9",
53
53
  "prettier": "^2.0.5"
@@ -45,7 +45,7 @@
45
45
  "devDependencies": {
46
46
  "@commitlint/cli": "^8.3.5",
47
47
  "@commitlint/config-conventional": "^9.1.1",
48
- "neo-cmp-cli": "^1.6.3",
48
+ "neo-cmp-cli": "^1.6.5",
49
49
  "husky": "^4.2.5",
50
50
  "lint-staged": "^10.2.9",
51
51
  "prettier": "^2.0.5",
@@ -62,7 +62,7 @@ module.exports = function (projectPath, options = {}) {
62
62
 
63
63
  // 输出 shell 命令让用户执行(这样可以真正改变 shell 的工作目录)
64
64
  if (outputShellCommand) {
65
- const command = `cd ${projectName}`;
65
+ const command = `neo open -n ${projectName}`;
66
66
  // 输出提示信息
67
67
  console.log('\n' + '='.repeat(60));
68
68
  console.log('💡 提示:要切换到项目目录,请执行以下命令:');
@@ -273,9 +273,7 @@ module.exports = async function (cmpZipUrl, cmpName, componentBaseDir = './src/c
273
273
  const newDeps = Object.keys(newPackageJsonDeps);
274
274
  if (newDeps.length > 0) {
275
275
  warningLog(
276
- `检测到 package.json 中新增了 ${
277
- newDeps.length
278
- } 个依赖包:${newDeps.join(', ')}`
276
+ `检测到 package.json 中新增了 ${newDeps.length} 个依赖包:${newDeps.join(', ')}`
279
277
  );
280
278
  warningLog(
281
279
  `为确保组件正常运行,请执行以下命令安装依赖:npm install 或 yarn install`
@@ -51,13 +51,13 @@ function errorLog(message, spinner) {
51
51
  const errorMessage = `${consoleTag} ${chalk.red(message)}`;
52
52
  if (spinner) {
53
53
  spinner.fail(errorMessage);
54
- } else {
54
+ } else {
55
55
  console.error(errorMessage);
56
56
  }
57
57
  }
58
58
 
59
59
  // 输出黄色字体的警告日志
60
- function warningLog(message) {
60
+ function warningLog(message, spinner) {
61
61
  const warningMessage = `${consoleTag} ${chalk.yellow(message)}`;
62
62
  if (spinner) {
63
63
  spinner.warn(warningMessage);
@@ -67,7 +67,7 @@ function warningLog(message) {
67
67
  }
68
68
 
69
69
  // 输出绿色字体的成功日志
70
- function successLog(message) {
70
+ function successLog(message, spinner) {
71
71
  const successMessage = `${consoleTag} ${chalk.green(message)}`;
72
72
  if (spinner) {
73
73
  spinner.succeed(successMessage);
@@ -84,11 +84,11 @@ function successLog(message) {
84
84
  function parseTsConfigWithTypeScript(configPath) {
85
85
  try {
86
86
  const configFile = ts.readConfigFile(configPath, ts.sys.readFile);
87
-
87
+
88
88
  if (configFile.error) {
89
89
  throw new Error(`解析 tsconfig.json 失败: ${configFile.error.messageText}`);
90
90
  }
91
-
91
+
92
92
  return configFile.config;
93
93
  } catch (error) {
94
94
  if (error.code === 'MODULE_NOT_FOUND') {
@@ -1,7 +1,7 @@
1
1
  const { execSync } = require('child_process');
2
2
 
3
3
  // 所有需要废弃的版本(1.6.2 之前的所有版本)
4
- const versionsToDeprecate = ["1.6.2-beta.5"];
4
+ const versionsToDeprecate = ["1.6.3"];
5
5
 
6
6
  const packageName = 'neo-cmp-cli';
7
7
  const deprecateMessage = '此版本为开发中版本(存在 bug),请升级到最新版本。';