Skip to content

Commit

Permalink
[Release] Update dependencies (#127)
Browse files Browse the repository at this point in the history
* Update dependencies (#123)

* chore: update dependencies

* feat: update deploy actions

* chore: update dependencies

* feat: filter professors by course prefix (#128)
  • Loading branch information
cjlawson02 authored Oct 7, 2024
1 parent e49f954 commit 47e88a6
Show file tree
Hide file tree
Showing 12 changed files with 4,397 additions and 4,227 deletions.
19 changes: 4 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,16 @@ jobs:
OUTSIDE_CONTRIB: ${{ secrets.CF_API_TOKEN == '' }}
steps:
- name: Checkout Code
uses: actions/checkout@v3
uses: actions/checkout@v4

# Set node/npm/yarn versions using volta
- uses: volta-cli/action@v4
- uses: actions/setup-node@v4
with:
package-json-path: "${{ github.workspace }}/package.json"

- name: Use the package manager cache if available
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-
node-version: 20
cache: "npm"

- name: Install dependencies
run: npm ci

- name: Install Top Level Dependencies
run: npm ci

- name: Lint packages
run: npm run lint

Expand Down
2 changes: 1 addition & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"build:local",
"test"
],
"accessToken": "MmQ1ODQwODQtZTg3Ni00OWY4LTg4MGYtNTczMjFiMTMyZDVkfHJlYWQ=="
"accessToken": "MmQ1ODQwODQtZTg3Ni00OWY4LTg4MGYtNTczMjFiMTMyZDVkfHJlYWQ="
}
}
},
Expand Down
8,422 changes: 4,301 additions & 4,121 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"devDependencies": {
"@types/isomorphic-fetch": "^0.0.39",
"lerna": "^8.1.2",
"nx-cloud": "^18.0.0"
"lerna": "^8.1.8",
"nx-cloud": "^19.1.0"
}
}
20 changes: 10 additions & 10 deletions packages/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@
"author": "Addison Tustin <[email protected]>",
"license": "GPL-3.0",
"devDependencies": {
"@cloudflare/workers-types": "^4.20231218.0",
"@cloudflare/workers-types": "^4.20240925.0",
"@polyratings/eslint-config": "^0.0.1",
"@types/node": "^20.10.6",
"cloudflare-worker-mock": "^1.2.0",
"esbuild": "^0.19.11",
"esbuild": "^0.24.0",
"esbuild-visualizer": "^0.6.0",
"eslint": "^8.56.0",
"eslint": "^8.57.1",
"toml": "^3.0.0",
"type-fest": "^4.2.0",
"typescript": "^5.3.3",
"wrangler": "^3.22.1"
"type-fest": "^4.26.1",
"typescript": "^5.6.2",
"wrangler": "^3.78.12"
},
"dependencies": {
"@trpc/server": "10.45.0",
"@tsndr/cloudflare-worker-jwt": "^2.3.2",
"toucan-js": "^3.3.1",
"zod": "^3.22.4"
"@trpc/server": "10.45.2",
"@tsndr/cloudflare-worker-jwt": "^2.5.4",
"toucan-js": "^4.0.0",
"zod": "^3.23.8"
}
}
20 changes: 10 additions & 10 deletions packages/cron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,21 @@
"fix": "eslint . --fix"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231218.0",
"@cloudflare/workers-types": "^4.20240925.0",
"@polyratings/eslint-config": "^0.0.1",
"@types/node-fetch": "^2.6.10",
"dotenv": "^16.3.1",
"esbuild": "^0.19.11",
"@types/node-fetch": "^2.6.11",
"dotenv": "^16.4.5",
"esbuild": "^0.24.0",
"esbuild-visualizer": "^0.6.0",
"eslint": "^8.56.0",
"eslint": "^8.57.1",
"node-fetch": "^3.3.2",
"typescript": "^5.3.3",
"wrangler": "^3.22.1"
"typescript": "^5.6.2",
"wrangler": "^3.78.12"
},
"dependencies": {
"@polyratings/backend": "^0.1.0",
"@trpc/client": "10.45.0",
"@trpc/server": "10.45.0",
"toucan-js": "^3.3.1"
"@trpc/client": "10.45.2",
"@trpc/server": "10.45.2",
"toucan-js": "^4.0.0"
}
}
12 changes: 6 additions & 6 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
"fix": "eslint . --fix"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.62.0",
"@typescript-eslint/parser": "^5.62.0",
"eslint": "^8.56.0",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"eslint": "^8.57.1",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-prettier": "^8.10.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-jsx-a11y": "^6.8.0",
"eslint-plugin-import": "^2.30.0",
"eslint-plugin-jsx-a11y": "^6.10.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.33.2",
"eslint-plugin-react": "^7.37.0",
"prettier": "^2.8.8"
}
}
68 changes: 34 additions & 34 deletions packages/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,62 +12,62 @@
"fix": "eslint . --fix"
},
"dependencies": {
"@heroicons/react": "^2.1.1",
"@hookform/resolvers": "^3.3.3",
"@heroicons/react": "^2.1.5",
"@hookform/resolvers": "^3.9.0",
"@polyratings/backend": "^0.1.0",
"@sentry/browser": "^7.91.0",
"@sentry/browser": "^8.32.0",
"@tanstack/react-query": "^4.36.1",
"@tanstack/react-query-persist-client": "^4.36.1",
"@tanstack/react-virtual": "^3.0.1",
"@trpc/client": "10.45.0",
"@trpc/react-query": "10.45.0",
"@trpc/server": "10.45.0",
"downshift": "^8.3.1",
"@tanstack/react-virtual": "^3.10.8",
"@trpc/client": "10.45.2",
"@trpc/react-query": "10.45.2",
"@trpc/server": "10.45.2",
"downshift": "^9.0.8",
"idb-keyval": "^6.2.1",
"jwt-decode": "^4.0.0",
"rc-slider": "^10.5.0",
"react": "^18.2.0",
"rc-slider": "^11.1.6",
"react": "^18.3.1",
"react-anchor-link-smooth-scroll": "^1.0.12",
"react-animate-height": "^3.2.3",
"react-data-table-component": "^7.5.4",
"react-dom": "^18.2.0",
"react-hook-form": "^7.49.2",
"react-intersection-observer": "^9.5.3",
"react-data-table-component": "^7.6.2",
"react-dom": "^18.3.1",
"react-hook-form": "^7.53.0",
"react-intersection-observer": "^9.13.1",
"react-modal": "^3.16.1",
"react-router-dom": "^6.21.1",
"react-router-dom": "^6.26.2",
"react-router-hash-link": "^2.4.3",
"react-spinners": "^0.13.8",
"react-spinners": "^0.14.1",
"react-star-ratings": "^2.3.0",
"react-toastify": "^9.1.3",
"react-toastify": "^10.0.5",
"tailwind-scrollbar-hide": "^1.1.7",
"type-fest": "^4.2.0",
"zod": "^3.22.4"
"type-fest": "^4.26.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20231218.0",
"@cloudflare/workers-types": "^4.20240925.0",
"@polyratings/eslint-config": "^0.0.1",
"@testing-library/jest-dom": "^6.1.6",
"@testing-library/react": "^14.1.2",
"@testing-library/jest-dom": "^6.5.0",
"@testing-library/react": "^16.0.1",
"@testing-library/user-event": "^14.5.2",
"@types/node": "^20.10.6",
"@types/react": "^18.2.46",
"@types/react": "^18.3.10",
"@types/react-anchor-link-smooth-scroll": "^1.0.5",
"@types/react-dom": "^18.2.18",
"@types/react-dom": "^18.3.0",
"@types/react-modal": "^3.16.3",
"@types/react-router-dom": "^5.3.3",
"@types/react-router-hash-link": "^2.4.9",
"@types/react-star-ratings": "^2.3.3",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.16",
"eslint": "^8.56.0",
"fake-indexeddb": "^5.0.1",
"@vitejs/plugin-react": "^4.3.2",
"autoprefixer": "^10.4.20",
"eslint": "^8.57.1",
"fake-indexeddb": "^6.0.0",
"isomorphic-fetch": "^3.0.0",
"jsdom": "^22.1.0",
"jsdom": "^25.0.1",
"rollup-plugin-visualizer": "^5.12.0",
"tailwindcss": "^3.4.0",
"typescript": "^5.3.3",
"vite": "^4.5.1",
"vite-tsconfig-paths": "^4.2.3",
"vitest": "^0.34.6"
"tailwindcss": "^3.4.13",
"typescript": "^5.6.2",
"vite": "^5.4.8",
"vite-tsconfig-paths": "^5.0.1",
"vitest": "^2.1.1"
}
}
51 changes: 27 additions & 24 deletions packages/frontend/src/components/Filters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export interface FilterHandle {
}

