polylith

msolli 2024-11-29T08:10:54.421339Z

Morning! Day 2 of Polylith - new question: Whenever I create a new project, the generated deps.edn file includes Clojure version 1.11.1. I'd like it to be 1.12.0. Is this configurable somehow?

2024-12-02T12:04:08.177559Z

The code looks good as far as I can tell. Proposed change sounds useful for power users of Polylith. I am mostly working in one (big) project and I haven't been bothered by the current defaults. But some customization options for brick scaffolding could be nice!

seancorfield 2024-11-29T16:12:26.188649Z

Not as far as I know. The templating system behind the create command is a bit basic. I'd certainly like more control over it.

imre 2024-11-29T18:07:17.935879Z

Pr to poly?

seancorfield 2024-11-29T18:07:51.407649Z

Haha... yeah, in my copious free time... 🙂

imre 2024-11-29T18:19:30.577709Z

I didnt mean you

🤣 1
imre 2024-11-29T18:31:59.007499Z

I meant bumping the clj version in the templates shpuldnt be too hard I'm guessing

seancorfield 2024-11-29T18:32:35.461769Z

It's all hard-coded into the creator component right now. Changing the default version would be easy but really folks want more control over what goes into each part.

seancorfield 2024-11-29T18:40:58.696729Z

I'd like to have new source/test files contain a copyright message. I'd want to be able to suppress creation of resources by default. I'd prefer several different things in test files (requiring the source ns :as sut, using a different testing library by default, etc). Basically, I'd want to be able to provide Selmer-style templates for most files. I'd have to think about what the design of it should look like, and how you could provide per-workspace templates (and override global too, perhaps). So, some of it would be workspace.edn config and some would be per-`create` command override maybe. Maybe modeled after deps-new (which leverages tools.build for all of this).

imre 2024-11-29T18:42:04.859829Z

Thosr sound like great improvements actually

imre 2024-11-29T18:42:26.186759Z

Couldn't poly leverage deps-new as a lib?

seancorfield 2024-11-29T18:43:29.965269Z

It could just leverage tools.build directly, TBH. deps-new is a fairly thin wrapper that provides a CLI for vars to substitute and some programmatic extension points (which poly wouldn't need).

seancorfield 2024-11-29T18:44:38.904749Z

But tools.build requires files on the filesystem rather than resources in a JAR so I think explicit Selmer usage would be better so you could rely on the classpath instead.

seancorfield 2024-11-29T18:46:17.387309Z

(although, given how simple Polylith's current file "templates" are, just strings in code as defaults would also work with Selmer)

seancorfield 2024-11-29T18:46:49.378269Z

I'll give it some thought...

seancorfield 2024-11-29T18:58:17.675439Z

For consideration and feedback: https://github.com/polyfy/polylith/issues/516

seancorfield 2024-11-30T05:13:01.110629Z

@msolli See the main channel for a PR I submitted to update Polylith to default to Clojure 1.12.0.

seancorfield 2024-11-30T20:05:24.801519Z

And a first cut PR for using Selmer templates for the create commands: https://github.com/polyfy/polylith/pull/520 -- feedback welcome!

👍 1