shipthis 0.1.31 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/dist/{AppleBundleIdDetails-eoK5F8Qn.js → AppleBundleIdDetails-BhHPCvRm.js} +17 -19
  2. package/dist/Command-BDIkuv2g.js +29 -0
  3. package/dist/CommandGame-CvBIjPZp.js +7 -0
  4. package/dist/{Create-ISdroJ3G.js → Create-Lpe0B8nT.js} +20 -20
  5. package/dist/GameStatus-5XpufIY_.js +137 -0
  6. package/dist/{Import-CfThJF6k.js → Import-DFzrAG04.js} +34 -36
  7. package/dist/{JobLogTail-BWzbQBZz.js → JobLogTail-BYcJgPcL.js} +53 -52
  8. package/dist/{JobProgress-DjIkuk5U.js → JobProgress-BcrE7CUK.js} +40 -38
  9. package/dist/{JobStatusTable-CEqWU73q.js → JobStatusTable-Bi-y8ZZT.js} +14 -13
  10. package/dist/{NextSteps-CK9zHOCt.js → NextSteps-DbJHmscQ.js} +1 -3
  11. package/dist/{ProgressSpinner-6pw1T8Iw.js → ProgressSpinner-Um6ARKlk.js} +2 -2
  12. package/dist/{ProjectCredentialsTable-u9ruZ9mN.js → ProjectCredentialsTable-B4vDJl4l.js} +11 -10
  13. package/dist/{StatusTable-Dm5St4g-.js → StatusTable-DzRWcMr4.js} +7 -9
  14. package/dist/{Table-CvM6pccN.js → Table-FaNgpyeq.js} +15 -15
  15. package/dist/{UserCredentialsTable-Q7u9M-ap.js → UserCredentialsTable-CwkZTFBD.js} +18 -19
  16. package/dist/{baseAppleCommand-zhkGlKq0.js → baseAppleCommand-BKXweb-U.js} +1 -1
  17. package/dist/{baseGameAndroidCommand-DJ-cMLa_.js → baseGameAndroidCommand-CAi-BSsH.js} +23 -23
  18. package/dist/commands/apple/apiKey/create.js +36 -36
  19. package/dist/commands/apple/apiKey/export.js +27 -27
  20. package/dist/commands/apple/apiKey/import.js +28 -28
  21. package/dist/commands/apple/apiKey/status.js +32 -32
  22. package/dist/commands/apple/certificate/create.js +40 -40
  23. package/dist/commands/apple/certificate/export.js +27 -27
  24. package/dist/commands/apple/certificate/import.js +28 -28
  25. package/dist/commands/apple/certificate/status.js +33 -33
  26. package/dist/commands/apple/login.js +15 -15
  27. package/dist/commands/apple/status.js +27 -27
  28. package/dist/commands/dashboard.js +10 -10
  29. package/dist/commands/game/android/apiKey/connect.js +28 -28
  30. package/dist/commands/game/android/apiKey/create.js +29 -29
  31. package/dist/commands/game/android/apiKey/export.js +30 -30
  32. package/dist/commands/game/android/apiKey/import.js +32 -32
  33. package/dist/commands/game/android/apiKey/invite.js +14 -14
  34. package/dist/commands/game/android/apiKey/status.js +30 -30
  35. package/dist/commands/game/android/keyStore/create.js +25 -25
  36. package/dist/commands/game/android/keyStore/export.js +29 -29
  37. package/dist/commands/game/android/keyStore/import.js +36 -36
  38. package/dist/commands/game/android/keyStore/status.js +26 -26
  39. package/dist/commands/game/android/status.js +15 -58
  40. package/dist/commands/game/build/download.js +24 -24
  41. package/dist/commands/game/build/list.js +37 -37
  42. package/dist/commands/game/create.js +15 -15
  43. package/dist/commands/game/details.js +35 -36
  44. package/dist/commands/game/export.js +12 -12
  45. package/dist/commands/game/ios/app/addTester.js +37 -32
  46. package/dist/commands/game/ios/app/create.js +24 -24
  47. package/dist/commands/game/ios/app/status.js +29 -29
  48. package/dist/commands/game/ios/app/sync.js +31 -31
  49. package/dist/commands/game/ios/profile/create.js +32 -32
  50. package/dist/commands/game/ios/profile/export.js +29 -29
  51. package/dist/commands/game/ios/profile/import.js +33 -33
  52. package/dist/commands/game/ios/profile/status.js +36 -36
  53. package/dist/commands/game/ios/status.js +46 -58
  54. package/dist/commands/game/ios/wizard.js +39 -34
  55. package/dist/commands/game/job/list.js +34 -34
  56. package/dist/commands/game/job/status.js +32 -32
  57. package/dist/commands/game/list.js +38 -40
  58. package/dist/commands/game/ship.js +81 -77
  59. package/dist/commands/game/status.js +38 -85
  60. package/dist/commands/game/wizard.js +253 -242
  61. package/dist/commands/internal/fastlane.js +15 -17
  62. package/dist/commands/internal/readme.js +38 -36
  63. package/dist/commands/login.js +14 -14
  64. package/dist/commands/status.js +32 -30
  65. package/dist/{export-DZxo2_e_.js → export-DLQrUEBK.js} +5 -5
  66. package/dist/{git-DREGq-jc.js → git-BpsfNFZ_.js} +8 -8
  67. package/dist/{import-8pL1AF47.js → import-BoY5e0uJ.js} +14 -14
  68. package/dist/{index-DJ078v-U.js → index-B27WJDxn.js} +43 -27
  69. package/dist/{index-DKQjnJrC.js → index-CisLwc7e.js} +42 -44
  70. package/dist/{index-C6aAyrXW.js → index-Crv7S0bl.js} +6 -6
  71. package/dist/{index-BHh0BZvD.js → index-DC0GJtAy.js} +50 -60
  72. package/dist/{index-CyvGh-kt.js → index-DfUg5j06.js} +93 -92
  73. package/dist/{index-w3lHxk5O.js → index-pj8JVg5X.js} +242 -225
  74. package/dist/{upload-BTpxj3QP.js → upload-C8S17EU_.js} +22 -22
  75. package/dist/{useAndroidServiceAccountTestResult-Dy3Ag7_r.js → useAndroidServiceAccountTestResult-D4e5AKAZ.js} +11 -13
  76. package/dist/{useAppleApp-h1Ogi_qc.js → useAppleApp-Dr6URQvC.js} +4 -4
  77. package/dist/{useAppleBundleId-B3TTNap0.js → useAppleBundleId-DELAwSQp.js} +6 -6
  78. package/dist/{useProjectCredentials-DpeXZcHP.js → useProjectCredentials-BjvdJdQg.js} +10 -12
  79. package/dist/{useWebSocket-gyuCsore.js → useWebSocket-CRV7V69Q.js} +1 -1
  80. package/dist/utils/help.js +4 -4
  81. package/package.json +5 -4
  82. package/dist/Command-DFdHXDiU.js +0 -44
  83. package/dist/CommandGame-Dif-oSky.js +0 -9
  84. package/dist/{RunWithSpinner-BVXNWGD3.js → RunWithSpinner-gMVA07bZ.js} +2 -2
