diff --git a/src/checkVersion.ts b/src/checkVersion.ts index d8795e0..f89ebcf 100644 --- a/src/checkVersion.ts +++ b/src/checkVersion.ts @@ -1,6 +1,6 @@ import boxen from "boxen"; import chalk from "chalk"; -import { version } from "../package.json"; +import pkg from "../package.json" with { type: "json" }; import semver from "semver"; async function checkProductionCLIVersion() { @@ -21,6 +21,7 @@ async function checkProductionCLIVersion() { } export async function checkVersion() { + const version = pkg.version; const latestVersion = await checkProductionCLIVersion(); if (latestVersion && version !== latestVersion) { const isOutdated = semver.lt(version, latestVersion); diff --git a/src/index.ts b/src/index.ts index 246cf5f..2478fc0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ #!/usr/bin/env bun import { Command } from "commander"; -import { version } from "../package.json" with { type: "json" }; +import pkg from "../package.json" with { type: "json" }; import { registerBalance } from "./lib/balance.ts"; import { registerBuy } from "./lib/buy/index.tsx"; import { registerContracts } from "./lib/contracts/index.tsx"; @@ -23,7 +23,7 @@ await checkVersion(); program .name("sf") .description("The San Francisco Compute command line tool.") - .version(version); + .version(pkg.version); // commands registerLogin(program); @@ -42,4 +42,4 @@ registerDown(program); // (development commands) registerDev(program); -program.parse(Bun.argv); +program.parse(process.argv); diff --git a/src/lib/buy/index.tsx b/src/lib/buy/index.tsx index 85c0e12..f2642f2 100644 --- a/src/lib/buy/index.tsx +++ b/src/lib/buy/index.tsx @@ -18,6 +18,7 @@ import TextInput from "ink-text-input"; import { useCallback, useEffect, useState } from "react"; import { Text } from "ink"; import ConfirmInput from "../ConfirmInput.tsx"; +import React from 'react' dayjs.extend(relativeTime); dayjs.extend(duration); diff --git a/src/lib/dev.ts b/src/lib/dev.ts index 9669db6..a5ca6cd 100644 --- a/src/lib/dev.ts +++ b/src/lib/dev.ts @@ -2,7 +2,7 @@ import { confirm } from "@inquirer/prompts"; import chalk from "chalk"; import type { Command } from "commander"; import dayjs from "npm:dayjs@1.11.13"; -import utc from "npm:dayjs@1.11.13/plugin/utc"; +import utc from "npm:dayjs@1.11.13/plugin/utc.js"; import { deleteConfig, getConfigPath, @@ -120,9 +120,9 @@ function registerEpoch(program: Command) { timestamps.forEach((epochTimestamp, i) => { const date = epochToDate(Number.parseInt(epochTimestamp)); console.log( - `${colorDiffedEpochs[i]} | ${ - chalk.yellow(dayjs(date).format("hh:mm A MM-DD-YYYY")) - } Local`, + `${colorDiffedEpochs[i]} | ${chalk.yellow( + dayjs(date).format("hh:mm A MM-DD-YYYY"), + )} Local`, ); }); }