eas-cli 0.55.1 → 0.58.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 +58 -49
- package/build/branch/queries.d.ts +5 -0
- package/build/branch/queries.js +87 -0
- package/build/build/android/build.js +17 -3
- package/build/build/android/graphql.js +2 -0
- package/build/build/android/prepareJob.js +5 -0
- package/build/build/android/syncProjectConfiguration.d.ts +3 -4
- package/build/build/android/syncProjectConfiguration.js +2 -3
- package/build/build/android/version.d.ts +16 -0
- package/build/build/android/version.js +86 -9
- package/build/build/build.js +8 -3
- package/build/build/context.d.ts +7 -3
- package/build/build/createContext.d.ts +5 -2
- package/build/build/createContext.js +9 -1
- package/build/build/ios/build.js +18 -17
- package/build/build/ios/graphql.js +2 -0
- package/build/build/ios/prepareJob.js +5 -0
- package/build/build/ios/syncProjectConfiguration.d.ts +5 -6
- package/build/build/ios/syncProjectConfiguration.js +3 -4
- package/build/build/ios/version.d.ts +23 -3
- package/build/build/ios/version.js +128 -28
- package/build/build/local.d.ts +2 -2
- package/build/build/local.js +7 -7
- package/build/build/metadata.d.ts +1 -0
- package/build/build/metadata.js +32 -6
- package/build/build/runBuildAndSubmit.d.ts +1 -0
- package/build/build/runBuildAndSubmit.js +29 -7
- package/build/build/utils/printBuildInfo.d.ts +1 -1
- package/build/build/utils/printBuildInfo.js +7 -13
- package/build/commandUtils/pagination.d.ts +13 -0
- package/build/commandUtils/pagination.js +42 -0
- package/build/commands/branch/list.d.ts +3 -4
- package/build/commands/branch/list.js +6 -69
- package/build/commands/branch/view.d.ts +3 -0
- package/build/commands/branch/view.js +15 -63
- package/build/commands/build/index.d.ts +1 -0
- package/build/commands/build/index.js +9 -0
- package/build/commands/build/version/set.d.ts +9 -0
- package/build/commands/build/version/set.js +81 -0
- package/build/commands/build/version/sync.d.ts +11 -0
- package/build/commands/build/version/sync.js +123 -0
- package/build/commands/submit.js +4 -1
- package/build/commands/update/index.d.ts +2 -2
- package/build/commands/update/index.js +24 -6
- package/build/commands/update/list.js +13 -18
- package/build/credentials/ios/actions/SetUpAdhocProvisioningProfile.js +2 -2
- package/build/credentials/ios/types.d.ts +2 -0
- package/build/devices/actions/create/action.d.ts +5 -2
- package/build/devices/actions/create/action.js +12 -2
- package/build/devices/actions/create/developerPortalMethod.d.ts +6 -0
- package/build/devices/actions/create/developerPortalMethod.js +90 -0
- package/build/devices/manager.js +4 -4
- package/build/graphql/generated.d.ts +501 -59
- package/build/graphql/generated.js +10 -1
- package/build/graphql/mutations/AppVersionMutation.d.ts +11 -0
- package/build/graphql/mutations/AppVersionMutation.js +28 -0
- package/build/graphql/mutations/PublishMutation.d.ts +2 -4
- package/build/graphql/queries/AppVersionQuery.d.ts +4 -0
- package/build/graphql/queries/AppVersionQuery.js +37 -0
- package/build/graphql/queries/BranchQuery.d.ts +2 -1
- package/build/graphql/queries/BranchQuery.js +26 -0
- package/build/graphql/queries/BuildQuery.d.ts +4 -1
- package/build/graphql/queries/BuildQuery.js +19 -0
- package/build/graphql/queries/PublishQuery.d.ts +2 -1
- package/build/graphql/queries/PublishQuery.js +16 -0
- package/build/graphql/queries/UpdateQuery.d.ts +6 -8
- package/build/graphql/queries/UpdateQuery.js +27 -23
- package/build/graphql/types/Build.d.ts +1 -0
- package/build/graphql/types/Build.js +16 -1
- package/build/metadata/apple/config/reader.d.ts +3 -2
- package/build/metadata/apple/config/reader.js +22 -5
- package/build/metadata/apple/config/writer.d.ts +3 -2
- package/build/metadata/apple/config/writer.js +22 -6
- package/build/metadata/apple/tasks/app-version.d.ts +5 -1
- package/build/metadata/apple/tasks/app-version.js +109 -8
- package/build/metadata/apple/tasks/index.d.ts +6 -1
- package/build/metadata/apple/tasks/index.js +7 -2
- package/build/metadata/apple/types.d.ts +3 -7
- package/build/metadata/upload.js +6 -1
- package/build/platform.d.ts +1 -0
- package/build/platform.js +17 -1
- package/build/project/android/applicationId.js +2 -2
- package/build/project/android/versions.d.ts +3 -0
- package/build/project/android/versions.js +23 -0
- package/build/project/applicationIdentifier.d.ts +4 -0
- package/build/project/applicationIdentifier.js +37 -0
- package/build/project/ios/bundleIdentifier.js +2 -2
- package/build/project/ios/target.js +14 -1
- package/build/project/ios/versions.d.ts +3 -0
- package/build/project/ios/versions.js +17 -0
- package/build/project/publish.d.ts +3 -2
- package/build/project/publish.js +23 -18
- package/build/project/remoteVersionSource.d.ts +8 -0
- package/build/project/remoteVersionSource.js +61 -0
- package/build/submit/submit.d.ts +2 -1
- package/build/submit/submit.js +3 -2
- package/build/submit/utils/files.d.ts +0 -6
- package/build/submit/utils/files.js +3 -16
- package/build/update/queries.d.ts +3 -0
- package/build/update/queries.js +72 -0
- package/build/update/utils.d.ts +14 -0
- package/build/update/utils.js +26 -9
- package/build/uploads.d.ts +8 -2
- package/build/uploads.js +19 -4
- package/build/utils/expodash/chunk.d.ts +1 -0
- package/build/utils/expodash/chunk.js +16 -0
- package/build/utils/queries.d.ts +25 -0
- package/build/utils/queries.js +67 -0
- package/build/vcs/clients/gitNoCommit.d.ts +1 -0
- package/build/vcs/clients/gitNoCommit.js +14 -0
- package/oclif.manifest.json +1 -1
- package/package.json +10 -5
- package/schema/metadata-0.json +38 -233
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getBuildVersionName = exports.validateAppConfigForRemoteVersionSource = exports.validateBuildProfileVersionSettings = exports.ensureVersionSourceIsRemoteAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
+
const eas_json_1 = require("@expo/eas-json");
|
|
7
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
8
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
9
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
10
|
+
const prompts_1 = require("../prompts");
|
|
11
|
+
async function ensureVersionSourceIsRemoteAsync(projectDir, easJsonReader) {
|
|
12
|
+
const easJsonCliConfig = await easJsonReader.getCliConfigAsync();
|
|
13
|
+
if ((easJsonCliConfig === null || easJsonCliConfig === void 0 ? void 0 : easJsonCliConfig.appVersionSource) === eas_json_1.AppVersionSource.REMOTE) {
|
|
14
|
+
return;
|
|
15
|
+
}
|
|
16
|
+
log_1.default.log(`The app version source defines whether the app version is stored locally in your project source (e.g. in app.json, Info.plist, or build.gradle) or remotely on EAS servers and only applied to the project at build time. To use this command, you will need to enable the remote version policy by adding ${chalk_1.default.bold('{"cli": { "appVersionSource": "remote" }}')} in eas.json.`);
|
|
17
|
+
// TODO: add link to docs
|
|
18
|
+
const confirm = await (0, prompts_1.confirmAsync)({
|
|
19
|
+
message: 'Do you want to set app version source to remote now?',
|
|
20
|
+
});
|
|
21
|
+
if (!confirm) {
|
|
22
|
+
throw new Error('Aborting...');
|
|
23
|
+
}
|
|
24
|
+
const easJsonPath = eas_json_1.EasJsonReader.formatEasJsonPath(projectDir);
|
|
25
|
+
const easJson = await fs_extra_1.default.readJSON(easJsonPath);
|
|
26
|
+
easJson.cli = { ...easJson === null || easJson === void 0 ? void 0 : easJson.cli, appVersionSource: eas_json_1.AppVersionSource.REMOTE };
|
|
27
|
+
await fs_extra_1.default.writeFile(easJsonPath, `${JSON.stringify(easJson, null, 2)}\n`);
|
|
28
|
+
log_1.default.withTick('Updated eas.json');
|
|
29
|
+
}
|
|
30
|
+
exports.ensureVersionSourceIsRemoteAsync = ensureVersionSourceIsRemoteAsync;
|
|
31
|
+
function validateBuildProfileVersionSettings(profileInfo, cliConfig) {
|
|
32
|
+
if ((cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.appVersionSource) !== eas_json_1.AppVersionSource.REMOTE) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
if (profileInfo.profile.autoIncrement === 'version') {
|
|
36
|
+
throw new Error(`${chalk_1.default.bold('{"autoIncrement": "version"}')} is not supported when app version source is set to remote.`);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.validateBuildProfileVersionSettings = validateBuildProfileVersionSettings;
|
|
40
|
+
function validateAppConfigForRemoteVersionSource(exp, platform) {
|
|
41
|
+
var _a, _b, _c;
|
|
42
|
+
if (typeof exp.runtimeVersion === 'object' && ((_a = exp.runtimeVersion) === null || _a === void 0 ? void 0 : _a.policy) === 'nativeVersion') {
|
|
43
|
+
throw new Error(`${chalk_1.default.bold('nativeVersion')} policy for ${chalk_1.default.bold('runtimeVersion')} is currently not supported when version source is set to remote. Switch policy e.g. to ${chalk_1.default.bold('appVersion')} or define version explicitly.`);
|
|
44
|
+
}
|
|
45
|
+
if (platform === eas_build_job_1.Platform.IOS && ((_b = exp.ios) === null || _b === void 0 ? void 0 : _b.buildNumber) !== undefined) {
|
|
46
|
+
log_1.default.warn(`${chalk_1.default.bold('ios.buildNumber')} field in app config is ignored when version source is set to remote, but this value will still be in the manifest available via ${chalk_1.default.bold('expo-constants')}. It's recommended to remove this value from app config.`);
|
|
47
|
+
}
|
|
48
|
+
if (platform === eas_build_job_1.Platform.ANDROID && ((_c = exp.android) === null || _c === void 0 ? void 0 : _c.versionCode) !== undefined) {
|
|
49
|
+
log_1.default.warn(`${chalk_1.default.bold('android.versionCode')} field in app config is ignored when version source is set to remote, but this value will still be in the manifest available via ${chalk_1.default.bold('expo-constants')}. It's recommended to remove this value from app config.`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.validateAppConfigForRemoteVersionSource = validateAppConfigForRemoteVersionSource;
|
|
53
|
+
function getBuildVersionName(platform) {
|
|
54
|
+
if (platform === eas_build_job_1.Platform.ANDROID) {
|
|
55
|
+
return 'versionCode';
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
return 'buildNumber';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.getBuildVersionName = getBuildVersionName;
|
package/build/submit/submit.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import { SubmissionContext } from './context';
|
|
|
4
4
|
export declare function submitAsync<T extends Platform>(ctx: SubmissionContext<T>): Promise<SubmissionFragment>;
|
|
5
5
|
export declare function waitToCompleteAsync(submissions: SubmissionFragment[], { verbose }?: {
|
|
6
6
|
verbose?: boolean;
|
|
7
|
-
}): Promise<
|
|
7
|
+
}): Promise<SubmissionFragment[]>;
|
|
8
|
+
export declare function exitWithNonZeroCodeIfSomeSubmissionsDidntFinish(submissions: SubmissionFragment[]): void;
|
package/build/submit/submit.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.waitToCompleteAsync = exports.submitAsync = void 0;
|
|
3
|
+
exports.exitWithNonZeroCodeIfSomeSubmissionsDidntFinish = exports.waitToCompleteAsync = exports.submitAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
@@ -49,7 +49,7 @@ async function waitToCompleteAsync(submissions, { verbose = false } = {}) {
|
|
|
49
49
|
log_1.default.newLine();
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
return completedSubmissions;
|
|
53
53
|
}
|
|
54
54
|
exports.waitToCompleteAsync = waitToCompleteAsync;
|
|
55
55
|
function printInstructionsForAndroidSubmission(submission) {
|
|
@@ -79,3 +79,4 @@ function exitWithNonZeroCodeIfSomeSubmissionsDidntFinish(submissions) {
|
|
|
79
79
|
process.exit(1);
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
exports.exitWithNonZeroCodeIfSomeSubmissionsDidntFinish = exitWithNonZeroCodeIfSomeSubmissionsDidntFinish;
|
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
export declare function isExistingFileAsync(filePath: string): Promise<boolean>;
|
|
2
2
|
export declare function uploadAppArchiveAsync(path: string): Promise<string>;
|
|
3
|
-
/**
|
|
4
|
-
* S3 returns broken URLs, sth like:
|
|
5
|
-
* https://submission-service-archives.s3.amazonaws.com/production%2Fdc98ca84-1473-4cb3-ae81-8c7b291cb27e%2F4424aa95-b985-4e2f-8755-9507b1037c1c
|
|
6
|
-
* This function replaces %2F with /.
|
|
7
|
-
*/
|
|
8
|
-
export declare function fixArchiveUrl(archiveUrl: string): string;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.uploadAppArchiveAsync = exports.isExistingFileAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
6
|
-
const url_1 = require("url");
|
|
7
6
|
const generated_1 = require("../../graphql/generated");
|
|
8
7
|
const uploads_1 = require("../../uploads");
|
|
9
8
|
const progress_1 = require("../../utils/progress");
|
|
@@ -19,23 +18,11 @@ async function isExistingFileAsync(filePath) {
|
|
|
19
18
|
exports.isExistingFileAsync = isExistingFileAsync;
|
|
20
19
|
async function uploadAppArchiveAsync(path) {
|
|
21
20
|
const fileSize = (await fs_extra_1.default.stat(path)).size;
|
|
22
|
-
const {
|
|
21
|
+
const { url } = await (0, uploads_1.uploadFileAtPathToS3Async)(generated_1.UploadSessionType.EasSubmitAppArchive, path, (0, progress_1.createProgressTracker)({
|
|
23
22
|
total: fileSize,
|
|
24
23
|
message: 'Uploading to EAS Submit',
|
|
25
24
|
completedMessage: 'Uploaded to EAS Submit',
|
|
26
25
|
}));
|
|
27
|
-
|
|
28
|
-
return fixArchiveUrl(String(url));
|
|
26
|
+
return url;
|
|
29
27
|
}
|
|
30
28
|
exports.uploadAppArchiveAsync = uploadAppArchiveAsync;
|
|
31
|
-
/**
|
|
32
|
-
* S3 returns broken URLs, sth like:
|
|
33
|
-
* https://submission-service-archives.s3.amazonaws.com/production%2Fdc98ca84-1473-4cb3-ae81-8c7b291cb27e%2F4424aa95-b985-4e2f-8755-9507b1037c1c
|
|
34
|
-
* This function replaces %2F with /.
|
|
35
|
-
*/
|
|
36
|
-
function fixArchiveUrl(archiveUrl) {
|
|
37
|
-
const parsed = new url_1.URL(archiveUrl);
|
|
38
|
-
parsed.pathname = decodeURIComponent(parsed.pathname);
|
|
39
|
-
return parsed.toString();
|
|
40
|
-
}
|
|
41
|
-
exports.fixArchiveUrl = fixArchiveUrl;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listAndRenderUpdatesOnBranchByNameAsync = exports.UPDATES_LIMIT = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const cli_table3_1 = tslib_1.__importDefault(require("cli-table3"));
|
|
7
|
+
const UpdateQuery_1 = require("../graphql/queries/UpdateQuery");
|
|
8
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
9
|
+
const formatFields_1 = tslib_1.__importDefault(require("../utils/formatFields"));
|
|
10
|
+
const json_1 = require("../utils/json");
|
|
11
|
+
const queries_1 = require("../utils/queries");
|
|
12
|
+
const utils_1 = require("./utils");
|
|
13
|
+
exports.UPDATES_LIMIT = 50;
|
|
14
|
+
async function listAndRenderUpdatesOnBranchByNameAsync(projectId, branchName, options) {
|
|
15
|
+
var _a, _b;
|
|
16
|
+
if (options.nonInteractive) {
|
|
17
|
+
const updates = await queryUpdateGroupsForBranchAsync((_a = options.limit) !== null && _a !== void 0 ? _a : exports.UPDATES_LIMIT, options.offset, projectId, branchName);
|
|
18
|
+
renderUpdateGroups(updates, options, branchName);
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
await (0, queries_1.paginatedQueryWithConfirmPromptAsync)({
|
|
22
|
+
limit: (_b = options.limit) !== null && _b !== void 0 ? _b : exports.UPDATES_LIMIT,
|
|
23
|
+
offset: options.offset,
|
|
24
|
+
queryToPerform: (limit, offset) => queryUpdateGroupsForBranchAsync(limit, offset, projectId, branchName),
|
|
25
|
+
promptOptions: {
|
|
26
|
+
title: 'Load more branches?',
|
|
27
|
+
renderListItems: updates => renderUpdateGroups(updates, options, branchName),
|
|
28
|
+
},
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.listAndRenderUpdatesOnBranchByNameAsync = listAndRenderUpdatesOnBranchByNameAsync;
|
|
33
|
+
async function queryUpdateGroupsForBranchAsync(limit, offset, projectId, branchName) {
|
|
34
|
+
const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
|
|
35
|
+
appId: projectId,
|
|
36
|
+
name: branchName,
|
|
37
|
+
limit,
|
|
38
|
+
offset,
|
|
39
|
+
});
|
|
40
|
+
const updateBranch = app === null || app === void 0 ? void 0 : app.byId.updateBranchByName;
|
|
41
|
+
if (!updateBranch) {
|
|
42
|
+
throw new Error(`Could not find branch "${branchName}"`);
|
|
43
|
+
}
|
|
44
|
+
return updateBranch.updates;
|
|
45
|
+
}
|
|
46
|
+
function renderUpdateGroups(updates, { json }, branchName) {
|
|
47
|
+
var _a, _b;
|
|
48
|
+
const branch = { name: branchName, id: (_b = (_a = updates[0]) === null || _a === void 0 ? void 0 : _a.branch.id) !== null && _b !== void 0 ? _b : 'N/A' };
|
|
49
|
+
if (json) {
|
|
50
|
+
(0, json_1.printJsonOnlyOutput)({ ...branch, currentPage: updates });
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const updateGroupsTable = new cli_table3_1.default({
|
|
54
|
+
head: utils_1.UPDATE_COLUMNS,
|
|
55
|
+
wordWrap: true,
|
|
56
|
+
});
|
|
57
|
+
updateGroupsTable.push(...(0, utils_1.getUpdateGroupsWithPlatforms)(updates).map(update => [
|
|
58
|
+
(0, utils_1.formatUpdate)(update),
|
|
59
|
+
update.runtimeVersion,
|
|
60
|
+
update.group,
|
|
61
|
+
update.platforms,
|
|
62
|
+
]));
|
|
63
|
+
log_1.default.addNewLineIfNone();
|
|
64
|
+
log_1.default.log(chalk_1.default.bold('Branch:'));
|
|
65
|
+
log_1.default.log((0, formatFields_1.default)([
|
|
66
|
+
{ label: 'Name', value: branch.name },
|
|
67
|
+
{ label: 'ID', value: branch.id },
|
|
68
|
+
]));
|
|
69
|
+
log_1.default.addNewLineIfNone();
|
|
70
|
+
log_1.default.log(updateGroupsTable.toString());
|
|
71
|
+
}
|
|
72
|
+
}
|
package/build/update/utils.d.ts
CHANGED
|
@@ -4,7 +4,16 @@ import { RequestedPlatform } from '../platform';
|
|
|
4
4
|
export declare type FormatUpdateParameter = Pick<Update, 'id' | 'createdAt' | 'message'> & {
|
|
5
5
|
actor?: Maybe<Pick<User, 'username' | 'id'> | Pick<Robot, 'firstName' | 'id'>>;
|
|
6
6
|
};
|
|
7
|
+
export declare type UpdateGroupDescription = FormatUpdateParameter & {
|
|
8
|
+
branch: string;
|
|
9
|
+
group: string;
|
|
10
|
+
platforms: string;
|
|
11
|
+
runtimeVersion: string;
|
|
12
|
+
};
|
|
7
13
|
export declare const UPDATE_COLUMNS: string[];
|
|
14
|
+
export declare function getUpdateGroupsWithPlatforms<UpdateFragment extends Pick<Update, 'platform' | 'group'>>(updates: UpdateFragment[]): (UpdateFragment & {
|
|
15
|
+
platforms: string;
|
|
16
|
+
})[];
|
|
8
17
|
export declare function getPlatformsForGroup({ group, updates, }: {
|
|
9
18
|
group: string;
|
|
10
19
|
updates: {
|
|
@@ -12,5 +21,10 @@ export declare function getPlatformsForGroup({ group, updates, }: {
|
|
|
12
21
|
platform: string;
|
|
13
22
|
}[];
|
|
14
23
|
}): string;
|
|
24
|
+
export declare function formatPlatformForUpdateGroup(updateGroup: {
|
|
25
|
+
group: string;
|
|
26
|
+
platform: string;
|
|
27
|
+
}[]): string;
|
|
28
|
+
export declare function truncateString(originalMessage: string, length?: number): string;
|
|
15
29
|
export declare function formatUpdate(update: FormatUpdateParameter): string;
|
|
16
30
|
export declare function ensureValidVersions(exp: ExpoConfig, platform: RequestedPlatform): void;
|
package/build/update/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ensureValidVersions = exports.formatUpdate = exports.getPlatformsForGroup = exports.UPDATE_COLUMNS = void 0;
|
|
3
|
+
exports.ensureValidVersions = exports.formatUpdate = exports.truncateString = exports.formatPlatformForUpdateGroup = exports.getPlatformsForGroup = exports.getUpdateGroupsWithPlatforms = exports.UPDATE_COLUMNS = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const timeago_js_1 = require("@expo/timeago.js");
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
@@ -14,22 +14,39 @@ exports.UPDATE_COLUMNS = [
|
|
|
14
14
|
'Update group ID',
|
|
15
15
|
'Update platforms',
|
|
16
16
|
];
|
|
17
|
+
function getUpdateGroupsWithPlatforms(updates) {
|
|
18
|
+
return Object.values((0, groupBy_1.default)(updates, updates => updates.group)).map(updateGroup => ({
|
|
19
|
+
...updateGroup[0],
|
|
20
|
+
platforms: formatPlatformForUpdateGroup(updateGroup),
|
|
21
|
+
}));
|
|
22
|
+
}
|
|
23
|
+
exports.getUpdateGroupsWithPlatforms = getUpdateGroupsWithPlatforms;
|
|
17
24
|
function getPlatformsForGroup({ group, updates, }) {
|
|
18
25
|
const groupedUpdates = (0, groupBy_1.default)(updates, update => update.group);
|
|
19
|
-
|
|
20
|
-
return 'N/A';
|
|
21
|
-
}
|
|
22
|
-
return groupedUpdates[group]
|
|
23
|
-
.map(update => update.platform)
|
|
24
|
-
.sort()
|
|
25
|
-
.join(', ');
|
|
26
|
+
return formatPlatformForUpdateGroup(groupedUpdates[group]);
|
|
26
27
|
}
|
|
27
28
|
exports.getPlatformsForGroup = getPlatformsForGroup;
|
|
29
|
+
function formatPlatformForUpdateGroup(updateGroup) {
|
|
30
|
+
return updateGroup.length === 0
|
|
31
|
+
? 'N/A'
|
|
32
|
+
: updateGroup
|
|
33
|
+
.map(update => update.platform)
|
|
34
|
+
.sort()
|
|
35
|
+
.join(', ');
|
|
36
|
+
}
|
|
37
|
+
exports.formatPlatformForUpdateGroup = formatPlatformForUpdateGroup;
|
|
38
|
+
function truncateString(originalMessage, length = 512) {
|
|
39
|
+
if (originalMessage.length > length) {
|
|
40
|
+
return originalMessage.substring(0, length - 3) + '...';
|
|
41
|
+
}
|
|
42
|
+
return originalMessage;
|
|
43
|
+
}
|
|
44
|
+
exports.truncateString = truncateString;
|
|
28
45
|
function formatUpdate(update) {
|
|
29
46
|
if (!update) {
|
|
30
47
|
return 'N/A';
|
|
31
48
|
}
|
|
32
|
-
const message = update.message ? `"${update.message}" ` : '';
|
|
49
|
+
const message = update.message ? `"${truncateString(update.message)}" ` : '';
|
|
33
50
|
return `${message}(${(0, timeago_js_1.format)(update.createdAt, 'en_US')} by ${(0, User_1.getActorDisplayName)(update.actor)})`;
|
|
34
51
|
}
|
|
35
52
|
exports.formatUpdate = formatUpdate;
|
package/build/uploads.d.ts
CHANGED
|
@@ -2,8 +2,14 @@ import { Response } from 'node-fetch';
|
|
|
2
2
|
import { UploadSessionType } from './graphql/generated';
|
|
3
3
|
import { PresignedPost } from './graphql/mutations/UploadSessionMutation';
|
|
4
4
|
import { ProgressHandler } from './utils/progress';
|
|
5
|
-
export declare function
|
|
6
|
-
|
|
5
|
+
export declare function uploadFileAtPathToS3Async(type: UploadSessionType, path: string, handleProgressEvent: ProgressHandler): Promise<{
|
|
6
|
+
url: string;
|
|
7
7
|
bucketKey: string;
|
|
8
8
|
}>;
|
|
9
9
|
export declare function uploadWithPresignedPostAsync(file: string, presignedPost: PresignedPost, handleProgressEvent?: ProgressHandler): Promise<Response>;
|
|
10
|
+
/**
|
|
11
|
+
* S3 returns broken URLs, sth like:
|
|
12
|
+
* https://submission-service-archives.s3.amazonaws.com/production%2Fdc98ca84-1473-4cb3-ae81-8c7b291cb27e%2F4424aa95-b985-4e2f-8755-9507b1037c1c
|
|
13
|
+
* This function replaces %2F with /.
|
|
14
|
+
*/
|
|
15
|
+
export declare function fixS3Url(archiveUrl: string): string;
|
package/build/uploads.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.uploadWithPresignedPostAsync = exports.
|
|
3
|
+
exports.fixS3Url = exports.uploadWithPresignedPostAsync = exports.uploadFileAtPathToS3Async = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
6
|
const form_data_1 = tslib_1.__importDefault(require("form-data"));
|
|
7
7
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
8
|
+
const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
|
|
9
|
+
const url_1 = require("url");
|
|
8
10
|
const fetch_1 = tslib_1.__importDefault(require("./fetch"));
|
|
9
11
|
const UploadSessionMutation_1 = require("./graphql/mutations/UploadSessionMutation");
|
|
10
|
-
async function
|
|
12
|
+
async function uploadFileAtPathToS3Async(type, path, handleProgressEvent) {
|
|
11
13
|
const presignedPost = await UploadSessionMutation_1.UploadSessionMutation.createUploadSessionAsync(type);
|
|
12
14
|
(0, assert_1.default)(presignedPost.fields.key, 'key is not specified in in presigned post');
|
|
13
15
|
const response = await uploadWithPresignedPostAsync(path, presignedPost, handleProgressEvent);
|
|
14
|
-
|
|
16
|
+
const location = (0, nullthrows_1.default)(response.headers.get('location'), `location does not exist in response headers (make sure you're uploading to AWS S3)`);
|
|
17
|
+
const url = fixS3Url(location);
|
|
18
|
+
return { url, bucketKey: presignedPost.fields.key };
|
|
15
19
|
}
|
|
16
|
-
exports.
|
|
20
|
+
exports.uploadFileAtPathToS3Async = uploadFileAtPathToS3Async;
|
|
17
21
|
async function uploadWithPresignedPostAsync(file, presignedPost, handleProgressEvent) {
|
|
18
22
|
const fileStat = await fs_extra_1.default.stat(file);
|
|
19
23
|
const fileSize = fileStat.size;
|
|
@@ -57,3 +61,14 @@ async function uploadWithPresignedPostAsync(file, presignedPost, handleProgressE
|
|
|
57
61
|
}
|
|
58
62
|
}
|
|
59
63
|
exports.uploadWithPresignedPostAsync = uploadWithPresignedPostAsync;
|
|
64
|
+
/**
|
|
65
|
+
* S3 returns broken URLs, sth like:
|
|
66
|
+
* https://submission-service-archives.s3.amazonaws.com/production%2Fdc98ca84-1473-4cb3-ae81-8c7b291cb27e%2F4424aa95-b985-4e2f-8755-9507b1037c1c
|
|
67
|
+
* This function replaces %2F with /.
|
|
68
|
+
*/
|
|
69
|
+
function fixS3Url(archiveUrl) {
|
|
70
|
+
const parsed = new url_1.URL(archiveUrl);
|
|
71
|
+
parsed.pathname = decodeURIComponent(parsed.pathname);
|
|
72
|
+
return parsed.toString();
|
|
73
|
+
}
|
|
74
|
+
exports.fixS3Url = fixS3Url;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function chunk<T>(list: T[], size?: number): T[][];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
function chunk(list, size = 1) {
|
|
4
|
+
const result = [];
|
|
5
|
+
for (let i = 0; i < list.length; i++) {
|
|
6
|
+
const isFirstElementInChunk = i % size === 0;
|
|
7
|
+
if (isFirstElementInChunk) {
|
|
8
|
+
result.push([list[i]]);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
result[result.length - 1].push(list[i]);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
return result;
|
|
15
|
+
}
|
|
16
|
+
exports.default = chunk;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
declare type BasePaginatedQueryArgs<QueryReturnType extends Record<string, any>> = {
|
|
2
|
+
limit: number;
|
|
3
|
+
offset: number;
|
|
4
|
+
queryToPerform: (limit: number, offset: number) => Promise<QueryReturnType[]>;
|
|
5
|
+
};
|
|
6
|
+
declare type PaginatedQueryWithConfirmPromptArgs<QueryReturnType extends Record<string, any>> = BasePaginatedQueryArgs<QueryReturnType> & {
|
|
7
|
+
promptOptions: {
|
|
8
|
+
readonly title: string;
|
|
9
|
+
renderListItems: (currentPage: QueryReturnType[]) => void;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare type PaginatedQueryWithSelectPromptArgs<QueryReturnType extends Record<string, any>> = BasePaginatedQueryArgs<QueryReturnType> & {
|
|
13
|
+
promptOptions: {
|
|
14
|
+
readonly title: string;
|
|
15
|
+
createDisplayTextForSelectionPromptListItem: (queryItem: QueryReturnType) => string;
|
|
16
|
+
getIdentifierForQueryItem: (queryItem: QueryReturnType) => string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare function paginatedQueryWithConfirmPromptAsync<QueryReturnType extends Record<string, any>>(queryArgs: PaginatedQueryWithConfirmPromptArgs<QueryReturnType>): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns an array of item(s) where the id is equal to the id of the user's selected item
|
|
22
|
+
* If no items are available for a user to select, this will return an empty array.
|
|
23
|
+
*/
|
|
24
|
+
export declare function paginatedQueryWithSelectPromptAsync<QueryReturnType extends Record<string, any>>(queryArgs: PaginatedQueryWithSelectPromptArgs<QueryReturnType>): Promise<QueryReturnType | void>;
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paginatedQueryWithSelectPromptAsync = exports.paginatedQueryWithConfirmPromptAsync = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const prompts_1 = require("../prompts");
|
|
6
|
+
const uniqBy_1 = tslib_1.__importDefault(require("./expodash/uniqBy"));
|
|
7
|
+
const fetchMoreValue = '_fetchMore';
|
|
8
|
+
async function paginatedQueryWithConfirmPromptAsync(queryArgs) {
|
|
9
|
+
return await paginatedQueryWithConfirmPromptInternalAsync(queryArgs, []);
|
|
10
|
+
}
|
|
11
|
+
exports.paginatedQueryWithConfirmPromptAsync = paginatedQueryWithConfirmPromptAsync;
|
|
12
|
+
async function paginatedQueryWithConfirmPromptInternalAsync({ limit, offset, queryToPerform, promptOptions, }, accumulator) {
|
|
13
|
+
// query an extra item to determine if there are more pages left
|
|
14
|
+
const paginatedItems = await queryToPerform(limit + 1, offset);
|
|
15
|
+
const areMorePagesAvailable = paginatedItems.length > limit;
|
|
16
|
+
// drop that extra item used for pagination from our render logic
|
|
17
|
+
const currentPage = paginatedItems.slice(0, limit);
|
|
18
|
+
const newAccumulator = [...accumulator, ...currentPage];
|
|
19
|
+
promptOptions.renderListItems(currentPage);
|
|
20
|
+
if (!areMorePagesAvailable) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
if (await (0, prompts_1.confirmAsync)({ message: promptOptions.title })) {
|
|
24
|
+
return await paginatedQueryWithConfirmPromptInternalAsync({
|
|
25
|
+
limit,
|
|
26
|
+
offset: offset + limit,
|
|
27
|
+
queryToPerform,
|
|
28
|
+
promptOptions,
|
|
29
|
+
}, newAccumulator);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Returns an array of item(s) where the id is equal to the id of the user's selected item
|
|
34
|
+
* If no items are available for a user to select, this will return an empty array.
|
|
35
|
+
*/
|
|
36
|
+
async function paginatedQueryWithSelectPromptAsync(queryArgs) {
|
|
37
|
+
return await paginatedQueryWithSelectPromptInternalAsync(queryArgs, []);
|
|
38
|
+
}
|
|
39
|
+
exports.paginatedQueryWithSelectPromptAsync = paginatedQueryWithSelectPromptAsync;
|
|
40
|
+
async function paginatedQueryWithSelectPromptInternalAsync({ limit, offset, queryToPerform, promptOptions, }, accumulator) {
|
|
41
|
+
// query an extra item to determine if there are more pages left
|
|
42
|
+
const paginatedItems = await queryToPerform(limit + 1, offset);
|
|
43
|
+
const areMorePagesAvailable = paginatedItems.length > limit;
|
|
44
|
+
// drop that extra item used for pagination from our render logic
|
|
45
|
+
const currentPage = paginatedItems.slice(0, limit);
|
|
46
|
+
const newAccumulator = [...accumulator, ...currentPage];
|
|
47
|
+
const selectionPromptListItems = (0, uniqBy_1.default)(newAccumulator, queryItem => promptOptions.getIdentifierForQueryItem(queryItem)).map(queryItem => ({
|
|
48
|
+
title: promptOptions.createDisplayTextForSelectionPromptListItem(queryItem),
|
|
49
|
+
value: promptOptions.getIdentifierForQueryItem(queryItem),
|
|
50
|
+
}));
|
|
51
|
+
if (areMorePagesAvailable) {
|
|
52
|
+
selectionPromptListItems.push({ title: 'Next page...', value: fetchMoreValue });
|
|
53
|
+
}
|
|
54
|
+
if (selectionPromptListItems.length === 0) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
const valueOfUserSelectedListItem = await (0, prompts_1.selectAsync)(promptOptions.title, selectionPromptListItems);
|
|
58
|
+
if (valueOfUserSelectedListItem === fetchMoreValue) {
|
|
59
|
+
return await paginatedQueryWithSelectPromptInternalAsync({
|
|
60
|
+
limit,
|
|
61
|
+
offset: offset + limit,
|
|
62
|
+
queryToPerform,
|
|
63
|
+
promptOptions,
|
|
64
|
+
}, newAccumulator);
|
|
65
|
+
}
|
|
66
|
+
return newAccumulator.find(items => promptOptions.getIdentifierForQueryItem(items) === valueOfUserSelectedListItem);
|
|
67
|
+
}
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
4
|
const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
|
|
5
|
+
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
5
6
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
7
|
+
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
6
8
|
const local_1 = require("../local");
|
|
7
9
|
const git_1 = tslib_1.__importDefault(require("./git"));
|
|
8
10
|
class GitNoCommitClient extends git_1.default {
|
|
@@ -23,5 +25,17 @@ class GitNoCommitClient extends git_1.default {
|
|
|
23
25
|
await ignore.initIgnoreAsync();
|
|
24
26
|
return ignore.ignores(filePath);
|
|
25
27
|
}
|
|
28
|
+
async trackFileAsync(file) {
|
|
29
|
+
try {
|
|
30
|
+
await super.trackFileAsync(file);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// In the no commit workflow it doesn't matter if we fail to track changes,
|
|
34
|
+
// so we can ignore if this throws an exception
|
|
35
|
+
log_1.default.warn(`Unable to track ${chalk_1.default.bold(path_1.default.basename(file))} in Git. Proceeding without tracking.`);
|
|
36
|
+
log_1.default.warn(` Reason: the command ${chalk_1.default.bold(`"git add ${file}"`)} exited with an error.`);
|
|
37
|
+
log_1.default.newLine();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
26
40
|
}
|
|
27
41
|
exports.default = GitNoCommitClient;
|