docs: add releases page (#1004)

This commit is contained in:
Benjamin Canac
2023-11-21 17:08:13 +01:00
committed by GitHub
parent f4be95dcf5
commit 762c5ebba1
12 changed files with 348 additions and 5 deletions

View File

@@ -98,8 +98,7 @@ const links = computed(() => {
}, {
label: 'Releases',
icon: 'i-heroicons-rocket-launch',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
to: '/releases'
}].filter(Boolean)
})

View File

@@ -0,0 +1,52 @@
<template>
<div ref="target" class="flex flex-col transition-opacity duration-500" :class="targetIsVisible ? 'opacity-100' : 'opacity-25'">
<time :datetime="date.day.toISOString()" class="flex-shrink-0 text-sm/6 font-semibold text-gray-500 dark:text-gray-400">{{ date.day.toLocaleString('en-us', { year: 'numeric', month: 'short', day: 'numeric' })
}}</time>
<NuxtLink v-if="date.release" :to="`https://github.com/nuxt/ui/releases/tag/${date.release.name}`" target="_blank" class="text-gray-900 dark:text-white font-bold text-3xl mt-2 group hover:text-primary-500 dark:hover:text-primary-400 transition-[color]">
{{ date.release.name }}
</NuxtLink>
<div v-else-if="date.pull" class="text-sm/6 break-all mt-2">
<NuxtLink :to="`https://github.com/${date.pull.user.login}`" target="_blank" class="text-gray-900 dark:text-white transition-colors inline-flex items-center gap-1 rounded-full bg-gray-100/50 dark:bg-gray-800/50 dark:hover:bg-gray-800 p-0.5 pr-1 ring-1 ring-gray-300 dark:ring-gray-700 text-xs font-medium flex-shrink-0 align-middle mr-1">
<UAvatar :src="`https://github.com/${date.pull.user.login}.png`" size="3xs" />
{{ date.pull.user.login }}
</NuxtLink>
pushed <NuxtLink :to="date.pull.html_url" target="_blank" class="font-medium text-gray-900 dark:text-white hover:text-primary-500 dark:hover:text-primary-400 transition-[color]">
#{{ date.pull.number }} {{ date.pull.title }}
</NuxtLink>
</div>
</div>
</template>
<script setup lang="ts">
import { useIntersectionObserver } from '@vueuse/core'
defineProps<{
date: {
day: Date
release?: {
name: string
}
pull?: {
number: number
title: string
html_url: string
user: {
login: string
}
}
}
}>()
const target = ref(null)
const targetIsVisible = ref(false)
useIntersectionObserver(target, ([{ isIntersecting }]) => {
targetIsVisible.value = isIntersecting
}, {
threshold: 1,
rootMargin: '0px 0px -68px 0px'
})
</script>

10
docs/content/releases.yml Normal file
View File

@@ -0,0 +1,10 @@
navigation: false
title: Releases
description: Follow the latest releases and updates of Nuxt UI.
links:
- label: View on GitHub
icon: i-simple-icons-github
to: https://github.com/nuxt/ui/releases
target: _blank
size: md
color: white

View File

@@ -89,8 +89,7 @@ const links = computed(() => {
}, {
label: 'Releases',
icon: 'i-heroicons-rocket-launch',
to: 'https://github.com/nuxt/ui/releases',
target: '_blank'
to: '/releases'
}].filter(Boolean)
})

View File

@@ -83,7 +83,9 @@ export default defineNuxtConfig({
'/',
'/getting-started',
'/dev/getting-started',
'/api/search.json'
'/api/search.json',
'/api/releases.json',
'/api/pulls.json'
]
}
},

View File

@@ -16,7 +16,9 @@
"@nuxtjs/google-fonts": "^3.0.2",
"@nuxtjs/mdc": "^0.2.6",
"@nuxtjs/plausible": "^0.2.3",
"@octokit/rest": "^20.0.2",
"@vueuse/nuxt": "^10.5.0",
"date-fns": "^2.30.0",
"eslint": "^8.52.0",
"joi": "^17.11.0",
"nuxt": "^3.8.0",

View File

