Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7a948f0
refactor(consts): complete the majority of refactoring
alexanderpaolini Feb 7, 2026
f7554d8
chore(refactor): more refactoring
alexanderpaolini Feb 7, 2026
bb03c47
chore(refactor): more refactoring
alexanderpaolini Feb 7, 2026
dc02207
oops(consts): made a mistake
alexanderpaolini Feb 7, 2026
04fd5e5
chore(refactor): more refactoring
alexanderpaolini Feb 8, 2026
4be1b10
chore(lint): lint fixes
alexanderpaolini Feb 8, 2026
916d317
fix(consts): use correct import
alexanderpaolini Feb 8, 2026
ec8c1f3
chore(consts): update coderabbit for consts package
alexanderpaolini Feb 8, 2026
fca1f9e
lint(*): lots of random fixes
alexanderpaolini Feb 8, 2026
9d1646b
chore(pnpm): install packages
alexanderpaolini Feb 8, 2026
63cc249
Squashed commit of the following:
alexanderpaolini Feb 8, 2026
5c8b8e9
bump
alexanderpaolini Feb 8, 2026
e94cdb9
Merge remote-tracking branch 'origin/main' into refactor/consts
alexanderpaolini Feb 8, 2026
e138cf9
Revert "Merge remote-tracking branch 'origin/main' into refactor/consts"
alexanderpaolini Feb 8, 2026
4ae6131
fix: lint + typecheck
DGoel1602 Feb 8, 2026
35c224f
chore(typecheck): ignore issue
alexanderpaolini Feb 8, 2026
3b354bb
feat(consts): move constants to correct spots
alexanderpaolini Feb 8, 2026
19a8db6
chore(consts): add bucket names to minio.ts
alexanderpaolini Feb 8, 2026
5c7e199
chore(db): refactor to consts changes
alexanderpaolini Feb 8, 2026
f0649d9
chore(api): refactor to consts changes
alexanderpaolini Feb 8, 2026
2599a8e
chore(guild): refactor to consts changes
alexanderpaolini Feb 8, 2026
a54f922
chore(blade): refactor to consts changes
alexanderpaolini Feb 8, 2026
0c260bf
chore(*): run format:fix
alexanderpaolini Feb 8, 2026
50c49fd
Merge branch 'main' into refactor/consts
DVidal1205 Feb 10, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .coderabbit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ reviews:
# Package labels
- label: "API"
instructions: "Apply when PR changes files in packages/api/** (tRPC routers, procedures)"
- label: "Constants"
instructions: "Apply when PR changes files in packages/consts/** (constants)"
- label: "UI"
instructions: "Apply when PR changes files in packages/ui/** (shared component library)"
- label: "Database"
Expand Down Expand Up @@ -170,8 +172,14 @@ reviews:

- path: "packages/consts/**"
instructions: |
Shared constants. Changes here affect the entire monorepo.
Ensure values are correct and changes are intentional.
Shared constants used across all apps and packages. Changes here affect the entire monorepo. Check:
- All constant names follow SCREAMING_SNAKE_CASE convention
- Values are intentional and well-documented (Discord IDs, API endpoints, role IDs, etc.)
- URLs and external API endpoints are correct and won't break integrations
- Type definitions are properly exported and used
- Constants do not contain sensitive data
- PROD and DEV constants are prefixed accordingly
- Exported values have valid reason to be shared repository wide

