@jacques_gordon/expo-mapbox-navigation 2.2.18 → 2.2.19

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/app.plugin.js CHANGED
@@ -318,19 +318,34 @@ def _expo_mapbox_nav_add_spm(installer)
318
318
  end
319
319
  `;
320
320
 
321
- // Find the last post_install block and add our call inside it,
322
- // or add a new post_install block if none exists.
323
- if (podfile.includes('post_install do |installer|')) {
324
- // Add our helper def before the first post_install
325
- // and our call inside the existing post_install
321
+ // Find the last post_integrate block and add our call inside it,
322
+ // or add a new post_integrate block if none exists.
323
+ //
324
+ // WHY post_integrate INSTEAD OF post_install:
325
+ // React Native/Expo's own CocoaPods post_install logic runs a step
326
+ // that re-derives and regenerates each pod target's SPM package
327
+ // product dependencies (visible in the pod install log as
328
+ // "[SPM] Cleaning old SPM dependencies from Pods project" / "[SPM]
329
+ // Adding SPM dependencies to Pods project"). Since our hook was
330
+ // previously injected at the START of the existing post_install
331
+ // block, it ran BEFORE that RN/Expo step — which then silently
332
+ // dropped our manually-added MapboxNavigationNative product
333
+ // dependency (while, by chance, preserving MapboxNavigationCore and
334
+ // MapboxNavigationUIKit, since something in RN/Expo's own derivation
335
+ // logic happens to recognize those two but not a product that's
336
+ // needed only transitively). CocoaPods' post_integrate hook is
337
+ // documented to run strictly after all post_install hooks AND after
338
+ // the Pods project has already been saved to disk, specifically so
339
+ // that later hooks can alter it after the fact. Injecting here
340
+ // guarantees our changes are applied last and are not overwritten.
341
+ if (podfile.includes('post_integrate do |installer|')) {
326
342
  podfile = spmHook + podfile.replace(
327
- 'post_install do |installer|',
328
- 'post_install do |installer|\n _expo_mapbox_nav_add_spm(installer)'
343
+ 'post_integrate do |installer|',
344
+ 'post_integrate do |installer|\n _expo_mapbox_nav_add_spm(installer)'
329
345
  );
330
346
  } else {
331
- // No post_install block — add both the helper and a new block
332
347
  podfile = podfile + spmHook + `
333
- post_install do |installer|
348
+ post_integrate do |installer|
334
349
  _expo_mapbox_nav_add_spm(installer)
335
350
  end
336
351
  `;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jacques_gordon/expo-mapbox-navigation",
3
- "version": "2.2.18",
3
+ "version": "2.2.19",
4
4
  "description": "Expo module for Mapbox Navigation SDK with 16KB page size support, NDK27, and Mapbox Maps v11.11.0+",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -318,19 +318,34 @@ def _expo_mapbox_nav_add_spm(installer)
318
318
  end
319
319
  `;
320
320
 
321
- // Find the last post_install block and add our call inside it,
322
- // or add a new post_install block if none exists.
323
- if (podfile.includes('post_install do |installer|')) {
324
- // Add our helper def before the first post_install
325
- // and our call inside the existing post_install
321
+ // Find the last post_integrate block and add our call inside it,
322
+ // or add a new post_integrate block if none exists.
323
+ //
324
+ // WHY post_integrate INSTEAD OF post_install:
325
+ // React Native/Expo's own CocoaPods post_install logic runs a step
326
+ // that re-derives and regenerates each pod target's SPM package
327
+ // product dependencies (visible in the pod install log as
328
+ // "[SPM] Cleaning old SPM dependencies from Pods project" / "[SPM]
329
+ // Adding SPM dependencies to Pods project"). Since our hook was
330
+ // previously injected at the START of the existing post_install
331
+ // block, it ran BEFORE that RN/Expo step — which then silently
332
+ // dropped our manually-added MapboxNavigationNative product
333
+ // dependency (while, by chance, preserving MapboxNavigationCore and
334
+ // MapboxNavigationUIKit, since something in RN/Expo's own derivation
335
+ // logic happens to recognize those two but not a product that's
336
+ // needed only transitively). CocoaPods' post_integrate hook is
337
+ // documented to run strictly after all post_install hooks AND after
338
+ // the Pods project has already been saved to disk, specifically so
339
+ // that later hooks can alter it after the fact. Injecting here
340
+ // guarantees our changes are applied last and are not overwritten.
341
+ if (podfile.includes('post_integrate do |installer|')) {
326
342
  podfile = spmHook + podfile.replace(
327
- 'post_install do |installer|',
328
- 'post_install do |installer|\n _expo_mapbox_nav_add_spm(installer)'
343
+ 'post_integrate do |installer|',
344
+ 'post_integrate do |installer|\n _expo_mapbox_nav_add_spm(installer)'
329
345
  );
330
346
  } else {
331
- // No post_install block — add both the helper and a new block
332
347
  podfile = podfile + spmHook + `
333
- post_install do |installer|
348
+ post_integrate do |installer|
334
349
  _expo_mapbox_nav_add_spm(installer)
335
350
  end
336
351
  `;