初始化
This commit is contained in:
111
docs/changelog/CHANGELOG.md
Normal file
111
docs/changelog/CHANGELOG.md
Normal file
@@ -0,0 +1,111 @@
|
||||
# CHANGELOG 更新日志
|
||||
|
||||
## v2.12.1(2025-06-13)
|
||||
|
||||
### `oxlint` 优化
|
||||
|
||||
- `oxlint` 从 `0.11.0` 升级到 `1.0.0`。
|
||||
|
||||
> 注意:最新的 `1.1.0` 还有问题,运行报错,所以使用 `1.0.0`。(别贪新)
|
||||
|
||||
**提交代码的时候会自动触发。** 如果想主动检测,可以使用 `pnpm lint` 命令。
|
||||
|
||||
## v2.11.1(2025-06-11)
|
||||
|
||||
### `hello-unibest`
|
||||
|
||||
- 新增 `echarts`(推荐) 和 `ucharts` 示例。
|
||||
|
||||
### docs 文档
|
||||
|
||||
- 更新 `App 专题` `热更新`内容。( `android端` 无法热更新的问题,已经解决了!)
|
||||
|
||||
## v2.11.0(2025-06-03)
|
||||
|
||||
<!-- ### 架构优化
|
||||
|
||||
- 把 `v2.8.0(2025-05-20)` 版本删除的 `husky + commitlint` 配置加回来了。 -->
|
||||
|
||||
### 依赖降级
|
||||
|
||||
- 将 `unocss` 从 `66.0.0` 降级到 `65.4.2`。(因为有部分网友会出现问题,所以降级了。)
|
||||
|
||||
### 新模板
|
||||
|
||||
- 新增 `base-sard-ui` 模板,方便用户直接使用 `sard-ui` 这个UI库开发。
|
||||
|
||||
## v2.10.1(2025-05-28)
|
||||
|
||||
### 新功能
|
||||
|
||||
- 实现基础的 `登录` 功能,支持 `微信小程序` 静默登录 和 `非小程序` 登录。
|
||||
|
||||
<!-- ## v2.9.3(2025-05-27)
|
||||
|
||||
### 新功能
|
||||
|
||||
- 支持 `spa` 模板,属于单页应用,完全自定义 `tabbar` 的形式。
|
||||
|
||||
### 依赖升级
|
||||
|
||||
- 将 `unocss` 从 `0.58` 升级到 `66.0.0`。
|
||||
- 将 `wot-design-uni` 从 `^1.4.0` 升级到 `^1.9.0`。
|
||||
- 将 `vue` 从 `3.4.21` 升级到 `^3.5.15`。
|
||||
- 将 `vite` 从 `5.2.8` 升级到 `6.3.5`。
|
||||
|
||||
## v2.8.0(2025-05-20)
|
||||
|
||||
### 架构优化
|
||||
|
||||
- 移除 `stylelint` 和 `eslint` 配置,统一采用 `oxlint` 进行代码检查,提升代码校验的速度(比 `eslint` 快 `50-100` 倍)。
|
||||
- ~~移除 `husky` 和 `commitlint` 配置(使用编辑器的AI生成commit信息)。~~(应网友要求,在v2.11.0加回来了)
|
||||
|
||||
::: details 对于 `v2.8.0` 以下版本,需按以下步骤操作:
|
||||
|
||||
- 把 `stylelint, eslint` 相关依赖包删除
|
||||
- 安装 `oxlint`,设置 `lint-staged` 配置为 `oxlint`
|
||||
- 删除 `stylelint, eslint` 相关文件
|
||||
|
||||

