diff --git a/.vscode/tasks.json b/.vscode/tasks.json deleted file mode 100644 index 2aa61a31c..000000000 --- a/.vscode/tasks.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=733558 - // for the documentation about the tasks.json format - "version": "2.0.0", - "tasks": [ - { - "label": "Dev Server", - "type": "shell", - "command": "bin/run", - "args": [], - "problemMatcher": [], - "group": { - "kind": "build", - "isDefault": true - }, - "runOptions": { - // "runOn": "folderOpen" - } - } - ] -} \ No newline at end of file diff --git a/bin/hoogle b/bin/hoogle deleted file mode 100755 index a1b21b94a..000000000 --- a/bin/hoogle +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env nix-shell -#! nix-shell -j auto ../shell.nix -i bash -set -xe -hoogle serve -p 8888 --local \ No newline at end of file diff --git a/bin/repl b/bin/repl deleted file mode 100755 index 424f5ae39..000000000 --- a/bin/repl +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -xe - -exec nix develop -c cabal -- repl --flags=ghcid diff --git a/bin/run b/bin/run deleted file mode 100755 index 8688d4bea..000000000 --- a/bin/run +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash -set -xe -export PORT=${PORT:-9010} - -exec nix develop -c ghcid -c 'cabal repl exe:emanote --flags=ghcid' --warnings -T ":main -L ../docs run --port=$PORT" diff --git a/bin/test b/bin/test deleted file mode 100755 index e507b0c4c..000000000 --- a/bin/test +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash -set -xe - -exec nix develop -i -c ghcid -c "cabal repl test:test --flags=ghcid" --warnings -T :main diff --git a/emanote/README.md b/emanote/README.md index 3d71d4324..3b936fc26 100644 --- a/emanote/README.md +++ b/emanote/README.md @@ -26,13 +26,13 @@ https://emanote.srid.ca/examples Emanote is a Haskell software.[^licenses] Thanks to Nix, this repository is pre-configured to provide a delightful development experience with full IDE support in Visual Studio Code. -See https://srid.ca/haskell-template/start for complete instructions, but the tldr is: Install nix, enable Flakes and run `bin/run`. +See https://srid.ca/haskell-template/start for complete instructions, but the tldr is: Install nix, enable Flakes and run `just run` in the Nix dev shell. See [architecture.md](docs/architecture.md) for a high-level overview of the codebase. ### PR contribution guidelines -Run `nix build .#check -L` when opening a PR. +Run `nix run nixpkgs#nixci` before opening a PR. ## Discussion diff --git a/flake.nix b/flake.nix index 0ab938974..b2fc08e3c 100644 --- a/flake.nix +++ b/flake.nix @@ -140,6 +140,9 @@ config.haskellProjects.default.outputs.devShell config.treefmt.build.devShell ]; + packages = with pkgs; [ + just + ]; }); emanote = { diff --git a/justfile b/justfile new file mode 100644 index 000000000..f9e2e9e08 --- /dev/null +++ b/justfile @@ -0,0 +1,23 @@ +default: + @just --list + +# Run hoogle +docs: + echo http://127.0.0.1:8888 + hoogle serve -p 8888 --local + +# Run cabal repl +repl *ARGS: + cabal repl --flags=ghcid {{ARGS}} + +# Autoformat the project tree +fmt: + treefmt + +# Run the app using ghcid (with auto-reload / recompile) +run: + ghcid -c 'cabal repl exe:emanote --flags=ghcid' --warnings -T ":main -L ../docs run --port=9010" + +# Run tests (with auto-reload / recompile) +test: + ghcid -c "cabal repl test:test --flags=ghcid" --warnings -T :main \ No newline at end of file