build-targets.ts
This file
Path
apps/cli/build-targets.ts
27 lines · 694 bytes · TypeScript
Last changed by
Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
History of this fileTake it
Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042
lines 1–25why, one step back1import { Option } from "effect";23export interface NpmMachine {4 readonly cpu: string;5 readonly os: string;6}78const OS = new Map([9 ["darwin", "darwin"],10 ["linux", "linux"],11 ["windows", "win32"],12]);1314const CPU = new Set(["arm64", "x64"]);1516export const npmMachineOf = (target: string): Option.Option<NpmMachine> => {17 const [os, cpu] = target.replace(/^bun-/u, "").split("-");1819 return Option.flatMap(Option.fromUndefinedOr(OS.get(os ?? "")), (npmOs) =>20 cpu !== undefined && CPU.has(cpu)21 ? Option.some({ cpu, os: npmOs })22 : Option.none()23 );24};25Merge build/comments-cli-protocol-checks into mainoscabrielbefore adoptionc86204f
line 26why, one step back26// OpenTUI loads its native library from `@opentui/core-<os>-<cpu>`.Close W7: cross-compile the release again, guard pi's edits, and keep the swarm out of this checkoutoscabrielbefore adoption842f042
line 27why, one step back27export const NATIVE = ["@opentui/core"] as const;