Skip to content

Commit

Permalink
fix: resolve TypeScript type errors in .vitepress/config (#2549)
Browse files Browse the repository at this point in the history
* fix: resolve TypeScript type errors in .vitepress/config

* ci: add docs typecheck
  • Loading branch information
DDDDD12138 authored Nov 20, 2024
1 parent 30b7491 commit c493cc7
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 11 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,4 @@ jobs:
- run: pnpm run test:build
- run: pnpm run tsd
- run: pnpm run vue-tsc
- run: pnpm run tsc:docs
7 changes: 2 additions & 5 deletions docs/.vitepress/config/en.mts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { DefaultTheme, LocalSpecificConfig } from 'vitepress'
import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress'

export const META_URL = ''
export const META_TITLE = 'Vue Test Utils'
export const META_DESCRIPTION = 'The official testing suite utils for Vue.js 3'

export const enConfig: LocalSpecificConfig<DefaultTheme.config> = {
export const enConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
description: META_DESCRIPTION,
head: [
['meta', { property: 'og:url', content: META_URL }],
Expand Down Expand Up @@ -39,7 +39,6 @@ export const enConfig: LocalSpecificConfig<DefaultTheme.config> = {
},
{
text: 'Essentials',
collapsable: false,
items: [
{ text: 'Getting Started', link: '/guide/' },
{ text: 'A Crash Course', link: '/guide/essentials/a-crash-course' },
Expand All @@ -64,7 +63,6 @@ export const enConfig: LocalSpecificConfig<DefaultTheme.config> = {
},
{
text: 'Vue Test Utils in depth',
collapsable: false,
items: [
{ text: 'Slots', link: '/guide/advanced/slots' },
{
Expand Down Expand Up @@ -97,7 +95,6 @@ export const enConfig: LocalSpecificConfig<DefaultTheme.config> = {
},
{
text: 'Extending Vue Test Utils',
collapsable: false,
items: [
{ text: 'Plugins', link: '/guide/extending-vtu/plugins' },
{
Expand Down
7 changes: 2 additions & 5 deletions docs/.vitepress/config/fr.mts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { DefaultTheme, LocalSpecificConfig } from 'vitepress'
import type { DefaultTheme, LocaleSpecificConfig } from 'vitepress'

export const META_URL = ''
export const META_TITLE = 'Vue Test Utils'
export const META_DESCRIPTION = 'La librairie officielle de tests unitaires pour Vue.js 3'

export const frConfig: LocalSpecificConfig<DefaultTheme.config> = {
export const frConfig: LocaleSpecificConfig<DefaultTheme.Config> = {
description: META_DESCRIPTION,
head: [
['meta', { property: 'og:url', content: META_URL }],
Expand Down Expand Up @@ -43,7 +43,6 @@ export const frConfig: LocalSpecificConfig<DefaultTheme.config> = {
},
{
text: 'Les Bases',
collapsable: false,
items: [
{ text: 'Pour commencer', link: '/fr/guide/' },
{ text: 'Cours rapide', link: '/fr/guide/essentials/a-crash-course' },
Expand All @@ -68,7 +67,6 @@ export const frConfig: LocalSpecificConfig<DefaultTheme.config> = {
},
{
text: 'Vue Test Utils en détail',
collapsable: false,
items: [
{ text: 'Slots', link: '/fr/guide/advanced/slots' },
{
Expand Down Expand Up @@ -101,7 +99,6 @@ export const frConfig: LocalSpecificConfig<DefaultTheme.config> = {
},
{
text: 'Extensions de Vue Test Utils',
collapsable: false,
items: [
{ text: 'Plugins', link: '/fr/guide/extending-vtu/plugins' },
{
Expand Down
10 changes: 10 additions & 0 deletions docs/.vitepress/tsconfig.vitepress.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"skipLibCheck": true,
"noEmit": true,
"allowImportingTsExtensions": true,
"resolveJsonModule": true
},
"include": ["./config", "./theme"]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
"test:watch": "vitest --watch",
"test:build": "vitest --mode test-build",
"tsd": "tsc -p test-dts/tsconfig.tsd.json",
"tsc:docs": "vue-tsc -p docs/.vitepress/tsconfig.vitepress.json",
"build": "rollup -c rollup.config.ts --bundleConfigAsCjs",
"prepare": "rollup -c rollup.config.ts --bundleConfigAsCjs",
"lint": "eslint .",
Expand Down Expand Up @@ -125,4 +126,4 @@
]
}
}
}
}

0 comments on commit c493cc7

Please sign in to comment.