feat: 更新依赖,解决启动报错

This commit is contained in:
LOG1997
2025-09-21 10:39:16 +08:00
parent cf07040d07
commit 8279cf0bf6
9 changed files with 3380 additions and 2908 deletions

View File

@@ -17,70 +17,71 @@
},
"dependencies": {
"@tweenjs/tween.js": "^23.1.2",
"@vueuse/core": "^11.3.0",
"@vueuse/core": "^13.9.0",
"axios": "^1.7.8",
"canvas-confetti": "^1.9.3",
"dayjs": "^1.11.13",
"github-markdown-css": "^5.8.0",
"localforage": "^1.10.0",
"markdown-it": "^14.1.0",
"pinia": "^2.2.6",
"pinia": "^3.0.3",
"pinia-plugin-persist": "^1.0.0",
"sparticles": "^1.3.1",
"three": "^0.166.0",
"three-css3d": "^1.0.6",
"vue": "^3.5.13",
"vue-dompurify-html": "^5.2.0",
"vue-i18n": "^10.0.4",
"vue-i18n": "^11.1.12",
"vue-router": "^4.5.0",
"vue-toast-notification": "^3",
"vue3-colorpicker": "^2.3.0",
"xlsx": "^0.18.5",
"zod": "^3.23.8"
"zod": "^4.1.11"
},
"devDependencies": {
"@antfu/eslint-config": "^3.9.2",
"@antfu/eslint-config": "^5.4.1",
"@eslint/eslintrc": "^3.2.0",
"@eslint/js": "^9.15.0",
"@iconify-json/ep": "^1.2.1",
"@iconify-json/fluent": "^1.2.8",
"@tailwindcss/typography": "^0.5.15",
"@tailwindcss/vite": "^4.1.13",
"@testing-library/vue": "^8.1.0",
"@types/canvas-confetti": "^1.6.4",
"@types/markdown-it": "^14.1.2",
"@types/node": "^22.9.4",
"@types/node": "^24.5.2",
"@types/three": "^0.166.0",
"@typescript-eslint/eslint-plugin": "^8.16.0",
"@typescript-eslint/parser": "^8.16.0",
"@vitejs/plugin-legacy": "^6.0.0",
"@vitejs/plugin-vue": "^5.2.0",
"@vitest/ui": "^2.1.5",
"@vitejs/plugin-legacy": "^7.2.1",
"@vitejs/plugin-vue": "^6.0.1",
"@vitest/ui": "^3.2.4",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.20",
"daisyui": "^4.12.14",
"daisyui": "^5.1.13",
"eslint": "^9.15.0",
"eslint-plugin-vue": "^9.31.0",
"globals": "^15.12.0",
"happy-dom": "^15.11.6",
"eslint-plugin-vue": "^10.4.0",
"globals": "^16.4.0",
"happy-dom": "^18.0.1",
"husky": "^9.1.7",
"jsdom": "^25.0.1",
"jsdom": "^27.0.0",
"path": "^0.12.7",
"postcss": "^8.4.49",
"rollup-plugin-visualizer": "^5.12.0",
"rollup-plugin-visualizer": "^6.0.3",
"sass": "^1.81.0",
"sass-loader": "^16.0.3",
"tailwindcss": "^3.4.15",
"tailwindcss": "^4.1.13",
"terser": "^5.36.0",
"typescript": "5.5.3",
"unplugin-auto-import": "^0.18.5",
"unplugin-icons": "^0.20.1",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.11",
"unplugin-auto-import": "^20.1.0",
"unplugin-icons": "^22.3.0",
"unplugin-vue-components": "^29.1.0",
"vite": "^7.1.6",
"vite-plugin-compression": "^0.5.1",
"vite-plugin-inspect": "^0.8.8",
"vite-plugin-inspect": "^11.3.3",
"vite-plugin-svg-icons": "^2.0.1",
"vite-plugin-vue-devtools": "^7.6.4",
"vitest": "^2.1.5",
"vue-tsc": "^2.1.10"
"vite-plugin-vue-devtools": "^8.0.2",
"vitest": "^3.2.4",
"vue-tsc": "^3.0.7"
}
}
}

