xonecas.io
6615
Yc

yoctoselect / commit 91dcc5b

docs: add bun/bunx convention and improve demo scrolling example

- AGENTS.md: add rule to use bun for everything including bunx over npx
- examples/demo.ts: replace basic overflow test with 50-item scrollable
  list using rich items, maxVisible=8, and descriptive hint text

xonecas2026-03-22 91dcc5bc7629611d6c3c5b0463139a8240463bea parent 091eae4

2 files changed

AGENTS.md+1−0
@@ -81,3 +81,4 @@ AGENTS.md
8181 - No mocks or stubs in tests
8282 - Use 16 ANSI colors only (inherited from terminal theme)
8383 - Performance first
84+- Use `bun` for everything: runtime, test runner, package manager, and `bunx` instead of `npx`
examples/demo.ts+25−5
@@ -46,12 +46,32 @@ async function main() {
4646 });
4747 console.log(`Selected model: ${model}`);
4848
49- console.log("\n=== Many items (overflow test) ===");
50- const items = Array.from(
51- { length: 30 },
52- (_, i) => `item-${String(i + 1).padStart(2, "0")}`,
49+ console.log("\n=== Scrollable list browsing ===");
50+ console.log(
51+ c.dim(" Use ↑/↓ to scroll through all 50 items, Home/End to jump\n"),
5352 );
54- const item = await select({ items, maxVisible: 5 });
53+ const colors = [
54+ "red",
55+ "orange",
56+ "yellow",
57+ "green",
58+ "blue",
59+ "indigo",
60+ "violet",
61+ ];
62+ const items = Array.from({ length: 50 }, (_, i) => {
63+ const color = colors[i % colors.length] as string;
64+ return {
65+ label: `${color}-${String(i + 1).padStart(2, "0")} ${c.dim(`shade ${i + 1}`)}`,
66+ value: `${color}-${i + 1}`,
67+ filterText: `${color} ${i + 1}`,
68+ };
69+ });
70+ const item = await select({
71+ items,
72+ maxVisible: 8,
73+ placeholder: "browse or type to filter...",
74+ });
5575 console.log(`Selected: ${item}`);
5676 }