New examples: - list_demo.zig: Interactive list with j/k navigation - table_demo.zig: Table with row selection and status colors - dashboard.zig: Multi-widget demo (Tabs, Gauges, Sparklines, List) Also includes: - build.zig: Added build targets for all new examples - table.zig: Fixed Cell.content default, HighlightSpacing check, ColumnPos type Run with: zig build list-demo / table-demo / dashboard 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
121 lines
4 KiB
Zig
121 lines
4 KiB
Zig
const std = @import("std");
|
|
|
|
pub fn build(b: *std.Build) void {
|
|
const target = b.standardTargetOptions(.{});
|
|
const optimize = b.standardOptimizeOption(.{});
|
|
|
|
// Módulo de la librería
|
|
const zcatui_mod = b.createModule(.{
|
|
.root_source_file = b.path("src/root.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
});
|
|
|
|
// Tests
|
|
const unit_tests = b.addTest(.{
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("src/root.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
}),
|
|
});
|
|
|
|
const run_unit_tests = b.addRunArtifact(unit_tests);
|
|
const test_step = b.step("test", "Ejecutar tests");
|
|
test_step.dependOn(&run_unit_tests.step);
|
|
|
|
// Ejemplo: hello
|
|
const hello_exe = b.addExecutable(.{
|
|
.name = "hello",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/hello.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(hello_exe);
|
|
|
|
const run_hello = b.addRunArtifact(hello_exe);
|
|
run_hello.step.dependOn(b.getInstallStep());
|
|
const hello_step = b.step("hello", "Ejecutar ejemplo hello");
|
|
hello_step.dependOn(&run_hello.step);
|
|
|
|
// Ejemplo: events_demo
|
|
const events_demo_exe = b.addExecutable(.{
|
|
.name = "events-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/events_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(events_demo_exe);
|
|
|
|
const run_events_demo = b.addRunArtifact(events_demo_exe);
|
|
run_events_demo.step.dependOn(b.getInstallStep());
|
|
const events_demo_step = b.step("events-demo", "Run events demo");
|
|
events_demo_step.dependOn(&run_events_demo.step);
|
|
|
|
// Ejemplo: list_demo
|
|
const list_demo_exe = b.addExecutable(.{
|
|
.name = "list-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/list_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(list_demo_exe);
|
|
|
|
const run_list_demo = b.addRunArtifact(list_demo_exe);
|
|
run_list_demo.step.dependOn(b.getInstallStep());
|
|
const list_demo_step = b.step("list-demo", "Run list demo");
|
|
list_demo_step.dependOn(&run_list_demo.step);
|
|
|
|
// Ejemplo: table_demo
|
|
const table_demo_exe = b.addExecutable(.{
|
|
.name = "table-demo",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/table_demo.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(table_demo_exe);
|
|
|
|
const run_table_demo = b.addRunArtifact(table_demo_exe);
|
|
run_table_demo.step.dependOn(b.getInstallStep());
|
|
const table_demo_step = b.step("table-demo", "Run table demo");
|
|
table_demo_step.dependOn(&run_table_demo.step);
|
|
|
|
// Ejemplo: dashboard
|
|
const dashboard_exe = b.addExecutable(.{
|
|
.name = "dashboard",
|
|
.root_module = b.createModule(.{
|
|
.root_source_file = b.path("examples/dashboard.zig"),
|
|
.target = target,
|
|
.optimize = optimize,
|
|
.imports = &.{
|
|
.{ .name = "zcatui", .module = zcatui_mod },
|
|
},
|
|
}),
|
|
});
|
|
b.installArtifact(dashboard_exe);
|
|
|
|
const run_dashboard = b.addRunArtifact(dashboard_exe);
|
|
run_dashboard.step.dependOn(b.getInstallStep());
|
|
const dashboard_step = b.step("dashboard", "Run dashboard demo");
|
|
dashboard_step.dependOn(&run_dashboard.step);
|
|
}
|