Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/issue-close-require.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
issues: write # for actions-cool/issues-helper to update issues
steps:
- name: needs reproduction
uses: actions-cool/issues-helper@9861779a695cf1898bd984c727f685f351cfc372 # v3.7.2
uses: actions-cool/issues-helper@e2ff99831a4f13625d35064e2b3dfe65c07a0396 # v3.7.5
with:
actions: close-issues
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-labeled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
steps:
- name: needs reproduction
if: github.event.label.name == 'needs reproduction'
uses: actions-cool/issues-helper@9861779a695cf1898bd984c727f685f351cfc372 # v3.7.2
uses: actions-cool/issues-helper@e2ff99831a4f13625d35064e2b3dfe65c07a0396 # v3.7.5
with:
actions: create-comment
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ bench/test/*/*/
**/bench.json
**/browser/browser.json
docs/public/user-avatars
docs/public/sponsors
.eslintcache
docs/.vitepress/cache/
!test/cli/fixtures/dotted-files/**/.cache
Expand Down
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
<p align="center">
<a href="https://vitest.dev">
<img src="https://user-images.githubusercontent.com/11247099/145112184-a9ff6727-661c-439d-9ada-963124a281f7.png" height="150">
</a>
<br>
<br>
<a href="https://vitest.dev" target="_blank" rel="noopener noreferrer">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://vitest.dev/vitest-light.svg">
<source media="(prefers-color-scheme: light)" srcset="https://vitest.dev/vitest-dark.svg">
<img alt="rolldown logo" src="https://vitest.dev/vitest-dark.svg" height="60">
</picture>
</a>
<br>
<br>
<br>
</p>

<h1 align="center">
Expand Down
8 changes: 7 additions & 1 deletion docs/.vitepress/components/Advanced.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<Badge type="danger" title="This is an advanced API intended for library authors and framework integrations. Most users should not need this." class="cursor-help">
<Badge type="danger" title="This is an advanced API intended for library authors and framework integrations. Most users should not need this." class="advanced-badge">
advanced
</Badge>
</template>

<style scoped>
.advanced-badge {
cursor: help;
}
</style>
22 changes: 20 additions & 2 deletions docs/.vitepress/components/CRoot.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
<script setup>
import { Icon } from '@iconify/vue'
</script>

<template>
<Badge type="warning" title="This options is only available in the top level config. You cannot specify it as an option of a test project." class="underline decoration-dotted cursor-help">
<div i-carbon:document-configuration class="my-1 -mx-1" />
<Badge type="warning" title="This options is only available in the top level config. You cannot specify it as an option of a test project." class="croot-badge">
<Icon icon="carbon:document-configuration" class="croot-icon" />
</Badge>
</template>

<style scoped>
.croot-badge {
text-decoration: underline;
text-decoration-style: dotted;
cursor: help;
}
.croot-icon {
margin-top: 0.25rem;
margin-bottom: 0.25rem;
margin-left: -0.25rem;
margin-right: -0.25rem;
}
</style>
23 changes: 21 additions & 2 deletions docs/.vitepress/components/CourseLink.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,31 @@
<script setup lang="ts">
import { Icon } from '@iconify/vue'

defineProps<{
href: string
}>()
</script>

<template>
<a :href="href" target="_blank" bg-green:10 px4 py3 rounded block mt2 flex items-center gap2>
<div i-carbon:play-filled flex-none text-lg />
<a :href="href" target="_blank" class="course-link">
<Icon icon="carbon:play-filled" class="course-icon" />
<slot />
</a>
</template>

<style scoped>
.course-link {
background-color: rgb(34 197 94 / 0.1);
padding: 0.75rem 1rem;
border-radius: 0.25rem;
display: flex;
align-items: center;
gap: 0.5rem;
margin-top: 0.5rem;
}

.course-icon {
flex: none;
font-size: 1.125rem;
}
</style>
8 changes: 7 additions & 1 deletion docs/.vitepress/components/Experimental.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
<template>
<Badge type="warning" title="This feature is experimental and does not follow SemVer." class="cursor-help">
<Badge type="warning" title="This feature is experimental and does not follow SemVer." class="experimental-badge">
experimental
</Badge>
</template>

