Files
scriptc/benchmarks/builds/inventory-report/render.ts
Chris Tate 0845c7ff56 Make native installs portable and smaller (#599)
* Make native installs portable and smaller

- Support glibc 2.34 with portable compiler binaries and static LLVM helpers.
- Bundle the host runtime and discover optional cross-target packs from project dependencies.
- Add application build benchmarks covering latency, executable size, and memory.

* Keep bootstrap tools available in Sandbox validation

- Isolate Zig for native compiler bootstrap and glibc entropy contracts.
- Preserve the existing toolchain scope for cache and corpus tests.

* Fix portable compiler bootstrap linking

- Keep native support objects compatible with the destination host linker.
- Resolve installed targets using the host declared by the toolchain manifest.
2026-10-01 10:46:16 -05:00

12 lines
710 B
TypeScript

import type { Category, Product } from "./types.ts";
import { money } from "./money.ts";
import { reorderUnits } from "./stock.ts";
import { revision } from "./config.ts";
export function render(groups: Category[], reorders: Product[], limit: number): string {
const lines = ["inventory report " + revision, "category,products,units,value,low_stock"];
for (const group of groups) lines.push([group.name, group.products, group.units, money(group.value), group.lowStock].join(","));
lines.push("reorder_sku,units,cost");
for (const product of reorders.slice(0, limit)) lines.push([product.sku, reorderUnits(product), money(reorderUnits(product) * product.price)].join(","));
return lines.join("\n");
}