Skip to content

Commit 24a3506

Browse files
fix(ts): Remove unused imports and update Grid to MUI v7 size API
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f765d12 commit 24a3506

7 files changed

Lines changed: 76 additions & 27 deletions

File tree

CLAUDE.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Commands
6+
7+
```bash
8+
npm run dev # Start dev server (http://localhost:5173)
9+
npm run build # tsc -b && vite build
10+
npm run lint # ESLint with max-warnings 0
11+
npm run preview # Preview production build locally
12+
```
13+
14+
There is no test suite. Deploys automatically to GitHub Pages on push to `main` via `.github/workflows/deploy.yml`.
15+
16+
## Architecture
17+
18+
Personal technical blog — React 19 + TypeScript + Vite, client-side only, deployed as static files.
19+
20+
**Routing** (React Router DOM 7):
21+
- `/` → Home with hero and 3D model viewer
22+
- `/notes` → Searchable, tag-filtered post listing
23+
- `/notes/:slug` → Individual post (MDX + TOC + comments)
24+
25+
**Content model** — posts are defined in two places:
26+
1. **Metadata**: `/src/data/notes.ts` — a typed `Note[]` array (slug, title, date, tags, excerpt, category). No YAML frontmatter.
27+
2. **Content**: `/src/content/notes/{slug}.mdx` — MDX files discovered and lazy-loaded at runtime via `import.meta.glob('../content/notes/*.mdx')` in `NoteView.tsx`.
28+
29+
Adding a new post requires entries in both files.
30+
31+
**MDX pipeline** (configured in `vite.config.ts`):
32+
- `remark-gfm` + `remark-math` → parse GFM and `$$...$$` LaTeX
33+
- `rehype-highlight` → code syntax highlighting
34+
- `rehype-katex` → render math
35+
- Components are injected via `MDXProvider` in `NoteView.tsx`, mapping HTML elements to MUI Typography variants
36+
37+
**Key libraries:**
38+
- Three.js + React Three Fiber — 3D model rendering in `ModelViewer.tsx`
39+
- `react-py` — Python WASM interpreter powering `PythonREPL.tsx`
40+
- Material-UI 7 with Emotion — all styling; light/dark theme in `/src/theme/`
41+
- KaTeX — math rendering
42+
- Giscus — GitHub-backed comments (`GiscusComments.tsx`)
43+
44+
**Theme**: Light/dark toggle persisted in `localStorage`. MUI theme and a React context (`ThemeContext`) are set up in `/src/theme/`. The `ModelViewer` adapts its environment map based on the active theme.
45+
46+
**Interactive components** (embeddable in MDX): `PythonREPL`, `ModelViewer`, `AnatomyAttention` (loads external CDN libs dynamically and uses imperative DOM refs alongside React).
47+
48+
## Conventions
49+
50+
- ESLint flat config (`eslint.config.js`); `react/no-unknown-property` is disabled globally to allow Three.js JSX props.
51+
- `tsconfig.json` uses project references: `tsconfig.app.json` for `/src`, `tsconfig.node.json` for Vite config.
52+
- Static assets (`.glb` models, images) live in `/public/`.

src/components/Layout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { AppBar, Toolbar, Typography, Button, Box, Container, IconButton } from '@mui/material';
2+
import { AppBar, Toolbar, Typography, Button, Box, Container } from '@mui/material';
33
import CodeIcon from '@mui/icons-material/Code';
44
import { Link as RouterLink } from 'react-router-dom';
55
import ThemeToggle from './ThemeToggle';

src/components/TableOfContents.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React, { useEffect, useState } from 'react';
2-
import {
3-
Box,
4-
Typography,
5-
List,
6-
ListItem,
7-
ListItemText,
8-
Link
2+
import {
3+
Box,
4+
Typography,
5+
List,
6+
ListItem,
7+
Link
98
} from '@mui/material';
109

1110
interface Heading {

src/components/ThemeToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import { IconButton, useTheme } from '@mui/material';
2+
import { IconButton } from '@mui/material';
33
import Brightness4Icon from '@mui/icons-material/Brightness4';
44
import Brightness7Icon from '@mui/icons-material/Brightness7';
55
import { useThemeContext } from '../theme/useThemeContext';

src/pages/Home.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ const Home: React.FC = () => {
112112

113113
<Grid container spacing={4}>
114114
{featuredNotes.map((note) => (
115-
<Grid item xs={12} md={4} key={note.slug}>
115+
<Grid size={{ xs: 12, md: 4 }} key={note.slug}>
116116
<Paper
117117
elevation={0}
118118
component={Link}

src/pages/NoteView.tsx

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import React, { Suspense, useMemo } from 'react';
22
import { useParams, Link as RouterLink } from 'react-router-dom';
3-
import {
4-
Container,
5-
Box,
6-
Typography,
7-
Button,
8-
Divider,
9-
Chip,
10-
Fade,
3+
import {
4+
Container,
5+
Box,
6+
Typography,
7+
Button,
8+
Divider,
9+
Chip,
1110
Stack,
1211
Skeleton
1312
} from '@mui/material';

src/pages/NotesList.tsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import React, { useState, useMemo } from 'react';
2-
import {
3-
Container,
4-
Typography,
5-
Box,
6-
Paper,
7-
TextField,
8-
Chip,
2+
import {
3+
Container,
4+
Typography,
5+
Box,
6+
TextField,
7+
Chip,
98
InputAdornment,
109
Grid,
1110
Card,
@@ -15,7 +14,7 @@ import {
1514
} from '@mui/material';
1615
import { Link } from 'react-router-dom';
1716
import SearchIcon from '@mui/icons-material/Search';
18-
import { notes, type Note } from '../data/notes';
17+
import { notes } from '../data/notes';
1918

2019
const NotesList: React.FC = () => {
2120
const [searchQuery, setSearchQuery] = useState('');
@@ -90,7 +89,7 @@ const NotesList: React.FC = () => {
9089
<Grid container spacing={4}>
9190
{filteredNotes.length > 0 ? (
9291
filteredNotes.map((note) => (
93-
<Grid item xs={12} md={6} lg={4} key={note.slug}>
92+
<Grid size={{ xs: 12, md: 6, lg: 4 }} key={note.slug}>
9493
<Card
9594
elevation={0}
9695
sx={{

0 commit comments

Comments
 (0)