create-aiot 2.0.5-beta.9 → 2.0.5-widget-provider-beta.2

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 (36) hide show
  1. package/README.md +26 -26
  2. package/lib/bin.js +1 -1
  3. package/lib/index.d.ts +0 -1
  4. package/lib/index.js +0 -44
  5. package/lib/template/template.json +17 -27
  6. package/lib/template/ux/android-demo/README.md +25 -25
  7. package/lib/template/ux/android-demo/_gitignore +4 -4
  8. package/lib/template/ux/android-demo/package.json +17 -17
  9. package/lib/template/ux/android-demo/src/CardDemo/index.ux +24 -24
  10. package/lib/template/ux/android-demo/src/Demo/index.ux +48 -48
  11. package/lib/template/ux/android-demo/src/DemoDetail/index.ux +27 -27
  12. package/lib/template/ux/android-demo/src/app.ux +14 -14
  13. package/lib/template/ux/android-demo/src/global.js +34 -34
  14. package/lib/template/ux/android-demo/src/manifest.json +56 -56
  15. package/lib/template/ux/android-demo/src/sitemap.json +4 -4
  16. package/lib/template/ux/vela-demo/README.md +25 -25
  17. package/lib/template/ux/vela-demo/_gitignore +4 -4
  18. package/lib/template/ux/vela-demo/package.json +18 -18
  19. package/lib/template/ux/vela-demo/src/app.ux +9 -9
  20. package/lib/template/ux/vela-demo/src/manifest.json +34 -34
  21. package/lib/template/ux/vela-demo/src/pages/detail/detail.ux +25 -25
  22. package/lib/template/ux/vela-demo/src/pages/index/index.ux +49 -49
  23. package/lib/utils/Common.js +4 -4
  24. package/lib/utils/TemplateUtil.js +19 -23
  25. package/package.json +4 -4
  26. package/lib/template/xts/app-package-name/_gitignore +0 -4
  27. package/lib/template/xts/app-package-name/app/app.xts +0 -17
  28. package/lib/template/xts/app-package-name/app/manifest.json +0 -68
  29. package/lib/template/xts/app-package-name/app/resources/icon.png +0 -0
  30. package/lib/template/xts/aspect1/config.json +0 -8
  31. package/lib/template/xts/aspect1/src/aspect.xts +0 -17
  32. package/lib/template/xts/aspect1/src/manifest.json +0 -21
  33. package/lib/template/xts/aspect1/src/pages/Home.xts +0 -35
  34. package/lib/template/xts/aspect1/src/resources/logo.png +0 -0
  35. package/lib/utils/xts/XtsTemplateUtil.d.ts +0 -9
  36. package/lib/utils/xts/XtsTemplateUtil.js +0 -42
package/README.md CHANGED
@@ -1,26 +1,26 @@
1
- # `create-aiot`
2
-
3
- 新建 vela 项目的工具,可指定项目名称、模板、启用的工具(例如 eslint)等。
4
-
5
- ## 使用
6
-
7
- ### 命令
8
-
9
- `npm create aiot`
10
-
11
- 仅输入命令,会使用询问的方式获取各项参数。
12
-
13
- 也可直接输入参数,避免询问,示例:`npm create aiot --name my-project`
14
-
15
- ### 参数列表
16
-
17
- | 参数名 | 描述 | 类型 | 默认值 |
18
- | -------- | ----------- | ------ | ------------ |
19
- | name | 项目名称 | string | aiot-project |
20
- | v | 项目版本 | string | 1.0.0 |
21
- | template | 模板名称 | string | 无 |
22
- | eslint | 启用 eslint | string | false |
23
-
24
- ## 贡献模板
25
-
26
- 待定
1
+ # `create-aiot`
2
+
3
+ 新建 vela 项目的工具,可指定项目名称、模板、启用的工具(例如 eslint)等。
4
+
5
+ ## 使用
6
+
7
+ ### 命令
8
+
9
+ `npm create aiot`
10
+
11
+ 仅输入命令,会使用询问的方式获取各项参数。
12
+
13
+ 也可直接输入参数,避免询问,示例:`npm create aiot --name my-project`
14
+
15
+ ### 参数列表
16
+
17
+ | 参数名 | 描述 | 类型 | 默认值 |
18
+ | -------- | ----------- | ------ | ------------ |
19
+ | name | 项目名称 | string | aiot-project |
20
+ | v | 项目版本 | string | 1.0.0 |
21
+ | template | 模板名称 | string | 无 |
22
+ | eslint | 启用 eslint | string | false |
23
+
24
+ ## 贡献模板
25
+
26
+ 待定
package/lib/bin.js CHANGED
@@ -20,7 +20,7 @@ async function main() {
20
20
  name: 'create-aiot',
21
21
  description: 'create aiot project',
22
22
  version: require('../package.json').version,
23
- commandList: [await (0, _.getCrerateXtsCommand)(), await (0, _.getUxCreateCommand)()]
23
+ commandList: [await (0, _.getUxCreateCommand)()]
24
24
  };
