@expo/eas-json 0.30.0 → 0.34.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/EasJson.types.d.ts +5 -0
- package/build/EasJsonReader.d.ts +11 -2
- package/build/EasJsonReader.js +36 -5
- package/build/EasJsonSchema.d.ts +1 -0
- package/build/EasJsonSchema.js +10 -1
- package/build/EasSubmit.types.d.ts +3 -0
- package/build/EasSubmit.types.js +5 -1
- package/build/errors.d.ts +2 -0
- package/build/errors.js +6 -0
- package/build/index.d.ts +1 -1
- package/build/index.js +3 -5
- package/package.json +5 -3
- package/src/EasJson.types.ts +6 -0
- package/src/EasJsonReader.ts +51 -6
- package/src/EasJsonSchema.ts +10 -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/errors.ts +1 -0
- package/src/index.ts +1 -1
- package/build/DeprecatedConfig.types.d.ts +0 -45
- package/build/DeprecatedConfig.types.js +0 -8
- package/build/DeprecatedEasJsonReader.d.ts +0 -33
- package/build/DeprecatedEasJsonReader.js +0 -145
- package/build/DeprecatedEasJsonSchema.d.ts +0 -3
- package/build/DeprecatedEasJsonSchema.js +0 -84
- package/build/migrate.d.ts +0 -6
- package/build/migrate.js +0 -161
- package/src/DeprecatedConfig.types.ts +0 -58
- package/src/DeprecatedEasJsonReader.ts +0 -190
- package/src/DeprecatedEasJsonSchema.ts +0 -95
- package/src/__tests__/migrate-test.ts +0 -297
- package/src/migrate.ts +0 -182
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { Android, Cache, Ios } from '@expo/eas-build-job';
|
|
2
|
-
|
|
3
|
-
export enum CredentialsSource {
|
|
4
|
-
LOCAL = 'local',
|
|
5
|
-
REMOTE = 'remote',
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export type AndroidDistributionType = 'store' | 'internal';
|
|
9
|
-
export type IosDistributionType = 'store' | 'internal' | 'simulator';
|
|
10
|
-
export type DistributionType = AndroidDistributionType | IosDistributionType;
|
|
11
|
-
|
|
12
|
-
export type IosEnterpriseProvisioning = 'adhoc' | 'universal';
|
|
13
|
-
|
|
14
|
-
export type VersionAutoIncrement = boolean | 'version' | 'buildNumber';
|
|
15
|
-
|
|
16
|
-
interface IosBuilderEnvironment extends Omit<Ios.BuilderEnvironment, 'image'> {
|
|
17
|
-
image?: Ios.BuilderEnvironment['image'];
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface AndroidBuildProfile extends Android.BuilderEnvironment {
|
|
21
|
-
credentialsSource: CredentialsSource;
|
|
22
|
-
releaseChannel?: string;
|
|
23
|
-
channel?: string;
|
|
24
|
-
distribution: AndroidDistributionType;
|
|
25
|
-
cache: Cache;
|
|
26
|
-
withoutCredentials?: boolean;
|
|
27
|
-
|
|
28
|
-
buildType?: Android.BuildType;
|
|
29
|
-
|
|
30
|
-
gradleCommand?: string;
|
|
31
|
-
artifactPath?: string;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export interface IosBuildProfile extends IosBuilderEnvironment {
|
|
35
|
-
credentialsSource: CredentialsSource;
|
|
36
|
-
releaseChannel?: string;
|
|
37
|
-
channel?: string;
|
|
38
|
-
distribution: IosDistributionType;
|
|
39
|
-
enterpriseProvisioning?: IosEnterpriseProvisioning;
|
|
40
|
-
autoIncrement: VersionAutoIncrement;
|
|
41
|
-
cache: Cache;
|
|
42
|
-
|
|
43
|
-
artifactPath?: string;
|
|
44
|
-
scheme?: string;
|
|
45
|
-
schemeBuildConfiguration?: string;
|
|
46
|
-
|
|
47
|
-
buildType?: Ios.BuildType;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
export type BuildProfile = AndroidBuildProfile | IosBuildProfile;
|
|
51
|
-
|
|
52
|
-
// EasConfig represents eas.json with one specific profile
|
|
53
|
-
export interface EasConfig {
|
|
54
|
-
builds: {
|
|
55
|
-
android?: AndroidBuildProfile;
|
|
56
|
-
ios?: IosBuildProfile;
|
|
57
|
-
};
|
|
58
|
-
}
|
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { Platform, Workflow } from '@expo/eas-build-job';
|
|
2
|
-
import fs from 'fs-extra';
|
|
3
|
-
import path from 'path';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
AndroidBuildProfile,
|
|
7
|
-
BuildProfile,
|
|
8
|
-
EasConfig,
|
|
9
|
-
IosBuildProfile,
|
|
10
|
-
} from './DeprecatedConfig.types';
|
|
11
|
-
import { EasJsonSchema, schemaBuildProfileMap } from './DeprecatedEasJsonSchema';
|
|
12
|
-
|
|
13
|
-
export interface EasJson {
|
|
14
|
-
builds: {
|
|
15
|
-
android?: { [key: string]: BuildProfilePreValidation };
|
|
16
|
-
ios?: { [key: string]: BuildProfilePreValidation };
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface BuildProfilePreValidation {
|
|
21
|
-
workflow?: Workflow;
|
|
22
|
-
extends?: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
function intersect<T>(setA: Set<T>, setB: Set<T>): Set<T> {
|
|
26
|
-
return new Set([...setA].filter(i => setB.has(i)));
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export class EasJsonReader {
|
|
30
|
-
constructor(private projectDir: string, private platform: 'android' | 'ios' | 'all') {}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Return build profile names for a particular platform.
|
|
34
|
-
* If platform is 'all', return common build profiles for all platforms
|
|
35
|
-
*/
|
|
36
|
-
public async getBuildProfileNamesAsync(): Promise<string[]> {
|
|
37
|
-
const easJson = await this.readRawAsync();
|
|
38
|
-
if (this.platform === 'android') {
|
|
39
|
-
return Object.keys(easJson?.builds?.android ?? {});
|
|
40
|
-
} else if (this.platform === 'ios') {
|
|
41
|
-
return Object.keys(easJson?.builds?.ios ?? {});
|
|
42
|
-
} else {
|
|
43
|
-
const intersectingProfileNames = intersect(
|
|
44
|
-
new Set(Object.keys(easJson?.builds?.ios ?? {})),
|
|
45
|
-
new Set(Object.keys(easJson?.builds?.android ?? {}))
|
|
46
|
-
);
|
|
47
|
-
return Array.from(intersectingProfileNames);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
public async readAsync(buildProfileName: string): Promise<EasConfig> {
|
|
52
|
-
const easJson = await this.readRawAsync();
|
|
53
|
-
|
|
54
|
-
let androidConfig;
|
|
55
|
-
if (['android', 'all'].includes(this.platform)) {
|
|
56
|
-
androidConfig = this.validateBuildProfile<AndroidBuildProfile>(
|
|
57
|
-
Platform.ANDROID,
|
|
58
|
-
buildProfileName,
|
|
59
|
-
easJson.builds?.android || {}
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
let iosConfig;
|
|
63
|
-
if (['ios', 'all'].includes(this.platform)) {
|
|
64
|
-
iosConfig = this.validateBuildProfile<IosBuildProfile>(
|
|
65
|
-
Platform.IOS,
|
|
66
|
-
buildProfileName,
|
|
67
|
-
easJson.builds?.ios || {}
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
builds: {
|
|
72
|
-
...(androidConfig ? { android: androidConfig } : {}),
|
|
73
|
-
...(iosConfig ? { ios: iosConfig } : {}),
|
|
74
|
-
},
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
public async validateAsync(): Promise<void> {
|
|
79
|
-
const easJson = await this.readRawAsync();
|
|
80
|
-
|
|
81
|
-
const androidProfiles = easJson.builds?.android ?? {};
|
|
82
|
-
for (const name of Object.keys(androidProfiles)) {
|
|
83
|
-
try {
|
|
84
|
-
this.validateBuildProfile(Platform.ANDROID, name, androidProfiles);
|
|
85
|
-
} catch (err: any) {
|
|
86
|
-
err.message = `Failed to validate Android build profile "${name}"\n${err.message}`;
|
|
87
|
-
throw err;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
const iosProfiles = easJson.builds?.ios ?? {};
|
|
91
|
-
for (const name of Object.keys(iosProfiles)) {
|
|
92
|
-
try {
|
|
93
|
-
this.validateBuildProfile(Platform.IOS, name, iosProfiles);
|
|
94
|
-
} catch (err: any) {
|
|
95
|
-
err.message = `Failed to validate iOS build profile "${name}"\n${err.message}`;
|
|
96
|
-
throw err;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
public async readRawAsync(): Promise<EasJson> {
|
|
102
|
-
const rawFile = await fs.readFile(path.join(this.projectDir, 'eas.json'), 'utf8');
|
|
103
|
-
const json = JSON.parse(rawFile);
|
|
104
|
-
|
|
105
|
-
const { value, error } = EasJsonSchema.validate(json, {
|
|
106
|
-
abortEarly: false,
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
if (error) {
|
|
110
|
-
throw new Error(`eas.json is not valid [${error.toString()}]`);
|
|
111
|
-
}
|
|
112
|
-
return value;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
private validateBuildProfile<T extends BuildProfile>(
|
|
116
|
-
platform: Platform,
|
|
117
|
-
buildProfileName: string,
|
|
118
|
-
buildProfiles: Record<string, BuildProfilePreValidation>
|
|
119
|
-
): T {
|
|
120
|
-
const buildProfile = this.resolveBuildProfile(platform, buildProfileName, buildProfiles);
|
|
121
|
-
const schema = schemaBuildProfileMap[platform];
|
|
122
|
-
const { value, error } = schema.validate(buildProfile, {
|
|
123
|
-
stripUnknown: true,
|
|
124
|
-
convert: true,
|
|
125
|
-
abortEarly: false,
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
if (error) {
|
|
129
|
-
throw new Error(
|
|
130
|
-
`Object "${platform}.${buildProfileName}" in eas.json is not valid [${error.toString()}]`
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
return value;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
private resolveBuildProfile(
|
|
137
|
-
platform: Platform,
|
|
138
|
-
buildProfileName: string,
|
|
139
|
-
buildProfiles: Record<string, BuildProfilePreValidation>,
|
|
140
|
-
depth: number = 0
|
|
141
|
-
): Record<string, any> {
|
|
142
|
-
if (depth >= 2) {
|
|
143
|
-
throw new Error(
|
|
144
|
-
'Too long chain of build profile extensions, make sure "extends" keys do not make a cycle'
|
|
145
|
-
);
|
|
146
|
-
}
|
|
147
|
-
const buildProfile = buildProfiles[buildProfileName];
|
|
148
|
-
if (!buildProfile) {
|
|
149
|
-
throw new Error(`There is no profile named ${buildProfileName} for platform ${platform}`);
|
|
150
|
-
}
|
|
151
|
-
const { extends: baseProfileName, ...buildProfileRest } = buildProfile;
|
|
152
|
-
if (baseProfileName) {
|
|
153
|
-
return deepMerge(
|
|
154
|
-
this.resolveBuildProfile(platform, baseProfileName, buildProfiles, depth + 1),
|
|
155
|
-
buildProfileRest
|
|
156
|
-
);
|
|
157
|
-
} else {
|
|
158
|
-
return buildProfileRest;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function isObject(value: any): boolean {
|
|
164
|
-
return typeof value === 'object' && value !== null;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export function deepMerge(
|
|
168
|
-
base: Record<string, any>,
|
|
169
|
-
update: Record<string, any>
|
|
170
|
-
): Record<string, any> {
|
|
171
|
-
const result: Record<string, any> = {};
|
|
172
|
-
Object.keys(base).forEach(key => {
|
|
173
|
-
const oldValue = base[key];
|
|
174
|
-
const newValue = update[key];
|
|
175
|
-
if (isObject(newValue) && isObject(oldValue)) {
|
|
176
|
-
result[key] = deepMerge(oldValue, newValue);
|
|
177
|
-
} else if (newValue !== undefined) {
|
|
178
|
-
result[key] = isObject(newValue) ? deepMerge({}, newValue) : newValue;
|
|
179
|
-
} else {
|
|
180
|
-
result[key] = isObject(oldValue) ? deepMerge({}, oldValue) : oldValue;
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
Object.keys(update).forEach(key => {
|
|
184
|
-
const newValue = update[key];
|
|
185
|
-
if (result[key] === undefined) {
|
|
186
|
-
result[key] = isObject(newValue) ? deepMerge({}, newValue) : newValue;
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
return result;
|
|
190
|
-
}
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import { Android, Ios } from '@expo/eas-build-job';
|
|
2
|
-
import Joi, { CustomHelpers } from 'joi';
|
|
3
|
-
|
|
4
|
-
const semverSchemaCheck = (value: any, helpers: CustomHelpers): any => {
|
|
5
|
-
if (/^[0-9]+\.[0-9]+\.[0-9]+$/.test(value)) {
|
|
6
|
-
return value;
|
|
7
|
-
} else {
|
|
8
|
-
throw new Error(`${value} is not a valid version`);
|
|
9
|
-
}
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const AndroidBuilderEnvironmentSchema = Joi.object({
|
|
13
|
-
image: Joi.string()
|
|
14
|
-
.valid(...Android.builderBaseImages)
|
|
15
|
-
.default('default'),
|
|
16
|
-
node: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
17
|
-
yarn: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
18
|
-
ndk: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
19
|
-
expoCli: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
20
|
-
env: Joi.object().pattern(Joi.string(), Joi.string().empty(null)).default({}),
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
const IosBuilderEnvironmentSchema = Joi.object({
|
|
24
|
-
image: Joi.string().valid(...Ios.builderBaseImages),
|
|
25
|
-
node: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
26
|
-
yarn: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
27
|
-
bundler: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
28
|
-
fastlane: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
29
|
-
cocoapods: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
30
|
-
expoCli: Joi.string().empty(null).custom(semverSchemaCheck),
|
|
31
|
-
env: Joi.object().pattern(Joi.string(), Joi.string().empty(null)).default({}),
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
const CacheSchema = Joi.object({
|
|
35
|
-
disabled: Joi.boolean().default(false),
|
|
36
|
-
key: Joi.string().max(128),
|
|
37
|
-
cacheDefaultPaths: Joi.boolean().default(true),
|
|
38
|
-
customPaths: Joi.array().items(Joi.string()).default([]),
|
|
39
|
-
});
|
|
40
|
-
|
|
41
|
-
const AndroidSchema = Joi.object({
|
|
42
|
-
workflow: Joi.string(),
|
|
43
|
-
credentialsSource: Joi.string().valid('local', 'remote').default('remote'),
|
|
44
|
-
releaseChannel: Joi.string(),
|
|
45
|
-
channel: Joi.string(),
|
|
46
|
-
distribution: Joi.string().valid('store', 'internal').default('store'),
|
|
47
|
-
cache: CacheSchema.default(),
|
|
48
|
-
withoutCredentials: Joi.boolean().default(false),
|
|
49
|
-
|
|
50
|
-
artifactPath: Joi.string(),
|
|
51
|
-
gradleCommand: Joi.string(),
|
|
52
|
-
|
|
53
|
-
buildType: Joi.alternatives().conditional('distribution', {
|
|
54
|
-
is: 'internal',
|
|
55
|
-
then: Joi.string().valid('apk', 'development-client'),
|
|
56
|
-
otherwise: Joi.string().valid('apk', 'app-bundle', 'development-client'),
|
|
57
|
-
}),
|
|
58
|
-
}).concat(AndroidBuilderEnvironmentSchema);
|
|
59
|
-
|
|
60
|
-
const IosSchema = Joi.object({
|
|
61
|
-
workflow: Joi.string(),
|
|
62
|
-
credentialsSource: Joi.string().valid('local', 'remote').default('remote'),
|
|
63
|
-
releaseChannel: Joi.string(),
|
|
64
|
-
channel: Joi.string(),
|
|
65
|
-
distribution: Joi.string().valid('store', 'internal', 'simulator').default('store'),
|
|
66
|
-
enterpriseProvisioning: Joi.string().valid('adhoc', 'universal'),
|
|
67
|
-
autoIncrement: Joi.alternatives()
|
|
68
|
-
.try(Joi.boolean(), Joi.string().valid('version', 'buildNumber'))
|
|
69
|
-
.default(false),
|
|
70
|
-
cache: CacheSchema.default(),
|
|
71
|
-
|
|
72
|
-
artifactPath: Joi.string(),
|
|
73
|
-
scheme: Joi.string(),
|
|
74
|
-
schemeBuildConfiguration: Joi.string(),
|
|
75
|
-
|
|
76
|
-
buildType: Joi.string().valid('release', 'development-client'),
|
|
77
|
-
}).concat(IosBuilderEnvironmentSchema);
|
|
78
|
-
|
|
79
|
-
export const schemaBuildProfileMap: Record<string, Joi.Schema> = {
|
|
80
|
-
android: AndroidSchema,
|
|
81
|
-
ios: IosSchema,
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
export const EasJsonSchema = Joi.object({
|
|
85
|
-
builds: Joi.object({
|
|
86
|
-
android: Joi.object().pattern(
|
|
87
|
-
Joi.string(),
|
|
88
|
-
Joi.object({}).unknown(true) // profile is validated further only if build is for that platform
|
|
89
|
-
),
|
|
90
|
-
ios: Joi.object().pattern(
|
|
91
|
-
Joi.string(),
|
|
92
|
-
Joi.object({}).unknown(true) // profile is validated further only if build is for that platform
|
|
93
|
-
),
|
|
94
|
-
}),
|
|
95
|
-
});
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
import { EasJson as DeprecatedEasJson } from '../DeprecatedEasJsonReader';
|
|
2
|
-
import { migrateProfile } from '../migrate';
|
|
3
|
-
|
|
4
|
-
test('migration for default manged eas.json', async () => {
|
|
5
|
-
const easJson = {
|
|
6
|
-
builds: {
|
|
7
|
-
android: {
|
|
8
|
-
release: {
|
|
9
|
-
buildType: 'app-bundle',
|
|
10
|
-
},
|
|
11
|
-
development: {
|
|
12
|
-
buildType: 'development-client',
|
|
13
|
-
distribution: 'internal',
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
ios: {
|
|
17
|
-
release: {
|
|
18
|
-
buildType: 'release',
|
|
19
|
-
},
|
|
20
|
-
development: {
|
|
21
|
-
buildType: 'development-client',
|
|
22
|
-
distribution: 'internal',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
} as DeprecatedEasJson;
|
|
27
|
-
expect(migrateProfile(easJson, 'release')).toEqual({
|
|
28
|
-
android: {
|
|
29
|
-
buildType: 'app-bundle',
|
|
30
|
-
},
|
|
31
|
-
});
|
|
32
|
-
expect(migrateProfile(easJson, 'development')).toEqual({
|
|
33
|
-
developmentClient: true,
|
|
34
|
-
distribution: 'internal',
|
|
35
|
-
});
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
test('migration for default generic eas.json', async () => {
|
|
39
|
-
const easJson = {
|
|
40
|
-
builds: {
|
|
41
|
-
android: {
|
|
42
|
-
release: {
|
|
43
|
-
gradleCommand: ':app:bundleRelease',
|
|
44
|
-
},
|
|
45
|
-
development: {
|
|
46
|
-
gradleCommand: ':app:assembleDebug',
|
|
47
|
-
distribution: 'internal',
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
ios: {
|
|
51
|
-
release: {
|
|
52
|
-
schemeBuildConfiguration: 'Release',
|
|
53
|
-
},
|
|
54
|
-
development: {
|
|
55
|
-
schemeBuildConfiguration: 'Debug',
|
|
56
|
-
distribution: 'internal',
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
} as DeprecatedEasJson;
|
|
61
|
-
expect(migrateProfile(easJson, 'release')).toEqual({
|
|
62
|
-
android: {
|
|
63
|
-
gradleCommand: ':app:bundleRelease',
|
|
64
|
-
},
|
|
65
|
-
ios: {
|
|
66
|
-
buildConfiguration: 'Release',
|
|
67
|
-
},
|
|
68
|
-
});
|
|
69
|
-
expect(migrateProfile(easJson, 'development')).toEqual({
|
|
70
|
-
distribution: 'internal',
|
|
71
|
-
android: {
|
|
72
|
-
gradleCommand: ':app:assembleDebug',
|
|
73
|
-
},
|
|
74
|
-
ios: {
|
|
75
|
-
buildConfiguration: 'Debug',
|
|
76
|
-
},
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
test('migration for example manged eas.json', async () => {
|
|
81
|
-
const easJson = {
|
|
82
|
-
builds: {
|
|
83
|
-
android: {
|
|
84
|
-
base: {
|
|
85
|
-
image: 'default',
|
|
86
|
-
env: {
|
|
87
|
-
EXAMPLE_ENV: 'example value',
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
release: {
|
|
91
|
-
extends: 'base',
|
|
92
|
-
env: {
|
|
93
|
-
ENVIRONMENT: 'production',
|
|
94
|
-
},
|
|
95
|
-
buildType: 'app-bundle',
|
|
96
|
-
},
|
|
97
|
-
staging: {
|
|
98
|
-
extends: 'base',
|
|
99
|
-
env: {
|
|
100
|
-
ENVIRONMENT: 'staging',
|
|
101
|
-
},
|
|
102
|
-
distribution: 'internal',
|
|
103
|
-
buildType: 'apk',
|
|
104
|
-
},
|
|
105
|
-
debug: {
|
|
106
|
-
extends: 'base',
|
|
107
|
-
withoutCredentials: true,
|
|
108
|
-
env: {
|
|
109
|
-
ENVIRONMENT: 'staging',
|
|
110
|
-
},
|
|
111
|
-
distribution: 'internal',
|
|
112
|
-
buildType: 'development-client',
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
ios: {
|
|
116
|
-
base: {
|
|
117
|
-
image: 'latest',
|
|
118
|
-
node: '12.13.0',
|
|
119
|
-
yarn: '1.22.5',
|
|
120
|
-
},
|
|
121
|
-
release: {
|
|
122
|
-
extends: 'base',
|
|
123
|
-
buildType: 'release',
|
|
124
|
-
env: {
|
|
125
|
-
ENVIRONMENT: 'production',
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
inhouse: {
|
|
129
|
-
extends: 'base',
|
|
130
|
-
distribution: 'internal',
|
|
131
|
-
enterpriseProvisioning: 'universal',
|
|
132
|
-
env: {
|
|
133
|
-
ENVIRONMENT: 'staging',
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
adhoc: {
|
|
137
|
-
extends: 'base',
|
|
138
|
-
distribution: 'internal',
|
|
139
|
-
env: {
|
|
140
|
-
ENVIRONMENT: 'staging',
|
|
141
|
-
},
|
|
142
|
-
},
|
|
143
|
-
client: {
|
|
144
|
-
extends: 'adhoc',
|
|
145
|
-
buildType: 'development-client',
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
} as DeprecatedEasJson;
|
|
150
|
-
expect(migrateProfile(easJson, 'base')).toEqual({
|
|
151
|
-
android: {
|
|
152
|
-
env: {
|
|
153
|
-
EXAMPLE_ENV: 'example value',
|
|
154
|
-
},
|
|
155
|
-
image: 'default',
|
|
156
|
-
},
|
|
157
|
-
ios: {
|
|
158
|
-
image: 'latest',
|
|
159
|
-
node: '12.13.0',
|
|
160
|
-
yarn: '1.22.5',
|
|
161
|
-
},
|
|
162
|
-
});
|
|
163
|
-
expect(migrateProfile(easJson, 'release')).toEqual({
|
|
164
|
-
extends: 'base',
|
|
165
|
-
android: {
|
|
166
|
-
buildType: 'app-bundle',
|
|
167
|
-
env: {
|
|
168
|
-
ENVIRONMENT: 'production',
|
|
169
|
-
},
|
|
170
|
-
},
|
|
171
|
-
ios: {
|
|
172
|
-
env: {
|
|
173
|
-
ENVIRONMENT: 'production',
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
});
|
|
177
|
-
expect(migrateProfile(easJson, 'staging')).toEqual({
|
|
178
|
-
android: {
|
|
179
|
-
buildType: 'apk',
|
|
180
|
-
distribution: 'internal',
|
|
181
|
-
env: {
|
|
182
|
-
ENVIRONMENT: 'staging',
|
|
183
|
-
},
|
|
184
|
-
},
|
|
185
|
-
});
|
|
186
|
-
expect(migrateProfile(easJson, 'inhouse')).toEqual({
|
|
187
|
-
ios: {
|
|
188
|
-
distribution: 'internal',
|
|
189
|
-
enterpriseProvisioning: 'universal',
|
|
190
|
-
env: {
|
|
191
|
-
ENVIRONMENT: 'staging',
|
|
192
|
-
},
|
|
193
|
-
},
|
|
194
|
-
});
|
|
195
|
-
});
|
|
196
|
-
|
|
197
|
-
test('migration for example generic eas.json', async () => {
|
|
198
|
-
const easJson = {
|
|
199
|
-
builds: {
|
|
200
|
-
android: {
|
|
201
|
-
base: {
|
|
202
|
-
image: 'ubuntu-18.04-android-30-ndk-r19c',
|
|
203
|
-
ndk: '21.4.7075529',
|
|
204
|
-
env: {
|
|
205
|
-
EXAMPLE_ENV: 'example value',
|
|
206
|
-
},
|
|
207
|
-
},
|
|
208
|
-
release: {
|
|
209
|
-
extends: 'base',
|
|
210
|
-
env: {
|
|
211
|
-
ENVIRONMENT: 'production',
|
|
212
|
-
},
|
|
213
|
-
gradleCommand: ':app:bundleRelease',
|
|
214
|
-
},
|
|
215
|
-
staging: {
|
|
216
|
-
extends: 'base',
|
|
217
|
-
env: {
|
|
218
|
-
ENVIRONMENT: 'staging',
|
|
219
|
-
},
|
|
220
|
-
distribution: 'internal',
|
|
221
|
-
gradleCommand: ':app:assembleRelease',
|
|
222
|
-
},
|
|
223
|
-
debug: {
|
|
224
|
-
extends: 'base',
|
|
225
|
-
withoutCredentials: true,
|
|
226
|
-
env: {
|
|
227
|
-
ENVIRONMENT: 'staging',
|
|
228
|
-
},
|
|
229
|
-
distribution: 'internal',
|
|
230
|
-
gradleCommand: ':app:assembleDebug',
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
ios: {
|
|
234
|
-
base: {
|
|
235
|
-
image: 'latest',
|
|
236
|
-
node: '12.13.0',
|
|
237
|
-
yarn: '1.22.5',
|
|
238
|
-
},
|
|
239
|
-
release: {
|
|
240
|
-
extends: 'base',
|
|
241
|
-
schemeBuildConfiguration: 'Release',
|
|
242
|
-
scheme: 'testapp',
|
|
243
|
-
env: {
|
|
244
|
-
ENVIRONMENT: 'production',
|
|
245
|
-
},
|
|
246
|
-
},
|
|
247
|
-
inhouse: {
|
|
248
|
-
extends: 'base',
|
|
249
|
-
distribution: 'internal',
|
|
250
|
-
enterpriseProvisioning: 'universal',
|
|
251
|
-
scheme: 'testapp-enterprise',
|
|
252
|
-
env: {
|
|
253
|
-
ENVIRONMENT: 'staging',
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
adhoc: {
|
|
257
|
-
extends: 'base',
|
|
258
|
-
distribution: 'internal',
|
|
259
|
-
scheme: 'testapp',
|
|
260
|
-
env: {
|
|
261
|
-
ENVIRONMENT: 'staging',
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
} as DeprecatedEasJson;
|
|
267
|
-
expect(migrateProfile(easJson, 'base')).toEqual({
|
|
268
|
-
android: {
|
|
269
|
-
env: {
|
|
270
|
-
EXAMPLE_ENV: 'example value',
|
|
271
|
-
},
|
|
272
|
-
image: 'ubuntu-18.04-android-30-ndk-r19c',
|
|
273
|
-
ndk: '21.4.7075529',
|
|
274
|
-
},
|
|
275
|
-
ios: {
|
|
276
|
-
image: 'latest',
|
|
277
|
-
node: '12.13.0',
|
|
278
|
-
yarn: '1.22.5',
|
|
279
|
-
},
|
|
280
|
-
});
|
|
281
|
-
expect(migrateProfile(easJson, 'release')).toEqual({
|
|
282
|
-
extends: 'base',
|
|
283
|
-
android: {
|
|
284
|
-
env: {
|
|
285
|
-
ENVIRONMENT: 'production',
|
|
286
|
-
},
|
|
287
|
-
gradleCommand: ':app:bundleRelease',
|
|
288
|
-
},
|
|
289
|
-
ios: {
|
|
290
|
-
buildConfiguration: 'Release',
|
|
291
|
-
env: {
|
|
292
|
-
ENVIRONMENT: 'production',
|
|
293
|
-
},
|
|
294
|
-
scheme: 'testapp',
|
|
295
|
-
},
|
|
296
|
-
});
|
|
297
|
-
});
|