eas-cli 0.53.1 → 0.54.0
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 +130 -42
- package/build/build/runBuildAndSubmit.js +4 -2
- package/build/build/utils/url.d.ts +1 -0
- package/build/build/utils/url.js +5 -1
- package/build/commands/build/index.d.ts +0 -1
- package/build/commands/build/index.js +1 -53
- package/build/commands/config.js +0 -2
- package/build/commands/metadata/pull.d.ts +8 -0
- package/build/commands/metadata/pull.js +59 -0
- package/build/commands/metadata/push.d.ts +8 -0
- package/build/commands/metadata/push.js +51 -0
- package/build/commands/submit.js +2 -1
- package/build/commands/update/index.d.ts +12 -0
- package/build/commands/update/index.js +78 -34
- package/build/graphql/generated.d.ts +24 -12
- package/build/graphql/queries/UpdateQuery.d.ts +4 -1
- package/build/graphql/queries/UpdateQuery.js +8 -7
- package/build/metadata/apple/config/reader.js +5 -4
- package/build/metadata/apple/tasks/app-info.js +8 -6
- package/build/metadata/apple/tasks/app-version.js +16 -12
- package/build/metadata/context.js +7 -14
- package/build/metadata/download.js +9 -2
- package/build/metadata/errors.d.ts +2 -2
- package/build/metadata/errors.js +4 -2
- package/build/metadata/upload.js +3 -0
- package/build/metadata/utils/date.d.ts +1 -1
- package/build/project/ensureProjectExists.js +4 -1
- package/build/project/publish.d.ts +6 -1
- package/build/project/publish.js +16 -3
- package/build/utils/expodash/uniq.d.ts +1 -0
- package/build/{metadata/utils/array.js → utils/expodash/uniq.js} +2 -3
- package/build/utils/profiles.d.ts +3 -3
- package/build/utils/profiles.js +5 -93
- package/oclif.manifest.json +1 -1
- package/package.json +8 -4
- package/build/metadata/utils/array.d.ts +0 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const config_1 = require("@expo/config");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
8
|
+
const configure_1 = require("../../build/configure");
|
|
9
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
10
|
+
const context_1 = require("../../credentials/context");
|
|
11
|
+
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
12
|
+
const context_2 = require("../../metadata/context");
|
|
13
|
+
const download_1 = require("../../metadata/download");
|
|
14
|
+
const errors_1 = require("../../metadata/errors");
|
|
15
|
+
const projectUtils_1 = require("../../project/projectUtils");
|
|
16
|
+
const actions_1 = require("../../user/actions");
|
|
17
|
+
class MetadataPull extends EasCommand_1.default {
|
|
18
|
+
async runAsync() {
|
|
19
|
+
log_1.default.warn('EAS Metadata is in beta and subject to breaking changes.');
|
|
20
|
+
const { flags } = await this.parse(MetadataPull);
|
|
21
|
+
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
22
|
+
const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
|
|
23
|
+
await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
24
|
+
await (0, configure_1.ensureProjectConfiguredAsync)({ projectDir, nonInteractive: false });
|
|
25
|
+
const credentialsCtx = new context_1.CredentialsContext({
|
|
26
|
+
exp,
|
|
27
|
+
projectDir,
|
|
28
|
+
user: await (0, actions_1.ensureLoggedInAsync)(),
|
|
29
|
+
nonInteractive: false,
|
|
30
|
+
});
|
|
31
|
+
const metadataCtx = await (0, context_2.createMetadataContextAsync)({
|
|
32
|
+
credentialsCtx,
|
|
33
|
+
projectDir,
|
|
34
|
+
exp,
|
|
35
|
+
profileName: flags.profile,
|
|
36
|
+
});
|
|
37
|
+
try {
|
|
38
|
+
const filePath = await (0, download_1.downloadMetadataAsync)(metadataCtx);
|
|
39
|
+
const relativePath = path_1.default.relative(process.cwd(), filePath);
|
|
40
|
+
log_1.default.addNewLineIfNone();
|
|
41
|
+
log_1.default.log(`🎉 Your store configuration is ready.
|
|
42
|
+
|
|
43
|
+
- Update the ${chalk_1.default.bold(relativePath)} file to prepare the app information.
|
|
44
|
+
- Run ${chalk_1.default.bold('eas submit')} or manually upload a new app version to the app stores.
|
|
45
|
+
- Once the app is uploaded, run ${chalk_1.default.bold('eas metadata:push')} to sync the store configuration.
|
|
46
|
+
- ${(0, log_1.learnMore)('https://docs.expo.dev/eas-metadata/introduction/')}`);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
(0, errors_1.handleMetadataError)(error);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.default = MetadataPull;
|
|
54
|
+
MetadataPull.description = 'generate the local store configuration from the app stores';
|
|
55
|
+
MetadataPull.flags = {
|
|
56
|
+
profile: core_1.Flags.string({
|
|
57
|
+
description: 'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
58
|
+
}),
|
|
59
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
export default class MetadataPush extends EasCommand {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
|
|
6
|
+
};
|
|
7
|
+
runAsync(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const config_1 = require("@expo/config");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const configure_1 = require("../../build/configure");
|
|
7
|
+
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
8
|
+
const context_1 = require("../../credentials/context");
|
|
9
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
10
|
+
const context_2 = require("../../metadata/context");
|
|
11
|
+
const errors_1 = require("../../metadata/errors");
|
|
12
|
+
const upload_1 = require("../../metadata/upload");
|
|
13
|
+
const projectUtils_1 = require("../../project/projectUtils");
|
|
14
|
+
const actions_1 = require("../../user/actions");
|
|
15
|
+
class MetadataPush extends EasCommand_1.default {
|
|
16
|
+
async runAsync() {
|
|
17
|
+
log_1.default.warn('EAS Metadata is in beta and subject to breaking changes.');
|
|
18
|
+
const { flags } = await this.parse(MetadataPush);
|
|
19
|
+
const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
|
|
20
|
+
const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
|
|
21
|
+
await (0, projectUtils_1.getProjectIdAsync)(exp);
|
|
22
|
+
await (0, configure_1.ensureProjectConfiguredAsync)({ projectDir, nonInteractive: false });
|
|
23
|
+
const credentialsCtx = new context_1.CredentialsContext({
|
|
24
|
+
exp,
|
|
25
|
+
projectDir,
|
|
26
|
+
user: await (0, actions_1.ensureLoggedInAsync)(),
|
|
27
|
+
nonInteractive: false,
|
|
28
|
+
});
|
|
29
|
+
const metadataCtx = await (0, context_2.createMetadataContextAsync)({
|
|
30
|
+
credentialsCtx,
|
|
31
|
+
projectDir,
|
|
32
|
+
exp,
|
|
33
|
+
profileName: flags.profile,
|
|
34
|
+
});
|
|
35
|
+
try {
|
|
36
|
+
await (0, upload_1.uploadMetadataAsync)(metadataCtx);
|
|
37
|
+
log_1.default.addNewLineIfNone();
|
|
38
|
+
log_1.default.log(`🎉 Store configuration is synced with the app stores.`);
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
(0, errors_1.handleMetadataError)(error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.default = MetadataPush;
|
|
46
|
+
MetadataPush.description = 'sync the local store configuration to the app stores';
|
|
47
|
+
MetadataPush.flags = {
|
|
48
|
+
profile: core_1.Flags.string({
|
|
49
|
+
description: 'Name of the submit profile from eas.json. Defaults to "production" if defined in eas.json.',
|
|
50
|
+
}),
|
|
51
|
+
};
|
package/build/commands/submit.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const eas_json_1 = require("@expo/eas-json");
|
|
4
5
|
const core_1 = require("@oclif/core");
|
|
5
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
7
|
const EasCommand_1 = tslib_1.__importDefault(require("../commandUtils/EasCommand"));
|
|
@@ -23,7 +24,7 @@ class Submit extends EasCommand_1.default {
|
|
|
23
24
|
const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
|
|
24
25
|
const submissionProfiles = await (0, profiles_1.getProfilesAsync)({
|
|
25
26
|
type: 'submit',
|
|
26
|
-
projectDir,
|
|
27
|
+
easJsonReader: new eas_json_1.EasJsonReader(projectDir),
|
|
27
28
|
platforms,
|
|
28
29
|
profileName: flags.profile,
|
|
29
30
|
});
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
+
import { ViewBranchUpdatesQuery } from '../../graphql/generated';
|
|
2
3
|
import { PublishPlatform } from '../../project/publish';
|
|
3
4
|
export declare const defaultPublishPlatforms: PublishPlatform[];
|
|
5
|
+
export declare type PublishPlatformFlag = PublishPlatform | 'all';
|
|
6
|
+
export declare function ensureBranchExistsAsync({ appId, name: branchName, limit, offset, }: {
|
|
7
|
+
appId: string;
|
|
8
|
+
name: string;
|
|
9
|
+
limit?: number;
|
|
10
|
+
offset?: number;
|
|
11
|
+
}): Promise<{
|
|
12
|
+
id: string;
|
|
13
|
+
updates: Exclude<Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'], null | undefined>['updates'];
|
|
14
|
+
}>;
|
|
4
15
|
export default class UpdatePublish extends EasCommand {
|
|
5
16
|
static description: string;
|
|
6
17
|
static flags: {
|
|
@@ -18,3 +29,4 @@ export default class UpdatePublish extends EasCommand {
|
|
|
18
29
|
};
|
|
19
30
|
runAsync(): Promise<void>;
|
|
20
31
|
}
|
|
32
|
+
export declare function getUpdatesToRepublishInteractiveAsync(projectId: string, branchName: string, platformFlag: string, pageSize: number, offset?: number, cumulativeUpdates?: Exclude<Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'], null | undefined>['updates']): Promise<Exclude<Exclude<ViewBranchUpdatesQuery['app'], null | undefined>['byId']['updateBranchByName'], null | undefined>['updates']>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultPublishPlatforms = void 0;
|
|
3
|
+
exports.getUpdatesToRepublishInteractiveAsync = exports.ensureBranchExistsAsync = exports.defaultPublishPlatforms = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const config_plugins_1 = require("@expo/config-plugins");
|
|
6
6
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
@@ -11,12 +11,13 @@ const dateformat_1 = tslib_1.__importDefault(require("dateformat"));
|
|
|
11
11
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
12
12
|
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
13
13
|
const api_1 = require("../../api");
|
|
14
|
+
const url_1 = require("../../build/utils/url");
|
|
14
15
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
15
16
|
const fetch_1 = tslib_1.__importDefault(require("../../fetch"));
|
|
16
17
|
const client_1 = require("../../graphql/client");
|
|
17
18
|
const PublishMutation_1 = require("../../graphql/mutations/PublishMutation");
|
|
18
19
|
const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
|
|
19
|
-
const log_1 = tslib_1.
|
|
20
|
+
const log_1 = tslib_1.__importStar(require("../../log"));
|
|
20
21
|
const ora_1 = require("../../ora");
|
|
21
22
|
const expoConfig_1 = require("../../project/expoConfig");
|
|
22
23
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
@@ -24,6 +25,7 @@ const publish_1 = require("../../project/publish");
|
|
|
24
25
|
const workflow_1 = require("../../project/workflow");
|
|
25
26
|
const prompts_1 = require("../../prompts");
|
|
26
27
|
const utils_1 = require("../../update/utils");
|
|
28
|
+
const actions_1 = require("../../user/actions");
|
|
27
29
|
const code_signing_1 = require("../../utils/code-signing");
|
|
28
30
|
const uniqBy_1 = tslib_1.__importDefault(require("../../utils/expodash/uniqBy"));
|
|
29
31
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
@@ -70,10 +72,12 @@ async function ensureChannelExistsAsync({ appId, branchId, channelName, }) {
|
|
|
70
72
|
}
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
|
-
async function ensureBranchExistsAsync({ appId, name: branchName, }) {
|
|
75
|
+
async function ensureBranchExistsAsync({ appId, name: branchName, limit, offset, }) {
|
|
74
76
|
const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
|
|
75
77
|
appId,
|
|
76
78
|
name: branchName,
|
|
79
|
+
limit,
|
|
80
|
+
offset,
|
|
77
81
|
});
|
|
78
82
|
const updateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
|
|
79
83
|
if (updateBranch) {
|
|
@@ -86,6 +90,7 @@ async function ensureBranchExistsAsync({ appId, name: branchName, }) {
|
|
|
86
90
|
await ensureChannelExistsAsync({ appId, branchId: newUpdateBranch.id, channelName: branchName });
|
|
87
91
|
return { id: newUpdateBranch.id, updates: [] };
|
|
88
92
|
}
|
|
93
|
+
exports.ensureBranchExistsAsync = ensureBranchExistsAsync;
|
|
89
94
|
class UpdatePublish extends EasCommand_1.default {
|
|
90
95
|
async runAsync() {
|
|
91
96
|
var _a, _b, _c;
|
|
@@ -159,12 +164,9 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
159
164
|
}
|
|
160
165
|
(0, assert_1.default)(branchName, 'Branch name must be specified.');
|
|
161
166
|
}
|
|
162
|
-
const { id: branchId, updates } = await ensureBranchExistsAsync({
|
|
163
|
-
appId: projectId,
|
|
164
|
-
name: branchName,
|
|
165
|
-
});
|
|
166
167
|
let unsortedUpdateInfoGroups = {};
|
|
167
168
|
let oldMessage, oldRuntimeVersion;
|
|
169
|
+
let uploadedAssetCount = 0;
|
|
168
170
|
if (republish) {
|
|
169
171
|
// If we are republishing, we don't need to worry about building the bundle or uploading the assets.
|
|
170
172
|
// Instead we get the `updateInfoGroup` from the update we wish to republish.
|
|
@@ -180,26 +182,13 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
180
182
|
if (jsonFlag) {
|
|
181
183
|
throw new Error('You must specify the update group to republish.');
|
|
182
184
|
}
|
|
183
|
-
|
|
184
|
-
.filter(update => {
|
|
185
|
-
// Only show groups that have updates on the specified platform(s).
|
|
186
|
-
return platformFlag === 'all' || update.platform === platformFlag;
|
|
187
|
-
})
|
|
188
|
-
.map(update => ({
|
|
189
|
-
title: formatUpdateTitle(update),
|
|
190
|
-
value: update.group,
|
|
191
|
-
}));
|
|
192
|
-
if (updateGroups.length === 0) {
|
|
193
|
-
throw new Error(`There are no updates on branch "${branchName}" published on the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`);
|
|
194
|
-
}
|
|
195
|
-
const selectedUpdateGroup = await (0, prompts_1.selectAsync)('which update would you like to republish?', updateGroups);
|
|
196
|
-
updatesToRepublish = updates.filter(update => update.group === selectedUpdateGroup);
|
|
185
|
+
updatesToRepublish = await getUpdatesToRepublishInteractiveAsync(projectId, branchName, platformFlag, 50);
|
|
197
186
|
}
|
|
198
187
|
const updatesToRepublishFilteredByPlatform = updatesToRepublish.filter(
|
|
199
188
|
// Only republish to the specified platforms
|
|
200
189
|
update => platformFlag === 'all' || update.platform === platformFlag);
|
|
201
190
|
if (updatesToRepublishFilteredByPlatform.length === 0) {
|
|
202
|
-
throw new Error(`There are no updates on branch "${branchName}" published
|
|
191
|
+
throw new Error(`There are no updates on branch "${branchName}" published for the platform(s) "${platformFlag}" with group ID "${group ? group : updatesToRepublish[0].group}". Did you mean to publish a new update instead?`);
|
|
203
192
|
}
|
|
204
193
|
let publicationPlatformMessage;
|
|
205
194
|
if (platformFlag === 'all') {
|
|
@@ -276,9 +265,13 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
276
265
|
try {
|
|
277
266
|
const platforms = platformFlag === 'all' ? exports.defaultPublishPlatforms : [platformFlag];
|
|
278
267
|
const assets = await (0, publish_1.collectAssetsAsync)({ inputDir: inputDir, platforms });
|
|
279
|
-
await (0, publish_1.uploadAssetsAsync)(assets);
|
|
268
|
+
const { uniqueUploadedAssetCount } = await (0, publish_1.uploadAssetsAsync)(assets, spinnerText => (assetSpinner.text = `Uploading assets... ${spinnerText}`));
|
|
269
|
+
uploadedAssetCount = uniqueUploadedAssetCount;
|
|
280
270
|
unsortedUpdateInfoGroups = await (0, publish_1.buildUnsortedUpdateInfoGroupAsync)(assets, exp);
|
|
281
|
-
|
|
271
|
+
const uploadAssetSuccessMessage = uploadedAssetCount
|
|
272
|
+
? `Uploaded ${uploadedAssetCount} ${uploadedAssetCount === 1 ? 'asset' : 'assets'}!`
|
|
273
|
+
: `Uploading assets skipped -- no new assets found!`;
|
|
274
|
+
assetSpinner.succeed(uploadAssetSuccessMessage);
|
|
282
275
|
}
|
|
283
276
|
catch (e) {
|
|
284
277
|
assetSpinner.fail('Failed to upload assets');
|
|
@@ -291,6 +284,11 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
291
284
|
.filter(pair => pair[1] === runtime)
|
|
292
285
|
.map(pair => pair[0]);
|
|
293
286
|
}
|
|
287
|
+
const { id: branchId } = await ensureBranchExistsAsync({
|
|
288
|
+
appId: projectId,
|
|
289
|
+
name: branchName,
|
|
290
|
+
limit: 0,
|
|
291
|
+
});
|
|
294
292
|
// Sort the updates into different groups based on their platform specific runtime versions
|
|
295
293
|
const updateGroups = Object.entries(runtimeToPlatformMapping).map(([runtime, platforms]) => {
|
|
296
294
|
const localUpdateInfoGroup = Object.fromEntries(platforms.map(platform => [
|
|
@@ -355,19 +353,29 @@ class UpdatePublish extends EasCommand_1.default {
|
|
|
355
353
|
}
|
|
356
354
|
log_1.default.addNewLineIfNone();
|
|
357
355
|
for (const runtime of new Set(Object.values(runtimeVersions))) {
|
|
358
|
-
const
|
|
359
|
-
|
|
360
|
-
.map(update => update.platform);
|
|
361
|
-
const newUpdate = newUpdates.find(update => update.runtimeVersion === runtime);
|
|
362
|
-
if (!newUpdate) {
|
|
356
|
+
const newUpdatesForRuntimeVersion = newUpdates.filter(update => update.runtimeVersion === runtime);
|
|
357
|
+
if (!newUpdatesForRuntimeVersion.length) {
|
|
363
358
|
throw new Error(`Publish response is missing updates with runtime ${runtime}.`);
|
|
364
359
|
}
|
|
360
|
+
const platforms = newUpdatesForRuntimeVersion.map(update => update.platform);
|
|
361
|
+
const newAndroidUpdate = newUpdatesForRuntimeVersion.find(update => update.platform === 'android');
|
|
362
|
+
const newIosUpdate = newUpdatesForRuntimeVersion.find(update => update.platform === 'ios');
|
|
363
|
+
const updateGroupId = newUpdatesForRuntimeVersion[0].group;
|
|
364
|
+
const projectName = exp.slug;
|
|
365
|
+
const accountName = (0, projectUtils_1.getProjectAccountName)(exp, await (0, actions_1.ensureLoggedInAsync)());
|
|
366
|
+
const updateGroupUrl = (0, url_1.getUpdateGroupUrl)(accountName, projectName, updateGroupId);
|
|
367
|
+
const updateGroupLink = (0, log_1.link)(updateGroupUrl, { dim: false });
|
|
365
368
|
log_1.default.log((0, formatFields_1.default)([
|
|
366
|
-
{ label: '
|
|
367
|
-
{ label: '
|
|
368
|
-
{ label: '
|
|
369
|
-
{ label: '
|
|
370
|
-
|
|
369
|
+
{ label: 'Branch', value: branchName },
|
|
370
|
+
{ label: 'Runtime version', value: runtime },
|
|
371
|
+
{ label: 'Platform', value: platforms.join(', ') },
|
|
372
|
+
{ label: 'Update group ID', value: updateGroupId },
|
|
373
|
+
...(newAndroidUpdate
|
|
374
|
+
? [{ label: 'Android update ID', value: newAndroidUpdate.id }]
|
|
375
|
+
: []),
|
|
376
|
+
...(newIosUpdate ? [{ label: 'iOS update ID', value: newIosUpdate.id }] : []),
|
|
377
|
+
{ label: 'Message', value: message },
|
|
378
|
+
{ label: 'Website link', value: updateGroupLink },
|
|
371
379
|
]));
|
|
372
380
|
log_1.default.addNewLineIfNone();
|
|
373
381
|
}
|
|
@@ -425,6 +433,42 @@ UpdatePublish.flags = {
|
|
|
425
433
|
description: 'Run command in non-interactive mode',
|
|
426
434
|
}),
|
|
427
435
|
};
|
|
436
|
+
async function getUpdatesToRepublishInteractiveAsync(projectId, branchName, platformFlag, pageSize, offset = 0, cumulativeUpdates = []) {
|
|
437
|
+
const fetchMoreValue = '_fetchMore';
|
|
438
|
+
const { updates } = await ensureBranchExistsAsync({
|
|
439
|
+
appId: projectId,
|
|
440
|
+
name: branchName,
|
|
441
|
+
limit: pageSize + 1,
|
|
442
|
+
offset,
|
|
443
|
+
});
|
|
444
|
+
cumulativeUpdates = [
|
|
445
|
+
...cumulativeUpdates,
|
|
446
|
+
// drop that extra item used for pagination from our render logic
|
|
447
|
+
...updates.slice(0, updates.length - 1),
|
|
448
|
+
];
|
|
449
|
+
const cumulativeUpdatesForTargetPlatforms = platformFlag === 'all'
|
|
450
|
+
? cumulativeUpdates
|
|
451
|
+
: cumulativeUpdates.filter(update => {
|
|
452
|
+
// Only show groups that have updates on the specified platform(s).
|
|
453
|
+
return update.platform === platformFlag;
|
|
454
|
+
});
|
|
455
|
+
const updateGroups = (0, uniqBy_1.default)(cumulativeUpdatesForTargetPlatforms, u => u.group).map(update => ({
|
|
456
|
+
title: formatUpdateTitle(update),
|
|
457
|
+
value: update.group,
|
|
458
|
+
}));
|
|
459
|
+
if (!updateGroups.length) {
|
|
460
|
+
throw new Error(`There are no updates on branch "${branchName}" published for the platform(s) ${platformFlag}. Did you mean to publish a new update instead?`);
|
|
461
|
+
}
|
|
462
|
+
if (updates.length > pageSize) {
|
|
463
|
+
updateGroups.push({ title: 'Next page...', value: fetchMoreValue });
|
|
464
|
+
}
|
|
465
|
+
const selectedUpdateGroup = await (0, prompts_1.selectAsync)('Which update would you like to republish?', updateGroups);
|
|
466
|
+
if (selectedUpdateGroup === fetchMoreValue) {
|
|
467
|
+
return await getUpdatesToRepublishInteractiveAsync(projectId, branchName, platformFlag, pageSize, offset + pageSize, cumulativeUpdates);
|
|
468
|
+
}
|
|
469
|
+
return cumulativeUpdates.filter(update => update.group === selectedUpdateGroup);
|
|
470
|
+
}
|
|
471
|
+
exports.getUpdatesToRepublishInteractiveAsync = getUpdatesToRepublishInteractiveAsync;
|
|
428
472
|
async function getRuntimeVersionObjectAsync(exp, platformFlag, projectDir) {
|
|
429
473
|
var _a, _b;
|
|
430
474
|
const platforms = (platformFlag === 'all' ? ['android', 'ios'] : [platformFlag]);
|
|
@@ -1301,10 +1301,13 @@ export declare type Build = ActivityTimelineProjectActivity & BuildOrBuildJob &
|
|
|
1301
1301
|
appVersion?: Maybe<Scalars['String']>;
|
|
1302
1302
|
artifacts?: Maybe<BuildArtifacts>;
|
|
1303
1303
|
buildProfile?: Maybe<Scalars['String']>;
|
|
1304
|
+
canRetry: Scalars['Boolean'];
|
|
1304
1305
|
cancelingActor?: Maybe<Actor>;
|
|
1305
1306
|
channel?: Maybe<Scalars['String']>;
|
|
1306
|
-
|
|
1307
|
+
completedAt?: Maybe<Scalars['DateTime']>;
|
|
1308
|
+
createdAt: Scalars['DateTime'];
|
|
1307
1309
|
distribution?: Maybe<DistributionType>;
|
|
1310
|
+
enqueuedAt?: Maybe<Scalars['DateTime']>;
|
|
1308
1311
|
error?: Maybe<BuildError>;
|
|
1309
1312
|
estimatedWaitTimeLeftSeconds?: Maybe<Scalars['Int']>;
|
|
1310
1313
|
expirationDate?: Maybe<Scalars['DateTime']>;
|
|
@@ -1319,9 +1322,11 @@ export declare type Build = ActivityTimelineProjectActivity & BuildOrBuildJob &
|
|
|
1319
1322
|
isGitWorkingTreeDirty?: Maybe<Scalars['Boolean']>;
|
|
1320
1323
|
logFiles: Array<Scalars['String']>;
|
|
1321
1324
|
metrics?: Maybe<BuildMetrics>;
|
|
1325
|
+
parentBuild?: Maybe<Build>;
|
|
1322
1326
|
platform: AppPlatform;
|
|
1323
1327
|
priority: BuildPriority;
|
|
1324
1328
|
project: Project;
|
|
1329
|
+
provisioningStartedAt?: Maybe<Scalars['DateTime']>;
|
|
1325
1330
|
/** Queue position is 1-indexed */
|
|
1326
1331
|
queuePosition?: Maybe<Scalars['Int']>;
|
|
1327
1332
|
reactNativeVersion?: Maybe<Scalars['String']>;
|
|
@@ -1330,7 +1335,8 @@ export declare type Build = ActivityTimelineProjectActivity & BuildOrBuildJob &
|
|
|
1330
1335
|
sdkVersion?: Maybe<Scalars['String']>;
|
|
1331
1336
|
status: BuildStatus;
|
|
1332
1337
|
submissions: Array<Submission>;
|
|
1333
|
-
updatedAt
|
|
1338
|
+
updatedAt: Scalars['DateTime'];
|
|
1339
|
+
workerStartedAt?: Maybe<Scalars['DateTime']>;
|
|
1334
1340
|
};
|
|
1335
1341
|
export declare type BuildArtifact = {
|
|
1336
1342
|
__typename?: 'BuildArtifact';
|
|
@@ -1482,6 +1488,8 @@ export declare type BuildMutation = {
|
|
|
1482
1488
|
createIosBuild: CreateBuildResult;
|
|
1483
1489
|
/** Delete an EAS Build build */
|
|
1484
1490
|
deleteBuild: Build;
|
|
1491
|
+
/** Retry an EAS Build build */
|
|
1492
|
+
retryBuild: Build;
|
|
1485
1493
|
};
|
|
1486
1494
|
export declare type BuildMutationCancelBuildArgs = {
|
|
1487
1495
|
buildId: Scalars['ID'];
|
|
@@ -1499,6 +1507,9 @@ export declare type BuildMutationCreateIosBuildArgs = {
|
|
|
1499
1507
|
export declare type BuildMutationDeleteBuildArgs = {
|
|
1500
1508
|
buildId: Scalars['ID'];
|
|
1501
1509
|
};
|
|
1510
|
+
export declare type BuildMutationRetryBuildArgs = {
|
|
1511
|
+
buildId: Scalars['ID'];
|
|
1512
|
+
};
|
|
1502
1513
|
export declare type BuildOrBuildJob = {
|
|
1503
1514
|
id: Scalars['ID'];
|
|
1504
1515
|
};
|
|
@@ -5765,8 +5776,8 @@ export declare type CreateAndroidBuildMutation = {
|
|
|
5765
5776
|
queuePosition?: number | null;
|
|
5766
5777
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
5767
5778
|
priority: BuildPriority;
|
|
5768
|
-
createdAt
|
|
5769
|
-
updatedAt
|
|
5779
|
+
createdAt: any;
|
|
5780
|
+
updatedAt: any;
|
|
5770
5781
|
error?: {
|
|
5771
5782
|
__typename?: 'BuildError';
|
|
5772
5783
|
errorCode: string;
|
|
@@ -5842,8 +5853,8 @@ export declare type CreateIosBuildMutation = {
|
|
|
5842
5853
|
queuePosition?: number | null;
|
|
5843
5854
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
5844
5855
|
priority: BuildPriority;
|
|
5845
|
-
createdAt
|
|
5846
|
-
updatedAt
|
|
5856
|
+
createdAt: any;
|
|
5857
|
+
updatedAt: any;
|
|
5847
5858
|
error?: {
|
|
5848
5859
|
__typename?: 'BuildError';
|
|
5849
5860
|
errorCode: string;
|
|
@@ -6200,8 +6211,8 @@ export declare type BuildsByIdQuery = {
|
|
|
6200
6211
|
queuePosition?: number | null;
|
|
6201
6212
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
6202
6213
|
priority: BuildPriority;
|
|
6203
|
-
createdAt
|
|
6204
|
-
updatedAt
|
|
6214
|
+
createdAt: any;
|
|
6215
|
+
updatedAt: any;
|
|
6205
6216
|
error?: {
|
|
6206
6217
|
__typename?: 'BuildError';
|
|
6207
6218
|
errorCode: string;
|
|
@@ -6273,8 +6284,8 @@ export declare type GetAllBuildsForAppQuery = {
|
|
|
6273
6284
|
queuePosition?: number | null;
|
|
6274
6285
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
6275
6286
|
priority: BuildPriority;
|
|
6276
|
-
createdAt
|
|
6277
|
-
updatedAt
|
|
6287
|
+
createdAt: any;
|
|
6288
|
+
updatedAt: any;
|
|
6278
6289
|
error?: {
|
|
6279
6290
|
__typename?: 'BuildError';
|
|
6280
6291
|
errorCode: string;
|
|
@@ -6563,6 +6574,7 @@ export declare type ViewBranchUpdatesQueryVariables = Exact<{
|
|
|
6563
6574
|
appId: Scalars['String'];
|
|
6564
6575
|
name: Scalars['String'];
|
|
6565
6576
|
limit: Scalars['Int'];
|
|
6577
|
+
offset: Scalars['Int'];
|
|
6566
6578
|
}>;
|
|
6567
6579
|
export declare type ViewBranchUpdatesQuery = {
|
|
6568
6580
|
__typename?: 'RootQuery';
|
|
@@ -6689,8 +6701,8 @@ export declare type BuildFragment = {
|
|
|
6689
6701
|
queuePosition?: number | null;
|
|
6690
6702
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
6691
6703
|
priority: BuildPriority;
|
|
6692
|
-
createdAt
|
|
6693
|
-
updatedAt
|
|
6704
|
+
createdAt: any;
|
|
6705
|
+
updatedAt: any;
|
|
6694
6706
|
error?: {
|
|
6695
6707
|
__typename?: 'BuildError';
|
|
6696
6708
|
errorCode: string;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { ViewAllUpdatesQuery, ViewBranchUpdatesQuery, ViewBranchUpdatesQueryVariables } from '../generated';
|
|
2
|
+
export declare const viewBranchUpdatesQueryUpdateLimit = 300;
|
|
3
|
+
declare type ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset = Partial<ViewBranchUpdatesQueryVariables> & Pick<ViewBranchUpdatesQueryVariables, 'appId' | 'name'>;
|
|
2
4
|
export declare const UpdateQuery: {
|
|
3
5
|
viewAllAsync({ appId }: {
|
|
4
6
|
appId: string;
|
|
5
7
|
}): Promise<ViewAllUpdatesQuery>;
|
|
6
|
-
viewBranchAsync({ appId, name
|
|
8
|
+
viewBranchAsync({ appId, name, limit, offset, }: ViewBranchUpdatesQueryVariablesWithOptionalLimitAndOffset): Promise<ViewBranchUpdatesQuery>;
|
|
7
9
|
};
|
|
10
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.UpdateQuery = void 0;
|
|
3
|
+
exports.UpdateQuery = exports.viewBranchUpdatesQueryUpdateLimit = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
6
6
|
const client_1 = require("../client");
|
|
7
|
-
|
|
7
|
+
exports.viewBranchUpdatesQueryUpdateLimit = 300;
|
|
8
8
|
exports.UpdateQuery = {
|
|
9
9
|
async viewAllAsync({ appId }) {
|
|
10
10
|
return (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
@@ -39,21 +39,21 @@ exports.UpdateQuery = {
|
|
|
39
39
|
}
|
|
40
40
|
`, {
|
|
41
41
|
appId,
|
|
42
|
-
limit:
|
|
42
|
+
limit: exports.viewBranchUpdatesQueryUpdateLimit,
|
|
43
43
|
}, { additionalTypenames: ['UpdateBranch', 'Update'] })
|
|
44
44
|
.toPromise());
|
|
45
45
|
},
|
|
46
|
-
async viewBranchAsync({ appId, name }) {
|
|
46
|
+
async viewBranchAsync({ appId, name, limit = exports.viewBranchUpdatesQueryUpdateLimit, offset = 0, }) {
|
|
47
47
|
return (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
|
|
48
48
|
.query((0, graphql_tag_1.default) `
|
|
49
|
-
query ViewBranchUpdates($appId: String!, $name: String!, $limit: Int!) {
|
|
49
|
+
query ViewBranchUpdates($appId: String!, $name: String!, $limit: Int!, $offset: Int!) {
|
|
50
50
|
app {
|
|
51
51
|
byId(appId: $appId) {
|
|
52
52
|
id
|
|
53
53
|
updateBranchByName(name: $name) {
|
|
54
54
|
id
|
|
55
55
|
name
|
|
56
|
-
updates(offset:
|
|
56
|
+
updates(offset: $offset, limit: $limit) {
|
|
57
57
|
id
|
|
58
58
|
group
|
|
59
59
|
message
|
|
@@ -78,7 +78,8 @@ exports.UpdateQuery = {
|
|
|
78
78
|
`, {
|
|
79
79
|
appId,
|
|
80
80
|
name,
|
|
81
|
-
limit
|
|
81
|
+
limit,
|
|
82
|
+
offset,
|
|
82
83
|
}, { additionalTypenames: ['UpdateBranch', 'Update'] })
|
|
83
84
|
.toPromise());
|
|
84
85
|
},
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.AppleConfigReader = exports.DEFAULT_WHATSNEW = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const apple_utils_1 = require("@expo/apple-utils");
|
|
5
|
-
const
|
|
6
|
+
const uniq_1 = tslib_1.__importDefault(require("../../../utils/expodash/uniq"));
|
|
6
7
|
const date_1 = require("../../utils/date");
|
|
7
8
|
// TODO: find out if we can move this to default JSON schema normalization
|
|
8
9
|
exports.DEFAULT_WHATSNEW = 'Bug fixes and improved stability';
|
|
@@ -19,17 +20,17 @@ class AppleConfigReader {
|
|
|
19
20
|
}
|
|
20
21
|
getLocales() {
|
|
21
22
|
// TODO: filter "default" locales, add option to add non-localized info to the config
|
|
22
|
-
return (0,
|
|
23
|
+
return (0, uniq_1.default)(Object.keys(this.schema.info || {}));
|
|
23
24
|
}
|
|
24
25
|
getInfoLocale(locale) {
|
|
25
|
-
var _a;
|
|
26
|
+
var _a, _b;
|
|
26
27
|
const info = (_a = this.schema.info) === null || _a === void 0 ? void 0 : _a[locale];
|
|
27
28
|
if (!info) {
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
30
31
|
return {
|
|
31
32
|
locale,
|
|
32
|
-
name: info.title
|
|
33
|
+
name: (_b = info.title) !== null && _b !== void 0 ? _b : 'no name provided',
|
|
33
34
|
subtitle: info.subtitle,
|
|
34
35
|
privacyChoicesUrl: info.privacyChoicesUrl,
|
|
35
36
|
privacyPolicyText: info.privacyPolicyText,
|
|
@@ -56,12 +56,14 @@ class AppInfoTask extends task_1.AppleTask {
|
|
|
56
56
|
continue;
|
|
57
57
|
}
|
|
58
58
|
const model = context.infoLocales.find(model => model.attributes.locale === locale);
|
|
59
|
-
await (0, log_2.logAsync)(() =>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
await (0, log_2.logAsync)(async () => {
|
|
60
|
+
return model
|
|
61
|
+
? await model.updateAsync(attributes)
|
|
62
|
+
: await context.info.createLocalizationAsync({ ...attributes, locale });
|
|
63
|
+
}, {
|
|
64
|
+
pending: `${model ? 'Updating' : 'Creating'} localized info for ${chalk_1.default.bold(locale)}...`,
|
|
65
|
+
success: `${model ? 'Updated' : 'Created'} localized info for ${chalk_1.default.bold(locale)}`,
|
|
66
|
+
failure: `Failed ${model ? 'updating' : 'creating'} localized info for ${chalk_1.default.bold(locale)}`,
|
|
65
67
|
});
|
|
66
68
|
}
|
|
67
69
|
context.infoLocales = await context.info.getLocalizationsAsync();
|