chore: chore update
This commit is contained in:
18
.github/workflows/auto-merge.yml
vendored
18
.github/workflows/auto-merge.yml
vendored
@@ -7,6 +7,24 @@ on:
|
||||
workflow_dispatch: # 手动触发
|
||||
|
||||
jobs:
|
||||
merge-to-release:
|
||||
name: Merge main into release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.GH_TOKEN_AUTO_MERGE }}
|
||||
|
||||
- name: Merge main into release
|
||||
run: |
|
||||
git config user.name "GitHub Actions"
|
||||
git config user.email "actions@github.com"
|
||||
git checkout release
|
||||
git merge main --no-ff -m "Auto merge main into release"
|
||||
git push origin release
|
||||
|
||||
merge-to-i18n:
|
||||
name: Merge main into i18n
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
4
.vscode/vue3.code-snippets
vendored
4
.vscode/vue3.code-snippets
vendored
@@ -28,10 +28,10 @@
|
||||
"}",
|
||||
"</route>\n",
|
||||
"<script lang=\"ts\" setup>",
|
||||
"//$3",
|
||||
"//$2",
|
||||
"</script>\n",
|
||||
"<template>",
|
||||
" <view class=\"\">$2</view>",
|
||||
" <view class=\"\">$3</view>",
|
||||
"</template>\n",
|
||||
"<style lang=\"scss\" scoped>",
|
||||
"//$4",
|
||||
|
||||
@@ -4,7 +4,7 @@ export default [
|
||||
{
|
||||
schemaPath: 'http://petstore.swagger.io/v2/swagger.json',
|
||||
serversPath: './src/service/app',
|
||||
requestLibPath: `import request from '@/utils/request';\n import { CustomRequestOptions } from '@/interceptors/request';`,
|
||||
requestLibPath: `import request from '@/utils/request';\n import { CustomRequestOptions } from '@/http/interceptor';`,
|
||||
requestOptionsType: 'CustomRequestOptions',
|
||||
isGenReactQuery: true,
|
||||
reactQueryMode: 'vue',
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
{
|
||||
"name": "unibest",
|
||||
"type": "commonjs",
|
||||
"version": "3.3.0",
|
||||
"version": "3.3.1",
|
||||
"unibest-version": "用户创建项目时生成,使用version版本号",
|
||||
"packageManager": "pnpm@10.10.0",
|
||||
"description": "unibest - 最好的 uniapp 开发模板",
|
||||
"update-time": "2025-07-08",
|
||||
"generate-time": "用户创建项目时生成",
|
||||
"author": {
|
||||
"name": "feige996",
|
||||
"zhName": "菲鸽",
|
||||
@@ -15,8 +16,6 @@
|
||||
"license": "MIT",
|
||||
"homepage": "https://unibest.tech",
|
||||
"repository": "https://github.com/feige996/unibest",
|
||||
"repository-gitee": "https://gitee.com/feige996/unibest",
|
||||
"repository-old": "https://github.com/codercup/unibest",
|
||||
"bugs": {
|
||||
"url": "https://github.com/feige996/unibest/issues",
|
||||
"url-old": "https://github.com/codercup/unibest/issues"
|
||||
@@ -149,7 +148,6 @@
|
||||
"postcss-scss": "^4.0.9",
|
||||
"rollup-plugin-visualizer": "^5.12.0",
|
||||
"sass": "1.77.8",
|
||||
"terser": "^5.36.0",
|
||||
"typescript": "^5.7.2",
|
||||
"unocss": "65.4.2",
|
||||
"unplugin-auto-import": "^0.17.8",
|
||||
|
||||
3
pnpm-lock.yaml
generated
3
pnpm-lock.yaml
generated
@@ -215,9 +215,6 @@ importers:
|
||||
sass:
|
||||
specifier: 1.77.8
|
||||
version: 1.77.8
|
||||
terser:
|
||||
specifier: ^5.36.0
|
||||
version: 5.36.0
|
||||
typescript:
|
||||
specifier: ^5.7.2
|
||||
version: 5.7.2
|
||||
|
||||
@@ -7,7 +7,7 @@ const { exec } = require('node:child_process')
|
||||
// 定义要执行的命令
|
||||
const dependencies = [
|
||||
'@dcloudio/uni-app-harmony',
|
||||
// TODO: 如果需要某个平台的小程序,请手动删除或注释掉
|
||||
// TODO: 如果不需要某个平台的小程序,请手动删除或注释掉
|
||||
'@dcloudio/uni-mp-alipay',
|
||||
'@dcloudio/uni-mp-baidu',
|
||||
'@dcloudio/uni-mp-jd',
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import type { TabBar } from '@uni-helper/vite-plugin-uni-pages'
|
||||
|
||||
/**
|
||||
* tabbar 选择的策略,更详细的介绍见 tabbar.md 文件
|
||||
* 0: 'NO_TABBAR' `无 tabbar`
|
||||
@@ -19,14 +21,14 @@ export const selectedTabbarStrategy = TABBAR_MAP.NATIVE_TABBAR
|
||||
// selectedTabbarStrategy==NATIVE_TABBAR(1) 时,需要填 iconPath 和 selectedIconPath
|
||||
// selectedTabbarStrategy==CUSTOM_TABBAR(2,3) 时,需要填 icon 和 iconType
|
||||
// selectedTabbarStrategy==NO_TABBAR(0) 时,tabbarList 不生效
|
||||
export const tabbarList = [
|
||||
export const tabbarList: TabBar['list'] = [
|
||||
{
|
||||
iconPath: 'static/tabbar/home.png',
|
||||
selectedIconPath: 'static/tabbar/homeHL.png',
|
||||
pagePath: 'pages/index/index',
|
||||
text: '首页',
|
||||
icon: 'home',
|
||||
// 选用 UI 框架自带的 icon时,iconType 为 uiLib
|
||||
// 选用 UI 框架自带的 icon 时,iconType 为 uiLib
|
||||
iconType: 'uiLib',
|
||||
},
|
||||
{
|
||||
@@ -56,7 +58,7 @@ export const tabbarList = [
|
||||
export const cacheTabbarEnable = selectedTabbarStrategy === TABBAR_MAP.NATIVE_TABBAR
|
||||
|| selectedTabbarStrategy === TABBAR_MAP.CUSTOM_TABBAR_WITH_CACHE
|
||||
|
||||
const _tabbar = {
|
||||
const _tabbar: TabBar = {
|
||||
color: '#999999',
|
||||
selectedColor: '#018d71',
|
||||
backgroundColor: '#F8F8F8',
|
||||
|
||||
@@ -11,9 +11,6 @@
|
||||
import RequestComp from './components/request.vue'
|
||||
import UploadComp from './components/upload.vue'
|
||||
|
||||
// 获取屏幕边界到安全区域距离
|
||||
const { safeAreaInsets } = uni.getSystemInfoSync()
|
||||
|
||||
// 奇怪:同样的代码放在 vue 里面不会校验到错误,放在 .ts 文件里面会校验到错误
|
||||
// const testOxlint = (name: string) => {
|
||||
// console.log('oxlint')
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
@import './iconfont.css';
|
||||
|
||||
.test {
|
||||
// 可以通过 @apply 多个样式封装整体样式
|
||||
@apply mt-4 ml-4;
|
||||
|
||||
padding-top: 4px;
|
||||
color: red;
|
||||
}
|
||||
// 测试用的 iconfont,可生效
|
||||
// @import './iconfont.css';
|
||||
|
||||
:root,
|
||||
page {
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
import fs from 'fs-extra'
|
||||
|
||||
export function copyNativeRes() {
|
||||
const waitPath = path.resolve(__dirname, '../src/nativeResources')
|
||||
const buildPath = path.resolve(
|
||||
__dirname,
|
||||
'../dist',
|
||||
process.env.NODE_ENV === 'production' ? 'build' : 'dev',
|
||||
process.env.UNI_PLATFORM!,
|
||||
'nativeResources',
|
||||
)
|
||||
|
||||
return {
|
||||
enforce: 'post',
|
||||
async writeBundle() {
|
||||
try {
|
||||
// 检查源目录是否存在
|
||||
const sourceExists = await fs.pathExists(waitPath)
|
||||
if (!sourceExists) {
|
||||
console.warn(`[copyNativeRes] 警告:源目录 "${waitPath}" 不存在,跳过复制操作。`)
|
||||
return
|
||||
}
|
||||
|
||||
// 确保目标目录及中间目录存在
|
||||
await fs.ensureDir(buildPath)
|
||||
console.log(`[copyNativeRes] 确保目标目录存在:${buildPath}`)
|
||||
|
||||
// 执行文件夹复制
|
||||
await fs.copy(waitPath, buildPath)
|
||||
console.log(
|
||||
`[copyNativeRes] 成功将 nativeResources 目录中的资源移动到构建目录:${buildPath}`,
|
||||
)
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`[copyNativeRes] 复制资源失败:`, error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -1,37 +0,0 @@
|
||||
// src/plugins/updatePackageJson.ts
|
||||
import type { Plugin } from 'vite'
|
||||
import fs from 'node:fs/promises'
|
||||
import path from 'node:path'
|
||||
import process from 'node:process'
|
||||
|
||||
function updatePackageJson(): Plugin {
|
||||
return {
|
||||
name: 'update-package-json',
|
||||
async buildStart() {
|
||||
// 只在生产环境构建时执行
|
||||
if (process.env.NODE_ENV !== 'production')
|
||||
return
|
||||
|
||||
const packageJsonPath = path.resolve(process.cwd(), 'package.json')
|
||||
|
||||
try {
|
||||
// 读取并解析 package.json
|
||||
const content = await fs.readFile(packageJsonPath, 'utf-8')
|
||||
const packageJson = JSON.parse(content)
|
||||
|
||||
// 更新时间戳(使用 ISO 格式或自定义格式)
|
||||
packageJson['update-time'] = new Date().toISOString().split('T')[0] // YYYY-MM-DD
|
||||
|
||||
// 写回文件(保持 2 空格缩进)
|
||||
await fs.writeFile(packageJsonPath, `${JSON.stringify(packageJson, null, 2)}\n`, 'utf-8')
|
||||
|
||||
console.log(`[update-package-json] 更新时间戳: ${packageJson['update-time']}`)
|
||||
}
|
||||
catch (error) {
|
||||
console.error('[update-package-json] 插件执行失败:', error)
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
export default updatePackageJson
|
||||
@@ -21,7 +21,6 @@ import { visualizer } from 'rollup-plugin-visualizer'
|
||||
import AutoImport from 'unplugin-auto-import/vite'
|
||||
import { defineConfig, loadEnv } from 'vite'
|
||||
import ViteRestart from 'vite-plugin-restart'
|
||||
import updatePackageJson from './vite-plugins/updatePackageJson'
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default async ({ command, mode }) => {
|
||||
@@ -130,7 +129,6 @@ export default async ({ command, mode }) => {
|
||||
dts: 'src/types/components.d.ts', // 自动生成的组件类型声明文件路径(用于 TypeScript 支持)
|
||||
}),
|
||||
Uni(),
|
||||
updatePackageJson(),
|
||||
],
|
||||
define: {
|
||||
__UNI_PLATFORM__: JSON.stringify(UNI_PLATFORM),
|
||||
|
||||
Reference in New Issue
Block a user