Skip to content

Commit 47a8cc2

Browse files
committed
chore: update to latest Nuxt UI v4
1 parent 000ae27 commit 47a8cc2

10 files changed

Lines changed: 2919 additions & 2915 deletions

File tree

.vscode/settings.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
{
22
"eslint.useFlatConfig": true,
3-
"prettier.enable": false,
3+
"files.associations": {
4+
"*.css": "tailwindcss"
5+
},
6+
"editor.quickSuggestions": {
7+
"strings": "on"
8+
},
9+
"tailwindCSS.classAttributes": ["class", "ui"],
10+
"tailwindCSS.experimental.classRegex": [
11+
["ui:\\s*{([^)]*)\\s*}", "(?:'|\"|`)([^']*)(?:'|\"|`)"]
12+
]
413
}

app/app.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
export default defineAppConfig({
22
ui: {
3-
gray: 'zinc',
3+
colors: {
4+
neutral: 'zinc',
5+
},
46
},
57
})

app/app.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ useHead({
1212
<UButton
1313
to="https://github.com/atinux/my-pull-requests"
1414
target="_blank"
15-
color="black"
16-
size="xs"
15+
color="neutral"
16+
variant="subtle"
17+
size="sm"
1718
icon="i-simple-icons-github"
1819
>
1920
Create my own contributions page
@@ -24,6 +25,6 @@ useHead({
2425

2526
<style lang="postcss">
2627
body {
27-
@apply min-h-screen bg-white dark:bg-gray-900 text-gray-700 dark:text-gray-200 font-sans;
28+
@apply min-h-screen bg-white dark:bg-neutral-900 text-neutral-700 dark:text-neutral-200 font-sans;
2829
}
2930
</style>

app/assets/css/main.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
@import "tailwindcss";
2+
@import "@nuxt/ui";

app/components/PullRequest.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ const stateIcons: Record<Contributions['prs'][number]['state'], string> = {
2626
:href="`https://github.com/${data.repo}`"
2727
target="_blank"
2828
relative
29-
:class="['size-10 sm:size-12 shrink-0 border border-gray-200 dark:border-gray-800 overflow-hidden shadow-sm', data.type === 'Organization' ? 'rounded-lg' : 'rounded-full']"
29+
:class="['size-10 sm:size-12 shrink-0 border border-neutral-200 dark:border-neutral-800 overflow-hidden shadow-sm', data.type === 'Organization' ? 'rounded-lg' : 'rounded-full']"
3030
>
3131
<img :src="`https://github.com/${data.repo.split('/')[0]}.png`" :alt="data.repo" class="size-full">
3232
</a>
3333

3434
<div class="flex-1 flex justify-between gap-2 lg:gap-4 min-w-0">
3535
<div class="flex flex-col min-w-0 gap-0.5 sm:gap-1">
36-
<a :href="data.url" target="_blank" class="text-sm sm:text-base flex items-center gap-0.5 sm:gap-1 hover:underline text-gray-900 dark:text-white">
36+
<a :href="data.url" target="_blank" class="text-sm sm:text-base flex items-center gap-0.5 sm:gap-1 hover:underline text-neutral-900 dark:text-white">
3737
<UIcon
3838
:name="stateIcons[data.state]"
3939
:class="{
4040
'text-green-500 dark:text-green-400': data.state === 'open',
41-
'text-gray-500 dark:text-gray-400': data.state === 'draft',
41+
'text-neutral-500 dark:text-neutral-400': data.state === 'draft',
4242
'text-purple-500 dark:text-purple-400': data.state === 'merged',
4343
'text-red-500 dark:text-red-400': data.state === 'closed',
4444
}"
@@ -54,7 +54,7 @@ const stateIcons: Record<Contributions['prs'][number]['state'], string> = {
5454
<span class="opacity-50">/</span>
5555
<span class="truncate">{{ data.repo.split('/')[1] }}</span>
5656
</a>
57-
<a :href="`https://github.com/${data.repo}`" target="_blank" class="items-center hidden sm:inline-flex gap-0.5 text-gray-500 dark:text-gray-400 hover:text-black dark:hover:text-white truncate">
57+
<a :href="`https://github.com/${data.repo}`" target="_blank" class="items-center hidden sm:inline-flex gap-0.5 text-neutral-500 dark:text-neutral-400 hover:text-black dark:hover:text-white truncate">
5858
<UIcon name="i-lucide-star" class="size-3 shrink-0" />
5959
<span class="text-xs">{{ formatStars(data.stars) }}</span>
6060
</a>
@@ -66,7 +66,7 @@ const stateIcons: Record<Contributions['prs'][number]['state'], string> = {
6666
#{{ data.number }}
6767
</a>
6868

69-
<time :datatime="data.created_at" class="text-xs sm:text-sm text-gray-500 dark:text-gray-400">{{ useTimeAgo(new Date(data.created_at)) }}</time>
69+
<time :datatime="data.created_at" class="text-xs sm:text-sm text-neutral-500 dark:text-neutral-400">{{ useTimeAgo(new Date(data.created_at)) }}</time>
7070
</div>
7171
</div>
7272
</div>

app/components/ScrollToTop.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ const { y: scroll } = useWindowScroll()
1313
<UButton
1414
title="Scroll to top"
1515
aria-label="Scroll to top"
16-
color="gray"
16+
color="neutral"
1717
variant="ghost"
18-
class="z-100 fixed bottom-3 right-3 h-10 w-10 flex justify-center items-center rounded-full transition duration-300 text-gray-600 hover:bg-[#8882] hover:opacity-100 dark:text-white dark:hover:bg-[#8883] print:hidden"
18+
class="z-100 fixed bottom-3 right-3 h-10 w-10 flex justify-center items-center rounded-full transition duration-300 text-neutral-600 hover:bg-[#8882] hover:opacity-100 dark:text-white dark:hover:bg-[#8883] print:hidden"
1919
icon="i-lucide-arrow-up"
2020
:class="scroll > 200 ? 'opacity-40' : '!opacity-0 pointer-events-none'"
2121
@click="toTop()"

app/pages/index.vue

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,17 +45,17 @@ useSeoMeta({
4545
</a>
4646
is <span class="animate-pulse">Contributing...</span>
4747
</h1>
48-
<p class="text-center text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300">
48+
<p class="text-center text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300">
4949
<NuxtLink :to="userUrl" target="_blank">
5050
@{{ user.username }}'s recent pull requests on GitHub.
5151
</NuxtLink>
5252
</p>
53-
<div class="flex items-center justify-center gap-1 text-gray-700 dark:text-gray-300">
53+
<div class="flex items-center justify-center gap-1 text-neutral-700 dark:text-neutral-300">
5454
<ClientOnly>
5555
<UButton
5656
:aria-label="`${user.name}'s GitHub profile`"
5757
:icon="colorMode.value === 'dark' ? 'i-lucide-moon' : 'i-lucide-sun'"
58-
color="gray"
58+
color="neutral"
5959
variant="link"
6060
@click="colorMode.preference = colorMode.value === 'dark' ? 'light' : 'dark'"
6161
/>
@@ -69,7 +69,7 @@ useSeoMeta({
6969
target="_blank"
7070
:aria-label="`${user.name}'s GitHub profile`"
7171
icon="i-lucide-github"
72-
color="gray"
72+
color="neutral"
7373
variant="link"
7474
/>
7575
<UButton
@@ -78,11 +78,11 @@ useSeoMeta({
7878
target="_blank"
7979
aria-label="RSS Feed"
8080
icon="i-lucide-rss"
81-
color="gray"
81+
color="neutral"
8282
variant="link"
8383
/>
8484
</div>
85-
<UDivider class="mt-2 sm:mt-6 mb-6 sm:mb-10 w-1/2 mx-auto animate-pulse" />
85+
<USeparator class="mt-2 sm:mt-6 mb-6 sm:mb-10 w-1/2 mx-auto animate-pulse" />
8686
</div>
8787

8888
<div class="flex flex-col gap-6 sm:gap-10">

nuxt.config.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
3+
css: ['~/assets/css/main.css'],
34

45
// https://nuxt.com/modules
56
modules: [
6-
'@nuxthub/core',
77
'@nuxt/eslint',
88
'@nuxt/ui',
99
'@vueuse/nuxt',
@@ -14,11 +14,15 @@ export default defineNuxtConfig({
1414

1515
// https://nuxt.com/docs/getting-started/upgrade#testing-nuxt-4
1616
future: { compatibilityVersion: 4 },
17-
compatibilityDate: '2024-07-30',
17+
compatibilityDate: '2025-09-08',
1818

1919
// https://hub.nuxt.com/docs/getting-started/installation#options
20-
hub: {
21-
cache: true,
20+
nitro: {
21+
storage: {
22+
cache: {
23+
driver: 'vercel-runtime-cache',
24+
}
25+
}
2226
},
2327

2428
// https://eslint.nuxt.com

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"type": "module",
33
"private": true,
4-
"packageManager": "pnpm@10.13.1+sha512.37ebf1a5c7a30d5fabe0c5df44ee8da4c965ca0c5af3dbab28c3a1681b70a256218d05c81c9c0dcf767ef6b8551eb5b960042b9ed4300c59242336377e01cfad",
4+
"packageManager": "pnpm@10.15.1",
55
"scripts": {
66
"build": "nuxi build",
77
"dev": "nuxi dev",
@@ -13,22 +13,22 @@
1313
"typecheck": "vue-tsc --noEmit"
1414
},
1515
"dependencies": {
16-
"@iconify-json/lucide": "^1.2.57",
17-
"@nuxt/ui": "^2.22.1",
18-
"@nuxthub/core": "^0.9.0",
19-
"@vueuse/core": "^13.5.0",
20-
"@vueuse/nuxt": "^13.5.0",
16+
"@iconify-json/lucide": "^1.2.66",
17+
"@nuxt/ui": "^4.0.0-alpha.1",
18+
"@vueuse/core": "^13.9.0",
19+
"@vueuse/nuxt": "^13.9.0",
2120
"feed": "^5.1.0",
22-
"nuxt": "^4.0.0",
21+
"nuxt": "^4.1.1",
2322
"octokit": "^5.0.3",
24-
"vue": "^3.5.17",
23+
"tailwindcss": "^4.1.13",
24+
"vue": "^3.5.21",
2525
"vue-router": "^4.5.1"
2626
},
2727
"devDependencies": {
28-
"@nuxt/eslint": "^1.6.0",
29-
"eslint": "^9.31.0",
30-
"vue-tsc": "^2.2.12",
31-
"wrangler": "^4.25.0"
28+
"@nuxt/eslint": "^1.9.0",
29+
"eslint": "^9.35.0",
30+
"vue-tsc": "^3.0.6",
31+
"wrangler": "^4.34.0"
3232
},
3333
"pnpm": {
3434
"onlyBuiltDependencies": [

0 commit comments

Comments
 (0)