react-native-3rddigital-appupdate 1.0.12 → 1.0.13
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/package.json +1 -1
- package/scripts/bundle.js +28 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-3rddigital-appupdate",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "A React Native library for seamless over-the-air (OTA) updates with version checks, automatic bundle download, and customizable user prompts for iOS and Android.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
package/scripts/bundle.js
CHANGED
|
@@ -580,10 +580,16 @@ function getIosTargetMetadata() {
|
|
|
580
580
|
})
|
|
581
581
|
.filter(Boolean);
|
|
582
582
|
|
|
583
|
+
const uniqueTargets = targets.filter(
|
|
584
|
+
(target, index, allTargets) =>
|
|
585
|
+
allTargets.findIndex((candidate) => candidate.name === target.name) ===
|
|
586
|
+
index
|
|
587
|
+
);
|
|
588
|
+
|
|
583
589
|
return {
|
|
584
590
|
projectFiles,
|
|
585
|
-
defaultConfig:
|
|
586
|
-
targets,
|
|
591
|
+
defaultConfig: uniqueTargets[0] ?? null,
|
|
592
|
+
targets: uniqueTargets,
|
|
587
593
|
};
|
|
588
594
|
}
|
|
589
595
|
|
|
@@ -648,29 +654,35 @@ function getIosSchemeMetadata() {
|
|
|
648
654
|
})
|
|
649
655
|
.filter(Boolean);
|
|
650
656
|
|
|
651
|
-
|
|
657
|
+
const schemesByTargetName = new Map(
|
|
658
|
+
schemes.map((scheme) => [scheme.targetName, scheme])
|
|
659
|
+
);
|
|
660
|
+
|
|
661
|
+
const mergedSchemes = iosMetadata.targets.map((target) => {
|
|
662
|
+
const matchedScheme = schemesByTargetName.get(target.name);
|
|
663
|
+
if (matchedScheme) {
|
|
664
|
+
return matchedScheme;
|
|
665
|
+
}
|
|
666
|
+
|
|
652
667
|
return {
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
version: target.version,
|
|
661
|
-
productName: target.productName,
|
|
662
|
-
})),
|
|
668
|
+
name: target.name,
|
|
669
|
+
label: `${target.label}${target.buildConfiguration ? ` [${target.buildConfiguration}]` : ''}`,
|
|
670
|
+
targetName: target.name,
|
|
671
|
+
buildConfiguration: target.buildConfiguration,
|
|
672
|
+
appId: target.appId,
|
|
673
|
+
version: target.version,
|
|
674
|
+
productName: target.productName,
|
|
663
675
|
};
|
|
664
|
-
}
|
|
676
|
+
});
|
|
665
677
|
|
|
666
|
-
const uniqueSchemes =
|
|
678
|
+
const uniqueSchemes = mergedSchemes.filter(
|
|
667
679
|
(scheme, index, allSchemes) =>
|
|
668
680
|
allSchemes.findIndex((candidate) => candidate.name === scheme.name) ===
|
|
669
681
|
index
|
|
670
682
|
);
|
|
671
683
|
|
|
672
684
|
return {
|
|
673
|
-
defaultConfig: uniqueSchemes[0],
|
|
685
|
+
defaultConfig: uniqueSchemes[0] ?? iosMetadata.defaultConfig,
|
|
674
686
|
schemes: uniqueSchemes,
|
|
675
687
|
};
|
|
676
688
|
}
|