Skip to content

Commit ae7891f

Browse files
committed
feat: ultracite
1 parent ef66da9 commit ae7891f

Some content is hidden

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

63 files changed

+6674
-6821
lines changed

.vscode/settings.json

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
{
2-
"files.associations": {
3-
"wrangler.json": "jsonc"
4-
}
2+
"files.associations": {
3+
"wrangler.json": "jsonc"
4+
},
5+
"editor.defaultFormatter": "esbenp.prettier-vscode",
6+
"[javascript][typescript][javascriptreact][typescriptreact][json][jsonc][css][graphql]": {
7+
"editor.defaultFormatter": "biomejs.biome"
8+
},
9+
"typescript.tsdk": "node_modules/typescript/lib",
10+
"editor.formatOnSave": true,
11+
"editor.formatOnPaste": true,
12+
"emmet.showExpandedAbbreviation": "never",
13+
"editor.codeActionsOnSave": {
14+
"source.fixAll.biome": "explicit",
15+
"source.organizeImports.biome": "explicit"
16+
}
517
}

biome.json

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,4 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.5.1/schema.json",
3-
"organizeImports": {
4-
"enabled": true
5-
},
6-
"linter": {
7-
"enabled": true,
8-
"rules": {
9-
"recommended": true
10-
},
11-
"ignore": [".next/", "out/", ".wrangler/", ".open-next/"]
12-
},
13-
"formatter": {
14-
"enabled": true,
15-
"indentWidth": 4,
16-
"indentStyle": "tab",
17-
"ignore": [".next/", "out/", ".wrangler/", ".open-next/"]
18-
},
19-
"javascript": {
20-
"formatter": {
21-
"bracketSpacing": true
22-
}
23-
}
2+
"extends": ["ultracite"],
3+
"$schema": "https://biomejs.dev/schemas/2.0.6/schema.json"
244
}

bun.lock

Lines changed: 199 additions & 10 deletions
Large diffs are not rendered by default.

components.json

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
{
2-
"$schema": "https://ui.shadcn.com/schema.json",
3-
"style": "new-york",
4-
"rsc": true,
5-
"tsx": true,
6-
"tailwind": {
7-
"config": "",
8-
"css": "src/app/globals.css",
9-
"baseColor": "neutral",
10-
"cssVariables": true,
11-
"prefix": ""
12-
},
13-
"aliases": {
14-
"components": "@/components",
15-
"utils": "@/lib/utils",
16-
"ui": "@/components/ui",
17-
"lib": "@/lib",
18-
"hooks": "@/hooks"
19-
},
20-
"iconLibrary": "lucide"
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/app/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
2121
}

next.config.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import type { NextConfig } from "next";
1+
import type { NextConfig } from 'next';
22

33
const nextConfig: NextConfig = {
4-
output: "standalone",
5-
experimental: {
6-
serverActions: {
7-
bodySizeLimit: "8mb",
8-
},
9-
},
4+
output: 'standalone',
5+
experimental: {
6+
serverActions: {
7+
bodySizeLimit: '8mb',
8+
},
9+
},
1010
};
1111

1212
export default nextConfig;

package.json

