expo-build-properties 0.12.1 → 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,12 @@
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
+
13
19
  ## 0.12.1 — 2024-05-06
14
20
 
15
21
  ### 🎉 New features
package/build/android.js CHANGED
@@ -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
  };
@@ -2,8 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.renderQueryIntents = exports.renderQueryPackages = exports.renderQueryProviders = void 0;
4
4
  function renderQueryProviders(data) {
5
- const dataStr = Array.isArray(data) ? data.join(';') : data;
6
- return dataStr ? { $: { 'android:authorities': dataStr } } : undefined;
5
+ return (Array.isArray(data) ? data : [data]).filter(Boolean).map((datum) => ({
6
+ $: {
7
+ 'android:authorities': datum,
8
+ },
9
+ }));
7
10
  }
8
11
  exports.renderQueryProviders = renderQueryProviders;
9
12
  function renderQueryPackages(data) {
@@ -333,9 +333,9 @@ export interface PluginConfigTypeAndroidPackagingOptions {
333
333
  }
334
334
  export interface PluginConfigTypeAndroidQueries {
335
335
  /**
336
- * 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.
337
337
  */
338
- package: string[];
338
+ package?: string[];
339
339
  /**
340
340
  * Specifies an intent filter signature. Your app can discover other apps that have matching <intent-filter> elements.
341
341
  * These intents have restrictions compared to typical intent filter signatures.
@@ -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
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-build-properties",
3
- "version": "0.12.1",
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": "7995f30a8d2af4836f3aef9fe322e9403fc23d34"
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
  }
@@ -372,9 +372,9 @@ export interface PluginConfigTypeAndroidPackagingOptions {
372
372
 
373
373
  export interface PluginConfigTypeAndroidQueries {
374
374
  /**
375
- * 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.
376
376
  */
377
- package: string[];
377
+ package?: string[];
378
378
  /**
379
379
  * Specifies an intent filter signature. Your app can discover other apps that have matching <intent-filter> elements.
380
380
  * These intents have restrictions compared to typical intent filter signatures.
@@ -513,10 +513,9 @@ const schema: JSONSchemaType<PluginConfigType> = {
513
513
  useLegacyPackaging: { type: 'boolean', nullable: true },
514
514
 
515
515
  manifestQueries: {
516
- required: ['package'],
517
516
  type: 'object',
518
517
  properties: {
519
- package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: false },
518
+ package: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: true },
520
519
  intent: {
521
520
  type: 'array',
522
521
  items: {
@@ -537,7 +536,7 @@ const schema: JSONSchemaType<PluginConfigType> = {
537
536
  },
538
537
  nullable: true,
539
538
  },
540
- provider: { type: 'array', items: { type: 'string' }, nullable: true },
539
+ provider: { type: 'array', items: { type: 'string' }, minItems: 1, nullable: true },
541
540
  },
542
541
  nullable: true,
543
542
  },