diff --git a/README.md b/README.md index 45a2e702..b77aabed 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,3 @@ -# Try-phi - logo [![Hits-of-Code](https://hitsofcode.com/github/objectionary/try-phi?branch=main)](https://hitsofcode.com/view/github/objectionary/try-phi?branch=main) @@ -10,9 +8,7 @@ Right now we implement it as a term rewriting system. It is combined with [EO](https://github.com/objectionary/eo) editor. EO is based on 𝜑-calculus. -## Usage - -- The online playground is available [here](https://www.objectionary.com/try-phi/?editor=phi&snippet=%5B%0A%20%20a%20-%3E%203%2C%0A%20%20b%20-%3E%20%5E0.a%0A%5D.b) +The online playground is available [here](https://www.objectionary.com/try-phi/?editor=phi&snippet=%5B%0A%20%20a%20-%3E%203%2C%0A%20%20b%20-%3E%20%5E0.a%0A%5D.b) ## Components @@ -21,42 +17,53 @@ It is combined with [EO](https://github.com/objectionary/eo) editor. EO is based - [EO editor](https://github.com/br4ch1st0chr0n3/eo-editor) - [Phi editor](https://github.com/br4ch1st0chr0n3/phi-editor) -## Development +## How to Contribute + +Install [Nix](https://nixos.org/download.html) (Single-user installation) + +```sh +sh <(curl -L https://nixos.org/nix/install) --no-daemon +``` -- Install [Nix](https://nixos.org/download.html) (Single-user installation) - ```sh - sh <(curl -L https://nixos.org/nix/install) --no-daemon - ``` +Install [direnv](https://nix.dev/tutorials/declarative-and-reproducible-developer-environments#direnv-automatically-activating-the-environment-on-directory-change) - steps 1, 2 -- Install [direnv](https://nix.dev/tutorials/declarative-and-reproducible-developer-environments#direnv-automatically-activating-the-environment-on-directory-change) - steps 1, 2 +For [VS Code](https://code.visualstudio.com/) -- For [VS Code](https://code.visualstudio.com/) - Install extensions - ```sh - code --install-extension mkhl.direnv --install-extension haskell.haskell --install-extension nwolverson.ide-purescript - ``` + +```sh +code --install-extension mkhl.direnv --install-extension haskell.haskell --install-extension nwolverson.ide-purescript +``` + - Open workspace in `.vscode/try-phi.code-workspace` -- In separate terminals: +Then, in separate terminals: + - backend dev - ```sh - cd back - # for the first time - direnv allow - # start the server - nix run - ``` + +```sh +cd back +# for the first time +direnv allow +# build for HLS +nix build +# start the server +nix run +``` + - front - ```sh - cd front - # for the first time - direnv allow - # open app in a browser - npm run dev - # or any other commands from package.json - ``` - -- If in VS Code, reload the window (`Ctrl`+`Shift`+`P` -> `Developer: Reload window`) and repeat previous commands to start the server and the client - -- For Haskell, your shell will have [haskell-language-server](https://github.com/haskell/haskell-language-server) -- For Purescript - [purescript-language-server](https://github.com/nwolverson/purescript-language-server) \ No newline at end of file + +```sh +cd front +# for the first time +direnv allow +# open app in a browser +npm run dev +# or any other commands from package.json +``` + +If in VS Code, reload the window (`Ctrl`+`Shift`+`P` -> `Developer: Reload window`) and repeat previous commands to start the server and the client + +For Haskell, your shell will have [haskell-language-server](https://github.com/haskell/haskell-language-server) + +For Purescript - [purescript-language-server](https://github.com/nwolverson/purescript-language-server) diff --git a/build.sh b/build.sh deleted file mode 100644 index b890b765..00000000 --- a/build.sh +++ /dev/null @@ -1,4 +0,0 @@ -cd front -npm run build:init -cd ../back -stack build \ No newline at end of file diff --git a/flake.lock b/flake.lock deleted file mode 100644 index 34fd8410..00000000 --- a/flake.lock +++ /dev/null @@ -1,553 +0,0 @@ -{ - "nodes": { - "HTTP": { - "flake": false, - "locked": { - "lastModified": 1451647621, - "narHash": "sha256-oHIyw3x0iKBexEo49YeUDV1k74ZtyYKGR2gNJXXRxts=", - "owner": "phadej", - "repo": "HTTP", - "rev": "9bc0996d412fef1787449d841277ef663ad9a915", - "type": "github" - }, - "original": { - "owner": "phadej", - "repo": "HTTP", - "type": "github" - } - }, - "back": { - "inputs": { - "flake-utils": "flake-utils", - "haskellNix": "haskellNix", - "nixpkgs": [ - "back", - "haskellNix", - "nixpkgs-unstable" - ] - }, - "locked": { - "lastModified": 1, - "narHash": "sha256-c6H0Ae1S5gErP0PIzOg6lIVbn/W/WgWCqo1FOq0amR0=", - "path": "/nix/store/1sccrxq3rn05hygj09ndp5pfpkyijn81-source/back", - "type": "path" - }, - "original": { - "path": "/nix/store/1sccrxq3rn05hygj09ndp5pfpkyijn81-source/back", - "type": "path" - } - }, - "cabal-32": { - "flake": false, - "locked": { - "lastModified": 1603716527, - "narHash": "sha256-X0TFfdD4KZpwl0Zr6x+PLxUt/VyKQfX7ylXHdmZIL+w=", - "owner": "haskell", - "repo": "cabal", - "rev": "48bf10787e27364730dd37a42b603cee8d6af7ee", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.2", - "repo": "cabal", - "type": "github" - } - }, - "cabal-34": { - "flake": false, - "locked": { - "lastModified": 1640353650, - "narHash": "sha256-N1t6M3/wqj90AEdRkeC8i923gQYUpzSr8b40qVOZ1Rk=", - "owner": "haskell", - "repo": "cabal", - "rev": "942639c18c0cd8ec53e0a6f8d120091af35312cd", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.4", - "repo": "cabal", - "type": "github" - } - }, - "cabal-36": { - "flake": false, - "locked": { - "lastModified": 1641652457, - "narHash": "sha256-BlFPKP4C4HRUJeAbdembX1Rms1LD380q9s0qVDeoAak=", - "owner": "haskell", - "repo": "cabal", - "rev": "f27667f8ec360c475027dcaee0138c937477b070", - "type": "github" - }, - "original": { - "owner": "haskell", - "ref": "3.6", - "repo": "cabal", - "type": "github" - } - }, - "cardano-shell": { - "flake": false, - "locked": { - "lastModified": 1608537748, - "narHash": "sha256-PulY1GfiMgKVnBci3ex4ptk2UNYMXqGjJOxcPy2KYT4=", - "owner": "input-output-hk", - "repo": "cardano-shell", - "rev": "9392c75087cb9a3d453998f4230930dea3a95725", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "cardano-shell", - "type": "github" - } - }, - "easy-purescript-nix": { - "flake": false, - "locked": { - "lastModified": 1654121141, - "narHash": "sha256-mkHIyWk5Xh54FqCU7CT3G/tnHF7mLbQt3EfnNCMCTO8=", - "owner": "justinwoo", - "repo": "easy-purescript-nix", - "rev": "5dca2f0f3b9ec0bceabb23fa1fd2b5f8ec30fa53", - "type": "github" - }, - "original": { - "owner": "justinwoo", - "repo": "easy-purescript-nix", - "type": "github" - } - }, - "flake-utils": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_2": { - "locked": { - "lastModified": 1644229661, - "narHash": "sha256-1YdnJAsNy69bpcjuoKdOYQX0YxZBiCYZo4Twxerqv7k=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "3cecb5b042f7f209c56ffd8371b2711a290ec797", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_3": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "flake-utils_4": { - "locked": { - "lastModified": 1659877975, - "narHash": "sha256-zllb8aq3YO3h8B/U0/J1WBgAL8EX5yWf5pMj3G0NAmc=", - "owner": "numtide", - "repo": "flake-utils", - "rev": "c0e246b9b83f637f4681389ecabcb2681b4f3af0", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "flake-utils", - "type": "github" - } - }, - "front": { - "inputs": { - "easy-purescript-nix": "easy-purescript-nix", - "flake-utils": "flake-utils_4", - "nixpkgs": "nixpkgs_2" - }, - "locked": { - "lastModified": 1, - "narHash": "sha256-YQLCTcFI+gxD0iUXm0jXDFKla9YNpuQqj3XbD4TcxVc=", - "path": "/nix/store/1sccrxq3rn05hygj09ndp5pfpkyijn81-source/front", - "type": "path" - }, - "original": { - "path": "/nix/store/1sccrxq3rn05hygj09ndp5pfpkyijn81-source/front", - "type": "path" - } - }, - "ghc-8.6.5-iohk": { - "flake": false, - "locked": { - "lastModified": 1600920045, - "narHash": "sha256-DO6kxJz248djebZLpSzTGD6s8WRpNI9BTwUeOf5RwY8=", - "owner": "input-output-hk", - "repo": "ghc", - "rev": "95713a6ecce4551240da7c96b6176f980af75cae", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "ref": "release/8.6.5-iohk", - "repo": "ghc", - "type": "github" - } - }, - "hackage": { - "flake": false, - "locked": { - "lastModified": 1660526090, - "narHash": "sha256-8+x3wrQBezySDs6QwBk8ZkAz81P/1Oc1WsyPu+SNp/c=", - "owner": "input-output-hk", - "repo": "hackage.nix", - "rev": "1d03018bb24be906bafb95fc541f7feaacbd87af", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "hackage.nix", - "type": "github" - } - }, - "haskellNix": { - "inputs": { - "HTTP": "HTTP", - "cabal-32": "cabal-32", - "cabal-34": "cabal-34", - "cabal-36": "cabal-36", - "cardano-shell": "cardano-shell", - "flake-utils": "flake-utils_2", - "ghc-8.6.5-iohk": "ghc-8.6.5-iohk", - "hackage": "hackage", - "hpc-coveralls": "hpc-coveralls", - "hydra": "hydra", - "nix-tools": "nix-tools", - "nixpkgs": [ - "back", - "haskellNix", - "nixpkgs-unstable" - ], - "nixpkgs-2003": "nixpkgs-2003", - "nixpkgs-2105": "nixpkgs-2105", - "nixpkgs-2111": "nixpkgs-2111", - "nixpkgs-2205": "nixpkgs-2205", - "nixpkgs-unstable": "nixpkgs-unstable", - "old-ghc-nix": "old-ghc-nix", - "stackage": "stackage" - }, - "locked": { - "lastModified": 1660554603, - "narHash": "sha256-J7z1qCpsFPlZCgIWvEhjNXABWOCFHRIuBcHsRGiwWm4=", - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "9c697ee23a78af9326b5c8849e675a380e46a69a", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "haskell.nix", - "rev": "9c697ee23a78af9326b5c8849e675a380e46a69a", - "type": "github" - } - }, - "hpc-coveralls": { - "flake": false, - "locked": { - "lastModified": 1607498076, - "narHash": "sha256-8uqsEtivphgZWYeUo5RDUhp6bO9j2vaaProQxHBltQk=", - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "rev": "14df0f7d229f4cd2e79f8eabb1a740097fdfa430", - "type": "github" - }, - "original": { - "owner": "sevanspowell", - "repo": "hpc-coveralls", - "type": "github" - } - }, - "hydra": { - "inputs": { - "nix": "nix", - "nixpkgs": [ - "back", - "haskellNix", - "hydra", - "nix", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1646878427, - "narHash": "sha256-KtbrofMtN8GlM7D+n90kixr7QpSlVmdN+vK5CA/aRzc=", - "owner": "NixOS", - "repo": "hydra", - "rev": "28b682b85b7efc5cf7974065792a1f22203a5927", - "type": "github" - }, - "original": { - "id": "hydra", - "type": "indirect" - } - }, - "lowdown-src": { - "flake": false, - "locked": { - "lastModified": 1633514407, - "narHash": "sha256-Dw32tiMjdK9t3ETl5fzGrutQTzh2rufgZV4A/BbxuD4=", - "owner": "kristapsdz", - "repo": "lowdown", - "rev": "d2c2b44ff6c27b936ec27358a2653caaef8f73b8", - "type": "github" - }, - "original": { - "owner": "kristapsdz", - "repo": "lowdown", - "type": "github" - } - }, - "nix": { - "inputs": { - "lowdown-src": "lowdown-src", - "nixpkgs": "nixpkgs", - "nixpkgs-regression": "nixpkgs-regression" - }, - "locked": { - "lastModified": 1643066034, - "narHash": "sha256-xEPeMcNJVOeZtoN+d+aRwolpW8mFSEQx76HTRdlhPhg=", - "owner": "NixOS", - "repo": "nix", - "rev": "a1cd7e58606a41fcf62bf8637804cf8306f17f62", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "2.6.0", - "repo": "nix", - "type": "github" - } - }, - "nix-tools": { - "flake": false, - "locked": { - "lastModified": 1659569011, - "narHash": "sha256-wHS0H5+TERmDnPCfzH4A+rSR5TvjYMWus9BNeNAMyUM=", - "owner": "input-output-hk", - "repo": "nix-tools", - "rev": "555d57e1ea81b79945f2608aa261df20f6b602a5", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "nix-tools", - "type": "github" - } - }, - "nixpkgs": { - "locked": { - "lastModified": 1632864508, - "narHash": "sha256-d127FIvGR41XbVRDPVvozUPQ/uRHbHwvfyKHwEt5xFM=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "82891b5e2c2359d7e58d08849e4c89511ab94234", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "ref": "nixos-21.05-small", - "type": "indirect" - } - }, - "nixpkgs-2003": { - "locked": { - "lastModified": 1620055814, - "narHash": "sha256-8LEHoYSJiL901bTMVatq+rf8y7QtWuZhwwpKE2fyaRY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "1db42b7fe3878f3f5f7a4f2dc210772fd080e205", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-20.03-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2105": { - "locked": { - "lastModified": 1655034179, - "narHash": "sha256-rf1/7AbzuYDw6+8Xvvf3PtEOygymLBrFsFxvext5ZjI=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "046ee4af7a9f016a364f8f78eeaa356ba524ac31", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2111": { - "locked": { - "lastModified": 1656782578, - "narHash": "sha256-1eMCBEqJplPotTo/SZ/t5HU6Sf2I8qKlZi9MX7jv9fw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "573603b7fdb9feb0eb8efc16ee18a015c667ab1b", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-21.11-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-2205": { - "locked": { - "lastModified": 1657876628, - "narHash": "sha256-URmf0O2cQ/3heg2DJOeLyU/JmfVMqG4X5t9crQXMaeY=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "549d82bdd40f760a438c3c3497c1c61160f3de55", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-22.05-darwin", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs-regression": { - "locked": { - "lastModified": 1643052045, - "narHash": "sha256-uGJ0VXIhWKGXxkeNnq4TvV3CIOkUJ3PAoLZ3HMzNVMw=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "github" - }, - "original": { - "id": "nixpkgs", - "rev": "215d4d0fd80ca5163643b03a33fde804a29cc1e2", - "type": "indirect" - } - }, - "nixpkgs-unstable": { - "locked": { - "lastModified": 1657888067, - "narHash": "sha256-GnwJoFBTPfW3+mz7QEeJEEQ9OMHZOiIJ/qDhZxrlKh8=", - "owner": "NixOS", - "repo": "nixpkgs", - "rev": "65fae659e31098ca4ac825a6fef26d890aaf3f4e", - "type": "github" - }, - "original": { - "owner": "NixOS", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_2": { - "locked": { - "lastModified": 1659446231, - "narHash": "sha256-hekabNdTdgR/iLsgce5TGWmfIDZ86qjPhxDg/8TlzhE=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "eabc38219184cc3e04a974fe31857d8e0eac098d", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixos-21.11", - "repo": "nixpkgs", - "type": "github" - } - }, - "nixpkgs_3": { - "locked": { - "lastModified": 1660551188, - "narHash": "sha256-a1LARMMYQ8DPx1BgoI/UN4bXe12hhZkCNqdxNi6uS0g=", - "owner": "nixos", - "repo": "nixpkgs", - "rev": "441dc5d512153039f19ef198e662e4f3dbb9fd65", - "type": "github" - }, - "original": { - "owner": "nixos", - "ref": "nixpkgs-unstable", - "repo": "nixpkgs", - "type": "github" - } - }, - "old-ghc-nix": { - "flake": false, - "locked": { - "lastModified": 1631092763, - "narHash": "sha256-sIKgO+z7tj4lw3u6oBZxqIhDrzSkvpHtv0Kki+lh9Fg=", - "owner": "angerman", - "repo": "old-ghc-nix", - "rev": "af48a7a7353e418119b6dfe3cd1463a657f342b8", - "type": "github" - }, - "original": { - "owner": "angerman", - "ref": "master", - "repo": "old-ghc-nix", - "type": "github" - } - }, - "root": { - "inputs": { - "back": "back", - "flake-utils": "flake-utils_3", - "front": "front", - "nixpkgs": "nixpkgs_3" - } - }, - "stackage": { - "flake": false, - "locked": { - "lastModified": 1660526637, - "narHash": "sha256-9Xqgl9IFHaGZaLdREc/pOnd/9hoIc/s4mLWfzOa3EKQ=", - "owner": "input-output-hk", - "repo": "stackage.nix", - "rev": "77cc74639bf6264ec139ae8b0b76e19699325d95", - "type": "github" - }, - "original": { - "owner": "input-output-hk", - "repo": "stackage.nix", - "type": "github" - } - } - }, - "root": "root", - "version": 7 -} diff --git a/package.json b/package.json deleted file mode 100644 index f4f1d3d6..00000000 --- a/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "private": true, - "devDependencies": { - "buffer": "^6.0.3", - "gh-pages": "^4.0.0", - "parcel": "2.5.0", - "process": "^0.11.10", - "purescript": "^0.15.2", - "spago": "^0.20.9", - "util": "^0.12.4" - }, - "scripts": { - "build": "spago build", - "dev": "parcel dev/index.html --open", - "test": "spago test", - "prequick-start": "npm i", - "quick-start": "npm run build", - "postquick-start": "npm run dev", - "prebuild:min": "npm i && rm -rf min && mkdir min && cp dev/* min/", - "build:min": "spago bundle-app --to min/index.js --minify && parcel build min/index.html", - "build:gh-pages": "npm run build:min && cp -TR min docs", - "build:prod": "npm run build:min && cp -TR min prod", - "postbuild:prod": "npx http-server prod -o" - }, - "dependencies": { "npx": "^10.2.2" - } -} \ No newline at end of file