Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependencies #516

Merged
merged 17 commits into from
Dec 4, 2024
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm lint-staged
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Features include:

### Prerequisites

1. Check your Node version with `node -v`. Make sure you have version 18 or 20 LTS. If you don't, we recommend [nvm](https://github.com/nvm-sh/nvm) to manage node versions (or [nvm-windows](https://github.com/coreybutler/nvm-windows)).
1. Check your Node version with `node -v`. Make sure you have version 18, 20, or 22 LTS. If you don't, we recommend [nvm](https://github.com/nvm-sh/nvm) to manage node versions (or [nvm-windows](https://github.com/coreybutler/nvm-windows)).

2. We use pnpm as our package manager. If you don't have pnpm, install it with `npm i -g pnpm`

Expand Down
34 changes: 17 additions & 17 deletions api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,39 +12,39 @@
"db:studio": "drizzle-kit studio"
},
"dependencies": {
"@trpc/server": "^10.45.1",
"@trpc/server": "^10.45.2",
"@vendia/serverless-express": "^4.12.6",
"axios": "^1.6.8",
"axios": "^1.7.8",
"connect-pg-simple": "^10.0.0",
"cookie-parser": "^1.4.6",
"cookie-parser": "^1.4.7",
"dotenv-flow": "^4.1.0",
"drizzle-orm": "^0.35.3",
"express": "^4.19.2",
"express-session": "^1.18.0",
"drizzle-orm": "^0.37.0",
"express": "^4.21.1",
"express-session": "^1.18.1",
"morgan": "^1.10.0",
"passport": "^0.7.0",
"passport-google-oauth": "^2.0.0",
"pg": "^8.13.0",
"pg": "^8.13.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@peterportal/types": "workspace:*",
"@types/connect-pg-simple": "^7.0.3",
"@types/cookie-parser": "^1.4.7",
"@types/cookie-parser": "^1.4.8",
"@types/dotenv-flow": "^3.3.3",
"@types/express": "^4.17.21",
"@types/express-session": "^1.18.0",
"@types/express": "^5.0.0",
"@types/express-session": "^1.18.1",
"@types/morgan": "^1.9.9",
"@types/passport": "^1.0.16",
"@types/passport": "^1.0.17",
"@types/passport-google-oauth": "^1.0.45",
"@types/pg": "^8.11.10",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"drizzle-kit": "^0.26.2",
"eslint": "^8.57.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"drizzle-kit": "^0.29.0",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"nodemon": "^3.1.7",
"tsx": "^4.19.1",
"typescript": "^5.4.2"
"tsx": "^4.19.2",
"typescript": "^5.5.4"
}
}
44 changes: 17 additions & 27 deletions api/src/db/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ export const user = pgTable(
theme: text('theme'),
lastRoadmapEditAt: timestamp('last_roadmap_edit_at'),
},
(table) => ({
uniqueGoogleId: unique('unique_google_id').on(table.googleId),
}),
(table) => [unique('unique_google_id').on(table.googleId)],
);

export const report = pgTable(
Expand All @@ -40,9 +38,7 @@ export const report = pgTable(
reason: text('reason').notNull(),
createdAt: timestamp('created_at').defaultNow().notNull(),
},
(table) => ({
reviewIdIdx: index('reports_review_id_idx').on(table.reviewId),
}),
(table) => [index('reports_review_id_idx').on(table.reviewId)],
);

export const review = pgTable(
Expand All @@ -69,13 +65,13 @@ export const review = pgTable(
tags: text('tags').array(),
verified: boolean('verified').notNull().default(false),
},
(table) => ({
ratingCheck: check('rating_check', sql`${table.rating} >= 1 AND ${table.rating} <= 5`),
difficultyCheck: check('difficulty_check', sql`${table.difficulty} >= 1 AND ${table.difficulty} <= 5`),
unique: unique('unique_review').on(table.userId, table.professorId, table.courseId),
professorIdIdx: index('reviews_professor_id_idx').on(table.professorId),
courseIdIdx: index('reviews_course_id_idx').on(table.courseId),
}),
(table) => [
check('rating_check', sql`${table.rating} >= 1 AND ${table.rating} <= 5`),
check('difficulty_check', sql`${table.difficulty} >= 1 AND ${table.difficulty} <= 5`),
unique('unique_review').on(table.userId, table.professorId, table.courseId),
index('reviews_professor_id_idx').on(table.professorId),
index('reviews_course_id_idx').on(table.courseId),
],
);

export const planner = pgTable(
Expand All @@ -88,9 +84,7 @@ export const planner = pgTable(
name: text('name').notNull(),
years: jsonb('years').$type<SavedPlannerYearData>().array().notNull(),
},
(table) => ({
userIdIdx: index('planners_user_id_idx').on(table.userId),
}),
(table) => [index('planners_user_id_idx').on(table.userId)],
);

export const transferredCourse = pgTable(
Expand All @@ -100,9 +94,7 @@ export const transferredCourse = pgTable(
courseName: text('course_name'),
units: real('units'),
},
(table) => ({
userIdIdx: index('transferred_courses_user_id_idx').on(table.userId),
}),
(table) => [index('transferred_courses_user_id_idx').on(table.userId)],
);

export const vote = pgTable(
Expand All @@ -116,11 +108,11 @@ export const vote = pgTable(
.references(() => user.id),
vote: integer('vote').notNull(),
},
(table) => ({
voteCheck: check('votes_vote_check', sql`${table.vote} = 1 OR ${table.vote} = -1`),
primaryKey: primaryKey({ columns: [table.reviewId, table.userId] }),
userIdIdx: index('votes_user_id_idx').on(table.userId),
}),
(table) => [
check('votes_vote_check', sql`${table.vote} = 1 OR ${table.vote} = -1`),
primaryKey({ columns: [table.reviewId, table.userId] }),
index('votes_user_id_idx').on(table.userId),
],
);

export const savedCourse = pgTable(
Expand All @@ -131,9 +123,7 @@ export const savedCourse = pgTable(
.notNull(),
courseId: text('course_id').notNull(),
},
(table) => ({
primaryKey: primaryKey({ columns: [table.userId, table.courseId] }),
}),
(table) => [primaryKey({ columns: [table.userId, table.courseId] })],
);

export const session = pgTable('session', {
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"scripts": {
"dev": "concurrently -n backend,frontend -c blue,green \"pnpm --filter=api dev\" \"pnpm --filter=site dev\"",
"prepare": "husky install",
"prepare": "husky",
"format": "prettier --write **/*.{css,scss,cjs,js,ts,tsx,yml,json,html}",
"lint": "prettier **/*.{css,scss,cjs,js,ts,tsx,yml,json,html} --check && pnpm --filter=site lint && pnpm --filter=api lint",
"db:generate": "pnpm --filter=api db:generate",
Expand All @@ -16,18 +16,18 @@
"sst": "2.41.5"
},
"engines": {
"node": "^18 || ^20",
"node": "^18 || ^20 || ^22",
"pnpm": "^9"
},
"devDependencies": {
"@types/node": "20.12.8",
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"concurrently": "^9.0.1",
"concurrently": "^9.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"husky": "^8.0.0",
"lint-staged": "^15.2.0",
"prettier": "^3.1.0"
"husky": "^9.1.7",
"lint-staged": "^15.2.10",
"prettier": "^3.4.1"
}
}
Loading
Loading