This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-06-18
Channels
- # aws-lambda (3)
- # beginners (57)
- # boot (3)
- # bristol-clojurians (1)
- # cider (38)
- # cljs-dev (23)
- # clojure (35)
- # clojure-italy (32)
- # clojure-nl (6)
- # clojure-spec (35)
- # clojure-uk (132)
- # clojurescript (34)
- # cursive (22)
- # data-science (1)
- # datomic (54)
- # devcards (1)
- # duct (5)
- # editors (7)
- # euroclojure (4)
- # fulcro (40)
- # graphql (1)
- # hoplon (6)
- # immutant (5)
- # jobs (1)
- # off-topic (22)
- # om (1)
- # planck (17)
- # portkey (1)
- # protorepl (12)
- # re-frame (97)
- # reagent (67)
- # reitit (16)
- # ring-swagger (1)
- # shadow-cljs (98)
- # spacemacs (8)
- # sql (20)
- # tools-deps (60)
Searching is by artifact/group name, right? AFAIK you canāt use the Maven APIs to search for namespace names?
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
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?
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.
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.
I mean, I could use the sha of the path to the project, but no-one is likely to be happy with that š
I'm just looking through the tools on https://github.com/clojure/tools.deps.alpha/wiki/Tools (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"}
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
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
Right - or even "basename-1/basename" ... most of my projects would be sensibly named with that convention
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.
@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 cursive.properties
file alongside the deps.edn, but that seems way uglier to me.
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...
Theyāre fine in a gist link, but not for a descriptive name for someone who wants to get an overview of their project.