create-aiot 2.0.2-beta.17 → 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.
Files changed (30) hide show
  1. package/README.md +26 -26
  2. package/lib/interface/IProjectParam.d.ts +9 -0
  3. package/lib/template/template.json +27 -27
  4. package/lib/template/ux/android-demo/README.md +25 -25
  5. package/lib/template/ux/android-demo/_gitignore +4 -4
  6. package/lib/template/ux/android-demo/package.json +17 -17
  7. package/lib/template/ux/android-demo/src/CardDemo/index.ux +24 -24
  8. package/lib/template/ux/android-demo/src/Demo/index.ux +48 -48
  9. package/lib/template/ux/android-demo/src/DemoDetail/index.ux +27 -27
  10. package/lib/template/ux/android-demo/src/app.ux +14 -14
  11. package/lib/template/ux/android-demo/src/global.js +34 -34
  12. package/lib/template/ux/android-demo/src/manifest.json +56 -56
  13. package/lib/template/ux/android-demo/src/sitemap.json +4 -4
  14. package/lib/template/ux/vela-demo/README.md +25 -25
  15. package/lib/template/ux/vela-demo/_gitignore +4 -4
  16. package/lib/template/ux/vela-demo/package.json +18 -18
  17. package/lib/template/ux/vela-demo/src/app.ux +9 -9
  18. package/lib/template/ux/vela-demo/src/manifest.json +31 -31
  19. package/lib/template/ux/vela-demo/src/pages/detail/detail.ux +25 -25
  20. package/lib/template/ux/vela-demo/src/pages/index/index.ux +49 -49
  21. package/lib/template/xts/app-package-name/_gitignore +3 -3
  22. package/lib/template/xts/app-package-name/app/app.xts +16 -16
  23. package/lib/template/xts/app-package-name/app/manifest.json +68 -68
  24. package/lib/template/xts/aspect1/config.json +8 -8
  25. package/lib/template/xts/aspect1/src/aspect.xts +16 -16
  26. package/lib/template/xts/aspect1/src/manifest.json +21 -21
  27. package/lib/template/xts/aspect1/src/pages/Home.xts +34 -34
  28. package/lib/utils/TemplateUtil.d.ts +25 -2
  29. package/lib/utils/TemplateUtil.js +19 -3
  30. package/package.json +4 -4
