Skip to content

Commit f5297dd

Browse files
committed
prettier instead of biome
1 parent 0e228d2 commit f5297dd

36 files changed

+793
-773
lines changed

.github/workflows/autofix.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: autofix.ci
33
on:
44
pull_request:
55
push:
6-
branches: [ "main", "reimagined" ]
6+
branches: ["main", "reimagined"]
77
permissions:
88
contents: read
99

@@ -16,7 +16,10 @@ jobs:
1616
- name: Set up Bun
1717
uses: oven-sh/setup-bun@v2
1818

19-
- name: Run ktfmt on plugin/src
19+
- name: Run Ktfmt
2020
run: bunx ktfmt@latest --kotlinlang-style plugin/src
2121

22-
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27
22+
- name: Run Prettier
23+
run: bun run format
24+
25+
- uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
plugin
2+
!plugin/src

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 100,
3+
"trailingComma": "all",
4+
"semi": true,
5+
"singleQuote": false
6+
}

apps/server/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ services:
2020
restart: unless-stopped
2121

2222
volumes:
23-
super-smash-mobs-brawl_postgres_data:
23+
super-smash-mobs-brawl_postgres_data:

apps/server/drizzle.config.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import { defineConfig } from "drizzle-kit";
22

33
export default defineConfig({
4-
schema: "./src/db/schema",
5-
out: "./src/db/migrations",
6-
dialect: "postgresql",
7-
dbCredentials: {
8-
url: process.env.DATABASE_URL || "",
9-
},
4+
schema: "./src/db/schema",
5+
out: "./src/db/migrations",
6+
dialect: "postgresql",
7+
dbCredentials: {
8+
url: process.env.DATABASE_URL || "",
9+
},
1010
});

apps/server/package.json

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
{
2-
"name": "server",
3-
"main": "src/index.ts",
4-
"type": "module",
5-
"scripts": {
6-
"build": "tsdown",
7-
"check-types": "tsc -b",
8-
"compile": "bun build --compile --minify --sourcemap --bytecode ./src/index.ts --outfile server",
9-
"dev": "bun run --hot src/index.ts",
10-
"start": "bun run dist/index.js",
11-
"db:push": "drizzle-kit push",
12-
"db:studio": "drizzle-kit studio",
13-
"db:generate": "drizzle-kit generate",
14-
"db:migrate": "drizzle-kit migrate",
15-
"db:start": "docker compose up -d",
16-
"db:watch": "docker compose up",
17-
"db:stop": "docker compose stop",
18-
"db:down": "docker compose down"
19-
},
20-
"dependencies": {
21-
"dotenv": "^17.2.1",
22-
"zod": "^4.0.2",
23-
"@trpc/server": "^11.4.2",
24-
"@trpc/client": "^11.4.2",
25-
"@hono/trpc-server": "^0.4.0",
26-
"hono": "^4.8.2",
27-
"drizzle-orm": "^0.44.2",
28-
"pg": "^8.14.1",
29-
"better-auth": "^1.3.4"
30-
},
31-
"devDependencies": {
32-
"tsdown": "^0.12.9",
33-
"typescript": "^5.8.2",
34-
"@types/bun": "^1.2.6",
35-
"drizzle-kit": "^0.31.2",
36-
"@types/pg": "^8.11.11"
37-
}
2+
"name": "server",
3+
"main": "src/index.ts",
4+
"type": "module",
5+
"scripts": {
6+
"build": "tsdown",
7+
"check-types": "tsc -b",
8+
"compile": "bun build --compile --minify --sourcemap --bytecode ./src/index.ts --outfile server",
9+
"dev": "bun run --hot src/index.ts",
10+
"start": "bun run dist/index.js",
11+
"db:push": "drizzle-kit push",
12+
"db:studio": "drizzle-kit studio",
13+
"db:generate": "drizzle-kit generate",
14+
"db:migrate": "drizzle-kit migrate",
15+
"db:start": "docker compose up -d",
16+
"db:watch": "docker compose up",
17+
"db:stop": "docker compose stop",
18+
"db:down": "docker compose down"
19+
},
20+
"dependencies": {
21+
"dotenv": "^17.2.1",
22+
"zod": "^4.0.2",
23+
"@trpc/server": "^11.4.2",
24+
"@trpc/client": "^11.4.2",
25+
"@hono/trpc-server": "^0.4.0",
26+
"hono": "^4.8.2",
27+
"drizzle-orm": "^0.44.2",
28+
"pg": "^8.14.1",
29+
"better-auth": "^1.3.4"
30+
},
31+
"devDependencies": {
32+
"tsdown": "^0.12.9",
33+
"typescript": "^5.8.2",
34+
"@types/bun": "^1.2.6",
35+
"drizzle-kit": "^0.31.2",
36+
"@types/pg": "^8.11.11"
37+
}
3838
}

