cloudcc-cli 1.6.3 → 1.6.5

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 (49) hide show
  1. package/README.md +1168 -1154
  2. package/bin/cc.js +49 -49
  3. package/bin/plugin.js +6 -6
  4. package/bin/project.js +6 -6
  5. package/package.json +34 -34
  6. package/src/classes/create.js +43 -43
  7. package/src/classes/index.js +8 -8
  8. package/src/classes/publish.js +47 -47
  9. package/src/config/get.js +22 -22
  10. package/src/config/index.js +8 -8
  11. package/src/config/use.js +16 -16
  12. package/src/object/get.js +16 -16
  13. package/src/object/index.js +7 -7
  14. package/src/plugin/create.js +80 -80
  15. package/src/plugin/create1.js +66 -66
  16. package/src/plugin/index.js +8 -8
  17. package/src/plugin/publish.js +298 -298
  18. package/src/plugin/publish1.js +286 -286
  19. package/src/project/create.js +89 -89
  20. package/src/project/create1.js +111 -111
  21. package/src/project/index.js +7 -7
  22. package/src/recordType/get.js +16 -16
  23. package/src/recordType/index.js +7 -7
  24. package/src/script/create.js +32 -32
  25. package/src/script/index.js +8 -8
  26. package/src/script/publish.js +69 -69
  27. package/src/timer/create.js +29 -29
  28. package/src/timer/index.js +8 -8
  29. package/src/timer/publish.js +47 -47
  30. package/src/token/get.js +13 -13
  31. package/src/token/index.js +7 -7
  32. package/src/triggers/create.js +35 -35
  33. package/src/triggers/index.js +8 -8
  34. package/src/triggers/publish.js +51 -51
  35. package/template/Appvue +29 -29
  36. package/template/babelconfigjs +5 -5
  37. package/template/demojava +14 -14
  38. package/template/gitignore +11 -11
  39. package/template/index.js +57 -57
  40. package/template/indexhtml +21 -21
  41. package/template/indexvue +34 -34
  42. package/template/javaconfigjson +2 -2
  43. package/template/mainjs +13 -13
  44. package/template/package-lockjson +12115 -12115
  45. package/template/packagejson +42 -42
  46. package/template/vueconfigjs +26 -26
  47. package/utils/checkVersion.js +105 -105
  48. package/utils/http.js +122 -122
  49. package/utils/utils.js +59 -53
