Improve command line helpers.

This commit is contained in:
Andrey Antukh
2020-08-17 15:04:21 +02:00
parent c0cd0d4a23
commit 2746d598b0
11 changed files with 106 additions and 87 deletions

View File

@@ -89,29 +89,39 @@ additional tasks.
### Frontend ###
The frontend build process and the http server is located on the tmux
**window 1**. **Shadow-cljs** is used for build and serve the frontend
code. For more information, please refer to `02-Frontend-Developer-Guide.md`.
The frontend build process is located on the tmux **window 1**.
**Shadow-cljs** is used for build and serve the frontend code. For
more information, please refer to `02-Frontend-Developer-Guide.md`.
By default the **window 1** executes the shadow-cljs watch process, that starts
a new JVM/Clojure instance if there is no one running. But you may also execute
`shadow-cljs server`, that starts only the instance. And then, open another
window with `Ctrl+c` and execute `shadow-cljs watch main` there. This way, the
process that watches and recompiles connects to it and it restarts faster when
your code changes.
By default the **window 1** executes the shadow-cljs watch process,
that starts a new JVM/Clojure instance if there is no one running.
Finally, you can start a REPL linked to the instance and the current connected
browser, by opening a third window with `Ctrl+c` and running
`shadow-cljs cljs-repl main`.
Finally, you can start a REPL linked to the instance and the current
connected browser, by opening a third window with `Ctrl+c` and running
`npx shadow-cljs cljs-repl main`.
### Exporter ###
The exporter app (clojurescript app running in nodejs) is located in
**window 2**, and you can go directly to it using `ctrl+b 2` shortcut.
There you will found the window split in two slices. On the top slice
you will have the build process (using shadow-cljs in the same way as
frontend application), and on the bot slice the script that launeches
the node process.
If some reason scripts does not stars correctly, you can manually
execute `node target/app.js ` to start the exporter app.
### Backend ###
The backend related environment is located in the tmux **window 2**,
The backend related environment is located in the tmux **window 3**,
and you can go directly to it using `ctrl+b 2` shortcut.
By default the backend will be started in non-interactive mode for
convenience but you can just press `Ctrl+c` and execute `./bin/repl`
convenience but you can just press `Ctrl+c` and execute `./scripts/repl`
for start the repl.
On the REPL you have this helper functions:

View File

@@ -3,6 +3,7 @@
This guide intends to explain the essential details of the frontend
application.
## Access to clojure from javascript console
The uxbox namespace of the main application is exported, so that is
@@ -15,6 +16,7 @@ console (there is autocompletion for help):
uxbox.main.store.emit_BANG_(uxbox.main.data.workspace.reset_zoom)
```
## Visual debug mode and utilities
Debugging a problem in the viewport algorithms for grouping and
@@ -37,6 +39,7 @@ uxbox.util.debug.debug_all()
uxbox.util.debug.debug_none()
```
## Debug state and objects
There are also some useful functions to visualize the global state or

View File

@@ -11,12 +11,12 @@ good amount of content (usually used for just test the application or
perform performance tweaks on queries).
In order to load fixtures, enter to the REPL environment executing the
`bin/repl` script, and then execute `(uxbox.fixtures/run :small)`.
`bin/repl` script, and then execute `(uxbox.fixtures/run {:preset :small})`.
You also can execute this as a standalone script with:
```bash
clojure -Adev -m uxbox.fixtures
clojure -Adev -X:fn-fixtures
```
NOTE: It is an optional step because the application can start with an
@@ -37,3 +37,11 @@ from there:
(require 'uxbox.fixtures)
(uxbox.fixtures/run :small)
```
To access to the running process repl you usually will execute this
command:
```bash
rlwrap netcat localhost 5555
```

View File

@@ -22,7 +22,7 @@ This is a probably incomplete list of available options (with
respective defaults):
- `UXBOX_HTTP_SERVER_PORT=6060`
- `UXBOX_PUBLIC_URI=http://localhost:3449/`
- `UXBOX_PUBLIC_URI=http://localhost:3449`
- `UXBOX_DATABASE_USERNAME=` (default undefined, used from uri)
- `UXBOX_DATABASE_PASSWORD=` (default undefined, used from uri)
- `UXBOX_DATABASE_URI=postgresql://127.0.0.1/uxbox`
@@ -57,6 +57,7 @@ respective defaults):
- `UXBOX_LDAP_AUTH_FULLNAME_ATTRIBUTE=displayName`
- `UXBOX_LDAP_AUTH_AVATAR_ATTRIBUTE=jpegPhoto`
## REPL ##
The production environment by default starts a server REPL where you
@@ -95,12 +96,12 @@ has all the material design icon collections).
Then, you need to execute:
```bash
clojure -Adev -m uxbox.media-loader ../path/to/config.edn
clojure -Adev -X:fn-media-loader :path ../path/to/config.edn
```
If you have a REPL access to the running process, you can execute it from there:
```clojure
(require 'uxbox.media-loader)
@(uxbox.media-loader/run "/path/to/config.edn")
(uxbox.media-loader/run* "/path/to/config.edn")
```