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

Proposal: Enhancing zigup with Targeted Init Commands and Remote Template Fetching #163

Open
pierrelgol opened this issue Jan 19, 2025 · 0 comments

Comments

@pierrelgol
Copy link
Contributor

I'm not entirely certain this feature falls within the project's current scope or what its implementation complexity might be. However, with Zig 0.13, the zig init command generates all necessary files and content to bootstrap a project but it also includes extraneous comments and boilerplate that must be manually removed. I preferred the previous approach where one specified either a library or an executable explicitly.

This leads to my suggestion: what if zigup offered additional commands, such as init-exe and init-lib, to emulate the earlier, more targeted initialization methods? This enhancement would be valuable on its own, and it could be extended further. For instance, much like the zig fetch --save command adds a package to a project's configuration, a similar mechanism could be implemented for project templates.

Imagine you have developed a wrapper around raylib, and you wish to provide an effortless way for users to kickstart their projects with your library. You could host a repository (or another appropriate format) containing the template. Users could then execute a command like:

zigup init --fetch https://github.com/Foo/RaylibZigTemplate/

This command would clone the repository and set up the directory and file structure exactly as defined by the template. Maybe the template fetching is too complicated, as such another idea was to have a directory tied to zigup, let's say .zigup-init somewhere that zigup is aware of. in this folder, you can create folder like exe/ and put all the files you want, and when you do zigup init-exe it simply copy paste the content of your exe folder in your current directory ?

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