|
||||
|
||||
:::
|
||||
|
||||
## v2.7.0(2025-05-19)
|
||||
|
||||
### 依赖升级
|
||||
|
||||
- 将 `@dcloudio/uni-app` 从 `3.0.0-4020920240930001` 升级到 `3.0.0-4060520250512001`,获取最新功能和性能优化。
|
||||
|
||||
### 新功能
|
||||
|
||||
- 支持 `无 TabBar` 模式,用户只需删除 `pages.config.ts` 中的 `tabBar` 配置即可。
|
||||
|
||||
::: details 对于 `v2.7.0` 以下版本,需按以下步骤操作:
|
||||
|
||||
- 执行 `pnpm uvm` 升级 `@dcloudio/uni-app`。
|
||||
- 修改 `src/utils/index.ts` 部分代码:
|
||||
|
||||
```ts
|
||||
import pagesConfig from '@/pages.json'
|
||||
const { pages, subPackages, tabBar = { list: [] } } = { ...pagesConfig }
|
||||
|
||||
/** 判断当前页面是否是 tabbar 页 */
|
||||
export const getIsTabbar = () => {
|
||||
try {
|
||||
const lastPage = getLastPage()
|
||||
const currPath = lastPage?.route
|
||||
|
||||
return Boolean(tabBar?.list?.some((item) => item.pagePath === currPath))
|
||||
} catch {
|
||||
return false
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
::: -->
|
||||
|
||||
## ...
|
||||
|
||||
## v0.0.0(2023-12.21)
|
||||
|
||||
创建项目,首次提交。
|
||||
BIN
docs/changelog/image-1.png
Normal file
BIN
docs/changelog/image-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 117 KiB |
BIN
docs/changelog/image-2.png
Normal file
BIN
docs/changelog/image-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 229 KiB |
BIN
docs/changelog/image-3.png
Normal file
BIN
docs/changelog/image-3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 259 KiB |
BIN
docs/changelog/image-4.png
Normal file
BIN
docs/changelog/image-4.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 111 KiB |
BIN
docs/changelog/image.png
Normal file
BIN
docs/changelog/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 64 KiB |
212
docs/changelog/upgrade.md
Normal file
212
docs/changelog/upgrade.md
Normal file
@@ -0,0 +1,212 @@
|
||||
# 升级指南
|
||||
|
||||
分为 `6` 部分的内容:(2025-06-14 周六)
|
||||
|
||||
- `uniapp sdk 升级`
|
||||
- `uni-helper 插件升级`
|
||||
- `oxlint 升级`
|
||||
- `移除 eslint, stylelint`
|
||||
- `unocss 升级` (可选)
|
||||
- `vscode 配置文件升级` (可选)
|
||||
|
||||
## uniapp sdk 升级
|
||||
|
||||
```sh
|
||||
pnpm uvm # 升级 uniapp sdk
|
||||
# 如果以上命令不存在,请使用下面的
|
||||
npx @dcloudio/uvm@latest
|
||||
```
|
||||
|
||||
然后进入交互式的升级模式,按照提示进行升级。期间包管理器选择 `pnpm`。
|
||||
|
||||
升级完后,会自动引入 `vue-i18n`,不需要的可以删除它。(可选)
|
||||
|
||||
## uni-helper 插件升级
|
||||
|
||||
```sh
|
||||
"@uni-helper/uni-types": "1.0.0-alpha.3",
|
||||
"@uni-helper/unocss-preset-uni": "^0.2.11",
|
||||
"@uni-helper/vite-plugin-uni-components": "0.2.0",
|
||||
"@uni-helper/vite-plugin-uni-layouts": "0.1.10",
|
||||
"@uni-helper/vite-plugin-uni-manifest": "0.2.8",
|
||||
"@uni-helper/vite-plugin-uni-pages": "0.2.28",
|
||||
"@uni-helper/vite-plugin-uni-platform": "0.0.4",
|
||||
```
|
||||
|
||||
把你项目里面的 `package.json` 里面的相关依赖包版本改成上面的。然后执行 `pnpm i` 安装。
|
||||
|
||||
## oxlint 升级
|
||||
|
||||
```sh
|
||||
pnpm add -D oxlint@v1.0.0 # 注意不要贪最新,最新的 v1.1.0 有问题,会报错。
|
||||
```
|
||||
|
||||
`package.json` 里面的 `"lint-staged"` 内容改为:
|
||||
|
||||
```json
|
||||
"lint-staged": {
|
||||
"**/*.{html,cjs,json,md,scss,css,txt}": [
|
||||
"prettier --write --cache"
|
||||
],
|
||||
"**/*.{js,jsx,ts,tsx,vue,mjs,cjs,mts,cts}": [
|
||||
"oxlint --fix",
|
||||
"prettier --write --cache"
|
||||
],
|
||||
"!**/{node_modules,dist}/**": []
|
||||
},
|
||||
```
|
||||
|
||||
`package.json` 里面的 `scripts` 添加:
|
||||
|
||||
```json
|
||||
scripts: {
|
||||
// ... 其他
|
||||
"lint": "oxlint",
|
||||
"lint-fix": "oxlint --fix"
|
||||
}
|
||||
```
|
||||
|
||||
然后在项目根目录新建 `.oxlintrc.json` 文件,内容如下:
|
||||
|
||||
```json
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"extends": ["config:recommended"],
|
||||
"plugins": ["import", "typescript", "unicorn"],
|
||||
"rules": {
|
||||
"no-console": "off",
|
||||
"no-unused-vars": "off"
|
||||
},
|
||||
"env": {
|
||||
"es6": true
|
||||
},
|
||||
"globals": {
|
||||
"foo": "readonly"
|
||||
},
|
||||
"ignorePatterns": [
|
||||
"node_modules",
|
||||
"dist",
|
||||
"src/static/**",
|
||||
"src/uni_modules/**",
|
||||
"vite.config.ts",
|
||||
"uno.config.ts",
|
||||
"pages.config.ts",
|
||||
"manifest.config.ts"
|
||||
],
|
||||
"settings": {},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["*.test.ts", "*.spec.ts"],
|
||||
"rules": {
|
||||
"@typescript-eslint/no-explicit-any": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
## 移除 eslint, stylelint
|
||||
|
||||
上面配置了 `oxlint` 后,`eslint` 不需要了,可以把 `依赖包` 和 `配置文件` 都都删除。
|
||||
|
||||
`stylelint` 可以保留也可以删除,因为几乎都是用 `unocss` 来写样式的,所以 `stylelint` 不要也可以。
|
||||
|
||||
## unocss 升级(可选)
|
||||
|
||||
1、升级 `unocss`
|
||||
|
||||
```sh
|
||||
pnpm add -D unocss@65.4.2 # 注意不要贪最新,最新的 v66+ 有问题,会报错。
|
||||
```
|
||||
|
||||
2、 更新 `uno.config.ts` 配置文件
|
||||
|
||||
```ts
|
||||
// https://www.npmjs.com/package/@uni-helper/unocss-preset-uni
|
||||
import { presetUni } from '@uni-helper/unocss-preset-uni'
|
||||
import {
|
||||
defineConfig,
|
||||
presetIcons,
|
||||
presetAttributify,
|
||||
transformerDirectives,
|
||||
transformerVariantGroup,
|
||||
} from 'unocss'
|
||||
|
||||
export default defineConfig({
|
||||
presets: [
|
||||
presetUni({
|
||||
attributify: {
|
||||
// prefix: 'fg-', // 如果加前缀,则需要在代码里面使用 `fg-` 前缀,如:<div fg-border="1px solid #000"></div>
|
||||
prefixedOnly: true,
|
||||
},
|
||||
}),
|
||||
presetIcons({
|
||||
scale: 1.2,
|
||||
warn: true,
|
||||
extraProperties: {
|
||||
display: 'inline-block',
|
||||
'vertical-align': 'middle',
|
||||
},
|
||||
}),
|
||||
// 支持css class属性化
|
||||
presetAttributify(),
|
||||
],
|
||||
transformers: [
|
||||
// 启用指令功能:主要用于支持 @apply、@screen 和 theme() 等 CSS 指令
|
||||
transformerDirectives(),
|
||||
// 启用 () 分组功能
|
||||
// 支持css class组合,eg: `<div class="hover:(bg-gray-400 font-medium) font-(light mono)">测试 unocss</div>`
|
||||
transformerVariantGroup(),
|
||||
],
|
||||
shortcuts: [
|
||||
{
|
||||
center: 'flex justify-center items-center',
|
||||
},
|
||||
],
|
||||
rules: [
|
||||
[
|
||||
'p-safe',
|
||||
{
|
||||
padding:
|
||||
'env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left)',
|
||||
},
|
||||
],
|
||||
['pt-safe', { 'padding-top': 'env(safe-area-inset-top)' }],
|
||||
['pb-safe', { 'padding-bottom': 'env(safe-area-inset-bottom)' }],
|
||||
],
|
||||
theme: {
|
||||
colors: {
|
||||
/** 主题色,用法如: text-primary */
|
||||
primary: 'var(--wot-color-theme,#0957DE)',
|
||||
},
|
||||
fontSize: {
|
||||
/** 提供更小号的字体,用法如:text-2xs */
|
||||
'2xs': ['20rpx', '28rpx'],
|
||||
'3xs': ['18rpx', '26rpx'],
|
||||
},
|
||||
},
|
||||
})
|
||||
```
|
||||
|
||||
3、 更新 `vite.config.ts` 中 `unocss` 的引入方式:
|
||||
|
||||
```ts
|
||||
export default async ({ command, mode }) => {
|
||||
// @see https://unocss.dev/
|
||||
const UnoCSS = (await import('unocss/vite')).default
|
||||
// ... 其他代码
|
||||
})
|
||||
```
|
||||
|
||||
## vscode 配置文件升级
|
||||
|
||||
`.vscode/settings.json` 里面 `explorer.fileNesting.patterns` 配置如下:
|
||||
|
||||
```json
|
||||
"explorer.fileNesting.patterns": {
|
||||
"README.md": "index.html,favicon.ico,robots.txt,CHANGELOG.md",
|
||||
"pages.config.ts": "manifest.config.ts,openapi-ts-request.config.ts",
|
||||
"package.json": "pnpm-lock.yaml,pnpm-workspace.yaml,LICENSE,.gitattributes,.gitignore,.gitpod.yml,CNAME,.npmrc,.browserslistrc",
|
||||
".oxlintrc.json": "tsconfig.json,.commitlintrc.*,.prettier*,.editorconfig,.commitlint.cjs,.eslint*"
|
||||
}
|
||||
```
|
||||
Reference in New Issue
Block a user