aiot-toolkit 2.0.2-beta.18 → 2.0.2-beta.19

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 CHANGED
@@ -1,44 +1,44 @@
1
- # 项目介绍
2
-
3
- aiot-toolkit 2.0 是将 **源码项目** 转换为 **目标代码项目** 并生成 **目标代码应用** 的命令行工具,同时配备了 **模拟器** 相关功能供开发者使用。
4
-
5
- aiot-toolkit2.0目前支持的打包格式如下:
6
-
7
- - ux:vela 平台下的应用,目前大量使用于小米手表、音箱等智能穿戴及物联网设备
8
-
9
- ## 安装使用
10
-
11
- - 全局安装
12
-
13
- `npm i aiot-toolkit -g`
14
-
15
- `npm i create-aiot -g`
16
-
17
- - 创建项目
18
-
19
- 1. `create-aiot ux`
20
- 2. 在项目根目录执行:`npm i`
21
-
22
- - 本机运行项目
23
-
24
- 在项目根目录执行 `aiot start`,此会启动模拟器,并运行项目
25
-
26
- * 打包项目
27
-
28
- 在项目根目录执行 `aiot release`
29
-
30
- ## 常用命令
31
-
32
- | 命令 | 说明 |
33
- | ------------------------ | ------------------------ |
34
- | npm create aiot | 创建并手动选择项目 |
35
- | npm create aiot xts | 创建xts项目 |
36
- | npm create aiot ux | 创建ux项目 |
37
- | aiot build | 构建项目 |
38
- | aiot release | 构建项目-release模式 |
39
- | aiot start | 构建项目并运行到模拟器 |
40
- | aiot getConnectedDevices | 获取已连接设备列表 |
41
- | aiot getPlatforms | 获取设置平台 |
42
- | aiot installDbgAndMkp | 在真机上安装快应用调试器 |
43
- | aiot createVelaAvd | 创建 vela 模拟器 |
44
- | aiot deleteVelaAvd | 删除 vela 模拟器 |
1
+ # 项目介绍
2
+
3
+ aiot-toolkit 2.0 是将 **源码项目** 转换为 **目标代码项目** 并生成 **目标代码应用** 的命令行工具,同时配备了 **模拟器** 相关功能供开发者使用。
4
+
5
+ aiot-toolkit2.0目前支持的打包格式如下:
6
+
7
+ - ux:vela 平台下的应用,目前大量使用于小米手表、音箱等智能穿戴及物联网设备
8
+
9
+ ## 安装使用
10
+
11
+ - 全局安装
12
+
13
+ `npm i aiot-toolkit -g`
14
+
15
+ `npm i create-aiot -g`
16
+
17
+ - 创建项目
18
+
19
+ 1. `create-aiot ux`
20
+ 2. 在项目根目录执行:`npm i`
21
+
22
+ - 本机运行项目
23
+
24
+ 在项目根目录执行 `aiot start`,此会启动模拟器,并运行项目
25
+
26
+ * 打包项目
27
+
28
+ 在项目根目录执行 `aiot release`
29
+
30
+ ## 常用命令
31
+
32
+ | 命令 | 说明 |
33
+ | ------------------------ | ------------------------ |
34
+ | npm create aiot | 创建并手动选择项目 |
35
+ | npm create aiot xts | 创建xts项目 |
36
+ | npm create aiot ux | 创建ux项目 |
37
+ | aiot build | 构建项目 |
38
+ | aiot release | 构建项目-release模式 |
39
+ | aiot start | 构建项目并运行到模拟器 |
40
+ | aiot getConnectedDevices | 获取已连接设备列表 |
41
+ | aiot getPlatforms | 获取设置平台 |
42
+ | aiot installDbgAndMkp | 在真机上安装快应用调试器 |
43
+ | aiot createVelaAvd | 创建 vela 模拟器 |
44
+ | aiot deleteVelaAvd | 删除 vela 模拟器 |
@@ -1,167 +1,167 @@
1
- .alert-warning {
2
- color: #8a6d3b;
3
- background-color: #fcf8e3;
4
- border-color: #faebcc;
5
- text-align: left;
6
- }
7
-
8
- .alert {
9
- padding: 8px;
10
- margin: 10px auto;
11
- width: 400px;
12
- min-width: 350px;
13
- border: 1px solid transparent;
14
- border-radius: 6px;
15
- box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
16
- }
17
-
18
- .alert p {
19
- margin: 6px;
20
- }
21
-
22
- .panel-default {
23
- border-color: #ddd;
24
- }
25
-
26
- .panel {
27
- margin-bottom: 20px;
28
- background-color: #fff;
29
- border-radius: 4px;
30
- -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
31
- box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
32
- margin: 10px auto;
33
- box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
34
- width: 400px;
35
- min-width: 350px;
36
- padding: 8px;
37
- }
38
-
39
- .panel-default > .panel-heading {
40
- color: #333;
41
- border-color: #ddd;
42
- text-align: left;
43
- }
44
-
45
- .panel-heading {
46
- padding: 8px 15px;
47
- border-bottom: 1px solid transparent;
48
- border-top-left-radius: 3px;
49
- border-top-right-radius: 3px;
50
- }
51
-
52
- .table {
53
- width: 100%;
54
- max-width: 100%;
55
- margin: 6px;
56
- background-color: transparent;
57
- border-spacing: 0;
58
- border-collapse: collapse;
59
- }
60
-
61
- .table td {
62
- color: black;
63
- text-shadow: none;
64
- text-align: left;
65
- }
66
-
67
- .table td.tname {
68
- width: 70%;
69
- }
70
-
71
- body {
72
- margin: 0;
73
- display: block;
74
- position: absolute;
75
- top: 0;
76
- bottom: 0;
77
- left: 0;
78
- right: 0;
79
- }
80
-
81
- .hide {
82
- display: none !important;
83
- }
84
-
85
- .qr-code-panel {
86
- text-align: center;
87
- display: flex;
88
- flex-direction: column;
89
- }
90
-
91
- .qr-code-panel .qr-img {
92
- margin: 10px 200px;
93
- min-width: 350px;
94
- }
95
-
96
- .bd-bg {
97
- position: relative;
98
- padding: 40px 0;
99
- color: black;
100
- text-align: center;
101
- background: #eee;
102
- }
103
-
104
- .updatetip-link {
105
- padding: 0 5px;
106
- }
107
-
108
- table.tunning tr {
109
- padding: 8px 15px;
110
- }
111
-
112
- .btn {
113
- display: inline-block;
114
- padding: 6px 12px;
115
- margin-bottom: 0;
116
- font-size: 14px;
117
- font-weight: 400;
118
- line-height: 1.42857143;
119
- text-align: center;
120
- white-space: nowrap;
121
- vertical-align: middle;
122
- -ms-touch-action: manipulation;
123
- touch-action: manipulation;
124
- cursor: pointer;
125
- -webkit-user-select: none;
126
- -moz-user-select: none;
127
- -ms-user-select: none;
128
- user-select: none;
129
- background-image: none;
130
- border: 1px solid transparent;
131
- border-radius: 4px;
132
- margin-left: 5px;
133
- }
134
-
135
- .btn-default {
136
- color: #333;
137
- background-color: #fff;
138
- border-color: #ccc;
139
- }
140
-
141
- .label {
142
- display: inline;
143
- padding: 0.7em;
144
- font-size: 75%;
145
- font-weight: 700;
146
- line-height: 1;
147
- color: #fff;
148
- text-align: center;
149
- text-decoration: none;
150
- white-space: nowrap;
151
- vertical-align: baseline;
152
- border-radius: 0.25em;
153
- }
154
-
155
- .label-info {
156
- background-color: #5bc0de;
157
- }
158
- .block {
159
- width: 420px;
160
- }
161
- .block .block-title {
162
- font-size: 16px;
163
- margin: 0.5em 0;
164
- }
165
- .block a {
166
- color: #0055ff;
167
- }
1
+ .alert-warning {
2
+ color: #8a6d3b;
3
+ background-color: #fcf8e3;
4
+ border-color: #faebcc;
5
+ text-align: left;
6
+ }
7
+
8
+ .alert {
9
+ padding: 8px;
10
+ margin: 10px auto;
11
+ width: 400px;
12
+ min-width: 350px;
13
+ border: 1px solid transparent;
14
+ border-radius: 6px;
15
+ box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
16
+ }
17
+
18
+ .alert p {
19
+ margin: 6px;
20
+ }
21
+
22
+ .panel-default {
23
+ border-color: #ddd;
24
+ }
25
+
26
+ .panel {
27
+ margin-bottom: 20px;
28
+ background-color: #fff;
29
+ border-radius: 4px;
30
+ -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
31
+ box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05);
32
+ margin: 10px auto;
33
+ box-shadow: 0 6px 10px rgba(0, 0, 0, 0.15);
34
+ width: 400px;
35
+ min-width: 350px;
36
+ padding: 8px;
37
+ }
38
+
39
+ .panel-default > .panel-heading {
40
+ color: #333;
41
+ border-color: #ddd;
42
+ text-align: left;
43
+ }
44
+
45
+ .panel-heading {
46
+ padding: 8px 15px;
47
+ border-bottom: 1px solid transparent;
48
+ border-top-left-radius: 3px;
49
+ border-top-right-radius: 3px;
50
+ }
51
+
52
+ .table {
53
+ width: 100%;
54
+ max-width: 100%;
55
+ margin: 6px;
56
+ background-color: transparent;
57
+ border-spacing: 0;
58
+ border-collapse: collapse;
59
+ }
60
+
61
+ .table td {
62
+ color: black;
63
+ text-shadow: none;
64
+ text-align: left;
65
+ }
66
+
67
+ .table td.tname {
68
+ width: 70%;
69
+ }
70
+
71
+ body {
72
+ margin: 0;
73
+ display: block;
74
+ position: absolute;
75
+ top: 0;
76
+ bottom: 0;
77
+ left: 0;
78
+ right: 0;
79
+ }
80
+
81
+ .hide {
82
+ display: none !important;
83
+ }
84
+
85
+ .qr-code-panel {
86
+ text-align: center;
87
+ display: flex;
88
+ flex-direction: column;
89
+ }
90
+
91
+ .qr-code-panel .qr-img {
92
+ margin: 10px 200px;
93
+ min-width: 350px;
94
+ }
95
+
96
+ .bd-bg {
97
+ position: relative;
98
+ padding: 40px 0;
99
+ color: black;
100
+ text-align: center;
101
+ background: #eee;
102
+ }
103
+
104
+ .updatetip-link {
105
+ padding: 0 5px;
106
+ }
107
+
108
+ table.tunning tr {
109
+ padding: 8px 15px;
110
+ }
111
+
112
+ .btn {
113
+ display: inline-block;
114
+ padding: 6px 12px;
115
+ margin-bottom: 0;
116
+ font-size: 14px;
117
+ font-weight: 400;
118
+ line-height: 1.42857143;
119
+ text-align: center;
120
+ white-space: nowrap;
121
+ vertical-align: middle;
122
+ -ms-touch-action: manipulation;
123
+ touch-action: manipulation;
124
+ cursor: pointer;
125
+ -webkit-user-select: none;
126
+ -moz-user-select: none;
127
+ -ms-user-select: none;
128
+ user-select: none;
129
+ background-image: none;
130
+ border: 1px solid transparent;
131
+ border-radius: 4px;
132
+ margin-left: 5px;
133
+ }
134
+
135
+ .btn-default {
136
+ color: #333;
137
+ background-color: #fff;
138
+ border-color: #ccc;
139
+ }
140
+
141
+ .label {
142
+ display: inline;
143
+ padding: 0.7em;
144
+ font-size: 75%;
145
+ font-weight: 700;
146
+ line-height: 1;
147
+ color: #fff;
148
+ text-align: center;
149
+ text-decoration: none;
150
+ white-space: nowrap;
151
+ vertical-align: baseline;
152
+ border-radius: 0.25em;
153
+ }
154
+
155
+ .label-info {
156
+ background-color: #5bc0de;
157
+ }
158
+ .block {
159
+ width: 420px;
160
+ }
161
+ .block .block-title {
162
+ font-size: 16px;
163
+ margin: 0.5em 0;
164
+ }
165
+ .block a {
166
+ color: #0055ff;
167
+ }
@@ -1,58 +1,58 @@
1
- <!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="UTF-8" />
5
- <title>调试器</title>
6
- <link href="./index.css" rel="stylesheet" />
7
- </head>
8
- <body class="bd-bg">
9
- <section class="qr-code-wrapper">
10
- <div>
11
- <div class="qr-code-panel">
12
- <div class="qr-img">
13
- <img src="" id="j-qr-icon" class="qr-icon" />
14
- </div>
15
- <div class="block alert alert-warning updatetip">
16
- <div class="block">
17
- <h2 class="block-title" title="在设备上预览">手机预览</h2>
18
- <p>1. 扫码安装rpk包</p>
19
- <p>
20
- 2. 在手机的调试器上点击
21
- <button class="btn btn-default">开始调试</button> ,启动调试界面
22
- </p>
23
- </div>
24
- <!-- <div class="block">
25
- <h2 class="block-title" title="在浏览器中预览">web 预览</h2>
26
- <p><a href="/preview" target="_blank">打开 web 预览</a></p>
27
- </div> -->
28
- </div>
29
- </div>
30
- </div>
31
- </section>
32
- <section class="inform-tip-wrapper"></section>
33
- <section class="result inspector-link-panel hide">
34
- <div class="panel panel-default">
35
- <div class="panel-heading">调试</div>
36
- <div class="panel-body">
37
- <table class="table tunning">
38
- <tbody></tbody>
39
- </table>
40
- </div>
41
- </div>
42
- </section>
43
- <script type="text/template" id="j-tpl-appinfo">
44
- <tr>
45
- <td class="tname">{{data_app_name}}</td>
46
- <td class="tlink"><a href='{{data_href_value}}' target='_blank' class="label label-info">{{data_href_name}}</a>
47
- </td>
48
- </tr>
49
- </script>
50
- <script src="./index.js"></script>
51
- <script type="text/template" id="j-tpl-updatetip">
52
- <div class="alert alert-warning updatetip">
53
- <p>调试器已有重要更新,请更新调试器</p>
54
- </div>
55
- </script>
56
- <script src="/socket.io/socket.io.js"></script>
57
- </body>
58
- </html>
1
+ <!doctype html>
2
+ <html>
3
+ <head>
4
+ <meta charset="UTF-8" />
5
+ <title>调试器</title>
6
+ <link href="./index.css" rel="stylesheet" />
7
+ </head>
8
+ <body class="bd-bg">
9
+ <section class="qr-code-wrapper">
10
+ <div>
11
+ <div class="qr-code-panel">
12
+ <div class="qr-img">
13
+ <img src="" id="j-qr-icon" class="qr-icon" />
14
+ </div>
15
+ <div class="block alert alert-warning updatetip">
16
+ <div class="block">
17
+ <h2 class="block-title" title="在设备上预览">手机预览</h2>
18
+ <p>1. 扫码安装rpk包</p>
19
+ <p>
20
+ 2. 在手机的调试器上点击
21
+ <button class="btn btn-default">开始调试</button> ,启动调试界面
22
+ </p>
23
+ </div>
24
+ <!-- <div class="block">
25
+ <h2 class="block-title" title="在浏览器中预览">web 预览</h2>
26
+ <p><a href="/preview" target="_blank">打开 web 预览</a></p>
27
+ </div> -->
28
+ </div>
29
+ </div>
30
+ </div>
31
+ </section>
32
+ <section class="inform-tip-wrapper"></section>
33
+ <section class="result inspector-link-panel hide">
34
+ <div class="panel panel-default">
35
+ <div class="panel-heading">调试</div>
36
+ <div class="panel-body">
37
+ <table class="table tunning">
38
+ <tbody></tbody>
39
+ </table>
40
+ </div>
41
+ </div>
42
+ </section>
43
+ <script type="text/template" id="j-tpl-appinfo">
44
+ <tr>
45
+ <td class="tname">{{data_app_name}}</td>
46
+ <td class="tlink"><a href='{{data_href_value}}' target='_blank' class="label label-info">{{data_href_name}}</a>
47
+ </td>
48
+ </tr>
49
+ </script>
50
+ <script src="./index.js"></script>
51
+ <script type="text/template" id="j-tpl-updatetip">
52
+ <div class="alert alert-warning updatetip">
53
+ <p>调试器已有重要更新,请更新调试器</p>
54
+ </div>
55
+ </script>
56
+ <script src="/socket.io/socket.io.js"></script>
57
+ </body>
58
+ </html>
@@ -1,66 +1,66 @@
1
- /**
2
- * Copyright (C) 2017, hapjs.org. All rights reserved.
3
- */
4
-
5
- const $ = (selector, elem) => {
6
- return typeof elem === 'undefined'
7
- ? document.querySelector(selector)
8
- : elem.querySelector(selector)
9
- }
10
-
11
- function init() {
12
- const qrImgId = '#j-qr-icon'
13
- const $qrCodeImg = $(qrImgId)
14
- const timeStamp = Date.now() % 1e5
15
- $qrCodeImg.src = `/qrcode?ws_id=${timeStamp}`
16
- bindEvents()
17
- }
18
-
19
- function bindEvents() {
20
- const socket = io(location.origin) // eslint-disable-line no-undef
21
-
22
- socket.on('appRegistered', (data) => {
23
- console.info(`on receiving appRegistered message: ${JSON.stringify(data)}`)
24
- updateTableElement(data)
25
- })
26
- socket.on('informUpdate', () => {
27
- console.info('on receiving informUpdate')
28
- appendUpdateInfo()
29
- })
30
- }
31
-
32
- /**
33
- * 更新页面调试信息
34
- * @param data{ inspectorUrl, application }
35
- */
36
- function updateTableElement(data) {
37
- const wrapper = '.inspector-link-panel'
38
- const tplId = '#j-tpl-appinfo'
39
- const $panelWrapper = $(wrapper)
40
- const $tplAppInfoElem = $(tplId)
41
- const $tbodyElem = $('tbody', $panelWrapper)
42
- let tplTextContent = $tplAppInfoElem.textContent
43
-
44
- $panelWrapper.classList.add('hide')
45
- const dataToFill = {
46
- data_app_name: data.application,
47
- data_href_value: data.inspectorUrl,
48
- data_href_name: 'Enter the debug page'
49
- }
50
- Object.keys(dataToFill).forEach((key) => {
51
- tplTextContent = tplTextContent.replace(`{{${key}}}`, dataToFill[key])
52
- })
53
-
54
- $tbodyElem.innerHTML = tplTextContent
55
- $panelWrapper.classList.remove('hide')
56
- }
57
-
58
- function appendUpdateInfo() {
59
- const tplId = '#j-tpl-updatetip'
60
- const wrapper = '.inform-tip-wrapper'
61
- const $tplUpdateTipElem = $(tplId)
62
- const $panelWrapper = $(wrapper)
63
- $panelWrapper.innerHTML = $tplUpdateTipElem.textContent
64
- }
65
-
66
- init()
1
+ /**
2
+ * Copyright (C) 2017, hapjs.org. All rights reserved.
3
+ */
4
+
5
+ const $ = (selector, elem) => {
6
+ return typeof elem === 'undefined'
7
+ ? document.querySelector(selector)
8
+ : elem.querySelector(selector)
9
+ }
10
+
11
+ function init() {
12
+ const qrImgId = '#j-qr-icon'
13
+ const $qrCodeImg = $(qrImgId)
14
+ const timeStamp = Date.now() % 1e5
15
+ $qrCodeImg.src = `/qrcode?ws_id=${timeStamp}`
16
+ bindEvents()
17
+ }
18
+
19
+ function bindEvents() {
20
+ const socket = io(location.origin) // eslint-disable-line no-undef
21
+
22
+ socket.on('appRegistered', (data) => {
23
+ console.info(`on receiving appRegistered message: ${JSON.stringify(data)}`)
24
+ updateTableElement(data)
25
+ })
26
+ socket.on('informUpdate', () => {
27
+ console.info('on receiving informUpdate')
28
+ appendUpdateInfo()
29
+ })
30
+ }
31
+
32
+ /**
33
+ * 更新页面调试信息
34
+ * @param data{ inspectorUrl, application }
35
+ */
36
+ function updateTableElement(data) {
37
+ const wrapper = '.inspector-link-panel'
38
+ const tplId = '#j-tpl-appinfo'
39
+ const $panelWrapper = $(wrapper)
40
+ const $tplAppInfoElem = $(tplId)
41
+ const $tbodyElem = $('tbody', $panelWrapper)
42
+ let tplTextContent = $tplAppInfoElem.textContent
43
+
44
+ $panelWrapper.classList.add('hide')
45
+ const dataToFill = {
46
+ data_app_name: data.application,
47
+ data_href_value: data.inspectorUrl,
48
+ data_href_name: 'Enter the debug page'
49
+ }
50
+ Object.keys(dataToFill).forEach((key) => {
51
+ tplTextContent = tplTextContent.replace(`{{${key}}}`, dataToFill[key])
52
+ })
53
+
54
+ $tbodyElem.innerHTML = tplTextContent
55
+ $panelWrapper.classList.remove('hide')
56
+ }
57
+
58
+ function appendUpdateInfo() {
59
+ const tplId = '#j-tpl-updatetip'
60
+ const wrapper = '.inform-tip-wrapper'
61
+ const $tplUpdateTipElem = $(tplId)
62
+ const $panelWrapper = $(wrapper)
63
+ $panelWrapper.innerHTML = $tplUpdateTipElem.textContent
64
+ }
65
+
66
+ init()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aiot-toolkit",
3
- "version": "2.0.2-beta.18",
3
+ "version": "2.0.2-beta.19",
4
4
  "description": "Tools for creating, developing, and packaging aiot applications.",
