eoas 3.0.0-beta.10 → 3.0.0-beta.2
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.
- package/README.md +2 -2
- package/dist/commands/publish.d.ts +0 -1
- package/dist/commands/publish.js +2 -24
- package/dist/lib/assets.d.ts +1 -5
- package/dist/lib/assets.js +3 -20
- package/package.json +5 -8
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# EOAS (Expo Open Application Services)
|
|
2
2
|
|
|
3
|
-
EOAS ((Expo Open Application Services) is a powerful helper package designed to simplify the setup and update publication process for the [expo-open-ota](https://github.com/
|
|
3
|
+
EOAS ((Expo Open Application Services) is a powerful helper package designed to simplify the setup and update publication process for the [expo-open-ota](https://github.com/axelmarciano/expo-open-ota) project.
|
|
4
4
|
|
|
5
5
|
## Quick Start
|
|
6
6
|
|
|
@@ -9,7 +9,7 @@ To get started with EOAS, check out the official documentation:
|
|
|
9
9
|
|
|
10
10
|
## Learn More
|
|
11
11
|
For detailed information and to explore the core functionalities of expo-open-ota, visit the main repository:
|
|
12
|
-
[expo-open-ota on GitHub](https://github.com/
|
|
12
|
+
[expo-open-ota on GitHub](https://github.com/axelmarciano/expo-open-ota)
|
|
13
13
|
|
|
14
14
|
---
|
|
15
15
|
|
|
@@ -13,7 +13,6 @@ export default class Publish extends Command {
|
|
|
13
13
|
packageRunner: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
14
|
message: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
15
15
|
dumpSourcemap: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
16
|
-
'rollout-percentage': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
17
16
|
};
|
|
18
17
|
private sanitizeFlags;
|
|
19
18
|
run(): Promise<void>;
|
package/dist/commands/publish.js
CHANGED
|
@@ -69,11 +69,6 @@ class Publish extends core_1.Command {
|
|
|
69
69
|
description: 'Emit Hermes source maps alongside the bundle so the published artifact can be symbolicated by tools like Sentry or PostHog.',
|
|
70
70
|
default: false,
|
|
71
71
|
}),
|
|
72
|
-
'rollout-percentage': core_1.Flags.integer({
|
|
73
|
-
min: 1,
|
|
74
|
-
max: 99,
|
|
75
|
-
description: 'Publish this update as a progressive rollout served to N% of devices (1-99). The remaining devices keep receiving the previous update of each branch/runtime version. With --platform all, the rollout applies independently to each platform. Progression (increase, end, revert) is managed from the dashboard.',
|
|
76
|
-
}),
|
|
77
72
|
};
|
|
78
73
|
sanitizeFlags(flags) {
|
|
79
74
|
return {
|
|
@@ -86,7 +81,6 @@ class Publish extends core_1.Command {
|
|
|
86
81
|
providedDeprecatedChannel: flags.channel,
|
|
87
82
|
message: flags.message,
|
|
88
83
|
dumpSourcemap: flags.dumpSourcemap,
|
|
89
|
-
rolloutPercentage: flags['rollout-percentage'],
|
|
90
84
|
};
|
|
91
85
|
}
|
|
92
86
|
async run() {
|
|
@@ -96,7 +90,7 @@ class Publish extends core_1.Command {
|
|
|
96
90
|
process.exit(1);
|
|
97
91
|
}
|
|
98
92
|
const { flags } = await this.parse(Publish);
|
|
99
|
-
const { platform, nonInteractive, branch, outputDir, packageRunner, providedDeprecatedChannel, disableRepositoryCheck, message, dumpSourcemap,
|
|
93
|
+
const { platform, nonInteractive, branch, outputDir, packageRunner, providedDeprecatedChannel, disableRepositoryCheck, message, dumpSourcemap, } = this.sanitizeFlags(flags);
|
|
100
94
|
if (!branch) {
|
|
101
95
|
log_1.default.error('Branch name is required');
|
|
102
96
|
process.exit(1);
|
|
@@ -259,8 +253,6 @@ class Publish extends core_1.Command {
|
|
|
259
253
|
platform,
|
|
260
254
|
commitHash,
|
|
261
255
|
message: resolvedMessage,
|
|
262
|
-
rolloutPercentage,
|
|
263
|
-
branch,
|
|
264
256
|
})),
|
|
265
257
|
runtimeVersion,
|
|
266
258
|
platform,
|
|
@@ -326,7 +318,7 @@ class Publish extends core_1.Command {
|
|
|
326
318
|
process.exit(1);
|
|
327
319
|
}
|
|
328
320
|
const markAsFinishedSpinner = (0, ora_1.ora)('🔗 Marking the updates as finished...').start();
|
|
329
|
-
const results = await Promise.all(uploadUrls.map(async ({ updateId, platform, runtimeVersion
|
|
321
|
+
const results = await Promise.all(uploadUrls.map(async ({ updateId, platform, runtimeVersion }) => {
|
|
330
322
|
const markAsUploadedUrl = new URL(`${serverUrl}/${appId}/markUpdateAsUploaded/${branch}`);
|
|
331
323
|
markAsUploadedUrl.searchParams.set('platform', platform);
|
|
332
324
|
markAsUploadedUrl.searchParams.set('updateId', updateId);
|
|
@@ -341,27 +333,13 @@ class Publish extends core_1.Command {
|
|
|
341
333
|
// If success and status code = 200
|
|
342
334
|
if (response.ok) {
|
|
343
335
|
log_1.default.withInfo(`✅ Update ready for ${platform}`);
|
|
344
|
-
// Announce only when the server echoed the percentage back: an old server
|
|
345
|
-
// silently ignores the param and ships the update to 100% of devices.
|
|
346
|
-
if (rolloutPercentage !== undefined && echoedRolloutPercentage !== undefined) {
|
|
347
|
-
log_1.default.withInfo(`Progressive rollout started at ${rolloutPercentage}% for ${platform}. Manage it from the dashboard.`);
|
|
348
|
-
}
|
|
349
336
|
return 'deployed';
|
|
350
337
|
}
|
|
351
338
|
// If response.status === 406 duplicate update
|
|
352
339
|
if (response.status === 406) {
|
|
353
340
|
log_1.default.withInfo(`⚠️ There is no change in the update for ${platform}, ignored...`);
|
|
354
|
-
if (rolloutPercentage !== undefined) {
|
|
355
|
-
log_1.default.withInfo(`No changes detected for ${platform}, no rollout was started.`);
|
|
356
|
-
}
|
|
357
341
|
return 'identical';
|
|
358
342
|
}
|
|
359
|
-
// The partial unique index can activate a rollout on this (branch, rtv) between
|
|
360
|
-
// requestUploadUrl and markUpdateAsUploaded, closing the publish race with a 409.
|
|
361
|
-
if (response.status === 409) {
|
|
362
|
-
log_1.default.error((0, assets_1.activeRolloutConflictMessage)(branch));
|
|
363
|
-
return 'error';
|
|
364
|
-
}
|
|
365
343
|
log_1.default.error('❌ Failed to mark the update as finished for platform', platform);
|
|
366
344
|
log_1.default.newLine();
|
|
367
345
|
log_1.default.error(await response.text());
|
package/dist/lib/assets.d.ts
CHANGED
|
@@ -13,8 +13,7 @@ export interface RequestUploadUrlItem {
|
|
|
13
13
|
fileName: string;
|
|
14
14
|
filePath: string;
|
|
15
15
|
}
|
|
16
|
-
export declare function
|
|
17
|
-
export declare function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, message, rolloutPercentage, branch, }: {
|
|
16
|
+
export declare function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, message, }: {
|
|
18
17
|
body: {
|
|
19
18
|
fileNames: string[];
|
|
20
19
|
};
|
|
@@ -24,11 +23,8 @@ export declare function requestUploadUrls({ body, requestUploadUrl, auth, runtim
|
|
|
24
23
|
platform: string;
|
|
25
24
|
commitHash?: string;
|
|
26
25
|
message?: string;
|
|
27
|
-
rolloutPercentage?: number;
|
|
28
|
-
branch: string;
|
|
29
26
|
}): Promise<{
|
|
30
27
|
uploadRequests: RequestUploadUrlItem[];
|
|
31
28
|
updateId: string;
|
|
32
|
-
rolloutPercentage?: number;
|
|
33
29
|
}>;
|
|
34
30
|
export {};
|
package/dist/lib/assets.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.requestUploadUrls = exports.
|
|
3
|
+
exports.requestUploadUrls = exports.computeFilesRequests = exports.MetadataJoi = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
6
|
const joi_1 = tslib_1.__importDefault(require("joi"));
|
|
@@ -73,18 +73,11 @@ function computeFilesRequests(projectDir, outputDir, requestedPlatform) {
|
|
|
73
73
|
return assets;
|
|
74
74
|
}
|
|
75
75
|
exports.computeFilesRequests = computeFilesRequests;
|
|
76
|
-
function
|
|
77
|
-
return `A progressive rollout is already active for branch "${branch}" on this runtime version. End or revert it from the dashboard before publishing a new update.`;
|
|
78
|
-
}
|
|
79
|
-
exports.activeRolloutConflictMessage = activeRolloutConflictMessage;
|
|
80
|
-
async function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, message, rolloutPercentage, branch, }) {
|
|
76
|
+
async function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion, platform, commitHash, message, }) {
|
|
81
77
|
const uploadUrl = new URL(requestUploadUrl);
|
|
82
78
|
uploadUrl.searchParams.set('runtimeVersion', runtimeVersion);
|
|
83
79
|
uploadUrl.searchParams.set('platform', platform);
|
|
84
80
|
uploadUrl.searchParams.set('commitHash', commitHash ?? '');
|
|
85
|
-
if (rolloutPercentage !== undefined) {
|
|
86
|
-
uploadUrl.searchParams.set('rolloutPercentage', String(rolloutPercentage));
|
|
87
|
-
}
|
|
88
81
|
const requestBody = { ...body };
|
|
89
82
|
if (message) {
|
|
90
83
|
requestBody.message = message;
|
|
@@ -97,20 +90,10 @@ async function requestUploadUrls({ body, requestUploadUrl, auth, runtimeVersion,
|
|
|
97
90
|
},
|
|
98
91
|
body: JSON.stringify(requestBody),
|
|
99
92
|
});
|
|
100
|
-
if (response.status === 409) {
|
|
101
|
-
throw new Error(activeRolloutConflictMessage(branch));
|
|
102
|
-
}
|
|
103
93
|
if (!response.ok) {
|
|
104
94
|
const text = await response.text();
|
|
105
95
|
throw new Error(`Failed to request upload URL: ${text}`);
|
|
106
96
|
}
|
|
107
|
-
|
|
108
|
-
// An old server silently ignores unknown query params, so a missing echo means
|
|
109
|
-
// the rollout was not applied even though the flag was set. Abort before any
|
|
110
|
-
// file is uploaded: continuing would finalize a full 100% publish.
|
|
111
|
-
if (rolloutPercentage !== undefined && json.rolloutPercentage === undefined) {
|
|
112
|
-
throw new Error('The server ignored --rollout-percentage and would publish to 100% of devices. Update the server to a version that supports progressive rollouts, or publish without --rollout-percentage.');
|
|
113
|
-
}
|
|
114
|
-
return json;
|
|
97
|
+
return await response.json();
|
|
115
98
|
}
|
|
116
99
|
exports.requestUploadUrls = requestUploadUrls;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eoas",
|
|
3
|
-
"version": "3.0.0-beta.
|
|
3
|
+
"version": "3.0.0-beta.2",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.json",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"engines": {
|
|
11
11
|
"node": ">=18.0.0"
|
|
12
12
|
},
|
|
13
|
-
"homepage": "https://github.com/
|
|
13
|
+
"homepage": "https://github.com/axelmarciano/expo-open-ota/tree/main/eoas",
|
|
14
14
|
"keywords": [
|
|
15
15
|
"expo-open-ota",
|
|
16
16
|
"expo",
|
|
@@ -19,11 +19,8 @@
|
|
|
19
19
|
],
|
|
20
20
|
"author": "Axel Marciano",
|
|
21
21
|
"license": "MIT",
|
|
22
|
-
"description": "A CLI tool to manage publishing and OTA updates for expo-open-OTA self-hosted server. This is not an official tool from Expo but an open-source project (https://github.com/
|
|
23
|
-
"repository":
|
|
24
|
-
"type": "git",
|
|
25
|
-
"url": "git+https://github.com/mercuretechnologies/expo-open-ota.git"
|
|
26
|
-
},
|
|
22
|
+
"description": "A CLI tool to manage publishing and OTA updates for expo-open-OTA self-hosted server. This is not an official tool from Expo but an open-source project (https://github.com/axelmarciano/expo-open-ota)",
|
|
23
|
+
"repository": "axelmarciano/expo-open-ota",
|
|
27
24
|
"dependencies": {
|
|
28
25
|
"@expo/code-signing-certificates": "^0.0.5",
|
|
29
26
|
"@expo/config": "10.0.11",
|
|
@@ -85,7 +82,7 @@
|
|
|
85
82
|
"typescript": "5.3.3"
|
|
86
83
|
},
|
|
87
84
|
"bin": {
|
|
88
|
-
"eoas": "bin/run.js"
|
|
85
|
+
"eoas": "./bin/run.js"
|
|
89
86
|
},
|
|
90
87
|
"oclif": {
|
|
91
88
|
"bin": "eoas",
|