Skip to content

Commit

Permalink
初次提交
Browse files Browse the repository at this point in the history
  • Loading branch information
LXJ committed May 26, 2021
0 parents commit 7be776e
Show file tree
Hide file tree
Showing 36 changed files with 4,609 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
root = true

[*]
indent_style = space
indent_size = 4

end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{package.json,.travis.yml,ci.yml}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
88 changes: 88 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Referenced from https://github.com/github/gitignore/blob/master/Node.gitignore

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Typescript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# other stuff
.DS_Store
Thumbs.db

# IDE configurations
.idea
.vscode

# build assets
/output
/dll
/dist
/wx_dist
/ant_dist
/tt_dist

# lock file
package-lock.json

# tiny img source files
doc/img/src/

# mock
/mock
12 changes: 12 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
node_modules/
coverage/
test/
dist/
.idea/
npm-debug.log
Thumbs.db
.DS_Store
.npmrc
*.swp
*.bat
yarn.lock
125 changes: 125 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
xiaomi-wx

====

A okam project


## 开发前阅读

此项目是基于 `okam` 开发框架开发的小程序项目,开发前先了解:[Okam 的使用](https://ecomfe.github.io/okam)

## 快速开始

### 准备工作

* 安装 Node (`Node >= 8` && `npm >= 3`)

* 执行 `npm install`

### 开发

* 百度小程序运行命令

* `npm run dev`: 带 watch 开发模式

* `npm run dev:clean`: 删掉构建产物(不包括项目配置文件)并重新构建且带 watch 开发模式

* `npm run dev:server`: 带 watch && 开发 Server 开发模式

* `npm run prod`: 生产环境构建(没有 watch && 开发 Server)

* 微信小程序运行命令

* `npm run dev:wx:` 微信小程序开发构建

* `npm run dev:wx:clean`: 微信小程序:删掉构建产物(不包括项目配置文件)并重新构建且带 watch 开发模式

* `npm run dev:wx:server`: 带 watch && 开发 Server 开发模式

* `npm run prod:wx`: 微信小程序生产环境构建(没有 watch && 开发 Server)

* 支付宝小程序运行命令

* `npm run dev:ant`: 微信小程序开发构建

* `npm run dev:ant:clean`: 微信小程序:删掉构建产物(不包括项目配置文件)并重新构建且带 watch 开发模式

* `npm run dev:ant:server`:带 watch && 开发 Server 开发模式

* `npm run prod:ant`: 微信小程序生产环境构建(没有 watch && 开发 Server)

* 头条小程序运行命令

* `npm run dev:tt`: 微信小程序开发构建

* `npm run dev:tt:clean`: 微信小程序:删掉构建产物(不包括项目配置文件)并重新构建且带 watch 开发模式

* `npm run dev:tt:server`:带 watch && 开发 Server 开发模式

* `npm run prod:tt`: 微信小程序生产环境构建(没有 watch && 开发 Server)


* 快应用小程序运行命令

* `npm run dev:quick`: 快应用小程序开发构建

* `npm run dev:quick:clean`: 快应用小程序:删掉构建产物(不包括项目配置文件)并重新构建且带 watch 开发模式

* `npm run dev:quick:server`:带 watch && 开发 Server 开发模式

* `npm run prod:quick`: 快应用小程序生产环境构建(没有 watch && 开发 Server)

### 注意

#### 快应用开发
* 需要全局安装 `hap` : `npm install adb-devtools -g`
* 手机需要安装 `rpk` 包,[详见](https://doc.quickapp.cn/)
* 快应用与小程序差异较多,框架提供基础功能,`UI` API, 对齐部分,需要开发对齐,详见示例 `src/common/component/Button`

### 目录结构说明

```
.
├── README.md
├── package.json
├── doc // 缓存项目源图片或者其它文档目录
├── dist // 百度小程序 构建产物,开发工具得选择该构建产物目录作为项目根目录方能预览
├── wx_dist // 微信小程序 构建产物,开发工具得选择该构建产物目录作为项目根目录方能预览
├── ant_dist // 支付宝小程序 构建产物,开发工具得选择该构建产物目录作为项目根目录方能预览
├── tt_dist // 头条小程序 构建产物,开发工具得选择该构建产物目录作为项目根目录方能预览
├── .tinyimgcache // 图片压缩的缓存信息,不可删掉,否则会导致图片重复压缩
├── project.json5 // 小程序项目配置文件,除了语法使用 JS 对象形式,配置说明参考官方小程序说明
├── scripts // 构建相关脚本
│   ├── build.js // 构建入口脚本
│ ├── base.config.js // 基础构建配置文件
│ ├── init-quick-app.js // 快应用初始构建配置文件
│ ├── quick.config.js // 快应用构建配置文件
│ ├── base.config.js // 基础构建配置文件
│ ├── tt.config.js // 头条小程序构建配置文件
│ ├── ant.config.js // 支付宝小程序构建配置文件
│ ├── wx.config.js // 微信小程序构建配置文件
│   └── swan.config.js // 百度 Swan 小程序构建配置文件
└── src // 项目源码
├── app.js // 小程序入口脚本
├── app.scss // 小程序入口样式
├── common // 项目公共代码
│   ├── img // 项目图片资源
│   ├── tpl // 项目公共模板文件
│   └── ...
├── components // 自定义组件
└── pages // 小程序页面集合
├── home // 首页
├── ...
└── ...
```


### 文档
* [okam 使用教程](https://ecomfe.github.io/okam)
* [百度小程序](https://smartprogram.baidu.com/docs/develop/tutorial/codedir)
* [微信小程序](https://developers.weixin.qq.com/miniprogram/dev/index.html)
* [支付宝小程序](https://docs.alipay.com/mini/developer/getting-started)
* [头条小程序](https://microapp.bytedance.com/docs/framework/)
* [快应用](https://doc.quickapp.cn/)

54 changes: 54 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"private": true,
"name": "xiaomi-wx",
"version": "0.1.0",
"description": "A okam project",
"main": "index.js",
"scripts": {
"dev:base": "cross-env NODE_ENV=dev node scripts/build.js --watch",
"prod:base": "node scripts/build.js --clean",
"dev": "npm run dev:base",
"dev:clean": "npm run dev:base -- --clean",
"dev:server": "npm run dev:base -- --server",
"prod": "npm run prod:base",
"dev:wx": "npm run dev:base -- --type wx",
"dev:wx:server": "npm run dev:base -- --server --type wx",
"dev:wx:clean": "npm run dev:base -- --clean --type wx",
"prod:wx": "npm run prod:base -- --type wx",
"dev:ant": "npm run dev:base -- --type ant",
"dev:ant:server": "npm run dev:base -- --server --type ant",
"dev:ant:clean": "npm run dev:base -- --clean --type ant",
"prod:ant": "npm run prod:base -- --type ant",
"dev:tt": "npm run dev:base -- --type tt",
"dev:tt:server": "npm run dev:base -- --server --type tt",
"dev:tt:clean": "npm run dev:base -- --clean --type tt",
"prod:tt": "npm run prod:base -- --type tt",
"dev:quick": "npm run dev:base -- --type quick",
"dev:quick:server": "npm run dev:base -- --server --type quick",
"dev:quick:clean": "npm run dev:base -- --clean --type quick",
"prod:quick": "npm run prod:base -- --type quick"
},
"author": "liuxja<[email protected]>",
"devDependencies": {
"@babel/core": "^7.1.6",
"@babel/preset-env": "^7.1.6",
"connect": "^3.6.6",
"cross-env": "^5.2.0",
"json5": "^2.1.0",
"less": "^4.1.1",
"node-sass": "^4.10.0",
"okam-build": "^0.4.27-alpha.0",
"postcss": "^7.0.6",
"postcss-url": "^8.0.0",
"promise-polyfill": "^8.1.0",
"regenerator-runtime": "^0.13.1",
"style-resources-loader": "^1.4.1"
},
"engine": {
"node": ">= 8"
},
"dependencies": {
"@vant/weapp": "^1.5.3",
"okam-core": "^0.4.18-alpha.0"
}
}
80 changes: 80 additions & 0 deletions project.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"description": "项目配置文件",
"packOptions": {
"ignore": []
},
"setting": {
"urlCheck": true,
"es6": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"compileHotReLoad": false,
"useMultiFrameRuntime": true,
"useApiHook": true,
"useApiHostProcess": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
},
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": true,
"packNpmRelationList": [
{
"packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./miniprogram/"
}
],
"minifyWXSS": true
},
"compileType": "miniprogram",
"libVersion": "2.15.0",
"appid": "wx5b2e4c521691fced",
"projectname": "miniprogram-1",
"debugOptions": {
"hidedInDevtools": []
},
"scripts": {},
"staticServerOptions": {
"baseURL": "",
"servePath": ""
},
"isGameTourist": false,
"condition": {
"search": {
"list": []
},
"conversation": {
"list": []
},
"game": {
"list": []
},
"plugin": {
"list": []
},
"gamePlugin": {
"list": []
},
"miniprogram": {
"list": []
}
}
}
15 changes: 15 additions & 0 deletions project.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
appid: '0',
description: 'A okam project',
projectname: 'xiaomi-wx',
_ttEnv: {
appid: '体验appId',
setting: {
urlCheck: true,
es6: true,
postcss: true,
minified: true,
newFeature: true
}
}
}
Loading

0 comments on commit 7be776e

Please sign in to comment.