Skip to content
This repository was archived by the owner on Jul 17, 2025. It is now read-only.

Commit b5aa27d

Browse files
committed
style: added prettier, formating the code
1 parent da2fba8 commit b5aa27d

27 files changed

+240
-124
lines changed

bun.lockb

195 KB
Binary file not shown.

package-lock.json

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

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"build": "next build",
77
"start": "next start -p 9169",
88
"lint": "next lint",
9-
"test": "tsx ./tests/test.ts"
9+
"test": "tsx ./tests/test.ts",
10+
"format": "prettier --write 'src/**/*.{js,jsx,ts,tsx}'"
1011
},
1112
"dependencies": {
1213
"@radix-ui/react-slot": "^1.1.0",
@@ -35,6 +36,8 @@
3536
"eslint": "^8",
3637
"eslint-config-next": "15.0.1",
3738
"postcss": "^8",
39+
"prettier": "^3.3.3",
40+
"prettier-plugin-tailwindcss": "^0.6.9",
3841
"tailwindcss": "^3.4.1",
3942
"tsx": "^4.19.2",
4043
"typescript": "^5"

prettier.config.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/** @type {import('prettier').Config & import('prettier-plugin-tailwindcss').PluginOptions} */
2+
const config = {
3+
plugins: ["prettier-plugin-tailwindcss"],
4+
arrowParens: "always",
5+
printWidth: 80,
6+
singleQuote: false,
7+
jsxSingleQuote: false,
8+
semi: true,
9+
trailingComma: "none",
10+
tabWidth: 2,
11+
};
12+
13+
export default config;

src/app/api/delete/[inboxid]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@ export async function GET(request: NextRequest) {
1919
return NextResponse.json(
2020
{ error: deleteResult.error.message },
2121
{
22-
status: 400,
22+
status: 400
2323
}
2424
);
2525
}
2626

2727
return NextResponse.json(
2828
{ error: getResult.error.message },
2929
{
30-
status: 400,
30+
status: 400
3131
}
3232
);
3333
}

