eoas 2.3.16 → 2.3.17-alpha

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.
@@ -11,6 +11,7 @@ export default class Publish extends Command {
11
11
  nonInteractive: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
12
  outputDir: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
13
13
  packageRunner: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
+ message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
14
15
  };
15
16
  private sanitizeFlags;
16
17
  run(): Promise<void>;
@@ -60,6 +60,11 @@ class Publish extends core_1.Command {
60
60
  description: 'Package runner to use for spawning Expo CLI commands (e.g. npx, bunx, pnpx). Can also be set via EOAS_PACKAGE_RUNNER env var. Defaults to npx.',
61
61
  required: false,
62
62
  }),
63
+ message: core_1.Flags.string({
64
+ char: 'm',
65
+ description: 'A short message describing the update. Defaults to the latest git commit message.',
66
+ required: false,
67
+ }),
63
68
  };
64
69
  sanitizeFlags(flags) {
65
70
  return {
@@ -70,6 +75,7 @@ class Publish extends core_1.Command {
70
75
  outputDir: flags.outputDir,
71
76
  packageRunner: (0, packageRunner_1.resolvePackageRunner)(flags.packageRunner, process.cwd()),
72
77
  providedDeprecatedChannel: flags.channel,
78
+ message: flags.message,
73
79
  };
74
80
  }
75
81
  async run() {
@@ -79,7 +85,7 @@ class Publish extends core_1.Command {
79
85
  process.exit(1);
80
86
  }
81
87
  const { flags } = await this.parse(Publish);
82
- const { platform, nonInteractive, branch, outputDir, packageRunner, providedDeprecatedChannel, disableRepositoryCheck, } = this.sanitizeFlags(flags);
88
+ const { platform, nonInteractive, branch, outputDir, packageRunner, providedDeprecatedChannel, disableRepositoryCheck, message, } = this.sanitizeFlags(flags);
83
89
  if (!branch) {
84
90
  log_1.default.error('Branch name is required');
85
91
  process.exit(1);
@@ -117,6 +123,10 @@ class Publish extends core_1.Command {
117
123
  }
118
124
  }
119
125
  const commitHash = await vcsClient.getCommitHashAsync();
126
+ let resolvedMessage = message;
127
+ if (!resolvedMessage && vcsClient.canGetLastCommitMessage()) {
128
+ resolvedMessage = (await vcsClient.getLastCommitMessageAsync()) ?? undefined;
129
+ }
120
130
  const runtimeSpinner = (0, ora_1.ora)('🔄 Resolving runtime version...').start();
121
131
  const runtimeVersions = [
122
132
  ...(!platform || platform === expoConfig_1.RequestedPlatform.All || platform === expoConfig_1.RequestedPlatform.Ios
@@ -226,6 +236,7 @@ class Publish extends core_1.Command {
226
236
  runtimeVersion,
227
237
  platform,
228
238
  commitHash,
239
+ message: resolvedMessage,
229
240
  })),
230
241
  runtimeVersion,
231
242
  platform,
@@ -292,7 +303,11 @@ class Publish extends core_1.Command {
292
303
  }
293
304
  const markAsFinishedSpinner = (0, ora_1.ora)('🔗 Marking the updates as finished...').start();
294
305
  const results = await Promise.all(uploadUrls.map(async ({ updateId, platform, runtimeVersion }) => {
295
- const response = await (0, fetch_1.fetchWithRetries)(`${serverUrl}/markUpdateAsUploaded/${branch}?platform=${platform}&updateId=${updateId}&runtimeVersion=${runtimeVersion}`, {
306
+ const markAsUploadedUrl = new URL(`${serverUrl}/markUpdateAsUploaded/${branch}`);
307
+ markAsUploadedUrl.searchParams.set('platform', platform);
308
+ markAsUploadedUrl.searchParams.set('updateId', updateId);
309
+ markAsUploadedUrl.searchParams.set('runtimeVersion', runtimeVersion);
310
+ const response = await (0, fetch_1.fetchWithRetries)(markAsUploadedUrl.toString(), {
296
311
  method: 'POST',
297
312
  headers: {
298
313
  ...(0, auth_1.getAuthExpoHeaders)(credentials),
@@ -121,9 +121,13 @@ class Publish extends core_1.Command {
121
121
  })),
122
122
  });
123
123
  log_1.default.log(`Re-publishing update: ${selectedUpdated.update.updateUUID}`);
124
- const republishEndpoint = `${baseUrl}/republish/${branch}?platform=${platform}&runtimeVersion=${selectedRuntimeVersion.runtimeVersion}&updateId=${selectedUpdated.update.updateId}&commitHash=${selectedUpdated.update.commitHash}`;
124
+ const republishUrl = new URL(`${baseUrl}/republish/${branch}`);
125
+ republishUrl.searchParams.set('platform', platform);
126
+ republishUrl.searchParams.set('runtimeVersion', selectedRuntimeVersion.runtimeVersion);
127
+ republishUrl.searchParams.set('updateId', selectedUpdated.update.updateId);
128
+ republishUrl.searchParams.set('commitHash', selectedUpdated.update.commitHash);
125
129
  const republishSpinner = (0, ora_1.default)('🔄 Republishing update...').start();
126
- const republishResponse = await (0, fetch_1.fetchWithRetries)(republishEndpoint, {
130
+ const republishResponse = await (0, fetch_1.fetchWithRetries)(republishUrl.toString(), {
127
131
  method: 'POST',
128
132
  headers: {
129
133
  ...(0, auth_1.getAuthExpoHeaders)(credentials),
@@ -126,8 +126,11 @@ class Publish extends core_1.Command {
126
126
  const rollbackSpinner = (0, ora_1.ora)('📦 Uploading rollback...').start();
127
127
  const erroredPlatforms = [];
128
128
  await Promise.all(runtimeVersions.map(async ({ runtimeVersion, platform }) => {
129
- const endpoint = `${baseUrl}/rollback/${branch}?commitHash=${commitHash}&platform=${platform}&runtimeVersion=${runtimeVersion}`;
130
- const response = await (0, fetch_1.fetchWithRetries)(endpoint, {
129
+ const rollbackUrl = new URL(`${baseUrl}/rollback/${branch}`);
130
+ rollbackUrl.searchParams.set('commitHash', commitHash ?? '');
131
+ rollbackUrl.searchParams.set('platform', platform);
132
+ rollbackUrl.searchParams.set('runtimeVersion', runtimeVersion ?? '');
133
+ const response = await (0, fetch_1.fetchWithRetries)(rollbackUrl.toString(), {
131
134
  method: 'POST',
132
135
  headers: {
133
136
  ...(0, auth_1.getAuthExpoHeaders)(credentials),
@@ -13,7 +13,7 @@ export interface RequestUploadUrlItem {
13
13
  fileName: string;
14
14
  filePath: string;
15
15
  }
16
- export declare function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, }: {
16
+ export declare function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, message, }: {
17
17
  body: {
18
18
  fileNames: string[];
19
19
  };
@@ -22,6 +22,7 @@ export declare function requestUploadUrls({ body, requestUploadUrl, auth, runtim
22
22
  runtimeVersion: string;
23
23
  platform: string;
24
24
  commitHash?: string;
25
+ message?: string;
25
26
  }): Promise<{
26
27
  uploadRequests: RequestUploadUrlItem[];
27
28
  updateId: string;
@@ -73,14 +73,22 @@ function computeFilesRequests(projectDir, outputDir, requestedPlatform) {
73
73
  return assets;
74
74
  }
75
75
  exports.computeFilesRequests = computeFilesRequests;
76
- async function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, }) {
77
- const response = await (0, fetch_1.fetchWithRetries)(`${requestUploadUrl}?runtimeVersion=${runtimeVersion}&platform=${platform}&commitHash=${commitHash || ''}`, {
76
+ async function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, message, }) {
77
+ const uploadUrl = new URL(requestUploadUrl);
78
+ uploadUrl.searchParams.set('runtimeVersion', runtimeVersion);
79
+ uploadUrl.searchParams.set('platform', platform);
80
+ uploadUrl.searchParams.set('commitHash', commitHash ?? '');
81
+ const requestBody = { ...body };
82
+ if (message) {
83
+ requestBody.message = message;
84
+ }
85
+ const response = await (0, fetch_1.fetchWithRetries)(uploadUrl.toString(), {
78
86
  method: 'POST',
79
87
  headers: {
80
88
  ...(0, auth_1.getAuthExpoHeaders)(auth),
81
89
  'Content-Type': 'application/json',
82
90
  },
83
- body: JSON.stringify(body),
91
+ body: JSON.stringify(requestBody),
84
92
  });
85
93
  if (!response.ok) {
86
94
  const text = await response.text();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoas",
3
- "version": "2.3.16",
3
+ "version": "2.3.17-alpha",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.json",