@boardgame-dsl/boardgame
v0.1.1
Published
The frontend "glue" for Haskell boardgames
Downloads
6
Readme
boardgame.js
The frontend glue for Haskell boardgames on the web.
The package is hosted on npm, install it with the following command.
npm install @boardgame-dsl/boardgameYou can also directly include the "glue" part of the library from unpkg with a script tag:
<script src="https://unpkg.com/@boardgame-dsl/boardgame@<version>/index.js"></script>The Library
The library is almost required when using boardgame WASM.
Import it in the entry file of your project:
import "@boardgame-dsl/boardgame";Later access its functions trough the window.boardgame object.
It is located in ./src, lib.config.js, run npm run build-lib to build.
Output is placed in ./dist/index.js.
UI Components
The UI components library can be useful when using boardgame WASM. It includes some standard components written in React.
Import components from the components sub-package.
import { ColoredGraphDisplay, ... } from "@boardgame-dsl/boardgame/components";It is located in ./components, components.config.js, run
npm run build-components to build. Output is placed in ./dist/components.js.
Example
An example project is available. To use it, place boardgame.js and
boardgame.wasm (output of the Haskell boardgame
project) in ./dist-example, and then run npm start. This will start a dev
server on localhost:9090.
The example projects files are located in ./example.
