@expo/eas-json 0.29.0 → 0.33.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/build/EasBuild.types.d.ts +5 -2
- package/build/EasJsonReader.d.ts +1 -1
- package/build/EasJsonReader.js +7 -3
- package/build/EasJsonSchema.js +4 -0
- package/build/EasSubmit.types.d.ts +3 -0
- package/build/EasSubmit.types.js +5 -1
- package/build/index.d.ts +1 -1
- package/package.json +3 -3
- package/src/EasBuild.types.ts +5 -2
- package/src/EasJsonReader.ts +9 -3
- package/src/EasJsonSchema.ts +7 -0
- package/src/EasSubmit.types.ts +8 -1
- package/src/__tests__/EasJsonReader-build-test.ts +15 -15
- package/src/__tests__/EasJsonReader-submit-test.ts +54 -9
- package/src/__tests__/migrate-test.ts +2 -2
- package/src/index.ts +2 -1
|
@@ -5,7 +5,9 @@ export declare enum CredentialsSource {
|
|
|
5
5
|
}
|
|
6
6
|
export declare type DistributionType = 'store' | 'internal';
|
|
7
7
|
export declare type IosEnterpriseProvisioning = 'adhoc' | 'universal';
|
|
8
|
-
export declare type VersionAutoIncrement = boolean | 'version'
|
|
8
|
+
export declare type VersionAutoIncrement = boolean | 'version';
|
|
9
|
+
export declare type IosVersionAutoIncrement = VersionAutoIncrement | 'buildNumber';
|
|
10
|
+
export declare type AndroidVersionAutoIncrement = VersionAutoIncrement | 'versionCode';
|
|
9
11
|
export interface CommonBuildProfile {
|
|
10
12
|
credentialsSource: CredentialsSource;
|
|
11
13
|
distribution: DistributionType;
|
|
@@ -22,13 +24,14 @@ export interface AndroidBuildProfile extends CommonBuildProfile {
|
|
|
22
24
|
withoutCredentials?: boolean;
|
|
23
25
|
image?: Android.BuilderEnvironment['image'];
|
|
24
26
|
ndk?: string;
|
|
27
|
+
autoIncrement?: AndroidVersionAutoIncrement;
|
|
25
28
|
buildType?: Android.BuildType.APK | Android.BuildType.APP_BUNDLE;
|
|
26
29
|
gradleCommand?: string;
|
|
27
30
|
artifactPath?: string;
|
|
28
31
|
}
|
|
29
32
|
export interface IosBuildProfile extends CommonBuildProfile {
|
|
30
33
|
enterpriseProvisioning?: IosEnterpriseProvisioning;
|
|
31
|
-
autoIncrement?:
|
|
34
|
+
autoIncrement?: IosVersionAutoIncrement;
|
|
32
35
|
simulator?: boolean;
|
|
33
36
|
image?: Ios.BuilderEnvironment['image'];
|
|
34
37
|
bundler?: string;
|
package/build/EasJsonReader.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare class EasJsonReader {
|
|
|
19
19
|
throwIfEasJsonDoesNotExist?: boolean | undefined;
|
|
20
20
|
}): Promise<string[]>;
|
|
21
21
|
readBuildProfileAsync<T extends Platform>(platform: T, profileName: string): Promise<BuildProfile<T>>;
|
|
22
|
-
readSubmitProfileAsync<T extends Platform>(platform: T,
|
|
22
|
+
readSubmitProfileAsync<T extends Platform>(platform: T, profileNameArg?: string): Promise<SubmitProfile<T>>;
|
|
23
23
|
readAndValidateAsync(): Promise<EasJson>;
|
|
24
24
|
readRawAsync(): Promise<EasJsonPreValidation>;
|
|
25
25
|
private resolveBuildProfile;
|
package/build/EasJsonReader.js
CHANGED
|
@@ -56,14 +56,18 @@ class EasJsonReader {
|
|
|
56
56
|
throw new Error(`Unknown platform ${platform}`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
async readSubmitProfileAsync(platform,
|
|
59
|
+
async readSubmitProfileAsync(platform, profileNameArg) {
|
|
60
60
|
var _a;
|
|
61
|
+
let profileName = profileNameArg;
|
|
61
62
|
if (!profileName) {
|
|
62
63
|
const profileNames = await this.getSubmitProfileNamesAsync({
|
|
63
64
|
throwIfEasJsonDoesNotExist: false,
|
|
64
65
|
});
|
|
65
|
-
if (profileNames.includes('
|
|
66
|
-
|
|
66
|
+
if (profileNames.includes('production')) {
|
|
67
|
+
profileName = 'production';
|
|
68
|
+
}
|
|
69
|
+
else if (profileNames.includes('release')) {
|
|
70
|
+
profileName = 'release';
|
|
67
71
|
}
|
|
68
72
|
else {
|
|
69
73
|
return getDefaultSubmitProfile(platform);
|
package/build/EasJsonSchema.js
CHANGED
|
@@ -35,6 +35,7 @@ const AndroidBuildProfileSchema = CommonBuildProfileSchema.concat(joi_1.default.
|
|
|
35
35
|
withoutCredentials: joi_1.default.boolean(),
|
|
36
36
|
image: joi_1.default.string().valid(...eas_build_job_1.Android.builderBaseImages),
|
|
37
37
|
ndk: joi_1.default.string().empty(null).custom(semverSchemaCheck),
|
|
38
|
+
autoIncrement: joi_1.default.alternatives().try(joi_1.default.boolean(), joi_1.default.string().valid('version', 'versionCode')),
|
|
38
39
|
artifactPath: joi_1.default.string(),
|
|
39
40
|
gradleCommand: joi_1.default.string(),
|
|
40
41
|
buildType: joi_1.default.string().valid('apk', 'app-bundle'),
|
|
@@ -67,6 +68,9 @@ exports.AndroidSubmitProfileSchema = joi_1.default.object({
|
|
|
67
68
|
changesNotSentForReview: joi_1.default.boolean().default(false),
|
|
68
69
|
});
|
|
69
70
|
exports.IosSubmitProfileSchema = joi_1.default.object({
|
|
71
|
+
ascApiKeyPath: joi_1.default.string(),
|
|
72
|
+
ascApiKeyId: joi_1.default.string(),
|
|
73
|
+
ascApiKeyIssuerId: joi_1.default.string(),
|
|
70
74
|
appleId: joi_1.default.string(),
|
|
71
75
|
ascAppId: joi_1.default.string(),
|
|
72
76
|
appleTeamId: joi_1.default.string(),
|
|
@@ -19,6 +19,9 @@ export interface AndroidSubmitProfile {
|
|
|
19
19
|
}
|
|
20
20
|
export declare const AndroidSubmitProfileFieldsToEvaluate: (keyof AndroidSubmitProfile)[];
|
|
21
21
|
export interface IosSubmitProfile {
|
|
22
|
+
ascApiKeyPath?: string;
|
|
23
|
+
ascApiKeyIssuerId?: string;
|
|
24
|
+
ascApiKeyId?: string;
|
|
22
25
|
appleId?: string;
|
|
23
26
|
ascAppId?: string;
|
|
24
27
|
appleTeamId?: string;
|
package/build/EasSubmit.types.js
CHANGED
|
@@ -18,4 +18,8 @@ var AndroidReleaseTrack;
|
|
|
18
18
|
exports.AndroidSubmitProfileFieldsToEvaluate = [
|
|
19
19
|
'serviceAccountKeyPath',
|
|
20
20
|
];
|
|
21
|
-
exports.IosSubmitProfileFieldsToEvaluate = [
|
|
21
|
+
exports.IosSubmitProfileFieldsToEvaluate = [
|
|
22
|
+
'ascApiKeyPath',
|
|
23
|
+
'ascApiKeyIssuerId',
|
|
24
|
+
'ascApiKeyId',
|
|
25
|
+
];
|
package/build/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { AndroidSubmitProfile, AndroidReleaseStatus, AndroidReleaseTrack, IosSubmitProfile, SubmitProfile, } from './EasSubmit.types';
|
|
2
2
|
export { EasJson } from './EasJson.types';
|
|
3
|
-
export { AndroidBuildProfile, BuildProfile, CredentialsSource, DistributionType, IosBuildProfile, IosEnterpriseProvisioning,
|
|
3
|
+
export { AndroidBuildProfile, BuildProfile, CredentialsSource, DistributionType, IosBuildProfile, IosEnterpriseProvisioning, IosVersionAutoIncrement, AndroidVersionAutoIncrement, } from './EasBuild.types';
|
|
4
4
|
export { EasJsonReader } from './EasJsonReader';
|
|
5
5
|
export { hasMismatchedExtendsAsync, isUsingDeprecatedFormatAsync, migrateAsync } from './migrate';
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/eas-json",
|
|
3
3
|
"description": "A library for interacting with the eas.json",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.33.0",
|
|
5
5
|
"author": "Expo <support@expo.dev>",
|
|
6
6
|
"bugs": "https://github.com/expo/eas-cli/issues",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@expo/eas-build-job": "0.2.
|
|
8
|
+
"@expo/eas-build-job": "0.2.52",
|
|
9
9
|
"@expo/json-file": "8.2.33",
|
|
10
10
|
"env-string": "1.0.1",
|
|
11
11
|
"fs-extra": "10.0.0",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "48130dcbdc3192a495a8094707408f2f6925075c"
|
|
37
37
|
}
|
package/src/EasBuild.types.ts
CHANGED
|
@@ -9,7 +9,9 @@ export type DistributionType = 'store' | 'internal';
|
|
|
9
9
|
|
|
10
10
|
export type IosEnterpriseProvisioning = 'adhoc' | 'universal';
|
|
11
11
|
|
|
12
|
-
export type VersionAutoIncrement = boolean | 'version'
|
|
12
|
+
export type VersionAutoIncrement = boolean | 'version';
|
|
13
|
+
export type IosVersionAutoIncrement = VersionAutoIncrement | 'buildNumber';
|
|
14
|
+
export type AndroidVersionAutoIncrement = VersionAutoIncrement | 'versionCode';
|
|
13
15
|
|
|
14
16
|
export interface CommonBuildProfile {
|
|
15
17
|
credentialsSource: CredentialsSource;
|
|
@@ -29,6 +31,7 @@ export interface AndroidBuildProfile extends CommonBuildProfile {
|
|
|
29
31
|
withoutCredentials?: boolean;
|
|
30
32
|
image?: Android.BuilderEnvironment['image'];
|
|
31
33
|
ndk?: string;
|
|
34
|
+
autoIncrement?: AndroidVersionAutoIncrement;
|
|
32
35
|
|
|
33
36
|
buildType?: Android.BuildType.APK | Android.BuildType.APP_BUNDLE;
|
|
34
37
|
|
|
@@ -38,7 +41,7 @@ export interface AndroidBuildProfile extends CommonBuildProfile {
|
|
|
38
41
|
|
|
39
42
|
export interface IosBuildProfile extends CommonBuildProfile {
|
|
40
43
|
enterpriseProvisioning?: IosEnterpriseProvisioning;
|
|
41
|
-
autoIncrement?:
|
|
44
|
+
autoIncrement?: IosVersionAutoIncrement;
|
|
42
45
|
simulator?: boolean;
|
|
43
46
|
image?: Ios.BuilderEnvironment['image'];
|
|
44
47
|
bundler?: string;
|
package/src/EasJsonReader.ts
CHANGED
|
@@ -81,18 +81,24 @@ export class EasJsonReader {
|
|
|
81
81
|
|
|
82
82
|
public async readSubmitProfileAsync<T extends Platform>(
|
|
83
83
|
platform: T,
|
|
84
|
-
|
|
84
|
+
profileNameArg?: string
|
|
85
85
|
): Promise<SubmitProfile<T>> {
|
|
86
|
+
let profileName = profileNameArg;
|
|
87
|
+
|
|
86
88
|
if (!profileName) {
|
|
87
89
|
const profileNames = await this.getSubmitProfileNamesAsync({
|
|
88
90
|
throwIfEasJsonDoesNotExist: false,
|
|
89
91
|
});
|
|
90
|
-
|
|
91
|
-
|
|
92
|
+
|
|
93
|
+
if (profileNames.includes('production')) {
|
|
94
|
+
profileName = 'production';
|
|
95
|
+
} else if (profileNames.includes('release')) {
|
|
96
|
+
profileName = 'release';
|
|
92
97
|
} else {
|
|
93
98
|
return getDefaultSubmitProfile(platform);
|
|
94
99
|
}
|
|
95
100
|
}
|
|
101
|
+
|
|
96
102
|
const easJson = await this.readAndValidateAsync();
|
|
97
103
|
const profile = easJson?.submit?.[profileName];
|
|
98
104
|
if (!profile) {
|
package/src/EasJsonSchema.ts
CHANGED
|
@@ -38,6 +38,10 @@ const AndroidBuildProfileSchema = CommonBuildProfileSchema.concat(
|
|
|
38
38
|
|
|
39
39
|
image: Joi.string().valid(...Android.builderBaseImages),
|
|
40
40
|
ndk: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
41
|
+
autoIncrement: Joi.alternatives().try(
|
|
42
|
+
Joi.boolean(),
|
|
43
|
+
Joi.string().valid('version', 'versionCode')
|
|
44
|
+
),
|
|
41
45
|
|
|
42
46
|
artifactPath: Joi.string(),
|
|
43
47
|
gradleCommand: Joi.string(),
|
|
@@ -86,6 +90,9 @@ export const AndroidSubmitProfileSchema = Joi.object({
|
|
|
86
90
|
});
|
|
87
91
|
|
|
88
92
|
export const IosSubmitProfileSchema = Joi.object({
|
|
93
|
+
ascApiKeyPath: Joi.string(),
|
|
94
|
+
ascApiKeyId: Joi.string(),
|
|
95
|
+
ascApiKeyIssuerId: Joi.string(),
|
|
89
96
|
appleId: Joi.string(),
|
|
90
97
|
ascAppId: Joi.string(),
|
|
91
98
|
appleTeamId: Joi.string(),
|
package/src/EasSubmit.types.ts
CHANGED
|
@@ -26,6 +26,9 @@ export const AndroidSubmitProfileFieldsToEvaluate: (keyof AndroidSubmitProfile)[
|
|
|
26
26
|
];
|
|
27
27
|
|
|
28
28
|
export interface IosSubmitProfile {
|
|
29
|
+
ascApiKeyPath?: string;
|
|
30
|
+
ascApiKeyIssuerId?: string;
|
|
31
|
+
ascApiKeyId?: string;
|
|
29
32
|
appleId?: string;
|
|
30
33
|
ascAppId?: string;
|
|
31
34
|
appleTeamId?: string;
|
|
@@ -35,7 +38,11 @@ export interface IosSubmitProfile {
|
|
|
35
38
|
appName?: string;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
export const IosSubmitProfileFieldsToEvaluate: (keyof IosSubmitProfile)[] = [
|
|
41
|
+
export const IosSubmitProfileFieldsToEvaluate: (keyof IosSubmitProfile)[] = [
|
|
42
|
+
'ascApiKeyPath',
|
|
43
|
+
'ascApiKeyIssuerId',
|
|
44
|
+
'ascApiKeyId',
|
|
45
|
+
];
|
|
39
46
|
|
|
40
47
|
export type SubmitProfile<TPlatform extends Platform = Platform> =
|
|
41
48
|
TPlatform extends Platform.ANDROID
|
|
@@ -14,13 +14,13 @@ beforeEach(async () => {
|
|
|
14
14
|
test('minimal valid eas.json for both platforms', async () => {
|
|
15
15
|
await fs.writeJson('/project/eas.json', {
|
|
16
16
|
build: {
|
|
17
|
-
|
|
17
|
+
production: {},
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
const reader = new EasJsonReader('/project');
|
|
22
|
-
const iosProfile = await reader.readBuildProfileAsync(Platform.IOS, '
|
|
23
|
-
const androidProfile = await reader.readBuildProfileAsync(Platform.ANDROID, '
|
|
22
|
+
const iosProfile = await reader.readBuildProfileAsync(Platform.IOS, 'production');
|
|
23
|
+
const androidProfile = await reader.readBuildProfileAsync(Platform.ANDROID, 'production');
|
|
24
24
|
|
|
25
25
|
expect({
|
|
26
26
|
distribution: 'store',
|
|
@@ -36,7 +36,7 @@ test('minimal valid eas.json for both platforms', async () => {
|
|
|
36
36
|
test('valid eas.json for development client builds', async () => {
|
|
37
37
|
await fs.writeJson('/project/eas.json', {
|
|
38
38
|
build: {
|
|
39
|
-
|
|
39
|
+
production: {},
|
|
40
40
|
debug: {
|
|
41
41
|
developmentClient: true,
|
|
42
42
|
android: {
|
|
@@ -219,7 +219,7 @@ test('valid profile extending other profile with platform specific caching', asy
|
|
|
219
219
|
test('valid eas.json with missing profile', async () => {
|
|
220
220
|
await fs.writeJson('/project/eas.json', {
|
|
221
221
|
build: {
|
|
222
|
-
|
|
222
|
+
production: {},
|
|
223
223
|
},
|
|
224
224
|
});
|
|
225
225
|
|
|
@@ -231,14 +231,14 @@ test('valid eas.json with missing profile', async () => {
|
|
|
231
231
|
test('invalid eas.json when using wrong buildType', async () => {
|
|
232
232
|
await fs.writeJson('/project/eas.json', {
|
|
233
233
|
build: {
|
|
234
|
-
|
|
234
|
+
production: { android: { buildType: 'archive' } },
|
|
235
235
|
},
|
|
236
236
|
});
|
|
237
237
|
|
|
238
238
|
const reader = new EasJsonReader('/project');
|
|
239
|
-
const promise = reader.readBuildProfileAsync(Platform.ANDROID, '
|
|
239
|
+
const promise = reader.readBuildProfileAsync(Platform.ANDROID, 'production');
|
|
240
240
|
await expect(promise).rejects.toThrowError(
|
|
241
|
-
'eas.json is not valid [ValidationError: "build.
|
|
241
|
+
'eas.json is not valid [ValidationError: "build.production.android.buildType" must be one of [apk, app-bundle]]'
|
|
242
242
|
);
|
|
243
243
|
});
|
|
244
244
|
|
|
@@ -246,33 +246,33 @@ test('empty json', async () => {
|
|
|
246
246
|
await fs.writeJson('/project/eas.json', {});
|
|
247
247
|
|
|
248
248
|
const reader = new EasJsonReader('/project');
|
|
249
|
-
const promise = reader.readBuildProfileAsync(Platform.ANDROID, '
|
|
250
|
-
await expect(promise).rejects.toThrowError('There is no profile named
|
|
249
|
+
const promise = reader.readBuildProfileAsync(Platform.ANDROID, 'production');
|
|
250
|
+
await expect(promise).rejects.toThrowError('There is no profile named production in eas.json');
|
|
251
251
|
});
|
|
252
252
|
|
|
253
253
|
test('invalid semver value', async () => {
|
|
254
254
|
await fs.writeJson('/project/eas.json', {
|
|
255
255
|
build: {
|
|
256
|
-
|
|
256
|
+
production: { node: '12.0.0-alpha' },
|
|
257
257
|
},
|
|
258
258
|
});
|
|
259
259
|
|
|
260
260
|
const reader = new EasJsonReader('/project');
|
|
261
|
-
const promise = reader.readBuildProfileAsync(Platform.ANDROID, '
|
|
261
|
+
const promise = reader.readBuildProfileAsync(Platform.ANDROID, 'production');
|
|
262
262
|
await expect(promise).rejects.toThrowError(
|
|
263
|
-
'eas.json is not valid [ValidationError: "build.
|
|
263
|
+
'eas.json is not valid [ValidationError: "build.production.node" failed custom validation because 12.0.0-alpha is not a valid version]'
|
|
264
264
|
);
|
|
265
265
|
});
|
|
266
266
|
|
|
267
267
|
test('get profile names', async () => {
|
|
268
268
|
await fs.writeJson('/project/eas.json', {
|
|
269
269
|
build: {
|
|
270
|
-
|
|
270
|
+
production: { node: '12.0.0-alpha' },
|
|
271
271
|
blah: { node: '12.0.0-alpha' },
|
|
272
272
|
},
|
|
273
273
|
});
|
|
274
274
|
|
|
275
275
|
const reader = new EasJsonReader('/project');
|
|
276
276
|
const allProfileNames = await reader.getBuildProfileNamesAsync();
|
|
277
|
-
expect(allProfileNames.sort()).toEqual(['blah', '
|
|
277
|
+
expect(allProfileNames.sort()).toEqual(['blah', 'production'].sort());
|
|
278
278
|
});
|
|
@@ -14,13 +14,13 @@ beforeEach(async () => {
|
|
|
14
14
|
test('minimal allowed eas.json for both platforms', async () => {
|
|
15
15
|
await fs.writeJson('/project/eas.json', {
|
|
16
16
|
submit: {
|
|
17
|
-
|
|
17
|
+
production: {},
|
|
18
18
|
},
|
|
19
19
|
});
|
|
20
20
|
|
|
21
21
|
const reader = new EasJsonReader('/project');
|
|
22
|
-
const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, '
|
|
23
|
-
const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, '
|
|
22
|
+
const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, 'production');
|
|
23
|
+
const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, 'production');
|
|
24
24
|
|
|
25
25
|
expect(androidProfile).toEqual({
|
|
26
26
|
changesNotSentForReview: false,
|
|
@@ -35,7 +35,7 @@ test('minimal allowed eas.json for both platforms', async () => {
|
|
|
35
35
|
test('android config with all required values', async () => {
|
|
36
36
|
await fs.writeJson('/project/eas.json', {
|
|
37
37
|
submit: {
|
|
38
|
-
|
|
38
|
+
production: {
|
|
39
39
|
android: {
|
|
40
40
|
serviceAccountKeyPath: './path.json',
|
|
41
41
|
track: 'beta',
|
|
@@ -46,7 +46,7 @@ test('android config with all required values', async () => {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
const reader = new EasJsonReader('/project');
|
|
49
|
-
const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, '
|
|
49
|
+
const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, 'production');
|
|
50
50
|
|
|
51
51
|
expect(androidProfile).toEqual({
|
|
52
52
|
serviceAccountKeyPath: './path.json',
|
|
@@ -59,7 +59,7 @@ test('android config with all required values', async () => {
|
|
|
59
59
|
test('android config with serviceAccountKeyPath set to env var', async () => {
|
|
60
60
|
await fs.writeJson('/project/eas.json', {
|
|
61
61
|
submit: {
|
|
62
|
-
|
|
62
|
+
production: {
|
|
63
63
|
android: {
|
|
64
64
|
serviceAccountKeyPath: '$GOOGLE_SERVICE_ACCOUNT',
|
|
65
65
|
track: 'beta',
|
|
@@ -72,7 +72,7 @@ test('android config with serviceAccountKeyPath set to env var', async () => {
|
|
|
72
72
|
try {
|
|
73
73
|
process.env.GOOGLE_SERVICE_ACCOUNT = './path.json';
|
|
74
74
|
const reader = new EasJsonReader('/project');
|
|
75
|
-
const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, '
|
|
75
|
+
const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, 'production');
|
|
76
76
|
|
|
77
77
|
expect(androidProfile).toEqual({
|
|
78
78
|
serviceAccountKeyPath: './path.json',
|
|
@@ -88,23 +88,68 @@ test('android config with serviceAccountKeyPath set to env var', async () => {
|
|
|
88
88
|
test('ios config with all required values', async () => {
|
|
89
89
|
await fs.writeJson('/project/eas.json', {
|
|
90
90
|
submit: {
|
|
91
|
-
|
|
91
|
+
production: {
|
|
92
92
|
ios: {
|
|
93
93
|
appleId: 'some@email.com',
|
|
94
94
|
ascAppId: '1223423523',
|
|
95
95
|
appleTeamId: 'QWERTY',
|
|
96
|
+
ascApiKeyPath: './path-ABCD.p8',
|
|
97
|
+
ascApiKeyIssuerId: 'abc-123-def-456',
|
|
98
|
+
ascApiKeyId: 'ABCD',
|
|
96
99
|
},
|
|
97
100
|
},
|
|
98
101
|
},
|
|
99
102
|
});
|
|
100
103
|
|
|
101
104
|
const reader = new EasJsonReader('/project');
|
|
102
|
-
const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, '
|
|
105
|
+
const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, 'production');
|
|
103
106
|
|
|
104
107
|
expect(iosProfile).toEqual({
|
|
105
108
|
appleId: 'some@email.com',
|
|
106
109
|
appleTeamId: 'QWERTY',
|
|
107
110
|
ascAppId: '1223423523',
|
|
111
|
+
ascApiKeyPath: './path-ABCD.p8',
|
|
112
|
+
ascApiKeyIssuerId: 'abc-123-def-456',
|
|
113
|
+
ascApiKeyId: 'ABCD',
|
|
108
114
|
language: 'en-US',
|
|
109
115
|
});
|
|
110
116
|
});
|
|
117
|
+
|
|
118
|
+
test('ios config with ascApiKey fields set to env var', async () => {
|
|
119
|
+
await fs.writeJson('/project/eas.json', {
|
|
120
|
+
submit: {
|
|
121
|
+
release: {
|
|
122
|
+
ios: {
|
|
123
|
+
appleId: 'some@email.com',
|
|
124
|
+
ascAppId: '1223423523',
|
|
125
|
+
appleTeamId: 'QWERTY',
|
|
126
|
+
ascApiKeyPath: '$ASC_API_KEY_PATH',
|
|
127
|
+
ascApiKeyIssuerId: '$ASC_API_KEY_ISSUER_ID',
|
|
128
|
+
ascApiKeyId: '$ASC_API_KEY_ID',
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
try {
|
|
135
|
+
process.env.ASC_API_KEY_PATH = './path-ABCD.p8';
|
|
136
|
+
process.env.ASC_API_KEY_ISSUER_ID = 'abc-123-def-456';
|
|
137
|
+
process.env.ASC_API_KEY_ID = 'ABCD';
|
|
138
|
+
const reader = new EasJsonReader('/project');
|
|
139
|
+
const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, 'release');
|
|
140
|
+
|
|
141
|
+
expect(iosProfile).toEqual({
|
|
142
|
+
appleId: 'some@email.com',
|
|
143
|
+
ascAppId: '1223423523',
|
|
144
|
+
appleTeamId: 'QWERTY',
|
|
145
|
+
ascApiKeyPath: './path-ABCD.p8',
|
|
146
|
+
ascApiKeyIssuerId: 'abc-123-def-456',
|
|
147
|
+
ascApiKeyId: 'ABCD',
|
|
148
|
+
language: 'en-US',
|
|
149
|
+
});
|
|
150
|
+
} finally {
|
|
151
|
+
process.env.ASC_API_KEY_PATH = undefined;
|
|
152
|
+
process.env.ASC_API_KEY_ISSUER_ID = undefined;
|
|
153
|
+
process.env.ASC_API_KEY_ID = undefined;
|
|
154
|
+
}
|
|
155
|
+
});
|
|
@@ -35,7 +35,7 @@ test('migration for default manged eas.json', async () => {
|
|
|
35
35
|
});
|
|
36
36
|
});
|
|
37
37
|
|
|
38
|
-
test('migration for default
|
|
38
|
+
test('migration for default bare workflow eas.json', async () => {
|
|
39
39
|
const easJson = {
|
|
40
40
|
builds: {
|
|
41
41
|
android: {
|
|
@@ -194,7 +194,7 @@ test('migration for example manged eas.json', async () => {
|
|
|
194
194
|
});
|
|
195
195
|
});
|
|
196
196
|
|
|
197
|
-
test('migration for example
|
|
197
|
+
test('migration for example bare workflow eas.json', async () => {
|
|
198
198
|
const easJson = {
|
|
199
199
|
builds: {
|
|
200
200
|
android: {
|
package/src/index.ts
CHANGED
|
@@ -13,7 +13,8 @@ export {
|
|
|
13
13
|
DistributionType,
|
|
14
14
|
IosBuildProfile,
|
|
15
15
|
IosEnterpriseProvisioning,
|
|
16
|
-
|
|
16
|
+
IosVersionAutoIncrement,
|
|
17
|
+
AndroidVersionAutoIncrement,
|
|
17
18
|
} from './EasBuild.types';
|
|
18
19
|
export { EasJsonReader } from './EasJsonReader';
|
|
19
20
|
export { hasMismatchedExtendsAsync, isUsingDeprecatedFormatAsync, migrateAsync } from './migrate';
|