Skip to content

Commit

Permalink
docs: add banner component (#7264)
Browse files Browse the repository at this point in the history
Co-authored-by: dalaoshu <laipichan@qq.com>
  • Loading branch information
sheremet-va and shulaoda authored Jan 16, 2025
1 parent d69cc75 commit 5c45d06
Show file tree
Hide file tree
Showing 5 changed files with 55 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']
Version: typeof import('./components/Version.vue')['default']
}
}
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 v2 <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 { enhanceAppWithTabs } from 'vitepress-plugin-tabs/client'
import { h } from 'vue'
import HomePage from '../components/HomePage.vue'
import Version from '../components/Version.vue'
import OldDocument from '../components/OldDocument.vue'
import '../style/main.css'
import '../style/vars.css'
import 'uno.css'
Expand All @@ -20,6 +21,7 @@ export default {
Layout() {
return h(DefaultTheme.Layout, null, {
'home-features-after': () => h(HomePage),
'layout-top': () => h(OldDocument),
})
},
enhanceApp({ app }) {
Expand Down
4 changes: 2 additions & 2 deletions packages/coverage-istanbul/src/provider.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import type { CoverageProvider, ReportContext, ResolvedCoverageOptions, Vitest } from 'vitest/node'
import { promises as fs } from 'node:fs'
// @ts-expect-error missing types
import { defaults as istanbulDefaults } from '@istanbuljs/schema'
import createDebug from 'debug'
import libCoverage, { type CoverageMap } from 'istanbul-lib-coverage'
import { createInstrumenter, type Instrumenter } from 'istanbul-lib-instrument'
Expand All @@ -11,8 +13,6 @@ import { resolve } from 'pathe'
import TestExclude from 'test-exclude'
import c from 'tinyrainbow'
import { BaseCoverageProvider } from 'vitest/coverage'
// @ts-expect-error missing types
import { defaults as istanbulDefaults } from '@istanbuljs/schema'

import { version } from '../package.json' with { type: 'json' }
import { COVERAGE_STORE_KEY } from './constants'
Expand Down

0 comments on commit 5c45d06

Please sign in to comment.