cloudcc-cli 0.6.9 → 0.7.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,31 @@
1
+ # ReleaseV0.7.3
2
+ #### 发布日期:2021-11-10
3
+ #### 发布范围:全量
4
+ #### 发布内容
5
+ * 修复
6
+ * 设置生成version的编码格式
7
+
8
+ # ReleaseV0.7.2
9
+ #### 发布日期:2021-11-8
10
+ #### 发布范围:全量
11
+ #### 发布内容
12
+ * 修复
13
+ * 优化md2html逻辑
14
+
15
+ # ReleaseV0.7.1
16
+ #### 发布日期:2021-11-8
17
+ #### 发布范围:全量
18
+ #### 发布内容
19
+ * 修复
20
+ * 修改生成version时机
21
+
22
+ # ReleaseV0.7.0
23
+ #### 发布日期:2021-11-6
24
+ #### 发布范围:全量
25
+ #### 发布内容
26
+ * 修复
27
+ * sdk打包之后发布到cdn流程
28
+
1
29
  # ReleaseV0.6.9
2
30
  #### 发布日期:2021-11-5
3
31
  #### 发布范围:全量
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cloudcc-cli",
3
- "version": "0.6.9",
3
+ "version": "0.7.3",
4
4
  "description": "cloudcc-cli",
5
5
  "keywords": [
6
6
  "cloudcc",
package/src/builderSDK.js CHANGED
@@ -30,7 +30,7 @@ class Builder {
30
30
  }
31
31
  // 获得vue内容
32
32
  let obj = this.getSDKName(answers.buildDirName);
33
- obj.types = answers.types;
33
+ obj.type = answers.types;
34
34
  this.build(obj) && this.upload(obj);
35
35
  }
36
36
  }
@@ -121,15 +121,13 @@ class Builder {
121
121
  let body = {
122
122
  fileInfo: []
123
123
  };
124
- obj.types.map((type) => {
125
- body.fileInfo.push(
126
- {
127
- "fileName": type + "/" + obj.sdkName + ".umd.min.js",
128
- "fileContent": jsContent,
129
- "bucketName": "cc-sdk",
130
- }
131
- )
132
- })
124
+ body.fileInfo.push(
125
+ {
126
+ "fileName": obj.type + "/" + obj.sdkName + ".umd.min.js",
127
+ "fileContent": jsContent,
128
+ "bucketName": "cc-sdk",
129
+ }
130
+ )
133
131
  let res = await post(this.options.devConsoleConfig.baseUrl + "/devconsole/cdn/uploadFile",
134
132
  body);
135
133
  if (res.returnCode == 200) {
package/src/index.html ADDED
@@ -0,0 +1,12 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>Document</title>
8
+ </head>
9
+ <body>
10
+
11
+ </body>
12
+ </html>
@@ -38,10 +38,21 @@ class Publish {
38
38
  if (projectConfig.config) {
39
39
  outPath = projectConfig.config["doc-path"] ? projectConfig.config["doc-path"] : "dist";
40
40
  }
41
- // 设置readme文件位置
42
- change("README", outPath);
43
- // 写入版本信息
44
- this.writeVersion(version);
41
+ // lightning的Release禁止生成Readme文档
42
+ if (!(Object.is("CloudCC", projectConfig.name) && Object.is("Release", condition.type))) {
43
+ try {
44
+ // 设置readme文件位置
45
+ change("README", outPath);
46
+ } catch (error) {
47
+ console.log(chalk.red("README写入异常:" + error))
48
+ }
49
+ }
50
+ try {
51
+ // 写入版本信息
52
+ this.writeVersion(version);
53
+ } catch (error) {
54
+ console.log(chalk.red("版本信息写入异常:" + error))
55
+ }
45
56
  // 发布代码并设置tags,触发发布,飞书提醒
46
57
  pushCodeAndTags([condition.type]) && jenkins(projectConfig.config["jenkins-" + condition.type]) && notifyFeishu(condition.type, version, projectConfig);
47
58
  console.log();
@@ -101,7 +112,7 @@ class Publish {
101
112
  <div>Commit:${gitCommitVersion}</div>
102
113
  </div>
103
114
  `
104
- fs.writeFileSync("dist/version.html", versionInfo);
115
+ fs.writeFileSync("dist/version.html", versionInfo, 'utf-8');
105
116
  return true
106
117
  } catch (error) {
107
118
  return false
package/utils/md2html.js CHANGED
@@ -25,18 +25,16 @@ function watchFile(target) {
25
25
  * @param {outPath} 保存路径
26
26
  */
27
27
  function change(target = "README", outPath = "dist") {
28
- fs.readFile(target + ".md", 'utf-8', (err, data) => { //读取文件
29
- if (err) {
30
- throw err;
31
- }
32
- const html = marked(data); //将md内容转为html内容
33
- let template = createTemplate();
34
- template = template.replace('{{{content}}}', html); //替换html内容占位标记
28
+ //读取文件
29
+ const data = fs.readFileSync(target + ".md", 'utf-8')
30
+ const html = marked(data); //将md内容转为html内容
31
+ let template = createTemplate();
32
+ template = template.replace('{{{content}}}', html); //替换html内容占位标记
33
+
34
+ let css = fs.readFileSync(path.join(__dirname) + '/github-markdown.min.css', 'utf8')
35
+ template = template.replace('{{{style}}}', css); //替换css内容占位标记
36
+ createFile(template, target, outPath);
35
37
 
36
- let css = fs.readFileSync(path.join(__dirname) + '/github-markdown.min.css', 'utf8')
37
- template = template.replace('{{{style}}}', css); //替换css内容占位标记
38
- createFile(template, target, outPath);
39
- });
40
38
  }
41
39
  /**
42
40
  * 创建页面模板
@@ -83,11 +81,7 @@ function createFile(content, fileName, outPath = "public") {
83
81
  const suffix = 'html'; //文件格式
84
82
  const fullName = fileName + '.' + suffix; //文件全名
85
83
  const file = path.join(outPath, fullName); //文件地址
86
- fs.writeFile(file, content, 'utf-8', err => {
87
- if (err) {
88
- throw err;
89
- }
90
- });
84
+ fs.writeFileSync(file, content, 'utf-8')
91
85
  }
92
86
 
93
87
  module.exports = {