Skip to content

Commit 8a9ad31

Browse files
committed
chore: ready
1 parent 6e0e15a commit 8a9ad31

File tree

8 files changed

+659
-705
lines changed

8 files changed

+659
-705
lines changed

nitro.config.ts

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"build": "vite build",
88
"preview": "vite preview",
99
"lint": "eslint --ext .js,.vue src",
10-
"typecheck": "vue-tsc -p ./tsconfig.app.json",
10+
"typecheck": "vue-tsc -p ./tsconfig.json",
1111
"db:generate": "drizzle-kit generate",
1212
"db:migrate": "drizzle-kit migrate"
1313
},
@@ -23,7 +23,7 @@
2323
"drizzle-orm": "^0.44.7",
2424
"katex": "^0.16.25",
2525
"mermaid": "^11.12.1",
26-
"nitro": "3.0.1-alpha.1",
26+
"nitro": "npm:nitro-nightly@latest",
2727
"ofetch": "^1.5.1",
2828
"pg": "^8.16.3",
2929
"shiki-stream": "^0.1.3",

pnpm-lock.yaml

Lines changed: 634 additions & 636 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/composables/useChats.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { isToday, isYesterday, subMonths } from 'date-fns'
22
import { computed, ref } from 'vue'
33
import { createSharedComposable } from '@vueuse/core'
44
import { $fetch } from 'ofetch'
5+
import type { Chat as ChatData } from '~/server/utils/drizzle'
56

67
interface Chat {
78
id: string
@@ -14,13 +15,13 @@ export const useChats = createSharedComposable(() => {
1415
const chats = ref<Chat[]>([])
1516

1617
const fetchChats = async () => {
17-
chats.value = await $fetch('/api/chats').then(data => data.map(chat => ({
18+
chats.value = await $fetch('/api/chats').then((data: ChatData[]) => data.map(chat => ({
1819
id: chat.id,
1920
label: chat.title || 'Untitled',
2021
to: `/chat/${chat.id}`,
2122
icon: 'i-lucide-message-circle',
22-
createdAt: chat.createdAt
23-
}))).catch(error => {
23+
createdAt: String(chat.createdAt)
24+
}) as Chat)).catch(error => {
2425
console.error(error)
2526
return []
2627
})

tsconfig.app.json

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

tsconfig.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,19 @@
11
{
2-
"files": [],
3-
"references": [
4-
{ "path": "./tsconfig.app.json" },
5-
{ "path": "./tsconfig.node.json" }
2+
"extends": ["nitro/tsconfig"],
3+
"compilerOptions": {
4+
"paths": {
5+
"~/*": ["./*"]
6+
},
7+
"types": [
8+
"unplugin-vue-router/client",
9+
"vite-plugin-vue-layouts/client"
10+
]
11+
},
12+
"include": [
13+
"./typed-router.d.ts",
14+
"src/**/*.ts",
15+
"src/**/*.vue",
16+
"auto-imports.d.ts",
17+
"components.d.ts"
618
]
719
}

tsconfig.node.json

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

vite.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export default defineConfig({
2121
}
2222
}
2323
}),
24-
nitro(),
24+
nitro({
25+
serverDir: './server'
26+
}),
2527
vueDevtools(),
2628
]
2729
})

0 commit comments

Comments
 (0)