Liza: Zig codebase initializer

Hi everyone!

I’ve been reusing a few Zig project patterns when staring a new repo, so I decided to combine them into a “templated” alternative to zig init.

For instance, you can initialize an executable project with 4 positional arguments like this:
zig build exe -- repo-name "Repository description." userhandle "User Name"

Also, you can choose the codebase template (exe, lib, or prt) with -c named argument (default is exe) and/or specify the version with -v (default is 0.1.0).

Btw, you’ll see a panic if a directory of the same name already exists.

Hope you find it useful! Feedback and questions are welcome as always!

10 Likes

Great name - Liza, haha. I will definitely give this a star when I get signed in after work.

1 Like

I think it’s really cool, If I may give one suggestion, it would be to add to the .gitignore, also rules for everything related to C and C dependency, as Zig is meant to be used with C/C libraries.

1 Like

Thanks!

Well, the only C-related files that makes sense to put in a .gitignore are the compiled ones, like pre-compiled headers, static/shared libraries and executables. But I’ve never seen those in a .gitignore file belonging to a Zig codebase and for a good reason – every compiled C or Zig file is meant to end up in zig-out/. That’s why the current .gitignore is already exhaustive for a standard Zig project.

3 Likes

Added a Zig port template for packaging C codebases like the ones @allyoucodebase. Btw, how can someone maintain a codebase there? I could contribute this one.

Really cool. I somehow did not know up until now that you could download the sources from a repo that doesn’t contain a build.zig/build.zig.zon using Zig’s package manager…

1 Like

I’ve invited you to the organization, feel free to move over any C project that you deem appropriate.

There is no specific procedure to invite people to the org yet.

1 Like