5
5
  "keywords": [
6
6
  "aiot"
@@ -21,19 +21,19 @@
21
21
  "test": "node ./__tests__/aiot-toolkit.test.js"
22
22
  },
23
23
  "dependencies": {
24
- "@aiot-toolkit/aiotpack": "2.0.2-beta.18",
25
- "@aiot-toolkit/commander": "2.0.2-beta.18",
26
- "@aiot-toolkit/emulator": "2.0.2-beta.18",
27
- "@aiot-toolkit/shared-utils": "2.0.2-beta.18",
24
+ "@aiot-toolkit/aiotpack": "2.0.2-beta.19",
25
+ "@aiot-toolkit/commander": "2.0.2-beta.19",
26
+ "@aiot-toolkit/emulator": "2.0.2-beta.19",
27
+ "@aiot-toolkit/shared-utils": "2.0.2-beta.19",
28
28
  "@inquirer/prompts": "^5.3.0",
29
29
  "@miwt/adb": "^0.9.0",
30
30
  "adm-zip": "^0.5.10",
31
31
  "axios": "^1.7.4",
32
32
  "cli-progress": "^3.12.0",
33
33
  "dayjs": "^1.11.10",
34
- "file-lane": "2.0.2-beta.18",
34
+ "file-lane": "2.0.2-beta.19",
35
35
  "fs-extra": "^11.2.0",
36
- "koa-router": "^12.0.1",
36
+ "koa-router": "^13.0.1",
37
37
  "lodash": "^4.17.21",
38
38
  "portfinder": "^1.0.32",
39
39
  "qr-image": "^3.2.0",
@@ -48,5 +48,5 @@
48
48
  "@types/semver": "^7.5.8",
49
49
  "@types/ws": "^8.5.10"
50
50
  },
51
- "gitHead": "b73a79ef04edac808f316bf8b8fb1718422daa1c"
51
+ "gitHead": "7c6ed600fe84ee9de9b00c6e95dfabf3bfb3ad65"
52
52
  }