@@ -1,45 +1,45 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
2
  import { Args, Flags } from '@oclif/core';
3
3
  import { render } from 'ink';
4
- import { c as BaseGameCommand, E as getJob, J as JobStatus } from '../../../index-w3lHxk5O.js';
5
- import 'react';
6
- import '../../../index-CyvGh-kt.js';
4
+ import { c as BaseGameCommand, z as getJob, J as JobStatus } from '../../../index-pj8JVg5X.js';
7
5
  import 'ink-spinner';
8
- import '@inkjs/ui';
9
- import 'axios';
10
- import '@tanstack/react-query';
11
- import 'fs';
12
- import 'uuid';
13
- import 'yazl';
14
- import 'crypto';
15
- import 'readline-sync';
16
- import 'node:readline';
6
+ import 'node:crypto';
7
+ import 'node:fs';
17
8
  import 'node:path';
9
+ import 'node:readline';
18
10
  import 'node:url';
11
+ import 'readline-sync';
19
12
  import 'luxon';
13
+ import 'axios';
20
14
  import 'isomorphic-git';
15
+ import '@tanstack/react-query';
16
+ import 'react';
21
17
  import 'fast-glob';
18
+ import 'uuid';
19
+ import 'yazl';
22
20
  import 'socket.io-client';
21
+ import 'fullscreen-ink';
22
+ import { J as JobLogTail } from '../../../JobLogTail-BYcJgPcL.js';
23
+ import { J as JobStatusTable } from '../../../JobStatusTable-Bi-y8ZZT.js';
23
24
  import 'open';
25
+ import '@inkjs/ui';
24
26
  import 'marked';
25
27
  import 'marked-terminal';
26
- import 'path';
27
- import { N as NextSteps } from '../../../NextSteps-CK9zHOCt.js';
28
+ import { N as NextSteps } from '../../../NextSteps-DbJHmscQ.js';
28
29
  import 'qrcode';
29
30
  import 'string-length';
30
31
  import 'strip-ansi';
31
- import { C as Command } from '../../../Command-DFdHXDiU.js';
32
- import { J as JobLogTail } from '../../../JobLogTail-BWzbQBZz.js';
33
- import { J as JobStatusTable } from '../../../JobStatusTable-CEqWU73q.js';
34
- import '@expo/apple-utils/build/index.js';
32
+ import '../../../index-DfUg5j06.js';
33
+ import { C as Command } from '../../../Command-BDIkuv2g.js';
35
34
  import 'crypto-js';
36
- import 'ini';
35
+ import '@expo/apple-utils/build/index.js';
37
36
  import 'deepmerge';
38
- import '../../../index-DJ078v-U.js';
39
- import '../../../useAndroidServiceAccountTestResult-Dy3Ag7_r.js';
37
+ import 'ini';
38
+ import '../../../index-B27WJDxn.js';
39
+ import '../../../useAndroidServiceAccountTestResult-D4e5AKAZ.js';
40
+ import '../../../useWebSocket-CRV7V69Q.js';
40
41
  import '../../../Title-BCQtayg6.js';
