NOTE: this part is only relevant if you're developing the Cuphic library itself.
The development workflow of the project itself is built around the Clojure CLI for managing dependencies and shadow-cljs for compiling ClojureScript code and providing a live-reloading development environment.
In this project, the dependency management feature of shadow-cljs is not used directly. Rather, I leverage the built-in support in shadow-cljs for the Clojure CLI/deps.edn to download dependencies and build a classpath.
I personally use IntelliJ with the Cursive plugin which integrates quite well with the Clojure CLI.
(assuming homebrew has already been installed)
I'm not sure which JDK version you need, but anything 8+ is probably fine! I personally just use the latest from AdoptOpenJDK (currently JDK 13):
brew cask install adoptopenjdk
The following will get you the Clojure CLI and shadow-cljs, along with NodeJS:
brew install clojure/tools/clojure
brew install node
npm install -g shadow-cljs
Make sure that shadow-cljs can infer and install react-dom:
npm init
Development of the library is done using the live-reloading capabilities of shadow-cljs:
shadow-cljs watch app
This will start a basic web server at localhost:6000
serving the :app
build as specified in the shadow-cljs.edn
file.
It's possible to execute unit tests while developing by also specifying the :test
build:
shadow-cljs watch app test
This will make test output available at localhost:6100
. It's quite convenient to keep a separate browser tab open just for this. The favicon will be coloured green or red depending on the state of the assertions.
Personally, I use the Clojure CLI integration in Cursive to calculate a classpath and download dependencies. Something like this command is being executed behind the scenes:
clj -A:app:test -Spath
I have also set up some aliases in my personal ~/.clojure/deps.edn file to perform certain common tasks such as listing/updating outdated packages:
clj -A:outdated
clj -A:update