Skip to content

Commit

Permalink
[autofix.ci] apply automated fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
autofix-ci[bot] authored Nov 30, 2023
1 parent b03a189 commit 4f55d68
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion components/content/home/HomeTheUnjsUniverse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import type { PuzzlePart } from '~/types/puzzle'
defineProps<{
cta: { to: string; text: string }
cta: { to: string, text: string }
carousel: PuzzlePart[]
}>()
</script>
Expand Down
6 changes: 3 additions & 3 deletions composables/useSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { ParsedContent } from '@nuxt/content/dist/runtime/types'
import MiniSearch, { type Options as MiniSearchOptions } from 'minisearch'
import type { SearchDisplay, SearchDisplayItem, SearchResult } from '~/types/search'

export function useSimpleSearch<T extends Record<string, unknown>>(data: MaybeRefOrGetter<Partial<ParsedContent>[]>, options: { idField: string; fields: string[]; storeFields: string[] } = { idField: 'title', fields: ['title', 'description'], storeFields: ['title', 'description', '_path', 'publishedAt', 'authors', 'packages'] }) {
export function useSimpleSearch<T extends Record<string, unknown>>(data: MaybeRefOrGetter<Partial<ParsedContent>[]>, options: { idField: string, fields: string[], storeFields: string[] } = { idField: 'title', fields: ['title', 'description'], storeFields: ['title', 'description', '_path', 'publishedAt', 'authors', 'packages'] }) {
const search = ref('')
const searchDebounced = useDebounce(search, 150)

Expand Down Expand Up @@ -52,7 +52,7 @@ export async function useSearchDefaultResults(): Promise<ComputedRef<SearchDispl
})
}

export async function useSearchResults(search: MaybeRefOrGetter<string>, options: { lazy?: boolean; server?: boolean } = {}): Promise<ComputedRef<SearchDisplay>> {
export async function useSearchResults(search: MaybeRefOrGetter<string>, options: { lazy?: boolean, server?: boolean } = {}): Promise<ComputedRef<SearchDisplay>> {
const website = useWebsite()
const searchResults = await useSearch(search, options)

Expand Down Expand Up @@ -99,7 +99,7 @@ export async function useSearchResults(search: MaybeRefOrGetter<string>, options
})
}

export async function useSearch(search: MaybeRefOrGetter<string>, options: { lazy?: boolean; server?: boolean } = {}): Promise<ComputedRef<SearchResult[]>> {
export async function useSearch(search: MaybeRefOrGetter<string>, options: { lazy?: boolean, server?: boolean } = {}): Promise<ComputedRef<SearchResult[]>> {
const { data } = await useFetch<string>('/api/search.txt', options)

return computed(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ H3 now supports defining event types using new generic type support.
When you define types, request utilities will be aware of the event input types. This enhancenment also allows us to enhance type safety for `$fetch` handlers in upstream frameworks like [Nitro](https://nitro.unjs.io/) and [Nuxt](https://nuxt.com/).

```ts
export default eventHandler<{ body: { name: string }; query: { id: string } }>(
export default eventHandler<{ body: { name: string }, query: { id: string } }>(
async (event) => {
const query = getQuery(event) // Query is typed as { id: string }
const body = await readBody(event) // Body is typed as { name: string }
Expand Down
2 changes: 1 addition & 1 deletion pages/blog/[...slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ useSeoMeta({
// TODO: Add og-image
const { data: packages } = await useAsyncData(`packages:${page.value?.packages.join(':')}`, () => queryContent('/packages/').only(['_path', 'title']).where({ _path: { $containsAny: page.value?.packages } }).find(), { watch: [() => page.value?.packages], default: () => [] }) as { data: Ref<{ _path: string; title: string }[]> }
const { data: packages } = await useAsyncData(`packages:${page.value?.packages.join(':')}`, () => queryContent('/packages/').only(['_path', 'title']).where({ _path: { $containsAny: page.value?.packages } }).find(), { watch: [() => page.value?.packages], default: () => [] }) as { data: Ref<{ _path: string, title: string }[]> }
</script>

<template>
Expand Down
2 changes: 1 addition & 1 deletion scripts/releases-article.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ async function main() {
}

return acc
}, [] as { name: string; releases: GithubRelease[] }[]).sort((a, b) => a.name.localeCompare(b.name))
}, [] as { name: string, releases: GithubRelease[] }[]).sort((a, b) => a.name.localeCompare(b.name))

const numberOfReleases = releasesFromCurrentMonth.reduce((acc, releases) => acc + releases.releases.length, 0)

Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export async function fetchRepos(): Promise<GitHubRepo[]> {
/**
* Fetch all releases from repos
*/
export async function fetchReleases(repos: GitHubRepo[]): Promise<{ releases: GithubRelease[]; name: string }[]> {
export async function fetchReleases(repos: GitHubRepo[]): Promise<{ releases: GithubRelease[], name: string }[]> {
const releases = await Promise.all(repos.map(async (repo) => {
const releases = await ofetch<{ releases: GithubRelease[] }>(`https://ungh.cc/repos/unjs/${repo.name}/releases`)
return {
Expand Down
4 changes: 2 additions & 2 deletions server/utils/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export async function fetchStars(owner: string, repo: string): Promise<number> {
/**
* Get contributors from GitHub
*/
export async function fetchContributors(owner: string, repo: string): Promise<{ id: number; username: string }[]> {
const { contributors } = await $fetch<{ contributors: { id: number; username: string; contributions: number }[] }>(`https://ungh.cc/repos/${owner}/${repo}/contributors`)
export async function fetchContributors(owner: string, repo: string): Promise<{ id: number, username: string }[]> {
const { contributors } = await $fetch<{ contributors: { id: number, username: string, contributions: number }[] }>(`https://ungh.cc/repos/${owner}/${repo}/contributors`)

const filteredContributors = contributors.filter(({ username }) => !username.includes('[bot]'))
const sortedContributors = filteredContributors.sort((a, b) => b.contributions - a.contributions)
Expand Down
4 changes: 2 additions & 2 deletions server/utils/rss.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export async function getMarkdownContent<T extends ParsedContent>(event: H3Event
return filteredFiles
}

export function contentToRssItem<T extends RssContent>(content: T, options: { site: string; default: { email: string } }): RssItem {
export function contentToRssItem<T extends RssContent>(content: T, options: { site: string, default: { email: string } }): RssItem {
return {
title: content.title ?? '',
link: `${options.site}${content._path}`,
Expand Down Expand Up @@ -151,6 +151,6 @@ function createRssChannelItem(item: RssItem): string {
*
* @see https://www.rssboard.org/rss-profile#data-types-email
*/
function buildRssEmail(email: { name: string; email: string }): string {
function buildRssEmail(email: { name: string, email: string }): string {
return `${email.email} (${email.name})`
}

0 comments on commit 4f55d68

Please sign in to comment.