Initial DSHWatch DSHWatch scaffold
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
/.nyc_output
|
||||
/coverage
|
||||
/node_modules
|
||||
/tests/fixtures
|
||||
/sign
|
||||
/dist
|
||||
/build
|
||||
@@ -0,0 +1,7 @@
|
||||
/.nyc_output
|
||||
/coverage
|
||||
/node_modules
|
||||
/sign
|
||||
/dist
|
||||
/build
|
||||
.husky/
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
node_modules
|
||||
build
|
||||
dist
|
||||
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
||||
*.log
|
||||
*.iml
|
||||
.idea/
|
||||
.vscode/
|
||||
|
||||
.nyc_output
|
||||
/coverage
|
||||
|
||||
/logs
|
||||
@@ -0,0 +1,22 @@
|
||||
module.exports = {
|
||||
printWidth: 100, // 指定代码长度,超出换行
|
||||
tabWidth: 2, // tab 键的宽度
|
||||
useTabs: false, // 使用空格替代tab
|
||||
semi: false, // 结尾加上分号
|
||||
singleQuote: false, // 使用单引号
|
||||
quoteProps: "consistent", // 要求对象字面量属性是否使用引号包裹,(‘as-needed’: 没有特殊要求,禁止使用,'consistent': 保持一致 , preserve: 不限制,想用就用)
|
||||
trailingComma: "none", // 不添加对象和数组最后一个元素的逗号
|
||||
bracketSpacing: false, // 对象中对空格和空行进行处理
|
||||
jsxBracketSameLine: false, // 在多行JSX元素的最后一行追加 >
|
||||
requirePragma: false, // 是否严格按照文件顶部的特殊注释格式化代码
|
||||
insertPragma: false, // 是否在格式化的文件顶部插入Pragma标记,以表明该文件被prettier格式化过了
|
||||
proseWrap: "preserve", // 按照文件原样折行
|
||||
htmlWhitespaceSensitivity: "ignore", // html文件的空格敏感度,控制空格是否影响布局
|
||||
endOfLine: "auto", // 结尾是 \n \r \n\r auto
|
||||
overrides: [
|
||||
{
|
||||
files: "*.ux",
|
||||
options: {parser: "vue"}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
"stylelint-config-standard",
|
||||
"stylelint-config-recess-order"
|
||||
// "stylelint-selector-bem-pattern"
|
||||
],
|
||||
ignoreFiles: ["node_modules", "test", "dist", "**/*.js"],
|
||||
rules: {
|
||||
"no-descending-specificity": null,
|
||||
"color-hex-case": "lower",
|
||||
"color-hex-length": "short",
|
||||
"at-rule-no-unknown": null,
|
||||
"block-no-empty": null,
|
||||
"selector-pseudo-class-no-unknown": [
|
||||
true,
|
||||
{
|
||||
ignorePseudoClasses: ["blur"]
|
||||
}
|
||||
],
|
||||
"property-no-unknown": [
|
||||
true,
|
||||
{
|
||||
ignoreProperties: [
|
||||
"placeholder-color",
|
||||
"gradient-start",
|
||||
"gradient-center",
|
||||
"gradient-end",
|
||||
"caret-color",
|
||||
"selected-color",
|
||||
"block-color"
|
||||
]
|
||||
}
|
||||
],
|
||||
"max-line-length": null,
|
||||
// "indentation": 2,
|
||||
// "no-empty-source": null,
|
||||
"selector-type-no-unknown": [
|
||||
true,
|
||||
{
|
||||
ignoreTypes: ["selected-color", "block-color"]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
Vendored
+45
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"velajs": {
|
||||
"command": "npx",
|
||||
"args": [
|
||||
"-y",
|
||||
"velajs-mcp"
|
||||
],
|
||||
"autoApprove": [
|
||||
"list_devices",
|
||||
"select_devices",
|
||||
"get_debug_status",
|
||||
"start_debug_cli",
|
||||
"start_debug_ide",
|
||||
"stop_debug",
|
||||
"close_all_emulators",
|
||||
"take_screenshot",
|
||||
"list_emulators",
|
||||
"get_snapshot",
|
||||
"get_element",
|
||||
"get_console_logs",
|
||||
"clear_console_logs",
|
||||
"execute_script",
|
||||
"get_network_requests",
|
||||
"clear_network_requests",
|
||||
"tap",
|
||||
"double_tap",
|
||||
"scroll",
|
||||
"swipe",
|
||||
"long_press",
|
||||
"send_key",
|
||||
"input_text",
|
||||
"get_storage",
|
||||
"get_project_info",
|
||||
"build_project",
|
||||
"get_build_settings",
|
||||
"select_build_setting",
|
||||
"get_output_logs",
|
||||
"get_emulator_logs",
|
||||
"get_device_log",
|
||||
"navigate"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
## 快速上手
|
||||
|
||||
### 1. 开发
|
||||
|
||||
```
|
||||
npm install
|
||||
npm run start
|
||||
```
|
||||
|
||||
### 2. 构建
|
||||
|
||||
```
|
||||
npm run build
|
||||
npm run release
|
||||
```
|
||||
|
||||
### 4. 代码规范化配置
|
||||
代码规范化可以帮助开发者在git commit前进行代码校验、格式化、commit信息校验
|
||||
|
||||
使用前提:必须先关联git
|
||||
|
||||
macOS or Linux
|
||||
```
|
||||
sh husky.sh
|
||||
```
|
||||
|
||||
windows
|
||||
```
|
||||
./husky.sh
|
||||
```
|
||||
|
||||
|
||||
## 了解更多
|
||||
|
||||
你可以通过我们的[官方文档](https://iot.mi.com/vela/quickapp)熟悉和了解快应用。
|
||||
@@ -0,0 +1,21 @@
|
||||
module.exports = {
|
||||
extends: ["@commitlint/config-conventional"],
|
||||
rules: {
|
||||
"type-enum": [
|
||||
2,
|
||||
"always",
|
||||
[
|
||||
"bug", // 此项特别针对bug号,用于向测试反馈bug列表的bug修改情况
|
||||
"feat", // 新功能(feature)
|
||||
"fix", // 修补bug
|
||||
"docs", // 文档(documentation)
|
||||
"style", // 格式(不影响代码运行的变动)
|
||||
"refactor", // 重构(即不是新增功能,也不是修改bug的代码变动)
|
||||
"test", // 增加测试
|
||||
"chore", // 构建过程或辅助工具的变动
|
||||
"revert", // feat(pencil): add ‘graphiteWidth’ option (撤销之前的commit)
|
||||
"merge" // 合并分支, 例如: merge(前端页面): feature-xxxx修改线程地址
|
||||
]
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
npx husky install
|
||||
npx husky add .husky/pre-commit 'npx lint-staged'
|
||||
npx husky add .husky/commit-msg 'npx --no -- commitlint --edit ${1}'
|
||||
Generated
+10267
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "DSHWatch",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"engines": {
|
||||
"node": ">=8.10"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "aiot start --watch",
|
||||
"build": "aiot build",
|
||||
"release": "aiot release",
|
||||
"lint": "eslint --format codeframe --fix --ext .ux,.js src/"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{ux,js}": [
|
||||
"prettier --write",
|
||||
"eslint --format codeframe --fix",
|
||||
"git add"
|
||||
],
|
||||
"*.{less,css}": [
|
||||
"prettier --write",
|
||||
"stylelint --fix --custom-syntax postcss-less",
|
||||
"git add"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@aiot-toolkit/jsc": "^1.0.3",
|
||||
"aiot-toolkit": "^2.0.5"
|
||||
}
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
<script>
|
||||
export default {
|
||||
onCreate() {
|
||||
console.log("app created")
|
||||
},
|
||||
onDestroy() {
|
||||
console.log("app destroyed")
|
||||
}
|
||||
}
|
||||
</script>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1 @@
|
||||
{}
|
||||
@@ -0,0 +1 @@
|
||||
{"a":{"b":"default hello"}}
|
||||
@@ -0,0 +1 @@
|
||||
{"a":{"b":"hello"}}
|
||||
@@ -0,0 +1 @@
|
||||
{"a":{"b":"你好"}}
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"package": "com.application.watch.demo",
|
||||
"name": "DSHWatch",
|
||||
"versionName": "1.0.0",
|
||||
"versionCode": 1,
|
||||
"minPlatformVersion": 1000,
|
||||
"icon": "/common/logo.png",
|
||||
"deviceTypeList": [
|
||||
"watch"
|
||||
],
|
||||
"features": [
|
||||
{
|
||||
"name": "system.router"
|
||||
}
|
||||
],
|
||||
"config": {
|
||||
"logLevel": "log",
|
||||
"designWidth": "device-width"
|
||||
},
|
||||
"router": {
|
||||
"entry": "pages/index",
|
||||
"pages": {
|
||||
"pages/index": {
|
||||
"component": "index"
|
||||
},
|
||||
"pages/detail": {
|
||||
"component": "detail"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<template>
|
||||
<div class="demo-page">
|
||||
<text class="title">{{ text }}</text>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
private: {
|
||||
text: "欢迎打开详情页"
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.demo-page {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -0,0 +1,48 @@
|
||||
<template>
|
||||
<div class="demo-page">
|
||||
<text class="title">{{ $t("a.b") }},欢迎打开{{ title }}</text>
|
||||
<!-- 点击跳转详情页 -->
|
||||
<input class="btn" type="button" value="跳转到详情页" onclick="routeDetail" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import router from "@system.router"
|
||||
|
||||
export default {
|
||||
// 页面级组件的数据模型,影响传入数据的覆盖机制:private内定义的属性不允许被覆盖
|
||||
private: {
|
||||
title: "示例页面"
|
||||
},
|
||||
|
||||
routeDetail() {
|
||||
// 跳转到应用内的某个页面,router用法详见:文档->接口->页面路由
|
||||
router.push({
|
||||
uri: "/pages/detail"
|
||||
})
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.demo-page {
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.btn {
|
||||
width: 200px;
|
||||
height: 40px;
|
||||
margin-top: 20px;
|
||||
border-radius: 5px;
|
||||
background-color: #09ba07;
|
||||
font-size: 20px;
|
||||
color: #ffffff;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user