41
- import '../../../useWebSocket-gyuCsore.js';
42
- import '../../../StatusTable-Dm5St4g-.js';
42
+ import '../../../StatusTable-DzRWcMr4.js';
43
43
 
44
44
  class GameJobStatus extends BaseGameCommand {
45
45
  static args = {
@@ -53,35 +53,35 @@ class GameJobStatus extends BaseGameCommand {
53
53
  ];
54
54
  static flags = {
55
55
  ...super.flags,
56
- lines: Flags.integer({ char: "n", description: "The number of lines to show", default: 10 }),
57
- follow: Flags.boolean({ char: "f", description: "Follow the log in real-time", default: false })
56
+ follow: Flags.boolean({ char: "f", default: false, description: "Follow the log in real-time" }),
57
+ lines: Flags.integer({ char: "n", default: 10, description: "The number of lines to show" })
58
58
  };
59
59
  async getJob() {
60
60
  try {
61
61
  const game = await this.getGame();
62
62
  const job = await getJob(this.args.job_id, game.id);
63
63
  return job;
64
- } catch (e) {
65
- if (e?.response?.status === 404) {
64
+ } catch (error) {
65
+ if (error?.response?.status === 404) {
66
66
  this.error("Job not found - please check you have access", { exit: 1 });
67
67
  }
68
- throw e;
68
+ throw error;
69
69
  }
70
70
  }
71
71
  async run() {
72
72
  const job = await this.getJob();
73
- const { lines, follow } = this.flags;
73
+ const { follow, lines } = this.flags;
74
74
  const handleJobUpdate = (job2) => {
75
75
  if (!follow) return;
76
76
  if ([JobStatus.COMPLETED, JobStatus.FAILED].includes(job2.status)) {
77
- const exitCode = job2.status == JobStatus.FAILED ? 1 : 0;
77
+ const exitCode = job2.status === JobStatus.FAILED ? 1 : 0;
78
78
  setTimeout(() => process.exit(exitCode), 5e3);
79
79
  }
80
80
  };
81
81
  render(
82
82
  /* @__PURE__ */ jsxs(Command, { command: this, children: [
83
- /* @__PURE__ */ jsx(JobStatusTable, { jobId: job.id, projectId: job.project.id, isWatching: follow, onJobUpdate: handleJobUpdate }),
84
- /* @__PURE__ */ jsx(JobLogTail, { jobId: job.id, projectId: job.project.id, isWatching: follow, length: lines }),
83
+ /* @__PURE__ */ jsx(JobStatusTable, { isWatching: follow, jobId: job.id, onJobUpdate: handleJobUpdate, projectId: job.project.id }),
84
+ /* @__PURE__ */ jsx(JobLogTail, { isWatching: follow, jobId: job.id, length: lines, projectId: job.project.id }),
85
85
  /* @__PURE__ */ jsx(NextSteps, { steps: [] })
86
86
  ] })
87
87
  );
@@ -1,75 +1,73 @@
1
1
  import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { render, Box, Text } from 'ink';
3
2
  import { Flags } from '@oclif/core';
4
- import { B as BaseAuthenticatedCommand, g as getProjects, b as getShortDate } from '../../index-w3lHxk5O.js';
5
- import 'react';
6
- import '../../index-CyvGh-kt.js';
3
+ import { render, Box, Text } from 'ink';
4
+ import { B as BaseAuthenticatedCommand, g as getProjects, b as getShortDate } from '../../index-pj8JVg5X.js';
7
5
  import 'ink-spinner';
8
- import '@inkjs/ui';
9
- import 'axios';
6
+ import { g as getShortUUID } from '../../index-B27WJDxn.js';
7
+ import { T as Table } from '../../Table-FaNgpyeq.js';
8
+ import 'react';
10
9
  import '@tanstack/react-query';
11
- import 'fs';
10
+ import 'axios';
11
+ import 'luxon';
12
+ import 'node:fs';
13
+ import 'fast-glob';
12
14
  import 'uuid';
13
15
  import 'yazl';
14
- import { g as getShortUUID } from '../../index-DJ078v-U.js';
16
+ import 'socket.io-client';
17
+ import 'fullscreen-ink';
18
+ import 'string-length';
19
+ import 'strip-ansi';
15
20
  import 'open';
21
+ import '@inkjs/ui';
22
+ import 'node:path';
16
23
  import 'marked';
17
24
  import 'marked-terminal';
18
- import 'path';
19
25
  import 'qrcode';
20
- import { T as Table } from '../../Table-CvM6pccN.js';
21
- import 'string-length';
22
- import 'strip-ansi';
23
- import 'luxon';
24
- import 'fast-glob';
25
- import { C as Command } from '../../Command-DFdHXDiU.js';
26
- import 'socket.io-client';
27
- import '@expo/apple-utils/build/index.js';
26
+ import '../../index-DfUg5j06.js';
27
+ import { C as Command } from '../../Command-BDIkuv2g.js';
28
28
  import 'crypto-js';
29
- import 'crypto';
30
- import 'readline-sync';
29
+ import '@expo/apple-utils/build/index.js';
30
+ import 'node:crypto';
31
31
  import 'node:readline';
32
- import 'node:path';
33
32
  import 'node:url';
33
+ import 'readline-sync';
34
34
  import 'isomorphic-git';
35
- import 'ini';
36
35
  import 'deepmerge';
37
- import '../../useAndroidServiceAccountTestResult-Dy3Ag7_r.js';
36
+ import 'ini';
37
+ import '../../useAndroidServiceAccountTestResult-D4e5AKAZ.js';
38
38
 
39
39
  class GameList extends BaseAuthenticatedCommand {
40
40
  static args = {};
41
41
  static description = "Shows a list of all your games.";
42
42
  static examples = ["<%= config.bin %> <%= command.id %>"];
43
43
  static flags = {
44
- pageNumber: Flags.integer({ char: "p", description: "The page number to show (starts at 0)", default: 0 }),
45
- pageSize: Flags.integer({ char: "s", description: "The number of items to show per page", default: 10 }),
44
+ order: Flags.string({
45
+ char: "r",
46
+ default: "desc",
47
+ description: "The order to sort by",
48
+ options: ["asc", "desc"]
49
+ }),
46
50
  orderBy: Flags.string({
47
51
  char: "o",
48
- description: "The field to order by",
49
52
  default: "createdAt",
53
+ description: "The field to order by",
50
54
  options: ["createdAt", "updatedAt", "name"]
51
55
  }),
52
- order: Flags.string({
53
- char: "r",
54
- description: "The order to sort by",
55
- default: "desc",
56
- options: ["asc", "desc"]
57
- })
56
+ pageNumber: Flags.integer({ char: "p", default: 0, description: "The page number to show (starts at 0)" }),
57
+ pageSize: Flags.integer({ char: "s", default: 10, description: "The number of items to show per page" })
58
58
  };
59
59
  async run() {
60
60
  const { flags } = this;
61
61
  const params = flags;
62
62
  const gameListResponse = await getProjects(params);
63
- const data = gameListResponse.data.map((game) => {
64
- return {
65
- id: getShortUUID(game.id),
66
- name: game.name,
67
- createdAt: getShortDate(game.createdAt)
68
- };
69
- });
63
+ const data = gameListResponse.data.map((game) => ({
64
+ createdAt: getShortDate(game.createdAt),
65
+ id: getShortUUID(game.id),
66
+ name: game.name
67
+ }));
70
68
  render(
71
69
  /* @__PURE__ */ jsxs(Command, { command: this, children: [
72
- data.length === 0 && params.pageNumber == 0 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
70
+ data.length === 0 && params.pageNumber === 0 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
73
71
  /* @__PURE__ */ jsx(Text, { children: "No games found. Create one now with:" }),
74
72
  /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginLeft: 2, marginTop: 1, children: [
75
73
  /* @__PURE__ */ jsx(Text, { children: "shipthis game wizard android" }),
@@ -77,7 +75,7 @@ class GameList extends BaseAuthenticatedCommand {
77
75
  ] })
78
76
  ] }),
79
77
  data.length > 0 && /* @__PURE__ */ jsx(Table, { data }),
80
- gameListResponse.pageCount > 1 && /* @__PURE__ */ jsxs(Box, { marginTop: 1, flexDirection: "column", children: [
78
+ gameListResponse.pageCount > 1 && /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
81
79
  /* @__PURE__ */ jsx(Text, { children: `Showing page ${flags.pageNumber + 1} of ${gameListResponse.pageCount}.` }),
82
80
  /* @__PURE__ */ jsx(Text, { children: "Use the --pageNumber parameter to see other pages." })
83
81
  ] })
@@ -1,48 +1,48 @@
1
1
  import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
2
  import { Flags } from '@oclif/core';
3
- import { useInput, Box, Text, render } from 'ink';
4
- import { L as LogLevel, a2 as getShortAuthRequiredUrl, W as WEB_URL, c as BaseGameCommand, E as getJob, H as downloadBuildById } from '../../index-w3lHxk5O.js';
5
- import { useContext, useState, useEffect } from 'react';
6
- import { d as CommandContext, b as GameContext, M as Markdown } from '../../index-CyvGh-kt.js';
3
+ import { Box, Text, render } from 'ink';
4
+ import { M as LogLevel, W as WEB_URL, a2 as getShortAuthRequiredUrl, c as BaseGameCommand, z as getJob, H as downloadBuildById } from '../../index-pj8JVg5X.js';
7
5
  import 'ink-spinner';
8
- import '@inkjs/ui';
9
- import axios from 'axios';
10
- import '@tanstack/react-query';
11
- import 'fs';
12
- import 'uuid';
13
- import 'yazl';
14
- import 'crypto';
15
- import 'readline-sync';
16
- import 'node:readline';
6
+ import 'node:crypto';
7
+ import 'node:fs';
17
8
  import 'node:path';
9
+ import 'node:readline';
18
10
  import 'node:url';
11
+ import 'readline-sync';
19
12
  import 'luxon';
13
+ import axios from 'axios';
20
14
  import 'isomorphic-git';
15
+ import '@tanstack/react-query';
16
+ import { useContext, useState, useEffect } from 'react';
21
17
  import 'fast-glob';
18
+ import 'uuid';
19
+ import 'yazl';
22
20
  import 'socket.io-client';
23
- import open from 'open';
24
- import 'marked';
25
- import 'marked-terminal';
26
- import 'path';
27
- import 'qrcode';
21
+ import 'fullscreen-ink';
28
22
  import 'string-length';
29
23
  import 'strip-ansi';
30
- import { C as CommandGame } from '../../CommandGame-Dif-oSky.js';
31
- import { g as getShortUUID } from '../../index-DJ078v-U.js';
32
- import { u as useShip, J as JobProgress } from '../../JobProgress-DjIkuk5U.js';
24
+ import open from 'open';
25
+ import { g as getShortUUID } from '../../index-B27WJDxn.js';
33
26
  import 'crypto-js';
34
- import { u as useJobWatching, J as JobLogTail } from '../../JobLogTail-BWzbQBZz.js';
35
- import { J as JobStatusTable } from '../../JobStatusTable-CEqWU73q.js';
27
+ import { u as useJobWatching, J as JobLogTail } from '../../JobLogTail-BYcJgPcL.js';
28
+ import { J as JobStatusTable } from '../../JobStatusTable-Bi-y8ZZT.js';
29
+ import '@inkjs/ui';
30
+ import { u as useShip, J as JobProgress } from '../../JobProgress-BcrE7CUK.js';
31
+ import { C as CommandContext, G as GameContext, e as useSafeInput, M as Markdown } from '../../index-DfUg5j06.js';
32
+ import 'qrcode';
33
+ import 'marked';
34
+ import 'marked-terminal';
35
+ import { C as CommandGame } from '../../CommandGame-CvBIjPZp.js';
36
36
  import '@expo/apple-utils/build/index.js';
37
- import 'ini';
38
37
  import 'deepmerge';
39
- import '../../useAndroidServiceAccountTestResult-Dy3Ag7_r.js';
40
- import '../../Command-DFdHXDiU.js';
41
- import '../../git-DREGq-jc.js';
42
- import '../../ProgressSpinner-6pw1T8Iw.js';
43
- import '../../useWebSocket-gyuCsore.js';
38
+ import 'ini';
39
+ import '../../useAndroidServiceAccountTestResult-D4e5AKAZ.js';
40
+ import '../../useWebSocket-CRV7V69Q.js';
44
41
  import '../../Title-BCQtayg6.js';
45
- import '../../StatusTable-Dm5St4g-.js';
42
+ import '../../StatusTable-DzRWcMr4.js';
43
+ import '../../git-BpsfNFZ_.js';
44
+ import '../../ProgressSpinner-Um6ARKlk.js';
45
+ import '../../Command-BDIkuv2g.js';
46
46
 
47
47
  function isNetworkError(exception) {
48
48
  if (!axios.isAxiosError(exception)) return false;
@@ -66,17 +66,17 @@ function getErrorMessage(error) {
66
66
  }
67
67
  }
68
68
 
69
- const JobFollow = ({ projectId, jobId, onComplete, onFailure }) => {
69
+ const JobFollow = ({ jobId, onComplete, onFailure, projectId }) => {
70
70
  useJobWatching({
71
- projectId,
72
- jobId,
73
71
  isWatching: true,
74
- onNewLogEntry: (logEntry) => {
75
- if (logEntry.level == LogLevel.ERROR) console.error(logEntry.message);
72
+ jobId,
73
+ onComplete,
74
+ onFailure,
75
+ onNewLogEntry(logEntry) {
76
+ if (logEntry.level === LogLevel.ERROR) console.error(logEntry.message);
76
77
  else console.log(logEntry.message);
77
78
  },
78
- onComplete,
79
- onFailure
79
+ projectId
80
80
  });
81
81
  return null;
82
82
  };
@@ -94,23 +94,27 @@ const Ship = ({ onComplete, onError }) => {
94
94
  const [isComplete, setIsComplete] = useState(false);
95
95
  const handleStartOnMount = async () => {
96
96
  if (!command) throw new Error("No command in context");
97
- const startedJobs = await shipMutation.mutateAsync({ command, log: setShipLog });
97
+ const logFn = flags?.follow ? console.log : setShipLog;
98
+ const startedJobs = await shipMutation.mutateAsync({ command, log: logFn });
98
99
  setJobs(startedJobs);
99
100
  };
100
101
  useEffect(() => {
101
102
  handleStartOnMount().catch(onError);
102
103
  }, []);
103
- useInput(async (input) => {
104
+ useSafeInput(async (input) => {
104
105
  if (!gameId) return;
105
- switch (input) {
106
- case "l":
106
+ const i = input.toLowerCase();
107
+ switch (i) {
108
+ case "l": {
107
109
  setShowLog((prev) => !prev);
108
110
  break;
109
- case "b":
110
- const dashUrl = jobs?.length !== 1 ? `/games/${gameId}` : `/games/${gameId}/job/${jobs[0].id}`;
111
+ }
112
+ case "b": {
113
+ const dashUrl = jobs?.length === 1 ? `/games/${gameId}/job/${jobs[0].id}` : `/games/${gameId}`;
111
114
  const url = await getShortAuthRequiredUrl(dashUrl);
112
115
  await open(url);
113
116
  break;
117
+ }
114
118
  }
115
119
  });
116
120
  const handleJobComplete = (job) => {
@@ -134,16 +138,16 @@ const Ship = ({ onComplete, onError }) => {
134
138
  if (!gameId) return /* @__PURE__ */ jsx(Fragment, {});
135
139
  if (flags?.follow) {
136
140
  if (jobs && jobs.length > 0) {
137
- return /* @__PURE__ */ jsx(JobFollow, { projectId: gameId, jobId: jobs[0].id, onComplete: handleJobComplete, onFailure: handleJobFailure });
141
+ return /* @__PURE__ */ jsx(JobFollow, { jobId: jobs[0].id, onComplete: handleJobComplete, onFailure: handleJobFailure, projectId: gameId });
138
142
  }
139
143
  return /* @__PURE__ */ jsx(Fragment, {});
140
144
  }
141
145
  return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
142
- jobs == null && /* @__PURE__ */ jsx(Text, { children: shipLog }),
146
+ jobs === null && /* @__PURE__ */ jsx(Text, { children: shipLog }),
143
147
  jobs && jobs.map((job) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
144
- /* @__PURE__ */ jsx(JobStatusTable, { jobId: job.id, projectId: job.project.id, isWatching: true }),
148
+ /* @__PURE__ */ jsx(JobStatusTable, { isWatching: true, jobId: job.id, projectId: job.project.id }),
145
149
  /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: /* @__PURE__ */ jsx(JobProgress, { job, onComplete: handleJobComplete, onFailure: handleJobFailure }) }),
146
- showLog && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(JobLogTail, { jobId: job.id, projectId: job.project.id, isWatching: true, length: 10 }) })
150
+ showLog && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(JobLogTail, { isWatching: true, jobId: job.id, length: 10, projectId: job.project.id }) })
147
151
  ] }, job.id)),
148
152
  jobs && !isComplete && /* @__PURE__ */ jsxs(Fragment, { children: [
149
153
  /* @__PURE__ */ jsx(Text, { children: "Press L to show and hide the job logs." }),
@@ -151,13 +155,13 @@ const Ship = ({ onComplete, onError }) => {
151
155
  /* @__PURE__ */ jsx(Text, { bold: true, children: "Please wait while ShipThis builds your game..." })
152
156
  ] }),
153
157
  isComplete && /* @__PURE__ */ jsxs(Fragment, { children: [
154
- failedJobs.length == 0 && /* @__PURE__ */ jsx(
158
+ failedJobs.length === 0 && /* @__PURE__ */ jsx(
155
159
  Markdown,
156
160
  {
157
161
  filename: "ship-success.md",
158
162
  templateVars: {
159
- wasPublished: flags?.skipPublish ? false : true,
160
- gameBuildsUrl: `${WEB_URL}games/${getShortUUID(gameId)}/builds`
163
+ gameBuildsUrl: `${WEB_URL}games/${getShortUUID(gameId)}/builds`,
164
+ wasPublished: !flags?.skipPublish
161
165
  }
162
166
  }
163
167
  ),
@@ -171,7 +175,7 @@ const Ship = ({ onComplete, onError }) => {
171
175
  }
172
176
  }
173
177
  ),
174
- /* @__PURE__ */ jsx(Box, { marginTop: 1, children: failedJobs.map((fj) => /* @__PURE__ */ jsx(JobLogTail, { jobId: fj.id, projectId: fj.project.id, isWatching: false, length: 10 }, fj.id)) })
178
+ /* @__PURE__ */ jsx(Box, { marginTop: 1, children: failedJobs.map((fj) => /* @__PURE__ */ jsx(JobLogTail, { isWatching: false, jobId: fj.id, length: 10, projectId: fj.project.id }, fj.id)) })
175
179
  ] })
176
180
  ] })
177
181
  ] });
