diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7c8bc0c..1172bbe 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Build and deploy on: push: - branches: main + branches: [ main ] pull_request: permissions: @@ -15,14 +15,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - uses: cachix/install-nix-action@v31 with: github_access_token: ${{ secrets.GITHUB_TOKEN }} - name: Install cachix - uses: cachix/cachix-action@v16 + uses: cachix/cachix-action@v17 with: name: haskell-miso-cachix @@ -36,7 +36,7 @@ jobs: run: nix develop .#ghcjs --command bash -c "make js" - name: Upload artifact - uses: actions/upload-pages-artifact@v3 + uses: actions/upload-pages-artifact@v5 with: path: ./public @@ -47,7 +47,7 @@ jobs: - name: Build WASM using GHCup run: | - make ghcup-build + make ghcup-build deploy: if: github.ref == 'refs/heads/main' @@ -62,5 +62,4 @@ jobs: steps: - name: Deploy to GitHub Pages id: deployment - uses: actions/deploy-pages@v4 - + uses: actions/deploy-pages@v5 diff --git a/README.md b/README.md index 1e15725..0db53c6 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ -🍱 miso-sampler +🍱 miso-sampler ==================== -This project contains a sample [miso](https://github.com/dmjio/miso) application with scripts to +This project contains a sample [miso](https://github.com/dmjio/miso) application with scripts to develop against vanilla GHC and to compile to Web Assembly or JavaScript. ### Source @@ -11,14 +11,14 @@ View [source](https://github.com/haskell-miso/miso-sampler/blob/main/app/Main.hs ### Install Nix (w/ flakes enabled) ```bash -# Install nix +# Install nix curl -L https://nixos.org/nix/install | sh # Enable flakes echo 'experimental-features = nix-command flakes' >> ~/.config/nix/nix.conf ``` -> [!TIP] +> [!TIP] > Miso requires installing [nix](https://nixos.org) with [Nix Flakes](https://wiki.nixos.org/wiki/Flakes) enabled. ### Browser mode 🔥 @@ -31,8 +31,8 @@ $ nix develop .#wasm --command bash -c 'make repl' ``` Preprocessing executable 'app' for app-0.1.0.0... -GHCi, version 9.12.2.20250924: https://www.haskell.org/ghc/ :? for help -Open http://127.0.0.1:8080/main.html or import http://127.0.0.1:8080/main.js to boot ghci +GHCi, version 9.14.1.20260330: https://www.haskell.org/ghc/ :? for help +Open http://127.0.0.1:8080/main.html or import("http://127.0.0.1:8080/main.js") to boot ghci ``` Paste the URL in your browser. Doing so will cause assets to transfer; you can inspect the network tab, but do not refresh the page. The REPL will load in the terminal @@ -80,7 +80,7 @@ $ nix develop .#wasm --command bash -c 'make watch' ### Development -Call `nix develop` to enter a shell with [GHC 9.12.2](https://haskell.org/ghc) +Call `nix develop` to enter a shell with [GHC 9.14.1](https://haskell.org/ghc) ```bash $ nix develop .#wasm @@ -120,7 +120,7 @@ Ensure that the Haskell miso [cachix](cachix.org) is being used when building yo ```yaml - name: Install cachix - uses: cachix/cachix-action@v16 + uses: cachix/cachix-action@v17 with: name: haskell-miso-cachix ``` diff --git a/app/Main.hs b/app/Main.hs index fd5f1b6..c2ffad4 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -63,13 +63,13 @@ viewModel _ x = H.div_ [ P.class_ "buttons-container" ] [ H.button_ - [ E.onClick AddOne + [ E.onClick SubtractOne , P.class_ "decrement-btn" - ] [text "+"] + ] [text "-"] , H.button_ - [ E.onClick SubtractOne + [ E.onClick AddOne , P.class_ "increment-btn" - ] [text "-"] + ] [text "+"] ] ] -----------------------------------------------------------------------------