@@ -3,6 +3,7 @@ const title = 'Playground'
const description = 'Play online with our interactive Nuxt Image playground.'
useSeoMeta({
titleTemplate: '%s - Nuxt UI',
title,
ogTitle: 'Nuxt UI Playground',
description

125
docs/pages/releases.vue Normal file

File diff suppressed because one or more lines are too long

View File

@@ -3,6 +3,7 @@ const title = 'Roadmap'
const description = 'Discover our Volta board for @nuxt/ui development status.'
useSeoMeta({
titleTemplate: '%s - Nuxt UI',
title,
ogTitle: 'Nuxt UI Roadmap',
description

View File

@@ -0,0 +1,23 @@
import { Octokit } from '@octokit/rest'
function isUserABot (user) {
return user?.login?.endsWith('-bot') || user?.login?.endsWith('[bot]')
}
export default cachedEventHandler(async () => {
if (!process.env.NUXT_GITHUB_TOKEN) {
return []
}
const octokit = new Octokit({ auth: process.env.NUXT_GITHUB_TOKEN })
const pulls = await octokit.paginate(octokit.rest.pulls.list, {
owner: 'nuxt',
repo: 'ui',
state: 'closed'
})
return pulls.filter(pull => !!pull.merged_at).filter(pull => !isUserABot(pull.user))
}, {
maxAge: 60 * 60
})

View File

@@ -0,0 +1,18 @@
import { Octokit } from '@octokit/rest'
export default cachedEventHandler(async () => {
if (!process.env.NUXT_GITHUB_TOKEN) {
return []
}
const octokit = new Octokit({ auth: process.env.NUXT_GITHUB_TOKEN })
const { data: releases } = await octokit.rest.repos.listReleases({
owner: 'nuxt',
repo: 'ui'
})
return releases
}, {
maxAge: 60 * 60
})

111
pnpm-lock.yaml generated
View File

@@ -172,9 +172,15 @@ importers:
'@nuxtjs/plausible':
specifier: ^0.2.3
version: 0.2.3(rollup@3.29.1)
'@octokit/rest':
specifier: ^20.0.2
version: 20.0.2
'@vueuse/nuxt':
specifier: ^10.5.0
version: 10.5.0(nuxt@3.8.0)(rollup@3.29.1)(vue@3.3.4)
date-fns:
specifier: ^2.30.0
version: 2.30.0
eslint:
specifier: ^8.52.0
version: 8.52.0
@@ -2118,6 +2124,11 @@ packages:
engines: {node: '>= 14'}
dev: true
/@octokit/auth-token@4.0.0:
resolution: {integrity: sha512-tY/msAuJo6ARbK6SPIxZrPBms3xPbfwBrulZe0Wtr/DIY9lje2HeV1uoebShn6mx7SjCHif6EjMvoREj+gZ+SA==}
engines: {node: '>= 18'}
dev: true
/@octokit/core@4.2.4:
resolution: {integrity: sha512-rYKilwgzQ7/imScn3M9/pFfUf4I1AZEH3KhyJmtPdE2zfaXAn2mFfUy4FbKewzc2We5y/LlKLj36fWJLKC2SIQ==}
engines: {node: '>= 14'}
@@ -2133,6 +2144,19 @@ packages:
- encoding
dev: true
/@octokit/core@5.0.1:
resolution: {integrity: sha512-lyeeeZyESFo+ffI801SaBKmCfsvarO+dgV8/0gD8u1d87clbEdWsP5yC+dSj3zLhb2eIf5SJrn6vDz9AheETHw==}
engines: {node: '>= 18'}
dependencies:
'@octokit/auth-token': 4.0.0
'@octokit/graphql': 7.0.2
'@octokit/request': 8.1.5
'@octokit/request-error': 5.0.1
'@octokit/types': 12.3.0
before-after-hook: 2.2.3
universal-user-agent: 6.0.0
dev: true
/@octokit/endpoint@7.0.6:
resolution: {integrity: sha512-5L4fseVRUsDFGR00tMWD/Trdeeihn999rTMGRMC1G/Ldi1uWlWJzI98H4Iak5DB/RVvQuyMYKqSK/R6mbSOQyg==}
engines: {node: '>= 14'}
@@ -2142,6 +2166,15 @@ packages:
universal-user-agent: 6.0.0
dev: true
/@octokit/endpoint@9.0.2:
resolution: {integrity: sha512-qhKW8YLIi+Kmc92FQUFGr++DYtkx/1fBv+Thua6baqnjnOsgBYJDCvWZR1YcINuHGOEQt416WOfE+A/oG60NBQ==}
engines: {node: '>= 18'}
dependencies:
'@octokit/types': 12.3.0
is-plain-object: 5.0.0
universal-user-agent: 6.0.0
dev: true
/@octokit/graphql@5.0.6:
resolution: {integrity: sha512-Fxyxdy/JH0MnIB5h+UQ3yCoh1FG4kWXfFKkpWqjZHw/p+Kc8Y44Hu/kCgNBT6nU1shNumEchmW/sUO1JuQnPcw==}
engines: {node: '>= 14'}
@@ -2153,10 +2186,23 @@ packages:
- encoding
dev: true
/@octokit/graphql@7.0.2:
resolution: {integrity: sha512-OJ2iGMtj5Tg3s6RaXH22cJcxXRi7Y3EBqbHTBRq+PQAqfaS8f/236fUrWhfSn8P4jovyzqucxme7/vWSSZBX2Q==}
engines: {node: '>= 18'}
dependencies:
'@octokit/request': 8.1.5
'@octokit/types': 12.3.0
universal-user-agent: 6.0.0
dev: true
/@octokit/openapi-types@18.0.0:
resolution: {integrity: sha512-V8GImKs3TeQRxRtXFpG2wl19V7444NIOTDF24AWuIbmNaNYOQMWRbjcGDXV5B+0n887fgDcuMNOmlul+k+oJtw==}
dev: true
/@octokit/openapi-types@19.0.2:
resolution: {integrity: sha512-8li32fUDUeml/ACRp/njCWTsk5t17cfTM1jp9n08pBrqs5cDFJubtjsSnuz56r5Tad6jdEPJld7LxNp9dNcyjQ==}
dev: true
/@octokit/plugin-paginate-rest@6.1.2(@octokit/core@4.2.4):
resolution: {integrity: sha512-qhrmtQeHU/IivxucOV1bbI/xZyC/iOBhclokv7Sut5vnejAIAEXVcGQeRpQlU39E0WwK9lNvJHphHri/DB6lbQ==}
engines: {node: '>= 14'}
@@ -2168,6 +2214,16 @@ packages:
'@octokit/types': 9.3.2
dev: true
/@octokit/plugin-paginate-rest@9.1.4(@octokit/core@5.0.1):
resolution: {integrity: sha512-MvZx4WvfhBnt7PtH5XE7HORsO7bBk4er1FgRIUr1qJ89NR2I6bWjGyKsxk8z42FPQ34hFQm0Baanh4gzdZR4gQ==}
engines: {node: '>= 18'}
peerDependencies:
'@octokit/core': '>=5'
dependencies:
'@octokit/core': 5.0.1
'@octokit/types': 12.3.0
dev: true
/@octokit/plugin-request-log@1.0.4(@octokit/core@4.2.4):
resolution: {integrity: sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==}
peerDependencies:
@@ -2176,6 +2232,25 @@ packages:
'@octokit/core': 4.2.4
dev: true
/@octokit/plugin-request-log@4.0.0(@octokit/core@5.0.1):
resolution: {integrity: sha512-2uJI1COtYCq8Z4yNSnM231TgH50bRkheQ9+aH8TnZanB6QilOnx8RMD2qsnamSOXtDj0ilxvevf5fGsBhBBzKA==}
engines: {node: '>= 18'}
peerDependencies:
'@octokit/core': '>=5'
dependencies:
'@octokit/core': 5.0.1
dev: true
/@octokit/plugin-rest-endpoint-methods@10.1.5(@octokit/core@5.0.1):
resolution: {integrity: sha512-LMEdsMV8TTMjMTqVoqMzV95XTbv0ZsWxCxQtjAunQOCdwoDH4BVF/Ke5JMSZEVCWGI2kzxnUNbFnK/MxwV7NjA==}
engines: {node: '>= 18'}
peerDependencies:
'@octokit/core': '>=5'
dependencies:
'@octokit/core': 5.0.1
'@octokit/types': 12.3.0
dev: true
/@octokit/plugin-rest-endpoint-methods@7.2.3(@octokit/core@4.2.4):
resolution: {integrity: sha512-I5Gml6kTAkzVlN7KCtjOM+Ruwe/rQppp0QU372K1GP7kNOYEKe8Xn5BW4sE62JAHdwpq95OQK/qGNyKQMUzVgA==}
engines: {node: '>= 14'}
@@ -2195,6 +2270,15 @@ packages:
once: 1.4.0
dev: true
/@octokit/request-error@5.0.1:
resolution: {integrity: sha512-X7pnyTMV7MgtGmiXBwmO6M5kIPrntOXdyKZLigNfQWSEQzVxR4a4vo49vJjTWX70mPndj8KhfT4Dx+2Ng3vnBQ==}
engines: {node: '>= 18'}
dependencies:
'@octokit/types': 12.3.0
deprecation: 2.3.1
once: 1.4.0
dev: true
/@octokit/request@6.2.8:
resolution: {integrity: sha512-ow4+pkVQ+6XVVsekSYBzJC0VTVvh/FCTUUgTsboGq+DTeWdyIFV8WSCdo0RIxk6wSkBTHqIK1mYuY7nOBXOchw==}
engines: {node: '>= 14'}
@@ -2209,6 +2293,17 @@ packages:
- encoding
dev: true
/@octokit/request@8.1.5:
resolution: {integrity: sha512-zVKbNbX1xUluD9ZR4/tPs1yuYrK9xeh5fGZUXA6u04XGsTvomg0YO8/ZUC0FqAd49hAOEMFPAVUTh+2lBhOhLA==}
engines: {node: '>= 18'}
dependencies:
'@octokit/endpoint': 9.0.2
'@octokit/request-error': 5.0.1
'@octokit/types': 12.3.0
is-plain-object: 5.0.0
universal-user-agent: 6.0.0
dev: true
/@octokit/rest@19.0.13:
resolution: {integrity: sha512-/EzVox5V9gYGdbAI+ovYj3nXQT1TtTHRT+0eZPcuC05UFSWO3mdO9UY1C0i2eLF9Un1ONJkAk+IEtYGAC+TahA==}
engines: {node: '>= 14'}
@@ -2221,6 +2316,16 @@ packages:
- encoding
dev: true
/@octokit/rest@20.0.2:
resolution: {integrity: sha512-Ux8NDgEraQ/DMAU1PlAohyfBBXDwhnX2j33Z1nJNziqAfHi70PuxkFYIcIt8aIAxtRE7KVuKp8lSR8pA0J5iOQ==}
engines: {node: '>= 18'}
dependencies:
'@octokit/core': 5.0.1
'@octokit/plugin-paginate-rest': 9.1.4(@octokit/core@5.0.1)
'@octokit/plugin-request-log': 4.0.0(@octokit/core@5.0.1)
'@octokit/plugin-rest-endpoint-methods': 10.1.5(@octokit/core@5.0.1)
dev: true
/@octokit/tsconfig@1.0.2:
resolution: {integrity: sha512-I0vDR0rdtP8p2lGMzvsJzbhdOWy405HcGovrspJ8RRibHnyRgggUSNO5AIox5LmqiwmatHKYsvj6VGFHkqS7lA==}
dev: true
@@ -2231,6 +2336,12 @@ packages:
'@octokit/openapi-types': 18.0.0
dev: true
/@octokit/types@12.3.0:
resolution: {integrity: sha512-nJ8X2HRr234q3w/FcovDlA+ttUU4m1eJAourvfUUtwAWeqL8AsyRqfnLvVnYn3NFbUnsmzQCzLNdFerPwdmcDQ==}
dependencies:
'@octokit/openapi-types': 19.0.2
dev: true
/@octokit/types@9.3.2:
resolution: {integrity: sha512-D4iHGTdAnEEVsB8fl95m1hiz7D5YiRdQ9b/OEb3BYRVwbLsGHcRVPz+u+BgRLNk0Q0/4iZCBqDN96j2XNxfXrA==}
dependencies: