const color = @import("../base/color.zig");
const Bgra = color.Bgra; // line 2
which works, but is far from ideal.
So 2 questions:
How can I avoid using these relative paths?
Is it possible to omit this line 2? I use Bgra all over my project and would like to be able to use that one (and other base/common types) without having to explicitely refer to them in each file.
There are off course more (Rect, Point etc. etc.)
If possible without a build.zig, because that one is future work for me.
The best way is to organize everything like std.
Add all the needed types in a file (e.g. src/my.zig) and expose it as a module (e.g. my).
In build.zig:
Ok thanks I will create a build.zig and check out if that works.
One more question: I added once an emty build.zig and then it formats my code on save, while this option was off in the ‘Zig Language’ extension in vscode.
Is there a way to avoid that?
(I am firmly against asymmetrical formatting of braces)