Skip to content

Commit 8fa6618

Browse files
hkiratclaude
andcommitted
chore: remove unused code across monorepo
Delete dead files (useWebSocket hook, cleanupSandboxes job, shared constants), remove unused exports, variables, and props throughout server, web, and shared packages. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5163ca2 commit 8fa6618

24 files changed

Lines changed: 29 additions & 315 deletions

File tree

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
export const COOKIE_NAME = "vendi_session";
2-
export const SESSION_MAX_AGE_MS = 365 * 100 * 24 * 60 * 60 * 1000; // ~100 years (perpetual)
32
export const INVITE_EXPIRY_MS = 7 * 24 * 60 * 60 * 1000; // 7 days

apps/server/src/config/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const envSchema = z.object({
2727
OPENAI_API_KEY: z.string().optional(),
2828
});
2929

30-
export type Env = z.infer<typeof envSchema>;
30+
type Env = z.infer<typeof envSchema>;
3131

3232
function validateEnv(): Env {
3333
const parsed = envSchema.safeParse(process.env);

apps/server/src/jobs/cleanupSandboxes.ts

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

apps/server/src/routes/project.routes.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,6 @@ router.post(
314314
async (req: Request, res: Response) => {
315315
try {
316316
const projectId = getProjectId(req);
317-
const userId = res.locals.user.id;
318317
const { content } = req.body;
319318

320319
if (!content || typeof content !== "string") {

apps/server/src/services/github.service.ts

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,31 +32,6 @@ function githubApi(token: string) {
3232
};
3333
}
3434

35-
export async function createBranch(
36-
userId: string,
37-
repoFullName: string,
38-
branchName: string,
39-
baseBranch: string
40-
): Promise<void> {
41-
const token = await getGithubToken(userId);
42-
const api = githubApi(token);
43-
const [owner, repo] = repoFullName.split("/");
44-
45-
// Get SHA of base branch
46-
const ref = (await api.fetch(
47-
`/repos/${owner}/${repo}/git/ref/heads/${baseBranch}`
48-
)) as { object: { sha: string } };
49-
50-
// Create new branch
51-
await api.fetch(`/repos/${owner}/${repo}/git/refs`, {
52-
method: "POST",
53-
body: JSON.stringify({
54-
ref: `refs/heads/${branchName}`,
55-
sha: ref.object.sha,
56-
}),
57-
});
58-
}
59-
6035
export async function createPullRequest(
6136
userId: string,
6237
repoFullName: string,

apps/server/src/ws/handler.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ export async function handleWsConnection(ws: WebSocket, req: IncomingMessage) {
3333
return;
3434
}
3535

36-
const userId = user.id;
37-
3836
ws.on("message", async (data: RawData) => {
3937
try {
4038
const msg: WsClientMessage = JSON.parse(data.toString());

apps/server/src/ws/rooms.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,3 @@ export function broadcastToRoom(sessionId: string, message: object): void {
3434
}
3535
}
3636
}
37-
38-
export function getRoomSize(sessionId: string): number {
39-
return rooms.get(sessionId)?.size ?? 0;
40-
}

apps/web/src/components/layout/OrgLayout.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Outlet, Navigate, useParams, useOutletContext } from "react-router-dom";
1+
import { Outlet, Navigate, useParams } from "react-router-dom";
22
import { useQuery } from "@tanstack/react-query";
33
import { api } from "../../lib/api";
44
import type { Organization } from "@vendi/shared";
@@ -7,10 +7,6 @@ interface OrgContext {
77
org: Organization;
88
}
99

10-
export function useOrg() {
11-
return useOutletContext<OrgContext>();
12-
}
13-
1410
export function OrgLayout() {
1511
const { orgId } = useParams<{ orgId: string }>();
1612

apps/web/src/components/preview/VncPreview.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import RFB from "@novnc/novnc/core/rfb.js";
66

77
interface VncPreviewProps {
88
wsUrl: string | null;
9-
onRefresh?: () => void;
109
}
1110

1211
export function VncPreview({ wsUrl }: VncPreviewProps) {

apps/web/src/hooks/useWebSocket.ts

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

0 commit comments

Comments
 (0)