chore: update deps

This commit is contained in:
Anthony Fu 2024-02-29 14:26:22 +01:00
parent 879826a59e
commit 182a26fe04
5 changed files with 875 additions and 923 deletions

10
auto-imports.d.ts vendored
View File

@ -30,7 +30,7 @@ declare global {
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent'] const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
const defineComponent: typeof import('vue')['defineComponent'] const defineComponent: typeof import('vue')['defineComponent']
const defineLoader: typeof import('vue-router/auto')['defineLoader'] const defineLoader: typeof import('vue-router/auto')['defineLoader']
const definePage: typeof import('unplugin-vue-router/runtime')['_definePage'] const definePage: typeof import('unplugin-vue-router/runtime')['definePage']
const eagerComputed: typeof import('@vueuse/core')['eagerComputed'] const eagerComputed: typeof import('@vueuse/core')['eagerComputed']
const effectScope: typeof import('vue')['effectScope'] const effectScope: typeof import('vue')['effectScope']
const extendRef: typeof import('@vueuse/core')['extendRef'] const extendRef: typeof import('@vueuse/core')['extendRef']
@ -297,6 +297,7 @@ declare global {
// for vue template auto import // for vue template auto import
import { UnwrapRef } from 'vue' import { UnwrapRef } from 'vue'
declare module 'vue' { declare module 'vue' {
interface GlobalComponents {}
interface ComponentCustomProperties { interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']> readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
@ -322,8 +323,7 @@ declare module 'vue' {
readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']> readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']> readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']> readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineLoader: UnwrapRef<typeof import('vue-router/auto')['defineLoader']> readonly definePage: UnwrapRef<typeof import('unplugin-vue-router/runtime')['definePage']>
readonly definePage: UnwrapRef<typeof import('unplugin-vue-router/runtime')['_definePage']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']> readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']> readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']> readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>
@ -583,6 +583,7 @@ declare module 'vue' {
} }
} }
declare module '@vue/runtime-core' { declare module '@vue/runtime-core' {
interface GlobalComponents {}
interface ComponentCustomProperties { interface ComponentCustomProperties {
readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']> readonly EffectScope: UnwrapRef<typeof import('vue')['EffectScope']>
readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']> readonly asyncComputed: UnwrapRef<typeof import('@vueuse/core')['asyncComputed']>
@ -608,8 +609,7 @@ declare module '@vue/runtime-core' {
readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']> readonly debouncedWatch: UnwrapRef<typeof import('@vueuse/core')['debouncedWatch']>
readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']> readonly defineAsyncComponent: UnwrapRef<typeof import('vue')['defineAsyncComponent']>
readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']> readonly defineComponent: UnwrapRef<typeof import('vue')['defineComponent']>
readonly defineLoader: UnwrapRef<typeof import('vue-router/auto')['defineLoader']> readonly definePage: UnwrapRef<typeof import('unplugin-vue-router/runtime')['definePage']>
readonly definePage: UnwrapRef<typeof import('unplugin-vue-router/runtime')['_definePage']>
readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']> readonly eagerComputed: UnwrapRef<typeof import('@vueuse/core')['eagerComputed']>
readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']> readonly effectScope: UnwrapRef<typeof import('vue')['effectScope']>
readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']> readonly extendRef: UnwrapRef<typeof import('@vueuse/core')['extendRef']>

View File

@ -1,7 +1,7 @@
{ {
"type": "module", "type": "module",
"private": true, "private": true,
"packageManager": "pnpm@8.14.3", "packageManager": "pnpm@8.15.4",
"scripts": { "scripts": {
"build": "vite build", "build": "vite build",
"dev": "vite --port 3333 --open", "dev": "vite --port 3333 --open",
@ -13,35 +13,35 @@
"postinstall": "npx simple-git-hooks" "postinstall": "npx simple-git-hooks"
}, },
"dependencies": { "dependencies": {
"@vueuse/core": "^10.7.2", "@vueuse/core": "^10.9.0",
"vue": "^3.4.15", "vue": "^3.4.21",
"vue-router": "^4.2.5" "vue-router": "^4.3.0"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^2.6.3", "@antfu/eslint-config": "^2.6.4",
"@iconify-json/carbon": "^1.1.28", "@iconify-json/carbon": "^1.1.30",
"@types/node": "^20.11.5", "@types/node": "^20.11.23",
"@unocss/eslint-config": "^0.58.3", "@unocss/eslint-config": "^0.58.5",
"@unocss/eslint-plugin": "^0.58.3", "@unocss/eslint-plugin": "^0.58.5",
"@unocss/reset": "^0.58.3", "@unocss/reset": "^0.58.5",
"@vitejs/plugin-vue": "^5.0.3", "@vitejs/plugin-vue": "^5.0.4",
"@vue-macros/volar": "^0.18.11", "@vue-macros/volar": "^0.18.11",
"@vue/test-utils": "^2.4.3", "@vue/test-utils": "^2.4.4",
"eslint": "^8.56.0", "eslint": "^8.57.0",
"eslint-plugin-format": "^0.1.0", "eslint-plugin-format": "^0.1.0",
"jsdom": "^24.0.0", "jsdom": "^24.0.0",
"lint-staged": "^15.2.0", "lint-staged": "^15.2.2",
"pnpm": "^8.14.3", "pnpm": "^8.15.4",
"simple-git-hooks": "^2.9.0", "simple-git-hooks": "^2.9.0",
"taze": "^0.13.1", "taze": "^0.13.3",
"typescript": "^5.3.3", "typescript": "^5.3.3",
"unocss": "^0.58.3", "unocss": "^0.58.5",
"unplugin-auto-import": "^0.17.3", "unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.26.0", "unplugin-vue-components": "^0.26.0",
"unplugin-vue-macros": "^2.7.10", "unplugin-vue-macros": "^2.7.10",
"unplugin-vue-router": "^0.7.0", "unplugin-vue-router": "^0.8.4",
"vite": "^5.0.12", "vite": "^5.1.4",
"vitest": "^1.2.1", "vitest": "^1.3.1",
"vue-tsc": "^1.8.27" "vue-tsc": "^1.8.27"
}, },
"simple-git-hooks": { "simple-git-hooks": {

1597
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@ -12,7 +12,8 @@
"resolveJsonModule": true, "resolveJsonModule": true,
"types": [ "types": [
"vite/client", "vite/client",
"unplugin-vue-macros/macros-global" "unplugin-vue-macros/macros-global",
"unplugin-vue-router/client"
], ],
"allowJs": true, "allowJs": true,
"strict": true, "strict": true,
@ -22,5 +23,9 @@
"forceConsistentCasingInFileNames": true, "forceConsistentCasingInFileNames": true,
"skipLibCheck": true "skipLibCheck": true
}, },
"exclude": ["dist", "node_modules", "eslint.config.js"] "exclude": [
"dist",
"node_modules",
"eslint.config.js"
]
} }

126
typed-router.d.ts vendored
View File

@ -5,139 +5,21 @@
// It's recommended to commit this file. // It's recommended to commit this file.
// Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry. // Make sure to add this file to your tsconfig.json file as an "includes" or "files" entry.
/// <reference types="unplugin-vue-router/client" /> declare module 'vue-router/auto-routes' {
import type { import type {
// type safe route locations
RouteLocationTypedList,
RouteLocationResolvedTypedList,
RouteLocationNormalizedTypedList,
RouteLocationNormalizedLoadedTypedList,
RouteLocationAsString,
RouteLocationAsRelativeTypedList,
RouteLocationAsPathTypedList,
// helper types
// route definitions
RouteRecordInfo, RouteRecordInfo,
ParamValue, ParamValue,
ParamValueOneOrMore, ParamValueOneOrMore,
ParamValueZeroOrMore, ParamValueZeroOrMore,
ParamValueZeroOrOne, ParamValueZeroOrOne,
// vue-router extensions
_RouterTyped,
RouterLinkTyped,
RouterLinkPropsTyped,
NavigationGuard,
UseLinkFnTyped,
// data fetching
_DataLoader,
_DefineLoaderOptions,
} from 'unplugin-vue-router/types' } from 'unplugin-vue-router/types'
declare module 'vue-router/auto/routes' { /**
* Route name map generated by unplugin-vue-router
*/
export interface RouteNamedMap { export interface RouteNamedMap {
'/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>, '/': RouteRecordInfo<'/', '/', Record<never, never>, Record<never, never>>,
'/[...all]': RouteRecordInfo<'/[...all]', '/:all(.*)', { all: ParamValue<true> }, { all: ParamValue<false> }>, '/[...all]': RouteRecordInfo<'/[...all]', '/:all(.*)', { all: ParamValue<true> }, { all: ParamValue<false> }>,
'/hi/[name]': RouteRecordInfo<'/hi/[name]', '/hi/:name', { name: ParamValue<true> }, { name: ParamValue<false> }>, '/hi/[name]': RouteRecordInfo<'/hi/[name]', '/hi/:name', { name: ParamValue<true> }, { name: ParamValue<false> }>,
} }
} }
declare module 'vue-router/auto' {
import type { RouteNamedMap } from 'vue-router/auto/routes'
export type RouterTyped = _RouterTyped<RouteNamedMap>
/**
* Type safe version of `RouteLocationNormalized` (the type of `to` and `from` in navigation guards).
* Allows passing the name of the route to be passed as a generic.
*/
export type RouteLocationNormalized<Name extends keyof RouteNamedMap = keyof RouteNamedMap> = RouteLocationNormalizedTypedList<RouteNamedMap>[Name]
/**
* Type safe version of `RouteLocationNormalizedLoaded` (the return type of `useRoute()`).
* Allows passing the name of the route to be passed as a generic.
*/
export type RouteLocationNormalizedLoaded<Name extends keyof RouteNamedMap = keyof RouteNamedMap> = RouteLocationNormalizedLoadedTypedList<RouteNamedMap>[Name]
/**
* Type safe version of `RouteLocationResolved` (the returned route of `router.resolve()`).
* Allows passing the name of the route to be passed as a generic.
*/
export type RouteLocationResolved<Name extends keyof RouteNamedMap = keyof RouteNamedMap> = RouteLocationResolvedTypedList<RouteNamedMap>[Name]
/**
* Type safe version of `RouteLocation` . Allows passing the name of the route to be passed as a generic.
*/
export type RouteLocation<Name extends keyof RouteNamedMap = keyof RouteNamedMap> = RouteLocationTypedList<RouteNamedMap>[Name]
/**
* Type safe version of `RouteLocationRaw` . Allows passing the name of the route to be passed as a generic.
*/
export type RouteLocationRaw<Name extends keyof RouteNamedMap = keyof RouteNamedMap> =
| RouteLocationAsString<RouteNamedMap>
| RouteLocationAsRelativeTypedList<RouteNamedMap>[Name]
| RouteLocationAsPathTypedList<RouteNamedMap>[Name]
/**
* Generate a type safe params for a route location. Requires the name of the route to be passed as a generic.
*/
export type RouteParams<Name extends keyof RouteNamedMap> = RouteNamedMap[Name]['params']
/**
* Generate a type safe raw params for a route location. Requires the name of the route to be passed as a generic.
*/
export type RouteParamsRaw<Name extends keyof RouteNamedMap> = RouteNamedMap[Name]['paramsRaw']
export function useRouter(): RouterTyped
export function useRoute<Name extends keyof RouteNamedMap = keyof RouteNamedMap>(name?: Name): RouteLocationNormalizedLoadedTypedList<RouteNamedMap>[Name]
export const useLink: UseLinkFnTyped<RouteNamedMap>
export function onBeforeRouteLeave(guard: NavigationGuard<RouteNamedMap>): void
export function onBeforeRouteUpdate(guard: NavigationGuard<RouteNamedMap>): void
export const RouterLink: RouterLinkTyped<RouteNamedMap>
export const RouterLinkProps: RouterLinkPropsTyped<RouteNamedMap>
// Experimental Data Fetching
export function defineLoader<
P extends Promise<any>,
Name extends keyof RouteNamedMap = keyof RouteNamedMap,
isLazy extends boolean = false,
>(
name: Name,
loader: (route: RouteLocationNormalizedLoaded<Name>) => P,
options?: _DefineLoaderOptions<isLazy>,
): _DataLoader<Awaited<P>, isLazy>
export function defineLoader<
P extends Promise<any>,
isLazy extends boolean = false,
>(
loader: (route: RouteLocationNormalizedLoaded) => P,
options?: _DefineLoaderOptions<isLazy>,
): _DataLoader<Awaited<P>, isLazy>
export {
_definePage as definePage,
_HasDataLoaderMeta as HasDataLoaderMeta,
_setupDataFetchingGuard as setupDataFetchingGuard,
_stopDataFetchingScope as stopDataFetchingScope,
} from 'unplugin-vue-router/runtime'
}
declare module 'vue-router' {
import type { RouteNamedMap } from 'vue-router/auto/routes'
export interface TypesConfig {
beforeRouteUpdate: NavigationGuard<RouteNamedMap>
beforeRouteLeave: NavigationGuard<RouteNamedMap>
$route: RouteLocationNormalizedLoadedTypedList<RouteNamedMap>[keyof RouteNamedMap]
$router: _RouterTyped<RouteNamedMap>
RouterLink: RouterLinkTyped<RouteNamedMap>
}
}