I’ll write a guide about using Calva with Duct, as well as file a PR on the Duct template so that things are as streamlined as they are with Calva+Luminus.
Until then. These are the steps for using Calva with a fresh Duct project w/ ClojureScript frontend adding the custom cljs settings yourself (w/o frontend, it is not much to write about ):
- Create the project:
lein new duct my-duct-cljs +site +example +cljs
- Open the project in VS Code:
code my-duct-cljs/
- Create a VS Code project folder settings file
.vscode/settings.json
, and paste this:
See Calva docs about Custom Connect Sequences if you are curious about the settings.{ "calva.replConnectSequences": [ { "name": "Server only", "projectType": "Leiningen", "afterCLJReplJackInCode": "(do (dev) (go))", "cljsType": "none" }, { "name": "Server + Client", "projectType": "Leiningen", "cljsType": { "dependsOn": "lein-figwheel", "connectCode": "(do (dev) (go) (println \"Server started\") (cljs-repl))", "isReadyToStartRegExp": "Server started", "printThisLineRegExp": ":duct.server.http.jetty/starting-server" }, "menuSelections": { "leinProfiles": [ "dev", "repl" ] } } ] }
- Issue the command Start a Project REPL and Connect (aka Jack-in),
ctrl+alt+c ctrl+alt+j
- Wait for the Calva says output channel to say CLJS REPL ready to connect. Please, start your ClojureScript app.
- Open your web browser, pointing it to 127.0.0.1:3000/example.
- Hack away on your project!
If anyone tries this, please let me know how the instructions worked. It’ll help me get the Calva docs right.