aiot-toolkit 2.0.6-beta.21 → 2.0.6-beta.22

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 +42 -18
  2. package/lib/bin.js +27 -6
  3. package/package.json +7 -7
package/README.md CHANGED
@@ -74,26 +74,50 @@ aiot-toolkit2.0目前支持的打包格式如下:
74
74
 
75
75
  ## resign
76
76
 
77
- build目录重新生成rpk
78
-
79
- 步骤
80
-
81
- 1. 创建任意名称的空目录, 例如 `folder`
82
- 2. 将 `build` 复制到 `folder`
83
- 3. (可跳过)如需自定义证书,将证书复制到 `folder/sign`
84
- 4. 进入 `folder` 目录,执行 `aiot resign`,会在`foler/dist`中生成rpk
85
- 5. 目录结构如下
86
-
87
- ```sh
88
- folder
89
- build // 用户复制
90
- sign // 用户复制,可选
91
- certificate.pem
92
- private.pem
93
- dist // 生成
94
- ***.rpk
77
+ **rpk解压的代码目录**重新生成rpk
78
+
79
+ ### 示例
80
+
81
+ #### 无参数
82
+
83
+ 1. 创建目录结构如下
84
+
85
+ ```js
86
+ folder
87
+ build // 用户复制:代码目录
88
+ *.js
89
+ sign // 用户复制:证书 (可选)
90
+ certificate.pem
91
+ private.pem
92
+ ```
93
+
94
+ 1. 执行命令:`npx aiot-toolkit resign`
95
+ 1. 产物
96
+
97
+ ```js
98
+ folder
99
+ dist // 生成
100
+ ***.rpk
101
+ ```
102
+
103
+ #### 自定义参数
104
+
105
+ 1. 执行命令:`npx aiot-toolkit resign --source="com.your.app" --output="."`
106
+ 2. 产物:
107
+
108
+ ```js
109
+ com.your.app // 代码目录
110
+ com.your.app.rpk // 产物
95
111
  ```
96
112
 
113
+ ### 参数说明
114
+
115
+ | 名称 | 说明 | 默认值 |
116
+ | ------ | -------- | ------- |
117
+ | source | 代码目录 | `build` |
118
+ | output | 产物目录 | `dist` |
119
+ | sign | 证书目录 | `sign` |
120
+
97
121
  ## jsc
98
122
 
99
123
  指定目录的js文件转换为jsc文件
package/lib/bin.js CHANGED
@@ -176,18 +176,39 @@ async function main() {
176
176
  }, {
177
177
  name: 'resign',
178
178
  description: 'resign build folder to dist/rpk',
179
- action: () => {
179
+ paramList: [{
180
+ name: 'source',
181
+ description: 'build folder to resign',
182
+ defaultValue: 'build',
183
+ type: 'string'
184
+ }, {
185
+ name: 'output',
186
+ description: 'output folder for the resigned build',
187
+ defaultValue: 'dist',
188
+ type: 'string'
189
+ }, {
190
+ name: 'sign',
191
+ description: 'sign folder for the resigned build',
192
+ defaultValue: 'sign',
193
+ type: 'string'
194
+ }],
195
+ action: option => {
196
+ const {
197
+ source,
198
+ output,
199
+ sign
200
+ } = option;
180
201
  const projectPath = process.cwd();
181
202
  const param = {
182
- signRoot: 'sign',
203
+ signRoot: sign,
183
204
  mode: _aiotpack.CompileMode.DEVELOPMENT,
184
- outputPath: 'build',
185
- releasePath: 'dist',
205
+ outputPath: source,
206
+ releasePath: output,
186
207
  projectPath,
187
208
  buildNameFormat: _BuildNameFormatType.default.DEFAULT,
188
- sourceRoot: 'build'
209
+ sourceRoot: source
189
210
  };
190
- return _ZipUtil.default.createRpk(projectPath + '/build', param);
211
+ return _ZipUtil.default.createRpk(_path.default.join(projectPath, source), param);
191
212
  }
192
213
  }, {
193
214
  name: 'jsc',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiot-toolkit",
3
- "version": "2.0.6-beta.21",
3
+ "version": "2.0.6-beta.22",
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.6-beta.21",
26
- "@aiot-toolkit/commander": "2.0.6-beta.21",
27
- "@aiot-toolkit/emulator": "2.0.6-beta.21",
28
- "@aiot-toolkit/shared-utils": "2.0.6-beta.21",
25
+ "@aiot-toolkit/aiotpack": "2.0.6-beta.22",
26
+ "@aiot-toolkit/commander": "2.0.6-beta.22",
27
+ "@aiot-toolkit/emulator": "2.0.6-beta.22",
28
+ "@aiot-toolkit/shared-utils": "2.0.6-beta.22",
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.6-beta.21",
32
+ "file-lane": "2.0.6-beta.22",
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": "9294502171d727985c7a28a4a6f0c4a291623309"
46
+ "gitHead": "36e03348be739bca8665d981ce33d4d3f8cc4df5"
47
47
  }