cloudcc-cli 1.9.4 → 1.9.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.
- package/README.md +7 -0
- package/package.json +1 -1
- package/src/plugin/create1.js +21 -2
package/README.md
CHANGED
package/package.json
CHANGED
package/src/plugin/create1.js
CHANGED
|
@@ -9,12 +9,16 @@ const chalk = require("chalk")
|
|
|
9
9
|
async function create(name) {
|
|
10
10
|
const temp = `<template>
|
|
11
11
|
<div class="cc-container">
|
|
12
|
-
|
|
12
|
+
<HelloWorld />
|
|
13
13
|
</div>
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script>
|
|
17
|
+
import HelloWorld from "./components/HelloWorld.vue";
|
|
17
18
|
export default {
|
|
19
|
+
components: {
|
|
20
|
+
HelloWorld,
|
|
21
|
+
},
|
|
18
22
|
data() {
|
|
19
23
|
return {
|
|
20
24
|
componentInfo: {
|
|
@@ -37,13 +41,28 @@ data() {
|
|
|
37
41
|
background: goldenrod;
|
|
38
42
|
}
|
|
39
43
|
</style>`
|
|
44
|
+
|
|
45
|
+
const temp1 = `
|
|
46
|
+
<template>
|
|
47
|
+
<div>Hello world</div>
|
|
48
|
+
</template>
|
|
49
|
+
|
|
50
|
+
<script>
|
|
51
|
+
export default {};
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<style lang="scss" scoped>
|
|
55
|
+
</style>
|
|
56
|
+
`
|
|
40
57
|
let res = await checkUpdate();
|
|
41
58
|
if (!res) {
|
|
42
59
|
|
|
43
|
-
const pluginPath = path.join(process.cwd(), "plugins
|
|
60
|
+
const pluginPath = path.join(process.cwd(), "plugins", name);
|
|
44
61
|
try {
|
|
45
62
|
fs.mkdirSync(pluginPath, { recursive: true })
|
|
46
63
|
fs.writeFileSync(path.join(pluginPath, name + ".vue"), temp)
|
|
64
|
+
fs.mkdirSync(path.join(pluginPath, "components"), { recursive: true })
|
|
65
|
+
fs.writeFileSync(path.join(pluginPath, "components", "HelloWorld.vue"), temp1)
|
|
47
66
|
fs.writeFileSync(path.join(pluginPath, "config.json"), `{"component":"component-${name}","compName":"compName-${name}","compDesc":"Component description information"}`)
|
|
48
67
|
console.log()
|
|
49
68
|
console.log(chalk.green("Successfully Created:" + name))
|