cloudcc-cli 0.9.2 → 0.9.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/README.md CHANGED
@@ -1,3 +1,31 @@
1
+ # ReleaseV0.9.6
2
+ #### 发布日期:2022-2-14
3
+ #### 发布范围:全量
4
+ #### 发布内容
5
+ * 优化
6
+ * 还原builderPlugin
7
+
8
+ # ReleaseV0.9.5
9
+ #### 发布日期:2022-2-10
10
+ #### 发布范围:全量
11
+ #### 发布内容
12
+ * 优化
13
+ * 飞书通知增加分支标识
14
+
15
+ # ReleaseV0.9.4
16
+ #### 发布日期:2021-12-10
17
+ #### 发布范围:全量
18
+ #### 发布内容
19
+ * 优化
20
+ * 自动更新版本指定版本号
21
+
22
+ # ReleaseV0.9.3
23
+ #### 发布日期:2021-12-10
24
+ #### 发布范围:全量
25
+ #### 发布内容
26
+ * 优化
27
+ * 更新cc-sdk上传地址
28
+
1
29
  # ReleaseV0.9.2
2
30
  #### 发布日期:2021-11-30
3
31
  #### 发布范围:全量
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "0.9.2",
3
+ "version": "0.9.6",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -87,28 +87,20 @@ class Builder {
87
87
  */
88
88
  getVueValue(buildFileName) {
89
89
  let vueContent = fs.readFileSync(this.getVueContent(buildFileName), 'utf8');
90
-
91
90
  let vueData = vueContent + ""
92
-
93
91
  // 去除空格
94
92
  // vueData = vueData.replace(/\ +/g, "")
95
93
  // 去除换行
96
94
  // vueData =vueData.replace(/[\r\n]/g, "");
97
-
98
95
  vueData = vueData.split("data()")[1].split("isLock:")[0] + "isLock:false,};}";
99
-
100
96
  vueData = "function data()" + vueData;
101
-
102
97
  const data = eval(`(${vueData})`)()
103
-
104
98
  let compName = data.componentInfo.component // 组件名字
105
-
106
99
  vueData = JSON.stringify(data);
107
-
108
100
  let bizType = data.componentInfo.bizType // 组件类型
109
101
  let compDesc = data.componentInfo.compDesc // 组件描述
110
102
  let category = data.componentInfo.category // 组件状态
111
-
103
+ console.log("vueData", vueData);
112
104
  return { compName, vueContent, vueData, bizType, compDesc, category }
113
105
  };
114
106
  /**
package/src/builderSDK.js CHANGED
@@ -44,10 +44,10 @@ class Builder {
44
44
  message: '请选择发布版本:',
45
45
  name: 'types',
46
46
  choices: [
47
- { name: "测试环境-Dev", value: "dev" },
48
- { name: "uat环境-Beta", value: "beta" },
49
- { name: "公司环境-GA", value: "ga" },
50
47
  { name: "客户环境-Release", value: "release" },
48
+ { name: "公司环境-GA", value: "ga" },
49
+ { name: "uat环境-Beta", value: "beta" },
50
+ { name: "测试环境-Dev", value: "dev" },
51
51
  ],
52
52
  }, {
53
53
  type: "input",
@@ -125,7 +125,7 @@ class Builder {
125
125
  {
126
126
  "fileName": obj.type + "/" + obj.sdkName + ".umd.min.js",
127
127
  "fileContent": jsContent,
128
- "bucketName": "cc-sdk",
128
+ "bucketName": "cloudcc-sdk",
129
129
  }
130
130
  )
131
131
  let res = await post(this.options.devConsoleConfig.baseUrl + "/devconsole/cdn/uploadFile",
@@ -137,11 +137,10 @@ class Builder {
137
137
  console.error(chalk.red(`发布失败: ${res.returnInfo}`));
138
138
  console.log();
139
139
  }
140
+
140
141
  return res;
141
142
  }
142
143
 
143
-
144
-
145
144
  /**
146
145
  * 过滤出min.js文件
147
146
  * @returns 过滤结果
@@ -18,9 +18,11 @@ function checkNpmVersion() {
18
18
  console.log();
19
19
  console.log(chalk.green("当前版本:v" + config.version));
20
20
  console.log(chalk.green("最新版本:v" + onlineVersion));
21
- return true;
21
+ console.log();
22
+ console.log(chalk.yellow(`如无法自动更新,请使用命令更新:npm install -g cloudcc-cli@${onlineVersion} --registry https://registry.npmjs.org`));
23
+ return onlineVersion;
22
24
  }
23
- return false;
25
+ return null;
24
26
  }
25
27
 
26
28
  /**
@@ -43,10 +45,10 @@ function askUpdate() {
43
45
  /**
44
46
  * 升级cli
45
47
  */
46
- function update() {
48
+ function update(onlineVersion) {
47
49
  console.log()
48
50
  console.log(chalk.green("升级中,请稍后..."));
49
- exec(`npm install -g cloudcc-cli --registry https://registry.npmjs.org`)
51
+ exec(`npm install -g cloudcc-cli@${onlineVersion} --registry https://registry.npmjs.org`)
50
52
  console.log()
51
53
  console.log(chalk.green("升级完成!请重新运行"));
52
54
  }
@@ -55,10 +57,11 @@ function update() {
55
57
  * 检查更新
56
58
  */
57
59
  async function checkUpdate() {
58
- if (checkNpmVersion()) {
60
+ let onlineVersion = checkNpmVersion();
61
+ if (onlineVersion) {
59
62
  let res = await askUpdate()
60
63
  if ("Yes" == res.update) {
61
- update()
64
+ update(onlineVersion)
62
65
  return true;
63
66
  } else {
64
67
  return false
package/utils/notifyIM.js CHANGED
@@ -21,7 +21,7 @@ module.exports = {
21
21
  },
22
22
  "elements": [{
23
23
  "tag": "markdown",
24
- "content": "项目名称:" + projectConfig.name + "\nTag:" + type + "\n版本号:" + version + "\n发布者:" + exec("git config user.name").toString("utf8").trim()
24
+ "content": "项目名称:" + projectConfig.name + "\n分支:" + exec("git rev-parse --abbrev-ref HEAD").toString("utf8").trim() + "\nTag:" + type + "\n版本号:" + version + "\n发布者:" + exec("git config user.name").toString("utf8").trim()
25
25
  }, {
26
26
  "actions": [{
27
27
  "tag": "button",
package/utils/pushCode.js CHANGED
@@ -22,14 +22,18 @@ function getNewVersionName(types) {
22
22
  return item.includes("-V");
23
23
  })
24
24
  console.log("version 1", version);
25
- // 取版本号
26
- version = version.split("-V")[1]
27
- console.log("version 2", version);
28
- // 改变版本号
29
- version = changeVersion.change(version, item)
30
- console.log("version 3", version);
31
- // 生成最后的版本号
32
- item = item + "-V" + version
25
+ if (version) {
26
+ // 取版本号
27
+ version = version.split("-V")[1]
28
+ console.log("version 2", version);
29
+ // 改变版本号
30
+ version = changeVersion.change(version, item)
31
+ console.log("version 3", version);
32
+ // 生成最后的版本号
33
+ item = item + "-V" + version
34
+ } else {
35
+ item = item + "-V0.0.1"
36
+ }
33
37
  } else {
34
38
  item = item + "-V0.0.1"
35
39
  }