-
Notifications
You must be signed in to change notification settings - Fork 0
Add course search & deadlines pages, Vercel deploy workflow, and repo docs/ignores #16
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,85 @@ | ||
| name: Deploy to Vercel | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| env: | ||
| VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} | ||
| VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }} | ||
|
|
||
| jobs: | ||
| deploy-preview: | ||
| if: github.event_name == 'pull_request' | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| pull-requests: write | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: pnpm | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10 | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Pull Vercel environment | ||
| run: npx vercel pull --yes --environment=preview --token=${{ secrets.VERCEL_TOKEN }} | ||
| - name: Build project artifacts | ||
| run: npx vercel build --token=${{ secrets.VERCEL_TOKEN }} | ||
| - name: Deploy preview | ||
| id: vercel_preview | ||
| run: | | ||
| PREVIEW_URL=$(npx vercel deploy --prebuilt --token=${{ secrets.VERCEL_TOKEN }}) | ||
| echo "preview_url=$PREVIEW_URL" >> "$GITHUB_OUTPUT" | ||
| - name: Comment preview URL on PR | ||
| uses: actions/github-script@v7 | ||
| with: | ||
| script: | | ||
| const url = `${{ steps.vercel_preview.outputs.preview_url }}`.trim(); | ||
| const body = [ | ||
| "✅ Vercel preview deployment is ready.", | ||
| "", | ||
| `Preview URL: ${url}` | ||
| ].join("\n"); | ||
|
|
||
| await github.rest.issues.createComment({ | ||
| owner: context.repo.owner, | ||
| repo: context.repo.repo, | ||
| issue_number: context.issue.number, | ||
| body, | ||
| }); | ||
|
|
||
| deploy-production: | ||
| if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
| - name: Setup Node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
| cache: pnpm | ||
| - name: Setup pnpm | ||
| uses: pnpm/action-setup@v4 | ||
| with: | ||
| version: 10 | ||
| - name: Install dependencies | ||
| run: pnpm install --frozen-lockfile | ||
| - name: Pull Vercel environment | ||
| run: npx vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }} | ||
| - name: Build project artifacts | ||
| run: npx vercel build --prod --token=${{ secrets.VERCEL_TOKEN }} | ||
| - name: Deploy production | ||
| run: npx vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| import type { Metadata } from "next" | ||
| import { MIT_COURSEWARE_DEADLINES, sortDeadlinesByDate } from "@/lib/course-deadlines" | ||
|
|
||
| export const metadata: Metadata = { | ||
| title: "MIT Courseware Deadlines · The VR School", | ||
| description: | ||
| "Operational deadlines for enrollment, coursework, exam registration, portfolio checkpoints, and transcript closeout.", | ||
| } | ||
|
|
||
| const CATEGORY_STYLE: Record<string, string> = { | ||
| Enrollment: "bg-sky-100 text-sky-800 dark:bg-sky-950 dark:text-sky-300", | ||
| Coursework: "bg-violet-100 text-violet-800 dark:bg-violet-950 dark:text-violet-300", | ||
| Exams: "bg-rose-100 text-rose-800 dark:bg-rose-950 dark:text-rose-300", | ||
| Portfolio: "bg-emerald-100 text-emerald-800 dark:bg-emerald-950 dark:text-emerald-300", | ||
| Admin: "bg-amber-100 text-amber-800 dark:bg-amber-950 dark:text-amber-300", | ||
| } | ||
|
|
||
| export default function CourseDeadlinesPage() { | ||
| const deadlines = sortDeadlinesByDate(MIT_COURSEWARE_DEADLINES) | ||
|
|
||
| return ( | ||
| <div className="min-h-screen bg-background text-foreground"> | ||
| <section className="max-w-5xl mx-auto px-6 py-16"> | ||
| <h1 className="text-4xl md:text-5xl font-serif tracking-tight mb-4">MIT Courseware Deadlines</h1> | ||
| <p className="text-muted-foreground max-w-3xl mb-10"> | ||
| Single source of truth for 2026–27 operational milestones across enrollment, instruction, assessments, portfolio evidence, and final transcript closeout. | ||
| </p> | ||
|
|
||
| <div className="rounded-xl border border-border/60 overflow-hidden"> | ||
| <table className="w-full text-sm"> | ||
| <thead className="bg-muted/30"> | ||
| <tr className="text-left text-xs text-muted-foreground uppercase tracking-wider border-b border-border/60"> | ||
| <th className="px-5 py-3 font-medium">Date</th> | ||
| <th className="px-5 py-3 font-medium">Milestone</th> | ||
| <th className="px-5 py-3 font-medium hidden sm:table-cell">Owner</th> | ||
| <th className="px-5 py-3 font-medium">Category</th> | ||
| </tr> | ||
| </thead> | ||
| <tbody className="divide-y divide-border/40"> | ||
| {deadlines.map((item) => ( | ||
| <tr key={item.id}> | ||
| <td className="px-5 py-3 tabular-nums whitespace-nowrap">{item.date}</td> | ||
| <td className="px-5 py-3"> | ||
| <p className="font-medium">{item.title}</p> | ||
| <p className="text-xs text-muted-foreground mt-0.5">{item.notes}</p> | ||
| </td> | ||
| <td className="px-5 py-3 text-muted-foreground hidden sm:table-cell">{item.owner}</td> | ||
| <td className="px-5 py-3"> | ||
| <span className={`inline-flex rounded-full px-2 py-0.5 text-xs font-semibold ${CATEGORY_STYLE[item.category]}`}> | ||
| {item.category} | ||
| </span> | ||
| </td> | ||
| </tr> | ||
| ))} | ||
| </tbody> | ||
| </table> | ||
| </div> | ||
| </section> | ||
| </div> | ||
| ) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qbefore calling.trim()searchParamsvalues can be eitherstringorstring[]in App Router pages, but this code assumesqis always a string. If the URL contains repeated query params (for example/courses?q=math&q=cs),params.qbecomes an array and(params.q ?? "").trim()throws a runtimeTypeError, causing the page to fail. Please coerceqto a single string (e.g., first element) before trimming.Useful? React with 👍 / 👎.