create-o7-app icon indicating copy to clipboard operation
create-o7-app copied to clipboard

Publish templating system?

Open Brendonovich opened this issue 2 years ago • 4 comments

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 avatar Mar 04 '23 05:03 Brendonovich

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?

ottomated avatar Mar 04 '23 23:03 ottomated

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!

Brendonovich avatar Mar 05 '23 02:03 Brendonovich

  • 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.

ottomated avatar Mar 05 '23 04:03 ottomated

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? 😅

Brendonovich avatar Mar 05 '23 05:03 Brendonovich