Skip to content

Commit ff9bf0f

Browse files
committed
Merge branch 'main' of github.com:ut-code/CourseMate into make-it-ssg
2 parents 516aab7 + 0b39bd1 commit ff9bf0f

Some content is hidden

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

62 files changed

+1114
-2817
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ jobs:
2626
with:
2727
bun-version: latest
2828
- run: bun i --frozen-lockfile
29-
working-directory: server
3029
- run: bunx prisma db push
3130
working-directory: server
3231

@@ -39,7 +38,7 @@ jobs:
3938
- uses: oven-sh/setup-bun@v2
4039
with:
4140
bun-version: latest
42-
- run: bun install
41+
- run: bun install --frozen-lockfile
4342
- run: bun run build
4443

4544
biome:

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,5 @@ lerna-debug.log*
2222
*.njsproj
2323
*.sln
2424
*.sw?
25+
26+
tsconfig.tsbuildinfo

bun.lock

Lines changed: 56 additions & 204 deletions
Large diffs are not rendered by default.

common/bun.lock

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

common/lib/panic.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,3 @@ export function panic(reason: string): never {
44
cause: "panic",
55
});
66
}
7-
8-
// expected error
9-
export function error(reason: string, code?: number): never {
10-
throw new Error(reason, { cause: code });
11-
}

common/types.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
// common/type/types.ts
22

3+
import type { Message } from "./zod/types.ts";
4+
35
export type {
46
UserID,
57
GUID,
@@ -34,3 +36,23 @@ export type {
3436
InitSharedRoom,
3537
UpdateRoom,
3638
} from "./zod/types.ts";
39+
40+
export type SSEChatEvents = {
41+
"Chat:Append": {
42+
message: Message;
43+
sender: string; // user name
44+
};
45+
"Chat:Update": {
46+
id: number;
47+
message: Message;
48+
};
49+
"Chat:Delete": {
50+
id: number;
51+
};
52+
"Chat:Ping": "";
53+
};
54+
export type SSEChatEventEnum = "Chat:Append" | "Chat:Update" | "Chat:Delete";
55+
export type SSEChatEvent<T extends SSEChatEventEnum> = {
56+
event: T;
57+
data: SSEChatEvents[T];
58+
};

common/zod/schemas.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const DaySchema = z.enum([
7878
"other",
7979
]);
8080

81-
export const PeriodSchema = z.number().min(0).max(6);
81+
export const PeriodSchema = z.coerce.number().min(0).max(6);
8282

8383
export const SlotSchema = z.object({
8484
day: DaySchema,

package.json

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,16 @@
22
"name": "course-mate",
33
"private": true,
44
"version": "1.0.0",
5-
"description": "",
5+
"author": "",
66
"main": "index.js",
7+
"devDependencies": {
8+
"@biomejs/biome": "^1.9.1",
9+
"lefthook": "^1.10.10",
10+
"lint-staged": "^15.2.10"
11+
},
12+
"description": "",
13+
"keywords": [],
14+
"license": "ISC",
715
"scripts": {
816
"prepare": "lefthook install && (cd server; bun run prepare)",
917
"check": "bun type && bun style:check",
@@ -20,23 +28,14 @@
2028
"watch:web": "cd web; bun run dev",
2129
"watch:server": "cd server; bun run dev",
2230
"seed": "cd server; bun prisma db seed",
23-
"prepare:deploy:web": "bun install --frozen-lockfile && bun run build:web",
24-
"prepare:deploy:server": "bun install --frozen-lockfile",
31+
"prepare:deploy:web": "bun install && bun run build:web",
32+
"prepare:deploy:server": "bun install",
2533
"deploy:web": "cd web; bun run start --port $PORT",
26-
"deploy:server": "cd server; bun run src/main.ts",
34+
"deploy:server": "cd server; bun run src/index.ts",
2735
"dev-db": "make dev-db",
2836
"test": "make test",
2937
"spell": "bunx cspell --quiet ."
3038
},
31-
"keywords": [],
32-
"author": "",
33-
"license": "ISC",
34-
"workspaces": ["common", "web", "server"],
35-
"devDependencies": {
36-
"@biomejs/biome": "^1.9.1",
37-
"lefthook": "^1.10.10",
38-
"lint-staged": "^15.2.10"
39-
},
40-
"dependencies": {},
41-
"trustedDependencies": ["@biomejs/biome", "lefthook"]
39+
"trustedDependencies": ["@biomejs/biome", "lefthook"],
40+
"workspaces": ["common", "web", "server"]
4241
}

0 commit comments

Comments
 (0)