shipthis
Version:
ShipThis manages building and uploading your Godot games to the App Store and Google Play.
91 lines (88 loc) • 3.24 kB
JavaScript
import { jsxs, jsx } from 'react/jsx-runtime';
import { Flags } from '@oclif/core';
import { render, Box, Text } from 'ink';
import { g as getProjects, c as getShortDate } from '../../baseCommand-CTn3KGH3.js';
import { B as BaseAuthenticatedCommand, g as getShortUUID } from '../../baseGameCommand-8VL7xe-O.js';
import 'node:fs';
import 'node:path';
import 'chalk';
import 'ink-spinner';
import { T as Table } from '../../Table-FaNgpyeq.js';
import 'react';
import '@tanstack/react-query';
import 'axios';
import 'luxon';
import 'fast-glob';
import 'uuid';
import 'yazl';
import 'socket.io-client';
import 'fullscreen-ink';
import 'string-length';
import 'strip-ansi';
import 'open';
import '@inkjs/ui';
import 'marked';
import 'marked-terminal';
import 'qrcode';
import { C as Command } from '../../Command-Cj6F5B5a.js';
import 'crypto-js';
import '@expo/apple-utils/build/index.js';
import 'node:crypto';
import 'node:readline';
import 'node:url';
import 'readline-sync';
import 'isomorphic-git';
import 'deepmerge';
import 'ini';
import 'fs';
import 'path';
class GameList extends BaseAuthenticatedCommand {
static args = {};
static description = "Shows a list of all your games.";
static examples = ["<%= config.bin %> <%= command.id %>"];
static flags = {
order: Flags.string({
char: "r",
default: "desc",
description: "The order to sort by",
options: ["asc", "desc"]
}),
orderBy: Flags.string({
char: "o",
default: "createdAt",
description: "The field to order by",
options: ["createdAt", "updatedAt", "name"]
}),
pageNumber: Flags.integer({ char: "p", default: 0, description: "The page number to show (starts at 0)" }),
pageSize: Flags.integer({ char: "s", default: 10, description: "The number of items to show per page" })
};
async run() {
const { flags } = this;
const params = flags;
const gameListResponse = await getProjects(params);
const data = gameListResponse.data.map((game) => {
const item = {};
item.id = getShortUUID(game.id);
item.name = game.name;
item.createdAt = getShortDate(game.createdAt);
return item;
});
render(
/* @__PURE__ */ jsxs(Command, { command: this, children: [
data.length === 0 && params.pageNumber === 0 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
/* @__PURE__ */ jsx(Text, { children: "No games found. Create one now with:" }),
/* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: [
/* @__PURE__ */ jsx(Text, { children: "shipthis game wizard android" }),
/* @__PURE__ */ jsx(Text, { children: "shipthis game wizard ios" })
] })
] }),
data.length > 0 && /* @__PURE__ */ jsx(Table, { data }),
gameListResponse.pageCount > 1 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
/* @__PURE__ */ jsx(Text, { children: `Showing page ${flags.pageNumber + 1} of ${gameListResponse.pageCount}.` }),
/* @__PURE__ */ jsx(Text, { children: "Use the --pageNumber parameter to see other pages." })
] })
] })
);
}
}
export { GameList as default };