Fork me on GitHub
#polylith
<
2021-10-11
>
tengstrand06:10:57

A question to you @seancorfield. Do you add "." to the :dev > :extra-paths in ./deps.edn + the io.github.clojure/tools.build {:git/tag "v0.5.1" :git/sha "21da7d4"}and io.github.seancorfield/build-clj {:git/tag "v0.5.1" :git/sha "dc121d6"} library dependencies as :extra-deps in the same file so that the you can work with https://github.com/polyfy/polylith/blob/shell/build.clj from your IDE? I need to add it in Cursive to get rid of the red marks and to get navigation working.

seancorfield17:10:24

@U1G0HH87L No, that is not needed. -T invocation automatically adds the current directory to the paths. VS Code / Calva / LSP do not complain. That sounds like a bug in Cursive (or at least another deficiency in terms of how it handles deps.edn projects).

tengstrand20:10:44

Okay. Because the example uses Cursive, I need to add it. If I mention that it’s not needed in the other IDE’s then it’s probably okay to have it in the instruction (otherwise it’s hard to work with the code in Cursive).

seancorfield20:10:02

When I start my REPL for the monorepo, if I want to work with the build.clj script as well as regular code, I use clj -A:dev:test:build instead of just clj -A:dev:test

seancorfield20:10:49

See if Cursive works properly with the REPL if you start it like that? Or is this Cursive's static analysis? (have you opened an issue on Cursive's repo for this?)

tengstrand02:10:44

It’s not the REPL that is the problem, it’s the IDE integration, and it doesn’t help if I select the build alias.

seancorfield02:10:34

I saw some discussions in #tools-build or #tools-deps where @U0567Q30W was talking about having problems getting Cursive to work properly with "tool" style aliases. Check out the backchat in those channels (or look on Zulip in those topics in the slack-archive stream).

seancorfield02:10:56

I just don't think you'll get the build.clj stuff to work properly with Cursive at the moment.

seancorfield02:10:55

My advice: document what works for VS Code/Emacs/etc and perhaps add a > Note: that Cursive users might need to add additional things to deps.edn -- there's already enough of a mess in the Polylith docs because it leads people to "do the wrong thing" just to satisfy Cursive (I was helping another Polylith user recently and they were having problems because the "correct" thing to do in Polylith doesn't match the docs because of the Cursive nonsense).

tengstrand03:10:16

Yes, it would be good if we could switch over to VSCode/Calva in the examples and instead have a separate section for Cursive users. I’ve started to update the documentation, but I don’t like what I see, so I will add a note instead as you suggest.

seancorfield03:10:00

The main reason for my strong position on that is that Colin is actively trying to improve the Cursive experience in all these areas because he knows it is sub-par compared to other editors. Polylith's docs should explain "best practice" for everyone -- since the concessions for Cursive will reduce over time. Cursive is consistently about 30% of the Clojure user base so I agree it can't be ignored, but why hamstring the other 70% of users just because the user experience with Cursive is a bit wonky.

seancorfield03:10:03

It's not like the Cursive concessions are needed for running the poly tool or building artifacts etc. And the REPL-connected experience in Cursive is just fine. This is purely about the static aspect of Cursive's experience.

tengstrand03:10:06

Yes, good point.

Henrique Prange21:10:35

Hey guys! Dumb question: where do you place test resources in a Polylith component?

kendall.buchanan22:10:14

@U029WR2TAV6 We just put them in component-name/resources :man-shrugging:.

Henrique Prange22:10:53

Thanks for your answer. Don’t they end up included in the project’s final package this way?

kendall.buchanan22:10:56

I’m guessing you could to extra-paths in the test alias to avoid that.

kendall.buchanan22:10:03

*you could add to

kendall.buchanan22:10:21

{:test {:extra-paths ["test" "test/resources"]
                  :extra-deps  {}}}

kendall.buchanan22:10:25

Or something like that :man-shrugging:

Henrique Prange23:10:35

I guess my question wasn’t clear. I’m trying to understand if there’s a standard directory to place test resources when using Polylith. It looks like it doesn’t. I’m using a test-resources folder with the extra-paths configuration, as you mentioned. Thanks!

seancorfield04:10:47

No, I don't think there's a standard place for test-only resources.

seancorfield04:10:08

I think I would probably use test-resources and :extra-paths.

👍 1