apps/server/src/db/schema/auth.ts

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,51 @@
11
import { boolean, pgTable, text, timestamp } from "drizzle-orm/pg-core";
22

33
export const user = pgTable("user", {
4-
id: text("id").primaryKey(),
5-
name: text("name").notNull(),
6-
email: text("email").notNull().unique(),
7-
emailVerified: boolean("email_verified").notNull(),
8-
image: text("image"),
9-
createdAt: timestamp("created_at").notNull(),
10-
updatedAt: timestamp("updated_at").notNull(),
4+
id: text("id").primaryKey(),
5+
name: text("name").notNull(),
6+
email: text("email").notNull().unique(),
7+
emailVerified: boolean("email_verified").notNull(),
8+
image: text("image"),
9+
createdAt: timestamp("created_at").notNull(),
10+
updatedAt: timestamp("updated_at").notNull(),
1111
});
1212

1313
export const session = pgTable("session", {
14-
id: text("id").primaryKey(),
15-
expiresAt: timestamp("expires_at").notNull(),
16-
token: text("token").notNull().unique(),
17-
createdAt: timestamp("created_at").notNull(),
18-
updatedAt: timestamp("updated_at").notNull(),
19-
ipAddress: text("ip_address"),
20-
userAgent: text("user_agent"),
21-
userId: text("user_id")
22-
.notNull()
23-
.references(() => user.id, { onDelete: "cascade" }),
14+
id: text("id").primaryKey(),
15+
expiresAt: timestamp("expires_at").notNull(),
16+
token: text("token").notNull().unique(),
17+
createdAt: timestamp("created_at").notNull(),
18+
updatedAt: timestamp("updated_at").notNull(),
19+
ipAddress: text("ip_address"),
20+
userAgent: text("user_agent"),
21+
userId: text("user_id")
22+
.notNull()
23+
.references(() => user.id, { onDelete: "cascade" }),
2424
});
2525

2626
export const account = pgTable("account", {
27-
id: text("id").primaryKey(),
28-
accountId: text("account_id").notNull(),
29-
providerId: text("provider_id").notNull(),
30-
userId: text("user_id")
31-
.notNull()
32-
.references(() => user.id, { onDelete: "cascade" }),
33-
accessToken: text("access_token"),
34-
refreshToken: text("refresh_token"),
35-
idToken: text("id_token"),
36-
accessTokenExpiresAt: timestamp("access_token_expires_at"),
37-
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
38-
scope: text("scope"),
39-
password: text("password"),
40-
createdAt: timestamp("created_at").notNull(),
41-
updatedAt: timestamp("updated_at").notNull(),
27+
id: text("id").primaryKey(),
28+
accountId: text("account_id").notNull(),
29+
providerId: text("provider_id").notNull(),
30+
userId: text("user_id")
31+
.notNull()
32+
.references(() => user.id, { onDelete: "cascade" }),
33+
accessToken: text("access_token"),
34+
refreshToken: text("refresh_token"),
35+
idToken: text("id_token"),
36+
accessTokenExpiresAt: timestamp("access_token_expires_at"),
37+
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
38+
scope: text("scope"),
39+
password: text("password"),
40+
createdAt: timestamp("created_at").notNull(),
41+
updatedAt: timestamp("updated_at").notNull(),
4242
});
4343