25
25
  _commander.Command.registeProgram(config);
26
26
  }
package/lib/index.d.ts CHANGED
@@ -1,3 +1,2 @@
1
1
  import { ICommand } from '@aiot-toolkit/commander';
2
2
  export declare function getUxCreateCommand(): Promise<ICommand>;
3
- export declare function getCrerateXtsCommand(): Promise<ICommand>;
package/lib/index.js CHANGED
@@ -3,7 +3,6 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.getCrerateXtsCommand = getCrerateXtsCommand;
7
6
  exports.getUxCreateCommand = getUxCreateCommand;
8
7
  var _sharedUtils = require("@aiot-toolkit/shared-utils");
9
8
  var _fs = _interopRequireDefault(require("fs"));
@@ -83,47 +82,4 @@ async function getUxCreateCommand() {
83
82
  createAction(option, 'ux');
84
83
  }
85
84
  };
86
- }
87
- async function getCrerateXtsCommand() {
88
- const templateList = await _TemplateUtil.default.requestTemplateList('xts');
89
- return {
90
- name: 'xts',
91
- description: 'create xts template project',
92
- paramList: [{
93
- name: 'template',
94
- description: 'prject template',
95
- type: 'select',
96
- enableInquirer: true,
97
- choices: templateList.map(item => {
98
- return {
99
- value: item.name,
100
- description: item.description
101
- };
102
- })
103
- }, {
104
- name: 'name',
105
- description: 'poject name',
106
- enableInquirer: true,
107
- defaultValue: 'xts-project',
108
- type: 'string',
109
- validate(value) {
110
- return _TemplateUtil.default.validateProjectName(value);
111
- }
112
- }, {
113
- name: 'packageName',
114
- description: 'package name',
115
- enableInquirer: true,
116
- defaultValue: 'xts.app.test',
117
- type: 'string'
118
- }, {
119
- name: 'aspect',
120
- type: 'string',
121
- defaultValue: 'aspect1',
122
- description: 'Do you need to create some aspect, with multiple aspect names separated by commas',
123
- enableInquirer: true
124
- }],
125
- action: option => {
126
- createAction(option, 'xts');
127
- }
128
- };
129
85
  }
