A Docker-like CLI and HTTP API for managing headless VMs

fix: reorganize imports and improve formatting in images.ts

+4 -5
+4 -5
src/subcommands/images.ts
··· 4 import utc from "dayjs/plugin/utc.js"; 5 import { Effect, pipe } from "effect"; 6 import type { Image } from "../db.ts"; 7 - import { type DbError, listImages } from "../images.ts"; 8 import { humanFileSize } from "../utils.ts"; 9 10 dayjs.extend(relativeTime); ··· 12 13 const createTable = () => 14 Effect.succeed( 15 - new Table( 16 - ["REPOSITORY", "TAG", "IMAGE ID", "CREATED", "SIZE"], 17 - ), 18 ); 19 20 const populateTable = (table: Table, images: Image[]) => ··· 47 Effect.all([listImages(), createTable()]), 48 Effect.flatMap(([images, table]) => populateTable(table, images)), 49 Effect.flatMap(displayTable), 50 - Effect.catchAll(handleError), 51 ); 52 53 export default async function () {
··· 4 import utc from "dayjs/plugin/utc.js"; 5 import { Effect, pipe } from "effect"; 6 import type { Image } from "../db.ts"; 7 + import { DbError } from "../errors.ts"; 8 + import { listImages } from "../images.ts"; 9 import { humanFileSize } from "../utils.ts"; 10 11 dayjs.extend(relativeTime); ··· 13 14 const createTable = () => 15 Effect.succeed( 16 + new Table(["REPOSITORY", "TAG", "IMAGE ID", "CREATED", "SIZE"]) 17 ); 18 19 const populateTable = (table: Table, images: Image[]) => ··· 46 Effect.all([listImages(), createTable()]), 47 Effect.flatMap(([images, table]) => populateTable(table, images)), 48 Effect.flatMap(displayTable), 49 + Effect.catchAll(handleError) 50 ); 51 52 export default async function () {