expo-build-properties 0.12.0 → 0.12.2

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,19 @@
10
10
 
11
11
  ### 💡 Others
12
12
 
13
+ ## 0.12.2 — 2024-06-05
14
+
15
+ ### 🐛 Bug fixes
16
+
17
+ - Improved android manifest queries, preventing overrides of <package> tags and splitting <provider> instead of merging them into one string ([#29418](https://github.com/expo/expo/pull/29418) by [@Titozzz](https://github.com/Titozzz))
18
+
19
+ ## 0.12.1 — 2024-05-06
20
+
21
+ ### 🎉 New features
22
+
23
+ - Add `ios.ccacheEnabled` option to enable the C++ compiler cache for iOS builds. ([#28638](https://github.com/expo/expo/pull/28638) by [@byCedric](https://github.com/byCedric))
24
+ - Add `ios.privacyManifestAggregationEnabled` option to enable/disable privacy manifest aggregation. ([#28646](https://github.com/expo/expo/pull/28646) by [@brentvatne](https://github.com/brentvatne)).
25
+
13
26
  ## 0.12.0 — 2024-04-18
14
27
 
15
28
  ### 🛠 Breaking changes
package/build/android.js CHANGED
@@ -3,8 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.withAndroidQueries = exports.withAndroidCleartextTraffic = exports.withAndroidPurgeProguardRulesOnce = exports.withAndroidProguardRules = exports.withAndroidBuildProperties = void 0;
7
- exports.updateAndroidProguardRules = updateAndroidProguardRules;
6
+ exports.withAndroidQueries = exports.withAndroidCleartextTraffic = exports.updateAndroidProguardRules = exports.withAndroidPurgeProguardRulesOnce = exports.withAndroidProguardRules = exports.withAndroidBuildProperties = void 0;
8
7
  const config_plugins_1 = require("expo/config-plugins");
9
8
  const fs_1 = __importDefault(require("fs"));
10
9
  const path_1 = __importDefault(require("path"));
@@ -166,6 +165,7 @@ function updateAndroidProguardRules(contents, newProguardRules, updateMode) {
166
165
  }
167
166
  return newContents;
168
167
  }
168
+ exports.updateAndroidProguardRules = updateAndroidProguardRules;
169
169
  const withAndroidCleartextTraffic = (config, props) => {
170
170
  return (0, config_plugins_1.withAndroidManifest)(config, (config) => {
171
171
  if (props.android?.usesCleartextTraffic == null) {
@@ -191,15 +191,14 @@ const withAndroidQueries = (config, props) => {
191
191
  const { manifestQueries } = props.android;
192
192
  // Default template adds a single intent to the `queries` tag
193
193
  const defaultIntents = config.modResults.manifest.queries.map((q) => q.intent ?? []).flat() ?? [];
194
- const additionalQueries = {
195
- package: (0, androidQueryUtils_1.renderQueryPackages)(manifestQueries.package),
194
+ const defaultPackages = config.modResults.manifest.queries.map((q) => q.package ?? []).flat() ?? [];
195
+ const defaultProviders = config.modResults.manifest.queries.map((q) => q.provider ?? []).flat() ?? [];
196
+ const newQueries = {
197
+ package: [...defaultPackages, ...(0, androidQueryUtils_1.renderQueryPackages)(manifestQueries.package)],
196
198
  intent: [...defaultIntents, ...(0, androidQueryUtils_1.renderQueryIntents)(manifestQueries.intent)],
199
+ provider: [...defaultProviders, ...(0, androidQueryUtils_1.renderQueryProviders)(manifestQueries.provider)],
197
200
  };
198
- const provider = (0, androidQueryUtils_1.renderQueryProviders)(manifestQueries.provider);
199
- if (provider != null) {
200
- additionalQueries.provider = provider;
201
- }
202
- config.modResults.manifest.queries = [additionalQueries];
201
+ config.modResults.manifest.queries = [newQueries];
203
202
  return config;
204
203
  });
205
204
  };
@@ -3,8 +3,8 @@ export declare function renderQueryProviders(data?: string | string[]): {
3
3
  $: {
4
4
  'android:authorities': string;
5
5
  };
6
- } | undefined;
7
- export declare function renderQueryPackages(data: string | string[]): {
6
+ }[];
7
+ export declare function renderQueryPackages(data?: string | string[]): {
8
8
  $: {
9
9
  'android:name': string;
10
10
  };
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.renderQueryProviders = renderQueryProviders;
4
- exports.renderQueryPackages = renderQueryPackages;
5
- exports.renderQueryIntents = renderQueryIntents;
3
+ exports.renderQueryIntents = exports.renderQueryPackages = exports.renderQueryProviders = void 0;
6
4
  function renderQueryProviders(data) {
7
- const dataStr = Array.isArray(data) ? data.join(';') : data;
8
- return dataStr ? { $: { 'android:authorities': dataStr } } : undefined;
5
+ return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
6
+ $: {
7
+ 'android:authorities': datum,
8
+ },
9
+ }));
9
10
  }
11
+ exports.renderQueryProviders = renderQueryProviders;
10
12
  function renderQueryPackages(data) {
11
13
  return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
12
14
  $: {
@@ -14,6 +16,7 @@ function renderQueryPackages(data) {
14
16
  },
15
17
  }));
16
18
  }
19
+ exports.renderQueryPackages = renderQueryPackages;
17
20
  function renderQueryIntents(queryIntents) {
18
21
  return (queryIntents?.map((intent) => {
19
22
  const { data, category, action } = intent;
@@ -36,3 +39,4 @@ function renderQueryIntents(queryIntents) {
36
39
  };
37
40
  }) ?? []);
38
41
  }
42
+ exports.renderQueryIntents = renderQueryIntents;
@@ -6,8 +6,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
6
6
  return (mod && mod.__esModule) ? mod : { "default": mod };
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.appendContents = appendContents;
10
- exports.purgeContents = purgeContents;
9
+ exports.purgeContents = exports.appendContents = void 0;
11
10
  const assert_1 = __importDefault(require("assert"));
12
11
  /**
13
12
  * Append new contents to src with generated section comments
@@ -29,6 +28,7 @@ function appendContents(src, contents, sectionOptions) {
29
28
  return `${src}\n${sectionedContents}`;
30
29
  }
31
30
  }
31
+ exports.appendContents = appendContents;
32
32
  /**
33
33
  * Purge a generated section
34
34
  */
@@ -38,6 +38,7 @@ function purgeContents(src, sectionOptions) {
38
38
  const regex = new RegExp(`\\n${escapeRegExp(start)}\\n[\\s\\S]*\\n${escapeRegExp(end)}`, 'gm');
39
39
  return src.replace(regex, '');
40
40
  }
41
+ exports.purgeContents = purgeContents;
41
42
  /**
42
43
  * Create comments for generated section
43
44
  */
package/build/ios.js CHANGED
@@ -20,6 +20,14 @@ exports.withIosBuildProperties = createBuildPodfilePropsConfigPlugin([
20
20
  propName: 'apple.extraPods',
21
21
  propValueGetter: (config) => JSON.stringify(config.ios?.extraPods ?? []),
22
22
  },
23
+ {
24
+ propName: 'apple.ccacheEnabled',
25
+ propValueGetter: (config) => (config.ios?.ccacheEnabled ?? false).toString(),
26
+ },
27
+ {
28
+ propName: 'apple.privacyManifestAggregationEnabled',
29
+ propValueGetter: (config) => (config.ios?.privacyManifestAggregationEnabled ?? false).toString(),
30
+ },
23
31
  ], 'withIosBuildProperties');
24
32
  const withIosDeploymentTarget = (config, props) => {
25
33
  const deploymentTarget = props.ios?.deploymentTarget;
@@ -202,6 +202,24 @@ export interface PluginConfigTypeIos {
202
202
  * this property is actually handled by `expo-modules-autolinking` but not the config-plugins inside expo-build-properties.
203
203
  */
204
204
  extraPods?: ExtraIosPodDependency[];
205
+ /**
206
+ * Enable C++ compiler cache for iOS builds.
207
+ *
208
+ * This speeds up compiling C++ code by caching the results of previous compilations.
209
+ *
210
+ * @see https://reactnative.dev/docs/build-speed#local-caches
211
+ * @see https://ccache.dev/
212
+ */
213
+ ccacheEnabled?: boolean;
214
+ /**
215
+ * Enable aggregation of Privacy Manifests (`PrivacyInfo.xcprivacy`) from
216
+ * CocoaPods resource bundles. If enabled, the manifests will be merged into a
217
+ * single file. If not enabled, developers will need to manually aggregate them.
218
+ *
219
+ * @see https://docs.expo.dev/guides/apple-privacy/
220
+ * @see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
221
+ */
222
+ privacyManifestAggregationEnabled?: boolean;
205
223
  }
206
224
  /**
207
225
  * Interface representing extra CocoaPods dependency.
@@ -315,9 +333,9 @@ export interface PluginConfigTypeAndroidPackagingOptions {
315
333
  }
316
334
  export interface PluginConfigTypeAndroidQueries {
317
335
  /**
318
- * Specifies a single app that your app intends to access. This other app might integrate with your app, or your app might use services that the other app provides.
336
+ * Specifies one or more apps that your app intends to access. These other apps might integrate with your app, or your app might use services that these other apps provide.
319
337
  */
320
- package: string[];
338
+ package?: string[];
321
339
  /**
322
340
  * Specifies an intent filter signature. Your app can discover other apps that have matching <intent-filter> elements.
323
341
  * These intents have restrictions compared to typical intent filter signatures.
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateConfig = validateConfig;
6
+ exports.validateConfig = void 0;
7
7
  const ajv_1 = __importDefault(require("ajv"));
8
8
  const semver_1 = __importDefault(require("semver"));
9
9
  /**
@@ -107,10 +107,9 @@ const schema = {
107
107
  usesCleartextTraffic: { type: 'boolean', nullable: true },
108
108
  useLegacyPackaging: { type: 'boolean', nullable: true },
109
109
  manifestQueries: {
110
- required: ['package'],
111
110
  type: 'object',
112
111
  properties: {
113
- package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: false },
112
+ package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: true },
114
113
  intent: {
115
114
  type: 'array',
116
115
  items: {
@@ -131,7 +130,7 @@ const schema = {
131
130
  },
132
131
  nullable: true,
133
132
  },
134
- provider: { type: 'array', items: { type: 'string' }, nullable: true },
133
+ provider: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: true },
135
134
  },
136
135
  nullable: true,
137
136
  },
@@ -145,6 +144,8 @@ const schema = {
145
144
  deploymentTarget: { type: 'string', pattern: '\\d+\\.\\d+', nullable: true },
146
145
  useFrameworks: { type: 'string', enum: ['static', 'dynamic'], nullable: true },
147
146
  networkInspector: { type: 'boolean', nullable: true },
147
+ ccacheEnabled: { type: 'boolean', nullable: true },
148
+ privacyManifestAggregationEnabled: { type: 'boolean', nullable: true },
148
149
  extraPods: {
149
150
  type: 'array',
150
151
  items: {
@@ -236,3 +237,4 @@ function validateConfig(config) {
236
237
  }
237
238
  return config;
238
239
  }
240
+ exports.validateConfig = validateConfig;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-build-properties",
3
- "version": "0.12.0",
3
+ "version": "0.12.2",
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": "4165b8d72e1b9a1889c2767534cc619e21468110"
43
+ "gitHead": "2da3ee1a1cfc03b58ee2988529ad941641330f99"
44
44
  }
package/src/android.ts CHANGED
@@ -231,18 +231,18 @@ export const withAndroidQueries: ConfigPlugin<PluginConfigType> = (config, props
231
231
  // Default template adds a single intent to the `queries` tag
232
232
  const defaultIntents =
233
233
  config.modResults.manifest.queries.map((q) => q.intent ?? []).flat() ?? [];
234
+ const defaultPackages =
235
+ config.modResults.manifest.queries.map((q) => q.package ?? []).flat() ?? [];
236
+ const defaultProviders =
237
+ config.modResults.manifest.queries.map((q) => q.provider ?? []).flat() ?? [];
234
238
 
235
- const additionalQueries: AndroidConfig.Manifest.ManifestQuery = {
236
- package: renderQueryPackages(manifestQueries.package),
239
+ const newQueries: AndroidConfig.Manifest.ManifestQuery = {
240
+ package: [...defaultPackages, ...renderQueryPackages(manifestQueries.package)],
237
241
  intent: [...defaultIntents, ...renderQueryIntents(manifestQueries.intent)],
242
+ provider: [...defaultProviders, ...renderQueryProviders(manifestQueries.provider)],
238
243
  };
239
244
 
240
- const provider = renderQueryProviders(manifestQueries.provider);
241
- if (provider != null) {
242
- additionalQueries.provider = provider;
243
- }
244
-
245
- config.modResults.manifest.queries = [additionalQueries];
245
+ config.modResults.manifest.queries = [newQueries];
246
246
  return config;
247
247
  });
248
248
  };
@@ -1,14 +1,17 @@
1
1
  import { PluginConfigTypeAndroidQueriesIntent } from './pluginConfig';
2
2
 
3
3
  export function renderQueryProviders(data?: string | string[]) {
4
- const dataStr = Array.isArray(data) ? data.join(';') : data;
5
- return dataStr ? { $: { 'android:authorities': dataStr } } : undefined;
4
+ return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
5
+ $: {
6
+ 'android:authorities': datum as string,
7
+ },
8
+ }));
6
9
  }
7
10
 
8
- export function renderQueryPackages(data: string | string[]) {
11
+ export function renderQueryPackages(data?: string | string[]) {
9
12
  return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
10
13
  $: {
11
- 'android:name': datum,
14
+ 'android:name': datum as string,
12
15
  },
13
16
  }));
14
17
  }
package/src/ios.ts CHANGED
@@ -22,6 +22,15 @@ export const withIosBuildProperties = createBuildPodfilePropsConfigPlugin<Plugin
22
22
  propName: 'apple.extraPods',
23
23
  propValueGetter: (config) => JSON.stringify(config.ios?.extraPods ?? []),
24
24
  },
25
+ {
26
+ propName: 'apple.ccacheEnabled',
27
+ propValueGetter: (config) => (config.ios?.ccacheEnabled ?? false).toString(),
28
+ },
29
+ {
30
+ propName: 'apple.privacyManifestAggregationEnabled',
31
+ propValueGetter: (config) =>
32
+ (config.ios?.privacyManifestAggregationEnabled ?? false).toString(),
33
+ },
25
34
  ],
26
35
  'withIosBuildProperties'
27
36
  );
@@ -236,6 +236,26 @@ export interface PluginConfigTypeIos {
236
236
  * this property is actually handled by `expo-modules-autolinking` but not the config-plugins inside expo-build-properties.
237
237
  */
238
238
  extraPods?: ExtraIosPodDependency[];
239
+
240
+ /**
241
+ * Enable C++ compiler cache for iOS builds.
242
+ *
243
+ * This speeds up compiling C++ code by caching the results of previous compilations.
244
+ *
245
+ * @see https://reactnative.dev/docs/build-speed#local-caches
246
+ * @see https://ccache.dev/
247
+ */
248
+ ccacheEnabled?: boolean;
249
+
250
+ /**
251
+ * Enable aggregation of Privacy Manifests (`PrivacyInfo.xcprivacy`) from
252
+ * CocoaPods resource bundles. If enabled, the manifests will be merged into a
253
+ * single file. If not enabled, developers will need to manually aggregate them.
254
+ *
255
+ * @see https://docs.expo.dev/guides/apple-privacy/
256
+ * @see https://developer.apple.com/documentation/bundleresources/privacy_manifest_files
257
+ */
258
+ privacyManifestAggregationEnabled?: boolean;
239
259
  }
240
260
 
241
261
  /**
@@ -352,9 +372,9 @@ export interface PluginConfigTypeAndroidPackagingOptions {
352
372
 
353
373
  export interface PluginConfigTypeAndroidQueries {
354
374
  /**
355
- * Specifies a single app that your app intends to access. This other app might integrate with your app, or your app might use services that the other app provides.
375
+ * Specifies one or more apps that your app intends to access. These other apps might integrate with your app, or your app might use services that these other apps provide.
356
376
  */
357
- package: string[];
377
+ package?: string[];
358
378
  /**
359
379
  * Specifies an intent filter signature. Your app can discover other apps that have matching <intent-filter> elements.
360
380
  * These intents have restrictions compared to typical intent filter signatures.
@@ -493,10 +513,9 @@ const schema: JSONSchemaType<PluginConfigType> = {
493
513
  useLegacyPackaging: { type: 'boolean', nullable: true },
494
514
 
495
515
  manifestQueries: {
496
- required: ['package'],
497
516
  type: 'object',
498
517
  properties: {
499
- package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: false },
518
+ package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: true },
500
519
  intent: {
501
520
  type: 'array',
502
521
  items: {
@@ -517,7 +536,7 @@ const schema: JSONSchemaType<PluginConfigType> = {
517
536
  },
518
537
  nullable: true,
519
538
  },
520
- provider: { type: 'array', items: { type: 'string' }, nullable: true },
539
+ provider: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: true },
521
540
  },
522
541
  nullable: true,
523
542
  },
@@ -532,6 +551,8 @@ const schema: JSONSchemaType<PluginConfigType> = {
532
551
  useFrameworks: { type: 'string', enum: ['static', 'dynamic'], nullable: true },
533
552
 
534
553
  networkInspector: { type: 'boolean', nullable: true },
554
+ ccacheEnabled: { type: 'boolean', nullable: true },
555
+ privacyManifestAggregationEnabled: { type: 'boolean', nullable: true },
535
556
 
536
557
  extraPods: {
537
558
  type: 'array',