aboutsummaryrefslogtreecommitdiff
path: root/cmd/trunks-example
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2021-09-25 23:43:13 +0700
committerShulhan <ms@kilabit.info>2021-09-25 23:43:13 +0700
commit8800b8fb860f6d8429487bf6bb45dc9cca29507a (patch)
tree18dd263dfbd2147a24587bb78438a4519efca4be /cmd/trunks-example
parent264cb9882e6878d1b8038de153424f69a2fc2ac4 (diff)
downloadgorankusu-8800b8fb860f6d8429487bf6bb45dc9cca29507a.tar.xz
all: simplify development on trunks-example
Previously to developer and test trunks on local we need to run "tsc -w" on directory _www to watch and recompile any changes to TypeScript files, and run "go run ./cmd/trunks-example" to view the Trunks web interface. Since we will have internal documentation inside _www/docs, we need to run another ciigo server that watch any changes to .adoc files and convert it to HTML. Three separate commands for development. This changes refactoring the development process by running two goroutines when TRUNKS_DEV environment variable is set to non-empty. One goroutine watch any changes to TypeScript, HTML, and tsconfig files inside the _www, and when there is an update it will execute "tsc -p" to recompile and "go run ./internal/generate-memfs" to embed them into Go source. Another goroutine watch any changes to .adoc files inside "_www/docs" directory and convert them into HTML files. This goroutine will running in the background while the HTTP server is running too.
Diffstat (limited to 'cmd/trunks-example')
-rw-r--r--cmd/trunks-example/main.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/cmd/trunks-example/main.go b/cmd/trunks-example/main.go
index 854cf69..9c340e5 100644
--- a/cmd/trunks-example/main.go
+++ b/cmd/trunks-example/main.go
@@ -12,8 +12,9 @@ import (
"os/signal"
"syscall"
- "git.sr.ht/~shulhan/trunks/example"
"github.com/shuLhan/share/lib/mlog"
+
+ "git.sr.ht/~shulhan/trunks/example"
)
func main() {