5888
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +0,0 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
}
}

1
src/components.d.ts vendored
View File

@@ -2,6 +2,7 @@
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
// biome-ignore lint: disable
export {}
/* prettier-ignore */

38
src/constant/theme.ts Normal file
View File

@@ -0,0 +1,38 @@
export const daisyuiThemes = [
'valentine',
'halloween',
'cmyk',
'winter',
'corporate',
'fantasy',
'aqua',
'pastel',
'lemonade',
'garden',
'silk',
'black',
'coffee',
'wireframe',
'caramellatte',
'acid',
'cyberpunk',
'nord',
'bumblebee',
'night',
'dracula',
'synthwave',
'light',
'dark',
'forest',
'emerald',
'business',
'cupcake',
'autumn',
'abyss',
'dim',
'lofi',
'sunset',
'luxury',
'retro',
]

View File

@@ -1,6 +1,10 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "tailwindcss";
@plugin "daisyui" {
themes: all;
}
/* @plugin "@tailwindcss/typography" */
body,
html {

View File

@@ -1,10 +1,10 @@
<script setup lang='ts'>
import i18n, { languageList } from '@/locales/i18n'
import { daisyuiThemes } from '@/constant/theme'
import i18n, { languageList } from '@/locales/i18n'
import useStore from '@/store'
import { themeChange } from '@/utils'
import { isHex, isRgbOrRgba } from '@/utils/color'
import daisyuiThemes from 'daisyui/src/theming/themes'
import { storeToRefs } from 'pinia'
import { onMounted, ref, watch } from 'vue'
import { ColorPicker } from 'vue3-colorpicker'
@@ -17,7 +17,7 @@ const { t } = useI18n()
const globalConfig = useStore().globalConfig
const personConfig = useStore().personConfig
const prizeConfig = useStore().prizeConfig
const { getTopTitle: topTitle, getTheme: localTheme, getPatterColor: patternColor, getPatternList: patternList, getCardColor: cardColor, getLuckyColor: luckyCardColor, getTextColor: textColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getIsShowPrizeList: isShowPrizeList, getLanguage: userLanguage, getBackground: backgroundImage, getImageList: imageList, getIsShowAvatar: isShowAvatar
const { getTopTitle: topTitle, getTheme: localTheme, getPatterColor: patternColor, getPatternList: patternList, getCardColor: cardColor, getLuckyColor: luckyCardColor, getTextColor: textColor, getCardSize: cardSize, getTextSize: textSize, getRowCount: rowCount, getIsShowPrizeList: isShowPrizeList, getLanguage: userLanguage, getBackground: backgroundImage, getImageList: imageList, getIsShowAvatar: isShowAvatar,
} = storeToRefs(globalConfig)
const { getAlreadyPersonList: alreadyPersonList, getNotPersonList: notPersonList } = storeToRefs(personConfig)
const colorPickerRef = ref()
@@ -38,7 +38,7 @@ const languageValue = ref(structuredClone(userLanguage.value))
const isShowPrizeListValue = ref(structuredClone(isShowPrizeList.value))
const isShowAvatarValue = ref(structuredClone(isShowAvatar.value))
const patternColorValue = ref(structuredClone(patternColor.value))
const themeList = ref(Object.keys(daisyuiThemes))
const themeList = ref(daisyuiThemes)
const daisyuiThemeList = ref<ThemeDaType>(daisyuiThemes)
const backgroundImageValue = ref(backgroundImage.value)
const formData = ref({
@@ -49,8 +49,9 @@ const formErr = ref({
})
const schema = zod.object({
rowCount: zod.number({
required_error: i18n.global.t('error.require'),
invalid_type_error: i18n.global.t('error.requireNumber'),
error: i18n.global.t('error.require'),
// required_error: i18n.global.t('error.require'),
// invalid_type_error: i18n.global.t('error.requireNumber'),
})
.min(1, i18n.global.t('error.minNumber1'))
.max(100, i18n.global.t('error.maxNumber100')),
@@ -158,7 +159,7 @@ watch(languageValue, (val: string) => {
globalConfig.setLanguage(val)
})
watch(isShowAvatarValue, () => {
globalConfig.setIsShowAvatar(isShowAvatarValue.value)
globalConfig.setIsShowAvatar(isShowAvatarValue.value)
})
onMounted(() => {
})
@@ -350,11 +351,13 @@ onMounted(() => {
</label>
<label class="w-full max-w-xs mb-10 form-control">
<div class="label">
<span class="label-text">{{ t('table.avatarDisplay') }}</span>
</div>
<input type="checkbox" :checked="isShowAvatarValue" @change="isShowAvatarValue = !isShowAvatarValue"
class="mt-2 border-solid checkbox checkbox-secondary border-1" />
<div class="label">
<span class="label-text">{{ t('table.avatarDisplay') }}</span>
</div>
<input
type="checkbox" :checked="isShowAvatarValue" class="mt-2 border-solid checkbox checkbox-secondary border-1"
@change="isShowAvatarValue = !isShowAvatarValue"
>
</label>
</div>
</template>

View File

@@ -1,23 +0,0 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
darkMode: 'class',
corePlugins: {
preflight: false
},
theme: {
},
content: ['./index.html', './src/**/*.{vue,js,ts,jsx,tsx}'],
plugins: [require('@tailwindcss/typography'), require('daisyui')],
daisyui: {
themes: true, // false: only light + dark | true: all themes | array: specific themes like this ["light", "dark", "cupcake"]
darkTheme: '', // name of one of the included themes for dark mode
base: true, // applies background color and foreground color for root element by default
styled: true, // include daisyUI colors and design decisions for all components
utils: true, // adds responsive and modifier utility classes
prefix: '', // prefix for daisyUI classnames (components, modifiers and responsive class names. Not colors)
logs: true, // Shows info about daisyUI version and used config in the console when building your CSS
themeRoot: ':root', // The element that receives theme color CSS variables
},
};

View File

@@ -2,6 +2,7 @@
import { createRequire } from 'node:module'
import path from 'node:path'
import tailwindcss from '@tailwindcss/vite'
import legacy from '@vitejs/plugin-legacy'
import vue from '@vitejs/plugin-vue'
import { visualizer } from 'rollup-plugin-visualizer'
@@ -19,132 +20,133 @@ const require = createRequire(import.meta.url)
const process = require('node:process')
export default defineConfig(({ mode }) => {
const env = loadEnv(mode, __dirname)
const chunkName = mode === 'prebuild' ? '[name]' : 'chunk'
const env = loadEnv(mode, __dirname)
const chunkName = mode === 'prebuild' ? '[name]' : 'chunk'
return {
base: mode === 'file' ? './' : '/log-lottery/',
plugins: [
vue(),
mode === 'file'
? legacy({
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
})
: null,
// vueDevTools(),
viteCompression({
verbose: true,
disable: false,
threshold: 10240,
algorithm: 'gzip',
ext: '.gz',
}),
visualizer({
emitFile: true, // 是否被触摸
filename: 'test.html', // 生成分析网页文件名
open: true, // 在默认用户代理中打开生成的文件
gzipSize: true, // 从源代码中收集 gzip 大小并将其显示在图表中
brotliSize: true, // 从源代码中收集 brotli 大小并将其显示在图表中
}),
return {
base: mode === 'file' ? './' : '/log-lottery/',
plugins: [
vue(),
tailwindcss(),
mode === 'file'
? legacy({
additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
})
: null,
// vueDevTools(),
viteCompression({
verbose: true,
disable: false,
threshold: 10240,
algorithm: 'gzip',
ext: '.gz',
}),
visualizer({
emitFile: true, // 是否被触摸
filename: 'test.html', // 生成分析网页文件
open: true, // 在默认用户代理中打开生成的文件
gzipSize: true, // 从源代码中收集 gzip 大小并将其显示在图表中
brotliSize: true, // 从源代码中收集 brotli 大小并将其显示在图表中
}),
createSvgIconsPlugin({
// 指定需要缓存的图标文件夹
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
// 指定symbolId格式
symbolId: 'icon-[dir]-[name]',
}),
AutoImport({
resolvers: [
// 自动导入图标组件
IconsResolver({
prefix: 'Icon',
}),
createSvgIconsPlugin({
// 指定需要缓存的图标文件夹
iconDirs: [path.resolve(process.cwd(), 'src/icons')],
// 指定symbolId格式
symbolId: 'icon-[dir]-[name]',
}),
AutoImport({
resolvers: [
// 自动导入图标组件
IconsResolver({
prefix: 'Icon',
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'auto-imports.d.ts'),
}),
Components({
resolvers: [
// 自动注册图标组件
IconsResolver({
enabledCollections: ['ep'],
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'components.d.ts'),
}),
Icons({
autoInstall: true,
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'auto-imports.d.ts'),
}),
Components({
resolvers: [
// 自动注册图标组件
IconsResolver({
enabledCollections: ['ep'],
}),
],
dts: path.resolve(path.resolve(__dirname, 'src'), 'components.d.ts'),
}),
Icons({
autoInstall: true,
}),
],
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "@/style/global.scss" as *;',
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "@/style/global.scss" as *;',
},
},
// postcss: {
// plugins: [
// require('tailwindcss'),
// require('autoprefixer'),
// ]
// }
},
},
// postcss: {
// plugins: [
// require('tailwindcss'),
// require('autoprefixer'),
// ]
// }
},
server: {
host: 'localhost',
port: 6719,
proxy: {
'/api': {
target: env.VITE_BASE_URL,
// 是否跨域
changeOrigin: true,
// 路径重写
rewrite: path => path.replace(/^\/api/, ''),
server: {
host: 'localhost',
port: 6719,
proxy: {
'/api': {
target: env.VITE_BASE_URL,
// 是否跨域
changeOrigin: true,
// 路径重写
rewrite: path => path.replace(/^\/api/, ''),
},
},
},
},
},
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
build: {
minify: 'terser',
terserOptions: {
compress: {
// 生产环境时移除console
drop_console: true,
drop_debugger: true,
resolve: {
alias: {
'@': path.resolve(__dirname, './src'),
},
},
},
// 关闭文件计算
reportCompressedSize: false,
// 关闭生成map文件 可以达到缩小打包体积
sourcemap: false, // 这个生产环境一定要关闭,不然打包的产物会很大
rollupOptions: {
output: {
chunkFileNames: `js/${chunkName}-[hash].js`, // 引入文件名的名称
entryFileNames: `js/${chunkName}-[hash].js`, // 包的入口文件名称
assetFileNames: `[ext]/${chunkName}-[hash].[ext]`, // 资源文件像 字体,图片等
manualChunks(id: any): string {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString()
}
},
build: {
minify: 'terser',
terserOptions: {
compress: {
// 生产环境时移除console
drop_console: true,
drop_debugger: true,
},
},
// 关闭文件计算
reportCompressedSize: false,
// 关闭生成map文件 可以达到缩小打包体积
sourcemap: false, // 这个生产环境一定要关闭,不然打包的产物会很大
rollupOptions: {
output: {
chunkFileNames: `js/${chunkName}-[hash].js`, // 引入文件名的名称
entryFileNames: `js/${chunkName}-[hash].js`, // 包的入口文件名称
assetFileNames: `[ext]/${chunkName}-[hash].[ext]`, // 资源文件像 字体,图片等
manualChunks(id: any): string {
if (id.includes('node_modules')) {
return id
.toString()
.split('node_modules/')[1]
.split('/')[0]
.toString()
}
},
},
},
},
},
},
// 使用这个必须在上面加/// <reference types="vitest" /> 不然会有类型报错
test: {
globals: true, // --> 0.8.1+ 请修改成globals
environment: 'jsdom',
// include: ['**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
// passWithNoTests: true,
transformMode: {
web: [/\.[jt]sx$/],
},
},
}
// 使用这个必须在上面加/// <reference types="vitest" /> 不然会有类型报错
test: {
globals: true, // --> 0.8.1+ 请修改成globals
environment: 'jsdom',
// include: ['**/__tests__/**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
// passWithNoTests: true,
transformMode: {
web: [/\.[jt]sx$/],
},
},
}
})