diff options
| author | Kit La Touche <kit@transneptune.net> | 2024-11-28 21:54:15 -0500 |
|---|---|---|
| committer | Kit La Touche <kit@transneptune.net> | 2024-11-28 21:54:15 -0500 |
| commit | 810ebb811c40b50ddb95bb9559d7515f46ec2052 (patch) | |
| tree | 993abbd49907b399af933a44fb40e2e88c6933a5 /tools | |
| parent | d23685c0ea46c92c75d43b6d6a361597241dd95e (diff) | |
| parent | 5ce6c9f6277c43caf7413cce255af7bdc947e74c (diff) | |
Merge branch 'main' into wip/stylize
Diffstat (limited to 'tools')
| -rwxr-xr-x | tools/run | 21 | ||||
| -rwxr-xr-x | tools/run-frontend | 10 | ||||
| -rwxr-xr-x | tools/run-unified | 9 | ||||
| -rwxr-xr-x | tools/test-all | 10 | ||||
| -rwxr-xr-x | tools/test-server | 9 | ||||
| -rwxr-xr-x | tools/test-ui | 9 |
6 files changed, 59 insertions, 9 deletions
@@ -1,14 +1,17 @@ #!/bin/bash -e -## tools/run [ARGS...] +## tools/run +## +## Runs the service, and runs a development version of the UI, with hot +## reloading and live code changes enabled. -if [ -z ${PILCROW_DEV+x} ]; then - cargo run -- "$@" -else - npm run dev & PIDS[0]=$! - cargo run -- "$@" & PIDS[1]=$! +PIDS=() - trap "kill ${PIDS[*]}" SIGINT +trap 'kill "${PIDS[@]}"' EXIT - wait -fi +cargo run & +PIDS+=($!) +npm run dev -- --host & +PIDS+=($!) + +wait "${PIDS[@]}" diff --git a/tools/run-frontend b/tools/run-frontend new file mode 100755 index 0000000..14ff49c --- /dev/null +++ b/tools/run-frontend @@ -0,0 +1,10 @@ +#!/bin/bash -e + +## tools/run-frontend [OPTIONS…] +## +## Runs a development server for the Pilcrow UI. Options are passed through to +## the `npm run dev` command. This is best combined with the `API_SERVER` +## environment variable, to configure the development server to connect to a +## running Pilcrow instance. + +exec npm run dev -- --host "$@" diff --git a/tools/run-unified b/tools/run-unified new file mode 100755 index 0000000..41ad1de --- /dev/null +++ b/tools/run-unified @@ -0,0 +1,9 @@ +#!/bin/bash -e + +## tools/run-unified [OPTIONS…] +## +## Runs the service, with the UI unified into it (approximately as it would be +## in a deployed configuration). Options are passed through to the `pilcrow` +## command. + +exec cargo run --bin pilcrow -- "$@" diff --git a/tools/test-all b/tools/test-all new file mode 100755 index 0000000..0ad3ca3 --- /dev/null +++ b/tools/test-all @@ -0,0 +1,10 @@ +#!/bin/bash -e + +## tools/test-all +## +## Run the full test suite. + +cd "$(dirname "$0")/.." + +tools/test-ui +tools/test-server diff --git a/tools/test-server b/tools/test-server new file mode 100755 index 0000000..44bdf76 --- /dev/null +++ b/tools/test-server @@ -0,0 +1,9 @@ +#!/bin/bash -e + +## tools/test-server +## +## Run the server test suite. + +cd "$(dirname "$0")/.." + +cargo test diff --git a/tools/test-ui b/tools/test-ui new file mode 100755 index 0000000..eff5a07 --- /dev/null +++ b/tools/test-ui @@ -0,0 +1,9 @@ +#!/bin/bash -e + +## tools/test-ui +## +## Run the UI test suite. + +cd "$(dirname "$0")/.." + +npm run test -- --run |
