Project tooling updated to use Bun for runtime and testing, and shadcn-ui for design components.
- Runtime and package manager:
bun - Dev/build:
rsbuild - Type checking:
bunx tsc --noEmit - Testing: Browser-only with Playwright (
bunx playwright test)
bun installinstalls dependencies and generatesbun.lock.bun run devstarts the dev server.bun run buildbuilds the app.bun run previewserves the production build.bun run testruns Playwright tests (sole testing framework).bun run playwright:installinstalls Playwright browsers.bun run checkruns TypeScript type checks without emitting.
- Configured via
components.jsonwith aliases@/componentsand@/lib/utils. - Tailwind setup uses
tailwindcss-animateand existing MWRC palette. - Base components added:
Buttonatsrc/components/ui/button.tsxInputatsrc/components/ui/input.tsx
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
export function Example() {
return (
<div className="space-y-2">
<Input placeholder="Search..." />
<Button>Submit</Button>
<Button variant="secondary">Cancel</Button>
</div>
)
}Each meme lives under memes/ as either a flat folder (memes/<slug>) or nested under category and source (memes/<category>/<source>/<slug>). Required contents:
data/meme.json: runtime metadata and optional asset listings- One or more image files (
.png,.jpg,.jpeg,.webp) - Optional markdown docs (
.md) forPrompt,Representation, andFinal Model
Example (memes/ChelovekPlusII/data/meme.json):
{
"final_model": {
"bc": {
"source_url": "https://example.org/post",
"short": "Short source description"
}
},
"images": [
"/ChelovekPlusII/one.png",
"/ChelovekPlusII/two.png"
],
"docs": [
"/ChelovekPlusII/ChelovekPlusII.md",
"/ChelovekPlusII/FinalModel.md",
"/ChelovekPlusII/Representation.md"
]
}Schema: see memes/schema/meme.schema.json. When you add or update meme.json, bun run generate:memes-index validates and emits public/memes/index.json. At runtime, loadGallery() fetches that index and resolves per-folder meme.json for images and docs. DocViewer fetches doc URLs from the resolved docs map.
What we do with it:
- Build a gallery list with titles, images, source URLs, and doc links.
- Use
imagesfor fallbacks and multiple srcs;docsprovide links for DocViewer tabs. - Read
final_model.bc.source_urlto present a "Source" action in viewers.
- All tests run in real browsers using Playwright.
- The runner starts the preview server and navigates the app.
- Tests validate DocViewer and ImageViewer interactions and footer/button stability across viewports.
- No JSDOM or Vitest is used in this project.
- First time on a new machine (installs browsers and OS deps):
bunx playwright install --with-deps - Execute:
bun run test
- Add new shadcn components by following
components.jsonconventions.