export interface FilterState {
departmentFilters: { name: string; state: boolean }[];
coursePrefixFilters: { name: string; state: boolean }[];
avgRatingFilter: [number, number];
studentDifficultyFilter: [number, number];
materialClearFilter: [number, number];
Expand All @@ -49,12 +49,12 @@ export function Filters({ unfilteredProfessors, onUpdate, className }: FilterPro
const location = useLocation();
const previousState = location.state as FilterState | undefined;
// Component State
const [departmentFilters, setDepartmentFilters] = useLocationState<
const [coursePrefixFilters, setCoursePrefixFilters] = useLocationState<
{ name: string; state: boolean }[]
>(
previousState?.departmentFilters ??
DEPARTMENT_LIST.map((department) => ({ name: department, state: false })),
"departmentFilters",
previousState?.coursePrefixFilters ??
DEPARTMENT_LIST.map((coursePrefix) => ({ name: coursePrefix, state: false })),
"coursePrefixFilters",
);
const [avgRatingFilter, setAvgRatingFilter] = useLocationState<[number, number]>(
previousState?.avgRatingFilter ?? [0, 4],
Expand Down Expand Up @@ -141,23 +141,26 @@ export function Filters({ unfilteredProfessors, onUpdate, className }: FilterPro
filteredResult.reverse();
}

const selectedDepartments = departmentFilters.filter(
(departmentFilter) => departmentFilter.state,
const selectedCoursePrefixs = coursePrefixFilters.filter(
(coursePrefixFilter) => coursePrefixFilter.state,
);

if (selectedDepartments.length) {
const departmentSet = new Set(
selectedDepartments.map((departmentFilter) => departmentFilter.name),
if (selectedCoursePrefixs.length) {
const coursePrefixSet = new Set(
selectedCoursePrefixs.map((coursePrefixFilter) => coursePrefixFilter.name),
);
const postDepartmentFilter = filteredResult.filter((professor) =>
departmentSet.has(professor.department),
const postCoursePrefixFilter = filteredResult.filter((professor) =>
professor.courses.some((course) => {
const prefix = course.split(" ")[0];
return coursePrefixSet.has(prefix);
}),
);
onUpdate(postDepartmentFilter);
onUpdate(postCoursePrefixFilter);
} else {
onUpdate(filteredResult);
}
}, [
departmentFilters,
coursePrefixFilters,
avgRatingFilter,
studentDifficultyFilter,
materialClearFilter,
Expand Down Expand Up @@ -200,23 +203,23 @@ export function Filters({ unfilteredProfessors, onUpdate, className }: FilterPro
<h2 className="text-xl font-bold transform -translate-x-4 py-1">Filters:</h2>

<div className="block xl:hidden mb-2">
<h3>Department:</h3>
<h3>CoursePrefix:</h3>
<select
className="w-[106%] mt-1 h-7 border-2 border-black rounded-md transform -translate-x-2"
onChange={(e) => {
const value = parseInt(e.target.value, 10);
const newDepartmentFilters = [...departmentFilters].map(({ name }) => ({
const newCoursePrefixFilters = [...coursePrefixFilters].map(({ name }) => ({
name,
state: false,
}));
if (value !== -1) {
newDepartmentFilters[value].state = true;
newCoursePrefixFilters[value].state = true;
}
setDepartmentFilters(newDepartmentFilters);
setCoursePrefixFilters(newCoursePrefixFilters);
}}
>
<option value="-1">Any</option>
{departmentFilters.map(({ name }, i) => (
{coursePrefixFilters.map(({ name }, i) => (
<option value={i} key={name}>
{name}
</option>
Expand Down Expand Up @@ -257,19 +260,19 @@ export function Filters({ unfilteredProfessors, onUpdate, className }: FilterPro
</div>

<div className="hidden xl:block">
<h3>Department:</h3>
<h3>Course Prefix:</h3>
<div className="grid grid-cols-2 gap-x-2">
{departmentFilters.map(({ name, state }, i) => (
{coursePrefixFilters.map(({ name, state }, i) => (
<label htmlFor={name} key={name} className="mt-1 flex items-center">
<input
type="checkbox"
checked={state}
id={name}
className="h-5 w-5"
onChange={(e) => {
const updatedDepartmentFilters = [...departmentFilters];
updatedDepartmentFilters[i].state = e.target.checked;
setDepartmentFilters(updatedDepartmentFilters);
const updatedCoursePrefixFilters = [...coursePrefixFilters];
updatedCoursePrefixFilters[i].state = e.target.checked;
setCoursePrefixFilters(updatedCoursePrefixFilters);
}}
/>
<span className="ml-2 text-gray-700">{name}</span>
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/src/hooks/useTailwindBreakpoints.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { renderHook, RenderHookResult } from "@testing-library/react";
import { act } from "react-dom/test-utils";
import { act, renderHook, RenderHookResult } from "@testing-library/react";
import { waitFor } from "@testing-library/dom";
import { describe, test, beforeEach, expect } from "vitest";
import { setWindowSize } from "@/test-utils";
Expand Down
3 changes: 1 addition & 2 deletions packages/frontend/src/hooks/useWindowSize.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { renderHook, RenderHookResult } from "@testing-library/react";
import { act } from "react-dom/test-utils";
import { act, renderHook, RenderHookResult } from "@testing-library/react";
import { waitFor } from "@testing-library/dom";
import { describe, test, beforeEach, expect } from "vitest";
import { setWindowSize } from "@/test-utils";
Expand Down
File renamed without changes.

0 comments on commit 47e88a6

Please sign in to comment.