You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into an issue when trying to add deps-new to Kit. The idea is to share the same base files so we can support both deps-new and clj-new with minimal duplication. I started off planning to do this:
base-template: shared template files
deps-template: new deps-new implementation
lein-template: existing clj-new implementation
In this scenario the base-template would be shared by both deps-template and lein-template. The deps-template would just have a template.edn file and the processing functions to implement the logic on top of the base files.
However, when I tried to implement this, I ran into a limitation with deps-new: it only supports one root directory per template, so any dependencies were not being included as part of the template, even with the same resource path (resources/io/github/kit_clj/kit). For now I'm just going to have lein-template depend directly on deps-template since clj-new doesn't have the same restriction.
Would it make sense to support multiple roots for a single template? Is there a better workaround I'm not thinking of? Maybe this is too specific to Kit and not worth supporting in general?
(This is kind of related to #27 but I think this problem is more narrow in scope. For splitting templates into multiple libraries, simply merging the roots together could be an option without having composition of templates.)
The text was updated successfully, but these errors were encountered:
rads
changed the title
Support loading template files through deps
Support loading template files through multiple deps
Aug 9, 2022
root is only special in that it's a default location that is copied to the "root" of the new project. You can specify any number of additional folders and also have them copy to that project "root" if that's what you need.
As for sharing a template between deps-new and lein-template -- someone has already done that... I can't remember who right now or for which project but I'll try to dig up that conversation.
I ran into an issue when trying to add deps-new to Kit. The idea is to share the same base files so we can support both deps-new and clj-new with minimal duplication. I started off planning to do this:
base-template
: shared template filesdeps-template
: new deps-new implementationlein-template
: existing clj-new implementationIn this scenario the
base-template
would be shared by bothdeps-template
andlein-template
. Thedeps-template
would just have atemplate.edn
file and the processing functions to implement the logic on top of the base files.However, when I tried to implement this, I ran into a limitation with deps-new: it only supports one root directory per template, so any dependencies were not being included as part of the template, even with the same resource path (
resources/io/github/kit_clj/kit
). For now I'm just going to havelein-template
depend directly ondeps-template
since clj-new doesn't have the same restriction.Would it make sense to support multiple roots for a single template? Is there a better workaround I'm not thinking of? Maybe this is too specific to Kit and not worth supporting in general?
(This is kind of related to #27 but I think this problem is more narrow in scope. For splitting templates into multiple libraries, simply merging the roots together could be an option without having composition of templates.)
The text was updated successfully, but these errors were encountered: