cloudcc-cli 1.6.0 → 1.6.2
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 +1147 -1128
- package/bin/cc.js +48 -48
- package/bin/plugin.js +5 -5
- package/bin/project.js +5 -5
- package/package.json +34 -34
- package/src/classes/create.js +43 -43
- package/src/classes/index.js +8 -8
- package/src/classes/publish.js +48 -47
- package/src/config/get.js +22 -0
- package/src/config/index.js +8 -0
- package/src/config/use.js +16 -0
- package/src/object/get.js +16 -0
- package/src/object/index.js +7 -0
- package/src/plugin/create.js +80 -80
- package/src/plugin/create1.js +66 -67
- package/src/plugin/index.js +8 -8
- package/src/plugin/publish.js +298 -305
- package/src/plugin/publish1.js +286 -293
- package/src/project/create.js +89 -89
- package/src/project/create1.js +111 -94
- package/src/project/index.js +7 -7
- package/src/recordType/get.js +16 -0
- package/src/recordType/index.js +7 -0
- package/src/script/create.js +33 -0
- package/src/script/index.js +8 -0
- package/src/script/publish.js +69 -0
- package/src/timer/create.js +29 -29
- package/src/timer/index.js +8 -8
- package/src/timer/publish.js +47 -47
- package/src/token/get.js +13 -0
- package/src/token/index.js +7 -0
- package/src/triggers/create.js +35 -35
- package/src/triggers/index.js +8 -8
- package/src/triggers/publish.js +51 -51
- package/template/Appvue +29 -29
- package/template/babelconfigjs +5 -5
- package/template/cloudcc-cli.configjs +1 -0
- package/template/demojava +14 -14
- package/template/gitignore +11 -0
- package/template/index.js +57 -52
- package/template/indexhtml +21 -21
- package/template/indexvue +34 -34
- package/template/javaconfigjson +2 -2
- package/template/mainjs +13 -13
- package/template/package-lockjson +12115 -12115
- package/template/packagejson +42 -46
- package/template/vueconfigjs +26 -26
- package/utils/checkVersion.js +105 -105
- package/utils/http.js +122 -122
- package/utils/utils.js +54 -44
package/src/plugin/create1.js
CHANGED
|
@@ -1,67 +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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
</div>
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
fs.
|
|
55
|
-
fs.writeFileSync(path.join(pluginPath,
|
|
56
|
-
|
|
57
|
-
console.log()
|
|
58
|
-
console.log(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
console.log()
|
|
62
|
-
console.log(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
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(), "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;
|
package/src/plugin/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const cc = {}
|
|
2
|
-
cc.create = require("./create1")
|
|
3
|
-
cc.publish = require("./publish1")
|
|
4
|
-
function Plugin(action,
|
|
5
|
-
cc[action](
|
|
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;
|