4444
export const verification = pgTable("verification", {
45-
id: text("id").primaryKey(),
46-
identifier: text("identifier").notNull(),
47-
value: text("value").notNull(),
48-
expiresAt: timestamp("expires_at").notNull(),
49-
createdAt: timestamp("created_at"),
50-
updatedAt: timestamp("updated_at"),
45+
id: text("id").primaryKey(),
46+
identifier: text("identifier").notNull(),
47+
value: text("value").notNull(),
48+
expiresAt: timestamp("expires_at").notNull(),
49+
createdAt: timestamp("created_at"),
50+
updatedAt: timestamp("updated_at"),
5151
});

apps/server/src/index.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -11,29 +11,29 @@ const app = new Hono();
1111

1212
app.use(logger());
1313
app.use(
14-
"/*",
15-
cors({
16-
origin: process.env.CORS_ORIGIN || "",
17-
allowMethods: ["GET", "POST", "OPTIONS"],
18-
allowHeaders: ["Content-Type", "Authorization"],
19-
credentials: true,
20-
}),
14+
"/*",
15+
cors({
16+
origin: process.env.CORS_ORIGIN || "",
17+
allowMethods: ["GET", "POST", "OPTIONS"],
18+
allowHeaders: ["Content-Type", "Authorization"],
19+
credentials: true,
20+
}),
2121
);
2222

2323
app.on(["POST", "GET"], "/api/auth/**", (c) => auth.handler(c.req.raw));
2424

2525
app.use(
26-
"/trpc/*",
27-
trpcServer({
28-
router: appRouter,
29-
createContext: (_opts, context) => {
30-
return createContext({ context });
31-
},
32-
}),
26+
"/trpc/*",
27+
trpcServer({
28+
router: appRouter,
29+
createContext: (_opts, context) => {
30+
return createContext({ context });
31+
},
32+
}),
3333
);
3434

3535
app.get("/", (c) => {
36-
return c.text("OK");
36+
return c.text("OK");
3737
});
3838

3939
export default app;

apps/server/src/lib/auth.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ import { db } from "../db";
44
import * as schema from "../db/schema/auth";
55

66
export const auth = betterAuth({
7-
database: drizzleAdapter(db, {
8-
provider: "pg",
7+
database: drizzleAdapter(db, {
8+
provider: "pg",
99

10-
schema: schema,
11-
}),
12-
trustedOrigins: [process.env.CORS_ORIGIN || ""],
13-
emailAndPassword: {
14-
enabled: true,
15-
},
16-
secret: process.env.BETTER_AUTH_SECRET,
17-
baseURL: process.env.BETTER_AUTH_URL,
10+
schema: schema,
11+
}),
12+
trustedOrigins: [process.env.CORS_ORIGIN || ""],
13+
emailAndPassword: {
14+
enabled: true,
15+
},
16+
secret: process.env.BETTER_AUTH_SECRET,
17+
baseURL: process.env.BETTER_AUTH_URL,
1818
});

apps/server/src/lib/context.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import type { Context as HonoContext } from "hono";
22
import { auth } from "./auth";
33

44
export type CreateContextOptions = {
5-
context: HonoContext;
5+
context: HonoContext;
66
};
77

88
export async function createContext({ context }: CreateContextOptions) {
9-
const session = await auth.api.getSession({
10-
headers: context.req.raw.headers,
11-
});
12-
return {
13-
session,
14-
};
9+
const session = await auth.api.getSession({
10+
headers: context.req.raw.headers,
11+
});
12+
return {
13+
session,
14+
};
1515
}
1616

1717
export type Context = Awaited<ReturnType<typeof createContext>>;

0 commit comments

Comments
 (0)