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 .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ jobs:
- name: Clean and GC
run: nix develop .#wasm --command bash -c "make" && nix-collect-garbage -d

- name: Build MicroHs using Nix
run: nix develop .#mhs --command bash -c "make mhs"

- name: Build JS using Nix
run: nix develop .#ghcjs --command bash -c "make js"

Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
dist*
result
public
.mcabal
.emcache
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ all: update build optim

js: update-js build-js

mhs: build-mhs

update:
wasm32-wasi-cabal update

Expand All @@ -33,18 +35,24 @@ serve:
http-server public

clean:
rm -rf dist-newstyle public
rm -rf dist-newstyle dist-mcabal public

update-js:
cabal update --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg

build-js:
cabal build --with-ghc=javascript-unknown-ghcjs-ghc --with-hc-pkg=javascript-unknown-ghcjs-ghc-pkg
cp -v ./dist-newstyle/build/javascript-ghcjs/ghc-9.12.2/*/x/app/build/app/app.jsexe/all.js .
cp -v ./dist-newstyle/build/javascript-ghcjs/ghc-*/*/x/app/build/app/app.jsexe/all.js .
rm -rf public
cp -rv static public
bunx --bun swc ./all.js -o public/index.js

build-mhs:
mcabal --options=-tbrowser build
rm -rf public
cp -rv static public
cp -v ./dist-mcabal/bin/mhs/app public/index.js

ghcup-update:
cabal update $(CABAL_ARGS)

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ $ nix develop .#wasm --command bash -c "make"
$ nix develop .#ghcjs --command bash -c "make js"
```

### Build (MicroHs)

```bash
$ nix develop .#mhs --command bash -c "make mhs"
```

### Serve

To host the built application you can call `serve`
Expand Down
3 changes: 3 additions & 0 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ packages:
allow-newer:
all:base

constraints:
aeson >= 2

source-repository-package
type: git
location: https://github.com/dmjio/miso
Expand Down
28 changes: 14 additions & 14 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
devShells.hls = inputs.miso.outputs.devShells.${system}.hls;
devShells.wasm = inputs.miso.outputs.devShells.${system}.wasm;
devShells.ghcjs = inputs.miso.outputs.devShells.${system}.ghcjs;
devShells.mhs = inputs.miso.outputs.devShells.${system}.mhs;
});

}
Expand Down
Loading