Fork me on GitHub
#calva
<
2023-11-26
>
phill23:11:16

I can work on project A and dependency B "at the same time" using Leiningen. While A's project.clj indicates B's Maven coordinates, A's classpath actually follows a symlink to my working clone of B. VS Code's file explorer also follows the symlink to B (as it does any symlink) so B is pleasantly browseable while I work on A in Calva. Leiningen calls this feature checkouts after the name of the directory where you put the symlinks. How can I do likewise with deps.edn? A's deps.edn indicates B's Maven coordinates or Git sha, but I want Calva to behave as if A's deps.edn used a :local/root coordinate for B. This local/root should ideally be configured as a symlink (as it is for Leiningen) so B would be pleasantly browseable while I work on A in Calva.

Bob B23:11:30

does making an alias with a local root as an override dep achieve all the goals?

phill23:11:32

I don't want to put any hint of the local clone in deps.edn.

Bailey Kocin23:11:03

Put it in your own local user deps.edn by using the ‘:override-deps’ keyword?

Bob B23:11:25

...or it might be possible to make a custom connect sequence that adds the override dep on the command line

seancorfield23:11:43

+1 to an alias in your user deps.edn that uses :override-deps to point that lib at the :local/root and then selecting that alias in Calva when jacking-in. Nothing needed in the project deps.edn. Aliases can be qualified, so :local/<project> for each project you might want to depend on locally. You'll likely want to configure VS Code with a list of (user-level) aliases that it should offer in projects (I do this for several aliases from my user deps.edn that let me override the version of Clojure, add Portal, and so on).