Overdemand, a multi-view, loaded to the gills weirdo stream.place video player
README.md

Video Over Demand #

Web component library for rendering video layouts in the browser. Built with Lit and published as ES modules with import-map–based dependency resolution.

The project also contains package/psv-fetch, a CLI tool for fetching place.stream.video records from AT Protocol repositories.

Architecture #

Two build outputs ship side by side in dist/:

  1. Unbundled source — every source file (component/*.ts, videooverdemand.ts) is compiled one-to-one to .mjs with bare specifiers preserved. Tree-shaking consumers only pay for what they import.

  2. Bundled dependencies — a second pass bundles all runtime dependencies (lit, @lit-labs/signals, their transitive graph) into individual .mjs files. No node_modules leakage.

An import map connects the two: bare specifiers in the unbundled output resolve to the bundled dependency files. Consumers load the import map and everything wires up without a bundler.

src (component/*.ts)          deps (lit, @lit-labs/signals, ...)
         │                                    │
    tsdown unbundle                     tsdown bundle
         │                                    │
         ▼                                    ▼
   dist/component/root.mjs           dist/lit.mjs
   dist/component/row.mjs            dist/@lit-labs/signals.mjs
   dist/videooverdemand.mjs          dist/lit/decorators.mjs
                  │                                   │
                  └──── import map resolves ───────────┘

Components #

<vod-root> #

Full-viewport flex column container. CSS custom properties control layout:

Property Default Purpose
--vod-rows 2 Number of visible rows (drives row height calculation)
--vod-gap 2px Spacing between rows and from viewport edges

Slots: default slot accepts <vod-row> elements.

<vod-row> #

Horizontal flex row. Height is computed from the ancestor's --vod-rows and --vod-gap:

(100dvh - (--vod-rows + 1) * --vod-gap) / --vod-rows

Slots: default slot accepts video element children.

Project structure #

component/            Lit web components
  root.ts             <vod-root> — viewport container
  row.ts              <vod-row> — horizontal row
doc/                  project documentation
  atmoco-review.md    AT Protocol integration review
  wishlist.md         feature wishlist
package/
  psv-fetch/          CLI for fetching AT Protocol video records
public/
  importmap.json      bare specifier → bundled dep mappings
videooverdemand.ts    library entry point (currently empty)
tsdown.config.ts      split build: unbundle + deps bundle
vite.config.ts        vite-plus config (pack, fmt, lint)
tsconfig.json         TypeScript config (Lit decorators, isolatedDeclarations)
.oxfmtrc.json         oxfmt config (tabs, no semi, 2047 line length)

Toolchain #

Tool Role
vite-plus Build orchestration (vp pack, vp lint, vp fmt, vp test)
tsdown Module bundling/unbundling, configured via vite-plus
tsgo Type checking (@typescript/native-preview)
oxlint Linting (via vp lint)
oxfmt Formatting (via vp fmt)
vitest Testing (via vp test)

Install #

pnpm install

Scripts #

Command What it does
pnpm build Build dist/ via vp pack
pnpm dev Watch mode build
pnpm check Run all checks in parallel (lint + typecheck)
pnpm check:lint oxlint via vp lint
pnpm check:type tsgo --noEmit
pnpm fix Run all fixers in parallel (format + lint)
pnpm fix:format oxfmt via vp fmt --write
pnpm fix:lint oxlint --fix via vp lint --fix
pnpm test vitest via vp test
pnpm typecheck alias for check:type
pnpm release bump version via bumpp

Dependencies #

Runtime #

Build #

  • vite-plus — build/lint/format/test orchestration
  • concurrently — parallel script composition for check and fix
  • bumpp — version bumping for releases

Code style #

  • Tabs for indentation, no semicolons, 2047 character line limit (enforced by .oxfmtrc.json)
  • isolatedDeclarations requires explicit type annotations on all exported class properties and methods
  • useDefineForClassFields: false required for Lit decorators to work correctly

License #

MIT