cloudcc-cli 1.2.9 → 1.3.0

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.
Files changed (43) hide show
  1. package/README.md +896 -888
  2. package/bin/build.js +6 -6
  3. package/bin/buildccbasesdk.js +6 -6
  4. package/bin/buildccsdk.js +6 -6
  5. package/bin/buildtag.js +6 -6
  6. package/bin/create.js +6 -6
  7. package/bin/publish.js +6 -6
  8. package/bin/publishh5.js +6 -6
  9. package/package.json +39 -39
  10. package/src/buildTag.js +74 -74
  11. package/src/builderBaseSDK.js +89 -89
  12. package/src/builderPlugin.js +209 -209
  13. package/src/builderSDK.js +160 -160
  14. package/src/creatorTemProject.js +90 -90
  15. package/src/publishProject.js +239 -239
  16. package/src/publishProjectH5.js +180 -180
  17. package/template/Appvue +35 -35
  18. package/template/babelconfigjs +5 -5
  19. package/template/generateIDjs +4 -4
  20. package/template/httpjs +107 -108
  21. package/template/index.js +65 -65
  22. package/template/indexhtml +21 -21
  23. package/template/indexvue +343 -343
  24. package/template/mainjs +16 -16
  25. package/template/package-lockjson +12154 -12154
  26. package/template/packagejson +58 -58
  27. package/template/vueconfigjs +20 -20
  28. package/test/index.html +14 -14
  29. package/test/test.js +5 -5
  30. package/utils/askTool.js +95 -95
  31. package/utils/changeVersion copy.js +74 -74
  32. package/utils/changeVersion.js +26 -26
  33. package/utils/checkVersion.js +90 -90
  34. package/utils/deploy.js +8 -8
  35. package/utils/encryption.js +20 -20
  36. package/utils/github-markdown.min.css +1 -1
  37. package/utils/http.js +95 -95
  38. package/utils/md2html.js +88 -88
  39. package/utils/notifyIM.js +86 -86
  40. package/utils/pushCode.js +186 -186
  41. package/utils/test.js +1 -1
  42. package/utils/trigger.js +15 -15
  43. package/utils/updatei18n.js +126 -126
package/utils/md2html.js CHANGED
@@ -1,89 +1,89 @@
1
- /**
2
- * 将md编译为html,并复制到dist/plu
3
- */
4
- const fs = require('fs'); //文件模块
5
- const path = require('path'); //路径模块
6
- const marked = require('marked'); //md转html模块
7
-
8
- /**
9
- * 检测文件改动
10
- */
11
- function watchFile(target) {
12
- fs.watchFile(target, {
13
- persistent: true, //是否持续监听
14
- interval: 200, //刷新间隔
15
- }, (curr, prev) => {
16
- if (curr.mtime == prev.mtime) { //比较修改时间,判断保存后内容是否真的发生了变化
17
- return false;
18
- }
19
- change()
20
- });
21
- }
22
- /**
23
- * 转换
24
- * @param {target} 编译文件名称
25
- * @param {outPath} 保存路径
26
- */
27
- function change(target = "README", outPath = "dist") {
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);
37
-
38
- }
39
- /**
40
- * 创建页面模板
41
- * @returns {string} 页面骨架字符串
42
- */
43
-
44
- function createTemplate() {
45
- const template = `<!DOCTYPE html>
46
- <html>
47
- <head>
48
- <meta charset="utf-8" >
49
- <meta name="viewport" content="width=device-width, initial-scale=1">
50
- <title>开发日志</title>
51
- <style>
52
- .markdown-body {
53
- box-sizing: border-box;
54
- min-width: 200px;
55
- max-width: 980px;
56
- margin: 0 auto;
57
- padding: 45px;
58
- }
59
- @media (max-width: 767px) {
60
- .markdown-body {
61
- padding: 15px;
62
- }
63
- }
64
- {{{style}}}
65
- </style>
66
- </head>
67
- <body>
68
- <article class="markdown-body">
69
- {{{content}}}
70
- </article>
71
- </body>
72
- </html>`;
73
- return template;
74
- }
75
-
76
- /**
77
- * 创建html文件
78
- * @param {string} content 写入html的文件内容
79
- */
80
- function createFile(content, fileName, outPath = "public") {
81
- const suffix = 'html'; //文件格式
82
- const fullName = fileName + '.' + suffix; //文件全名
83
- const file = path.join(outPath, fullName); //文件地址
84
- fs.writeFileSync(file, content, 'utf-8')
85
- }
86
-
87
- module.exports = {
88
- createFile, createTemplate, change, watchFile
1
+ /**
2
+ * 将md编译为html,并复制到dist/plu
3
+ */
4
+ const fs = require('fs'); //文件模块
5
+ const path = require('path'); //路径模块
6
+ const marked = require('marked'); //md转html模块
7
+
8
+ /**
9
+ * 检测文件改动
10
+ */
11
+ function watchFile(target) {
12
+ fs.watchFile(target, {
13
+ persistent: true, //是否持续监听
14
+ interval: 200, //刷新间隔
15
+ }, (curr, prev) => {
16
+ if (curr.mtime == prev.mtime) { //比较修改时间,判断保存后内容是否真的发生了变化
17
+ return false;
18
+ }
19
+ change()
20
+ });
21
+ }
22
+ /**
23
+ * 转换
24
+ * @param {target} 编译文件名称
25
+ * @param {outPath} 保存路径
26
+ */
27
+ function change(target = "README", outPath = "dist") {
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);
37
+
38
+ }
39
+ /**
40
+ * 创建页面模板
41
+ * @returns {string} 页面骨架字符串
42
+ */
43
+
44
+ function createTemplate() {
45
+ const template = `<!DOCTYPE html>
46
+ <html>
47
+ <head>
48
+ <meta charset="utf-8" >
49
+ <meta name="viewport" content="width=device-width, initial-scale=1">
50
+ <title>开发日志</title>
51
+ <style>
52
+ .markdown-body {
53
+ box-sizing: border-box;
54
+ min-width: 200px;
55
+ max-width: 980px;
56
+ margin: 0 auto;
57
+ padding: 45px;
58
+ }
59
+ @media (max-width: 767px) {
60
+ .markdown-body {
61
+ padding: 15px;
62
+ }
63
+ }
64
+ {{{style}}}
65
+ </style>
66
+ </head>
67
+ <body>
68
+ <article class="markdown-body">
69
+ {{{content}}}
70
+ </article>
71
+ </body>
72
+ </html>`;
73
+ return template;
74
+ }
75
+
76
+ /**
77
+ * 创建html文件
78
+ * @param {string} content 写入html的文件内容
79
+ */
80
+ function createFile(content, fileName, outPath = "public") {
81
+ const suffix = 'html'; //文件格式
82
+ const fullName = fileName + '.' + suffix; //文件全名
83
+ const file = path.join(outPath, fullName); //文件地址
84
+ fs.writeFileSync(file, content, 'utf-8')
85
+ }
86
+
87
+ module.exports = {
88
+ createFile, createTemplate, change, watchFile
89
89
  }
