Skip to content

venikman/cass

Repository files navigation

Cass

Project tooling updated to use Bun for runtime and testing, and shadcn-ui for design components.

Tooling

  • Runtime and package manager: bun
  • Dev/build: rsbuild
  • Type checking: bunx tsc --noEmit
  • Testing: Browser-only with Playwright (bunx playwright test)

Scripts

  • bun install installs dependencies and generates bun.lock.
  • bun run dev starts the dev server.
  • bun run build builds the app.
  • bun run preview serves the production build.
  • bun run test runs Playwright tests (sole testing framework).
  • bun run playwright:install installs Playwright browsers.
  • bun run check runs TypeScript type checks without emitting.

shadcn-ui

  • Configured via components.json with aliases @/components and @/lib/utils.
  • Tailwind setup uses tailwindcss-animate and existing MWRC palette.
  • Base components added:
    • Button at src/components/ui/button.tsx
    • Input at src/components/ui/input.tsx

Usage

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>
  )
}

Memes Folder Structure and Schema

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) for Prompt, Representation, and Final 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 images for fallbacks and multiple srcs; docs provide links for DocViewer tabs.
  • Read final_model.bc.source_url to present a "Source" action in viewers.

Testing Overview (Browser-only)

  • 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.

Run

  • First time on a new machine (installs browsers and OS deps): bunx playwright install --with-deps
  • Execute: bun run test

Notes

  • Add new shadcn components by following components.json conventions.

About

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published