Skip to content

Commit b8e8976

Browse files
committed
fix: remove upgrade to nuxt og image v6
This reverts commit 7a0fc21.
1 parent 55ff287 commit b8e8976

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+613
-3382
lines changed

.github/workflows/ci.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,6 @@ jobs:
154154
run: pnpm build:test
155155
env:
156156
VALIDATE_HTML: true
157-
NODE_OPTIONS: --max-old-space-size=6144
158157

159158
- name: 🖥️ Test project (browser)
160159
run: pnpm test:browser:prebuilt
@@ -183,8 +182,6 @@ jobs:
183182

184183
- name: 🏗️ Build project
185184
run: pnpm build:test
186-
env:
187-
NODE_OPTIONS: --max-old-space-size=6144
188185

189186
- name: ♿ Accessibility audit (Lighthouse - ${{ matrix.mode }} mode)
190187
run: pnpm test:a11y:prebuilt

app/app.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,6 @@ if (import.meta.client) {
118118
useEventListener(document, 'click', handleModalLightDismiss)
119119
}
120120
}
121-
122-
// title and description will be inferred
123-
// this will be overridden by upstream pages that use different templates
124-
defineOgImage('Page.takumi')
125121
</script>
126122

127123
<template>

app/components/OgImage/Default.vue

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<script setup lang="ts">
2+
interface Props {
3+
primaryColor?: string
4+
title?: string
5+
description?: string
6+
}
7+
8+
const props = withDefaults(defineProps<Props>(), {
9+
primaryColor: '#60a5fa',
10+
title: 'npmx',
11+
description: 'a fast, modern browser for the **npm registry**',
12+
})
13+
</script>
14+
15+
<template>
16+
<div
17+
class="h-full w-full flex flex-col justify-center px-20 bg-[#050505] text-[#fafafa] relative overflow-hidden"
18+
style="font-family: 'Geist Mono', sans-serif"
19+
>
20+
<div class="relative z-10 flex flex-col gap-6">
21+
<div class="flex items-start gap-4">
22+
<div
23+
class="flex items-start justify-center w-16 h-16 p-3.5 rounded-xl bg-gradient-to-tr from-[#3b82f6] shadow-lg"
24+
:style="{ backgroundColor: props.primaryColor }"
25+
>
26+
<svg
27+
width="36"
28+
height="36"
29+
viewBox="0 0 24 24"
30+
fill="none"
31+
stroke="white"
32+
stroke-width="2.5"
33+
stroke-linecap="round"
34+
stroke-linejoin="round"
35+
>
36+
<path d="m7.5 4.27 9 5.15" />
37+
<path
38+
d="M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z"
39+
/>
40+
<path d="m3.3 7 8.7 5 8.7-5" />
41+
<path d="M12 22V12" />
42+
</svg>
43+
</div>
44+
45+
<h1 class="text-8xl font-bold">
46+
<span
47+
class="opacity-80 tracking-[-0.1em]"
48+
:style="{ color: props.primaryColor }"
49+
style="margin-left: -1rem; margin-right: 0.5rem"
50+
>./</span
51+
>{{ props.title }}
52+
</h1>
53+
</div>
54+
55+
<div
56+
class="flex flex-wrap items-center gap-x-3 text-4xl text-[#a3a3a3]"
57+
style="font-family: 'Geist', sans-serif"
58+
>
59+
<template v-for="(part, index) in props.description.split(/(\*\*.*?\*\*)/)" :key="index">
60+
<span
61+
v-if="part.startsWith('**') && part.endsWith('**')"
62+
class="px-3 py-1 rounded-lg border font-normal"
63+
:style="{
64+
color: props.primaryColor,
65+
backgroundColor: props.primaryColor + '10',
66+
borderColor: props.primaryColor + '30',
67+
boxShadow: `0 0 20px ${props.primaryColor}25`,
68+
}"
69+
>
70+
{{ part.replaceAll('**', '') }}
71+
</span>
72+
<span v-else-if="part.trim() !== ''">
73+
{{ part }}
74+
</span>
75+
</template>
76+
</div>
77+
</div>
78+
79+
<div
80+
class="absolute -top-32 -inset-ie-32 w-[550px] h-[550px] rounded-full blur-3xl"
81+
:style="{ backgroundColor: props.primaryColor + '10' }"
82+
/>
83+
</div>
84+
</template>
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// This type declaration file is required to break a circular type resolution in vue-tsc.
2+
//
3+
// nuxt-og-image generates a type declaration (.nuxt/module/nuxt-og-image.d.ts) that imports
4+
// this component's type. This creates a cycle: nuxt.d.ts → nuxt-og-image.d.ts → Package.vue →
5+
// needs auto-import globals from nuxt.d.ts. Without this file, vue-tsc resolves the component
6+
// before the globals are available, so all auto-imports (computed, toRefs, useFetch, etc.) fail.
7+
8+
import type { DefineComponent } from 'vue'
9+
10+
declare const _default: DefineComponent<{
11+
name: string
12+
version: string
13+
primaryColor?: string
14+
}>
15+
16+
export default _default

0 commit comments

Comments
 (0)