|
2 | 2 |
|
3 | 3 | This is a `PureScript` version of `try-phi` front end. Previously, it was written in [Elm](https://github.com/fizruk/try-phi/tree/cf29332d08376e1da90c851f5326b440ac070763) and [Haskell](https://github.com/fizruk/try-phi/commit/bc04b4d61b00f79ad7736769d1420d632e294579) (via `Miso`). It uses `Halogen` for UI. |
4 | 4 |
|
5 | | -## Dependencies |
| 5 | +## Quick Start |
6 | 6 |
|
7 | | -- Install [npm](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm/) |
| 7 | +1. [Install Nix](https://github.com/deemp/flakes/blob/main/README/InstallNix.md) |
8 | 8 |
|
9 | | -## Quick Start |
| 9 | +1. Switch to this directory |
| 10 | + |
| 11 | + ```sh |
| 12 | + git clone https://github.com/objectionary/try-phi |
| 13 | + cd try-phi/front |
| 14 | + ``` |
10 | 15 |
|
11 | | -- Switch to this directory, build and run the project |
| 16 | +1. Run project: |
12 | 17 |
|
13 | | -```sh |
14 | | -cd front |
15 | | -npm run quick-start |
16 | | -``` |
| 18 | + ```console |
| 19 | + nix develop |
| 20 | + npm run quick-start |
| 21 | + ``` |
17 | 22 |
|
18 | | -- If there is an [inotify error](https://askubuntu.com/a/1088275), run |
| 23 | + - If there is an [inotify error](https://askubuntu.com/a/1088275), run |
19 | 24 |
|
20 | | -```sh |
21 | | -echo fs.inotify.max_user_watches=1000000 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
22 | | -``` |
| 25 | + ```sh |
| 26 | + echo fs.inotify.max_user_watches=1000000 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p |
| 27 | + ``` |
23 | 28 |
|
24 | | -Now, your browser will open, showing [http://localhost:1234](http://localhost:1234) |
| 29 | +1. Now, your browser will open, showing [http://localhost:1234](http://localhost:1234) |
25 | 30 |
|
26 | 31 | ## Develop |
27 | 32 |
|
28 | | -- Run |
| 33 | +1. Run |
29 | 34 |
|
30 | | -```sh |
31 | | -npm run dev |
32 | | -``` |
| 35 | + ```sh |
| 36 | + nix develop |
| 37 | + npm run dev |
| 38 | + ``` |
33 | 39 |
|
34 | 40 | If you're using an [editor](https://github.com/purescript/documentation/blob/master/ecosystem/Editor-and-tool-support.md#editors) that supports [`purs ide`](https://github.com/purescript/purescript/tree/master/psc-ide) or are running [`pscid`](https://github.com/kRITZCREEK/pscid), you simply need to keep the previous `npm run dev` command running in a terminal. Any save to a file **used** in the project will trigger an incremental recompilation, rebundle, and web page refresh, so you can immediately see your changes. |
35 | 41 |
|
36 | 42 | If your workflow does not support automatic recompilation, then you will need to manually re-run `npm run build`. Even with automatic recompilation, a manual rebuild is occasionally required, such as when you add, remove, or modify module names, or notice any other unexpected behavior. |
37 | 43 |
|
38 | 44 | ## Deployment |
39 | 45 |
|
40 | | -* Produce the bundled and minified code at `./prod` and see the app running in a browser via [http-server](https://www.npmjs.com/package/http-server): |
| 46 | +1. Produce the bundled and minified code at `./prod` and see the app running in a browser via [http-server](https://www.npmjs.com/package/http-server): |
41 | 47 |
|
42 | | -```sh |
43 | | -npm run build:prod |
44 | | -``` |
| 48 | + ```sh |
| 49 | + npm run build:prod |
| 50 | + ``` |
45 | 51 |
|
46 | | -* Now, you may deploy your app to a static hosting service, e.g., GitHub Pages (see this [post](https://javascript.plainenglish.io/deploying-any-app-to-github-pages-1e8e946bf890)) |
| 52 | +1. Now, you may deploy your app to a static hosting service, e.g., GitHub Pages (see this [post](https://javascript.plainenglish.io/deploying-any-app-to-github-pages-1e8e946bf890)) |
0 commit comments