@@ -1,27 +1,17 @@
1
- [
2
- {
3
- "type": "ux",
4
- "demoList": [
5
- {
6
- "name": "vela-demo",
7
- "path": "./ux/vela-demo",
8
- "description": "vela demo template"
9
- },
10
- {
11
- "name": "android-demo",
12
- "path": "./ux/android-demo",
13
- "description": "android demo template"
14
- }
15
- ]
16
- },
17
- {
18
- "type": "xts",
19
- "demoList": [
20
- {
21
- "name": "xts-demo",
22
- "path": "./xts/app-package-name",
23
- "description": "xts demo template"
24
- }
25
- ]
26
- }
27
- ]
1
+ [
2
+ {
3
+ "type": "ux",
4
+ "demoList": [
5
+ {
6
+ "name": "vela-demo",
7
+ "path": "./ux/vela-demo",
8
+ "description": "vela demo template"
9
+ },
10
+ {
11
+ "name": "android-demo",
12
+ "path": "./ux/android-demo",
13
+ "description": "android demo template"
14
+ }
15
+ ]
16
+ }
17
+ ]
@@ -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,17 +1,17 @@
1
- {
2
- "name": "{{ appName }}",
3
- "version": "1.0.0",
4
- "description": "",
5
- "engines": {
6
- "node": ">=8.10"
7
- },
8
- "scripts": {
9
- "start": "aiot start",
10
- "build": "aiot build",
11
- "release": "aiot release",
12
- "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
- },
14
- "devDependencies": {
15
- "aiot-toolkit": "^{{ toolkitVersion }}"
16
- }
17
- }
1
+ {
2
+ "name": "{{ appName }}",
3
+ "version": "1.0.0",
4
+ "description": "",
5
+ "engines": {
6
+ "node": ">=8.10"
7
+ },
8
+ "scripts": {
9
+ "start": "aiot start",
10
+ "build": "aiot build",
11
+ "release": "aiot release",
12
+ "lint": "eslint --format codeframe --fix --ext .ux,.js src/"
13
+ },
14
+ "devDependencies": {
15
+ "aiot-toolkit": "^{{ toolkitVersion }}"
16
+ }
17
+ }
@@ -1,24 +1,24 @@
1
- <template>
2
- <!-- template里只能有一个根节点 -->
3
- <div class="demo-page">
4
- <text>{{text}}</text>
5
- <text>{{des}}</text>
6
- </div>
7
- </template>
8
-
9
- <script>
10
- export default {
11
- private: {
12
- text: '欢迎使用快应用卡片',
13
- des: '卡片是一种轻量级的快应用,快应用卡片使快应用能够在其他app和系统里提供可扩展的app功能'
14
- }
15
- }
16
- </script>
17
-
18
- <style>
19
- .demo-page {
20
- flex: 1;
21
- flex-direction: column;
22
- align-items: center;
23
- }
24
- </style>
1
+ <template>
2
+ <!-- template里只能有一个根节点 -->
3
+ <div class="demo-page">
4
+ <text>{{text}}</text>
5
+ <text>{{des}}</text>
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ export default {
11
+ private: {
12
+ text: '欢迎使用快应用卡片',
13
+ des: '卡片是一种轻量级的快应用,快应用卡片使快应用能够在其他app和系统里提供可扩展的app功能'
14
+ }
15
+ }
16
+ </script>
17
+
18
+ <style>
19
+ .demo-page {
20
+ flex: 1;
21
+ flex-direction: column;
22
+ align-items: center;
23
+ }
24
+ </style>
@@ -1,48 +1,48 @@
1
- <template>
2
- <!-- template里只能有一个根节点 -->
3
- <div class="demo-page">
4
- <text class="title">欢迎打开{{title}}</text>
5
- <!-- 点击跳转详情页 -->
6
- <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
7
- </div>
8
- </template>
9
-
10
- <script>
11
- import router from '@system.router'
12
-
13
- export default {
14
- // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
- private: {
16
- title: '示例页面'
17
- },
18
- routeDetail () {
19
- // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
20
- router.push ({
21
- uri: '/DemoDetail'
22
- })
23
- }
24
- }
25
- </script>
26
-
27
- <style>
28
- .demo-page {
29
- flex-direction: column;
30
- justify-content: center;
31
- align-items: center;
32
- }
33
-
34
- .title {
35
- font-size: 40px;
36
- text-align: center;
37
- }
38
-
39
- .btn {
40
- width: 550px;
41
- height: 86px;
42
- margin-top: 75px;
43
- border-radius: 43px;
44
- background-color: #09ba07;
45
- font-size: 30px;
46
- color: #ffffff;
47
- }
48
- </style>
1
+ <template>
2
+ <!-- template里只能有一个根节点 -->
3
+ <div class="demo-page">
4
+ <text class="title">欢迎打开{{title}}</text>
5
+ <!-- 点击跳转详情页 -->
6
+ <input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
7
+ </div>
8
+ </template>
9
+
10
+ <script>
11
+ import router from '@system.router'
12
+
13
+ export default {
14
+ // 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
15
+ private: {
16
+ title: '示例页面'
17
+ },
18
+ routeDetail () {
19
+ // 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
20
+ router.push ({
21
+ uri: '/DemoDetail'
22
+ })
23
+ }
24
+ }
25
+ </script>
26
+
27
+ <style>
28
+ .demo-page {
29
+ flex-direction: column;
30
+ justify-content: center;
31
+ align-items: center;
32
+ }
33
+
34
+ .title {
35
+ font-size: 40px;
36
+ text-align: center;
37
+ }
38
+
39
+ .btn {
40
+ width: 550px;
41
+ height: 86px;
42
+ margin-top: 75px;
43
+ border-radius: 43px;
44
+ background-color: #09ba07;
45
+ font-size: 30px;
46
+ color: #ffffff;
47
+ }
48
+ </style>
@@ -1,27 +1,27 @@
1
- <template>
2
- <!-- template里只能有一个根节点 -->
3
- <div class="demo-page">
4
- <text class="title">{{text}}</text>
5
- </div>
6
- </template>
7
-
8
- <script>
9
- export default {
10
- private: {
11
- text: '欢迎打开详情页'
12
- }
13
- }
14
- </script>
15
-
16
- <style>
17
- .demo-page {
18
- flex-direction: column;
19
- justify-content: center;
20
- align-items: center;
21
- }
22
-
23
- .title {
24
- font-size: 40px;
25
- text-align: center;
26
- }
27
- </style>
1
+ <template>
2
+ <!-- template里只能有一个根节点 -->
3
+ <div class="demo-page">
4
+ <text class="title">{{text}}</text>
5
+ </div>
6
+ </template>
7
+
8
+ <script>
9
+ export default {
10
+ private: {
11
+ text: '欢迎打开详情页'
12
+ }
13
+ }
14
+ </script>
15
+
16
+ <style>
17
+ .demo-page {
18
+ flex-direction: column;
19
+ justify-content: center;
20
+ align-items: center;
21
+ }
22
+
23
+ .title {
24
+ font-size: 40px;
25
+ text-align: center;
26
+ }
27
+ </style>
@@ -1,14 +1,14 @@
1
- <script>
2
- /**
3
- * @file 应用级别的配置,供所有页面公用
4
- * 可在app.ux导出公用变量
5
- * 其他src目录下的ux文件使用this.$app.$def.<paramName>即可调用此处导出的变量
6
- * 文档地址: https://doc.quickapp.cn/framework/source-file.html#appux
7
- */
8
-
9
- // 引入全局函数定义文件global.js
10
- import './global'
11
-
12
- export default {}
13
-
14
- </script>
1
+ <script>
2
+ /**
3
+ * @file 应用级别的配置,供所有页面公用
4
+ * 可在app.ux导出公用变量
5
+ * 其他src目录下的ux文件使用this.$app.$def.<paramName>即可调用此处导出的变量
6
+ * 文档地址: https://doc.quickapp.cn/framework/source-file.html#appux
7
+ */
8
+
9
+ // 引入全局函数定义文件global.js
10
+ import './global'
11
+
12
+ export default {}
13
+
14
+ </script>
@@ -1,34 +1,34 @@
1
- /**
2
- * @file 全局能力的配置与获取
3
- * 文档地址:https://doc.quickapp.cn/tutorial/framework/optimization-skills.html#%E4%BD%BF%E7%94%A8-globaljs
4
- */
5
-
6
- function getGlobalRef() {
7
- return Object.getPrototypeOf(global) || global
8
- }
9
-
10
- const quickappGlobal = getGlobalRef()
11
-
12
- /**
13
- * 设置全局(被APP与Page共享)数据;
14
- * @param key {string}
15
- * @param val {*}
16
- */
17
- function setGlobalData(key, val) {
18
- quickappGlobal[key] = val
19
- }
20
-
21
- /**
22
- * 获取全局(被APP与Page共享)数据;
23
- * @param key {string}
24
- * @return {*}
25
- */
26
- function getGlobalData(key) {
27
- return quickappGlobal[key]
28
- }
29
-
30
- // 两个方法默认定义在全局
31
- setGlobalData('setGlobalData', setGlobalData)
32
- setGlobalData('getGlobalData', getGlobalData)
33
-
34
- export { setGlobalData, getGlobalData }
1
+ /**
2
+ * @file 全局能力的配置与获取
3
+ * 文档地址:https://doc.quickapp.cn/tutorial/framework/optimization-skills.html#%E4%BD%BF%E7%94%A8-globaljs
4
+ */
5
+
6
+ function getGlobalRef() {
7
+ return Object.getPrototypeOf(global) || global
8
+ }
9
+
10
+ const quickappGlobal = getGlobalRef()
11
+
12
+ /**
13
+ * 设置全局(被APP与Page共享)数据;
14
+ * @param key {string}
15
+ * @param val {*}
16
+ */
17
+ function setGlobalData(key, val) {
18
+ quickappGlobal[key] = val
19
+ }
20
+
21
+ /**
22
+ * 获取全局(被APP与Page共享)数据;
23
+ * @param key {string}
24
+ * @return {*}
25
+ */
26
+ function getGlobalData(key) {
27
+ return quickappGlobal[key]
28
+ }
29
+
30
+ // 两个方法默认定义在全局
31
+ setGlobalData('setGlobalData', setGlobalData)
32
+ setGlobalData('getGlobalData', getGlobalData)
33
+
34
+ export { setGlobalData, getGlobalData }