Something went wrong. Try again.
Making a new TUI editor maybe
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107set quietapp_version := `sed -n 's/^version: *\(.*\)/\1/p' ./glyph.cabal`sources := justfile_directory() / "app" + " " + justfile_directory() / "lib" + " " + justfile_directory() / "dhall" + " " + justfile_directory() / "test"# Print available commandshelp: just --justfile {{ justfile() }} --list# Print the version from the cabal fileversion: echo {{ app_version }}# Format all the thingsformat: fourmolu -i {{ sources }} stylish-haskell -ir {{ sources }} cabal-fmt -i {{ justfile_directory() }}/glyph.cabal nixfmt {{ justfile_directory() }}/shell.nix prettier --write --log-level warn --no-error-on-unmatched-pattern --ignore-path {{ justfile_directory() }}/.gitignore "{{ justfile_directory() }}/**/*.md"# Lint the Haskell sourceslint: hlint {{ sources }}# Build the executable and the test suitebuild: cabal build all --enable-tests# Run the test suitetest: gen cabal test# Run the editorrun *ARGS: gen cabal run glyph -- {{ ARGS }}# Run the editorgen *ARGS: cabal run gen-dhall -- {{ ARGS }}# Rebuild, retest, or rerun whenever a source file changeswatch TARGET="test": #!/usr/bin/env bash set -euo pipefail case "{{ TARGET }}" in build) command=(just build) ;; test) command=(just test) ;; run) command=(just run) ;; lint) command=(just lint) ;; *) echo "unknown watch target '{{ TARGET }}' -- expected build, test, run, or lint" >&2 exit 1 ;; esac watchexec --exts hs,cabal --restart -- "${command[@]}"# Build Haddock docs for glyph and its dependencies, then index them into a local Hoogle databasehoogle-gen: #!/usr/bin/env bash set -euo pipefail if [[ -z "${GLYPH_GHC_DOCS:-}" ]]; then echo "GLYPH_GHC_DOCS is unset -- run this from inside the project's nix-shell" >&2 exit 1 fi cd "{{ justfile_directory() }}" cabal haddock all --project-file=cabal.project.hoogle --builddir=dist-newstyle/hoogle locals=(--local="$GLYPH_GHC_DOCS" --local=dist-newstyle/hoogle) shopt -s nullglob for dir in "$(cabal path --store-dir)"/ghc-"$(ghc --numeric-version)"*/*/share/doc/html/; do locals+=(--local="$dir") done mkdir -p .hoogle hoogle generate --database=.hoogle/glyph.hoo "${locals[@]}"# Query the local Hoogle database: `just hoogle search QUERY...` or `just hoogle server [PORT]`[positional-arguments]hoogle MODE="server" *ARGS: #!/usr/bin/env bash set -euo pipefail database="{{ justfile_directory() }}/.hoogle/glyph.hoo" if [[ ! -f "$database" ]]; then echo "no Hoogle database at $database -- run 'just hoogle-gen' first" >&2 exit 1 fi shift case "{{ MODE }}" in search) if [[ $# -eq 0 ]]; then echo "usage: just hoogle search QUERY..." >&2 exit 1 fi hoogle search --database="$database" "$@" ;; server) hoogle server --database="$database" --local --port="${1:-8080}" ;; *) echo "unknown hoogle mode '{{ MODE }}' -- expected search or server" >&2 exit 1 ;; esac# Everything CI would checkcheck: build test lint echo "all checks passed"