cloudcc-cli 1.2.2 → 1.2.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.
package/README.md CHANGED
@@ -1,3 +1,10 @@
1
+ # ReleaseV1.2.3
2
+ #### 发布日期:2022-11-16
3
+ #### 发布范围:全量
4
+ #### 发布内容
5
+ * 优化
6
+ * 发布脚本添加错误详细信息输出
7
+
1
8
  # ReleaseV1.2.2
2
9
  #### 发布日期:2022-11-12
3
10
  #### 发布范围:全量
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "1.2.2",
3
+ "version": "1.2.3",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -1,4 +1,4 @@
1
- const { execSync } = require('child_process');
1
+ const { exec, execSync, spawn, spawnSync } = require('child_process');
2
2
  const { post } = require('../utils/http');
3
3
  const fs = require('fs');
4
4
  const path = require("path")
@@ -35,14 +35,12 @@ class Builder {
35
35
  let item = dirs[i]
36
36
  let obj = this.getVueValue(item);
37
37
  this.initPluginFile(item, obj.compName);
38
- this.build(obj);
39
- await this.upload(obj, config)
38
+ this.build(obj, config)
40
39
  }
41
40
  } else {
42
41
  let obj = this.getVueValue(answers.buildFileName);
43
42
  this.initPluginFile(answers.buildFileName, obj.compName);
44
- this.build(obj);
45
- await this.upload(obj, config)
43
+ this.build(obj, config)
46
44
  }
47
45
  }
48
46
  }
@@ -127,15 +125,20 @@ class Builder {
127
125
  * 编译文件,将vue编译为js文件
128
126
  * @param {编译对象信息} obj
129
127
  */
130
- build(obj) {
128
+ build(obj, config) {
131
129
  console.log(chalk.green('编译中,请稍后...'));
132
- let { stdout, stderr, error } = execSync('npx vue-cli-service build --target lib --name ' + obj.compName + ' --dest build plugin/plugin.js');
133
- if (null == error) {
134
- console.log(chalk.green('编译成功!'));
135
- } else {
136
- console.log(chalk.red('编译失败:', error));
137
- }
138
- fs.unlinkSync('plugin/plugin.js');
130
+ exec('npx vue-cli-service build --target lib --name ' + obj.compName + ' --dest build plugin/plugin.js', async (error, stdout, stderr) => {
131
+ if (error) {
132
+ console.log('编译失败:', error);
133
+ console.log(chalk.red('编译失败:' + stdout));
134
+ return;
135
+ } else {
136
+ console.log(chalk.green('编译成功!'));
137
+ console.log();
138
+ await this.upload(obj, config)
139
+ fs.unlinkSync('plugin/plugin.js');
140
+ }
141
+ })
139
142
  }
140
143
  /**
141
144
  * 将文件上传
@@ -30,7 +30,7 @@ function checkNpmVersion() {
30
30
  console.log(chalk.green("当前版本:v" + config.version));
31
31
  console.log(chalk.green("最新版本:v" + onlineVersion));
32
32
  console.log();
33
- console.log(chalk.yellow(`如无法自动更新,请使用命令更新:npm install -g cloudcc-cli@${onlineVersion} --registry https://registry.npmjs.org`));
33
+ console.log(chalk.yellow(`如无法自动更新,请使用命令更新:npm install -g cloudcc-cli@${onlineVersion} --registry http://registry.npmmirror.com`));
34
34
  return onlineVersion;
35
35
  }
36
36
  return null;
package/cookies.html DELETED
@@ -1 +0,0 @@
1
- 1.2.1