Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
225 changed files
with
4,906 additions
and
2,369 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish Package | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*" # Push events to matching v*, i.e. v1.0, v20.15.10 | ||
- "plugin-*" # Push events to matching plugin-*, i.e. plugin-(vue|vue-jsx|react|legacy)@1.0.0 | ||
- "create-vite*" # # Push events to matching create-vite*, i.e. create-vite@1.0.0 | ||
|
||
jobs: | ||
publish: | ||
# prevents this action from running on forks | ||
if: github.repository == 'vitejs/vite' | ||
runs-on: ubuntu-latest | ||
environment: Release | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 6 | ||
|
||
- name: Set node version to 16.x | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16.x | ||
registry-url: https://registry.npmjs.org/ | ||
cache: "pnpm" | ||
|
||
- name: Install deps | ||
run: pnpm install | ||
|
||
- name: Creating .npmrc | ||
run: | | ||
cat << EOF > "$HOME/.npmrc" | ||
//registry.npmjs.org/:_authToken=$NPM_TOKEN | ||
EOF | ||
env: | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
|
||
- name: Publish package | ||
run: pnpm run ci-publish -- ${{ github.ref_name }} | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: release | ||
name: Add GitHub Release Tag | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
hoist-pattern[]=*eslint* | ||
hoist-pattern[]=*babel* | ||
hoist-pattern[]=*jest* | ||
hoist-pattern[]=@emotion/* | ||
hoist-pattern[]=postcss | ||
hoist-pattern[]=pug | ||
hoist-pattern[]=source-map-support |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,137 @@ | ||
<script lang="ts"> | ||
// shared data across instances so we load only once | ||
let data = $ref<SponsorData>() | ||
const base = `https://sponsors.vuejs.org` | ||
const dataUrl = `${base}/vite.json` | ||
</script> | ||
|
||
<script setup lang="ts"> | ||
import { onMounted, onUnmounted } from 'vue' | ||
interface Sponsor { | ||
url: string | ||
img: string | ||
name: string | ||
} | ||
interface SponsorData { | ||
special: Sponsor[] | ||
platinum: Sponsor[] | ||
platinum_china: Sponsor[] | ||
gold: Sponsor[] | ||
silver: Sponsor[] | ||
bronze: Sponsor[] | ||
} | ||
const { tier, placement = 'aside' } = defineProps<{ | ||
tier: keyof SponsorData | ||
placement?: 'aside' | 'page' | 'landing' | ||
}>() | ||
let container = $ref<HTMLElement>() | ||
let visible = $ref(false) | ||
onMounted(async () => { | ||
// only render when entering view | ||
const observer = new IntersectionObserver( | ||
(entries) => { | ||
if (entries[0].isIntersecting) { | ||
visible = true | ||
observer.disconnect() | ||
} | ||
}, | ||
{ rootMargin: '0px 0px 300px 0px' } | ||
) | ||
observer.observe(container) | ||
onUnmounted(() => observer.disconnect()) | ||
// load data | ||
if (!data) { | ||
data = await (await fetch(dataUrl)).json() | ||
} | ||
}) | ||
</script> | ||
|
||
<template> | ||
<div | ||
ref="container" | ||
class="sponsor-container" | ||
:class="[tier.startsWith('plat') ? 'platinum' : tier, placement]" | ||
> | ||
<template v-if="data && visible"> | ||
<a | ||
v-for="{ url, img, name } of data[tier]" | ||
class="sponsor-item" | ||
:href="url" | ||
target="_blank" | ||
rel="sponsored noopener" | ||
> | ||
<picture v-if="img.endsWith('png')"> | ||
<source | ||
type="image/avif" | ||
:srcset="`${base}/images/${img.replace(/\.png$/, '.avif')}`" | ||
/> | ||
<img :src="`${base}/images/${img}`" :alt="name" /> | ||
</picture> | ||
<img v-else :src="`${base}/images/${img}`" :alt="name" /> | ||
</a> | ||
</template> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.sponsor-container { | ||
--max-width: 100%; | ||
display: flex; | ||
justify-content: space-evenly; | ||
flex-wrap: wrap; | ||
} | ||
.sponsor-container.platinum { | ||
--max-width: 260px; | ||
} | ||
.sponsor-container.gold { | ||
--max-width: 160px; | ||
} | ||
.sponsor-container.silver { | ||
--max-width: 140px; | ||
} | ||
.sponsor-item { | ||
margin: 2px 0; | ||
display: flex; | ||
align-items: center; | ||
border-radius: 2px; | ||
transition: background-color 0.2s ease; | ||
height: calc(var(--max-width) / 2 - 6px); | ||
} | ||
.sponsor-item.action { | ||
font-size: 11px; | ||
color: #999; | ||
} | ||
.sponsor-item img { | ||
width: 100%; | ||
max-width: calc(var(--max-width) - 30px); | ||
max-height: calc(var(--max-width) / 2 - 20px); | ||
margin: 10px 20px; | ||
} | ||
.special .sponsor-item { | ||
height: 160px; | ||
} | ||
.special .sponsor-item img { | ||
max-width: 300px; | ||
max-height: 150px; | ||
} | ||
/* aside mode (on content pages) */ | ||
.sponsor-container.platinum.aside { | ||
--max-width: 200px; | ||
} | ||
.sponsor-container.gold.aside { | ||
--max-width: 124px; | ||
} | ||
.aside .sponsor-item { | ||
margin: 0; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<script setup lang="ts"> | ||
import SponsorsGroup from './SponsorsGroup.vue' | ||
import { useData } from 'vitepress' | ||
const { frontmatter } = useData() | ||
</script> | ||
|
||
<template> | ||
<div v-if="frontmatter.sponsors !== false"> | ||
<a | ||
class="sponsors-aside-text" | ||
href="https://github.com/sponsors/yyx990803" | ||
target="_blank" | ||
>Sponsors</a | ||
> | ||
<SponsorsGroup tier="platinum" /> | ||
<SponsorsGroup tier="gold" /> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
a.sponsors-aside-text { | ||
color: #999; | ||
display: block; | ||
margin: 3em 0 1em; | ||
font-weight: 700; | ||
font-size: 11px; | ||
text-transform: uppercase; | ||
letter-spacing: 0.4px; | ||
padding-left: 2em; | ||
} | ||
</style> |
Oops, something went wrong.