@expo/eas-json 0.32.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.
@@ -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, profileName?: string): Promise<SubmitProfile<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;
@@ -56,14 +56,18 @@ class EasJsonReader {
56
56
  throw new Error(`Unknown platform ${platform}`);
57
57
  }
58
58
  }
59
- async readSubmitProfileAsync(platform, profileName) {
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('release')) {
66
- return await this.readSubmitProfileAsync(platform, 'release');
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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@expo/eas-json",
3
3
  "description": "A library for interacting with the eas.json",
4
- "version": "0.32.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": {
@@ -33,5 +33,5 @@
33
33
  "publishConfig": {
34
34
  "access": "public"
35
35
  },
36
- "gitHead": "cf7848e3c5171473ccdf1cbdde377bf73c5f6458"
36
+ "gitHead": "48130dcbdc3192a495a8094707408f2f6925075c"
37
37
  }
@@ -81,18 +81,24 @@ export class EasJsonReader {
81
81
 
82
82
  public async readSubmitProfileAsync<T extends Platform>(
83
83
  platform: T,
84
- profileName?: string
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
- if (profileNames.includes('release')) {
91
- return await this.readSubmitProfileAsync(platform, 'release');
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) {
@@ -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
- release: {},
17
+ production: {},
18
18
  },
19
19
  });
20
20
 
21
21
  const reader = new EasJsonReader('/project');
22
- const iosProfile = await reader.readBuildProfileAsync(Platform.IOS, 'release');
23
- const androidProfile = await reader.readBuildProfileAsync(Platform.ANDROID, 'release');
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
- release: {},
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
- release: {},
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
- release: { android: { buildType: 'archive' } },
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, 'release');
239
+ const promise = reader.readBuildProfileAsync(Platform.ANDROID, 'production');
240
240
  await expect(promise).rejects.toThrowError(
241
- 'eas.json is not valid [ValidationError: "build.release.android.buildType" must be one of [apk, app-bundle]]'
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, 'release');
250
- await expect(promise).rejects.toThrowError('There is no profile named release in eas.json');
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
- release: { node: '12.0.0-alpha' },
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, 'release');
261
+ const promise = reader.readBuildProfileAsync(Platform.ANDROID, 'production');
262
262
  await expect(promise).rejects.toThrowError(
263
- 'eas.json is not valid [ValidationError: "build.release.node" failed custom validation because 12.0.0-alpha is not a valid version]'
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
- release: { node: '12.0.0-alpha' },
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', 'release'].sort());
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
- release: {},
17
+ production: {},
18
18
  },
19
19
  });
20
20
 
21
21
  const reader = new EasJsonReader('/project');
22
- const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, 'release');
23
- const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, 'release');
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
- release: {
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, 'release');
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
- release: {
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, 'release');
75
+ const androidProfile = await reader.readSubmitProfileAsync(Platform.ANDROID, 'production');
76
76
 
77
77
  expect(androidProfile).toEqual({
78
78
  serviceAccountKeyPath: './path.json',
@@ -88,7 +88,7 @@ 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
- release: {
91
+ production: {
92
92
  ios: {
93
93
  appleId: 'some@email.com',
94
94
  ascAppId: '1223423523',
@@ -102,7 +102,7 @@ test('ios config with all required values', async () => {
102
102
  });
103
103
 
104
104
  const reader = new EasJsonReader('/project');
105
- const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, 'release');
105
+ const iosProfile = await reader.readSubmitProfileAsync(Platform.IOS, 'production');
106
106
 
107
107
  expect(iosProfile).toEqual({
108
108
  appleId: 'some@email.com',
@@ -35,7 +35,7 @@ test('migration for default manged eas.json', async () => {
35
35
  });
36
36
  });
37
37
 
38
- test('migration for default generic eas.json', async () => {
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 generic eas.json', async () => {
197
+ test('migration for example bare workflow eas.json', async () => {
198
198
  const easJson = {
199
199
  builds: {
200
200
  android: {