Tom is a recording system.
Start a temporary local web server, build the app with the dev
profile, and serve the app,
browser test runner and karma test runner with hot reload:
lein watch
lein watch
electron .
Please be patient; it may take over 20 seconds to see any output, and over 40 seconds to complete.
When [:app] Build completed
appears in the output, browse to
http://localhost:8280/.
shadow-cljs
will automatically push ClojureScript code
changes to your browser on save. To prevent a few common issues, see
Hot Reload in ClojureScript: Things to avoid.
Opening the app in your browser starts a ClojureScript browser REPL, to which you may now connect.
Build the app with the prod
profile, start a temporary local web server, launch headless
Chrome/Chromium, run tests, and stop the web server:
lein ci
Please be patient; it may take over 15 seconds to see any output, and over 25 seconds to complete.
Or, for auto-reload:
lein watch
Then in another terminal:
karma start
Use Less to edit styles in .less
files located in the
less/
directory. CSS files are compiled automatically on dev
or prod
build.
Manually compile CSS files:
lein less once
The resources/public/css/
directory is created, containing the compiled CSS files.
Enable automatic compiling of CSS files when source .less
files are changed:
lein less auto
See a list of shadow-cljs CLI
actions:
lein run -m shadow.cljs.devtools.cli --help
Please be patient; it may take over 10 seconds to see any output. Also note that some actions shown may not actually be supported, outputting "Unknown action." when run.
Run a shadow-cljs action on this project's build id (without the colon, just app
):
lein run -m shadow.cljs.devtools.cli <action> app
The debug?
variable in config.cljs
defaults to true
in
dev
builds, and false
in prod
builds.
Use debug?
for logging or other tasks that should run only on dev
builds:
(ns tom.example
(:require [tom.config :as config])
(when config/debug?
(println "This message will appear in the browser console only on dev builds."))
Build the app with the prod
profile:
lein release
For Windows
npm run package-win
For Mac
npm run package-mac