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.
Files changed (3) hide show
  1. package/README.md +2 -1
  2. package/bin/ci.js +9 -8
  3. 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:11:54
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: 2022-09-24 13:05:17
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 { miniapp_version, version, version_description } = require(this.packageJSONPath);
157
+ const { version, description } = require(this.versionJSONPath);
156
158
  // 把package里的版本和版本描述同步到cli中,当使用cli -u时写入到cli
157
159
  // 22.1.8新加miniapp_version
158
- cliFileData.version = miniapp_version || version;
159
- cliFileData.description = version_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.packageJSONPath);
288
- packageObj.miniapp_version = this.version;
289
+ const packageObj = require(this.versionJSONPath);
289
290
  packageObj.version = handleVersion(this.version);
290
- packageObj.version_description = this.description;
291
+ packageObj.description = this.description;
291
292
  const packageStr = JSON.stringify(packageObj, null, 2);
292
- writeToFile(this.packageJSONPath, packageStr);
293
+ writeToFile(this.versionJSONPath, packageStr);
293
294
  console.log(`上传成功后可至微信小程序管理后台 ${chalk.blue('https://mp.weixin.qq.com/wxamp/wacodepage/getcodepage')} 将上传的版本选为体验版`);
294
295
  }
295
296
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sparrow-ci",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "基于miniprogram-ci开发的小程序命令行工具",
5
5
  "main": "",
6
6
  "bin": {