expo-build-properties 0.3.0 → 0.4.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/CHANGELOG.md CHANGED
@@ -10,6 +10,17 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.4.0 — 2022-10-25
14
+
15
+ ### 🛠 Breaking changes
16
+
17
+ - [plugin] Upgrade minimum runtime requirement to Node 14 (LTS). ([#18204](https://github.com/expo/expo/pull/18204) by [@EvanBacon](https://github.com/EvanBacon))
18
+ - Bumped iOS deployment target to 13.0 and deprecated support for iOS 12. ([#18873](https://github.com/expo/expo/pull/18873) by [@tsapeta](https://github.com/tsapeta))
19
+
20
+ ### 💡 Others
21
+
22
+ - Drop `@expo/config-plugins` dependency in favor of peer dependency on `expo`. ([#18595](https://github.com/expo/expo/pull/18595) by [@EvanBacon](https://github.com/EvanBacon))
23
+
13
24
  ## 0.3.0 — 2022-07-07
14
25
 
15
26
  ### 🎉 New features
package/build/android.js CHANGED
@@ -12,43 +12,43 @@ const { createBuildGradlePropsConfigPlugin } = config_plugins_1.AndroidConfig.Bu
12
12
  exports.withAndroidBuildProperties = createBuildGradlePropsConfigPlugin([
13
13
  {
14
14
  propName: 'android.minSdkVersion',
15
- propValueGetter: (config) => { var _a, _b; return (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.minSdkVersion) === null || _b === void 0 ? void 0 : _b.toString(); },
15
+ propValueGetter: (config) => config.android?.minSdkVersion?.toString(),
16
16
  },
17
17
  {
18
18
  propName: 'android.compileSdkVersion',
19
- propValueGetter: (config) => { var _a, _b; return (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.compileSdkVersion) === null || _b === void 0 ? void 0 : _b.toString(); },
19
+ propValueGetter: (config) => config.android?.compileSdkVersion?.toString(),
20
20
  },
21
21
  {
22
22
  propName: 'android.targetSdkVersion',
23
- propValueGetter: (config) => { var _a, _b; return (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.targetSdkVersion) === null || _b === void 0 ? void 0 : _b.toString(); },
23
+ propValueGetter: (config) => config.android?.targetSdkVersion?.toString(),
24
24
  },
25
25
  {
26
26
  propName: 'android.buildToolsVersion',
27
- propValueGetter: (config) => { var _a; return (_a = config.android) === null || _a === void 0 ? void 0 : _a.buildToolsVersion; },
27
+ propValueGetter: (config) => config.android?.buildToolsVersion,
28
28
  },
29
29
  {
30
30
  propName: 'android.kotlinVersion',
31
- propValueGetter: (config) => { var _a; return (_a = config.android) === null || _a === void 0 ? void 0 : _a.kotlinVersion; },
31
+ propValueGetter: (config) => config.android?.kotlinVersion,
32
32
  },
33
33
  {
34
34
  propName: 'android.packagingOptions.pickFirsts',
35
- propValueGetter: (config) => { var _a, _b, _c; return (_c = (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.packagingOptions) === null || _b === void 0 ? void 0 : _b.pickFirst) === null || _c === void 0 ? void 0 : _c.join(','); },
35
+ propValueGetter: (config) => config.android?.packagingOptions?.pickFirst?.join(','),
36
36
  },
37
37
  {
38
38
  propName: 'android.packagingOptions.excludes',
39
- propValueGetter: (config) => { var _a, _b, _c; return (_c = (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.packagingOptions) === null || _b === void 0 ? void 0 : _b.exclude) === null || _c === void 0 ? void 0 : _c.join(','); },
39
+ propValueGetter: (config) => config.android?.packagingOptions?.exclude?.join(','),
40
40
  },
41
41
  {
42
42
  propName: 'android.packagingOptions.merges',
43
- propValueGetter: (config) => { var _a, _b, _c; return (_c = (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.packagingOptions) === null || _b === void 0 ? void 0 : _b.merge) === null || _c === void 0 ? void 0 : _c.join(','); },
43
+ propValueGetter: (config) => config.android?.packagingOptions?.merge?.join(','),
44
44
  },
45
45
  {
46
46
  propName: 'android.packagingOptions.doNotStrip',
47
- propValueGetter: (config) => { var _a, _b, _c; return (_c = (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.packagingOptions) === null || _b === void 0 ? void 0 : _b.doNotStrip) === null || _c === void 0 ? void 0 : _c.join(','); },
47
+ propValueGetter: (config) => config.android?.packagingOptions?.doNotStrip?.join(','),
48
48
  },
49
49
  {
50
50
  propName: 'android.enableProguardInReleaseBuilds',
51
- propValueGetter: (config) => { var _a, _b; return (_b = (_a = config.android) === null || _a === void 0 ? void 0 : _a.enableProguardInReleaseBuilds) === null || _b === void 0 ? void 0 : _b.toString(); },
51
+ propValueGetter: (config) => config.android?.enableProguardInReleaseBuilds?.toString(),
52
52
  },
53
53
  ], 'withAndroidBuildProperties');
54
54
  /**
@@ -58,8 +58,7 @@ const withAndroidProguardRules = (config, props) => {
58
58
  return (0, config_plugins_1.withDangerousMod)(config, [
59
59
  'android',
60
60
  async (config) => {
61
- var _a, _b;
62
- const extraProguardRules = (_b = (_a = props.android) === null || _a === void 0 ? void 0 : _a.extraProguardRules) !== null && _b !== void 0 ? _b : null;
61
+ const extraProguardRules = props.android?.extraProguardRules ?? null;
63
62
  const proguardRulesFile = path_1.default.join(config.modRequest.platformProjectRoot, 'app', 'proguard-rules.pro');
64
63
  const contents = await fs_1.default.promises.readFile(proguardRulesFile, 'utf8');
65
64
  const newContents = updateAndroidProguardRules(contents, extraProguardRules);
package/build/ios.js CHANGED
@@ -6,12 +6,11 @@ const { createBuildPodfilePropsConfigPlugin } = config_plugins_1.IOSConfig.Build
6
6
  exports.withIosBuildProperties = createBuildPodfilePropsConfigPlugin([
7
7
  {
8
8
  propName: 'ios.useFrameworks',
9
- propValueGetter: (config) => { var _a; return (_a = config.ios) === null || _a === void 0 ? void 0 : _a.useFrameworks; },
9
+ propValueGetter: (config) => config.ios?.useFrameworks,
10
10
  },
11
11
  ], 'withIosBuildProperties');
12
12
  const withIosDeploymentTarget = (config, props) => {
13
- var _a;
14
- const deploymentTarget = (_a = props.ios) === null || _a === void 0 ? void 0 : _a.deploymentTarget;
13
+ const deploymentTarget = props.ios?.deploymentTarget;
15
14
  if (!deploymentTarget) {
16
15
  return config;
17
16
  }
@@ -37,7 +36,7 @@ function updateDeploymentTargetXcodeProject(project, deploymentTarget) {
37
36
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
38
37
  for (const [_, configurations] of config_plugins_1.IOSConfig.XcodeUtils.getBuildConfigurationsForListId(project, buildConfigListId)) {
39
38
  const { buildSettings } = configurations;
40
- if (buildSettings === null || buildSettings === void 0 ? void 0 : buildSettings.IPHONEOS_DEPLOYMENT_TARGET) {
39
+ if (buildSettings?.IPHONEOS_DEPLOYMENT_TARGET) {
41
40
  buildSettings.IPHONEOS_DEPLOYMENT_TARGET = deploymentTarget;
42
41
  }
43
42
  }
@@ -47,6 +46,6 @@ function updateDeploymentTargetXcodeProject(project, deploymentTarget) {
47
46
  const withIosDeploymentTargetPodfile = createBuildPodfilePropsConfigPlugin([
48
47
  {
49
48
  propName: 'ios.deploymentTarget',
50
- propValueGetter: (config) => { var _a; return (_a = config.ios) === null || _a === void 0 ? void 0 : _a.deploymentTarget; },
49
+ propValueGetter: (config) => config.ios?.deploymentTarget,
51
50
  },
52
51
  ], 'withIosDeploymentTargetPodfile');
@@ -18,7 +18,7 @@ const EXPO_SDK_MINIMAL_SUPPORTED_VERSIONS = {
18
18
  kotlinVersion: '1.6.10',
19
19
  },
20
20
  ios: {
21
- deploymentTarget: '12.0',
21
+ deploymentTarget: '13.0',
22
22
  },
23
23
  };
24
24
  const schema = {
@@ -66,31 +66,30 @@ const schema = {
66
66
  * @ignore
67
67
  */
68
68
  function maybeThrowInvalidVersions(config) {
69
- var _a, _b, _c, _d, _e, _f, _g;
70
69
  const checkItems = [
71
70
  {
72
71
  name: 'android.minSdkVersion',
73
- configVersion: (_a = config.android) === null || _a === void 0 ? void 0 : _a.minSdkVersion,
72
+ configVersion: config.android?.minSdkVersion,
74
73
  minimalVersion: EXPO_SDK_MINIMAL_SUPPORTED_VERSIONS.android.minSdkVersion,
75
74
  },
76
75
  {
77
76
  name: 'android.compileSdkVersion',
78
- configVersion: (_b = config.android) === null || _b === void 0 ? void 0 : _b.compileSdkVersion,
77
+ configVersion: config.android?.compileSdkVersion,
79
78
  minimalVersion: EXPO_SDK_MINIMAL_SUPPORTED_VERSIONS.android.compileSdkVersion,
80
79
  },
81
80
  {
82
81
  name: 'android.targetSdkVersion',
83
- configVersion: (_c = config.android) === null || _c === void 0 ? void 0 : _c.targetSdkVersion,
82
+ configVersion: config.android?.targetSdkVersion,
84
83
  minimalVersion: EXPO_SDK_MINIMAL_SUPPORTED_VERSIONS.android.targetSdkVersion,
85
84
  },
86
85
  {
87
86
  name: 'android.kotlinVersion',
88
- configVersion: (_d = config.android) === null || _d === void 0 ? void 0 : _d.kotlinVersion,
87
+ configVersion: config.android?.kotlinVersion,
89
88
  minimalVersion: EXPO_SDK_MINIMAL_SUPPORTED_VERSIONS.android.kotlinVersion,
90
89
  },
91
90
  {
92
91
  name: 'ios.deploymentTarget',
93
- configVersion: (_e = config.ios) === null || _e === void 0 ? void 0 : _e.deploymentTarget,
92
+ configVersion: config.ios?.deploymentTarget,
94
93
  minimalVersion: EXPO_SDK_MINIMAL_SUPPORTED_VERSIONS.ios.deploymentTarget,
95
94
  },
96
95
  ];
@@ -102,7 +101,7 @@ function maybeThrowInvalidVersions(config) {
102
101
  }
103
102
  if (typeof configVersion === 'string' &&
104
103
  typeof minimalVersion === 'string' &&
105
- semver_1.default.lt((_f = semver_1.default.coerce(configVersion)) !== null && _f !== void 0 ? _f : '0.0.0', (_g = semver_1.default.coerce(minimalVersion)) !== null && _g !== void 0 ? _g : '0.0.0')) {
104
+ semver_1.default.lt(semver_1.default.coerce(configVersion) ?? '0.0.0', semver_1.default.coerce(minimalVersion) ?? '0.0.0')) {
106
105
  throw new Error(`\`${name}\` needs to be at least version ${minimalVersion}.`);
107
106
  }
108
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-build-properties",
3
- "version": "0.3.0",
3
+ "version": "0.4.0",
4
4
  "description": "Config plugin to customize native build properties on prebuild",
5
5
  "main": "build/withBuildProperties.js",
6
6
  "types": "build/withBuildProperties.d.ts",
@@ -31,12 +31,11 @@
31
31
  "license": "MIT",
32
32
  "homepage": "https://docs.expo.dev/versions/latest/sdk/build-properties",
33
33
  "dependencies": {
34
- "@expo/config-plugins": "~5.0.0",
35
34
  "ajv": "^8.11.0",
36
35
  "semver": "^7.3.5"
37
36
  },
38
37
  "devDependencies": {
39
- "expo-module-scripts": "^2.0.0"
38
+ "expo-module-scripts": "^3.0.0"
40
39
  },
41
40
  "jest": {
42
41
  "preset": "expo-module-scripts"
@@ -44,5 +43,5 @@
44
43
  "peerDependencies": {
45
44
  "expo": "*"
46
45
  },
47
- "gitHead": "e893ff2b01e108cf246cec02318c0df9d6bc603c"
46
+ "gitHead": "eab2b09c735fb0fc2bf734a3f29a6593adba3838"
48
47
  }
@@ -13,7 +13,7 @@ const EXPO_SDK_MINIMAL_SUPPORTED_VERSIONS = {
13
13
  kotlinVersion: '1.6.10',
14
14
  },
15
15
  ios: {
16
- deploymentTarget: '12.0',
16
+ deploymentTarget: '13.0',
17
17
  },
18
18
  };
19
19