eas-cli 2.6.0 → 2.7.1
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 +101 -50
- package/build/branch/queries.d.ts +8 -1
- package/build/branch/queries.js +50 -1
- package/build/build/android/build.js +1 -0
- package/build/build/ios/build.js +1 -0
- package/build/build/local.js +1 -1
- package/build/build/validate.d.ts +1 -0
- package/build/build/validate.js +121 -1
- package/build/channel/queries.d.ts +11 -0
- package/build/channel/queries.js +46 -1
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +1 -1
- package/build/commands/branch/create.d.ts +0 -3
- package/build/commands/branch/create.js +2 -27
- package/build/commands/channel/create.d.ts +0 -7
- package/build/commands/channel/create.js +4 -31
- package/build/commands/credentials.d.ts +1 -0
- package/build/commands/credentials.js +3 -2
- package/build/commands/update/configure.d.ts +1 -0
- package/build/commands/update/configure.js +10 -218
- package/build/commands/update/index.d.ts +3 -9
- package/build/commands/update/index.js +136 -143
- package/build/credentials/manager/HelperActions.d.ts +2 -0
- package/build/credentials/manager/ManageAndroid.js +8 -1
- package/build/credentials/manager/ManageIos.js +8 -1
- package/build/credentials/manager/SelectPlatform.d.ts +3 -1
- package/build/credentials/manager/SelectPlatform.js +2 -1
- package/build/graphql/generated.d.ts +26 -17
- package/build/graphql/types/Build.js +1 -0
- package/build/log.d.ts +1 -0
- package/build/log.js +3 -0
- package/build/project/projectUtils.d.ts +3 -1
- package/build/project/projectUtils.js +10 -3
- package/build/project/publish.d.ts +13 -10
- package/build/project/publish.js +68 -38
- package/build/project/workflow.d.ts +1 -0
- package/build/project/workflow.js +9 -1
- package/build/prompts.js +3 -1
- package/build/submit/ArchiveSource.js +12 -16
- package/build/update/configure.d.ts +22 -0
- package/build/update/configure.js +200 -0
- package/build/utils/expoCli.d.ts +6 -0
- package/build/utils/expoCli.js +46 -1
- package/build/utils/expodash/memoize.d.ts +2 -0
- package/build/utils/expodash/memoize.js +17 -0
- package/build/utils/image.d.ts +6 -0
- package/build/utils/image.js +107 -0
- package/build/utils/statuspageService.js +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +8 -4
|
@@ -2774,6 +2774,7 @@ export declare type PublicArtifacts = {
|
|
|
2774
2774
|
export declare type PublishUpdateGroupInput = {
|
|
2775
2775
|
awaitingCodeSigningInfo?: InputMaybe<Scalars['Boolean']>;
|
|
2776
2776
|
branchId: Scalars['String'];
|
|
2777
|
+
gitCommitHash?: InputMaybe<Scalars['String']>;
|
|
2777
2778
|
message?: InputMaybe<Scalars['String']>;
|
|
2778
2779
|
runtimeVersion: Scalars['String'];
|
|
2779
2780
|
updateInfoGroup: UpdateInfoGroup;
|
|
@@ -3344,6 +3345,7 @@ export declare type Update = ActivityTimelineProjectActivity & {
|
|
|
3344
3345
|
branchId: Scalars['ID'];
|
|
3345
3346
|
codeSigningInfo?: Maybe<CodeSigningInfo>;
|
|
3346
3347
|
createdAt: Scalars['DateTime'];
|
|
3348
|
+
gitCommitHash?: Maybe<Scalars['String']>;
|
|
3347
3349
|
group: Scalars['String'];
|
|
3348
3350
|
id: Scalars['ID'];
|
|
3349
3351
|
manifestFragment: Scalars['String'];
|
|
@@ -3803,6 +3805,23 @@ export declare type CreateUpdateBranchForAppMutation = {
|
|
|
3803
3805
|
};
|
|
3804
3806
|
};
|
|
3805
3807
|
};
|
|
3808
|
+
export declare type CreateUpdateChannelOnAppMutationVariables = Exact<{
|
|
3809
|
+
appId: Scalars['ID'];
|
|
3810
|
+
name: Scalars['String'];
|
|
3811
|
+
branchMapping: Scalars['String'];
|
|
3812
|
+
}>;
|
|
3813
|
+
export declare type CreateUpdateChannelOnAppMutation = {
|
|
3814
|
+
__typename?: 'RootMutation';
|
|
3815
|
+
updateChannel: {
|
|
3816
|
+
__typename?: 'UpdateChannelMutation';
|
|
3817
|
+
createUpdateChannelForApp: {
|
|
3818
|
+
__typename?: 'UpdateChannel';
|
|
3819
|
+
id: string;
|
|
3820
|
+
name: string;
|
|
3821
|
+
branchMapping: string;
|
|
3822
|
+
};
|
|
3823
|
+
};
|
|
3824
|
+
};
|
|
3806
3825
|
export declare type GetBranchInfoQueryVariables = Exact<{
|
|
3807
3826
|
appId: Scalars['String'];
|
|
3808
3827
|
name: Scalars['String'];
|
|
@@ -3863,23 +3882,6 @@ export declare type CancelBuildMutation = {
|
|
|
3863
3882
|
};
|
|
3864
3883
|
};
|
|
3865
3884
|
};
|
|
3866
|
-
export declare type CreateUpdateChannelOnAppMutationVariables = Exact<{
|
|
3867
|
-
appId: Scalars['ID'];
|
|
3868
|
-
name: Scalars['String'];
|
|
3869
|
-
branchMapping: Scalars['String'];
|
|
3870
|
-
}>;
|
|
3871
|
-
export declare type CreateUpdateChannelOnAppMutation = {
|
|
3872
|
-
__typename?: 'RootMutation';
|
|
3873
|
-
updateChannel: {
|
|
3874
|
-
__typename?: 'UpdateChannelMutation';
|
|
3875
|
-
createUpdateChannelForApp: {
|
|
3876
|
-
__typename?: 'UpdateChannel';
|
|
3877
|
-
id: string;
|
|
3878
|
-
name: string;
|
|
3879
|
-
branchMapping: string;
|
|
3880
|
-
};
|
|
3881
|
-
};
|
|
3882
|
-
};
|
|
3883
3885
|
export declare type DeleteUpdateChannelMutationVariables = Exact<{
|
|
3884
3886
|
channelId: Scalars['ID'];
|
|
3885
3887
|
}>;
|
|
@@ -6687,6 +6689,7 @@ export declare type CreateAndroidBuildMutation = {
|
|
|
6687
6689
|
appBuildVersion?: string | null;
|
|
6688
6690
|
runtimeVersion?: string | null;
|
|
6689
6691
|
gitCommitHash?: string | null;
|
|
6692
|
+
gitCommitMessage?: string | null;
|
|
6690
6693
|
initialQueuePosition?: number | null;
|
|
6691
6694
|
queuePosition?: number | null;
|
|
6692
6695
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
@@ -6766,6 +6769,7 @@ export declare type CreateIosBuildMutation = {
|
|
|
6766
6769
|
appBuildVersion?: string | null;
|
|
6767
6770
|
runtimeVersion?: string | null;
|
|
6768
6771
|
gitCommitHash?: string | null;
|
|
6772
|
+
gitCommitMessage?: string | null;
|
|
6769
6773
|
initialQueuePosition?: number | null;
|
|
6770
6774
|
queuePosition?: number | null;
|
|
6771
6775
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
@@ -7303,6 +7307,7 @@ export declare type BuildsByIdQuery = {
|
|
|
7303
7307
|
appBuildVersion?: string | null;
|
|
7304
7308
|
runtimeVersion?: string | null;
|
|
7305
7309
|
gitCommitHash?: string | null;
|
|
7310
|
+
gitCommitMessage?: string | null;
|
|
7306
7311
|
initialQueuePosition?: number | null;
|
|
7307
7312
|
queuePosition?: number | null;
|
|
7308
7313
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
@@ -7371,6 +7376,7 @@ export declare type BuildsWithSubmissionsByIdQuery = {
|
|
|
7371
7376
|
appBuildVersion?: string | null;
|
|
7372
7377
|
runtimeVersion?: string | null;
|
|
7373
7378
|
gitCommitHash?: string | null;
|
|
7379
|
+
gitCommitMessage?: string | null;
|
|
7374
7380
|
initialQueuePosition?: number | null;
|
|
7375
7381
|
queuePosition?: number | null;
|
|
7376
7382
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
@@ -7479,6 +7485,7 @@ export declare type ViewBuildsOnAppQuery = {
|
|
|
7479
7485
|
appBuildVersion?: string | null;
|
|
7480
7486
|
runtimeVersion?: string | null;
|
|
7481
7487
|
gitCommitHash?: string | null;
|
|
7488
|
+
gitCommitMessage?: string | null;
|
|
7482
7489
|
initialQueuePosition?: number | null;
|
|
7483
7490
|
queuePosition?: number | null;
|
|
7484
7491
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
@@ -8076,6 +8083,7 @@ export declare type BuildFragment = {
|
|
|
8076
8083
|
appBuildVersion?: string | null;
|
|
8077
8084
|
runtimeVersion?: string | null;
|
|
8078
8085
|
gitCommitHash?: string | null;
|
|
8086
|
+
gitCommitMessage?: string | null;
|
|
8079
8087
|
initialQueuePosition?: number | null;
|
|
8080
8088
|
queuePosition?: number | null;
|
|
8081
8089
|
estimatedWaitTimeLeftSeconds?: number | null;
|
|
@@ -8135,6 +8143,7 @@ export declare type BuildWithSubmissionsFragment = {
|
|
|
8135
8143
|
appBuildVersion?: string | null;
|
|
8136
8144
|
runtimeVersion?: string | null;
|
|
8137
8145
|
gitCommitHash?: string | null;
|
|
8146
|
+
gitCommitMessage?: string | null;
|
|
8138
8147
|
initialQueuePosition?: number | null;
|
|
8139
8148
|
queuePosition?: number | null;
|
|
8140
8149
|
estimatedWaitTimeLeftSeconds?: number | null;
|
package/build/log.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export default class Log {
|
|
|
8
8
|
static debug(...args: any[]): void;
|
|
9
9
|
static gray(...args: any[]): void;
|
|
10
10
|
static warnDeprecatedFlag(flag: string, message: string): void;
|
|
11
|
+
static fail(message: string): void;
|
|
11
12
|
static succeed(message: string): void;
|
|
12
13
|
static withTick(...args: any[]): void;
|
|
13
14
|
private static consoleLog;
|
package/build/log.js
CHANGED
|
@@ -36,6 +36,9 @@ class Log {
|
|
|
36
36
|
static warnDeprecatedFlag(flag, message) {
|
|
37
37
|
Log.warn(`› ${chalk_1.default.bold('--' + flag)} flag is deprecated. ${message}`);
|
|
38
38
|
}
|
|
39
|
+
static fail(message) {
|
|
40
|
+
Log.log(`${chalk_1.default.red(log_symbols_1.default.error)} ${message}`);
|
|
41
|
+
}
|
|
39
42
|
static succeed(message) {
|
|
40
43
|
Log.log(`${chalk_1.default.green(log_symbols_1.default.success)} ${message}`);
|
|
41
44
|
}
|
|
@@ -15,6 +15,8 @@ export declare function getProjectConfigDescription(projectDir: string): string;
|
|
|
15
15
|
export declare function isExpoUpdatesInstalled(projectDir: string): boolean;
|
|
16
16
|
export declare function isExpoUpdatesInstalledOrAvailable(projectDir: string, sdkVersion?: string): boolean;
|
|
17
17
|
export declare function validateAppVersionRuntimePolicySupportAsync(projectDir: string, exp: ExpoConfig): Promise<void>;
|
|
18
|
-
export declare function installExpoUpdatesAsync(projectDir: string
|
|
18
|
+
export declare function installExpoUpdatesAsync(projectDir: string, options?: {
|
|
19
|
+
silent: boolean;
|
|
20
|
+
}): Promise<void>;
|
|
19
21
|
export declare function getOwnerAccountForProjectIdAsync(graphqlClient: ExpoGraphqlClient, projectId: string): Promise<AccountFragment>;
|
|
20
22
|
export declare function getDisplayNameForProjectIdAsync(graphqlClient: ExpoGraphqlClient, projectId: string): Promise<string>;
|
|
@@ -88,10 +88,17 @@ async function validateAppVersionRuntimePolicySupportAsync(projectDir, exp) {
|
|
|
88
88
|
log_1.default.warn(`You need to be on SDK 46 or higher, and use expo-updates >= 0.14.4 to use appVersion runtime policy.`);
|
|
89
89
|
}
|
|
90
90
|
exports.validateAppVersionRuntimePolicySupportAsync = validateAppVersionRuntimePolicySupportAsync;
|
|
91
|
-
async function installExpoUpdatesAsync(projectDir) {
|
|
91
|
+
async function installExpoUpdatesAsync(projectDir, options) {
|
|
92
92
|
log_1.default.log(chalk_1.default.gray `> npx expo install expo-updates`);
|
|
93
|
-
|
|
94
|
-
|
|
93
|
+
try {
|
|
94
|
+
await (0, expoCli_1.expoCommandAsync)(projectDir, ['install', 'expo-updates'], { silent: options === null || options === void 0 ? void 0 : options.silent });
|
|
95
|
+
}
|
|
96
|
+
catch (error) {
|
|
97
|
+
if (options === null || options === void 0 ? void 0 : options.silent) {
|
|
98
|
+
log_1.default.error('stdout' in error ? error.stdout : error.message);
|
|
99
|
+
}
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
95
102
|
}
|
|
96
103
|
exports.installExpoUpdatesAsync = installExpoUpdatesAsync;
|
|
97
104
|
async function getOwnerAccountForProjectIdAsync(graphqlClient, projectId) {
|
|
@@ -3,12 +3,12 @@ import { ExpoConfig, Platform } from '@expo/config';
|
|
|
3
3
|
import Joi from 'joi';
|
|
4
4
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
5
5
|
import { PartialManifestAsset } from '../graphql/generated';
|
|
6
|
-
export declare type
|
|
6
|
+
export declare type ExpoCLIExportPlatformFlag = Platform | 'all';
|
|
7
7
|
declare type Metadata = {
|
|
8
8
|
version: number;
|
|
9
9
|
bundler: 'metro';
|
|
10
10
|
fileMetadata: {
|
|
11
|
-
[key in
|
|
11
|
+
[key in Platform]: {
|
|
12
12
|
assets: {
|
|
13
13
|
path: string;
|
|
14
14
|
ext: string;
|
|
@@ -23,7 +23,7 @@ export declare type RawAsset = {
|
|
|
23
23
|
path: string;
|
|
24
24
|
};
|
|
25
25
|
declare type CollectedAssets = {
|
|
26
|
-
[platform in
|
|
26
|
+
[platform in Platform]?: {
|
|
27
27
|
launchAsset: RawAsset;
|
|
28
28
|
assets: RawAsset[];
|
|
29
29
|
};
|
|
@@ -40,7 +40,7 @@ declare type ManifestFragment = {
|
|
|
40
40
|
extra?: ManifestExtra;
|
|
41
41
|
};
|
|
42
42
|
declare type UpdateInfoGroup = {
|
|
43
|
-
[key in
|
|
43
|
+
[key in Platform]: ManifestFragment;
|
|
44
44
|
};
|
|
45
45
|
export declare const MetadataJoi: Joi.ObjectSchema<any>;
|
|
46
46
|
export declare function guessContentTypeFromExtension(ext?: string): string;
|
|
@@ -58,16 +58,19 @@ export declare function convertAssetToUpdateInfoGroupFormatAsync(asset: RawAsset
|
|
|
58
58
|
* This will be sorted later based on the platform's runtime versions.
|
|
59
59
|
*/
|
|
60
60
|
export declare function buildUnsortedUpdateInfoGroupAsync(assets: CollectedAssets, exp: ExpoConfig): Promise<UpdateInfoGroup>;
|
|
61
|
-
export declare function buildBundlesAsync({ projectDir, inputDir, }: {
|
|
61
|
+
export declare function buildBundlesAsync({ projectDir, inputDir, exp, platformFlag, }: {
|
|
62
62
|
projectDir: string;
|
|
63
63
|
inputDir: string;
|
|
64
|
+
exp: Pick<ExpoConfig, 'sdkVersion'>;
|
|
65
|
+
platformFlag: ExpoCLIExportPlatformFlag;
|
|
64
66
|
}): Promise<void>;
|
|
65
|
-
export declare function resolveInputDirectoryAsync(
|
|
67
|
+
export declare function resolveInputDirectoryAsync(inputDir: string, { skipBundler }: {
|
|
68
|
+
skipBundler?: boolean;
|
|
69
|
+
}): Promise<string>;
|
|
66
70
|
export declare function loadMetadata(distRoot: string): Metadata;
|
|
67
|
-
export declare function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}): Promise<CollectedAssets>;
|
|
71
|
+
export declare function filterExportedPlatformsByFlag<T extends Partial<Record<Platform, any>>>(record: T, platformFlag: ExpoCLIExportPlatformFlag): T;
|
|
72
|
+
/** Given a directory, load the metadata.json and collect the assets for each platform. */
|
|
73
|
+
export declare function collectAssetsAsync(dir: string): Promise<CollectedAssets>;
|
|
71
74
|
export declare function filterOutAssetsThatAlreadyExistAsync(graphqlClient: ExpoGraphqlClient, uniqueAssetsWithStorageKey: (RawAsset & {
|
|
72
75
|
storageKey: string;
|
|
73
76
|
})[]): Promise<(RawAsset & {
|
package/build/project/publish.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isUploadedAssetCountAboveWarningThreshold = exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssetsAsync = exports.loadMetadata = exports.resolveInputDirectoryAsync = exports.buildBundlesAsync = exports.buildUnsortedUpdateInfoGroupAsync = exports.convertAssetToUpdateInfoGroupFormatAsync = exports.getStorageKeyForAssetAsync = exports.getStorageKey = exports.getBase64URLEncoding = exports.guessContentTypeFromExtension = exports.MetadataJoi = void 0;
|
|
3
|
+
exports.isUploadedAssetCountAboveWarningThreshold = exports.uploadAssetsAsync = exports.filterOutAssetsThatAlreadyExistAsync = exports.collectAssetsAsync = exports.filterExportedPlatformsByFlag = exports.loadMetadata = exports.resolveInputDirectoryAsync = exports.buildBundlesAsync = exports.buildUnsortedUpdateInfoGroupAsync = exports.convertAssetToUpdateInfoGroupFormatAsync = exports.getStorageKeyForAssetAsync = exports.getStorageKey = exports.getBase64URLEncoding = exports.guessContentTypeFromExtension = exports.MetadataJoi = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const json_file_1 = tslib_1.__importDefault(require("@expo/json-file"));
|
|
6
6
|
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
@@ -12,6 +12,7 @@ const promise_limit_1 = tslib_1.__importDefault(require("promise-limit"));
|
|
|
12
12
|
const generated_1 = require("../graphql/generated");
|
|
13
13
|
const PublishMutation_1 = require("../graphql/mutations/PublishMutation");
|
|
14
14
|
const PublishQuery_1 = require("../graphql/queries/PublishQuery");
|
|
15
|
+
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
15
16
|
const uploads_1 = require("../uploads");
|
|
16
17
|
const expoCli_1 = require("../utils/expoCli");
|
|
17
18
|
const chunk_1 = tslib_1.__importDefault(require("../utils/expodash/chunk"));
|
|
@@ -21,13 +22,14 @@ const fileMetadataJoi = joi_1.default.object({
|
|
|
21
22
|
.required()
|
|
22
23
|
.items(joi_1.default.object({ path: joi_1.default.string().required(), ext: joi_1.default.string().required() })),
|
|
23
24
|
bundle: joi_1.default.string().required(),
|
|
24
|
-
}).
|
|
25
|
+
}).optional();
|
|
25
26
|
exports.MetadataJoi = joi_1.default.object({
|
|
26
27
|
version: joi_1.default.number().required(),
|
|
27
28
|
bundler: joi_1.default.string().required(),
|
|
28
29
|
fileMetadata: joi_1.default.object({
|
|
29
30
|
android: fileMetadataJoi,
|
|
30
31
|
ios: fileMetadataJoi,
|
|
32
|
+
web: fileMetadataJoi,
|
|
31
33
|
}).required(),
|
|
32
34
|
}).required();
|
|
33
35
|
function guessContentTypeFromExtension(ext) {
|
|
@@ -102,29 +104,44 @@ async function buildUnsortedUpdateInfoGroupAsync(assets, exp) {
|
|
|
102
104
|
return updateInfoGroup;
|
|
103
105
|
}
|
|
104
106
|
exports.buildUnsortedUpdateInfoGroupAsync = buildUnsortedUpdateInfoGroupAsync;
|
|
105
|
-
async function buildBundlesAsync({ projectDir, inputDir, }) {
|
|
107
|
+
async function buildBundlesAsync({ projectDir, inputDir, exp, platformFlag, }) {
|
|
106
108
|
const packageJSON = json_file_1.default.read(path_1.default.resolve(projectDir, 'package.json'));
|
|
107
109
|
if (!packageJSON) {
|
|
108
110
|
throw new Error('Could not locate package.json');
|
|
109
111
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
112
|
+
if ((0, expoCli_1.shouldUseVersionedExpoCLI)(projectDir, exp)) {
|
|
113
|
+
await (0, expoCli_1.expoCommandAsync)(projectDir, [
|
|
114
|
+
'export',
|
|
115
|
+
'--output-dir',
|
|
116
|
+
inputDir,
|
|
117
|
+
'--dump-sourcemap',
|
|
118
|
+
'--platform',
|
|
119
|
+
platformFlag,
|
|
120
|
+
]);
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
// Legacy global Expo CLI
|
|
124
|
+
await (0, expoCli_1.expoCommandAsync)(projectDir, [
|
|
125
|
+
'export',
|
|
126
|
+
'--output-dir',
|
|
127
|
+
inputDir,
|
|
128
|
+
'--experimental-bundle',
|
|
129
|
+
'--non-interactive',
|
|
130
|
+
'--dump-sourcemap',
|
|
131
|
+
'--platform',
|
|
132
|
+
platformFlag,
|
|
133
|
+
]);
|
|
134
|
+
}
|
|
118
135
|
}
|
|
119
136
|
exports.buildBundlesAsync = buildBundlesAsync;
|
|
120
|
-
async function resolveInputDirectoryAsync(
|
|
121
|
-
const distRoot = path_1.default.resolve(
|
|
137
|
+
async function resolveInputDirectoryAsync(inputDir, { skipBundler }) {
|
|
138
|
+
const distRoot = path_1.default.resolve(inputDir);
|
|
122
139
|
if (!(await fs_extra_1.default.pathExists(distRoot))) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
140
|
+
let error = `--input-dir="${inputDir}" not found.`;
|
|
141
|
+
if (skipBundler) {
|
|
142
|
+
error += ` --skip-bundler requires the project to be exported manually before uploading. Ex: npx expo export && eas update --skip-bundler`;
|
|
143
|
+
}
|
|
144
|
+
throw new Error(error);
|
|
128
145
|
}
|
|
129
146
|
return distRoot;
|
|
130
147
|
}
|
|
@@ -143,37 +160,50 @@ function loadMetadata(distRoot) {
|
|
|
143
160
|
if (metadata.bundler !== 'metro') {
|
|
144
161
|
throw new Error('Only bundles created with Metro are currently supported');
|
|
145
162
|
}
|
|
163
|
+
const platforms = Object.keys(metadata.fileMetadata);
|
|
164
|
+
if (platforms.length === 0) {
|
|
165
|
+
log_1.default.warn('No updates were exported for any platform');
|
|
166
|
+
}
|
|
167
|
+
log_1.default.debug(`Loaded ${platforms.length} platform(s): ${platforms.join(', ')}`);
|
|
146
168
|
return metadata;
|
|
147
169
|
}
|
|
148
170
|
exports.loadMetadata = loadMetadata;
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
171
|
+
function filterExportedPlatformsByFlag(record, platformFlag) {
|
|
172
|
+
if (platformFlag === 'all') {
|
|
173
|
+
return record;
|
|
174
|
+
}
|
|
175
|
+
const platform = platformFlag;
|
|
176
|
+
if (!record[platform]) {
|
|
177
|
+
throw new Error(`--platform="${platform}" not found in metadata.json. Available platform(s): ${Object.keys(record).join(', ')}`);
|
|
178
|
+
}
|
|
179
|
+
return { [platform]: record[platform] };
|
|
180
|
+
}
|
|
181
|
+
exports.filterExportedPlatformsByFlag = filterExportedPlatformsByFlag;
|
|
182
|
+
/** Given a directory, load the metadata.json and collect the assets for each platform. */
|
|
183
|
+
async function collectAssetsAsync(dir) {
|
|
184
|
+
const metadata = loadMetadata(dir);
|
|
185
|
+
const collectedAssets = {};
|
|
186
|
+
for (const platform of Object.keys(metadata.fileMetadata)) {
|
|
187
|
+
collectedAssets[platform] = {
|
|
155
188
|
launchAsset: {
|
|
156
189
|
fileExtension: '.bundle',
|
|
157
190
|
contentType: 'application/javascript',
|
|
158
|
-
path: path_1.default.resolve(
|
|
191
|
+
path: path_1.default.resolve(dir, metadata.fileMetadata[platform].bundle),
|
|
159
192
|
},
|
|
160
|
-
assets: metadata.fileMetadata[platform].assets.map(asset => {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
return {
|
|
167
|
-
fileExtension,
|
|
168
|
-
contentType: guessContentTypeFromExtension(asset.ext),
|
|
169
|
-
path: path_1.default.join(distRoot, asset.path),
|
|
170
|
-
};
|
|
171
|
-
}),
|
|
193
|
+
assets: metadata.fileMetadata[platform].assets.map(asset => ({
|
|
194
|
+
fileExtension: asset.ext ? ensureLeadingPeriod(asset.ext) : undefined,
|
|
195
|
+
contentType: guessContentTypeFromExtension(asset.ext),
|
|
196
|
+
path: path_1.default.join(dir, asset.path),
|
|
197
|
+
})),
|
|
172
198
|
};
|
|
173
199
|
}
|
|
174
|
-
return
|
|
200
|
+
return collectedAssets;
|
|
175
201
|
}
|
|
176
202
|
exports.collectAssetsAsync = collectAssetsAsync;
|
|
203
|
+
// ensure the file extension has a '.' prefix
|
|
204
|
+
function ensureLeadingPeriod(extension) {
|
|
205
|
+
return extension.startsWith('.') ? extension : `.${extension}`;
|
|
206
|
+
}
|
|
177
207
|
async function filterOutAssetsThatAlreadyExistAsync(graphqlClient, uniqueAssetsWithStorageKey) {
|
|
178
208
|
const assetMetadata = await PublishQuery_1.PublishQuery.getAssetMetadataAsync(graphqlClient, uniqueAssetsWithStorageKey.map(asset => asset.storageKey));
|
|
179
209
|
const missingAssetKeys = assetMetadata
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { Platform, Workflow } from '@expo/eas-build-job';
|
|
2
2
|
export declare function resolveWorkflowAsync(projectDir: string, platform: Platform): Promise<Workflow>;
|
|
3
|
+
export declare function resolveWorkflowPerPlatformAsync(projectDir: string): Promise<Record<Platform, Workflow>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveWorkflowAsync = void 0;
|
|
3
|
+
exports.resolveWorkflowPerPlatformAsync = exports.resolveWorkflowAsync = 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");
|
|
@@ -32,3 +32,11 @@ async function resolveWorkflowAsync(projectDir, platform) {
|
|
|
32
32
|
return eas_build_job_1.Workflow.MANAGED;
|
|
33
33
|
}
|
|
34
34
|
exports.resolveWorkflowAsync = resolveWorkflowAsync;
|
|
35
|
+
async function resolveWorkflowPerPlatformAsync(projectDir) {
|
|
36
|
+
const [android, ios] = await Promise.all([
|
|
37
|
+
resolveWorkflowAsync(projectDir, eas_build_job_1.Platform.ANDROID),
|
|
38
|
+
resolveWorkflowAsync(projectDir, eas_build_job_1.Platform.IOS),
|
|
39
|
+
]);
|
|
40
|
+
return { android, ios };
|
|
41
|
+
}
|
|
42
|
+
exports.resolveWorkflowPerPlatformAsync = resolveWorkflowPerPlatformAsync;
|
package/build/prompts.js
CHANGED
|
@@ -5,8 +5,10 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
const prompts_1 = tslib_1.__importDefault(require("prompts"));
|
|
7
7
|
async function promptAsync(questions, options = {}) {
|
|
8
|
+
var _a;
|
|
8
9
|
if (!process.stdin.isTTY && !global.test) {
|
|
9
|
-
|
|
10
|
+
const message = Array.isArray(questions) ? (_a = questions[0]) === null || _a === void 0 ? void 0 : _a.message : questions.message;
|
|
11
|
+
throw new Error(`Input is required, but stdin is not readable. Failed to display prompt: ${message}`);
|
|
10
12
|
}
|
|
11
13
|
return await (0, prompts_1.default)(questions, {
|
|
12
14
|
onCancel() {
|
|
@@ -6,12 +6,12 @@ const eas_build_job_1 = require("@expo/eas-build-job");
|
|
|
6
6
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
7
|
const url_1 = require("url");
|
|
8
8
|
const uuid = tslib_1.__importStar(require("uuid"));
|
|
9
|
-
const generated_1 = require("../graphql/generated");
|
|
10
9
|
const BuildQuery_1 = require("../graphql/queries/BuildQuery");
|
|
11
10
|
const AppPlatform_1 = require("../graphql/types/AppPlatform");
|
|
12
11
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
13
12
|
const platform_1 = require("../platform");
|
|
14
13
|
const prompts_1 = require("../prompts");
|
|
14
|
+
const date_1 = require("../utils/date");
|
|
15
15
|
const builds_1 = require("./utils/builds");
|
|
16
16
|
const files_1 = require("./utils/files");
|
|
17
17
|
exports.BUILD_LIST_ITEM_COUNT = 4;
|
|
@@ -187,26 +187,22 @@ async function handleBuildListSourceAsync(graphqlClient, source) {
|
|
|
187
187
|
}
|
|
188
188
|
}
|
|
189
189
|
function formatBuildChoice(build, expiryDate) {
|
|
190
|
-
const { id,
|
|
190
|
+
const { id, updatedAt, runtimeVersion, buildProfile, gitCommitHash, gitCommitMessage, channel } = build;
|
|
191
191
|
const formatValue = (field) => field ? chalk_1.default.bold(field) : chalk_1.default.dim('Unknown');
|
|
192
192
|
const buildDate = new Date(updatedAt);
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
const title =
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
]
|
|
203
|
-
.filter(it => it != null)
|
|
204
|
-
.join(', '),
|
|
205
|
-
`\tProfile: ${formatValue(buildProfile)}, Release channel: ${formatValue(releaseChannel)}`,
|
|
206
|
-
`\tAuthored by: ${formatValue(initiatingActor === null || initiatingActor === void 0 ? void 0 : initiatingActor.displayName)}`,
|
|
193
|
+
const formattedCommitData = gitCommitHash && gitCommitMessage
|
|
194
|
+
? `${chalk_1.default.dim(gitCommitHash.slice(0, 7))} "${chalk_1.default.bold(gitCommitMessage)}"`
|
|
195
|
+
: 'Unknown';
|
|
196
|
+
const title = `ID: ${chalk_1.default.dim(id)} (${chalk_1.default.dim(`${(0, date_1.fromNow)(buildDate)} ago`)})`;
|
|
197
|
+
const description = [
|
|
198
|
+
`\tProfile: ${formatValue(buildProfile)}`,
|
|
199
|
+
`\tChannel: ${formatValue(channel)}`,
|
|
200
|
+
`\tRuntime version: ${formatValue(runtimeVersion)}`,
|
|
201
|
+
`\tCommit: ${formattedCommitData}`,
|
|
207
202
|
].join('\n');
|
|
208
203
|
return {
|
|
209
204
|
title,
|
|
205
|
+
description,
|
|
210
206
|
value: build,
|
|
211
207
|
disabled: buildDate < expiryDate,
|
|
212
208
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ExpoConfig } from '@expo/config-types';
|
|
2
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
+
import { RequestedPlatform } from '../platform';
|
|
4
|
+
export declare const DEFAULT_MANAGED_RUNTIME_VERSION: {
|
|
5
|
+
readonly policy: "sdkVersion";
|
|
6
|
+
};
|
|
7
|
+
export declare const DEFAULT_BARE_RUNTIME_VERSION: "1.0.0";
|
|
8
|
+
/**
|
|
9
|
+
* Make sure EAS Update is fully configured in the current project.
|
|
10
|
+
* This goes over a checklist and performs the following checks or changes:
|
|
11
|
+
* - Enure the `expo-updates` package is currently installed.
|
|
12
|
+
* - Ensure `app.json` is configured for EAS Updates
|
|
13
|
+
* - Sets `runtimeVersion` if not set
|
|
14
|
+
* - Sets `updates.url` if not set
|
|
15
|
+
* - Ensure latest changes are reflected in the native config, if any
|
|
16
|
+
*/
|
|
17
|
+
export declare function ensureEASUpdatesIsConfiguredAsync(graphqlClient: ExpoGraphqlClient, { exp: expWithoutUpdates, projectId, projectDir, platform, }: {
|
|
18
|
+
exp: ExpoConfig;
|
|
19
|
+
projectId: string;
|
|
20
|
+
projectDir: string;
|
|
21
|
+
platform: RequestedPlatform | null;
|
|
22
|
+
}): Promise<void>;
|