This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-10-16
Channels
- # aleph (73)
- # babashka (12)
- # beginners (17)
- # calva (9)
- # clerk (8)
- # clj-otel (1)
- # clojars (8)
- # clojure (3)
- # clojure-europe (13)
- # clojure-nl (3)
- # clojure-norway (66)
- # clojure-uk (3)
- # clojuredesign-podcast (2)
- # clojurescript (11)
- # clr (8)
- # conjure (2)
- # core-typed (1)
- # data-science (11)
- # datahike (4)
- # etaoin (5)
- # events (1)
- # graalvm (2)
- # honeysql (27)
- # hyperfiddle (26)
- # introduce-yourself (3)
- # lsp (3)
- # membrane (1)
- # off-topic (60)
- # polylith (20)
- # practicalli (4)
- # reitit (3)
- # shadow-cljs (18)
- # specter (2)
- # xtdb (1)
Hi everyone, wondering if there is a way to do the following. Maybe more of a tools deps question than polylith, but I think it might be easier to get an example here. I am trying to have a base that has extra-paths for dev/src and dev/resources folder under the dev alias of the base deps.edn. When I start the repl on the main polylith workspace though, I can't seem to get those extra-paths to work in any locally referenced bricks. I'm using the same structure as in the docs. This is the deps.edn for the base:
{:paths ["src" "resources"]
:deps {ring/ring {:mvn/version "1.10.0"}}
:aliases {:test {:extra-paths ["test"]
:extra-deps {}}
:dev {:extra-paths ["dev/src" "dev/resources"]
:extra-deps {}}}}
ThanksI guess what I'm really asking is, can I have an alias's extra deps that point to a :local/root
, also load the referenced dev alias of that dep?
closest thing i can think of is to add those paths to workspace deps.edn "bases/foo/dev/src"
Aliases are not transitive in general so an alias in a dependency (like a base) cannot be used by the project that depends on it. That's a deps limitation. The way Polylith uses :test
from a brick is... An extension, shall we say. I pretty much avoid putting anything in :test
in a brick now - just in projects.
@U04V70XH6 it's a good point. I guess I don't have a good reason for it. Going to rethink this. Maybe somewhere in the back of my mind I thought it's better not to have systems that I hardly touch running, but what you say makes me think why not. Update the ports on the web servers to be unique locally across all the bases.
Even if they're the same, you can still have one REPL -- and just start/stop each app as you work on it. They don't start automatically when you load the ns do they?
I find user.clj
to be a bit of a footgun -- it's the cause of a lot of bizarre problems people come here asking for help with 🙂
What editor are you using? Maybe hotkeys/snippets are a cleaner solution...?
The development
project can have src
files, so those wouldn't end up in projects, only in your development REPL, and you could have project setup/teardown functions in there and perhaps snippets that did ((requiring-resolve 'dev/project-setup))
etc to invoke development/src/dev.clj
's functions
Thank you @U04V70XH6 I'm going to dig back in an rethink this setup now
> "Sometimes we need to perform some test setup/teardown before and after we execute the tests for a project. If any code is used by more than one project, we can put it in a separate component," https://polylith.gitbook.io/poly/workflow/testing Would the setup & teardown go in ./components/new-component-test-deps/src or ./components/new-component-test-deps/test/src ? If its the former, bit concerned test deps are in my build, if its the latter, should I add ./components/new-component-test-deps/test/src to each project's :test alias?
I have a 'dangling' component , its not in workspace deps.edn, or projects main deps.edn, but rather its in projects test deps.edn seems to work so far
This is the correct approach (and related to my comment on the other thread).
Note: if you run poly test :dev
(which is rare), you might need those deps in the workspace deps.edn
as well as other project deps.edn
- remember that development is "just" another project.