JuliaCI / PkgTemplates.jl

Create new Julia packages, the easy way
https://juliaci.github.io/PkgTemplates.jl
MIT License
637 stars 101 forks source link

Recommend BestieTemplate instead? #478

Open gdalle opened 3 months ago

gdalle commented 3 months ago

As discussed at JuliaCon with @oxinabox and @abelsiqueira, we would like BestieTemplate.jl to become the new PkgTemplates.jl, mainly because of its update functionality (you don't have to re-create a package from scratch to get the latest features).

Should we put a big warning on the README here and redirect? That way development efforts will be focused in one place. Abel can you handle the load? Frames would that be okay with you?

oxinabox commented 3 months ago

I am yet to actually try it, so I would feel a bit funny about recommending it. But if you are satisfied then I would be happy enough

abelsiqueira commented 3 months ago

@gdalle, we are ready for the next step.

@oxinabox, we can have a slow rollout, if you prefer. E.g., announce the intention on Discourse asking for user of PkgTemplate to try Bestie, and if nothing is terrible after a few days/weeks, we proceed with the warning. It should give you time to try and decide. But I am also happy to wait, there is no rush in our side.

gdalle commented 3 months ago

I haven't tried it myself for a new package, I just went over the features with Abel. Let's wait until Frames and I have taken it out for a spin, and then we'll announce the switch

pat-alt commented 2 months ago

Moving this here from #483

@abelsiqueira I've dabbled a bit with BestieTemplate.jl and having the update functionality is definitely a huge win. Maybe I'll abuse this thread here to ask a few questions/add some thoughts:

  1. What's Bestie's equivalent to plugins?
  2. Would it be possible to move to Bestie and not completely give up on the ability to generate templates programmatically?

To elaborate a bit on (1), I've found it very easy to add functionality here since it's all Julia and the docs for devs are comprehensive. To give you a concrete example, how easy do you think it would be to contribute something like #482 to Bestie?

As for point (2), it says in Bestie's docs:

PkgTemplates.jl is a project generator. This means that if you want to programmatically create templates inside Julia, this is the best solution. The questions (user interface) are implemented by the package, which then translates that into the answers for the engine.

I think this is a great feature and it would be a shame to lose it entirely. For example, I have been trying to leverage this functionality here to add a custom package template for Taija. I've continued to work on this even after hearing about Bestie at JuliaCon, because it seemed to me like the most straightforward pure-Julia approach.

Happy to instead focus my efforts on Bestie, these are just a few questions/concerns I've had so far, so what be great to hear your thoughts :)

abelsiqueira commented 2 months ago

Hi @pat-alt, some answers while my tests are running:

  1. I think "questions" are the closest? Depends on what you want to do. Ok, I looked at the rest of the question. There are quite a few changes in #482, so the answer might be incomplete. But to add something like a conditional folder called quarto and some conditional file changes, you would need to:

    1. Create a new question in copier.yml (e.g., AddQuarto)
    2. Create the folder in template with a name like {% if AddQuarto %}quarto{% endif %}
    3. Change places like the docs GH action with a conditional like above
  2. I don't fully understand what you're doing. I am guessing the following (and correct me otherwise):

    1. You have some answers defined in Taija (the plugins) that you expect all Taija projects (or users?) will follow
    2. You have additional files that you want to include in that same template

You can accomplish 2.1 using data = Dict(q1 => a1, q2 => a2). I don't know how to achieve 2.2, but it is a desired feature because of private additions (https://github.com/abelsiqueira/BestieTemplate.jl/issues/368). I hope it is achievable, but it might involve more copier (the underlying project generator in Bestie) than Bestie. I'm happy to discuss more.

Let me know if the answers make sense or if you need more details.

pat-alt commented 2 months ago

Thanks a lot for the quick response @abelsiqueira, this all makes sense! I'll come back to this as soon as I can.