aiot-toolkit 2.0.4-beta.4 → 2.0.4-beta.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.
Files changed (3) hide show
  1. package/README.md +35 -12
  2. package/lib/bin.js +18 -0
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -38,18 +38,19 @@ aiot-toolkit2.0目前支持的打包格式如下:
38
38
 
39
39
  ## 常用命令
40
40
 
41
- | 命令 | 说明 |
42
- | ------------------------ | ------------------------ |
43
- | npm create aiot | 创建并手动选择项目 |
44
- | npm create aiot ux | 创建ux项目 |
45
- | aiot build | 构建项目 |
46
- | aiot release | 构建项目-release模式 |
47
- | aiot start | 构建项目并运行到模拟器 |
48
- | aiot getConnectedDevices | 获取已连接设备列表 |
49
- | aiot getPlatforms | 获取设置平台 |
50
- | aiot installDbgAndMkp | 在真机上安装快应用调试器 |
51
- | aiot createVVD | 创建 vela 模拟器 |
52
- | aiot deleteVVD | 删除 vela 模拟器 |
41
+ | 命令 | 说明 |
42
+ | ------------------------ | ---------------------------------------------- |
43
+ | npm create aiot | 创建并手动选择项目 |
44
+ | npm create aiot ux | 创建ux项目 |
45
+ | aiot build | 构建项目 |
46
+ | aiot release | 构建项目-release模式 |
47
+ | aiot start | 构建项目并运行到模拟器 |
48
+ | aiot getConnectedDevices | 获取已连接设备列表 |
49
+ | aiot getPlatforms | 获取设置平台 |
50
+ | aiot installDbgAndMkp | 在真机上安装快应用调试器 |
51
+ | aiot createVVD | 创建 vela 模拟器 |
52
+ | aiot deleteVVD | 删除 vela 模拟器 |
53
+ | aiot resign | build目录重新生成rpk, 详情: [resign](#resign) |
53
54
 
54
55
  ## build 参数
55
56
 
@@ -66,3 +67,25 @@ aiot-toolkit2.0目前支持的打包格式如下:
66
67
  | *start-page* | string | 启动页面,示例:`--start-page 'pages/index?a=1&b=2'` | | |
67
68
  | *~~enable-custom-component~~* | confirm | **已废弃** | | |
68
69
  | *~~stats~~* | confirm | **已废弃** | | |
70
+
71
+ ## resign
72
+
73
+ build目录重新生成rpk
74
+
75
+ 步骤
76
+
77
+ 1. 创建任意名称的空目录, 例如 `folder`
78
+ 2. 将 `build` 复制到 `folder`
79
+ 3. (可跳过)如需自定义证书,将证书复制到 `folder/sign`
80
+ 4. 进入 `folder` 目录,执行 `aiot resign`,会在`foler/dist`中生成rpk
81
+ 5. 目录结构如下
82
+
83
+ ```sh
84
+ folder
85
+ build // 用户复制
86
+ sign // 用户复制,可选
87
+ certificate.pem
88
+ private.pem
89
+ dist // 生成
90
+ ***.rpk
91
+ ```
package/lib/bin.js CHANGED
@@ -13,6 +13,8 @@ var _VelaUxStarter = _interopRequireDefault(require("./starter/VelaUxStarter"));
13
13
  var _XtsStarter = _interopRequireDefault(require("./starter/XtsStarter"));
14
14
  var _DeviceUtil = _interopRequireDefault(require("./utils/DeviceUtil"));
15
15
  var _VelaAvdUtils = _interopRequireDefault(require("./utils/VelaAvdUtils"));
16
+ var _ZipUtil = _interopRequireDefault(require("@aiot-toolkit/aiotpack/lib/compiler/javascript/vela/utils/ZipUtil"));
17
+ var _BuildNameFormatType = _interopRequireDefault(require("@aiot-toolkit/aiotpack/lib/compiler/javascript/vela/enum/BuildNameFormatType"));
16
18
  function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
17
19
  // 支持的最低node版本
18
20
  const NODE_MINIMUM_VERSION = '18.0.0';
@@ -169,6 +171,22 @@ async function main() {
169
171
  action: async () => {
170
172
  _VelaAvdUtils.default.initEmulatorEnv();
171
173
  }
174
+ }, {
175
+ name: 'resign',
176
+ description: 'resign build folder to dist/rpk',
177
+ action: () => {
178
+ const projectPath = process.cwd();
179
+ const param = {
180
+ signRoot: 'sign',
181
+ mode: _aiotpack.CompileMode.DEVELOPMENT,
182
+ outputPath: 'build',
183
+ releasePath: 'dist',
184
+ projectPath,
185
+ buildNameFormat: _BuildNameFormatType.default.DEFAULT,
186
+ sourceRoot: 'build'
187
+ };
188
+ return _ZipUtil.default.createRpk(projectPath + '/build', param);
189
+ }
172
190
  }]
173
191
  };
174
192
  _commander.Command.registeProgram(config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiot-toolkit",
3
- "version": "2.0.4-beta.4",
3
+ "version": "2.0.4-beta.5",
4
4
  "description": "Tools for creating, developing, and packaging aiot applications.",
5
5
  "keywords": [
6
6
  "aiot"
@@ -22,14 +22,14 @@
22
22
  "test": "node ./__tests__/aiot-toolkit.test.js"
23
23
  },
24
24
  "dependencies": {
25
- "@aiot-toolkit/aiotpack": "2.0.4-beta.4",
26
- "@aiot-toolkit/commander": "2.0.4-beta.4",
27
- "@aiot-toolkit/emulator": "2.0.4-beta.4",
28
- "@aiot-toolkit/shared-utils": "2.0.4-beta.4",
25
+ "@aiot-toolkit/aiotpack": "2.0.4-beta.5",
26
+ "@aiot-toolkit/commander": "2.0.4-beta.5",
27
+ "@aiot-toolkit/emulator": "2.0.4-beta.5",
28
+ "@aiot-toolkit/shared-utils": "2.0.4-beta.5",
29
29
  "@inquirer/prompts": "^5.3.0",
30
30
  "@miwt/adb": "^0.9.0",
31
31
  "axios": "^1.7.4",
32
- "file-lane": "2.0.4-beta.4",
32
+ "file-lane": "2.0.4-beta.5",
33
33
  "fs-extra": "^11.2.0",
34
34
  "koa-router": "^13.0.1",
35
35
  "lodash": "^4.17.21",
@@ -43,5 +43,5 @@
43
43
  "@types/qr-image": "^3.2.9",
44
44
  "@types/semver": "^7.5.8"
45
45
  },
46
- "gitHead": "f06b80be7d99c43f88db001415c0eb15acb65286"
46
+ "gitHead": "10c27c5047aa68522c09dc54c79d283b39b1fd8a"
47
47
  }