expo-build-properties 0.5.2 → 0.7.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,18 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.7.0 — 2023-05-08
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Fixed false alarm error throwing when `ios.flipper=false` and `useFrameworks`. ([#22296](https://github.com/expo/expo/pull/22296) by [@kudo](https://github.com/kudo))
18
+
19
+ ## 0.6.0 - 2023-04-14
20
+
21
+ ### 🎉 New features
22
+
23
+ - Added experimental `unstable_networkInspector` properties. ([#22129](https://github.com/expo/expo/pull/22129) by [@kudo](https://github.com/kudo))
24
+
13
25
  ## 0.5.2 — 2023-04-03
14
26
 
15
27
  ### 🎉 New features
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # expo-build-properties
2
2
 
3
- **`expo-build-properties`** is a config plugin for managed apps to override the default native build properties.
3
+ **`expo-build-properties`** is a [config plugin](https://docs.expo.dev/config-plugins/introduction/) to customize native build properties when using [`npx expo prebuild`](https://docs.expo.dev/workflow/prebuild/).
4
4
 
5
5
  ## API documentation
6
6
 
@@ -9,10 +9,8 @@
9
9
 
10
10
  ### Installation
11
11
 
12
- **Note:** To use this config plugin, your apps must be a managed app and build by either [EAS Build](/build/introduction.md) or `expo run:[android|ios]`.
13
-
14
12
  ```
15
- expo install expo-build-properties
13
+ npx expo install expo-build-properties
16
14
  ```
17
15
 
18
16
  Add plugin to `app.json`. For example:
@@ -48,4 +46,4 @@ Contributions are very welcome! Please refer to guidelines described in the [con
48
46
  [docs-main]: https://github.com/expo/expo/blob/main/docs/pages/versions/unversioned/sdk/build-properties.mdx
49
47
  [docs-stable]: https://docs.expo.dev/versions/latest/sdk/build-properties/
50
48
  [contributing]: https://github.com/expo/expo#contributing
51
- [config-plugins]: https://docs.expo.dev/guides/config-plugins/
49
+ [config-plugins]: https://docs.expo.dev/home/config-plugins/introduction
package/build/android.js CHANGED
@@ -58,6 +58,10 @@ exports.withAndroidBuildProperties = createBuildGradlePropsConfigPlugin([
58
58
  propName: 'android.enableShrinkResourcesInReleaseBuilds',
59
59
  propValueGetter: (config) => config.android?.enableShrinkResourcesInReleaseBuilds?.toString(),
60
60
  },
61
+ {
62
+ propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
63
+ propValueGetter: (config) => config.android?.unstable_networkInspector?.toString(),
64
+ },
61
65
  ], 'withAndroidBuildProperties');
62
66
  const withAndroidFlipper = (config, props) => {
63
67
  const ANDROID_FLIPPER_KEY = 'FLIPPER_VERSION';
package/build/ios.js CHANGED
@@ -21,6 +21,10 @@ exports.withIosBuildProperties = createBuildPodfilePropsConfigPlugin([
21
21
  return undefined;
22
22
  },
23
23
  },
24
+ {
25
+ propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
26
+ propValueGetter: (config) => config.ios?.unstable_networkInspector?.toString(),
27
+ },
24
28
  ], 'withIosBuildProperties');
25
29
  const withIosDeploymentTarget = (config, props) => {
26
30
  const deploymentTarget = props.ios?.deploymentTarget;
@@ -67,6 +67,11 @@ export interface PluginConfigTypeAndroid {
67
67
  * semver string and specify an alternate Flipper version.
68
68
  */
69
69
  flipper?: string;
70
+ /**
71
+ * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
72
+ * SDK 49+ is required.
73
+ */
74
+ unstable_networkInspector?: boolean;
70
75
  }
71
76
  /**
72
77
  * Interface representing available configuration for iOS native build properties.
@@ -101,6 +106,11 @@ export interface PluginConfigTypeIos {
101
106
  * doing so will generate an error.
102
107
  */
103
108
  flipper?: boolean | string;
109
+ /**
110
+ * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
111
+ * SDK 49+ is required.
112
+ */
113
+ unstable_networkInspector?: boolean;
104
114
  }
105
115
  /**
106
116
  * Interface representing available configuration for Android Gradle plugin [PackagingOptions](https://developer.android.com/reference/tools/gradle-api/7.0/com/android/build/api/dsl/PackagingOptions).
@@ -50,6 +50,7 @@ const schema = {
50
50
  },
51
51
  nullable: true,
52
52
  },
53
+ unstable_networkInspector: { type: 'boolean', nullable: true },
53
54
  },
54
55
  nullable: true,
55
56
  },
@@ -63,6 +64,7 @@ const schema = {
63
64
  type: ['boolean', 'string'],
64
65
  nullable: true,
65
66
  },
67
+ unstable_networkInspector: { type: 'boolean', nullable: true },
66
68
  },
67
69
  nullable: true,
68
70
  },
@@ -128,7 +130,7 @@ function validateConfig(config) {
128
130
  maybeThrowInvalidVersions(config);
129
131
  // explicitly block using use_frameworks and Flipper in iOS
130
132
  // https://github.com/facebook/flipper/issues/2414
131
- if (config?.ios?.flipper !== undefined && config?.ios?.useFrameworks !== undefined) {
133
+ if (Boolean(config.ios?.flipper) && config.ios?.useFrameworks !== undefined) {
132
134
  throw new Error('`ios.flipper` cannot be enabled when `ios.useFrameworks` is set.');
133
135
  }
134
136
  if (config.android?.enableShrinkResourcesInReleaseBuilds === true &&
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-build-properties",
3
- "version": "0.5.2",
3
+ "version": "0.7.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",
@@ -40,5 +40,5 @@
40
40
  "peerDependencies": {
41
41
  "expo": "*"
42
42
  },
43
- "gitHead": "014aa056080fd88a11b09b5be7c3ba078fbec7d0"
43
+ "gitHead": "4ba50c428c8369bb6b3a51a860d4898ad4ccbe78"
44
44
  }
package/src/android.ts CHANGED
@@ -63,6 +63,10 @@ export const withAndroidBuildProperties = createBuildGradlePropsConfigPlugin<Plu
63
63
  propName: 'android.enableShrinkResourcesInReleaseBuilds',
64
64
  propValueGetter: (config) => config.android?.enableShrinkResourcesInReleaseBuilds?.toString(),
65
65
  },
66
+ {
67
+ propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
68
+ propValueGetter: (config) => config.android?.unstable_networkInspector?.toString(),
69
+ },
66
70
  ],
67
71
  'withAndroidBuildProperties'
68
72
  );
package/src/ios.ts CHANGED
@@ -23,6 +23,10 @@ export const withIosBuildProperties = createBuildPodfilePropsConfigPlugin<Plugin
23
23
  return undefined;
24
24
  },
25
25
  },
26
+ {
27
+ propName: 'EX_DEV_CLIENT_NETWORK_INSPECTOR',
28
+ propValueGetter: (config) => config.ios?.unstable_networkInspector?.toString(),
29
+ },
26
30
  ],
27
31
  'withIosBuildProperties'
28
32
  );
@@ -88,6 +88,12 @@ export interface PluginConfigTypeAndroid {
88
88
  * semver string and specify an alternate Flipper version.
89
89
  */
90
90
  flipper?: string;
91
+
92
+ /**
93
+ * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
94
+ * SDK 49+ is required.
95
+ */
96
+ unstable_networkInspector?: boolean;
91
97
  }
92
98
 
93
99
  /**
@@ -125,6 +131,12 @@ export interface PluginConfigTypeIos {
125
131
  * doing so will generate an error.
126
132
  */
127
133
  flipper?: boolean | string;
134
+
135
+ /**
136
+ * Enable the experimental Network Inspector for [Development builds](https://docs.expo.dev/develop/development-builds/introduction/).
137
+ * SDK 49+ is required.
138
+ */
139
+ unstable_networkInspector?: boolean;
128
140
  }
129
141
 
130
142
  /**
@@ -182,6 +194,8 @@ const schema: JSONSchemaType<PluginConfigType> = {
182
194
  },
183
195
  nullable: true,
184
196
  },
197
+
198
+ unstable_networkInspector: { type: 'boolean', nullable: true },
185
199
  },
186
200
  nullable: true,
187
201
  },
@@ -196,6 +210,8 @@ const schema: JSONSchemaType<PluginConfigType> = {
196
210
  type: ['boolean', 'string'],
197
211
  nullable: true,
198
212
  },
213
+
214
+ unstable_networkInspector: { type: 'boolean', nullable: true },
199
215
  },
200
216
  nullable: true,
201
217
  },
@@ -270,7 +286,7 @@ export function validateConfig(config: any): PluginConfigType {
270
286
 
271
287
  // explicitly block using use_frameworks and Flipper in iOS
272
288
  // https://github.com/facebook/flipper/issues/2414
273
- if (config?.ios?.flipper !== undefined && config?.ios?.useFrameworks !== undefined) {
289
+ if (Boolean(config.ios?.flipper) && config.ios?.useFrameworks !== undefined) {
274
290
  throw new Error('`ios.flipper` cannot be enabled when `ios.useFrameworks` is set.');
275
291
  }
276
292