@@ -1,25 +1,25 @@
1
- ## 快速上手
2
-
3
- ### 1. 开发
4
-
5
- ```
6
- npm install
7
- npm run start
8
- ```
9
-
10
- ### 2. 构建
11
-
12
- ```
13
- npm run build
14
- npm run release
15
- ```
16
-
17
- ### 3. 调试
18
-
19
- ```
20
- npm run watch
21
- ```
22
-
23
- ## 了解更多
24
-
25
- 你可以通过我们的[官方文档](https://iot.mi.com/vela/quickapp)熟悉和了解快应用。
1
+ ## 快速上手
2
+
3
+ ### 1. 开发
4
+
5
+ ```
6
+ npm install
7
+ npm run start
8
+ ```
9
+
10
+ ### 2. 构建
11
+
12
+ ```
13
+ npm run build
14
+ npm run release
15
+ ```
16
+
17
+ ### 3. 调试
18
+
19
+ ```
20
+ npm run watch
21
+ ```
22
+
23
+ ## 了解更多
24
+
25
+ 你可以通过我们的[官方文档](https://iot.mi.com/vela/quickapp)熟悉和了解快应用。
@@ -1,5 +1,5 @@
1
- /.nyc_output
2
- /coverage
3
- /node_modules
4
- /dist
1
+ /.nyc_output
2
+ /coverage
3
+ /node_modules
4
+ /dist
5
5
  /build
@@ -1,18 +1,18 @@
1
- {
2
- "name": "{{ appName }}",
3
- "version": "1.0.0",
4
- "description": "",
5
- "engines": {
6
- "node": ">=8.10"
7
- },
8
- "scripts": {
9
- "start": "aiot start --watch",
10
- "build": "aiot build",
11
- "release": "aiot release",
12
- "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
- },
14
- "devDependencies": {
15
- "@aiot-toolkit/jsc": "^1.0.3",
16
- "aiot-toolkit": "^{{ toolkitVersion }}"
17
- }
18
- }
1
+ {
2
+ "name": "{{ appName }}",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "engines": {
6
+ "node": ">=8.10"
7
+ },
8
+ "scripts": {
9
+ "start": "aiot start --watch",
10
+ "build": "aiot build",
11
+ "release": "aiot release",
12
+ "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
+ },
14
+ "devDependencies": {
15
+ "@aiot-toolkit/jsc": "^1.0.3",
16
+ "aiot-toolkit": "^{{ toolkitVersion }}"
17
+ }
18
+ }
@@ -1,10 +1,10 @@
1
- <script>
2
- export default {
3
- onCreate() {
4
- console.log('app created')
5
- },
6
- onDestroy() {
7
- console.log('app destroyed')
8
- }
9
- }
1
+ <script>
2
+ export default {
3
+ onCreate() {
4
+ console.log('app created')
5
+ },
6
+ onDestroy() {
7
+ console.log('app destroyed')
8
+ }
9
+ }
10
10
  </script>
@@ -1,32 +1,32 @@
1
- {
2
- "package": "com.application.watch.demo",
3
- "name": "{{appName}}",
4
- "versionName": "1.0.0",
5
- "versionCode": 1,
6
- "minPlatformVersion": 1200,
7
- "icon": "/common/logo.png",
8
- "simulationVersion": "default",
9
- "deviceTypeList": [
10
- "watch"
11
- ],
12
- "features": [
13
- {
14
- "name": "system.router"
15
- }
16
- ],
17
- "config": {
18
- "logLevel": "log",
19
- "designWidth": 480
20
- },
21
- "router": {
22
- "entry": "pages/index",
23
- "pages": {
24
- "pages/index": {
25
- "component": "index"
26
- },
27
- "pages/detail": {
28
- "component": "detail"
29
- }
30
- }
31
- }
1
+ {
2
+ "package": "com.application.watch.demo",
3
+ "name": "{{appName}}",
4
+ "versionName": "1.0.0",
5
+ "versionCode": 1,
6
+ "minPlatformVersion": 1200,
7
+ "icon": "/common/logo.png",
8
+ "simulationVersion": "default",
9
+ "deviceTypeList": [
10
+ "watch"
11
+ ],
12
+ "features": [
13
+ {
14
+ "name": "system.router"
15
+ }
16
+ ],
17
+ "config": {
18
+ "logLevel": "log",
19
+ "designWidth": 480
20
+ },
21
+ "router": {
22
+ "entry": "pages/index",
23
+ "pages": {
24
+ "pages/index": {
25
+ "component": "index"
26
+ },
27
+ "pages/detail": {
28
+ "component": "detail"
29
+ }
30
+ }
31
+ }
32
32
  }
@@ -1,26 +1,26 @@
1
- <template>
2
- <div class="demo-page">
3
- <text class="title">{{text}}</text>
4
- </div>
5
- </template>
6
-
7
- <script>
8
- export default {
9
- private: {
10
- text: '欢迎打开详情页'
11
- }
12
- }
13
- </script>
14
-
15
- <style>
16
- .demo-page {
17
- flex-direction: column;
18
- justify-content: center;
19
- align-items: center;
20
- }
21
-
22
- .title {
23
- font-size: 20px;
24
- text-align: center;
25
- }
1
+ <template>
2
+ <div class="demo-page">
3
+ <text class="title">{{text}}</text>
4
+ </div>
5
+ </template>
6
+
7
+ <script>
8
+ export default {
9
+ private: {
10
+ text: '欢迎打开详情页'
11
+ }
12
+ }
13
+ </script>
14
+
15
+ <style>
16
+ .demo-page {
17
+ flex-direction: column;
18
+ justify-content: center;
19
+ align-items: center;
20
+ }
21
+
22
+ .title {
23
+ font-size: 20px;
24
+ text-align: center;
25
+ }
26
26
  </style>
@@ -1,49 +1,49 @@
1
- <template>
2
- <div class="demo-page">
3
- <text class="title">{{$t('a.b')}},欢迎打开{{title}}</text>
4
- <!-- 点击跳转详情页 -->
5
- <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import router from '@system.router'
11
- import configuration from '@system.configuration'
12
-
13
- export default {
14
- // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
- private: {
16
- title: '示例页面'
17
- },
18
-
19
- routeDetail() {
20
- // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
21
- router.push({
22
- uri: '/pages/detail'
23
- })
24
- }
25
- }
26
- </script>
27
-
28
- <style>
29
- .demo-page {
30
- flex-direction: column;
31
- justify-content: center;
32
- align-items: center;
33
- }
34
-
35
- .title {
36
- font-size: 20px;
37
- text-align: center;
38
- }
39
-
40
- .btn {
41
- width: 200px;
42
- height: 40px;
43
- margin-top: 20px;
44
- border-radius: 5px;
45
- background-color: #09ba07;
46
- font-size: 20px;
47
- color: #ffffff;
48
- }
49
- </style>
1
+ <template>
2
+ <div class="demo-page">
3
+ <text class="title">{{$t('a.b')}},欢迎打开{{title}}</text>
4
+ <!-- 点击跳转详情页 -->
5
+ <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import router from '@system.router'
11
+ import configuration from '@system.configuration'
12
+
13
+ export default {
14
+ // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
+ private: {
16
+ title: '示例页面'
17
+ },
18
+
19
+ routeDetail() {
20
+ // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
21
+ router.push({
22
+ uri: '/pages/detail'
23
+ })
24
+ }
25
+ }
26
+ </script>
27
+
28
+ <style>
29
+ .demo-page {
30
+ flex-direction: column;
31
+ justify-content: center;
32
+ align-items: center;
33
+ }
34
+
35
+ .title {
36
+ font-size: 20px;
37
+ text-align: center;
38
+ }
39
+
40
+ .btn {
41
+ width: 200px;
42
+ height: 40px;
43
+ margin-top: 20px;
44
+ border-radius: 5px;
45
+ background-color: #09ba07;
46
+ font-size: 20px;
47
+ color: #ffffff;
48
+ }
49
+ </style>
@@ -1,4 +1,4 @@
1
- /node_modules
2
- /dist
3
- /build
1
+ /node_modules
2
+ /dist
3
+ /build
4
4
  /wasmUnpacked
@@ -1,17 +1,17 @@
1
- app MainApp {
2
- onCreate(intent: RouteInfo) {
3
- console.log('App onCreate.')
4
- }
5
-
6
- onForeground() {
7
- console.log('App onForeground.')
8
- }
9
-
10
- onBackground() {
11
- console.log('App onBackground.')
12
- }
13
-
14
- onDestroy() {
15
- console.log('App onDestroy.')
16
- }
1
+ app MainApp {
2
+ onCreate(intent: RouteInfo) {
3
+ console.log('App onCreate.')
4
+ }
5
+
6
+ onForeground() {
7
+ console.log('App onForeground.')
8
+ }
9
+
10
+ onBackground() {
11
+ console.log('App onBackground.')
12
+ }
13
+
14
+ onDestroy() {
15
+ console.log('App onDestroy.')
16
+ }
17
17
  }
@@ -1,68 +1,68 @@
1
- {
2
- "package": "{{packageName}}",
3
- "name": "{{appName}}",
4
- "icon": "/$app_resource/icon.png",
5
- "versionName": "1.0.0",
6
- "versionCode": 1,
7
- "minPlatformVersion": 1000,
8
- "features": [
9
- {
10
- "name": "system.shortcut"
11
- }
12
- ],
13
- "config": {
14
- "logLevel": "log",
15
- "network": {
16
- "connectTimeout": 10000,
17
- "readTimeout": 10000,
18
- "writeTimeout": 10000
19
- }
20
- },
21
- "display": {
22
- "backgroundColor": "#ffffff",
23
- "fullScreen": false,
24
- "titleBar": true,
25
- "titleBarBackgroundColor": "#000000",
26
- "titleBarTextColor": "#fffff",
27
- "statusBarImmersive": false,
28
- "statusBarTextStyle": "auto",
29
- "statusBarBackgroundColor": "#000000",
30
- "themeMode": -1
31
- },
32
- "trustedSslDomains": ["www.quickapp.cn", "m.quickapp.cn"],
33
- "router": {
34
- "aspects": {
35
- "home": [
36
- {
37
- "path": "aspect1",
38
- "devices": ["phone", "pad"],
39
- "autoStart": true
40
- }
41
- ]
42
- }
43
- },
44
- "rules": {
45
- "screenRule1": {
46
- "screenWidth": {
47
- "operator": "include",
48
- "values": ["100", "200"]
49
- },
50
- "screenShape": {
51
- "operator": "include",
52
- "values": ["rect"]
53
- }
54
- },
55
- "screenRule2": {
56
- "screenWidth": {
57
- "operator": "exclude",
58
- "values": ["800", "400"]
59
- }
60
- },
61
- "circleRule": {
62
- "screenShape": {
63
- "operator": "include",
64
- "values": ["circle"]
65
- }
66
- }
67
- }
68
- }
1
+ {
2
+ "package": "{{packageName}}",
3
+ "name": "{{appName}}",
4
+ "icon": "/$app_resource/icon.png",
5
+ "versionName": "1.0.0",
6
+ "versionCode": 1,
7
+ "minPlatformVersion": 1000,
8
+ "features": [
9
+ {
10
+ "name": "system.shortcut"
11
+ }
12
+ ],
13
+ "config": {
14
+ "logLevel": "log",
15
+ "network": {
16
+ "connectTimeout": 10000,
17
+ "readTimeout": 10000,
18
+ "writeTimeout": 10000
19
+ }
20
+ },
21
+ "display": {
22
+ "backgroundColor": "#ffffff",
23
+ "fullScreen": false,
24
+ "titleBar": true,
25
+ "titleBarBackgroundColor": "#000000",
26
+ "titleBarTextColor": "#fffff",
27
+ "statusBarImmersive": false,
28
+ "statusBarTextStyle": "auto",
29
+ "statusBarBackgroundColor": "#000000",
30
+ "themeMode": -1
31
+ },
32
+ "trustedSslDomains": ["www.quickapp.cn", "m.quickapp.cn"],
33
+ "router": {
34
+ "aspects": {
35
+ "home": [
36
+ {
37
+ "path": "aspect1",
38
+ "devices": ["phone", "pad"],
39
+ "autoStart": true
40
+ }
41
+ ]
42
+ }
43
+ },
44
+ "rules": {
45
+ "screenRule1": {
46
+ "screenWidth": {
47
+ "operator": "include",
48
+ "values": ["100", "200"]
49
+ },
50
+ "screenShape": {
51
+ "operator": "include",
52
+ "values": ["rect"]
53
+ }
54
+ },
55
+ "screenRule2": {
56
+ "screenWidth": {
57
+ "operator": "exclude",
58
+ "values": ["800", "400"]
59
+ }
60
+ },
61
+ "circleRule": {
62
+ "screenShape": {
63
+ "operator": "include",
64
+ "values": ["circle"]
65
+ }
66
+ }
67
+ }
68
+ }
@@ -1,8 +1,8 @@
1
- {
2
- "name": "{{aspectName}}",
3
- "type": "UI",
4
- "virtualMachine": "TS",
5
- "display": {},
6
- "permissions": {},
7
- "window": {}
8
- }
1
+ {
2
+ "name": "{{aspectName}}",
3
+ "type": "UI",
4
+ "virtualMachine": "TS",
5
+ "display": {},
6
+ "permissions": {},
7
+ "window": {}
8
+ }
@@ -1,17 +1,17 @@
1
- vaspect MainAspect {
2
- onCreate(intent: RouteInfo) {
3
- console.log('MainAspect onCreate.')
4
- }
5
-
6
- onShow() {
7
- console.log('MainAspect onShow.')
8
- }
9
-
10
- onHide() {
11
- console.log('MainAspect onHide.')
12
- }
13
-
14
- onDestroy() {
15
- console.log('MainAspect onDestroy.')
16
- }
1
+ vaspect MainAspect {
2
+ onCreate(intent: RouteInfo) {
3
+ console.log('MainAspect onCreate.')
4
+ }
5
+
6
+ onShow() {
7
+ console.log('MainAspect onShow.')
8
+ }
9
+
10
+ onHide() {
11
+ console.log('MainAspect onHide.')
12
+ }
13
+
14
+ onDestroy() {
15
+ console.log('MainAspect onDestroy.')
16
+ }
17
17
  }
@@ -1,21 +1,21 @@
1
- {
2
- "name": "{{aspectName}}",
3
- "versionName": "1.9.1",
4
- "versionCode": 10900001,
5
- "description": "主模块",
6
- "icon": "$file:logo.png",
7
- "logLevel": "log",
8
- "router": {
9
- "entry": "Home",
10
- "pages": {
11
- "Home": {
12
- "path": "pages/Home"
13
- }
14
- }
15
- },
16
- "features": [
17
- {
18
- "name": "system.shortcut"
19
- }
20
- ]
21
- }
1
+ {
2
+ "name": "{{aspectName}}",
3
+ "versionName": "1.9.1",
4
+ "versionCode": 10900001,
5
+ "description": "主模块",
6
+ "icon": "$file:logo.png",
7
+ "logLevel": "log",
8
+ "router": {
9
+ "entry": "Home",
10
+ "pages": {
11
+ "Home": {
12
+ "path": "pages/Home"
13
+ }
14
+ }
15
+ },
16
+ "features": [
17
+ {
18
+ "name": "system.shortcut"
19
+ }
20
+ ]
21
+ }