cloudcc-cli 1.2.2 → 1.2.3
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/builderPlugin.js +16 -13
- package/utils/checkVersion.js +1 -1
- package/cookies.html +0 -1
package/README.md
CHANGED
package/package.json
CHANGED
package/src/builderPlugin.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const { execSync } = require('child_process');
|
|
1
|
+
const { exec, execSync, spawn, spawnSync } = require('child_process');
|
|
2
2
|
const { post } = require('../utils/http');
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const path = require("path")
|
|
@@ -35,14 +35,12 @@ class Builder {
|
|
|
35
35
|
let item = dirs[i]
|
|
36
36
|
let obj = this.getVueValue(item);
|
|
37
37
|
this.initPluginFile(item, obj.compName);
|
|
38
|
-
this.build(obj)
|
|
39
|
-
await this.upload(obj, config)
|
|
38
|
+
this.build(obj, config)
|
|
40
39
|
}
|
|
41
40
|
} else {
|
|
42
41
|
let obj = this.getVueValue(answers.buildFileName);
|
|
43
42
|
this.initPluginFile(answers.buildFileName, obj.compName);
|
|
44
|
-
this.build(obj)
|
|
45
|
-
await this.upload(obj, config)
|
|
43
|
+
this.build(obj, config)
|
|
46
44
|
}
|
|
47
45
|
}
|
|
48
46
|
}
|
|
@@ -127,15 +125,20 @@ class Builder {
|
|
|
127
125
|
* 编译文件,将vue编译为js文件
|
|
128
126
|
* @param {编译对象信息} obj
|
|
129
127
|
*/
|
|
130
|
-
build(obj) {
|
|
128
|
+
build(obj, config) {
|
|
131
129
|
console.log(chalk.green('编译中,请稍后...'));
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
130
|
+
exec('npx vue-cli-service build --target lib --name ' + obj.compName + ' --dest build plugin/plugin.js', async (error, stdout, stderr) => {
|
|
131
|
+
if (error) {
|
|
132
|
+
console.log('编译失败:', error);
|
|
133
|
+
console.log(chalk.red('编译失败:' + stdout));
|
|
134
|
+
return;
|
|
135
|
+
} else {
|
|
136
|
+
console.log(chalk.green('编译成功!'));
|
|
137
|
+
console.log();
|
|
138
|
+
await this.upload(obj, config)
|
|
139
|
+
fs.unlinkSync('plugin/plugin.js');
|
|
140
|
+
}
|
|
141
|
+
})
|
|
139
142
|
}
|
|
140
143
|
/**
|
|
141
144
|
* 将文件上传
|
package/utils/checkVersion.js
CHANGED
|
@@ -30,7 +30,7 @@ function checkNpmVersion() {
|
|
|
30
30
|
console.log(chalk.green("当前版本:v" + config.version));
|
|
31
31
|
console.log(chalk.green("最新版本:v" + onlineVersion));
|
|
32
32
|
console.log();
|
|
33
|
-
console.log(chalk.yellow(`如无法自动更新,请使用命令更新:npm install -g cloudcc-cli@${onlineVersion} --registry
|
|
33
|
+
console.log(chalk.yellow(`如无法自动更新,请使用命令更新:npm install -g cloudcc-cli@${onlineVersion} --registry http://registry.npmmirror.com`));
|
|
34
34
|
return onlineVersion;
|
|
35
35
|
}
|
|
36
36
|
return null;
|
package/cookies.html
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
1.2.1
|