Liking cljdoc? Tell your friends :D

How to install Wedge

This document will get you up and running with Wedge in an existing project. If you’d like to just start a new project, see one of the templates. This is also a good way to learn how to create your own Wedge-based template, or get a better understanding of where Wedge is used in your project.

Adding the dependency

Depending on your package manager, you’ll need to add the main dependency in different ways. Wedge’s Clojars page has various different formats depending on what you’re using.

For adding Mise, you’ll need to use a package manager that supports git dependencies such as Clojure CLI or lein-tools-deps. You should only add Mise to your dev dependencies. In deps.edn this is usually achieved with a :dev alias. Here’s an example:

io.dominic/wedge-mise {:git/url "https://git.sr.ht/~severeoverfl0w/wedge-mise"
                       :sha "CHANGEMETOLATESTFROMGIT"}

You should get the latest sha from Mise’s log.

If you’re using deps.edn, this might look like so:

{:paths …
 :deps …
 :aliases
 {:dev {:extra-deps {io.dominic/wedge {:mvn/version …}
                     io.dominic/wedge-mise {:git/url …}}}}}

Configure Wedge

Wedge uses a io/dominic/wedge/system-config.edn (usually in the src/ folder) file in order to set up automatically. This file specifies 2 things:

  1. How to initialize your system

  2. How to find your system during development

To do this, the file should contain a hash map. The hash map should have at least :system, but usually :dev too. There’s two possible systems bundled with Wedge, io.dominic.wedge.clip-aero and io.dominic.wedge.integrant-aero.

For now, let’s select clip-aero.

src/io/dominic/wedge/system-config.edn
{:system io.dominic.wedge.clip-aero}

We’ll also specify that in order to load the project in dev, we should load Aero with the :profile :dev. This uses Aero-specific APIs, so don’t worry if you’re not familiar with Aero and this seems magical. All we are doing is specifying that Aero should only read the "dev" part of the config, for "dev".

src/io/dominic/wedge/system-config.edn
{:system io.dominic.wedge.clip-aero
 :dev {:profile :dev}}

Setup dev

Now we’re ready to start loading up the Wedge development namespaces. You will need a folder which you only add to the classpath during development, commonly called dev. In deps.edn this would look like so:

:aliases {:dev {:extra-paths ["dev"]}}

Inside this folder, we’ll create two files, dev/user.clj and dev/dev.clj.

dev/user.clj
(ns user
  (:require
    [io.dominic.wedge.user :refer :all]))
dev/dev.clj
(ns dev
  (:require
    [io.dominic.wedge.dev :refer :all]))

These will require vars that are useful in each of these namespaces. Learn more about Wedge’s dev in the dev guide.

Now you’re all set!

Can you improve this documentation?Edit on sourcehut

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close