Comparing version 0.1.17 to 0.1.18
@@ -5,2 +5,4 @@ #!/usr/bin/env node | ||
import App from "./App.js"; | ||
import { clearConsole } from "./utils/helpers.js"; | ||
clearConsole(); | ||
render(React.createElement(App, null)); |
@@ -1,13 +0,7 @@ | ||
import { Box, Text, useFocus } from "ink"; | ||
import Link from "ink-link"; | ||
import { getCommandInfo } from "../utils/index.js"; | ||
import { Box, Text } from "ink"; | ||
import React from "react"; | ||
import { getCommandInfo } from "../utils/index.js"; | ||
export function CommandInfo() { | ||
useFocus({ isActive: false }); | ||
return (React.createElement(Box, { width: "100%", minHeight: 5, justifyContent: "space-between", flexWrap: "wrap" }, | ||
React.createElement(Box, { flexGrow: 3 }, | ||
React.createElement(Text, { color: "blue", bold: true }, getCommandInfo())), | ||
React.createElement(Box, { flexGrow: 1 }, | ||
React.createElement(Link, { url: "https://github.com/rubiin/asdfui" }, | ||
React.createElement(Text, { color: "magenta" }, "Github"))))); | ||
return (React.createElement(Box, { width: "100%", minHeight: 5, marginTop: 1, justifyContent: "center", flexWrap: "wrap" }, | ||
React.createElement(Text, { color: "blue", bold: true }, getCommandInfo()))); | ||
} |
@@ -76,4 +76,4 @@ import { Title } from "../components/index.js"; | ||
return (React.createElement(Box, { borderStyle: "double", borderColor: getBorderColorOnFocus(isFocused), flexDirection: "column", width: "70%", minHeight: 20, paddingLeft: 4 }, | ||
React.createElement(Title, { label: totalNumber("Versions", availableVersions.length), color: getBorderColorOnFocus(isFocused) }), | ||
React.createElement(Title, { label: totalNumber("Versions", installedVersions.length, availableVersions.length), color: getBorderColorOnFocus(isFocused) }), | ||
React.createElement(VersionsDisplay, { setSelectedVersion: handleState, isOnline: isOnline, isFocused: isFocused, isLoading: isLoading, isLocal: isLocal, versions: isLocal ? installedVersions : availableVersions, pluginName: currentlySelected.label }))); | ||
} |
@@ -77,12 +77,9 @@ import { $ } from "execa"; | ||
const sanitizedData = sanitizeData(stdout); | ||
const values = formatPluginData(sanitizedData.map((value) => value.trim().replace("*", ""))).reverse(); | ||
const globalVersion = await getGlobalVersionForTool(name); | ||
if (globalVersion) { | ||
return values.map((value) => { | ||
if (value.label === globalVersion) { | ||
value.label += " 🌎"; | ||
} | ||
return value; | ||
}); | ||
} | ||
const values = formatPluginData(sanitizedData.map((value) => { | ||
value = value.trim(); | ||
if (value.startsWith("*")) { | ||
value = value.replace("*", "") + " 🌎"; | ||
} | ||
return value; | ||
})).reverse(); | ||
return values; | ||
@@ -101,3 +98,3 @@ } | ||
}); | ||
lineReader.on(`line`, function (line) { | ||
lineReader.on("line", function (line) { | ||
if (line.includes(searchTerm)) { | ||
@@ -104,0 +101,0 @@ result = line.split(" ")[1]; |
@@ -14,4 +14,4 @@ import { BorderColor } from "../types.js"; | ||
} | ||
export function totalNumber(start, total) { | ||
return `${start} (${total})`; | ||
export function totalNumber(start, installed, available) { | ||
return available ? `${start} (${installed}/${available})` : `${start} (${installed})`; | ||
} | ||
@@ -21,1 +21,4 @@ export function getCommandInfo() { | ||
} | ||
export function clearConsole() { | ||
process.stdout.write("\x1B[2J\x1B[3J\x1B[H\x1Bc"); | ||
} |
{ | ||
"name": "asdfui", | ||
"version": "0.1.17", | ||
"version": "0.1.18", | ||
"bin": "dist/cli.js", | ||
@@ -45,3 +45,2 @@ "type": "module", | ||
"ink": "^4.4.1", | ||
"ink-link": "^3.0.0", | ||
"ink-select-input": "^5.0.0", | ||
@@ -48,0 +47,0 @@ "install": "^0.13.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
19292
429
- Removedink-link@^3.0.0
- Removedansi-escapes@5.0.0(transitive)
- Removedhas-flag@4.0.0(transitive)
- Removedink-link@3.0.0(transitive)
- Removedobject-assign@4.1.1(transitive)
- Removedprop-types@15.8.1(transitive)
- Removedreact-is@16.13.1(transitive)
- Removedsupports-color@7.2.0(transitive)
- Removedsupports-hyperlinks@2.3.0(transitive)
- Removedterminal-link@3.0.0(transitive)
- Removedtype-fest@1.4.0(transitive)