zcatui/build.zig
reugenio 4d27a7b13d Add readline-style Input widget with history support
New widget: src/widgets/input.zig
- Basic editing (insert, delete, backspace)
- Cursor movement (home, end, left, right)
- Word navigation (Ctrl+Left/Right, Ctrl+B/F)
- Kill/yank operations (Ctrl+K, Ctrl+U, Ctrl+Y)
- Delete word (Ctrl+W)
- History navigation (Up/Down arrows)
- Unicode support (UTF-8 encoding)
- Password masking support

New example: examples/input_demo.zig
- Interactive demo with normal and password inputs
- Tab to switch focus between inputs
- Shows submitted values in message log

Run with: zig build input-demo

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 13:26:56 +01:00

140 lines
4.6 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);
// Ejemplo: input_demo
const input_demo_exe = b.addExecutable(.{
.name = "input-demo",
.root_module = b.createModule(.{
.root_source_file = b.path("examples/input_demo.zig"),
.target = target,
.optimize = optimize,
.imports = &.{
.{ .name = "zcatui", .module = zcatui_mod },
},
}),
});
b.installArtifact(input_demo_exe);
const run_input_demo = b.addRunArtifact(input_demo_exe);
run_input_demo.step.dependOn(b.getInstallStep());
const input_demo_step = b.step("input-demo", "Run input demo");
input_demo_step.dependOn(&run_input_demo.step);
}