Lines changed: 61 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,63 @@
11
{
2-
"name": "md-chat",
3-
"version": "0.1.0",
4-
"private": true,
5-
"scripts": {
6-
"dev": "next dev --turbopack",
7-
"build": "next build",
8-
"start": "next start",
9-
"lint": "next lint",
10-
"format": "biome format --write ."
11-
},
12-
"dependencies": {
13-
"@ai-sdk/anthropic": "^1.2.12",
14-
"@ai-sdk/google": "^1.2.19",
15-
"@ai-sdk/groq": "^1.2.9",
16-
"@ai-sdk/openai": "^1.3.22",
17-
"@ai-sdk/react": "^1.2.12",
18-
"@ai-sdk/ui-utils": "^1.2.11",
19-
"@ai-sdk/xai": "^1.2.16",
20-
"@aws-sdk/client-s3": "^3.826.0",
21-
"@biomejs/biome": "^1.9.4",
22-
"@logto/next": "^4.2.4",
23-
"@openrouter/ai-sdk-provider": "^0.7.2",
24-
"@prisma/client": "^6.10.0",
25-
"@radix-ui/react-avatar": "^1.1.10",
26-
"@radix-ui/react-label": "^2.1.7",
27-
"@radix-ui/react-separator": "^1.1.7",
28-
"@radix-ui/react-slot": "^1.2.3",
29-
"ai": "^4.3.16",
30-
"class-variance-authority": "^0.7.1",
31-
"clsx": "^2.1.1",
32-
"daisyui": "^5.0.43",
33-
"lucide-react": "^0.513.0",
34-
"motion": "^12.16.0",
35-
"next": "^15.3.4",
36-
"ollama-ai-provider": "^1.2.0",
37-
"prisma": "^6.10.0",
38-
"radix-ui": "^1.4.2",
39-
"react": "^19.1.0",
40-
"react-dom": "^19.1.0",
41-
"react-icons": "^5.5.0",
42-
"react-markdown": "^10.1.0",
43-
"react-syntax-highlighter": "^15.6.1",
44-
"redis": "^5.5.6",
45-
"remark-gfm": "^4.0.1",
46-
"resumable-stream": "^2.2.0",
47-
"sonner": "^2.0.5",
48-
"tailwind-merge": "^3.3.0",
49-
"tailwind-variants": "^1.0.0",
50-
"zod": "^3.25.56"
51-
},
52-
"devDependencies": {
53-
"@tailwindcss/postcss": "^4.1.8",
54-
"@types/node": "^22.15.30",
55-
"@types/react": "^19",
56-
"@types/react-dom": "^19",
57-
"@types/react-syntax-highlighter": "^15.5.13",
58-
"tailwindcss": "^4.1.8",
59-
"tw-animate-css": "^1.3.4",
60-
"typescript": "^5"
61-
}
2+
"name": "md-chat",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev --turbopack",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint",
10+
"format": "ultracite format"
11+
},
12+
"dependencies": {
13+
"@ai-sdk/anthropic": "^1.2.12",
14+
"@ai-sdk/google": "^1.2.19",
15+
"@ai-sdk/groq": "^1.2.9",
16+
"@ai-sdk/openai": "^1.3.22",
17+
"@ai-sdk/react": "^1.2.12",
18+
"@ai-sdk/ui-utils": "^1.2.11",
19+
"@ai-sdk/xai": "^1.2.16",
20+
"@aws-sdk/client-s3": "^3.826.0",
21+
"@biomejs/biome": "2.0.6",
22+
"@logto/next": "^4.2.4",
23+
"@openrouter/ai-sdk-provider": "^0.7.2",
24+
"@prisma/client": "^6.10.0",
25+
"@radix-ui/react-avatar": "^1.1.10",
26+
"@radix-ui/react-label": "^2.1.7",
27+
"@radix-ui/react-separator": "^1.1.7",
28+
"@radix-ui/react-slot": "^1.2.3",
29+
"ai": "^4.3.16",
30+
"class-variance-authority": "^0.7.1",
31+
"clsx": "^2.1.1",
32+
"daisyui": "^5.0.43",
33+
"lucide-react": "^0.513.0",
34+
"motion": "^12.16.0",
35+
"next": "^15.3.4",
36+
"ollama-ai-provider": "^1.2.0",
37+
"prisma": "^6.10.0",
38+
"radix-ui": "^1.4.2",
39+
"react": "^19.1.0",
40+
"react-dom": "^19.1.0",
41+
"react-icons": "^5.5.0",
42+
"react-markdown": "^10.1.0",
43+
"react-syntax-highlighter": "^15.6.1",
44+
"redis": "^5.5.6",
45+
"remark-gfm": "^4.0.1",
46+
"resumable-stream": "^2.2.0",
47+
"sonner": "^2.0.5",
48+
"tailwind-merge": "^3.3.0",
49+
"tailwind-variants": "^1.0.0",
50+
"zod": "^3.25.56"
51+
},
52+
"devDependencies": {
53+
"@tailwindcss/postcss": "^4.1.8",
54+
"@types/node": "^22.15.30",
55+
"@types/react": "^19",
56+
"@types/react-dom": "^19",
57+
"@types/react-syntax-highlighter": "^15.5.13",
58+
"tailwindcss": "^4.1.8",
59+
"tw-animate-css": "^1.3.4",
60+
"typescript": "^5",
61+
"ultracite": "5.0.32"
62+
}
6263
}

