chore: remove some trivial usage of usingnamespace (#17268)

This commit is contained in:
chloe caruso
2025-02-11 19:38:52 -08:00
committed by GitHub
parent e22c6c5dbe
commit 2b97d61deb
47 changed files with 458 additions and 763 deletions

View File

@@ -429,7 +429,7 @@ pub fn addBunObject(b: *Build, opts: *BunBuildOptions) *Compile {
.name = if (opts.optimize == .Debug) "bun-debug" else "bun",
.root_source_file = switch (opts.os) {
.wasm => b.path("root_wasm.zig"),
else => b.path("root.zig"),
else => b.path("src/main.zig"),
// else => b.path("root_css.zig"),
},
.target = opts.target,
@@ -519,16 +519,6 @@ fn exists(path: []const u8) bool {
fn addInternalPackages(b: *Build, obj: *Compile, opts: *BunBuildOptions) void {
const os = opts.os;
const io_path = switch (os) {
.mac => "src/io/io_darwin.zig",
.linux => "src/io/io_linux.zig",
.windows => "src/io/io_windows.zig",
else => "src/io/io_stub.zig",
};
obj.root_module.addAnonymousImport("async_io", .{
.root_source_file = b.path(io_path),
});
const zlib_internal_path = switch (os) {
.windows => "src/deps/zlib.win32.zig",
.linux, .mac => "src/deps/zlib.posix.zig",
@@ -598,6 +588,15 @@ fn addInternalPackages(b: *Build, obj: *Compile, opts: *BunBuildOptions) void {
});
}
}
inline for (.{
.{ .import = "completions-bash", .file = b.path("completions/bun.bash") },
.{ .import = "completions-zsh", .file = b.path("completions/bun.zsh") },
.{ .import = "completions-fish", .file = b.path("completions/bun.fish") },
}) |entry| {
obj.root_module.addAnonymousImport(entry.import, .{
.root_source_file = entry.file,
});
}
if (os == .windows) {
obj.root_module.addAnonymousImport("bun_shim_impl.exe", .{