@@ -179,45 +183,45 @@ const Ship = ({ onComplete, onError }) => {
179
183
 
180
184
  class GameShip extends BaseGameCommand {
181
185
  static args = {};
186
+ static description = "Builds the app (for all platforms with valid credentials) and ships it to the stores.";
187
+ static examples = [
188
+ "<%= config.bin %> <%= command.id %>",
189
+ "<%= config.bin %> <%= command.id %> --platform ios",
190
+ "<%= config.bin %> <%= command.id %> --platform android --skipPublish",
191
+ "<%= config.bin %> <%= command.id %> --platform android --download game.aab",
192
+ "<%= config.bin %> <%= command.id %> --platform android --follow --downloadAPK game.apk"
193
+ ];
182
194
  static flags = {
183
195
  ...BaseGameCommand.flags,
184
- platform: Flags.string({
185
- description: 'The platform to ship the game to. This can be "android" or "ios"',
186
- required: false,
187
- options: ["android", "ios"]
188
- }),
189
- skipPublish: Flags.boolean({
190
- description: "Skip the publish step",
191
- required: false,
192
- default: false
193
- }),
194
196
  download: Flags.string({
197
+ dependsOn: ["platform"],
195
198
  description: "Download the build artifact to the specified file",
196
- required: false,
197
- dependsOn: ["platform"]
199
+ required: false
198
200
  }),
199
201
  downloadAPK: Flags.string({
202
+ dependsOn: ["platform"],
200
203
  description: "Download the APK artifact (if available) to the specified file",
201
- required: false,
202
- dependsOn: ["platform"]
204
+ required: false
203
205
  }),
204
206
  follow: Flags.boolean({
207
+ dependsOn: ["platform"],
205
208
  description: "Follow the job logs in real-time. Requires --platform to be specified.",
206
- required: false,
207
- dependsOn: ["platform"]
209
+ required: false
210
+ }),
211
+ platform: Flags.string({
212
+ description: 'The platform to ship the game to. This can be "android" or "ios"',
213
+ options: ["android", "ios"],
214
+ required: false
215
+ }),
216
+ skipPublish: Flags.boolean({
217
+ default: false,
218
+ description: "Skip the publish step",
219
+ required: false
208
220
  })
209
221
  };
210
- static description = "Builds the app (for all platforms with valid credentials) and ships it to the stores.";
211
- static examples = [
212
- "<%= config.bin %> <%= command.id %>",
213
- "<%= config.bin %> <%= command.id %> --platform ios",
214
- "<%= config.bin %> <%= command.id %> --platform android --skipPublish",
215
- "<%= config.bin %> <%= command.id %> --platform android --download game.aab",
216
- "<%= config.bin %> <%= command.id %> --platform android --follow --downloadAPK game.apk"
217
- ];
218
222
  async run() {
219
223
  await this.ensureWeAreInAProjectDir();
220
- const gameId = await this.getGameId();
224
+ const gameId = this.getGameId();
221
225
  if (!gameId) {
222
226
  this.error("No game ID found");
223
227
  }
@@ -232,7 +236,7 @@ class GameShip extends BaseGameCommand {
232
236
  if (attempt < MAX_RETRIES) await new Promise((res) => setTimeout(res, RETRY_DELAY_MS));
233
237
  }
234
238
  if (!job?.builds || job.builds.length === 0) this.error("No builds found for this job after multiple attempts");
235
- const platform = this.flags.platform;
239
+ const { platform } = this.flags;
236
240
  const type = platform === "android" ? this.flags.downloadAPK ? "APK" : "AAB" : "IPA";
237
241
  const build = job.builds.find((b) => b.buildType === type);
238
242
  if (!build) this.error(`No build found for type ${type}`);
@@ -1,115 +1,68 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { render } from 'ink';
1
+ import { jsx } from 'react/jsx-runtime';
3
2
  import { Flags } from '@oclif/core';
4
- import 'react';
5
- import '../../index-CyvGh-kt.js';
6
- import { B as BaseAuthenticatedCommand, F as getProject, P as Platform, k as getProjectPlatformProgress, b as getShortDate } from '../../index-w3lHxk5O.js';
3
+ import { render } from 'ink';
4
+ import { B as BaseAuthenticatedCommand } from '../../index-pj8JVg5X.js';
7
5
  import 'ink-spinner';
8
- import '@inkjs/ui';
6
+ import 'node:crypto';
7
+ import 'node:fs';
8
+ import 'node:path';
9
+ import 'node:readline';
10
+ import 'node:url';
11
+ import 'readline-sync';
12
+ import 'luxon';
9
13
  import 'axios';
14
+ import 'isomorphic-git';
10
15
  import '@tanstack/react-query';
11
- import 'fs';
16
+ import 'react';
17
+ import 'crypto-js';
12
18
  import 'uuid';
19
+ import 'fast-glob';
13
20
  import 'yazl';
14
- import { g as getShortUUID, m as makeHumanReadable } from '../../index-DJ078v-U.js';
21
+ import 'socket.io-client';
22
+ import 'fullscreen-ink';
23
+ import { a as GameStatus$1 } from '../../GameStatus-5XpufIY_.js';
24
+ import 'string-length';
25
+ import 'strip-ansi';
15
26
  import 'open';
27
+ import '@inkjs/ui';
16
28
  import 'marked';
17
29
  import 'marked-terminal';
18
- import 'path';
19
- import { N as NextSteps } from '../../NextSteps-CK9zHOCt.js';
20
30
  import 'qrcode';
21
- import { S as StatusTable } from '../../StatusTable-Dm5St4g-.js';
22
- import 'string-length';
23
- import 'strip-ansi';
24
- import 'luxon';
25
- import 'fast-glob';
26
- import { C as Command } from '../../Command-DFdHXDiU.js';
27
- import 'socket.io-client';
28
- import '../../useAndroidServiceAccountTestResult-Dy3Ag7_r.js';
31
+ import '../../index-DfUg5j06.js';
32
+ import { C as CommandGame } from '../../CommandGame-CvBIjPZp.js';
29
33
  import '@expo/apple-utils/build/index.js';
30
- import 'crypto-js';
31
- import 'crypto';
32
- import 'readline-sync';
33
- import 'node:readline';
34
- import 'node:path';
35
- import 'node:url';
36
- import 'isomorphic-git';
37
- import 'ini';
38
34
  import 'deepmerge';
35
+ import 'ini';
36
+ import '../../index-B27WJDxn.js';
37
+ import '../../StatusTable-DzRWcMr4.js';
39
38
  import '../../Title-BCQtayg6.js';
39
+ import '../../NextSteps-DbJHmscQ.js';
40
+ import '../../useAndroidServiceAccountTestResult-D4e5AKAZ.js';
41
+ import '../../Command-BDIkuv2g.js';
40
42
 
41
- function getSteps(platform, progress) {
42
- if (!progress) return [];
43
- switch (platform) {
44
- case Platform.ANDROID:
45
- return [
46
- !progress.hasCredentialsForPlatform && "shipthis game android keyStore create",
47
- !progress.hasApiKeyForPlatform && "shipthis game android apiKey create",
48
- progress.hasCredentialsForPlatform && progress.hasApiKeyForPlatform && "shipthis game ship"
49
- ].filter(Boolean);
50
- case Platform.IOS:
51
- return [
52
- !progress.hasApiKeyForPlatform && "shipthis apple apiKey create",
53
- !progress.hasCredentialsForPlatform && "shipthis game ios profile create",
54
- progress.hasApiKeyForPlatform && progress.hasCredentialsForPlatform && "shipthis game ship"
55
- ].filter(Boolean);
56
- default:
57
- throw new Error("Invalid platform");
58
- }
59
- }
60
43
  class GameStatus extends BaseAuthenticatedCommand {
61
44
  static args = {};
62
45
  static description = "Shows the status of the current game.";
63
46
  static examples = [
64
47
  "<%= config.bin %> <%= command.id %>",
65
- "<%= config.bin %> <%= command.id %> --gameId 0c179fc4"
48
+ "<%= config.bin %> <%= command.id %> --gameId 0c179fc4",
49
+ "<%= config.bin %> <%= command.id %> --platform ios"
66
50
  ];
67
51
  static flags = {
68
- gameId: Flags.string({ char: "g", description: "The ID of the game" })
52
+ gameId: Flags.string({ char: "g", description: "The ID of the game" }),
53
+ platform: Flags.string({
54
+ char: "p",
55
+ description: "The platform to check status for (ios, android)",
56
+ options: ["android", "ios"]
57
+ })
69
58
  };
70
59
  async run() {
71
- const gameId = await this.getGameId();
60
+ const gameId = this.getGameId();
72
61
  if (!gameId) {
73
62
  this.error("No game found - please run `shipthis game wizard` or specify a game ID with --gameId", { exit: 1 });
74
63
  }
75
- const game = await getProject(gameId);
76
- const hasConfiguredIos = !!game.details?.iosBundleId;
77
- const hasConfiguredAndroid = !!game.details?.androidPackageName;
78
- let statuses = {
79
- [Platform.IOS]: hasConfiguredIos ? await getProjectPlatformProgress(game.id, Platform.IOS) : null,
80
- [Platform.ANDROID]: hasConfiguredAndroid ? await getProjectPlatformProgress(game.id, Platform.ANDROID) : null
81
- };
82
- let steps = [];
83
- if (hasConfiguredIos) steps = steps.concat(getSteps(Platform.IOS, statuses[Platform.IOS]));
84
- if (hasConfiguredAndroid) steps = steps.concat(getSteps(Platform.ANDROID, statuses[Platform.ANDROID]));
85
- if (!hasConfiguredIos && !hasConfiguredAndroid) {
86
- steps = steps.concat(["shipthis game wizard android", "shipthis game wizard ios"]);
87
- }
88
- const progressToStatuses = (progress) => {
89
- const { platform, ...rest } = progress;
90
- return makeHumanReadable(rest);
91
- };
92
64
  render(
93
- /* @__PURE__ */ jsxs(Command, { command: this, children: [
94
- /* @__PURE__ */ jsx(
95
- StatusTable,
96
- {
97
- marginBottom: 1,
98
- title: "Game Details",
99
- statuses: {
100
- "Game ID": getShortUUID(game.id),
101
- Name: game.name,
102
- Version: `${game.details?.semanticVersion || "0.0.1"}`,
103
- "Build Number": `${game.details?.buildNumber || 1}`,
104
- "Created At": getShortDate(game.createdAt),
105
- "Game Engine": `${game.details?.gameEngine || "godot"} ${game.details?.gameEngineVersion || "4.3"}`
106
- }
107
- }
108
- ),
109
- statuses[Platform.IOS] && /* @__PURE__ */ jsx(StatusTable, { title: "iOS Status", statuses: progressToStatuses(statuses[Platform.IOS]) }),
110
- statuses[Platform.ANDROID] && /* @__PURE__ */ jsx(StatusTable, { title: "Android Status", statuses: progressToStatuses(statuses[Platform.ANDROID]) }),
111
- /* @__PURE__ */ jsx(NextSteps, { steps })
112
- ] })
65
+ /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(GameStatus$1, { onComplete: (exitCode) => process.exit(exitCode) }) })
113
66
  );
114
67
  }
115
68
  }