<style scoped>
.experimental-badge {
cursor: help;
}
</style>
4 changes: 3 additions & 1 deletion docs/.vitepress/components/FeaturesList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import ListItem from './ListItem.vue'
<ul
class="features-list"
dir="auto"
flex="~ col gap2 md:gap-3"
>
<ListItem><a target="_blank" href="https://vitejs.dev" rel="noopener noreferrer">Vite</a>'s config, transformers, resolvers, and plugins</ListItem>
<ListItem>Use the same setup from your app to run the tests!</ListItem>
Expand Down Expand Up @@ -44,5 +43,8 @@ import ListItem from './ListItem.vue'

.features-list {
padding: 0;
display: flex;
flex-direction: column;
gap: 0.5rem;
}
</style>
2 changes: 1 addition & 1 deletion docs/.vitepress/components/HomePage.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { VPHomeSponsors } from 'vitepress/theme'
import { VPHomeSponsors } from '@voidzero-dev/vitepress-theme'
import { sponsors } from '../sponsors'
</script>

Expand Down
62 changes: 46 additions & 16 deletions docs/.vitepress/components/ListItem.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { Icon } from '@iconify/vue'
import { until, useElementVisibility } from '@vueuse/core'
import { computed, effectScope, onMounted, ref } from 'vue'

