From 8c035988be0c34418d07ab22d29c50ef52e48e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joaqu=C3=ADn=20S=C3=A1nchez?= Date: Mon, 8 Jul 2024 16:49:13 +0200 Subject: [PATCH] docs: update VP theme configuration (#6051) --- docs/.vitepress/config.ts | 6 +++--- docs/.vitepress/theme/index.ts | 16 +++++++--------- docs/guide/browser/context.md | 1 + docs/tsconfig.json | 2 +- 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/docs/.vitepress/config.ts b/docs/.vitepress/config.ts index 757999b794db..cbaa58b6e641 100644 --- a/docs/.vitepress/config.ts +++ b/docs/.vitepress/config.ts @@ -37,8 +37,8 @@ export default ({ mode }: { mode: string }) => { }, head: [ ['meta', { name: 'theme-color', content: '#729b1a' }], - ['link', { rel: 'icon', href: '/favicon.ico', sizes: 'any' }], - ['link', { rel: 'icon', href: '/logo.svg', type: 'image/svg+xml' }], + ['link', { rel: 'icon', href: '/favicon.ico', sizes: '48x48' }], + ['link', { rel: 'icon', href: '/logo.svg', sizes: 'any', type: 'image/svg+xml' }], ['meta', { name: 'author', content: `${teamMembers.map(c => c.name).join(', ')} and ${vitestName} contributors` }], ['meta', { name: 'keywords', content: 'vitest, vite, test, coverage, snapshot, react, vue, preact, svelte, solid, lit, marko, ruby, cypress, puppeteer, jsdom, happy-dom, test-runner, jest, typescript, esm, tinypool, tinyspy, node' }], ['meta', { property: 'og:title', content: vitestName }], @@ -139,7 +139,7 @@ export default ({ mode }: { mode: string }) => { link: releases, }, { - text: 'Contributing ', + text: 'Contributing', link: contributing, }, ], diff --git a/docs/.vitepress/theme/index.ts b/docs/.vitepress/theme/index.ts index 97e274322241..cbbf93372ef4 100644 --- a/docs/.vitepress/theme/index.ts +++ b/docs/.vitepress/theme/index.ts @@ -1,6 +1,6 @@ import { h } from 'vue' -import Theme, { VPBadge } from 'vitepress/theme' -import type { EnhanceAppContext } from 'vitepress' +import type { Theme } from 'vitepress' +import DefaultTheme from 'vitepress/theme' import { inBrowser } from 'vitepress' import '../style/main.css' import '../style/vars.css' @@ -15,16 +15,14 @@ if (inBrowser) { } export default { - ...Theme, + extends: DefaultTheme, Layout() { - return h(Theme.Layout, null, { + return h(DefaultTheme.Layout, null, { 'home-features-after': () => h(HomePage), }) }, - enhanceApp({ app }: EnhanceAppContext) { - // Vitepress v1+ doesn't seem to expose it as a global "Badge" - app.component('Badge', VPBadge) + enhanceApp({ app }) { app.component('Version', Version) - app.use(TwoslashFloatingVue as any) + app.use(TwoslashFloatingVue) }, -} +} satisfies Theme diff --git a/docs/guide/browser/context.md b/docs/guide/browser/context.md index 191b92512e7d..7ef22cd13fd5 100644 --- a/docs/guide/browser/context.md +++ b/docs/guide/browser/context.md @@ -41,6 +41,7 @@ export const userEvent: { setup: () => UserEvent click: (element: Element, options?: UserEventClickOptions) => Promise dblClick: (element: Element, options?: UserEventDoubleClickOptions) => Promise + tripleClick: (element: Element, options?: UserEventTripleClickOptions) => Promise selectOptions: ( element: Element, values: HTMLElement | HTMLElement[] | string | string[], diff --git a/docs/tsconfig.json b/docs/tsconfig.json index ec3745208670..2e414a74e42a 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -5,7 +5,7 @@ "lib": ["DOM", "ESNext"], "baseUrl": ".", "module": "esnext", - "moduleResolution": "node", + "moduleResolution": "Bundler", "paths": { "~/*": ["src/*"] },