cloudcc-cli 0.9.6 → 0.9.7

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
+ # ReleaseV0.9.7
2
+ #### 发布日期:2022-2-15
3
+ #### 发布范围:全量
4
+ #### 发布内容
5
+ * 优化
6
+ * 发布项目,使用服务器功能
7
+
1
8
  # ReleaseV0.9.6
2
9
  #### 发布日期:2022-2-14
3
10
  #### 发布范围:全量
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "0.9.6",
3
+ "version": "0.9.7",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
@@ -100,7 +100,6 @@ class Builder {
100
100
  let bizType = data.componentInfo.bizType // 组件类型
101
101
  let compDesc = data.componentInfo.compDesc // 组件描述
102
102
  let category = data.componentInfo.category // 组件状态
103
- console.log("vueData", vueData);
104
103
  return { compName, vueContent, vueData, bizType, compDesc, category }
105
104
  };
106
105
  /**
@@ -15,7 +15,7 @@ const { getNewVersionName, pushCodeAndTags } = require("../utils/pushCode")
15
15
  // 触发构建器
16
16
  const { jenkins } = require("../utils/trigger")
17
17
  // 通知飞书
18
- const { notifyFeishu } = require("../utils/NotifyIM")
18
+ const { notifyFeishu } = require("../utils/notifyIM")
19
19
  // 时间库
20
20
  const dayjs = require("dayjs")
21
21
  /**
@@ -23,6 +23,16 @@ const dayjs = require("dayjs")
23
23
  */
24
24
  class Publish {
25
25
  constructor() {
26
+ /**
27
+ * 控制台参数
28
+ * type:发布类型
29
+ * branch:使用的分支
30
+ */
31
+ this.args = new Map();
32
+ this.arguments = process.argv.splice(2).map((item) => {
33
+ let arr = item.split("=");
34
+ this.args.set(arr[0].split("-")[1], arr[1]);
35
+ });
26
36
  }
27
37
  /**
28
38
  * 初始化
@@ -30,13 +40,29 @@ class Publish {
30
40
  async init() {
31
41
  let res = await checkUpdate();
32
42
  if (!res) {
33
- // 询问发布类型
34
- let condition = await askType();
43
+ let condition = {};
44
+ // 检查参数是否存在发布类型
45
+ if (this.args.get("type")) {
46
+ condition.type = this.args.get("type")
47
+ } else {
48
+ // 询问发布类型
49
+ condition = await askType();
50
+ }
51
+
52
+ // 如果存在分支,则切换分支
53
+ if (this.args.get("branch")) {
54
+ exec(`git checkout ${this.args.get("branch")}`);
55
+ console.log(chalk.green("切换分支:" + this.args.get("branch")))
56
+ console.log()
57
+ }
58
+
35
59
  // 获得version
36
60
  let version = getNewVersionName([condition.type])
37
61
  console.log();
38
62
  console.log(chalk.green('待发布版本:' + version));
39
63
  console.log();
64
+
65
+ // 开始打包
40
66
  if (await this.build()) {
41
67
  // 将readme生成为html,并复制到dist中
42
68
  let outPath = "dist"