shipthis 0.1.23 → 0.1.25

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 (89) hide show
  1. package/README.md +25 -16
  2. package/docs/assets/ship-outputx0.8.gif +0 -0
  3. package/package.json +1 -1
  4. package/bin/readme.sh +0 -15
  5. package/dist/AppleBundleIdDetails-C9C5WSPR.js +0 -76
  6. package/dist/Command-BQCJ9Wf-.js +0 -28
  7. package/dist/CommandGame-CkGqTno0.js +0 -9
  8. package/dist/Create-t_E231OA.js +0 -59
  9. package/dist/Import-Ljz1gxXd.js +0 -110
  10. package/dist/JobProgress-D9tHgBvi.js +0 -121
  11. package/dist/JobStatusTable-DmI7qCHc.js +0 -203
  12. package/dist/NextSteps-CK9zHOCt.js +0 -18
  13. package/dist/ProgressSpinner-6pw1T8Iw.js +0 -16
  14. package/dist/ProjectCredentialsTable-CTkP1mvy.js +0 -37
  15. package/dist/RunWithSpinner-BVXNWGD3.js +0 -27
  16. package/dist/StatusTable-Dm5St4g-.js +0 -33
  17. package/dist/Table-CvM6pccN.js +0 -101
  18. package/dist/Title-BCQtayg6.js +0 -6
  19. package/dist/UserCredentialsTable-DhtM_iTG.js +0 -82
  20. package/dist/baseAppleCommand-IGl6KTvv.js +0 -10
  21. package/dist/baseGameAndroidCommand-DFn4zMvq.js +0 -43
  22. package/dist/commands/apple/apiKey/create.js +0 -103
  23. package/dist/commands/apple/apiKey/export.js +0 -81
  24. package/dist/commands/apple/apiKey/import.js +0 -85
  25. package/dist/commands/apple/apiKey/status.js +0 -122
  26. package/dist/commands/apple/certificate/create.js +0 -133
  27. package/dist/commands/apple/certificate/export.js +0 -81
  28. package/dist/commands/apple/certificate/import.js +0 -85
  29. package/dist/commands/apple/certificate/status.js +0 -130
  30. package/dist/commands/apple/login.js +0 -76
  31. package/dist/commands/apple/status.js +0 -79
  32. package/dist/commands/dashboard.js +0 -38
  33. package/dist/commands/game/android/apiKey/connect.js +0 -74
  34. package/dist/commands/game/android/apiKey/create.js +0 -74
  35. package/dist/commands/game/android/apiKey/export.js +0 -84
  36. package/dist/commands/game/android/apiKey/import.js +0 -93
  37. package/dist/commands/game/android/apiKey/invite.js +0 -81
  38. package/dist/commands/game/android/apiKey/status.js +0 -87
  39. package/dist/commands/game/android/keyStore/create.js +0 -69
  40. package/dist/commands/game/android/keyStore/export.js +0 -83
  41. package/dist/commands/game/android/keyStore/import.js +0 -112
  42. package/dist/commands/game/android/keyStore/status.js +0 -70
  43. package/dist/commands/game/android/status.js +0 -84
  44. package/dist/commands/game/build/download.js +0 -80
  45. package/dist/commands/game/build/list.js +0 -94
  46. package/dist/commands/game/create.js +0 -67
  47. package/dist/commands/game/details.js +0 -113
  48. package/dist/commands/game/export.js +0 -58
  49. package/dist/commands/game/ios/app/addTester.js +0 -124
  50. package/dist/commands/game/ios/app/create.js +0 -117
  51. package/dist/commands/game/ios/app/status.js +0 -66
  52. package/dist/commands/game/ios/app/sync.js +0 -95
  53. package/dist/commands/game/ios/profile/create.js +0 -129
  54. package/dist/commands/game/ios/profile/export.js +0 -83
  55. package/dist/commands/game/ios/profile/import.js +0 -92
  56. package/dist/commands/game/ios/profile/status.js +0 -139
  57. package/dist/commands/game/ios/status.js +0 -92
  58. package/dist/commands/game/ios/wizard.js +0 -153
  59. package/dist/commands/game/job/list.js +0 -91
  60. package/dist/commands/game/job/status.js +0 -91
  61. package/dist/commands/game/list.js +0 -83
  62. package/dist/commands/game/ship.js +0 -205
  63. package/dist/commands/game/status.js +0 -114
  64. package/dist/commands/game/wizard.js +0 -686
  65. package/dist/commands/internal/fastlane.js +0 -74
  66. package/dist/commands/internal/readme.js +0 -937
  67. package/dist/commands/login.js +0 -92
  68. package/dist/commands/status.js +0 -76
  69. package/dist/export-CVs_xoDN.js +0 -36
  70. package/dist/git-DREGq-jc.js +0 -32
  71. package/dist/import-Ch5O7xfN.js +0 -47
  72. package/dist/index-BB00V5oF.js +0 -136
  73. package/dist/index-CIa2EDQ6.js +0 -24
  74. package/dist/index-DkNQs11R.js +0 -711
  75. package/dist/index-DrcGhlrc.js +0 -138
  76. package/dist/index-DyOv-ge5.js +0 -125
  77. package/dist/index-vMXsdSCy.js +0 -208
  78. package/dist/index.d.ts +0 -1
  79. package/dist/index.js +0 -1
  80. package/dist/upload-CRE2nVdd.js +0 -60
  81. package/dist/useAndroidServiceAccountTestResult-DcYDam-p.js +0 -52
  82. package/dist/useAppleApp-B16WbUxJ.js +0 -32
  83. package/dist/useAppleBundleId-DobPATan.js +0 -64
  84. package/dist/useJobWatching-BZSUa8E-.js +0 -45
  85. package/dist/useProjectCredentials-Btnr7WK3.js +0 -54
  86. package/dist/useWebSocket-ByuNoqRw.js +0 -36
  87. package/dist/utils/help.js +0 -14
  88. package/npm-shrinkwrap.json +0 -14011
  89. package/oclif.manifest.json +0 -2275
