提交 01cd9ec4 作者: 方治民

feat: v0.0.2 更新配置项、字体、文档相关

上级 9e0d2f7e
# APP 名称 # APP 名称
VITE_GLOB_APP_NAME = 智慧化工 VITE_GLOB_APP_NAME = Basic APP
# APP 描述 # APP 描述
VITE_GLOB_APP_DESCRIPTION = 湖北可赛化工 APP VITE_GLOB_APP_DESCRIPTION = APP 基础工程
# 可赛化工 APP # APP 基础工程 (uni-app-vue3)
## 开发规范 > 项目 Fork 自 [uni-app-vite-ts](https://gitee.com/dcloud/uni-preset-vue/blob/vite-ts)
> **注意事项**: 运行/调试/编译/发布环境使用 `HBuilderX`, 开发工具统一使用 `Visual Studio Code`
[规范说明](./doc/workflow.md)
---
## 开发环境 ## 开发环境
<!-- prettier-ignore --> <!-- prettier-ignore -->
- Visual Studio Code [latest](https://code.visualstudio.com) - Visual Studio Code [latest](https://code.visualstudio.com)
- HBuilderX [latest](https://www.dcloud.io/hbuilderx.html) - HBuilderX [alpha](https://www.dcloud.io/hbuilderx.html)
- [常用插件清单](./doc/plugins.md) - [常用插件清单](./doc/plugins.md)
## 技术栈 ## 开始
[技术栈说明](./doc/technique.md) <!-- prettier-ignore -->
- [开发规范说明](./doc/workflow.md)
## 开发工具说明 - [技术栈说明](./doc/technique.md)
> 运行/调试/编译/发布环境使用 `HBuilderX`, 开发工具统一使用 `Visual Studio Code` ---
## TODO ## TODO
......
import type { Plugin } from 'vite' import type { Plugin } from 'vite'
import { configUniPlugin } from './uni' import { configUniPlugin } from './uni'
import { configAutoImportPlugin } from './autoImport' import { configAutoImportPlugin } from './autoImport'
import pkg from '../../package.json'
export function createVitePlugins(viteEnv: ViteEnv) { export function createVitePlugins(viteEnv: ViteEnv) {
const { VITE_GLOB_APP_NAME, VITE_GLOB_APP_DESCRIPTION } = viteEnv const {
console.log('APP 名称: ', VITE_GLOB_APP_NAME) VITE_GLOB_APP_NAME,
console.log('APP 描述: ', VITE_GLOB_APP_DESCRIPTION) VITE_GLOB_APP_DESCRIPTION,
VITE_GLOB_API_URL,
VITE_GLOB_API_URL_PREFIX,
} = viteEnv
// 以红色字体输出信息
const color = '\x1b[91m'
console.log()
console.log(color, `APP 版本: v${pkg.version}`)
console.log(color, `APP 名称: ${VITE_GLOB_APP_NAME}`)
console.log(color, `APP 描述: ${VITE_GLOB_APP_DESCRIPTION}`)
console.log(color, `API Doc: ${VITE_GLOB_API_URL}${VITE_GLOB_API_URL_PREFIX}/doc.html`)
// plugins // plugins
const vitePlugins: (Plugin | Plugin[])[] = [] const vitePlugins: (Plugin | Plugin[])[] = []
......
...@@ -4,11 +4,14 @@ import prettier from 'prettier' ...@@ -4,11 +4,14 @@ import prettier from 'prettier'
// uni-app // uni-app
import uni from '@dcloudio/vite-plugin-uni' import uni from '@dcloudio/vite-plugin-uni'
// @dcloudio/uni-helper-json
import tags from '@dcloudio/uni-helper-json/dist/tags.json'
/**
* 根据 @dcloudio/uni-helper-json 生成组件 .d.ts 描述文件,对组件进行高亮展示
*/
function generateUniComponentsTypes() { function generateUniComponentsTypes() {
const tags = fs.readFileSync('./node_modules/@dcloudio/uni-helper-json/dist/tags.json', 'utf8') const components = Object.keys(tags).map((key) => `'${key}': typeof HTMLElement`)
const json = JSON.parse(tags)
const components = Object.keys(json).map((key) => `'${key}': typeof HTMLElement`)
const content = ` const content = `
// generated by @dcloudio/uni-helper-json/dist/tags.json // generated by @dcloudio/uni-helper-json/dist/tags.json
...@@ -21,7 +24,12 @@ function generateUniComponentsTypes() { ...@@ -21,7 +24,12 @@ function generateUniComponentsTypes() {
export {} export {}
` `
const formatted = prettier.format(content, { parser: 'typescript', tabWidth: 4, semi: false }) const formatted = prettier.format(content, {
parser: 'typescript',
tabWidth: 4,
semi: false,
singleQuote: true,
})
fs.writeFileSync('./types/uni-components.d.ts', formatted, 'utf8') fs.writeFileSync('./types/uni-components.d.ts', formatted, 'utf8')
} }
......
...@@ -54,7 +54,6 @@ develop 分支之上为权限分支,仅由负责人负责合并代码或创建 ...@@ -54,7 +54,6 @@ develop 分支之上为权限分支,仅由负责人负责合并代码或创建
#### 常用的 type 类别 #### 常用的 type 类别
<!-- prettier-ignore --> <!-- prettier-ignore -->
- `upd`:更新 xxx 功能
- `feat`:新增 xxx 功能 - `feat`:新增 xxx 功能
- `fix`:修复 xxx Bug - `fix`:修复 xxx Bug
- `docs`:变更 xxx 文档 - `docs`:变更 xxx 文档
...@@ -62,6 +61,7 @@ develop 分支之上为权限分支,仅由负责人负责合并代码或创建 ...@@ -62,6 +61,7 @@ develop 分支之上为权限分支,仅由负责人负责合并代码或创建
- `refactor`:重构 xxx 功能或方法 - `refactor`:重构 xxx 功能或方法
- `test`:调试 xxx 功能或新增 xxx 测试用例 - `test`:调试 xxx 功能或新增 xxx 测试用例
- `chore`:构建过程或辅助工具的变动(较少出现,项目构建之初基本已确定好) - `chore`:构建过程或辅助工具的变动(较少出现,项目构建之初基本已确定好)
- `build`: 发布 v0.0.1 版本
#### subject 简述 #### subject 简述
...@@ -75,6 +75,5 @@ develop 分支之上为权限分支,仅由负责人负责合并代码或创建 ...@@ -75,6 +75,5 @@ develop 分支之上为权限分支,仅由负责人负责合并代码或创建
```sh ```sh
git commit -m 'feat: 新增用户登录功能' git commit -m 'feat: 新增用户登录功能'
git commit -m 'upd: 完善用户登录界面交互细节' git commit -m 'fix: 修复由 token 问题引起的需要重复登录 Bug #1002'
git commit -m 'fix: 修复由token问题引起的需要重复登录Bug #1002'
``` ```
{ {
"name": "kshg-app", "name": "basic-app",
"version": "0.0.1", "version": "0.0.2",
"description": "可赛化工 APP", "description": "APP 基础工程",
"keywords": [ "keywords": [
"chemical", "app",
"kesai", "basic"
"kshg",
"可赛化工",
"APP"
], ],
"repository": { "repository": {
"type": "git", "type": "git",
"url": "https://gitlab.yiring.com/chemical-kesai/kshg-app.git" "url": "https://gitlab.yiring.com/basic/basic-uniapp-v3.git"
}, },
"author": { "author": {
"name": "yiring", "name": "ifzm",
"email": "developer@yiring.com", "email": "fzm@yiring.com",
"url": "https://yiring.com" "url": "https://yiring.com"
}, },
"scripts": { "scripts": {
......
...@@ -14,4 +14,8 @@ ...@@ -14,4 +14,8 @@
<style> <style>
/* common css */ /* common css */
/* #ifndef APP-PLUS-NVUE */
/* uni.css - 通用组件、模板样式库,可以当作一套ui库应用 */
@import './common/uni.css';
/* #endif */
</style> </style>
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
{ {
"path": "pages/index/index", "path": "pages/index/index",
"style": { "style": {
"navigationBarTitleText": "智慧化工" "navigationBarTitleText": "Basic APP"
} }
} }
], ],
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
} }
.title { .title {
/* font-size: 36rpx; */ font-size: 36rpx;
color: #8f8f94; color: #8f8f94;
} }
</style> </style>
// generated by @dcloudio/uni-helper-json/dist/tags.json // generated by @dcloudio/uni-helper-json/dist/tags.json
declare module 'vue' { declare module 'vue' {
// uni-app 全局组件高亮 // uni-app 内置组件高亮
export interface GlobalComponents { export interface GlobalComponents {
block: typeof HTMLElement block: typeof HTMLElement
view: typeof HTMLElement view: typeof HTMLElement
......
...@@ -30,6 +30,9 @@ export default ({ mode }: ConfigEnv): UserConfig => { ...@@ -30,6 +30,9 @@ export default ({ mode }: ConfigEnv): UserConfig => {
optimizeDeps: { optimizeDeps: {
include: ['lodash-es', '@vueuse/core'], include: ['lodash-es', '@vueuse/core'],
}, },
build: {
sourcemap: true,
},
define: { define: {
__APP__: { __APP__: {
name: pkg.name, name: pkg.name,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论