package/utils/notifyIM.js CHANGED
@@ -1,87 +1,87 @@
1
- /**
2
- * 调用IM机器人进行群通知
3
- */
4
- const { postParams } = require('../utils/http');
5
- // 同步执行exe命令
6
- const exec = require('child_process').execSync;
7
- // 控制台样式
8
- const chalk = require("chalk")
9
- // 网络请求
10
- const axios = require("axios")
11
- module.exports = {
12
- /**
13
- * 通知钉钉群
14
- */
15
- notifyDingDing: (type, version, projectConfig, user) => {
16
- if (projectConfig && projectConfig.config) {
17
- let body = {
18
- "msgtype": "actionCard",
19
- "actionCard": {
20
- "title": `${projectConfig.name}项目发布通知`,
21
- "text": `${projectConfig.name}项目发布通知` + "\n\n 项&nbsp;&nbsp;目&nbsp;&nbsp;名:" + projectConfig.name + "\n\n分&nbsp;&nbsp;支&nbsp;&nbsp;名:" + exec("git rev-parse --abbrev-ref HEAD").toString("utf8").trim() + "\n\nTag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:" + type + "\n\n版&nbsp;&nbsp;本&nbsp;&nbsp;号:" + version + "\n\n发&nbsp;&nbsp;布&nbsp;&nbsp;者:" + user,
22
- "btnOrientation": "1",
23
- "btns": [
24
- {
25
- "title": "迭代日志",
26
- "actionURL": projectConfig.config["doc-" + type]
27
- }
28
- ]
29
- }
30
- }
31
- // 获取钉钉推送地址
32
- let triggers = projectConfig.config["dingding-" + type];
33
- if (triggers) {
34
- triggers.map((trigger) => {
35
- axios.post(trigger, body);
36
- })
37
- console.log(chalk.green('已通知钉钉群,请查看。'));
38
- }
39
- }
40
- },
41
- /**
42
- * 通知飞书群
43
- */
44
- notifyFeishu: (type, version, projectConfig, user) => {
45
- if (projectConfig && projectConfig.config) {
46
- let body = {
47
- "msg_type": "interactive",
48
- "card": {
49
- "config": {
50
- "wide_screen_mode": true,
51
- "enable_forward": true
52
- },
53
- "elements": [{
54
- "tag": "markdown",
55
- "content": "项目名称:" + projectConfig.name + "\n分支:" + exec("git rev-parse --abbrev-ref HEAD").toString("utf8").trim() + "\nTag:" + type + "\n版本号:" + version + "\n发布者:" + user
56
- }, {
57
- "actions": [{
58
- "tag": "button",
59
- "text": {
60
- "content": "更新日志",
61
- "tag": "lark_md"
62
- },
63
- "url": projectConfig.config["doc-" + type],
64
- "type": "default",
65
- "value": {}
66
- }],
67
- "tag": "action"
68
- }],
69
- "header": {
70
- "title": {
71
- "content": `${projectConfig.name}项目发布通知`,
72
- "tag": "plain_text"
73
- }
74
- }
75
- }
76
- }
77
- // 获取飞书推送地址
78
- let triggers = projectConfig.config["feishu-" + type];
79
- if (triggers) {
80
- triggers.map((trigger) => {
81
- postParams(trigger, body);
82
- })
83
- console.log(chalk.green('已通知飞书群,请查看。'));
84
- }
85
- }
86
- }
1
+ /**
2
+ * 调用IM机器人进行群通知
3
+ */
4
+ const { postParams } = require('../utils/http');
5
+ // 同步执行exe命令
6
+ const exec = require('child_process').execSync;
7
+ // 控制台样式
8
+ const chalk = require("chalk")
9
+ // 网络请求
10
+ const axios = require("axios")
11
+ module.exports = {
12
+ /**
13
+ * 通知钉钉群
14
+ */
15
+ notifyDingDing: (type, version, projectConfig, user) => {
16
+ if (projectConfig && projectConfig.config) {
17
+ let body = {
18
+ "msgtype": "actionCard",
19
+ "actionCard": {
20
+ "title": `${projectConfig.name}项目发布通知`,
21
+ "text": `${projectConfig.name}项目发布通知` + "\n\n 项&nbsp;&nbsp;目&nbsp;&nbsp;名:" + projectConfig.name + "\n\n分&nbsp;&nbsp;支&nbsp;&nbsp;名:" + exec("git rev-parse --abbrev-ref HEAD").toString("utf8").trim() + "\n\nTag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;:" + type + "\n\n版&nbsp;&nbsp;本&nbsp;&nbsp;号:" + version + "\n\n发&nbsp;&nbsp;布&nbsp;&nbsp;者:" + user,
22
+ "btnOrientation": "1",
23
+ "btns": [
24
+ {
25
+ "title": "迭代日志",
26
+ "actionURL": projectConfig.config["doc-" + type]
27
+ }
28
+ ]
29
+ }
30
+ }
31
+ // 获取钉钉推送地址
32
+ let triggers = projectConfig.config["dingding-" + type];
33
+ if (triggers) {
34
+ triggers.map((trigger) => {
35
+ axios.post(trigger, body);
36
+ })
37
+ console.log(chalk.green('已通知钉钉群,请查看。'));
38
+ }
39
+ }
40
+ },
41
+ /**
42
+ * 通知飞书群
43
+ */
44
+ notifyFeishu: (type, version, projectConfig, user) => {
45
+ if (projectConfig && projectConfig.config) {
46
+ let body = {
47
+ "msg_type": "interactive",
48
+ "card": {
49
+ "config": {
50
+ "wide_screen_mode": true,
51
+ "enable_forward": true
52
+ },
53
+ "elements": [{
54
+ "tag": "markdown",
55
+ "content": "项目名称:" + projectConfig.name + "\n分支:" + exec("git rev-parse --abbrev-ref HEAD").toString("utf8").trim() + "\nTag:" + type + "\n版本号:" + version + "\n发布者:" + user
56
+ }, {
57
+ "actions": [{
58
+ "tag": "button",
59
+ "text": {
60
+ "content": "更新日志",
61
+ "tag": "lark_md"
62
+ },
63
+ "url": projectConfig.config["doc-" + type],
64
+ "type": "default",
65
+ "value": {}
66
+ }],
67
+ "tag": "action"
68
+ }],
69
+ "header": {
70
+ "title": {
71
+ "content": `${projectConfig.name}项目发布通知`,
72
+ "tag": "plain_text"
73
+ }
74
+ }
75
+ }
76
+ }
77
+ // 获取飞书推送地址
78
+ let triggers = projectConfig.config["feishu-" + type];
79
+ if (triggers) {
80
+ triggers.map((trigger) => {
81
+ postParams(trigger, body);
82
+ })
83
+ console.log(chalk.green('已通知飞书群,请查看。'));
84
+ }
85
+ }
86
+ }
87
87
  }