aboutsummaryrefslogtreecommitdiff
path: root/lib/init/src/root.zig
AgeCommit message (Collapse)Author
2025-08-08std.Io: remove BufferedWriterAndrew Kelley
2025-07-07std.fmt: breaking API changesAndrew Kelley
added adapter to AnyWriter and GenericWriter to help bridge the gap between old and new API make std.testing.expectFmt work at compile-time std.fmt no longer has a dependency on std.unicode. Formatted printing was never properly unicode-aware. Now it no longer pretends to be. Breakage/deprecations: * std.fs.File.reader -> std.fs.File.deprecatedReader * std.fs.File.writer -> std.fs.File.deprecatedWriter * std.io.GenericReader -> std.io.Reader * std.io.GenericWriter -> std.io.Writer * std.io.AnyReader -> std.io.Reader * std.io.AnyWriter -> std.io.Writer * std.fmt.format -> std.fmt.deprecatedFormat * std.fmt.fmtSliceEscapeLower -> std.ascii.hexEscape * std.fmt.fmtSliceEscapeUpper -> std.ascii.hexEscape * std.fmt.fmtSliceHexLower -> {x} * std.fmt.fmtSliceHexUpper -> {X} * std.fmt.fmtIntSizeDec -> {B} * std.fmt.fmtIntSizeBin -> {Bi} * std.fmt.fmtDuration -> {D} * std.fmt.fmtDurationSigned -> {D} * {} -> {f} when there is a format method * format method signature - anytype -> *std.io.Writer - inferred error set -> error{WriteFailed} - options -> (deleted) * std.fmt.Formatted - now takes context type explicitly - no fmt string
2025-07-07std.io: move getStdIn, getStdOut, getStdErr functions to fs.FileAndrew Kelley
preparing to rearrange std.io namespace into an interface how to upgrade: std.io.getStdIn() -> std.fs.File.stdin() std.io.getStdOut() -> std.fs.File.stdout() std.io.getStdErr() -> std.fs.File.stderr()
2025-06-13zig init: simplify templating logic (#24170)Loris Cro
and also rename `advancedPrint` to `bufferedPrint` in the zig init templates These are left overs from my previous changes to zig init. The new templating system removes LITNAME because the new restrictions on package names make it redundant with NAME, and the use of underscores for marking templated identifiers lets us template variable names while still keeping zig fmt happy.
2025-06-02zig init: add new --strip flag and improve template filesLoris Cro
This commit introduces a new flag to generate a new Zig project using `zig init` without comments for users who are already familiar with the Zig build system. Additionally, the generated files are now different. Previously we would generate a set of files that defined a static library and an executable, which real-life experience has shown to cause confusion to newcomers. The new template generates one Zig module and one executable both in order to accommodate the two most common use cases, but also to suggest that a library could use a CLI tool (e.g. a parser library could use a CLI tool that provides syntax checking) and vice-versa a CLI tool might want to expose its core functionality as a Zig module. All references to C interoperability are removed from the template under the assumption that if you're tall enough to do C interop, you're also tall enough to find your way around the build system. Experienced users will still be able to use the current template and adapt it with minimal changes in order to perform more advanced operations. As an example, one only needs to change `b.addExecutable` to `b.addLibrary` to switch from generating an executable to a dynamic (or static) library.
2024-12-18init template: expand slightly, migrate from deprecated std.Build APIsmlugg
2024-07-26Fix typo in init files.Karim Mk
2024-07-26update init templateAndrew Kelley
* add fuzz example * explain that you might want to delete main.zig or root.zig
2023-11-20merge `zig init-exe` and `zig init-lib` into `zig init`Andrew Kelley
Instead of `zig init-lib` and `zig init-exe`, now there is only `zig init`, which initializes any of the template files that do not already exist, and makes a package that contains both an executable and a static library. The idea is that the user can delete whatever they don't want. In fact, I think even more things should be added to the build.zig template.