@@ -1,205 +0,0 @@
1
- import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
2
- import { Flags } from '@oclif/core';
3
- import { useInput, Box, Text, render } from 'ink';
4
- import { a3 as getShortAuthRequiredUrl, W as WEB_URL, c as BaseGameCommand, K as downloadBuildById } from '../../index-DkNQs11R.js';
5
- import { useContext, useState, useEffect } from 'react';
6
- import { e as CommandContext, b as GameContext, M as Markdown } from '../../index-vMXsdSCy.js';
7
- 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';
17
- import 'node:path';
18
- import 'node:url';
19
- import 'luxon';
20
- import 'isomorphic-git';
21
- import 'fast-glob';
22
- import 'socket.io-client';
23
- import open from 'open';
24
- import 'marked';
25
- import 'marked-terminal';
26
- import 'path';
27
- import 'qrcode';
28
- import 'string-length';
29
- import 'strip-ansi';
30
- import { C as CommandGame } from '../../CommandGame-CkGqTno0.js';
31
- import { g as getShortUUID } from '../../index-BB00V5oF.js';
32
- import { u as useShip, J as JobProgress } from '../../JobProgress-D9tHgBvi.js';
33
- import { J as JobStatusTable, a as JobLogTail } from '../../JobStatusTable-DmI7qCHc.js';
34
- import '@expo/apple-utils/build/index.js';
35
- import 'crypto-js';
36
- import 'ini';
37
- import 'deepmerge';
38
- import '../../useAndroidServiceAccountTestResult-DcYDam-p.js';
39
- import '../../Command-BQCJ9Wf-.js';
40
- import '../../git-DREGq-jc.js';
41
- import '../../ProgressSpinner-6pw1T8Iw.js';
42
- import '../../useJobWatching-BZSUa8E-.js';
43
- import '../../useWebSocket-ByuNoqRw.js';
44
- import '../../Title-BCQtayg6.js';
45
- import '../../StatusTable-Dm5St4g-.js';
46
-
47
- function isNetworkError(exception) {
48
- if (!axios.isAxiosError(exception)) return false;
49
- return ["ECONNABORTED", "ERR_NETWORK"].includes(`${exception.code}`);
50
- }
51
- function getErrorMessage(error) {
52
- try {
53
- if (isNetworkError(error)) {
54
- return "Please check your internet connection.";
55
- }
56
- const data = error?.response?.data;
57
- const apiValidation = Array.isArray(data) ? data.map((r) => "message" in r ? `Error - ${r.message}` : r.toString()).join(" ") : "";
58
- const apiErr = error?.response?.data?.error || "";
59
- const apiMsg = `${apiErr}${apiValidation ? " " + apiValidation : ""}`;
60
- if (apiMsg.length === 0) {
61
- return "message" in error ? error.message : error.toString();
62
- }
63
- return apiMsg;
64
- } catch {
65
- return error ? error.toString() : "Error";
66
- }
67
- }
68
-
69
- const Ship = ({ onComplete, onError }) => {
70
- const { command } = useContext(CommandContext);
71
- const { gameId } = useContext(GameContext);
72
- const shipMutation = useShip();
73
- const [jobs, setJobs] = useState(null);
74
- const [failedJobs, setFailedJobs] = useState([]);
75
- const [successJobs, setSuccessJobs] = useState([]);
76
- const [shipLog, setShipLog] = useState("");
77
- const [showLog, setShowLog] = useState(false);
78
- const [isComplete, setIsComplete] = useState(false);
79
- const handleStartOnMount = async () => {
80
- if (!command) throw new Error("No command in context");
81
- const startedJobs = await shipMutation.mutateAsync({ command, log: setShipLog });
82
- setJobs(startedJobs);
83
- };
84
- useEffect(() => {
85
- handleStartOnMount().catch(onError);
86
- }, []);
87
- useInput(async (input) => {
88
- if (!gameId) return;
89
- switch (input) {
90
- case "l":
91
- setShowLog((prev) => !prev);
92
- break;
93
- case "b":
94
- const dashUrl = jobs?.length !== 1 ? `/games/${gameId}` : `/games/${gameId}/job/${jobs[0].id}`;
95
- const url = await getShortAuthRequiredUrl(dashUrl);
96
- await open(url);
97
- break;
98
- }
99
- });
100
- const handleJobComplete = (job) => {
101
- setSuccessJobs([...successJobs, job]);
102
- const newJobs = (jobs || []).filter((prevJob) => prevJob.id !== job.id);
103
- setJobs(newJobs);
104
- if (newJobs.length === 0) {
105
- setIsComplete(true);
106
- }
107
- };
108
- const handleJobFailure = (job) => {
109
- setFailedJobs([...failedJobs, job]);
110
- handleJobComplete(job);
111
- };
112
- useEffect(() => {
113
- if (!isComplete) return;
114
- setTimeout(() => {
115
- failedJobs.length === 0 ? onComplete(successJobs) : onError("One or more jobs failed");
116
- }, 500);
117
- }, [isComplete]);
118
- if (!gameId) return /* @__PURE__ */ jsx(Fragment, {});
119
- return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", children: [
120
- jobs == null && /* @__PURE__ */ jsx(Text, { children: shipLog }),
121
- jobs && jobs.map((job) => /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginBottom: 1, children: [
122
- /* @__PURE__ */ jsx(JobStatusTable, { jobId: job.id, projectId: job.project.id, isWatching: true }),
123
- /* @__PURE__ */ jsx(Box, { flexDirection: "column", children: /* @__PURE__ */ jsx(JobProgress, { job, onComplete: handleJobComplete, onFailure: handleJobFailure }) }),
124
- showLog && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(JobLogTail, { jobId: job.id, projectId: job.project.id, isWatching: true, length: 10 }) })
125
- ] }, job.id)),
126
- jobs && !isComplete && /* @__PURE__ */ jsxs(Fragment, { children: [
127
- /* @__PURE__ */ jsx(Text, { children: "Press L to show and hide the job logs." }),
128
- /* @__PURE__ */ jsx(Text, { children: "Press B to open the ShipThis dashboard in your browser." }),
129
- /* @__PURE__ */ jsx(Text, { bold: true, children: "Please wait while ShipThis builds your game..." })
130
- ] }),
131
- isComplete && /* @__PURE__ */ jsxs(Fragment, { children: [
132
- failedJobs.length == 0 && /* @__PURE__ */ jsx(
133
- Markdown,
134
- {
135
- filename: "ship-success.md",
136
- templateVars: {
137
- gameBuildsUrl: `${WEB_URL}games/${getShortUUID(gameId)}/builds`
138
- }
139
- }
140
- ),
141
- failedJobs.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
142
- /* @__PURE__ */ jsx(
143
- Markdown,
144
- {
145
- filename: "ship-failure.md",
146
- templateVars: {
147
- jobDashboardUrl: `${WEB_URL}games/${getShortUUID(gameId)}/job/${getShortUUID(failedJobs[0].id)}`
148
- }
149
- }
150
- ),
151
- /* @__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)) })
152
- ] })
153
- ] })
154
- ] });
155
- };
156
-
157
- class GameShip extends BaseGameCommand {
158
- static args = {};
159
- static flags = {
160
- ...BaseGameCommand.flags,
161
- platform: Flags.string({
162
- description: 'The platform to ship the game to. This can be "android" or "ios"',
163
- required: false,
164
- options: ["android", "ios"]
165
- }),
166
- skipPublish: Flags.boolean({
167
- description: "Skip the publish step",
168
- required: false,
169
- default: false
170
- }),
171
- download: Flags.string({
172
- description: "Download the build artifact to the specified file",
173
- required: false,
174
- dependsOn: ["platform"]
175
- })
176
- };
177
- static description = "Builds the app (for all platforms with valid credentials) and ships it to the stores.";
178
- static examples = [
179
- "<%= config.bin %> <%= command.id %>",
180
- "<%= config.bin %> <%= command.id %> --platform ios",
181
- "<%= config.bin %> <%= command.id %> --platform android --skipPublish",
182
- "<%= config.bin %> <%= command.id %> --platform android --download output.aab"
183
- ];
184
- async run() {
185
- await this.ensureWeAreInAProjectDir();
186
- const gameId = await this.getGameId();
187
- if (!gameId) {
188
- this.error("No game ID found");
189
- }
190
- const handleComplete = async (jobs) => {
191
- if (this.flags.download) {
192
- await downloadBuildById(gameId, `${jobs[0]?.build?.id}`, this.flags.download);
193
- }
194
- process.exit(0);
195
- };
196
- const handleError = (e) => {
197
- this.error(getErrorMessage(e));
198
- };
199
- render(
200
- /* @__PURE__ */ jsx(CommandGame, { command: this, children: /* @__PURE__ */ jsx(Ship, { onComplete: handleComplete, onError: handleError }) })
201
- );
202
- }
203
- }
204
-
205
- export { GameShip as default };
@@ -1,114 +0,0 @@
1
- import { jsxs, jsx } from 'react/jsx-runtime';
2
- import { render } from 'ink';
3
- import { Flags } from '@oclif/core';
4
- import 'react';
5
- import '../../index-vMXsdSCy.js';
6
- import { B as BaseAuthenticatedCommand, I as getProject, P as Platform, k as getProjectPlatformProgress, b as getShortDate } from '../../index-DkNQs11R.js';
7
- 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 { g as getShortUUID, m as makeHumanReadable } from '../../index-BB00V5oF.js';
15
- import 'open';
16
- import 'marked';
17
- import 'marked-terminal';
18
- import 'path';
19
- import { N as NextSteps } from '../../NextSteps-CK9zHOCt.js';
20
- 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-BQCJ9Wf-.js';
27
- import 'socket.io-client';
28
- import '../../useAndroidServiceAccountTestResult-DcYDam-p.js';
29
- 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
- import 'deepmerge';
39
- import '../../Title-BCQtayg6.js';
40
-
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
- class GameStatus extends BaseAuthenticatedCommand {
61
- static args = {};
62
- static description = "Shows the status of the current game.";
63
- static examples = [
64
- "<%= config.bin %> <%= command.id %>",
65
- "<%= config.bin %> <%= command.id %> --gameId 0c179fc4"
66
- ];
67
- static flags = {
68
- gameId: Flags.string({ char: "g", description: "The ID of the game" })
69
- };
70
- async run() {
71
- const gameId = await this.getGameId();
72
- if (!gameId) {
73
- this.error("No game found - please run `shipthis game wizard` or specify a game ID with --gameId", { exit: 1 });
74
- }
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
- const progressToStatuses = (progress) => {
86
- const { platform, ...rest } = progress;
87
- return makeHumanReadable(rest);
88
- };
89
- render(
90
- /* @__PURE__ */ jsxs(Command, { command: this, children: [
91
- /* @__PURE__ */ jsx(
92
- StatusTable,
93
- {
94
- marginBottom: 1,
95
- title: "Game Details",
96
- statuses: {
97
- "Game ID": getShortUUID(game.id),
98
- Name: game.name,
99
- Version: `${game.details?.semanticVersion || "0.0.1"}`,
100
- "Build Number": `${game.details?.buildNumber || 1}`,
101
- "Created At": getShortDate(game.createdAt),
102
- "Game Engine": `${game.details?.gameEngine || "godot"} ${game.details?.gameEngineVersion || "4.3"}`
103
- }
104
- }
105
- ),
106
- statuses[Platform.IOS] && /* @__PURE__ */ jsx(StatusTable, { title: "iOS Status", statuses: progressToStatuses(statuses[Platform.IOS]) }),
107
- statuses[Platform.ANDROID] && /* @__PURE__ */ jsx(StatusTable, { title: "Android Status", statuses: progressToStatuses(statuses[Platform.ANDROID]) }),
108
- /* @__PURE__ */ jsx(NextSteps, { steps })
109
- ] })
110
- );
111
- }
112
- }
113
-
114
- export { GameStatus as default };