@whatsacomputertho/fbsim-ui
v1.0.0-beta.2
Published
FBSim web component library
Downloads
15
Readme
FBSim UI
A library of ES and NodeJS-compatible web components used across FootballSim UI implementations
Overview
Browser-native web components written in TypeScript. These components interact with a service abstraction layer with implementations for both the FBSim Core WASM library (for local in-browser use) and the FBSim REST API (for use over the network).
Usage
Component Demos
Each web component has a dedicated demo page for viewing it in isolation during development. Run the Vite dev server with hot-reload:
make devThis starts a local server (default http://localhost:5173). The root page links to each component demo:
demo/wact-nav.html— Sticky navigation bardemo/wact-team-select.html— Team selection inputsdemo/wact-matchup-select.html— Home/away matchup selectiondemo/wact-box-score.html— Game score displaydemo/wact-game-sim.html— Full simulation orchestratordemo/wact-feedback-ribbon.html— Feedback/notification ribbon
Changes to source files in src/ are reflected in the browser in real-time via Vite's hot module replacement.
Development Recipes
Various make recipes are defined in this project's Makefile which are used in CI and are useful locally for development
dev: Starts the Vite dev server with hot-reload for component demosdependencies: Runsnpm cito install required dev and prod dependenciestest: Runsnpx vitest runto run the unit tests for each web componentbuild: Compiles the library into ES and Node-compatible distributions and tests the distributionssec: Runsnpm auditto audit the project's dependencies
