Files
atomsync/bb.edn
Florian Schroedl 570a087f53 refactor: move TodoMVC example into example/ directory
- example/todomvc/pocketbook/todomvc.cljs — app source
- example/todomvc/todomvc.html — page
- example/todomvc/js/ — compiled output (gitignored)

Server static file serving is now filesystem-based via --static-dir
flag instead of classpath resources. No static dir by default (API
only); bb server passes --static-dir example/todomvc.

Removed resources/public/ — library has no bundled static assets.
2026-04-04 17:05:12 +02:00

35 lines
1.8 KiB
Clojure

{:tasks
{server {:doc "Start the Pocketbook sync server (serves example app)"
:task (shell "clj" "-M:server" "--static-dir" "example/todomvc")}
cljs {:doc "Compile ClojureScript (one-shot)"
:task (shell "clj" "-M:cljs")}
cljs:watch {:doc "Compile ClojureScript (watch mode)"
:task (shell "clj" "-M:cljs-dev")}
test {:doc "Run all server tests"
:task (let [expr (str "(require 'pocketbook.db-test 'pocketbook.transit-test"
" 'pocketbook.server-test 'pocketbook.auth-test)"
" (let [r (clojure.test/run-all-tests #\"pocketbook\\..*\")]"
" (System/exit (if (and (zero? (:fail r)) (zero? (:error r))) 0 1)))")]
(shell "clj" "-M:dev" "-e" expr))}
dev {:doc "Start server and CLJS watch in tmux"
:task (let [dir (System/getProperty "user.dir")]
(shell {:dir dir} "tmux new-session -d -s pocketbook-dev -n server -c" dir)
(shell {:dir dir} "tmux send-keys -t pocketbook-dev:server" "bb server" "Enter")
(shell {:dir dir} "tmux new-window -t pocketbook-dev -n cljs -c" dir)
(shell {:dir dir} "tmux send-keys -t pocketbook-dev:cljs" "bb cljs:watch" "Enter")
(println "🔶 tmux session 'pocketbook-dev' started")
(println " App: http://localhost:8090")
(println " Server: http://localhost:8090/sync")
(println " Attach: tmux attach -t pocketbook-dev"))}
dev:stop {:doc "Stop the dev tmux session"
:task (shell "tmux kill-session -t pocketbook-dev")}
dev:restart {:doc "Restart the dev tmux session"
:task (do (shell {:continue true} "tmux kill-session -t pocketbook-dev")
(run 'dev))}}}