Skip to content

Commit 73cb696

Browse files
docs: show a warning in v1 docs (#7003)
Co-authored-by: Vladimir Sheremet <[email protected]>
1 parent ef8cc00 commit 73cb696

File tree

6 files changed

+57
-2
lines changed

6 files changed

+57
-2
lines changed

docs/.vitepress/components.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ declare module 'vue' {
1313
HomePage: typeof import('./components/HomePage.vue')['default']
1414
ListItem: typeof import('./components/ListItem.vue')['default']
1515
NonProjectOption: typeof import('./components/NonProjectOption.vue')['default']
16+
OldDocument: typeof import('./components/OldDocument.vue')['default']
1617
RouterLink: typeof import('vue-router')['RouterLink']
1718
RouterView: typeof import('vue-router')['RouterView']
1819
Version: typeof import('./components/Version.vue')['default']
+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<template>
2+
<div class="old-document">
3+
<p>
4+
This documentation covers Vitest v1 <strong>(old version)</strong>. For the
5+
latest version, see
6+
<a href="https://vitest.dev" class="new-document-link">https://vitest.dev</a>.
7+
</p>
8+
</div>
9+
</template>
10+
11+
<style>
12+
:root {
13+
--vp-layout-top-height: 96px;
14+
@media (min-width: 455px) {
15+
--vp-layout-top-height: 64px;
16+
}
17+
@media (min-width: 960px) {
18+
--vp-layout-top-height: 32px;
19+
}
20+
}
21+
22+
.old-document {
23+
position: fixed;
24+
display: flex;
25+
height: var(--vp-layout-top-height);
26+
width: 100%;
27+
padding: 4px 32px;
28+
justify-content: center;
29+
align-items: center;
30+
color: var(--vp-c-old-document-text);
31+
background: var(--vp-c-old-document-bg);
32+
z-index: var(--vp-z-index-layout-top);
33+
34+
.new-document-link {
35+
text-decoration: underline;
36+
color: var(--vp-c-text-1);
37+
&:hover {
38+
color: var(--vp-c-text-2);
39+
}
40+
}
41+
}
42+
</style>

docs/.vitepress/style/vars.css

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
--vp-c-brand-3: #506e10;
99
--vp-c-sponsor: #ca2971;
1010
--vitest-c-sponsor-hover: #c13071;
11+
12+
/* Old Document */
13+
--vp-c-old-document-bg: #f4f8e0;
14+
--vp-c-old-document-text: #2a3a1b;
1115
}
1216

1317
.dark {
@@ -16,6 +20,10 @@
1620
--vp-c-brand-3: #acd268;
1721
--vp-c-sponsor: #ee4e95;
1822
--vitest-c-sponsor-hover: #e51370;
23+
24+
/* Old Document */
25+
--vp-c-old-document-bg: #2d3b2e;
26+
--vp-c-old-document-text: #c5d9b6;
1927
}
2028

2129

docs/.vitepress/theme/index.ts

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import '../style/main.css'
66
import '../style/vars.css'
77
import 'uno.css'
88
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
9+
import OldDocument from '../components/OldDocument.vue'
910
import HomePage from '../components/HomePage.vue'
1011
import Version from '../components/Version.vue'
1112
import '@shikijs/vitepress-twoslash/style.css'
@@ -18,6 +19,7 @@ export default {
1819
Layout() {
1920
return h(Theme.Layout, null, {
2021
'home-features-after': () => h(HomePage),
22+
'layout-top': () => h(OldDocument),
2123
})
2224
},
2325
enhanceApp({ app }: EnhanceAppContext) {

packages/coverage-istanbul/src/provider.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ import libCoverage from 'istanbul-lib-coverage'
1313
import libSourceMaps from 'istanbul-lib-source-maps'
1414
import { type Instrumenter, createInstrumenter } from 'istanbul-lib-instrument'
1515

16-
// @ts-expect-error missing types
16+
// eslint-disable-next-line ts/prefer-ts-expect-error
17+
// @ts-ignore missing types
1718
import _TestExclude from 'test-exclude'
1819
import { COVERAGE_STORE_KEY } from './constants'
1920

packages/coverage-v8/src/provider.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ import { BaseCoverageProvider } from 'vitest/coverage'
2323
import type { AfterSuiteRunMeta, CoverageProvider, CoverageV8Options, ReportContext, ResolvedCoverageOptions } from 'vitest'
2424
import type { Vitest } from 'vitest/node'
2525

26-
// @ts-expect-error missing types
26+
// eslint-disable-next-line ts/prefer-ts-expect-error
27+
// @ts-ignore missing types
2728
import _TestExclude from 'test-exclude'
2829

2930
interface TestExclude {

0 commit comments

Comments
 (0)