Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ result
public
.mcabal
.emcache
.miso/
.mhscache
.miso-build.log
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,16 @@ $ nix develop .#ghcjs --command bash -c "make js"
$ nix develop .#mhs --command bash -c "make mhs"
```

### The miso tool (MicroHs, without nix)

The sampler is also a project of the [miso tool](https://haskell-miso.org/docs/cli) (`miso.yml`), which builds it with MicroHs, without GHC or nix ([emscripten](https://emscripten.org) is needed for the browser):

```bash
$ curl -fsSL https://haskell-miso.org/download | sh
$ miso dev # build, serve on http://localhost:8000, rebuild and reload on save
$ miso build # public/
```

### Serve

To host the built application you can call `serve`
Expand All @@ -131,6 +141,12 @@ Ensure that the Haskell miso [cachix](https://haskell-miso-cachix.cachix.org) is
name: haskell-miso-cachix
```

In CI, the [setup-miso](https://github.com/haskell-miso/setup-miso) action installs the miso tool and runs `miso build` (with emscripten):

```yaml
- uses: haskell-miso/setup-miso@v1
```

### Hosting

To upload and host your project to Github Pages, please see [our Github workflow file](https://github.com/haskell-miso/miso-sampler/blob/main/.github/workflows/main.yml#L38-L56) and the necessary Github actions included.
The site is built with the miso tool and deployed to GitHub Pages: see the `miso` and `deploy` jobs of [our Github workflow file](https://github.com/haskell-miso/miso-sampler/blob/main/.github/workflows/main.yml).
11 changes: 11 additions & 0 deletions miso-static/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> miso-sampler </title>
</head>
<body>
<script src="index.js"></script>
</body>
</html>
12 changes: 12 additions & 0 deletions miso.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# The sampler as a project of the miso tool (MicroHs, no GHC): miso dev to
# develop, miso build to build public/ (this is what CI deploys). app.cabal
# and the Makefile build it with GHC instead.
name: miso-sampler
version: 0.1.0
main: Main
source-dirs: [app]
# browser: WebAssembly (needs emcc)
target: browser
# its own index.html: the one in static/ loads the GHC build's index.js
static-dir: miso-static
dependencies: [miso]
Loading