Expand Down Expand Up @@ -39,23 +40,15 @@ onMounted(async () => {

<template>
<li :style="color">
<div
ref="el"
relative
m="ya r-1"
w-5
h-5
flex-none
align-mid
>
<div absolute transition duration-300 :class="state ? 'flip' : ''">
<div i-carbon:circle-dash animate-spin animate-2s text-yellow4 />
<div ref="el" class="icon-container">
<div class="icon-wrapper" :class="state ? 'flip' : ''">
<Icon icon="carbon:circle-dash" class="icon-spinner" width="1.2em" height="1.2em" />
</div>
<div absolute transition duration-300 :class="state === 2 ? '' : 'flip'">
<div i-carbon:close-outline text-red4 />
<div class="icon-wrapper" :class="state === 2 ? '' : 'flip'">
<Icon icon="carbon:close-outline" class="icon-error" width="1.2em" height="1.2em" />
</div>
<div absolute transition duration-300 :class="state === 1 ? '' : 'flip'">
<div i-carbon:checkmark-outline class="text-$vp-c-brand-1" />
<div class="icon-wrapper" :class="state === 1 ? '' : 'flip'">
<Icon icon="carbon:checkmark-outline" class="icon-success" width="1.2em" height="1.2em" />
</div>
</div>
<div>
Expand All @@ -64,8 +57,45 @@ onMounted(async () => {
</li>
</template>

<style>
<style scoped>
.icon-container {
position: relative;
width: 1.2em;
height: 1.2em;
flex: none;
margin-top: auto;
margin-bottom: auto;
vertical-align: middle;
}

.icon-wrapper {
position: absolute;
transition: all 300ms;
}

.flip {
transform: rotateY(90deg);
}

.icon-spinner {
animation: spin 1s linear infinite;
color: rgb(250, 204, 21);
}

.icon-error {
color: rgb(248, 113, 113);
}

.icon-success {
color: var(--vp-c-brand-1);
}

@keyframes spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
}
}
</style>
2 changes: 1 addition & 1 deletion docs/.vitepress/components/Version.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { VPBadge } from 'vitepress/theme'
import { VPBadge } from '@voidzero-dev/vitepress-theme'

const { type = 'stable' } = defineProps<{
type?: 'stable' | 'experimental'
Expand Down
80 changes: 62 additions & 18 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
import {
groupIconMdPlugin,
groupIconVitePlugin,
localIconLoader,
} from 'vitepress-plugin-group-icons'
import llmstxt from 'vitepress-plugin-llms'
import { version } from '../../package.json'
Expand All @@ -25,9 +26,10 @@ import {
} from './meta'
import { pwa } from './scripts/pwa'
import { transformHead } from './scripts/transformHead'
import { extendConfig } from '@voidzero-dev/vitepress-theme/config'

export default ({ mode }: { mode: string }) => {
return withPwa(defineConfig({
return withPwa(extendConfig(defineConfig({
lang: 'en-US',
title: vitestName,
description: vitestDescription,
Expand All @@ -47,9 +49,8 @@ export default ({ mode }: { mode: string }) => {
},
},
head: [
['meta', { name: 'theme-color', content: '#729b1a' }],
['link', { rel: 'icon', href: '/favicon.ico', sizes: '48x48' }],
['link', { rel: 'icon', href: '/logo.svg', sizes: 'any', type: 'image/svg+xml' }],
['meta', { name: 'theme-color', content: '#22FF84' }],
['link', { rel: 'icon', href: '/logo-without-border.svg', 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, tinyspy, node' }],
['meta', { property: 'og:title', content: vitestName }],
Expand All @@ -69,16 +70,17 @@ export default ({ mode }: { mode: string }) => {
groupIconVitePlugin({
customIcon: {
'CLI': 'vscode-icons:file-type-shell',
'vitest.shims': 'vscode-icons:file-type-vitest',
'vitest.config': 'vscode-icons:file-type-vitest',
'vitest.workspace': 'vscode-icons:file-type-vitest',
'vitest.shims': localIconLoader(import.meta.url, '../public/logo-without-border.svg'),
'vitest.config': localIconLoader(import.meta.url, '../public/logo-without-border.svg'),
'vitest.workspace': localIconLoader(import.meta.url, '../public/logo-without-border.svg'),
'.spec.ts': 'vscode-icons:file-type-testts',
'.test.ts': 'vscode-icons:file-type-testts',
'.spec.js': 'vscode-icons:file-type-testjs',
'.test.js': 'vscode-icons:file-type-testjs',
'marko': 'vscode-icons:file-type-marko',
'qwik': 'logos:qwik-icon',
'next': '',
'vite.config': localIconLoader(import.meta.url, '../public/logo-without-border-vite.svg'),
},
}),
llmstxt(),
Expand Down Expand Up @@ -109,6 +111,7 @@ export default ({ mode }: { mode: string }) => {
languages: ['js', 'jsx', 'ts', 'tsx'],
},
themeConfig: {
variant: 'vitest',
logo: '/logo.svg',

editLink: {
Expand Down Expand Up @@ -142,8 +145,49 @@ export default ({ mode }: { mode: string }) => {
],

footer: {
message: 'Released under the MIT License.',
copyright: 'Copyright © 2021-PRESENT VoidZero Inc. and Vitest contributors',
copyright: `© ${new Date().getFullYear()} VoidZero Inc. and Vitest contributors.`,
nav: [
{
title: 'Vitest',
items: [
{ text: 'Guides', link: '/guide/' },
{ text: 'API', link: '/api/' },
{ text: 'Config', link: '/config/' },
],
},
{
title: 'Resources',
items: [
{ text: 'Team', link: '/team' },
{ text: 'Blog', link: '/blog' },
{ text: 'Releases', link: releases },
],
},
{
title: 'Versions',
items: [
{ text: 'Unreleased Docs', link: 'https://main.vitest.dev/' },
{ text: 'Vitest v3 Docs', link: 'https://v3.vitest.dev/' },
{ text: 'Vitest v2 Docs', link: 'https://v2.vitest.dev/' },
{ text: 'Vitest v1 Docs', link: 'https://v1.vitest.dev/' },
{ text: 'Vitest v0 Docs', link: 'https://v0.vitest.dev/' },
],
},
/* {
title: 'Legal',
items: [
{ text: 'Terms & Conditions', link: 'https://voidzero.dev/terms' },
{ text: 'Privacy Policy', link: 'https://voidzero.dev/privacy' },
{ text: 'Cookie Policy', link: 'https://voidzero.dev/cookies' },
],
}, */
],
social: [
{ icon: 'github', link: github },
{ icon: 'discord', link: discord },
// { icon: 'mastodon', link: mastodon }, -- the link shows github
{ icon: 'bluesky', link: bluesky },
],
},

nav: [
Expand Down Expand Up @@ -184,20 +228,20 @@ export default ({ mode }: { mode: string }) => {
link: 'https://main.vitest.dev/',
},
{
text: 'v0.x',
link: 'https://v0.vitest.dev/',
},
{
text: 'v1.x',
link: 'https://v1.vitest.dev/',
text: 'v3.x',
link: 'https://v3.vitest.dev/',
},
{
text: 'v2.x',
link: 'https://v2.vitest.dev/',
},
{
text: 'v3.x',
link: 'https://v3.vitest.dev/',
text: 'v1.x',
link: 'https://v1.vitest.dev/',
},
{
text: 'v0.x',
link: 'https://v0.vitest.dev/',
},
],
},
Expand Down Expand Up @@ -1090,5 +1134,5 @@ export default ({ mode }: { mode: string }) => {
},
pwa,
transformHead,
}))
})))
}
Loading
Loading