Skip to content

Commit bbe7b97

Browse files
committed
feat: update types in blog
1 parent 36dd357 commit bbe7b97

4 files changed

Lines changed: 8 additions & 3 deletions

File tree

app/components/AuthorAvatar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { ResolvedAuthor } from '#shared/schemas/blog'
33
44
const props = defineProps<{
5-
author: ResolvedAuthor
5+
author: Pick<ResolvedAuthor, 'name' | 'avatar'>
66
size?: 'sm' | 'md' | 'lg'
77
}>()
88

app/components/BlogPostFederatedArticles.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script setup lang="ts">
22
import type { FederatedArticleInput } from '#shared/types/blog-post'
33
import type { Author } from '#shared/schemas/blog'
4+
import type { AtIdentifierString } from '@atproto/lex'
45
56
const props = defineProps<{
67
headline: string
@@ -11,7 +12,7 @@ const props = defineProps<{
1112
const authors = computed<Author[]>(() =>
1213
props.articles.map(article => ({
1314
name: article.authorHandle,
14-
blueskyHandle: article.authorHandle,
15+
blueskyHandle: article.authorHandle as AtIdentifierString,
1516
})),
1617
)
1718

app/components/global/BlueskyPostEmbed.client.vue

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ async function resolveAtUri(): Promise<string | null> {
4848
if (!match) return null
4949
const [, handle, rkey] = match
5050
51+
if (!handle || !rkey) return null
52+
5153
// If the handle is already a DID, build the AT URI directly
5254
if (handle.startsWith('did:')) {
5355
return `at://${handle}/app.bsky.feed.post/${rkey}`

nuxt.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import process from 'node:process'
22
import { currentLocales } from './config/i18n'
33
import Markdown from 'unplugin-vue-markdown/vite'
44
import { isCI, isTest, provider } from 'std-env'
5+
import type { ViteOptions } from 'nuxt/schema'
56

67
const isStorybook = process.env.STORYBOOK === 'true' || process.env.VITEST_STORYBOOK === 'true'
78

@@ -362,7 +363,8 @@ export default defineNuxtConfig({
362363
}),
363364
)
364365
},
365-
}),
366+
// important for types compatibility
367+
}) as Exclude<ViteOptions['plugins'], undefined>[number],
366368
],
367369

368370
optimizeDeps: {

0 commit comments

Comments
 (0)