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

Publish templating system? #2

Open
Brendonovich opened this issue Mar 4, 2023 · 4 comments
Open

Publish templating system? #2

Brendonovich opened this issue Mar 4, 2023 · 4 comments

Comments

@Brendonovich
Copy link

Hey Otto, love what you've done here! The template_builder crate is particularly cool imo, I've been wanting something similar but have always made it too complex or just not been bothered. Different files per combination of features isn't quite as granular as I would ultimately want, but hey if it does the job then I'm down for it.
It'd be great to use in create-rspc-app and probably many more projects, would you be down to get it published? I can lend some time if necessary.

@Brendonovich Brendonovich changed the title Separate templating system into independent crate? Publish templating system? Mar 4, 2023
@ottomated
Copy link
Owner

Actually, this entire package besides the tests are template-agnostic -- it should be quite easy to re-configure it for different projects. What would be the best way to publish it, do you think?

@Brendonovich
Copy link
Author

Getting the templating library onto crates.io would be a good start, but it'd be nice to replace the codegen system with some macros + traits so that rust can be the source of truth for all the features - not sure if that's a design goal of yours though.
It'd also be nice to use include_dir to embed all the templates into the resulting binary - no need to walk any directories that way!

@ottomated
Copy link
Owner

  • I don't see a good reason to rewrite the entire working system just to make rust the source of truth
  • include_dir is not going to be possible. It needs to read their file names at compile-time.

@Brendonovich
Copy link
Author

I don't see a good reason to rewrite the entire working system just to make rust the source of truth

fairo

include_dir is not going to be possible. It needs to read their file names at compile-time

It probs wouldn't work without adopting macros anyway. I might implement it myself but dir walking can do the job.

Only necessary change I think you'd need would be for the template directory to be customisable via Builder so that the templates don't have to be located at template_builder/templates. That and a name change should suffice for publishing template_builder, but from your wording it sounds like a layer of the CLI could be published separately too - maybe an opportunity for a create-create-app? 😅

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

2 participants