Skip to content

Commit 1ea3865

Browse files
authored
chore: cleaning up, type fixes (#247)
* chore: cleaning up, type fixes * chore: revert tailwind class reordering
1 parent f7c66f1 commit 1ea3865

File tree

6 files changed

+13
-3428
lines changed

6 files changed

+13
-3428
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,5 +169,5 @@ dist
169169
.pnp.\*
170170
.DS_Store
171171

172-
docs/.vitepress/cache
173-
docs/.vitepress/dist
172+
**/.vitepress/cache
173+
**/.vitepress/dist

components/midori/sponsor.data.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { defineLoader } from 'vitepress';
2+
13
export interface Sponsor {
24
sponsorEntity: {
35
login: string
@@ -12,8 +14,11 @@ export interface Sponsor {
1214
}
1315
}
1416

15-
export default {
16-
async load() {
17+
declare const data: Sponsor[]
18+
export { data }
19+
20+
export default defineLoader({
21+
async load(): Promise<Sponsor[]> {
1722
const result = await fetch('https://api.github.com/graphql', {
1823
method: 'POST',
1924
headers: {
@@ -49,7 +54,7 @@ export default {
4954
}).then((x) => x.json())
5055

5156
// @ts-ignore
52-
const data: Sponsor[] = result.data.user.sponsorshipsAsMaintainer.nodes
57+
const data: Sponsor[] = result.data?.user?.sponsorshipsAsMaintainer?.nodes || []
5358

5459
return data.filter(x => !x.tier.isOneTime).sort(
5560
(a, b) =>
@@ -59,4 +64,4 @@ export default {
5964
new Date(b?.createdAt).getTime()
6065
)
6166
}
62-
}
67+
})

components/midori/sponsor.vue

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,7 @@ import relativeTime from 'dayjs/plugin/relativeTime'
9595
9696
dayjs.extend(relativeTime)
9797
98-
// @ts-ignore
99-
import { data, type Sponsor } from './sponsor.data.ts'
100-
101-
console.log({
102-
data
103-
})
98+
import { data, type Sponsor } from './sponsor.data'
10499
105100
const sponsors: Sponsor[] = data
106101
</script>

docs/essential/plugin.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ const app = new Elysia()
7474
.listen(8080)
7575
```
7676

77-
## Functional callback
77+
## Functional callback
7878

7979
It's recommended to define a new plugin instance instead of using a function callback.
8080

docs/vite.config.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)