@@ -1,80 +1,80 @@
1
- const fs = require('fs');
2
- const inquirer = require("inquirer")
3
- // 检查cli版本更新功能
4
- const { checkUpdate } = require("../../utils/checkVersion")
5
- const temp = `<template>
6
- <div class="cc-container">
7
- <div>Hello CloudCC</div>
8
- <div>
9
- <a href="https://cloudccone.feishu.cn/wiki/JZ7CwcRfriU8taknCKCcwKEmncd">
10
- 开发者文档</a
11
- >
12
- </div>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- export default {
18
- data() {
19
- return {
20
- componentInfo: {
21
- // 组件唯一标识,全局唯一
22
- component: "cloudcc-demo-01",
23
- // 组件名称,在页面编辑器显示的名字
24
- compName: "cloudcc-demo-01",
25
- // 组件描述信息
26
- compDesc: "组件描述信息",
27
- },
28
- isLock: false,
29
- };
30
- },
31
- };
32
- </script>
33
- <style lang="scss" scoped>
34
- .cc-container {
35
- text-align: center;
36
- padding: 8px;
37
- background: goldenrod;
38
- }
39
- </style>`
40
- /**
41
- * 创建组件模板文件
42
- */
43
- class Builder {
44
- constructor() {
45
- this.options = {
46
- // 开发配置信息
47
- devConsoleConfig: {
48
- },
49
- }
50
- this.plugin = process.argv.splice(2)[0]
51
- }
52
- async init() {
53
- let res = await checkUpdate();
54
- if (!res) {
55
- // 获得用户输入
56
- let answers;
57
- if (this.plugin) {
58
- answers = { buildFileName: this.plugin + "/demo.vue" }
59
- } else {
60
- answers = await this.ask();
61
- answers.buildFileName = "./plugin/" + answers.buildFileName
62
- }
63
- fs.writeFileSync(answers.buildFileName, temp);
64
- }
65
- }
66
- /**
67
- * 命令行交互
68
- * @returns 结果
69
- */
70
- ask() {
71
- const prompt = [];
72
- prompt.push({
73
- type: "input",
74
- name: "buildFileName",
75
- message: "请输入文件名,如index.vue",
76
- })
77
- return inquirer.prompt(prompt)
78
- }
79
- }
80
- module.exports = Builder;
1
+ const fs = require('fs');
2
+ const inquirer = require("inquirer")
3
+ // 检查cli版本更新功能
4
+ const { checkUpdate } = require("../../utils/checkVersion")
5
+ const temp = `<template>
6
+ <div class="cc-container">
7
+ <div>Hello CloudCC</div>
8
+ <div>
9
+ <a href="https://cloudccone.feishu.cn/wiki/JZ7CwcRfriU8taknCKCcwKEmncd">
10
+ 开发者文档</a
11
+ >
12
+ </div>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ export default {
18
+ data() {
19
+ return {
20
+ componentInfo: {
21
+ // 组件唯一标识,全局唯一
22
+ component: "cloudcc-demo-01",
23
+ // 组件名称,在页面编辑器显示的名字
24
+ compName: "cloudcc-demo-01",
25
+ // 组件描述信息
26
+ compDesc: "组件描述信息",
27
+ },
28
+ isLock: false,
29
+ };
30
+ },
31
+ };
32
+ </script>
33
+ <style lang="scss" scoped>
34
+ .cc-container {
35
+ text-align: center;
36
+ padding: 8px;
37
+ background: goldenrod;
38
+ }
39
+ </style>`
40
+ /**
41
+ * 创建组件模板文件
42
+ */
43
+ class Builder {
44
+ constructor() {
45
+ this.options = {
46
+ // 开发配置信息
47
+ devConsoleConfig: {
48
+ },
49
+ }
50
+ this.plugin = process.argv.splice(2)[0]
51
+ }
52
+ async init() {
53
+ let res = await checkUpdate();
54
+ if (!res) {
55
+ // 获得用户输入
56
+ let answers;
57
+ if (this.plugin) {
58
+ answers = { buildFileName: this.plugin + "/demo.vue" }
59
+ } else {
60
+ answers = await this.ask();
61
+ answers.buildFileName = "./plugin/" + answers.buildFileName
62
+ }
63
+ fs.writeFileSync(answers.buildFileName, temp);
64
+ }
65
+ }
66
+ /**
67
+ * 命令行交互
68
+ * @returns 结果
69
+ */
70
+ ask() {
71
+ const prompt = [];
72
+ prompt.push({
73
+ type: "input",
74
+ name: "buildFileName",
75
+ message: "请输入文件名,如index.vue",
76
+ })
77
+ return inquirer.prompt(prompt)
78
+ }
79
+ }
80
+ module.exports = Builder;
@@ -1,66 +1,66 @@
1
- // 检查cli版本更新功能
2
- const { checkUpdate } = require("../../utils/checkVersion")
3
- const fs = require("fs");
4
- const path = require("path")
5
- const chalk = require("chalk")
6
-
7
-
8
- /**
9
- * 创建文件
10
- * @param {string} name 文件名称
11
- */
12
- async function create(name) {
13
- const temp = `<template>
14
- <div class="cc-container">
15
- <div>Hello CloudCC</div>
16
- <div>
17
- <a href="https://cloudccone.feishu.cn/wiki/JZ7CwcRfriU8taknCKCcwKEmncd">
18
- 开发者文档</a
19
- >
20
- </div>
21
- </div>
22
- </template>
23
-
24
- <script>
25
- export default {
26
- data() {
27
- return {
28
- componentInfo: {
29
- // 组件唯一标识,全局唯一
30
- component: "${name}",
31
- // 组件名称,在页面编辑器显示的名字
32
- compName: "${name}",
33
- // 组件描述信息
34
- compDesc: "组件描述信息",
35
- },
36
- isLock: false,
37
- };
38
- },
39
- };
40
- </script>
41
- <style lang="scss" scoped>
42
- .cc-container {
43
- text-align: center;
44
- padding: 8px;
45
- background: goldenrod;
46
- }
47
- </style>`
48
- let res = await checkUpdate();
49
- if (!res) {
50
-
51
- const pluginPath = path.join(process.cwd(), "plugin/" + name);
52
- try {
53
- fs.mkdirSync(pluginPath, { recursive: true })
54
- fs.writeFileSync(path.join(pluginPath, name + ".vue"), temp)
55
- fs.writeFileSync(path.join(pluginPath, "config.json"), `{"name":"${name}"}`)
56
- console.log()
57
- console.log(chalk.green("创建成功:" + name))
58
- console.log()
59
- } catch (e) {
60
- console.log()
61
- console.log(chalk.red("创建失败:" + e))
62
- console.log()
63
- }
64
- }
65
- }
66
- module.exports = create;
1
+ // 检查cli版本更新功能
2
+ const { checkUpdate } = require("../../utils/checkVersion")
3
+ const fs = require("fs");
4
+ const path = require("path")
5
+ const chalk = require("chalk")
6
+
7
+
8
+ /**
9
+ * 创建文件
10
+ * @param {string} name 文件名称
11
+ */
12
+ async function create(name) {
13
+ const temp = `<template>
14
+ <div class="cc-container">
15
+ <div>Hello CloudCC</div>
16
+ <div>
17
+ <a href="https://cloudccone.feishu.cn/wiki/JZ7CwcRfriU8taknCKCcwKEmncd">
18
+ 开发者文档</a
19
+ >
20
+ </div>
21
+ </div>
22
+ </template>
23
+
24
+ <script>
25
+ export default {
26
+ data() {
27
+ return {
28
+ componentInfo: {
29
+ // 组件唯一标识,全局唯一
30
+ component: "${name}",
31
+ // 组件名称,在页面编辑器显示的名字
32
+ compName: "${name}",
33
+ // 组件描述信息
34
+ compDesc: "组件描述信息",
35
+ },
36
+ isLock: false,
37
+ };
38
+ },
39
+ };
40
+ </script>
41
+ <style lang="scss" scoped>
42
+ .cc-container {
43
+ text-align: center;
44
+ padding: 8px;
45
+ background: goldenrod;
46
+ }
47
+ </style>`
48
+ let res = await checkUpdate();
49
+ if (!res) {
50
+
51
+ const pluginPath = path.join(process.cwd(), "plugins/" + name);
52
+ try {
53
+ fs.mkdirSync(pluginPath, { recursive: true })
54
+ fs.writeFileSync(path.join(pluginPath, name + ".vue"), temp)
55
+ fs.writeFileSync(path.join(pluginPath, "config.json"), `{"name":"${name}"}`)
56
+ console.log()
57
+ console.log(chalk.green("创建成功:" + name))
58
+ console.log()
59
+ } catch (e) {
60
+ console.log()
61
+ console.log(chalk.red("创建失败:" + e))
62
+ console.log()
63
+ }
64
+ }
65
+ }
66
+ module.exports = create;
@@ -1,8 +1,8 @@
1
- const cc = {}
2
- cc.create = require("./create1")
3
- cc.publish = require("./publish1")
4
- function Plugin(action, argvs) {
5
- cc[action](argvs[2])
6
- }
7
-
8
- module.exports = Plugin;
1
+ const cc = {}
2
+ cc.create = require("./create1")
3
+ cc.publish = require("./publish1")
4
+ function Plugin(action, argvs) {
5
+ cc[action](argvs[2])
6
+ }
7
+
8
+ module.exports = Plugin;