Hi, apologise in advance, but I was looking at another thread (One Zig folder to store them all?) and add a couple of ideas that I decided not to put in that specific thread, but to create a new one.
This is mostly how zig init
behaves, and again apologise if any of these “ways” already exist, since my time so far with zig has been short.
Currently to create a new project, running zig init
:
mkdir foo
cd foo
zig init
I would change it to (I think is more intuitive):
zig init foo
cd foo
or (less intuitive)
zig init --name foo
cd foo
To use it on existing folder:
cd foo
zig init .
Also I would say that doing these steps would be helpful:
-
running
git init
automatically afterzig init
. This also could be avoided by adding a flag to not create a git repo (or any other VCS), something like--no-git
or--no-vcs
, but having it has a default is a good option. -
also generating a README.md with a simple title and description like
# foo
This project is built with Zig, please run `zig build run` or zig build test`, for more information go to https://ziglang.org/ or https://ziglang.org/documentation/master/ or https://ziggit.dev
-
I would also add .gitignore files with content specific to ignore .zig-cache and zig-out, and probably ignore some other generated files that we usually care. Probably taking a look at gitignore.io - Create Useful .gitignore Files For Your Project, but I’m sure most people where know what to ignore.
-
a LICENSE file that could have a default “license”, MIT or whataver, all could be specific and change by passing flags
-
a
.vscode/extensions.json
with something like:
{
"recommendations": [
"ziglang.vscode-zig",
]
}
this would would recommend, the “best of the best of the best” extension for Zig, useful for new zig users.
Probably there’s more stuff… just some ideas. Some of them assume people use vscode, probably because most do, and I’m not excluding others, but all of those could have some nice defaults with the ability to set something difference by using some base configuration, envs or flags.