UNPKG

rune

Version:

CLI to upload your games to Rune

30 lines (29 loc) 1.99 kB
import { Text } from "ink"; import React from "react"; import { Create } from "../flows/Create.js"; import { DuskToRune } from "../flows/DuskToRune.js"; import { List } from "../flows/List/List.js"; import { Logout } from "../flows/Logout.js"; import { OpenDashboard } from "../flows/OpenDashboard.js"; import { Update } from "../flows/Update/Update.js"; import { UpdateMembers } from "../flows/UpdateMembers/UpdateMembers.js"; import { Upload } from "../flows/Upload/Upload.js"; import { cliCommand, cli } from "../lib/cli.js"; import { packageJson } from "../lib/packageJson.js"; import { LoginGate } from "./LoginGate.js"; import { VersionCheckGate } from "./VersionCheckGate.js"; export function App() { const { command, args, commandInvalid, flags } = cliCommand(); if (commandInvalid) { return React.createElement(Text, { color: "red" }, "Invalid command `", command, "`"); } return (React.createElement(React.Fragment, null, React.createElement(Text, { color: "green" }, "\uD83D\uDE80 You can now use `npx rune@latest ", command, "`"), React.createElement(VersionCheckGate, null, cli.flags.version ? (React.createElement(Text, null, packageJson.version)) : !command || command === "help" ? (React.createElement(Text, null, cli.help)) : command === "logout" ? (React.createElement(Logout, null)) : command === "dusk-to-rune" ? (React.createElement(DuskToRune, { args: args })) : command === "create" ? (React.createElement(Create, { args: args })) : (React.createElement(LoginGate, null, command === "list" ? (React.createElement(List, null)) : command === "upload" ? (React.createElement(Upload, { flags: flags })) : command === "update-info" ? (React.createElement(Update, { args: args })) : command === "update-members" ? (React.createElement(UpdateMembers, null)) : command === "dashboard" || command === "dash" ? (React.createElement(OpenDashboard, null)) : null))))); }