Skip to content

Commit

Permalink
feat: upgrade packages
Browse files Browse the repository at this point in the history
  • Loading branch information
agrattan0820 committed Nov 16, 2023
1 parent 1b98f26 commit 2f4459b
Show file tree
Hide file tree
Showing 8 changed files with 1,494 additions and 1,022 deletions.
36 changes: 18 additions & 18 deletions apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,49 +10,49 @@
"test:e2e": "playwright test"
},
"dependencies": {
"@auth/drizzle-adapter": "^0.3.3",
"@sentry/nextjs": "^7.73.0",
"@tanstack/react-query": "^4.36.1",
"@auth/drizzle-adapter": "^0.3.6",
"@sentry/nextjs": "^7.80.1",
"@tanstack/react-query": "^5.8.4",
"@upstash/ratelimit": "^0.4.4",
"@upstash/redis": "^1.23.3",
"@vercel/analytics": "^1.1.0",
"@upstash/redis": "^1.25.1",
"@vercel/analytics": "^1.1.1",
"@xstate/react": "^3.2.2",
"autoprefixer": "10.4.16",
"clsx": "^2.0.0",
"database": "workspace:*",
"drizzle-orm": "^0.28.6",
"framer-motion": "^10.16.4",
"next": "^13.5.4",
"next-auth": "^4.23.2",
"drizzle-orm": "^0.29.0",
"framer-motion": "^10.16.5",
"next": "^14.0.2",
"next-auth": "^4.24.5",
"postcss": "8.4.31",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-hot-toast": "^2.4.1",
"react-icons": "^4.11.0",
"react-icons": "^4.12.0",
"server-only": "^0.0.1",
"sharp": "^0.32.6",
"socket.io-client": "^4.7.2",
"tailwind-merge": "^1.14.0",
"tailwindcss": "^3.3.3",
"tailwind-merge": "^2.0.0",
"tailwindcss": "^3.3.5",
"typescript": "5.2.2",
"use-sound": "^4.0.1",
"xstate": "^4.38.2"
"xstate": "^4.38.3"
},
"devDependencies": {
"@playwright/test": "^1.39.0",
"@tailwindcss/typography": "^0.5.10",
"@types/node": "^20.8.4",
"@types/react": "^18.2.28",
"@types/react-dom": "^18.2.13",
"@types/node": "^20.9.0",
"@types/react": "^18.2.37",
"@types/react-dom": "^18.2.15",
"eslint-config-custom": "workspace:*",
"prettier-plugin-tailwindcss": "^0.5.5",
"prettier-plugin-tailwindcss": "^0.5.7",
"tsconfig": "workspace:*"
},
"engines": {
"node": "18"
},
"optionalDependencies": {
"bufferutil": "^4.0.7",
"bufferutil": "^4.0.8",
"utf-8-validate": "^6.0.3"
}
}
38 changes: 17 additions & 21 deletions apps/client/src/app/room/[code]/game/[gameId]/game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,27 +106,23 @@ export default function Game({ gameInfo, session }: GameProps) {

const gameId = gameInfo.game.id;
const round = state.context.round;
const { data: faceOffs, isLoading: faceOffsLoading } = useQuery(
["faceOffs", "gameId", gameId, "round", round],
() => getFaceOffs({ gameId, round }),
{
enabled:
!!gameId &&
!!round &&
(state.matches("faceOff") || state.matches("faceOffResults")),
},
);
const { data: leaderboard } = useQuery(
["leaderboard", "gameId", gameId],
() => getLeaderboardById({ gameId }),
{
enabled:
!!gameId &&
(state.matches("winnerLeadUp") ||
state.matches("winner") ||
state.matches("leaderboard")),
},
);
const { data: faceOffs, isLoading: faceOffsLoading } = useQuery({
queryKey: ["faceOffs", "gameId", gameId, "round", round],
queryFn: () => getFaceOffs({ gameId, round }),
enabled:
!!gameId &&
!!round &&
(state.matches("faceOff") || state.matches("faceOffResults")),
});
const { data: leaderboard } = useQuery({
queryKey: ["leaderboard", "gameId", gameId],
queryFn: () => getLeaderboardById({ gameId }),
enabled:
!!gameId &&
(state.matches("winnerLeadUp") ||
state.matches("winner") ||
state.matches("leaderboard")),
});

const currFaceOffQuestion =
!faceOffsLoading && faceOffs && faceOffs.length > 0
Expand Down
22 changes: 11 additions & 11 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,27 +14,27 @@
"sentry:sourcemaps": "sentry-cli sourcemaps inject --org alexander-grattan --project artificial-unintelligence-server ./dist && sentry-cli sourcemaps upload --org alexander-grattan --project artificial-unintelligence-server ./dist"
},
"dependencies": {
"@sentry/node": "^7.73.0",
"@sentry/node": "^7.80.1",
"cookie-parser": "^1.4.6",
"cors": "^2.8.5",
"database": "workspace:*",
"dotenv": "^16.3.1",
"drizzle-orm": "^0.28.6",
"drizzle-orm": "^0.29.0",
"express": "^4.18.2",
"helmet": "^7.0.0",
"helmet": "^7.1.0",
"ioredis": "^5.3.2",
"morgan": "^1.10.0",
"replicate": "^0.20.1",
"replicate": "^0.21.1",
"socket.io": "^4.7.2"
},
"devDependencies": {
"@jest/globals": "^29.7.0",
"@sentry/cli": "^2.21.2",
"@types/cookie-parser": "^1.4.4",
"@types/cors": "^2.8.14",
"@types/express": "^4.17.19",
"@types/morgan": "^1.9.6",
"@types/node": "^20.8.4",
"@sentry/cli": "^2.21.5",
"@types/cookie-parser": "^1.4.6",
"@types/cors": "^2.8.16",
"@types/express": "^4.17.21",
"@types/morgan": "^1.9.9",
"@types/node": "^20.9.0",
"cross-env": "^7.0.3",
"eslint-config-custom": "workspace:*",
"jest": "^29.7.0",
Expand All @@ -48,7 +48,7 @@
"node": "18"
},
"optionalDependencies": {
"bufferutil": "^4.0.7",
"bufferutil": "^4.0.8",
"utf-8-validate": "^6.0.3"
}
}
22 changes: 12 additions & 10 deletions apps/server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,19 @@ export function buildServer() {
// Based on https://redis.io/commands/incr#pattern-rate-limiter-1
app.use(async (req, res, next) => {
let redisIncr: number;
try {
redisIncr = await redis.incr(req.ip);
} catch (error) {
console.error(`Could not increment rate limit key for ${req.ip}`);
throw error;
}
if (redisIncr > 10) {
res.status(429).send("Too many requests - try again later");
return;
if (req.ip) {
try {
redisIncr = await redis.incr(req.ip);
} catch (error) {
console.error(`Could not increment rate limit key for ${req.ip}`);
throw error;
}
if (redisIncr > 10) {
res.status(429).send("Too many requests - try again later");
return;
}
await redis.expire(req.ip, 10);
}
await redis.expire(req.ip, 10);

next();
});
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"format": "prettier --write \"**/*.{ts,tsx,md}\""
},
"devDependencies": {
"eslint": "^8.51.0",
"prettier": "^3.0.3",
"eslint": "^8.53.0",
"prettier": "^3.1.0",
"tsconfig": "workspace:*",
"turbo": "^1.10.15"
"turbo": "^1.10.16"
},
"engines": {
"node": "18"
Expand Down
8 changes: 4 additions & 4 deletions packages/database/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
},
"dependencies": {
"dotenv": "^16.3.1",
"drizzle-orm": "^0.28.6",
"postgres": "^3.4.0"
"drizzle-orm": "^0.29.0",
"postgres": "^3.4.3"
},
"devDependencies": {
"@auth/core": "^0.16.1",
"drizzle-kit": "^0.19.13",
"@auth/core": "^0.18.1",
"drizzle-kit": "^0.20.2",
"eslint-config-custom": "workspace:*",
"ts-node": "^10.9.1",
"tsconfig": "workspace:*",
Expand Down
8 changes: 4 additions & 4 deletions packages/eslint-config-custom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"version": "0.0.0",
"private": true,
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^6.7.5",
"@typescript-eslint/parser": "^6.7.5",
"eslint-config-next": "13.5.4",
"@typescript-eslint/eslint-plugin": "^6.11.0",
"@typescript-eslint/parser": "^6.11.0",
"eslint-config-next": "14.0.2",
"eslint-config-prettier": "^9.0.0",
"eslint-config-turbo": "^1.10.15"
"eslint-config-turbo": "^1.10.16"
}
}
Loading

0 comments on commit 2f4459b

Please sign in to comment.