# Applications
- path: "apps/blade/**"
Expand Down
1 change: 0 additions & 1 deletion apps/2025/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
},
"dependencies": {
"@forge/api": "workspace:*",
"@forge/consts": "workspace:*",
"@forge/ui": "workspace:*",
"@t3-oss/env-nextjs": "^0.11.1",
"@tanstack/react-query": "^5.69.0",
Expand Down
7 changes: 3 additions & 4 deletions apps/blade/src/app/_components/bad-perms.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import { ShieldX } from "lucide-react";

import type { PermissionKey } from "@forge/consts/knight-hacks";
import { PERMISSION_DATA } from "@forge/consts/knight-hacks";
import { PERMISSIONS } from "@forge/consts";

export function BadPerms({ perms }: { perms: PermissionKey[] }) {
export function BadPerms({ perms }: { perms: PERMISSIONS.PermissionKey[] }) {
const permNames: string[] = [];
perms.forEach((v) => {
const permissionData = PERMISSION_DATA[v];
const permissionData = PERMISSIONS.PERMISSION_DATA[v];
if (permissionData) permNames.push(permissionData.name);
});

Expand Down
4 changes: 2 additions & 2 deletions apps/blade/src/app/_components/discord-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useState } from "react";
import Image from "next/image";

import { PERMANENT_DISCORD_INVITE } from "@forge/consts/knight-hacks";
import { DISCORD } from "@forge/consts";
import { Button } from "@forge/ui/button";
import {
Dialog,
Expand Down Expand Up @@ -48,7 +48,7 @@ export function TacoTuesday({ initialState }: { initialState: boolean }) {
className="text-md w-3/4"
onClick={() =>
window.open(
PERMANENT_DISCORD_INVITE,
DISCORD.PERMANENT_INVITE,
"_blank",
"noopener,noreferrer",
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
Users,
} from "lucide-react";

import type { PermissionKey } from "@forge/consts/knight-hacks";
import type { PERMISSIONS } from "@forge/consts";

import { USER_DROPDOWN_ICON_COLOR, USER_DROPDOWN_ICON_SIZE } from "~/consts";

Expand All @@ -29,8 +29,8 @@ export interface roleItems {
component: React.JSX.Element;
route: string;
requiredPermissions?: {
or?: PermissionKey[];
and?: PermissionKey[];
or?: PERMISSIONS.PermissionKey[];
and?: PERMISSIONS.PermissionKey[];
};
}

Expand Down
6 changes: 3 additions & 3 deletions apps/blade/src/app/_components/navigation/user-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useRouter } from "next/navigation";
import { LayoutDashboard } from "lucide-react";

import type { PermissionKey } from "@forge/consts/knight-hacks";
import type { PERMISSIONS } from "@forge/consts";
import { signOut } from "@forge/auth";
import { Avatar, AvatarFallback, AvatarImage } from "@forge/ui/avatar";
import { Button } from "@forge/ui/button";
Expand All @@ -29,15 +29,15 @@ import {
} from "./reusable-user-dropdown";

interface UserDropdownProps {
permissions: Record<PermissionKey, boolean>;
permissions: Record<PERMISSIONS.PermissionKey, boolean>;
}

/**
* Filters role items based on user permissions
*/
function filterItemsByPermissions(
items: roleItems[],
permissions: Record<PermissionKey, boolean>,
permissions: Record<PERMISSIONS.PermissionKey, boolean>,
): roleItems[] {
return items.filter((item) => {
// If no permissions required, show the item
Expand Down
14 changes: 8 additions & 6 deletions apps/blade/src/app/admin/_components/GenderPie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import type { PieSectorDataItem } from "recharts/types/polar/Pie";
import { useEffect, useMemo, useState } from "react";
import { Cell, Label, Pie, PieChart, Sector } from "recharts";

import type { GENDERS } from "@forge/consts/knight-hacks";
import type { ChartConfig } from "@forge/ui/chart";
import { ADMIN_PIE_CHART_COLORS } from "@forge/consts/knight-hacks";
import { FORMS } from "@forge/consts";
import { Card, CardContent, CardHeader, CardTitle } from "@forge/ui/card";
import {
ChartContainer,
Expand All @@ -23,7 +22,7 @@ import {
} from "@forge/ui/select";

interface Person {
gender?: (typeof GENDERS)[number];
gender?: (typeof FORMS.GENDERS)[number];
}

export default function GenderPie({ people }: { people: Person[] }) {
Expand Down Expand Up @@ -61,7 +60,10 @@ export default function GenderPie({ people }: { people: Person[] }) {
if (gender && !baseConfig[gender]) {
baseConfig[gender] = {
label: gender,
color: ADMIN_PIE_CHART_COLORS[colorIdx % ADMIN_PIE_CHART_COLORS.length],
color:
FORMS.ADMIN_PIE_CHART_COLORS[
colorIdx % FORMS.ADMIN_PIE_CHART_COLORS.length
],
};
colorIdx++;
}
Expand Down Expand Up @@ -192,8 +194,8 @@ export default function GenderPie({ people }: { people: Person[] }) {
<Cell
key={`cell-${index}`}
fill={
ADMIN_PIE_CHART_COLORS[
index % ADMIN_PIE_CHART_COLORS.length
FORMS.ADMIN_PIE_CHART_COLORS[
index % FORMS.ADMIN_PIE_CHART_COLORS.length
]
}
/>
Expand Down
4 changes: 2 additions & 2 deletions apps/blade/src/app/admin/_components/MajorBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
YAxis,
} from "recharts";

import type { MAJORS } from "@forge/consts/knight-hacks";
import type { FORMS } from "@forge/consts";
import type { ChartConfig } from "@forge/ui/chart";
import { Card, CardContent, CardHeader, CardTitle } from "@forge/ui/card";
import { ChartContainer, ChartTooltip } from "@forge/ui/chart";
Expand All @@ -22,7 +22,7 @@ const chartConfig = {
} satisfies ChartConfig;

interface Person {
major?: (typeof MAJORS)[number];
major?: (typeof FORMS.MAJORS)[number];
}

export default function MajorBarChart({ people }: { people: Person[] }) {
Expand Down
22 changes: 10 additions & 12 deletions apps/blade/src/app/admin/_components/RaceOrEthnicityPie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import { useEffect, useMemo, useState } from "react";
import { Cell, Label, Pie, PieChart, Sector } from "recharts";

import type { ChartConfig } from "@forge/ui/chart";
import {
ADMIN_PIE_CHART_COLORS,
RACES_OR_ETHNICITIES,
SHORT_RACES_AND_ETHNICITIES,
} from "@forge/consts/knight-hacks";
import { FORMS } from "@forge/consts";
import { Card, CardContent, CardHeader, CardTitle } from "@forge/ui/card";
import {
ChartContainer,
Expand All @@ -26,17 +22,17 @@ import {
} from "@forge/ui/select";

interface Person {
raceOrEthnicity?: (typeof RACES_OR_ETHNICITIES)[number];
raceOrEthnicity?: (typeof FORMS.RACES_OR_ETHNICITIES)[number];
}

const shortenRaceOrEthnicity = (raceOrEthnicity: string): string => {
const replacements: Record<string, string> = {
// Native Hawaiian or Other Pacific Islander
[RACES_OR_ETHNICITIES[4]]: SHORT_RACES_AND_ETHNICITIES[0], // Native Hawaiian/Pacific Islander
[FORMS.RACES_OR_ETHNICITIES[4]]: FORMS.SHORT_RACES_AND_ETHNICITIES[0], // Native Hawaiian/Pacific Islander
// Hispanic / Latino / Spanish Origin
[RACES_OR_ETHNICITIES[2]]: SHORT_RACES_AND_ETHNICITIES[1], // Hispanic/Latino
[FORMS.RACES_OR_ETHNICITIES[2]]: FORMS.SHORT_RACES_AND_ETHNICITIES[1], // Hispanic/Latino
// Native American or Alaskan Native
[RACES_OR_ETHNICITIES[5]]: SHORT_RACES_AND_ETHNICITIES[2], // Native American/Alaskan Native
[FORMS.RACES_OR_ETHNICITIES[5]]: FORMS.SHORT_RACES_AND_ETHNICITIES[2], // Native American/Alaskan Native
};
return replacements[raceOrEthnicity] ?? raceOrEthnicity;
};
Expand Down Expand Up @@ -83,7 +79,9 @@ export default function RaceOrEthnicityPie({ people }: { people: Person[] }) {
baseConfig[shortenedString] = {
label: shortenedString,
color:
ADMIN_PIE_CHART_COLORS[colorIdx % ADMIN_PIE_CHART_COLORS.length],
FORMS.ADMIN_PIE_CHART_COLORS[
colorIdx % FORMS.ADMIN_PIE_CHART_COLORS.length
],
};
colorIdx++;
}
Expand Down Expand Up @@ -217,8 +215,8 @@ export default function RaceOrEthnicityPie({ people }: { people: Person[] }) {
<Cell
key={`cell-${index}`}
fill={
ADMIN_PIE_CHART_COLORS[
index % ADMIN_PIE_CHART_COLORS.length
FORMS.ADMIN_PIE_CHART_COLORS[
index % FORMS.ADMIN_PIE_CHART_COLORS.length
]
}
/>
Expand Down
4 changes: 2 additions & 2 deletions apps/blade/src/app/admin/_components/SchoolBarChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
YAxis,
} from "recharts";

import type { SCHOOLS } from "@forge/consts/knight-hacks";
import type { FORMS } from "@forge/consts";
import type { ChartConfig } from "@forge/ui/chart";
import { Card, CardContent, CardHeader, CardTitle } from "@forge/ui/card";
import { ChartContainer, ChartTooltip } from "@forge/ui/chart";
Expand All @@ -22,7 +22,7 @@ const chartConfig = {
} satisfies ChartConfig;

interface Person {
school?: (typeof SCHOOLS)[number];
school?: (typeof FORMS.SCHOOLS)[number];
}

export default function SchoolBarChart({ people }: { people: Person[] }) {
Expand Down
23 changes: 11 additions & 12 deletions apps/blade/src/app/admin/_components/SchoolYearPie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ import { useEffect, useMemo, useState } from "react";
import { Cell, Label, Pie, PieChart, Sector } from "recharts";

import type { ChartConfig } from "@forge/ui/chart";
import {
ADMIN_PIE_CHART_COLORS,
LEVELS_OF_STUDY,
SHORT_LEVELS_OF_STUDY,
} from "@forge/consts/knight-hacks";
import { FORMS } from "@forge/consts";
import { Card, CardContent, CardHeader, CardTitle } from "@forge/ui/card";
import {
ChartContainer,
Expand All @@ -26,17 +22,17 @@ import {
} from "@forge/ui/select";

interface Person {
levelOfStudy?: (typeof LEVELS_OF_STUDY)[number];
levelOfStudy?: (typeof FORMS.LEVELS_OF_STUDY)[number];
}

const shortenLevelOfStudy = (levelOfStudy: string): string => {
const replacements: Record<string, string> = {
// Undergraduate University (2 year - community college or similar)
[LEVELS_OF_STUDY[2]]: SHORT_LEVELS_OF_STUDY[0], // Undergraduate University (2 year)
[FORMS.LEVELS_OF_STUDY[2]]: FORMS.SHORT_LEVELS_OF_STUDY[0], // Undergraduate University (2 year)
// Graduate University (Masters, Professional, Doctoral, etc)
[LEVELS_OF_STUDY[4]]: SHORT_LEVELS_OF_STUDY[1], // Graduate University (Masters/PhD)
[FORMS.LEVELS_OF_STUDY[4]]: FORMS.SHORT_LEVELS_OF_STUDY[1], // Graduate University (Masters/PhD)
// Other Vocational / Trade Program or Apprenticeship
[LEVELS_OF_STUDY[6]]: SHORT_LEVELS_OF_STUDY[2], // Vocational/Trade School
[FORMS.LEVELS_OF_STUDY[6]]: FORMS.SHORT_LEVELS_OF_STUDY[2], // Vocational/Trade School
};
return replacements[levelOfStudy] ?? levelOfStudy;
};
Expand Down Expand Up @@ -84,7 +80,10 @@ export default function SchoolYearPie({ people }: { people: Person[] }) {
if (shortenedString && !baseConfig[shortenedString]) {
baseConfig[shortenedString] = {
label: shortenedString,
color: ADMIN_PIE_CHART_COLORS[colorIdx % ADMIN_PIE_CHART_COLORS.length],
color:
FORMS.ADMIN_PIE_CHART_COLORS[
colorIdx % FORMS.ADMIN_PIE_CHART_COLORS.length
],
};
colorIdx++;
}
Expand Down Expand Up @@ -217,8 +216,8 @@ export default function SchoolYearPie({ people }: { people: Person[] }) {
<Cell
key={`cell-${index}`}
fill={
ADMIN_PIE_CHART_COLORS[
index % ADMIN_PIE_CHART_COLORS.length
FORMS.ADMIN_PIE_CHART_COLORS[
index % FORMS.ADMIN_PIE_CHART_COLORS.length
]
}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,7 @@

import { useState } from "react";

import type { Semester } from "@forge/consts/knight-hacks";
import {
ALL_DATES_RANGE_UNIX,
SEMESTER_START_DATES,
} from "@forge/consts/knight-hacks";
import { FORMS } from "@forge/consts";
import { Checkbox } from "@forge/ui/checkbox";
import {
Select,
Expand All @@ -25,16 +21,16 @@ import { WeekdayPopularityRadar } from "./event-data/WeekdayPopularityRadar";

export default function EventDemographics() {
const { data: events } = api.event.getEvents.useQuery();
const semestersArr: Semester[] = [
const semestersArr: FORMS.Semester[] = [
{
name: "All Semesters",
startDate: new Date(ALL_DATES_RANGE_UNIX.start),
endDate: new Date(ALL_DATES_RANGE_UNIX.end),
startDate: new Date(FORMS.ALL_DATES_RANGE_UNIX.start),
endDate: new Date(FORMS.ALL_DATES_RANGE_UNIX.end),
},
]; // for select options

const defaultSemester = semestersArr[0] ?? null;
const [activeSemester, setActiveSemester] = useState<Semester | null>(
const [activeSemester, setActiveSemester] = useState<FORMS.Semester | null>(
defaultSemester,
);
const [includeHackathons, setIncludeHackathons] = useState(false);
Expand All @@ -43,13 +39,13 @@ export default function EventDemographics() {
events?.forEach(({ start_datetime }) => {
const year = start_datetime.getFullYear();
const springStart = new Date(
`${year}-${SEMESTER_START_DATES.spring.month + 1}-${SEMESTER_START_DATES.spring.day}`,
`${year}-${FORMS.SEMESTER_START_DATES.spring.month + 1}-${FORMS.SEMESTER_START_DATES.spring.day}`,
);
const summerStart = new Date(
`${year}-${SEMESTER_START_DATES.summer.month + 1}-${SEMESTER_START_DATES.summer.day}`,
`${year}-${FORMS.SEMESTER_START_DATES.summer.month + 1}-${FORMS.SEMESTER_START_DATES.summer.day}`,
);
const fallStart = new Date(
`${year}-${SEMESTER_START_DATES.fall.month + 1}-${SEMESTER_START_DATES.fall.day}`,
`${year}-${FORMS.SEMESTER_START_DATES.fall.month + 1}-${FORMS.SEMESTER_START_DATES.fall.day}`,
);

// keep track of semesters that exist in events table of db
Expand All @@ -58,7 +54,7 @@ export default function EventDemographics() {
if (!semestersSet.has(semesterName)) {
semestersSet.add(semesterName);
const springEnd = new Date(
`${year}-${SEMESTER_START_DATES.summer.month + 1}-${SEMESTER_START_DATES.summer.day}`,
`${year}-${FORMS.SEMESTER_START_DATES.summer.month + 1}-${FORMS.SEMESTER_START_DATES.summer.day}`,
);
semestersArr.push({
name: semesterName,
Expand All @@ -71,7 +67,7 @@ export default function EventDemographics() {
if (!semestersSet.has(semesterName)) {
semestersSet.add(semesterName);
const summerEnd = new Date(
`${year}-${SEMESTER_START_DATES.fall.month + 1}-${SEMESTER_START_DATES.fall.day}`,
`${year}-${FORMS.SEMESTER_START_DATES.fall.month + 1}-${FORMS.SEMESTER_START_DATES.fall.day}`,
);
semestersArr.push({
name: semesterName,
Expand All @@ -87,7 +83,7 @@ export default function EventDemographics() {
if (!semestersSet.has(semesterName)) {
semestersSet.add(semesterName);
const fallEnd = new Date(
`${year + 1}-${SEMESTER_START_DATES.spring.month + 1}-${SEMESTER_START_DATES.spring.day}`,
`${year + 1}-${FORMS.SEMESTER_START_DATES.spring.month + 1}-${FORMS.SEMESTER_START_DATES.spring.day}`,
);
semestersArr.push({
name: semesterName,
Expand Down
Loading