@expo/eas-json 9.0.1 → 9.0.4

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/accessor.js CHANGED
@@ -21,7 +21,7 @@ const customErrorMessageHandlers = [
21
21
  detail.path[0] === 'build' &&
22
22
  ['ios', 'android'].includes(detail.path[2].toString()) &&
23
23
  detail.path[3] === 'image') {
24
- throw new errors_1.InvalidEasJsonError(chalk_1.default.red(`Specified build image '${detail === null || detail === void 0 ? void 0 : detail.context}' is not recognized. Please update your EAS CLI and see ${(0, log_1.link)('https://docs.expo.dev/build-reference/infrastructure/')} for supported build images.`));
24
+ throw new errors_1.InvalidEasJsonError(chalk_1.default.red(`Specified build image '${detail?.context}' is not recognized. Please update your EAS CLI and see ${(0, log_1.link)('https://docs.expo.dev/build-reference/infrastructure/')} for supported build images.`));
25
25
  }
26
26
  }
27
27
  },
@@ -4,22 +4,20 @@ exports.resolveBuildProfile = void 0;
4
4
  const errors_1 = require("../errors");
5
5
  const schema_1 = require("./schema");
6
6
  function resolveBuildProfile({ easJson, platform, profileName, }) {
7
- var _a;
8
7
  const easJsonProfile = resolveProfile({
9
8
  easJson,
10
- profileName: profileName !== null && profileName !== void 0 ? profileName : 'production',
9
+ profileName: profileName ?? 'production',
11
10
  });
12
11
  const { android, ios, ...base } = easJsonProfile;
13
- const withoutDefaults = mergeProfiles(base, (_a = easJsonProfile[platform]) !== null && _a !== void 0 ? _a : {});
12
+ const withoutDefaults = mergeProfiles(base, easJsonProfile[platform] ?? {});
14
13
  return mergeProfiles(getDefaultProfile(platform), withoutDefaults);
15
14
  }
16
15
  exports.resolveBuildProfile = resolveBuildProfile;
