Skip to content

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

@pierrelgol

Description

@pierrelgol

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 ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions