Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/template v2 #278

Open
brumhard opened this issue May 12, 2023 · 1 comment
Open

go/template v2 #278

brumhard opened this issue May 12, 2023 · 1 comment

Comments

@brumhard
Copy link
Contributor

go/template v2

So after around 1,5 years of using go/template we see some room for improvement in several parts.

context

  • the project started out as a opinionated internal template
  • after open source we tried to transition to a less opinionated and more generic template and therefore minimized the folder structure etc.

Anyways, go-template currently only supports one embedded template as the source of truth and we found out that this can't support all the different requirements that arise in different projects, e.g. switching out the build tool etc or supporting a new technology.
Also there has always been this conflict between providing too much and needing to delete a lot or too few to really be relevant.

stuff that the new template engine should support

  • every feature of the old engine
  • earthly -> one file additionally replacing e.g. make
  • shared files like gitignores
  • specific library quickstarts e.g. ent
  • technology specifics like gRPC
  • prometheus, instrumentation
  • database implementation postgres
  • dummy business logic
  • CLI vs server/backend
  • completely different project architecture like pulumi provider template

envisioned/possible solutions

  • modular system (maybe gRPC plugin based like terraform/pulumi)
  • modules provide specific functionality, the exact scope will have to be defined
  • modules/plugins can be opinionated, the go-template itself should be fairly generic
  • it might be necessary that plugins have dependencies to other modules, and also to edit existing files
  • users can define what modules they want to use
  • some modules will be embedded/vendored with go-template but the system allows others to write their own modules
@brumhard
Copy link
Contributor Author

@linuxluigi already started a draft for this module system at #254. I also created an interface that I will try to implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant