-
I would like to create separate modules which provide their own ui. These will then be aggregated and consumed by a couple different apps which mainly focus on the orchestration of a select few modules. If possible, I would like to avoid checking in the generated code to the modules' repo. Instead, it would be preferred to generate all of the code for the primary app's dependencies during it's CI/CD process. Is there a known/preferred way to do this, or even a reason not to do this and an alternative approach? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Hi, thanks for the question. Personally I haven't considered this, I always commit my generated code, as is best practice in general for go modules. I have been thinking of this and haven't thought of a good solution for you, as the go module system doesn't really support extra build steps just for deps. In short I think you would be taking on a lot of complexity just to keep generated files out of your repo. |
Beta Was this translation helpful? Give feedback.
-
@mattd-cg I created a component library for Templ for personal use. The problems are as you defined. Go get will download the project but you are unable to generate the templates can use them. I tried to compile and upload and it would not find the functions. So I have moved to a git submodule. Is this ideal? nope but it works. Just remove the go.mod and go.sum files and let them become part of your project. I want to see if I can make a script that will check the go.mod for dependencies and review all the directories for *.templ files. If it finds them, templ generate. Then see if I can find the components in my project. |
Beta Was this translation helpful? Give feedback.
Hi, thanks for the question. Personally I haven't considered this, I always commit my generated code, as is best practice in general for go modules.
I have been thinking of this and haven't thought of a good solution for you, as the go module system doesn't really support extra build steps just for deps.
In short I think you would be taking on a lot of complexity just to keep generated files out of your repo.