Fork me on GitHub

@hagmonk That looks lovely!

😄 4

Searching is by artifact/group name, right? AFAIK you can’t use the Maven APIs to search for namespace names?


yes, just the group/artifact string


We really need something like Maven’s search by classname for namespaces and vars, but the indexing required for that is non-trivial.


right, I did some poking around the crossclj sources, seems like the fellow maintaining that has taken a step back from it


Yes, he has


I’m not sure he maintained it much past the initial implementation, but I might be wrong there.


It would be great to have a CLJ/CLJS source code index that also tracked the source repo and any built artifacts spun out of that


I have a question about deps support for Cursive. As I envision it, each deps project (i.e. a deps.edn, basically) would be a module in IntelliJ, so modules will be created for local deps etc, and libraries created for git deps.


My problem is that modules have to be given a name, and it has to be something that I can uniquely determine from the deps.edn file, which AFAIK doesn’t provide anything like that.


The only thing that I can think of is to use the name of the containing directory. Does that seem like a reasonable convention?

Alex Miller (Clojure team)03:06:52

We have talked about this a lot in the context of git deps. I don’t have time to write it all now will try to hit this tomorrow


I could also allow a name to be provided in a :cursive/name my-module entry in the deps map, assuming that sort of thing is allowed.


Oh, and one restriction is that modules have to have unique names.


I think the general sentiment has been to keep deps.edn uncluttered with anything not related to building a classpath or running the program. Whether unrelated keys are preserved seems to be by chance rather than design


but you just need a name for the module, it doesn't need to be the same as, say, the official maven artifact name


However, I doubt Cursive is the only system that would find it useful to assign a name to a project.


True, but there’s literally nothing there to base it off right now.


I mean, I could use the sha of the path to the project, but no-one is likely to be happy with that 🙂


haha, what? who here doesn't love a full length SHA? :)


Hey, it’s (almost) guaranteed unique!


I'm just looking through the tools on (which I have to update with find-deps and mbuczko/revolt) to see what conventions exist for project name, in those cases where one is needed


As I understand it, if there are two projects which both refer to a common library using a local ref, there’s no requirement even for the name they assign to it to be unique.


i.e. project1: foo/bar {:local/root "../lib"} and project2: baz/bup {:local/root "../lib"}


In fact, I have no idea where those names are used, if anywhere


I suppose the resolved path to the dep is what actually matters there, rather than the symbol. I'm not aware of any use for it either


I guess one could also look at any git metadata in the project folder - perhaps prefer that, then fall back to directory name


I guess I could use the path from the main project root as the module name, but that will get weird if the local root is outside the main project.


I don’t know if IntelliJ has restrictions on what modules can be called, actually.


The problem with git metadata is that Cursive then needs git capabilities as well as maven capabilities


plus it won't always exist


perhaps the basename of the resolved path of the dep is good enough for most cases? If there is a name clash it might be worth foisting that on the user anyhow


That’s basically the name of the containing directory, right?


Right - or even "basename-1/basename" ... most of my projects would be sensibly named with that convention


I guess I’m worried about cases like server/api/deps.edn and client/api/deps.edn


I’ll see if I can find out whether there are restrictions on module names.


I think I’ll just have to implement things until people stop complaining.

😂 4

That is the zen of software development right there!


The problem with foisting it on the user is that there’s no way to store a customisation for the name within the IntelliJ project - I have to return a project structure based on a list of deps.edn files, no more.


Indeed - I think of it as a dynamic search algorithm.


@alexmiller I’m interested if there’s an official position on keys like :cursive/name my-module in deps files.


@cfleming I don't know how "official" it is but whenever the subject has come up, Alex has always discouraged people adding "random" keys to the file...


Also anecdotal, but listening to Rich on the cognitect podcast (when will they fix the audio?) I heard him say how nice it was to look at a deps.edn file and see “only deps” in there …


I guess I can always have a file alongside the deps.edn, but that seems way uglier to me.


Well, except it’s not only deps.


I mean, there are tasks with aliases etc etc as well.


Anyway, I’ll wait and see what Alex says.


That was my thought too, I think it’s more accurate to say it contains “keys required to build a classpath and invoke the JVM with that classpath”


There's an argument that Leiningen's project.clj sets a precedent for allowing additional tool-specific keys...


I think tools.deps is a deliberate move away from that - where is the sweet spot though? Should the canonical name for the project be something in the deps file? It’s not really a tool-specific thing at all. Ironically, the deps file is a list of canonical names for other projects, or at least the names they go by in their repos


I would say that deps.edn goes a long way toward removing the importance of names -- you can give arbitrary names to local and Git deps. The names of Maven deps really only exist to match up with group/artifact names that are published. When you depend on, say, a Gist, or some code in a random directory, the name is unimportant and synthetic for the most part...


Sadly, my users are not going to want shas as their module names.


They’re fine in a gist link, but not for a descriptive name for someone who wants to get an overview of their project.


These are the kind of highfalutin customers @cfleming's software attracts :)


They’re so fussy.


For some reason I'm reminded of Ghostbusters: "I've worked in the private sector … they expect results"


It does sometimes help to imagine myself as Bill Murray when I have to do this stuff.