postcss.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const config = {
2-
plugins: ["@tailwindcss/postcss"],
2+
plugins: ['@tailwindcss/postcss'],
33
};
44

55
export default config;

src/actions/apikey.ts

Lines changed: 55 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,72 @@
1-
"use server";
1+
'use server';
22

3-
import { getLogtoContext } from "@logto/next/server-actions";
4-
import { logtoConfig } from "@/lib/auth";
5-
import { prisma } from "@/lib/prisma";
3+
import { getLogtoContext } from '@logto/next/server-actions';
4+
import { logtoConfig } from '@/lib/auth';
5+
import { prisma } from '@/lib/prisma';
66

77
export async function setApiKey({
8-
provider,
9-
key,
8+
provider,
9+
key,
1010
}: {
11-
provider: string;
12-
key: string;
11+
provider: string;
12+
key: string;
1313
}) {
14-
const { claims } = await getLogtoContext(logtoConfig);
14+
const { claims } = await getLogtoContext(logtoConfig);
1515

16-
if (!claims) {
17-
throw new Error("User not authenticated");
18-
}
16+
if (!claims) {
17+
throw new Error('User not authenticated');
18+
}
1919

20-
const user = await prisma.user.findUnique({ where: { id: claims?.sub } });
20+
const user = await prisma.user.findUnique({ where: { id: claims?.sub } });
2121

22-
if (!user) {
23-
await prisma.user.create({ data: { id: claims?.sub } });
24-
}
22+
if (!user) {
23+
await prisma.user.create({ data: { id: claims?.sub } });
24+
}
2525

26-
const existingKey = await prisma.apiKey.findFirst({
27-
where: {
28-
userId: claims.sub,
29-
providerId: provider,
30-
},
31-
});
26+
const existingKey = await prisma.apiKey.findFirst({
27+
where: {
28+
userId: claims.sub,
29+
providerId: provider,
30+
},
31+
});
3232

33-
if (existingKey) {
34-
await prisma.apiKey.update({
35-
where: { id: existingKey.id },
36-
data: {
37-
key,
38-
},
39-
});
40-
} else {
41-
await prisma.apiKey.create({
42-
data: {
43-
userId: claims.sub,
44-
providerId: provider,
45-
key,
46-
},
47-
});
48-
}
33+
if (existingKey) {
34+
await prisma.apiKey.update({
35+
where: { id: existingKey.id },
36+
data: {
37+
key,
38+
},
39+
});
40+
} else {
41+
await prisma.apiKey.create({
42+
data: {
43+
userId: claims.sub,
44+
providerId: provider,
45+
key,
46+
},
47+
});
48+
}
4949
}
5050

5151
export async function deleteApiKey(provider: string) {
52-
const { claims } = await getLogtoContext(logtoConfig);
52+
const { claims } = await getLogtoContext(logtoConfig);
5353

54-
if (!claims) {
55-
throw new Error("User not authenticated");
56-
}
54+
if (!claims) {
55+
throw new Error('User not authenticated');
56+
}
5757

58-
const existingKey = await prisma.apiKey.findFirst({
59-
where: {
60-
userId: claims.sub,
61-
providerId: provider,
62-
},
63-
});
58+
const existingKey = await prisma.apiKey.findFirst({
59+
where: {
60+
userId: claims.sub,
61+
providerId: provider,
62+
},
63+
});
6464

65-
if (existingKey) {
66-
await prisma.apiKey.delete({
67-
where: { id: existingKey.id },
68-
});
69-
} else {
70-
throw new Error("API key not found");
71-
}
65+
if (existingKey) {
66+
await prisma.apiKey.delete({
67+
where: { id: existingKey.id },
68+
});
69+
} else {
70+
throw new Error('API key not found');
71+
}
7272
}

0 commit comments

Comments
 (0)