Development Workflow With Clojure CLI Tools

Continuing our exploration with Clojure CLI tools, we will discuss what what templates are available to help us create project, Then we will create a new ClojureScript project using figwheel-main and show the different builds we can use to provide several workflows for developing, testing and deploying an application.

We will create a new project using the figwheel-main template, explaining that we need to specify organisation/project-name or organisation.project-name for the clj-new templates to work properly.

Then run the project using the -A:fig:build alias to run with rebel readline to our user account version of deps.edn so it is available for all projects. Then we will run a test runner and see the auto-testing monitoring. Finally we will show ways to configure a deploy workflow that we can use with GitHub

This article is also covered in Practicalli Clojure study group #38 video

Please see earlier articles in this series for background:

Read More

CIDER Jack-in to Clojure CLI Projects From Spacemacs

Running a Clojure project created with CLI tools or clj-new may require you to pass in an alias for the REPL to pick up the right libraries.

A few days ago I created a new ClojureScript and reagent project, using the Clojure CLI tools and clj-new project creation tool, which converts Leiningen and Boot templates into a deps.edn based project. Unfortunately when I created a project from the fighwheel-main template the REPL failed to run from CIDER using cider-jack-in-cljs, saying that figwheel-main was not found. All that was required was to specify the :fig alias when running a REPL.

This article covers two approaches to running Clojure CLI projects from CIDER jack-in that require setting of an alias or multiple aliases e.g. -A:fig:build:party:hammock

See Getting started with Clojure CLI tools for background to this article.

Read More

Getting Started With Clojure CLI Tools

Clojure Command Line Interface (CLI) tools provide a fast way for developers to get started with Clojure and simplify an already pretty simple experience. With tools.deps it also provides a more flexible approach to including libraries, including the use of code from a specific commit in a Git repository.

Practicalli Clojure 35 - Clojure CLI tools - an introduction is a video of a live broadcast of this content (inclucing typos)

Clojure CLI tools provide:

  • Running an interactive REPL (Read-Eval-Print Loop)
  • Running Clojure programs
  • Evaluating Clojure expressions
  • Managing dependencies via tools.deps

Clojure CLI tools allow you to use other libraries to, referred to as dependencies or ‘deps’. These may be libraries you are writing locally, projects in git (e.g. on GitHub) or libraries published to Maven Central or Clojars.

The Clojure CLI tools can cover the essential features of Clojure Build tools Leiningen and Boot, but are not designed as a complete replacement. Both these build tools are mature and may have features you would otherwise need to script in Clojure CLI tools.

This article is a follow on from new Clojure REPL Experience With Clojure CLI Tools and Rebel Readline

Read More