src/app/api/email/[email]/route.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export async function GET(request: NextRequest) {
1010
return NextResponse.json(
1111
{ error: "Invalid email address" },
1212
{
13-
status: 400,
13+
status: 400
1414
}
1515
);
1616

@@ -20,7 +20,7 @@ export async function GET(request: NextRequest) {
2020
return NextResponse.json(
2121
{ error: result.error.message },
2222
{
23-
status: 400,
23+
status: 400
2424
}
2525
);
2626
}

src/app/api/inbox/[inboxid]/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export async function GET(request: NextRequest) {
1919
return NextResponse.json(
2020
{ error: result.error.message },
2121
{
22-
status: 400,
22+
status: 400
2323
}
2424
);
2525
}

src/app/api/page.tsx

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,32 +5,32 @@ export default function Component() {
55
return (
66
<div className="mx-auto mb-4 flex w-full max-w-3xl flex-col items-center space-y-6">
77
<section className="text-center">
8-
<h1 className="text-primary mb-1 text-4xl font-bold">VWH Email API</h1>
9-
<p className="text-foreground/80 text-xl">REST API Documentation</p>
8+
<h1 className="mb-1 text-4xl font-bold text-primary">VWH Email API</h1>
9+
<p className="text-xl text-foreground/80">REST API Documentation</p>
1010
</section>
1111
<section className="w-full space-y-8">
1212
{/* Email Endpoint */}
13-
<div className="bg-primary/10 group relative w-full overflow-hidden rounded border p-4 transition-all duration-300 ease-in-out hover:shadow-md">
13+
<div className="group relative w-full overflow-hidden rounded border bg-primary/10 p-4 transition-all duration-300 ease-in-out hover:shadow-md">
1414
<div className="flex flex-col space-y-2">
1515
<div className="flex items-center justify-between">
1616
<div className="flex items-center space-x-2">
1717
<MailIcon className="h-5 w-5 text-gray-400" />
18-
<h2 className="text-primary text-lg font-semibold">
18+
<h2 className="text-lg font-semibold text-primary">
1919
Get Email Messages
2020
</h2>
2121
</div>
22-
<span className="text-foreground/80 text-sm font-medium">
22+
<span className="text-sm font-medium text-foreground/80">
2323
GET
2424
</span>
2525
</div>
2626
<p className="text-foreground/80">
2727
Retrieve all messages for a specific email address
2828
</p>
2929
<div className="mt-2 space-y-2">
30-
<h2 className="text-primary text-md font-semibold">Endpoint</h2>
30+
<h2 className="text-md font-semibold text-primary">Endpoint</h2>
3131
<section className="flex items-center gap-2">
32-
<div className="bg-primary/5 rounded p-2 flex-grow min-w-0">
33-
<code className="text-sm block truncate">
32+
<div className="min-w-0 flex-grow rounded bg-primary/5 p-2">
33+
<code className="block truncate text-sm">
3434
https://email.vwh.sh/api/email/{"{email}"}
3535
</code>
3636
</div>
@@ -40,12 +40,12 @@ export default function Component() {
4040
className="flex-shrink-0"
4141
/>
4242
</section>
43-
<h2 className="text-primary text-md font-semibold">Parameters</h2>
44-
<ul className="list-disc list-inside text-sm text-foreground/80">
43+
<h2 className="text-md font-semibold text-primary">Parameters</h2>
44+
<ul className="list-inside list-disc text-sm text-foreground/80">
4545
<li>email (string): The email address to fetch messages for</li>
4646
</ul>
47-
<h2 className="text-primary text-md font-semibold">Response</h2>
48-
<div className="bg-primary/5 rounded p-2 overflow-x-auto">
47+
<h2 className="text-md font-semibold text-primary">Response</h2>
48+
<div className="overflow-x-auto rounded bg-primary/5 p-2">
4949
<pre className="text-sm text-foreground/80">
5050
{`[
5151
{
@@ -65,27 +65,27 @@ export default function Component() {
6565
</div>
6666
</div>
6767
{/* Inbox Endpoint */}
68-
<div className="bg-primary/10 group relative w-full overflow-hidden rounded border p-4 transition-all duration-300 ease-in-out hover:shadow-md">
68+
<div className="group relative w-full overflow-hidden rounded border bg-primary/10 p-4 transition-all duration-300 ease-in-out hover:shadow-md">
6969
<div className="flex flex-col space-y-2">
7070
<div className="flex items-center justify-between">
7171
<div className="flex items-center space-x-2">
7272
<MailIcon className="h-5 w-5 text-gray-400" />
73-
<h2 className="text-primary text-lg font-semibold">
73+
<h2 className="text-lg font-semibold text-primary">
7474
Get Inbox Message
7575
</h2>
7676
</div>
77-
<span className="text-foreground/80 text-sm font-medium">
77+
<span className="text-sm font-medium text-foreground/80">
7878
GET
7979
</span>
8080
</div>
8181
<p className="text-foreground/80">
8282
Retrieve a specific message by its ID
8383
</p>
8484
<div className="mt-2 space-y-2">
85-
<h2 className="text-primary text-md font-semibold">Endpoint</h2>
85+
<h2 className="text-md font-semibold text-primary">Endpoint</h2>
8686
<section className="flex items-center gap-2">
87-
<div className="bg-primary/5 rounded p-2 flex-grow min-w-0">
88-
<code className="text-sm block truncate">
87+
<div className="min-w-0 flex-grow rounded bg-primary/5 p-2">
88+
<code className="block truncate text-sm">
8989
https://email.vwh.sh/api/inbox/{"{inboxId}"}
9090
</code>
9191
</div>
@@ -95,12 +95,12 @@ export default function Component() {
9595
className="flex-shrink-0"
9696
/>
9797
</section>
98-
<h2 className="text-primary text-md font-semibold">Parameters</h2>
99-
<ul className="list-disc list-inside text-sm text-foreground/80">
98+
<h2 className="text-md font-semibold text-primary">Parameters</h2>
99+
<ul className="list-inside list-disc text-sm text-foreground/80">
100100
<li>inboxId (string): The unique identifier of the message</li>
101101
</ul>
102-
<h2 className="text-primary text-md font-semibold">Response</h2>
103-
<div className="bg-primary/5 rounded p-2 overflow-x-auto">
102+
<h2 className="text-md font-semibold text-primary">Response</h2>
103+
<div className="overflow-x-auto rounded bg-primary/5 p-2">
104104
<pre className="text-sm text-foreground/80">
105105
{`{
106106
"id": "{inboxId}",
@@ -118,27 +118,27 @@ export default function Component() {
118118
</div>
119119
</div>
120120
{/* Delete Endpoint */}
121-
<div className="bg-primary/10 group relative w-full overflow-hidden rounded border p-4 transition-all duration-300 ease-in-out hover:shadow-md">
121+
<div className="group relative w-full overflow-hidden rounded border bg-primary/10 p-4 transition-all duration-300 ease-in-out hover:shadow-md">
122122
<div className="flex flex-col space-y-2">
123123
<div className="flex items-center justify-between">
124124
<div className="flex items-center space-x-2">
125125
<Trash2Icon className="h-5 w-5 text-gray-400" />
126-
<h2 className="text-primary text-lg font-semibold">
126+
<h2 className="text-lg font-semibold text-primary">
127127
Delete Inbox Message
128128
</h2>
129129
</div>
130-
<span className="text-foreground/80 text-sm font-medium">
130+
<span className="text-sm font-medium text-foreground/80">
131131
GET
132132
</span>
133133
</div>
134134
<p className="text-foreground/80">
135135
Delete a specific message by its ID
136136
</p>
137137
<div className="mt-2 space-y-2">
138-
<h2 className="text-primary text-md font-semibold">Endpoint</h2>
138+
<h2 className="text-md font-semibold text-primary">Endpoint</h2>
139139
<section className="flex items-center gap-2">
140-
<div className="bg-primary/5 rounded p-2 flex-grow min-w-0">
141-
<code className="text-sm block truncate">
140+
<div className="min-w-0 flex-grow rounded bg-primary/5 p-2">
141+
<code className="block truncate text-sm">
142142
https://email.vwh.sh/api/delete/{"{inboxId}"}
143143
</code>
144144
</div>
@@ -148,12 +148,12 @@ export default function Component() {
148148
className="flex-shrink-0"
149149
/>
150150
</section>
151-
<h2 className="text-primary text-md font-semibold">Parameters</h2>
152-
<ul className="list-disc list-inside text-sm text-foreground/80">
151+
<h2 className="text-md font-semibold text-primary">Parameters</h2>
152+
<ul className="list-inside list-disc text-sm text-foreground/80">
153153
<li>inboxId (string): The unique identifier of the message</li>
154154
</ul>
155-
<h2 className="text-primary text-md font-semibold">Response</h2>
156-
<div className="bg-primary/5 rounded p-2 overflow-x-auto">
155+
<h2 className="text-md font-semibold text-primary">Response</h2>
156+
<div className="overflow-x-auto rounded bg-primary/5 p-2">
157157
<pre className="text-sm text-foreground/80">true</pre>
158158
</div>
159159
</div>

0 commit comments

Comments
 (0)