chore: Update package dependencies and optimize imports

This commit is contained in:
ccbikai 2024-07-08 20:28:38 +08:00
parent e16fb88c08
commit 01be05c0fc
13 changed files with 2226 additions and 3245 deletions

16
.github/FUNDING.yml vendored
View File

@ -1,14 +1,2 @@
# These are supported funding model platforms github: ccbikai
buy_me_a_coffee: ccbikai
github: ccbikai # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
patreon: # Replace with a single Patreon username
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
polar: # Replace with a single Polar username
buy_me_a_coffee: ccbikai # Replace with a single Buy Me a Coffee username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

View File

@ -1,7 +1,7 @@
<script setup> <script setup>
const { title, description, image } = useAppConfig() const { title, description, image } = useAppConfig()
useSeoMeta({ useSeoMeta({
title: title + ' - ' + description, title: `${title} - ${description}`,
description, description,
ogType: 'website', ogType: 'website',
ogTitle: title, ogTitle: title,

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { Sun, Moon, Laptop } from 'lucide-vue-next' import { Laptop, Moon, Sun } from 'lucide-vue-next'
const colorMode = useColorMode() const colorMode = useColorMode()
</script> </script>

View File

@ -1,8 +1,8 @@
<script setup> <script setup>
// https://vue3-simple-icons.wyatt-herkamp.dev/ // https://vue3-simple-icons.wyatt-herkamp.dev/
import { import {
AppleIcon,
AndroidIcon, AndroidIcon,
AppleIcon,
DebianIcon, DebianIcon,
FacebookIcon, FacebookIcon,
FirefoxBrowserIcon, FirefoxBrowserIcon,

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { Link, AreaChart, ServerOff, Paintbrush, Sparkles, Hourglass } from 'lucide-vue-next' import { AreaChart, Hourglass, Link, Paintbrush, ServerOff, Sparkles } from 'lucide-vue-next'
const features = ref([ const features = ref([
{ {

View File

@ -1,5 +1,5 @@
<script setup> <script setup>
import { GmailIcon, TelegramIcon, BloggerIcon, XIcon, MastodonIcon, GitHubIcon } from 'vue3-simple-icons' import { BloggerIcon, GitHubIcon, GmailIcon, MastodonIcon, TelegramIcon, XIcon } from 'vue3-simple-icons'
const email = ref(null) const email = ref(null)
onMounted(() => { onMounted(() => {

View File

@ -1,11 +1,11 @@
// @ts-check // @ts-check
// import antfu from '@antfu/eslint-config' import antfu from '@antfu/eslint-config'
import withNuxt from './.nuxt/eslint.config.mjs' import withNuxt from './.nuxt/eslint.config.mjs'
export default withNuxt( export default withNuxt(
// antfu(), antfu(),
{ {
ignores: ['components/ui'], ignores: ['components/ui', '.data', 'public/world.json'],
}, },
{ {
rules: { rules: {

View File

@ -1,6 +1,7 @@
// https://nuxt.com/docs/api/configuration/nuxt-config // https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({ export default defineNuxtConfig({
devtools: { enabled: true }, devtools: { enabled: true },
modules: [ modules: [
'@nuxthub/core', '@nuxthub/core',
'shadcn-nuxt', 'shadcn-nuxt',
@ -8,9 +9,11 @@ export default defineNuxtConfig({
'@nuxtjs/tailwindcss', '@nuxtjs/tailwindcss',
'@nuxtjs/color-mode', '@nuxtjs/color-mode',
], ],
colorMode: { colorMode: {
classSuffix: '', classSuffix: '',
}, },
routeRules: { routeRules: {
'/': { '/': {
prerender: true, prerender: true,
@ -19,25 +22,30 @@ export default defineNuxtConfig({
ssr: false, ssr: false,
}, },
}, },
hub: { hub: {
// ai: true,
analytics: true, analytics: true,
blob: false, blob: false,
cache: false, cache: false,
database: false, database: false,
kv: true, kv: true,
// ai: true,
}, },
eslint: { eslint: {
config: { config: {
stylistic: true, stylistic: true,
standalone: false,
}, },
}, },
nitro: { nitro: {
experimental: { experimental: {
// Enable Server API documentation within NuxtHub // Enable Server API documentation within NuxtHub
openAPI: true, openAPI: true,
}, },
}, },
runtimeConfig: { runtimeConfig: {
siteToken: 'SinkCool', siteToken: 'SinkCool',
redirectStatusCode: '301', redirectStatusCode: '301',
@ -52,4 +60,6 @@ export default defineNuxtConfig({
slugDefaultLength: '6', slugDefaultLength: '6',
}, },
}, },
})
compatibilityDate: '2024-07-08',
})

View File

@ -3,7 +3,10 @@
"type": "module", "type": "module",
"version": "0.1.2", "version": "0.1.2",
"private": true, "private": true,
"packageManager": "pnpm@9.1.2", "packageManager": "pnpm@9.5.0",
"engines": {
"node": ">=20.11"
},
"scripts": { "scripts": {
"dev": "nuxt dev", "dev": "nuxt dev",
"build": "nuxt build", "build": "nuxt build",
@ -17,46 +20,43 @@
"wrangler": "wrangler", "wrangler": "wrangler",
"lint-staged": "lint-staged" "lint-staged": "lint-staged"
}, },
"engines": {
"node": ">=20.11"
},
"dependencies": { "dependencies": {
"@unovis/ts": "^1.4.1", "@unovis/ts": "^1.4.2",
"@unovis/vue": "^1.4.1", "@unovis/vue": "^1.4.2",
"@vee-validate/zod": "^4.12.8", "@vee-validate/zod": "^4.13.2",
"@vueuse/core": "^10.9.0", "@vueuse/core": "^10.11.0",
"intl-parse-accept-language": "^1.0.0", "intl-parse-accept-language": "^1.0.0",
"lucide-vue-next": "^0.379.0", "lucide-vue-next": "^0.401.0",
"mysql-bricks": "^1.1.2", "mysql-bricks": "^1.1.2",
"nanoid": "^5.0.7", "nanoid": "^5.0.7",
"pluralize": "^8.0.0", "pluralize": "^8.0.0",
"qr-code-styling": "1.6.0-rc.1", "qr-code-styling": "1.6.0-rc.1",
"radix-vue": "^1.8.1", "radix-vue": "^1.9.0",
"ua-parser-js": "next", "ua-parser-js": "next",
"vee-validate": "^4.12.8", "vee-validate": "^4.13.2",
"virtua": "^0.31.0", "virtua": "^0.33.2",
"vue-sonner": "^1.1.2", "vue-sonner": "^1.1.3",
"vue3-simple-icons": "^11.13.0", "vue3-simple-icons": "^12.0.0",
"zod": "^3.23.8" "zod": "^3.23.8"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^2.18.1", "@antfu/eslint-config": "^2.21.3",
"@nuxt/eslint": "^0.3.13", "@nuxt/eslint": "^0.3.13",
"@nuxt/eslint-config": "^0.3.13", "@nuxt/eslint-config": "^0.3.13",
"@nuxthub/core": "^0.5.17", "@nuxthub/core": "^0.7.0",
"@nuxtjs/color-mode": "^3.4.1", "@nuxtjs/color-mode": "^3.4.2",
"@nuxtjs/tailwindcss": "^6.12.0", "@nuxtjs/tailwindcss": "^6.12.0",
"class-variance-authority": "^0.7.0", "class-variance-authority": "^0.7.0",
"clsx": "^2.1.1", "clsx": "^2.1.1",
"eslint": "^8.57.0", "eslint": "^8.57.0",
"lint-staged": "^15.2.4", "lint-staged": "^15.2.7",
"nuxt": "^3.11.2", "nuxt": "^3.12.3",
"shadcn-nuxt": "^0.10.4", "shadcn-nuxt": "^0.10.4",
"simple-git-hooks": "^2.11.1", "simple-git-hooks": "^2.11.1",
"tailwind-merge": "^2.3.0", "tailwind-merge": "^2.4.0",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",
"vue-tsc": "^2.0.19", "vue-tsc": "^2.0.26",
"wrangler": "^3.57.1" "wrangler": "^3.63.1"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"pre-commit": "npm run lint-staged" "pre-commit": "npm run lint-staged"

View File

@ -17,10 +17,11 @@ async function getLink() {
} }
function updateLink(link, type) { function updateLink(link, type) {
if (type === 'delete') if (type === 'delete') {
navigateTo('/dashboard/links', { navigateTo('/dashboard/links', {
replace: true, replace: true,
}) })
}
} }
onMounted(() => { onMounted(() => {

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
import { writeFileSync } from 'fs' import { writeFileSync } from 'node:fs'
import { join } from 'path' import { join } from 'node:path'
import { WorldMapSimplestTopoJSON } from '@unovis/ts/maps.js' import { WorldMapSimplestTopoJSON } from '@unovis/ts/maps.js'
writeFileSync(join(import.meta.dirname, '../public/world.json'), JSON.stringify(WorldMapSimplestTopoJSON), 'utf8') writeFileSync(join(import.meta.dirname, '../public/world.json'), JSON.stringify(WorldMapSimplestTopoJSON), 'utf8')

View File

@ -2,11 +2,12 @@ import type { H3Event } from 'h3'
import { parseURL } from 'ufo' import { parseURL } from 'ufo'
import { UAParser } from 'ua-parser-js' import { UAParser } from 'ua-parser-js'
import { import {
Apps,
Bots,
CLIs, CLIs,
Crawlers,
Emails, Emails,
ExtraDevices, ExtraDevices,
Fetchers,
InApps,
MediaPlayers, MediaPlayers,
Modules, Modules,
} from 'ua-parser-js/extensions' } from 'ua-parser-js/extensions'
@ -68,7 +69,7 @@ export function useAccessLog(event: H3Event) {
const userAgent = getHeader(event, 'user-agent') || '' const userAgent = getHeader(event, 'user-agent') || ''
const uaInfo = (new UAParser(userAgent, { const uaInfo = (new UAParser(userAgent, {
browser: [Apps.browser || [], Bots.browser || [], CLIs.browser || [], Emails.browser || [], MediaPlayers.browser || [], Modules.browser || []].flat(), browser: [Crawlers.browser || [], CLIs.browser || [], Emails.browser || [], Fetchers.browser || [], InApps.browser || [], MediaPlayers.browser || [], Modules.browser || []].flat(),
device: [ExtraDevices.device || []].flat(), device: [ExtraDevices.device || []].flat(),
})).getResult() })).getResult()
@ -90,7 +91,6 @@ export function useAccessLog(event: H3Event) {
language, language,
os: uaInfo?.os?.name, os: uaInfo?.os?.name,
browser: uaInfo?.browser?.name, browser: uaInfo?.browser?.name,
// @ts-expect-error todo
browserType: uaInfo?.browser?.type, browserType: uaInfo?.browser?.type,
device: uaInfo?.device?.model, device: uaInfo?.device?.model,
deviceType: uaInfo?.device?.type, deviceType: uaInfo?.device?.type,