Skip to content

Commit

Permalink
docs: show a warning in v1 docs (#7003)
Browse files Browse the repository at this point in the history
Co-authored-by: Vladimir Sheremet <[email protected]>
  • Loading branch information
shulaoda and sheremet-va authored Dec 3, 2024
1 parent ef8cc00 commit 73cb696
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/.vitepress/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ declare module 'vue' {
HomePage: typeof import('./components/HomePage.vue')['default']
ListItem: typeof import('./components/ListItem.vue')['default']
NonProjectOption: typeof import('./components/NonProjectOption.vue')['default']
OldDocument: typeof import('./components/OldDocument.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
Version: typeof import('./components/Version.vue')['default']
Expand Down
42 changes: 42 additions & 0 deletions docs/.vitepress/components/OldDocument.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<template>
<div class="old-document">
<p>
This documentation covers Vitest v1 <strong>(old version)</strong>. For the
latest version, see
<a href="https://vitest.dev" class="new-document-link">https://vitest.dev</a>.
</p>
</div>
</template>

<style>
:root {
--vp-layout-top-height: 96px;
@media (min-width: 455px) {
--vp-layout-top-height: 64px;
}
@media (min-width: 960px) {
--vp-layout-top-height: 32px;
}
}
.old-document {
position: fixed;
display: flex;
height: var(--vp-layout-top-height);
width: 100%;
padding: 4px 32px;
justify-content: center;
align-items: center;
color: var(--vp-c-old-document-text);
background: var(--vp-c-old-document-bg);
z-index: var(--vp-z-index-layout-top);
.new-document-link {
text-decoration: underline;
color: var(--vp-c-text-1);
&:hover {
color: var(--vp-c-text-2);
}
}
}
</style>
8 changes: 8 additions & 0 deletions docs/.vitepress/style/vars.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
--vp-c-brand-3: #506e10;
--vp-c-sponsor: #ca2971;
--vitest-c-sponsor-hover: #c13071;

/* Old Document */
--vp-c-old-document-bg: #f4f8e0;
--vp-c-old-document-text: #2a3a1b;
}

.dark {
Expand All @@ -16,6 +20,10 @@
--vp-c-brand-3: #acd268;
--vp-c-sponsor: #ee4e95;
--vitest-c-sponsor-hover: #e51370;

/* Old Document */
--vp-c-old-document-bg: #2d3b2e;
--vp-c-old-document-text: #c5d9b6;
}


Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import '../style/main.css'
import '../style/vars.css'
import 'uno.css'
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
import OldDocument from '../components/OldDocument.vue'
import HomePage from '../components/HomePage.vue'
import Version from '../components/Version.vue'
import '@shikijs/vitepress-twoslash/style.css'
Expand All @@ -18,6 +19,7 @@ export default {
Layout() {
return h(Theme.Layout, null, {
'home-features-after': () => h(HomePage),
'layout-top': () => h(OldDocument),
})
},
enhanceApp({ app }: EnhanceAppContext) {
Expand Down
3 changes: 2 additions & 1 deletion packages/coverage-istanbul/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ import libCoverage from 'istanbul-lib-coverage'
import libSourceMaps from 'istanbul-lib-source-maps'
import { type Instrumenter, createInstrumenter } from 'istanbul-lib-instrument'

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

Expand Down
3 changes: 2 additions & 1 deletion packages/coverage-v8/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import { BaseCoverageProvider } from 'vitest/coverage'
import type { AfterSuiteRunMeta, CoverageProvider, CoverageV8Options, ReportContext, ResolvedCoverageOptions } from 'vitest'
import type { Vitest } from 'vitest/node'

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

interface TestExclude {
Expand Down

0 comments on commit 73cb696

Please sign in to comment.