sparrow-ci 1.0.9 → 1.1.0
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 +2 -1
- package/bin/ci.js +9 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wangqi
|
|
3
3
|
* @Date: 2022-08-12 15:36:41
|
|
4
4
|
* @LastEditors: wangqi
|
|
5
|
-
* @LastEditTime: 2022-09-24 13:
|
|
5
|
+
* @LastEditTime: 2022-09-24 13:15:49
|
|
6
6
|
* @FilePath: /sparrow-ci/README.md
|
|
7
7
|
* @Description: README
|
|
8
8
|
-->
|
|
@@ -69,6 +69,7 @@ module.exports = {
|
|
|
69
69
|
| --git-pull | -g | 拉取远端master代码 |
|
|
70
70
|
| --clone | -c | 克隆文件夹 |
|
|
71
71
|
| --robot | -r | 修改开发者机器人id |
|
|
72
|
+
|
|
72
73
|
比如,上传测试代码:
|
|
73
74
|
|
|
74
75
|
```shell
|
package/bin/ci.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @Author: wangqi
|
|
3
3
|
* @Date: 2022-08-12 15:56:29
|
|
4
4
|
* @LastEditors: wangqi
|
|
5
|
-
* @LastEditTime:
|
|
5
|
+
* @LastEditTime: 2023-02-03 16:40:26
|
|
6
6
|
* @FilePath: /sparrow-ci/bin/ci.js
|
|
7
7
|
* @Description:
|
|
8
8
|
*/
|
|
@@ -43,6 +43,7 @@ class Ci {
|
|
|
43
43
|
subPackages = '';
|
|
44
44
|
mainCliFilePath = '';
|
|
45
45
|
packageJSONPath = '';
|
|
46
|
+
versionJSONPath = '';
|
|
46
47
|
cliFileExisted = false;
|
|
47
48
|
needCheckNpmPackages = [];
|
|
48
49
|
appid = '';
|
|
@@ -65,6 +66,7 @@ class Ci {
|
|
|
65
66
|
this.independentSubPackages = this.subPackages.filter(inPackage => inPackage.independent);
|
|
66
67
|
this.mainCliFilePath = path.join(this.miniprogramRoot, 'cli.js');
|
|
67
68
|
this.packageJSONPath = path.join(this.projectRoot, 'package.json');
|
|
69
|
+
this.versionJSONPath = path.join(this.projectRoot, 'version.json');
|
|
68
70
|
// 独立分包是否存在
|
|
69
71
|
isDependentExisted(this.miniprogramRoot, this.independentSubPackages);
|
|
70
72
|
// cli.js是否存在
|
|
@@ -152,11 +154,11 @@ class Ci {
|
|
|
152
154
|
// 读取cli.js文件的信息
|
|
153
155
|
readCliFile(filePath) {
|
|
154
156
|
const cliFileData = require(filePath);
|
|
155
|
-
const {
|
|
157
|
+
const { version, description } = require(this.versionJSONPath);
|
|
156
158
|
// 把package里的版本和版本描述同步到cli中,当使用cli -u时写入到cli
|
|
157
159
|
// 22.1.8新加miniapp_version
|
|
158
|
-
cliFileData.version =
|
|
159
|
-
cliFileData.description =
|
|
160
|
+
cliFileData.version = version;
|
|
161
|
+
cliFileData.description = description || ''
|
|
160
162
|
this.setConfigInfo(cliFileData);
|
|
161
163
|
}
|
|
162
164
|
|
|
@@ -284,12 +286,11 @@ class Ci {
|
|
|
284
286
|
robotNum: this.robotNum,
|
|
285
287
|
});
|
|
286
288
|
if (type === 'online') return;
|
|
287
|
-
const packageObj = require(this.
|
|
288
|
-
packageObj.miniapp_version = this.version;
|
|
289
|
+
const packageObj = require(this.versionJSONPath);
|
|
289
290
|
packageObj.version = handleVersion(this.version);
|
|
290
|
-
packageObj.
|
|
291
|
+
packageObj.description = this.description;
|
|
291
292
|
const packageStr = JSON.stringify(packageObj, null, 2);
|
|
292
|
-
writeToFile(this.
|
|
293
|
+
writeToFile(this.versionJSONPath, packageStr);
|
|
293
294
|
console.log(`上传成功后可至微信小程序管理后台 ${chalk.blue('https://mp.weixin.qq.com/wxamp/wacodepage/getcodepage')} 将上传的版本选为体验版`);
|
|
294
295
|
}
|
|
295
296
|
|