cloudcc-cli 1.7.2 → 1.7.4
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 +1219 -1204
- package/bin/cc.js +49 -49
- package/bin/plugin.js +6 -6
- package/bin/project.js +6 -6
- package/core/core/ServiceResult.java +35 -35
- package/core/core/UserInfo.java +45 -45
- package/package.json +34 -34
- package/src/classes/create.js +40 -40
- package/src/classes/index.js +8 -8
- package/src/classes/publish.js +43 -43
- package/src/config/get.js +20 -20
- package/src/config/index.js +8 -8
- package/src/config/use.js +14 -14
- package/src/object/get.js +14 -14
- package/src/object/index.js +7 -7
- package/src/plugin/create.js +70 -70
- package/src/plugin/create1.js +58 -58
- package/src/plugin/index.js +8 -8
- package/src/plugin/publish.js +262 -262
- package/src/plugin/publish1.js +256 -256
- package/src/project/create.js +87 -87
- package/src/project/create1.js +109 -109
- package/src/project/index.js +7 -7
- package/src/recordType/get.js +13 -13
- package/src/recordType/index.js +7 -7
- package/src/script/create.js +29 -29
- package/src/script/index.js +8 -8
- package/src/script/publish.js +62 -62
- package/src/timer/create.js +26 -26
- package/src/timer/index.js +8 -8
- package/src/timer/publish.js +43 -43
- package/src/token/get.js +11 -11
- package/src/token/index.js +7 -7
- package/src/triggers/create.js +27 -27
- package/src/triggers/index.js +8 -8
- package/src/triggers/publish.js +48 -48
- package/template/Appvue +24 -24
- package/template/babelconfigjs +5 -5
- package/template/demojava +14 -14
- package/template/gitignore +11 -11
- package/template/index.js +57 -57
- package/template/indexhtml +21 -21
- package/template/indexvue +29 -29
- package/template/javaconfigjson +2 -2
- package/template/mainjs +13 -13
- package/template/package-lockjson +13952 -13952
- package/template/packagejson +42 -42
- package/template/vueconfigjs +21 -21
- package/tool/branch/index.js +25 -25
- package/tool/checkLange/checkLang.js +68 -68
- package/tool/checkLange/clearLang.js +85 -85
- package/utils/checkVersion.js +90 -94
- package/utils/config.js +18 -0
- package/utils/http.js +123 -123
- package/utils/utils.js +40 -58
package/src/timer/create.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
const { checkUpdate } = require("../../utils/checkVersion")
|
|
2
|
-
const fs = require("fs");
|
|
3
|
-
const path = require("path")
|
|
4
|
-
const chalk = require("chalk")
|
|
5
|
-
|
|
6
|
-
async function create(name) {
|
|
7
|
-
let res = await checkUpdate();
|
|
8
|
-
if (!res) {
|
|
9
|
-
const timerPath = path.join(process.cwd(), "timer/" + name);
|
|
10
|
-
try {
|
|
11
|
-
fs.mkdirSync(timerPath, { recursive: true })
|
|
12
|
-
const javaTmp = `System.out.print("hello CloudCC");`
|
|
13
|
-
fs.writeFileSync(path.join(timerPath, name + ".java"), javaTmp)
|
|
14
|
-
fs.writeFileSync(path.join(timerPath, "config.json"), `{"name":"${name}","version":"3"}`)
|
|
15
|
-
console.log()
|
|
16
|
-
console.log(chalk.green("Successfully Created:" + name))
|
|
17
|
-
console.log()
|
|
18
|
-
} catch (e) {
|
|
19
|
-
console.log()
|
|
20
|
-
console.log(chalk.red("Creation Failed:" + e))
|
|
21
|
-
console.log()
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
module.exports = create;
|
|
1
|
+
const { checkUpdate } = require("../../utils/checkVersion")
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path")
|
|
4
|
+
const chalk = require("chalk")
|
|
5
|
+
|
|
6
|
+
async function create(name) {
|
|
7
|
+
let res = await checkUpdate();
|
|
8
|
+
if (!res) {
|
|
9
|
+
const timerPath = path.join(process.cwd(), "timer/" + name);
|
|
10
|
+
try {
|
|
11
|
+
fs.mkdirSync(timerPath, { recursive: true })
|
|
12
|
+
const javaTmp = `System.out.print("hello CloudCC");`
|
|
13
|
+
fs.writeFileSync(path.join(timerPath, name + ".java"), javaTmp)
|
|
14
|
+
fs.writeFileSync(path.join(timerPath, "config.json"), `{"name":"${name}","version":"3"}`)
|
|
15
|
+
console.log()
|
|
16
|
+
console.log(chalk.green("Successfully Created:" + name))
|
|
17
|
+
console.log()
|
|
18
|
+
} catch (e) {
|
|
19
|
+
console.log()
|
|
20
|
+
console.log(chalk.red("Creation Failed:" + e))
|
|
21
|
+
console.log()
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = create;
|
package/src/timer/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const cc = {}
|
|
2
|
-
cc.create = require("./create")
|
|
3
|
-
cc.publish = require("./publish")
|
|
4
|
-
function Timer(action, argvs) {
|
|
5
|
-
cc[action](argvs[2])
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
module.exports = Timer;
|
|
1
|
+
const cc = {}
|
|
2
|
+
cc.create = require("./create")
|
|
3
|
+
cc.publish = require("./publish")
|
|
4
|
+
function Timer(action, argvs) {
|
|
5
|
+
cc[action](argvs[2])
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
module.exports = Timer;
|
package/src/timer/publish.js
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
const { checkUpdate } = require("../../utils/checkVersion")
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path")
|
|
5
|
-
const chalk = require("chalk")
|
|
6
|
-
const { postNormal } = require("../../utils/http")
|
|
7
|
-
|
|
8
|
-
const { getBusToken } = require("../../utils/utils")
|
|
9
|
-
|
|
10
|
-
async function publish(name) {
|
|
11
|
-
let res = await checkUpdate();
|
|
12
|
-
if (!res) {
|
|
13
|
-
console.log();
|
|
14
|
-
console.log(chalk.green('Posting, please wait...'));
|
|
15
|
-
console.log();
|
|
16
|
-
const timerPath = path.join(process.cwd(), `timer/${name}/`);
|
|
17
|
-
let classContent = fs.readFileSync(timerPath + `${name}.java`, 'utf8');
|
|
18
|
-
let configContent = JSON.parse(fs.readFileSync(timerPath + "config.json", 'utf8'));
|
|
19
|
-
|
|
20
|
-
if (await getBusToken()) {
|
|
21
|
-
let body = {
|
|
22
|
-
"id": configContent.id,
|
|
23
|
-
"name": name,
|
|
24
|
-
"version": configContent.version,
|
|
25
|
-
"source": encodeURI(classContent),
|
|
26
|
-
"folderId": "wgd"
|
|
27
|
-
}
|
|
28
|
-
let res = await postNormal(global.setupSvc + "/api/ccPeak/save", body)
|
|
29
|
-
if (res.result) {
|
|
30
|
-
console.log(chalk.green('Success!'));
|
|
31
|
-
console.log();
|
|
32
|
-
|
|
33
|
-
if (!configContent.id) {
|
|
34
|
-
configContent.id = res.data
|
|
35
|
-
fs.writeFileSync(path.join(timerPath, "config.json"), JSON.stringify(configContent))
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
console.log(chalk.red('Fail:' + res.returnInfo));
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
module.exports = publish;
|
|
1
|
+
|
|
2
|
+
const { checkUpdate } = require("../../utils/checkVersion")
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path")
|
|
5
|
+
const chalk = require("chalk")
|
|
6
|
+
const { postNormal } = require("../../utils/http")
|
|
7
|
+
|
|
8
|
+
const { getBusToken } = require("../../utils/utils")
|
|
9
|
+
|
|
10
|
+
async function publish(name) {
|
|
11
|
+
let res = await checkUpdate();
|
|
12
|
+
if (!res) {
|
|
13
|
+
console.log();
|
|
14
|
+
console.log(chalk.green('Posting, please wait...'));
|
|
15
|
+
console.log();
|
|
16
|
+
const timerPath = path.join(process.cwd(), `timer/${name}/`);
|
|
17
|
+
let classContent = fs.readFileSync(timerPath + `${name}.java`, 'utf8');
|
|
18
|
+
let configContent = JSON.parse(fs.readFileSync(timerPath + "config.json", 'utf8'));
|
|
19
|
+
|
|
20
|
+
if (await getBusToken()) {
|
|
21
|
+
let body = {
|
|
22
|
+
"id": configContent.id,
|
|
23
|
+
"name": name,
|
|
24
|
+
"version": configContent.version,
|
|
25
|
+
"source": encodeURI(classContent),
|
|
26
|
+
"folderId": "wgd"
|
|
27
|
+
}
|
|
28
|
+
let res = await postNormal(global.setupSvc + "/api/ccPeak/save", body)
|
|
29
|
+
if (res.result) {
|
|
30
|
+
console.log(chalk.green('Success!'));
|
|
31
|
+
console.log();
|
|
32
|
+
|
|
33
|
+
if (!configContent.id) {
|
|
34
|
+
configContent.id = res.data
|
|
35
|
+
fs.writeFileSync(path.join(timerPath, "config.json"), JSON.stringify(configContent))
|
|
36
|
+
}
|
|
37
|
+
} else {
|
|
38
|
+
console.log(chalk.red('Fail:' + res.returnInfo));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
module.exports = publish;
|
package/src/token/get.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
const { getBusToken } = require("../../utils/utils")
|
|
2
|
-
|
|
3
|
-
async function get(path) {
|
|
4
|
-
let token = await getBusToken(path)
|
|
5
|
-
if (token) {
|
|
6
|
-
console.log(token)
|
|
7
|
-
return token;
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
module.exports = get;
|
|
1
|
+
const { getBusToken } = require("../../utils/utils")
|
|
2
|
+
|
|
3
|
+
async function get(path) {
|
|
4
|
+
let token = await getBusToken(path)
|
|
5
|
+
if (token) {
|
|
6
|
+
console.log(token)
|
|
7
|
+
return token;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
module.exports = get;
|
package/src/token/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const cc = {}
|
|
2
|
-
cc.get = require("./get")
|
|
3
|
-
function Token(action,argvs) {
|
|
4
|
-
cc[action](argvs[2])
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
module.exports = Token;
|
|
1
|
+
const cc = {}
|
|
2
|
+
cc.get = require("./get")
|
|
3
|
+
function Token(action,argvs) {
|
|
4
|
+
cc[action](argvs[2])
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
module.exports = Token;
|
package/src/triggers/create.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const { checkUpdate } = require("../../utils/checkVersion")
|
|
2
|
-
const fs = require("fs");
|
|
3
|
-
const path = require("path")
|
|
4
|
-
const chalk = require("chalk")
|
|
5
|
-
|
|
6
|
-
async function create(argvs) {
|
|
7
|
-
let res = await checkUpdate();
|
|
8
|
-
if (!res) {
|
|
9
|
-
let body = JSON.parse(decodeURI(argvs[2]))
|
|
10
|
-
const triggersPath = path.join(process.cwd(), "triggers/" + body.name);
|
|
11
|
-
try {
|
|
12
|
-
fs.mkdirSync(triggersPath, { recursive: true })
|
|
13
|
-
const javaTmp = `System.out.print("hello CloudCC");`
|
|
14
|
-
fs.writeFileSync(path.join(triggersPath, body.name + ".java"), javaTmp)
|
|
15
|
-
fs.writeFileSync(path.join(triggersPath, "config.json"), JSON.stringify(body))
|
|
16
|
-
console.log()
|
|
17
|
-
console.log(chalk.green("Successfully Created:" + body.name))
|
|
18
|
-
console.log()
|
|
19
|
-
} catch (e) {
|
|
20
|
-
console.log()
|
|
21
|
-
console.log(chalk.red("Creation Failed:" + e))
|
|
22
|
-
console.log()
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
module.exports = create;
|
|
1
|
+
const { checkUpdate } = require("../../utils/checkVersion")
|
|
2
|
+
const fs = require("fs");
|
|
3
|
+
const path = require("path")
|
|
4
|
+
const chalk = require("chalk")
|
|
5
|
+
|
|
6
|
+
async function create(argvs) {
|
|
7
|
+
let res = await checkUpdate();
|
|
8
|
+
if (!res) {
|
|
9
|
+
let body = JSON.parse(decodeURI(argvs[2]))
|
|
10
|
+
const triggersPath = path.join(process.cwd(), "triggers/" + body.name);
|
|
11
|
+
try {
|
|
12
|
+
fs.mkdirSync(triggersPath, { recursive: true })
|
|
13
|
+
const javaTmp = `System.out.print("hello CloudCC");`
|
|
14
|
+
fs.writeFileSync(path.join(triggersPath, body.name + ".java"), javaTmp)
|
|
15
|
+
fs.writeFileSync(path.join(triggersPath, "config.json"), JSON.stringify(body))
|
|
16
|
+
console.log()
|
|
17
|
+
console.log(chalk.green("Successfully Created:" + body.name))
|
|
18
|
+
console.log()
|
|
19
|
+
} catch (e) {
|
|
20
|
+
console.log()
|
|
21
|
+
console.log(chalk.red("Creation Failed:" + e))
|
|
22
|
+
console.log()
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = create;
|
package/src/triggers/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
const cc = {}
|
|
2
|
-
cc.create = require("./create")
|
|
3
|
-
cc.publish = require("./publish")
|
|
4
|
-
function Classes(action, argvs) {
|
|
5
|
-
cc[action](argvs)
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
module.exports = Classes;
|
|
1
|
+
const cc = {}
|
|
2
|
+
cc.create = require("./create")
|
|
3
|
+
cc.publish = require("./publish")
|
|
4
|
+
function Classes(action, argvs) {
|
|
5
|
+
cc[action](argvs)
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
module.exports = Classes;
|
package/src/triggers/publish.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
const { checkUpdate } = require("../../utils/checkVersion")
|
|
3
|
-
const fs = require("fs");
|
|
4
|
-
const path = require("path")
|
|
5
|
-
const chalk = require("chalk")
|
|
6
|
-
const { postNormal } = require("../../utils/http")
|
|
7
|
-
const { getBusToken } = require("../../utils/utils")
|
|
8
|
-
|
|
9
|
-
async function publish(argvs) {
|
|
10
|
-
let name = argvs[2]
|
|
11
|
-
let res = await checkUpdate();
|
|
12
|
-
if (!res) {
|
|
13
|
-
console.log();
|
|
14
|
-
console.log(chalk.green('Posting, please wait...'));
|
|
15
|
-
console.log();
|
|
16
|
-
const triggersPath = path.join(process.cwd(), `triggers/${name}/`);
|
|
17
|
-
let classContent = fs.readFileSync(triggersPath + `${name}.java`, 'utf8');
|
|
18
|
-
let configContent = JSON.parse(fs.readFileSync(triggersPath + "config.json", 'utf8'));
|
|
19
|
-
|
|
20
|
-
if (await getBusToken()) {
|
|
21
|
-
let body = {
|
|
22
|
-
"id": configContent.id,
|
|
23
|
-
"apiname": configContent.apiname,
|
|
24
|
-
"isactive": configContent.isactive,
|
|
25
|
-
"targetObjectId": configContent.targetObjectId,
|
|
26
|
-
"triggerTime": configContent.triggerTime,
|
|
27
|
-
"name": name,
|
|
28
|
-
"version": configContent.version,
|
|
29
|
-
"triggerSource": encodeURI(classContent),
|
|
30
|
-
"folderId": "wgd"
|
|
31
|
-
}
|
|
32
|
-
let res = await postNormal(global.setupSvc + "/api/triggerSetup/saveTrigger", body)
|
|
33
|
-
if (res.result) {
|
|
34
|
-
console.log(chalk.green('Success!'));
|
|
35
|
-
console.log();
|
|
36
|
-
|
|
37
|
-
if (!configContent.id) {
|
|
38
|
-
configContent.id = res.data.id
|
|
39
|
-
configContent.apiname = res.data.apiname
|
|
40
|
-
fs.writeFileSync(path.join(triggersPath, "config.json"), JSON.stringify(configContent))
|
|
41
|
-
}
|
|
42
|
-
} else {
|
|
43
|
-
console.log(chalk.red('Fail:' + res.returnInfo));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
module.exports = publish;
|
|
1
|
+
|
|
2
|
+
const { checkUpdate } = require("../../utils/checkVersion")
|
|
3
|
+
const fs = require("fs");
|
|
4
|
+
const path = require("path")
|
|
5
|
+
const chalk = require("chalk")
|
|
6
|
+
const { postNormal } = require("../../utils/http")
|
|
7
|
+
const { getBusToken } = require("../../utils/utils")
|
|
8
|
+
|
|
9
|
+
async function publish(argvs) {
|
|
10
|
+
let name = argvs[2]
|
|
11
|
+
let res = await checkUpdate();
|
|
12
|
+
if (!res) {
|
|
13
|
+
console.log();
|
|
14
|
+
console.log(chalk.green('Posting, please wait...'));
|
|
15
|
+
console.log();
|
|
16
|
+
const triggersPath = path.join(process.cwd(), `triggers/${name}/`);
|
|
17
|
+
let classContent = fs.readFileSync(triggersPath + `${name}.java`, 'utf8');
|
|
18
|
+
let configContent = JSON.parse(fs.readFileSync(triggersPath + "config.json", 'utf8'));
|
|
19
|
+
|
|
20
|
+
if (await getBusToken()) {
|
|
21
|
+
let body = {
|
|
22
|
+
"id": configContent.id,
|
|
23
|
+
"apiname": configContent.apiname,
|
|
24
|
+
"isactive": configContent.isactive,
|
|
25
|
+
"targetObjectId": configContent.targetObjectId,
|
|
26
|
+
"triggerTime": configContent.triggerTime,
|
|
27
|
+
"name": name,
|
|
28
|
+
"version": configContent.version,
|
|
29
|
+
"triggerSource": encodeURI(classContent),
|
|
30
|
+
"folderId": "wgd"
|
|
31
|
+
}
|
|
32
|
+
let res = await postNormal(global.setupSvc + "/api/triggerSetup/saveTrigger", body)
|
|
33
|
+
if (res.result) {
|
|
34
|
+
console.log(chalk.green('Success!'));
|
|
35
|
+
console.log();
|
|
36
|
+
|
|
37
|
+
if (!configContent.id) {
|
|
38
|
+
configContent.id = res.data.id
|
|
39
|
+
configContent.apiname = res.data.apiname
|
|
40
|
+
fs.writeFileSync(path.join(triggersPath, "config.json"), JSON.stringify(configContent))
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
console.log(chalk.red('Fail:' + res.returnInfo));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
module.exports = publish;
|
package/template/Appvue
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="cc-container">
|
|
3
|
-
<div>Hello CloudCC</div>
|
|
4
|
-
</div>
|
|
5
|
-
</template>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
export default {
|
|
9
|
-
name: "App",
|
|
10
|
-
};
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<style lang="scss" scoped>
|
|
14
|
-
html body {
|
|
15
|
-
padding: 0;
|
|
16
|
-
margin: 0;
|
|
17
|
-
height: 100vh;
|
|
18
|
-
width: 100%;
|
|
19
|
-
}
|
|
20
|
-
.cc-container {
|
|
21
|
-
text-align: center;
|
|
22
|
-
padding: 8px;
|
|
23
|
-
background: goldenrod;
|
|
24
|
-
}
|
|
1
|
+
<template>
|
|
2
|
+
<div class="cc-container">
|
|
3
|
+
<div>Hello CloudCC</div>
|
|
4
|
+
</div>
|
|
5
|
+
</template>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
export default {
|
|
9
|
+
name: "App",
|
|
10
|
+
};
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<style lang="scss" scoped>
|
|
14
|
+
html body {
|
|
15
|
+
padding: 0;
|
|
16
|
+
margin: 0;
|
|
17
|
+
height: 100vh;
|
|
18
|
+
width: 100%;
|
|
19
|
+
}
|
|
20
|
+
.cc-container {
|
|
21
|
+
text-align: center;
|
|
22
|
+
padding: 8px;
|
|
23
|
+
background: goldenrod;
|
|
24
|
+
}
|
|
25
25
|
</style>
|
package/template/babelconfigjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
presets: [
|
|
3
|
-
'@vue/cli-plugin-babel/preset'
|
|
4
|
-
]
|
|
5
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
presets: [
|
|
3
|
+
'@vue/cli-plugin-babel/preset'
|
|
4
|
+
]
|
|
5
|
+
}
|
package/template/demojava
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
public class Test{
|
|
2
|
-
private CCServiceV3 cs;
|
|
3
|
-
private UserInfo userInfo;
|
|
4
|
-
|
|
5
|
-
public Test(UserInfo userInfo){
|
|
6
|
-
this.userInfo = userInfo;
|
|
7
|
-
cs = new CCServiceV3(userInfo);
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
public String demo(String str){
|
|
12
|
-
str = "demo";
|
|
13
|
-
return str;
|
|
14
|
-
}
|
|
1
|
+
public class Test{
|
|
2
|
+
private CCServiceV3 cs;
|
|
3
|
+
private UserInfo userInfo;
|
|
4
|
+
|
|
5
|
+
public Test(UserInfo userInfo){
|
|
6
|
+
this.userInfo = userInfo;
|
|
7
|
+
cs = new CCServiceV3(userInfo);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
public String demo(String str){
|
|
12
|
+
str = "demo";
|
|
13
|
+
return str;
|
|
14
|
+
}
|
|
15
15
|
}
|
package/template/gitignore
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
.DS_Store
|
|
2
|
-
node_modules/
|
|
3
|
-
build
|
|
4
|
-
|
|
5
|
-
# Editor directories and files
|
|
6
|
-
.idea
|
|
7
|
-
.vscode
|
|
8
|
-
*.suo
|
|
9
|
-
*.ntvs*
|
|
10
|
-
*.njsproj
|
|
11
|
-
*.sln
|
|
1
|
+
.DS_Store
|
|
2
|
+
node_modules/
|
|
3
|
+
build
|
|
4
|
+
|
|
5
|
+
# Editor directories and files
|
|
6
|
+
.idea
|
|
7
|
+
.vscode
|
|
8
|
+
*.suo
|
|
9
|
+
*.ntvs*
|
|
10
|
+
*.njsproj
|
|
11
|
+
*.sln
|
package/template/index.js
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
const fs = require("fs");
|
|
2
|
-
const chalk = require("chalk")
|
|
3
|
-
const path = require("path")
|
|
4
|
-
module.exports = function (creator, options, callback) {
|
|
5
|
-
const { name, description } = options;
|
|
6
|
-
|
|
7
|
-
const cwd = process.cwd();
|
|
8
|
-
|
|
9
|
-
const projectPath = path.join(cwd, name);
|
|
10
|
-
fs.mkdirSync(projectPath)
|
|
11
|
-
|
|
12
|
-
const src = path.join(projectPath, "src");
|
|
13
|
-
fs.mkdirSync(src)
|
|
14
|
-
|
|
15
|
-
const public = path.join(projectPath, "public");
|
|
16
|
-
fs.mkdirSync(public)
|
|
17
|
-
|
|
18
|
-
creator.copyTpl('cloudcc-cli.configjs', path.join(projectPath, "cloudcc-cli.config.js"))
|
|
19
|
-
|
|
20
|
-
creator.copyTpl('gitignore', path.join(projectPath, ".gitignore"))
|
|
21
|
-
|
|
22
|
-
creator.copyTpl('packagejson', path.join(projectPath, "package.json"), {
|
|
23
|
-
name, description
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
creator.copyTpl('package-lockjson', path.join(projectPath, "package-lock.json"), {
|
|
27
|
-
name, description
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
creator.copyTpl('vueconfigjs', path.join(projectPath, "vue.config.js"))
|
|
31
|
-
|
|
32
|
-
creator.copyTpl('babelconfigjs', path.join(projectPath, "babel.config.js"))
|
|
33
|
-
|
|
34
|
-
creator.copyTpl('mainjs', path.join(src, "main.js"))
|
|
35
|
-
|
|
36
|
-
creator.copyTpl('Appvue', path.join(src, "App.vue"))
|
|
37
|
-
|
|
38
|
-
creator.copyTpl('indexhtml', path.join(public, "index.html"))
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
creator.fs.commit(() => {
|
|
42
|
-
console.log();
|
|
43
|
-
console.log(`${chalk.grey(`Create project: ${name}`)} ${chalk.green('✔ ')}`);
|
|
44
|
-
|
|
45
|
-
console.log(`${chalk.grey(`Create directory: ${name}/public`)} ${chalk.green('✔ ')}`);
|
|
46
|
-
console.log(`${chalk.grey(`Create file: ${name}/public/index.html`)} ${chalk.green('✔ ')}`);
|
|
47
|
-
|
|
48
|
-
console.log(`${chalk.grey(`Create file: ${name}/src`)} ${chalk.green('✔ ')}`);
|
|
49
|
-
console.log(`${chalk.grey(`Create file: ${name}/src/App.vue`)} ${chalk.green('✔ ')}`);
|
|
50
|
-
console.log(`${chalk.grey(`Create file: ${name}/src/main.js`)} ${chalk.green('✔ ')}`);
|
|
51
|
-
|
|
52
|
-
console.log(`${chalk.grey(`Create file: ${name}/babel.config.js`)} ${chalk.green('✔ ')}`);
|
|
53
|
-
console.log(`${chalk.grey(`Create file: ${name}/package.json`)} ${chalk.green('✔ ')}`);
|
|
54
|
-
console.log(`${chalk.grey(`Create file: ${name}/vue.config.js`)} ${chalk.green('✔ ')}`);
|
|
55
|
-
console.log(`${chalk.grey(`Create file: ${name}/cloudcc-cli.config.js`)} ${chalk.green('✔ ')}`);
|
|
56
|
-
callback();
|
|
57
|
-
});
|
|
1
|
+
const fs = require("fs");
|
|
2
|
+
const chalk = require("chalk")
|
|
3
|
+
const path = require("path")
|
|
4
|
+
module.exports = function (creator, options, callback) {
|
|
5
|
+
const { name, description } = options;
|
|
6
|
+
|
|
7
|
+
const cwd = process.cwd();
|
|
8
|
+
|
|
9
|
+
const projectPath = path.join(cwd, name);
|
|
10
|
+
fs.mkdirSync(projectPath)
|
|
11
|
+
|
|
12
|
+
const src = path.join(projectPath, "src");
|
|
13
|
+
fs.mkdirSync(src)
|
|
14
|
+
|
|
15
|
+
const public = path.join(projectPath, "public");
|
|
16
|
+
fs.mkdirSync(public)
|
|
17
|
+
|
|
18
|
+
creator.copyTpl('cloudcc-cli.configjs', path.join(projectPath, "cloudcc-cli.config.js"))
|
|
19
|
+
|
|
20
|
+
creator.copyTpl('gitignore', path.join(projectPath, ".gitignore"))
|
|
21
|
+
|
|
22
|
+
creator.copyTpl('packagejson', path.join(projectPath, "package.json"), {
|
|
23
|
+
name, description
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
creator.copyTpl('package-lockjson', path.join(projectPath, "package-lock.json"), {
|
|
27
|
+
name, description
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
creator.copyTpl('vueconfigjs', path.join(projectPath, "vue.config.js"))
|
|
31
|
+
|
|
32
|
+
creator.copyTpl('babelconfigjs', path.join(projectPath, "babel.config.js"))
|
|
33
|
+
|
|
34
|
+
creator.copyTpl('mainjs', path.join(src, "main.js"))
|
|
35
|
+
|
|
36
|
+
creator.copyTpl('Appvue', path.join(src, "App.vue"))
|
|
37
|
+
|
|
38
|
+
creator.copyTpl('indexhtml', path.join(public, "index.html"))
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
creator.fs.commit(() => {
|
|
42
|
+
console.log();
|
|
43
|
+
console.log(`${chalk.grey(`Create project: ${name}`)} ${chalk.green('✔ ')}`);
|
|
44
|
+
|
|
45
|
+
console.log(`${chalk.grey(`Create directory: ${name}/public`)} ${chalk.green('✔ ')}`);
|
|
46
|
+
console.log(`${chalk.grey(`Create file: ${name}/public/index.html`)} ${chalk.green('✔ ')}`);
|
|
47
|
+
|
|
48
|
+
console.log(`${chalk.grey(`Create file: ${name}/src`)} ${chalk.green('✔ ')}`);
|
|
49
|
+
console.log(`${chalk.grey(`Create file: ${name}/src/App.vue`)} ${chalk.green('✔ ')}`);
|
|
50
|
+
console.log(`${chalk.grey(`Create file: ${name}/src/main.js`)} ${chalk.green('✔ ')}`);
|
|
51
|
+
|
|
52
|
+
console.log(`${chalk.grey(`Create file: ${name}/babel.config.js`)} ${chalk.green('✔ ')}`);
|
|
53
|
+
console.log(`${chalk.grey(`Create file: ${name}/package.json`)} ${chalk.green('✔ ')}`);
|
|
54
|
+
console.log(`${chalk.grey(`Create file: ${name}/vue.config.js`)} ${chalk.green('✔ ')}`);
|
|
55
|
+
console.log(`${chalk.grey(`Create file: ${name}/cloudcc-cli.config.js`)} ${chalk.green('✔ ')}`);
|
|
56
|
+
callback();
|
|
57
|
+
});
|
|
58
58
|
}
|
package/template/indexhtml
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
-
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
8
|
-
<title>
|
|
9
|
-
Cloudcc Plugin Dev
|
|
10
|
-
</title>
|
|
11
|
-
</head>
|
|
12
|
-
|
|
13
|
-
<body>
|
|
14
|
-
<noscript>
|
|
15
|
-
<strong>We're sorry but Cloudcc Plugin Dev doesn't work properly without JavaScript enabled.
|
|
16
|
-
Please enable it to continue.</strong>
|
|
17
|
-
</noscript>
|
|
18
|
-
<div id="app"></div>
|
|
19
|
-
<!-- built files will be auto injected -->
|
|
20
|
-
</body>
|
|
21
|
-
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="">
|
|
3
|
+
|
|
4
|
+
<head>
|
|
5
|
+
<meta charset="utf-8">
|
|
6
|
+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
7
|
+
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
|
8
|
+
<title>
|
|
9
|
+
Cloudcc Plugin Dev
|
|
10
|
+
</title>
|
|
11
|
+
</head>
|
|
12
|
+
|
|
13
|
+
<body>
|
|
14
|
+
<noscript>
|
|
15
|
+
<strong>We're sorry but Cloudcc Plugin Dev doesn't work properly without JavaScript enabled.
|
|
16
|
+
Please enable it to continue.</strong>
|
|
17
|
+
</noscript>
|
|
18
|
+
<div id="app"></div>
|
|
19
|
+
<!-- built files will be auto injected -->
|
|
20
|
+
</body>
|
|
21
|
+
|
|
22
22
|
</html>
|