diff --git a/.github/workflows/auto-merge.yml b/.github/workflows/auto-merge.yml index 0c12579..f548d8b 100644 --- a/.github/workflows/auto-merge.yml +++ b/.github/workflows/auto-merge.yml @@ -7,24 +7,6 @@ on: workflow_dispatch: # 手动触发 jobs: - merge-to-main: - name: Merge base into main - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - token: ${{ secrets.GH_TOKEN_AUTO_MERGE }} - - - name: Merge base into main - run: | - git config user.name "GitHub Actions" - git config user.email "actions@github.com" - git checkout main - git merge base --no-ff -m "Auto merge base into main" - git push origin main - merge-to-i18n: name: Merge base into i18n runs-on: ubuntu-latest diff --git a/package.json b/package.json index ad88c87..b9f8d09 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "unibest", "type": "commonjs", - "version": "2.12.2", + "version": "2.13.1", "description": "unibest - 最好的 uniapp 开发模板", - "update-time": "2025-05-28", + "update-time": "2025-06-17", "author": { "name": "feige996", "zhName": "菲鸽", @@ -11,14 +11,15 @@ "github": "https://github.com/feige996", "gitee": "https://gitee.com/feige996" }, + "homepage": "https://unibest.tech", "license": "MIT", "repository": "https://github.com/feige996/unibest", "repository-gitee": "https://gitee.com/feige996/unibest", - "repository-deprecated": "https://github.com/codercup/unibest", + "repository-old": "https://github.com/codercup/unibest", "bugs": { - "url": "https://github.com/feige996/unibest/issues" + "url": "https://github.com/feige996/unibest/issues", + "url-old": "https://github.com/codercup/unibest/issues" }, - "homepage": "https://feige996.github.io/unibest/", "engines": { "node": ">=18", "pnpm": ">=7.30" @@ -148,6 +149,7 @@ "postcss": "^8.4.49", "postcss-html": "^1.7.0", "postcss-scss": "^4.0.9", + "prettier": "^3.5.3", "rollup-plugin-visualizer": "^5.12.0", "sass": "1.77.8", "terser": "^5.36.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7797e83..693dc14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -186,6 +186,9 @@ importers: postcss-scss: specifier: ^4.0.9 version: 4.0.9(postcss@8.4.49) + prettier: + specifier: ^3.5.3 + version: 3.5.3 rollup-plugin-visualizer: specifier: ^5.12.0 version: 5.12.0(rollup@4.41.1) @@ -4635,8 +4638,8 @@ packages: resolution: {integrity: sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==} engines: {node: ^10 || ^12 || >=14} - prettier@3.3.2: - resolution: {integrity: sha512-rAVeHYMcv8ATV5d508CFdn+8/pHPpXeIid1DdrPwXnaAdH7cqjVbpJaT5eq4yRAFU/lsbwYwSF/n5iNrdJHPQA==} + prettier@3.5.3: + resolution: {integrity: sha512-QQtaxnoDJeAkDvDKWCLiwIXkTgRhwYDEQCghU9Z6q03iyek/rxRh/2lC3HB7P8sWT2xC/y5JDctPLBIGzHKbhw==} engines: {node: '>=14'} hasBin: true @@ -8010,10 +8013,10 @@ snapshots: '@polka/url@1.0.0-next.29': {} - '@prettier/sync@0.5.2(prettier@3.3.2)': + '@prettier/sync@0.5.2(prettier@3.5.3)': dependencies: make-synchronized: 0.2.9 - prettier: 3.3.2 + prettier: 3.5.3 '@quansync/fs@0.1.3': dependencies: @@ -8128,7 +8131,7 @@ snapshots: '@tootallnate/once@1.1.2': {} - '@trivago/prettier-plugin-sort-imports@5.2.1(@vue/compiler-sfc@3.5.15)(prettier@3.3.2)': + '@trivago/prettier-plugin-sort-imports@5.2.1(@vue/compiler-sfc@3.5.15)(prettier@3.5.3)': dependencies: '@babel/generator': 7.26.2 '@babel/parser': 7.26.2 @@ -8136,7 +8139,7 @@ snapshots: '@babel/types': 7.26.0 javascript-natural-sort: 0.7.1 lodash: 4.17.21 - prettier: 3.3.2 + prettier: 3.5.3 optionalDependencies: '@vue/compiler-sfc': 3.5.15 transitivePeerDependencies: @@ -11012,8 +11015,8 @@ snapshots: openapi-ts-request@1.1.2(@types/node@20.17.9)(@vue/compiler-sfc@3.5.15)(chokidar@3.6.0)(typescript@5.7.2): dependencies: - '@prettier/sync': 0.5.2(prettier@3.3.2) - '@trivago/prettier-plugin-sort-imports': 5.2.1(@vue/compiler-sfc@3.5.15)(prettier@3.3.2) + '@prettier/sync': 0.5.2(prettier@3.5.3) + '@trivago/prettier-plugin-sort-imports': 5.2.1(@vue/compiler-sfc@3.5.15)(prettier@3.5.3) axios: 1.7.9 bing-translate-api: 4.0.2 chalk: 4.1.2 @@ -11027,7 +11030,7 @@ snapshots: minimatch: 10.0.1 mockjs: 1.1.0 nunjucks: 3.2.4(chokidar@3.6.0) - prettier: 3.3.2 + prettier: 3.5.3 reserved-words: 0.1.2 rimraf: 6.0.1 swagger2openapi: 7.0.8 @@ -11294,7 +11297,7 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - prettier@3.3.2: {} + prettier@3.5.3: {} pretty-format@27.5.1: dependencies: diff --git a/src/components/privacy-popup/index.scss b/src/components/privacy-popup/index.scss deleted file mode 100644 index 8cba003..0000000 --- a/src/components/privacy-popup/index.scss +++ /dev/null @@ -1,47 +0,0 @@ -@import 'wot-design-uni/components/wd-button/index.scss'; -:deep(.wd-privacy-popup) { - width: 600rpx; - padding: 0 24rpx; - box-sizing: border-box; - border-radius: 32rpx; - overflow: hidden; -} - -.wd-privacy-popup { - &__header { - width: 100%; - height: 128rpx; - line-height: 128rpx; - color: rgba(0, 0, 0, 0.85); - font-size: 30rpx; - padding: 0 12rpx; - box-sizing: border-box; - } - - &__container { - width: 100%; - box-sizing: border-box; - padding: 0 12rpx; - margin-bottom: 32rpx; - - font-size: 28rpx; - line-height: 1.8; - color: #3e3e3e; - text-align: left; - font-weight: 550; - &-protocol { - color: #4d80f0; - } - } - - &__footer { - display: flex; - justify-content: space-between; - padding-bottom: 36rpx; - - button { - border: none; - outline: none; - } - } -} \ No newline at end of file diff --git a/src/components/privacy-popup/privacy-popup.vue b/src/components/privacy-popup/privacy-popup.vue deleted file mode 100644 index 9bf9ec9..0000000 --- a/src/components/privacy-popup/privacy-popup.vue +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - diff --git a/src/pages.json b/src/pages.json index e2456f2..2343e94 100644 --- a/src/pages.json +++ b/src/pages.json @@ -31,42 +31,6 @@ "style": { "navigationBarTitleText": "关于" } - }, - { - "path": "pages/login/index", - "type": "page", - "style": { - "navigationBarTitleText": "登录", - "navigationStyle": "custom" - } - }, - { - "path": "pages/mine/index", - "type": "page", - "style": { - "navigationBarTitleText": "我的" - } - }, - { - "path": "pages/mine/about/index", - "type": "page", - "style": { - "navigationBarTitleText": "关于我们" - } - }, - { - "path": "pages/mine/info/index", - "type": "page", - "style": { - "navigationBarTitleText": "个人资料" - } - }, - { - "path": "pages/mine/password/index", - "type": "page", - "style": { - "navigationBarTitleText": "修改密码" - } } ], "subPackages": [] diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue deleted file mode 100644 index 5195f14..0000000 --- a/src/pages/login/index.vue +++ /dev/null @@ -1,584 +0,0 @@ - -{ - style: { - navigationBarTitleText: '登录', - navigationStyle: 'custom', - }, -} - - - - - - diff --git a/src/pages/mine/about/index.vue b/src/pages/mine/about/index.vue deleted file mode 100644 index d7e152a..0000000 --- a/src/pages/mine/about/index.vue +++ /dev/null @@ -1,173 +0,0 @@ - -{ - style: { - navigationBarTitleText: '关于我们', - }, -} - - - - - - - diff --git a/src/pages/mine/index.vue b/src/pages/mine/index.vue deleted file mode 100644 index 11cbc1e..0000000 --- a/src/pages/mine/index.vue +++ /dev/null @@ -1,374 +0,0 @@ - -{ - style: { - navigationBarTitleText: '我的', - }, -} - - - - - - - diff --git a/src/pages/mine/info/index.vue b/src/pages/mine/info/index.vue deleted file mode 100644 index 2feb64d..0000000 --- a/src/pages/mine/info/index.vue +++ /dev/null @@ -1,190 +0,0 @@ - -{ - style: { - navigationBarTitleText: '个人资料', - }, -} - - - - - - - diff --git a/src/pages/mine/password/index.vue b/src/pages/mine/password/index.vue deleted file mode 100644 index a92d2d5..0000000 --- a/src/pages/mine/password/index.vue +++ /dev/null @@ -1,203 +0,0 @@ - -{ - style: { - navigationBarTitleText: '修改密码', - }, -} - - - - - - - diff --git a/vite-plugins/updatePackageJson.ts b/vite-plugins/updatePackageJson.ts new file mode 100644 index 0000000..0d2282f --- /dev/null +++ b/vite-plugins/updatePackageJson.ts @@ -0,0 +1,34 @@ +// src/plugins/updatePackageJson.ts +import { Plugin } from 'vite' +import fs from 'fs/promises' +import path from 'path' + +const 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 diff --git a/vite.config.ts b/vite.config.ts index 6111304..3efc208 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -20,6 +20,7 @@ import { visualizer } from 'rollup-plugin-visualizer' import AutoImport from 'unplugin-auto-import/vite' import ViteRestart from 'vite-plugin-restart' import { copyNativeRes } from './vite-plugins/copyNativeRes' +import updatePackageJson from './vite-plugins/updatePackageJson' import Components from '@uni-helper/vite-plugin-uni-components' // https://vitejs.dev/config/ @@ -129,6 +130,7 @@ export default async ({ command, mode }) => { dts: 'src/types/components.d.ts', // 自动生成的组件类型声明文件路径(用于 TypeScript 支持) }), Uni(), + updatePackageJson(), ], define: { __UNI_PLATFORM__: JSON.stringify(UNI_PLATFORM),