17
16
  function resolveProfile({ easJson, profileName, depth = 0, }) {
18
- var _a;
19
17
  if (depth >= 5) {
20
18
  throw new Error('Too long chain of profile extensions, make sure "extends" keys do not make a cycle');
21
19
  }
22
- const profile = (_a = easJson.build) === null || _a === void 0 ? void 0 : _a[profileName];
20
+ const profile = easJson.build?.[profileName];
23
21
  if (!profile) {
24
22
  if (depth === 0) {
25
23
  throw new errors_1.MissingProfileError(`Missing build profile in eas.json: ${profileName}`);
@@ -12,7 +12,7 @@ function resolveSubmitProfile({ easJson, platform, profileName, }) {
12
12
  const submitProfile = resolveProfile({
13
13
  easJson,
14
14
  platform,
15
- profileName: profileName !== null && profileName !== void 0 ? profileName : 'production',
15
+ profileName: profileName ?? 'production',
16
16
  });
17
17
  const unevaluatedProfile = mergeProfiles(getDefaultProfile(platform), submitProfile);
18
18
  return evaluateFields(platform, unevaluatedProfile);
@@ -28,11 +28,10 @@ function resolveSubmitProfile({ easJson, platform, profileName, }) {
28
28
  }
29
29
  exports.resolveSubmitProfile = resolveSubmitProfile;
30
30
  function resolveProfile({ easJson, profileName, depth = 0, platform, }) {
31
- var _a;
32
31
  if (depth >= 2) {
33
32
  throw new Error('Too long chain of profile extensions, make sure "extends" keys do not make a cycle');
34
33
  }
35
- const profile = (_a = easJson.submit) === null || _a === void 0 ? void 0 : _a[profileName];
34
+ const profile = easJson.submit?.[profileName];
36
35
  if (!profile) {
37
36
  if (depth === 0) {
38
37
  throw new errors_1.MissingProfileError(`Missing submit profile in eas.json: ${profileName}`);
package/build/utils.js CHANGED
@@ -8,20 +8,18 @@ const resolver_2 = require("./submit/resolver");
8
8
  const schema_1 = require("./submit/schema");
9
9
  class EasJsonUtils {
10
10
  static async getBuildProfileNamesAsync(accessor) {
11
- var _a;
12
11
  const easJson = await accessor.readAsync();
13
- return Object.keys((_a = easJson === null || easJson === void 0 ? void 0 : easJson.build) !== null && _a !== void 0 ? _a : {});
12
+ return Object.keys(easJson?.build ?? {});
14
13
  }
15
14
  static async getBuildProfileAsync(accessor, platform, profileName) {
16
15
  const easJson = await accessor.readAsync();
17
16
  return (0, resolver_1.resolveBuildProfile)({ easJson, platform, profileName });
18
17
  }
19
18
  static async getBuildProfileDeprecationWarningsAsync(easJsonAccessor, platform, profileName) {
20
- var _a;
21
19
  const warnings = [];
22
20
  const buildProfile = await EasJsonUtils.getBuildProfileAsync(easJsonAccessor, platform, profileName);
23
21
  const rawEasJson = await easJsonAccessor.readRawJsonAsync();
24
- if (((_a = buildProfile.cache) === null || _a === void 0 ? void 0 : _a.cacheDefaultPaths) !== undefined) {
22
+ if (buildProfile.cache?.cacheDefaultPaths !== undefined) {
25
23
  warnings.push({
26
24
  message: [
27
25
  `The "build.${profileName}.cache.cacheDefaultPaths" field in eas.json is deprecated and will be removed in the future.`,
@@ -42,9 +40,8 @@ class EasJsonUtils {
42
40
  return warnings;
43
41
  }
44
42
  static getCustomPathsDeprecationWarnings(rawEasJson, profileName) {
45
- var _a, _b, _c, _d, _e, _f;
46
43
  const warnings = [];
47
- if (((_c = (_b = (_a = rawEasJson.build) === null || _a === void 0 ? void 0 : _a[profileName]) === null || _b === void 0 ? void 0 : _b.cache) === null || _c === void 0 ? void 0 : _c.customPaths) !== undefined) {
44
+ if (rawEasJson.build?.[profileName]?.cache?.customPaths !== undefined) {
48
45
  warnings.push({
49
46
  message: [
50
47
  `The "build.${profileName}.cache.customPaths" field in eas.json is deprecated and will be removed in the future. Please use "build.${profileName}.cache.paths" instead.`,
@@ -52,16 +49,15 @@ class EasJsonUtils {
52
49
  docsUrl: 'https://docs.expo.dev/build-reference/eas-json/#cache',
53
50
  });
54
51
  }
55
- if (((_e = (_d = rawEasJson.build) === null || _d === void 0 ? void 0 : _d[profileName]) === null || _e === void 0 ? void 0 : _e.extends) !== undefined) {
56
- warnings.push(...EasJsonUtils.getCustomPathsDeprecationWarnings(rawEasJson, (_f = rawEasJson.build) === null || _f === void 0 ? void 0 : _f[profileName].extends));
52
+ if (rawEasJson.build?.[profileName]?.extends !== undefined) {
53
+ warnings.push(...EasJsonUtils.getCustomPathsDeprecationWarnings(rawEasJson, rawEasJson.build?.[profileName].extends));
57
54
  }
58
55
  return warnings;
59
56
  }
60
57
  static async getCliConfigAsync(accessor) {
61
- var _a;
62
58
  try {
63
59
  const easJson = await accessor.readAsync();
64
- return (_a = easJson.cli) !== null && _a !== void 0 ? _a : null;
60
+ return easJson.cli ?? null;
65
61
  }
66
62
  catch (err) {
67
63
  if (err instanceof errors_1.MissingEasJsonError) {
@@ -71,9 +67,8 @@ class EasJsonUtils {
71
67
  }
72
68
  }
73
69
  static async getSubmitProfileNamesAsync(accessor) {
74
- var _a;
75
70
  const easJson = await accessor.readAsync();
76
- return Object.keys((_a = easJson === null || easJson === void 0 ? void 0 : easJson.submit) !== null && _a !== void 0 ? _a : {});
71
+ return Object.keys(easJson?.submit ?? {});
77
72
  }
78
73
  static async getSubmitProfileAsync(accessor, platform, profileName) {
79
74
  const easJson = await accessor.readAsync();
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@expo/eas-json",
3
3
  "description": "A library for interacting with eas.json",
4
- "version": "9.0.1",
4
+ "version": "9.0.4",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bugs": "https://github.com/expo/eas-cli/issues",
7
7
  "dependencies": {
8
8
  "@babel/code-frame": "7.23.5",
9
- "@expo/eas-build-job": "1.0.107",
9
+ "@expo/eas-build-job": "1.0.108",
10
10
  "chalk": "4.1.2",
11
11
  "env-string": "1.0.1",
12
12
  "fs-extra": "11.2.0",
@@ -53,5 +53,5 @@
53
53
  "node": "20.11.0",
54
54
  "yarn": "1.22.21"
55
55
  },
56
- "gitHead": "40c1cbe9f68929870418e2623002eff5049e8aba"
56
+ "gitHead": "675c36a157d9352700f6758f2a03209c760ef114"
57
57
  }