react-native-3rddigital-appupdate 1.0.17 → 1.0.18
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 +38 -22
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.18",
|
|
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
|
@@ -486,6 +486,7 @@ function getIosTargetMetadata() {
|
|
|
486
486
|
configObjects.map((config) => [
|
|
487
487
|
config.id,
|
|
488
488
|
{
|
|
489
|
+
id: config.id,
|
|
489
490
|
name: cleanPbxString(readPbxValue(config.body, 'name')),
|
|
490
491
|
version: cleanPbxString(readPbxValue(config.body, 'MARKETING_VERSION')),
|
|
491
492
|
appId: cleanPbxString(
|
|
@@ -545,27 +546,42 @@ function getIosTargetMetadata() {
|
|
|
545
546
|
|
|
546
547
|
if (!buildConfigs.length) return null;
|
|
547
548
|
|
|
548
|
-
const
|
|
549
|
+
const buildConfigsWithAppId = buildConfigs.filter(
|
|
550
|
+
(config) => config.appId
|
|
551
|
+
);
|
|
549
552
|
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
553
|
+
const configsByAppId = new Map();
|
|
554
|
+
for (const buildConfig of buildConfigsWithAppId) {
|
|
555
|
+
const appIdKey = buildConfig.appId;
|
|
556
|
+
if (!configsByAppId.has(appIdKey)) {
|
|
557
|
+
configsByAppId.set(appIdKey, []);
|
|
554
558
|
}
|
|
555
559
|
|
|
556
|
-
|
|
560
|
+
configsByAppId.get(appIdKey).push(buildConfig);
|
|
557
561
|
}
|
|
558
562
|
|
|
559
|
-
const
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
563
|
+
const preferredConfigNames = [
|
|
564
|
+
configList?.defaultName,
|
|
565
|
+
'Release',
|
|
566
|
+
'Profile',
|
|
567
|
+
'Debug',
|
|
568
|
+
].filter(Boolean);
|
|
569
|
+
|
|
570
|
+
const distinctConfigs =
|
|
571
|
+
configsByAppId.size <= 1
|
|
572
|
+
? [
|
|
573
|
+
choosePreferredBuildConfig(
|
|
574
|
+
buildConfigsWithAppId.length
|
|
575
|
+
? buildConfigsWithAppId
|
|
576
|
+
: buildConfigs,
|
|
577
|
+
preferredConfigNames
|
|
578
|
+
),
|
|
579
|
+
].filter(Boolean)
|
|
580
|
+
: Array.from(configsByAppId.values())
|
|
581
|
+
.map((configGroup) =>
|
|
582
|
+
choosePreferredBuildConfig(configGroup, preferredConfigNames)
|
|
583
|
+
)
|
|
584
|
+
.filter(Boolean);
|
|
569
585
|
|
|
570
586
|
return distinctConfigs.map((selectedConfig) => {
|
|
571
587
|
const buildConfigurationLabel = selectedConfig.name
|
|
@@ -577,7 +593,7 @@ function getIosTargetMetadata() {
|
|
|
577
593
|
: '';
|
|
578
594
|
|
|
579
595
|
return {
|
|
580
|
-
name: `${targetName}::${selectedConfig.
|
|
596
|
+
name: `${targetName}::${selectedConfig.appId ?? selectedConfig.id ?? 'no-app-id'}`,
|
|
581
597
|
targetName,
|
|
582
598
|
label: `${targetName}${buildConfigurationLabel}${appIdLabel}`,
|
|
583
599
|
appId: selectedConfig.appId ?? null,
|
|
@@ -592,11 +608,11 @@ function getIosTargetMetadata() {
|
|
|
592
608
|
|
|
593
609
|
const uniqueTargets = targets.filter(
|
|
594
610
|
(target, index, allTargets) =>
|
|
595
|
-
allTargets.findIndex(
|
|
596
|
-
|
|
597
|
-
candidate.
|
|
598
|
-
candidate.
|
|
599
|
-
|
|
611
|
+
allTargets.findIndex((candidate) =>
|
|
612
|
+
candidate.appId
|
|
613
|
+
? candidate.appId === target.appId
|
|
614
|
+
: candidate.targetName === target.targetName &&
|
|
615
|
+
candidate.buildConfiguration === target.buildConfiguration
|
|
600
616
|
) === index
|
|
601
617
|
);
|
|
602
618
|
|