codeplay-common 4.11.19 → 4.11.21

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/README.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # codeplay-common
2
2
 
3
+ ## Optional IAP configuration (4.11.21)
4
+
5
+ Before-build upgrades the AdMob configuration schema to at least 1.8 and adds empty defaults for `IAP.configuration.adFreeEntitlement`, `offeringIdentifier`, `lifetimeProductIds` (playstore/ios/amazon/samsung), and `samsungPaywallProductIds`. Existing store flags, keys, product IDs and explicit settings are preserved. Empty settings retain the legacy current offering and subscription behavior; these fields do not create store products or enable lifetime purchases automatically.
6
+
7
+ These optional settings come only from the consuming app's configuration, including its legacy configuration when migrating. Downloaded shared templates cannot opt an app into another app's entitlement, offering or lifetime products. Configure each store and RevenueCat before selecting nonempty values in an app. This package update does not ship the new IAP runtime modules or publish store releases.
8
+
3
9
  ## Shared splash setup (4.11.13)
4
10
 
5
11
  The package owns the splash theme template, Android splash setup, MainActivity generator and Framework7 readiness helper. Install/update copies the build scripts into the consuming app. Installation, before-build and splash setup repair the known legacy `Theme.AppCompat.NoActionBar` post-splash default in the app's preserved `buildCodeplay/splashxml/codeplay_splashScreen.xml` template. The replacement uses `Theme.AppCompat.DayNight.NoActionBar`; other custom themes and resource attributes are preserved. Android sync applies the template to generated resources. Existing APKs require a rebuild to receive native changes.
@@ -3258,7 +3258,15 @@ const syncCodeplaySystemBarsPackage = () => {
3258
3258
  };
3259
3259
 
3260
3260
  const ADMOB_NEXTGEN_DEFAULTS = {
3261
- VERSION: "1.6",
3261
+ VERSION: "1.8",
3262
+ IAP: {
3263
+ configuration: {
3264
+ adFreeEntitlement: "",
3265
+ offeringIdentifier: "",
3266
+ lifetimeProductIds: { playstore: "", ios: "", amazon: "", samsung: "" },
3267
+ samsungPaywallProductIds: ""
3268
+ }
3269
+ },
3262
3270
  ios: { nativeid: "" },
3263
3271
  android: { nativeid: "" },
3264
3272
  config: {
@@ -3395,6 +3403,7 @@ const ensureAdmobNextgenConfigDefaults = (config) => {
3395
3403
  const runtimeConfig = hasObjectKeys(config?.config) ? config.config : {};
3396
3404
 
3397
3405
  normalizedConfig.config = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.config, runtimeConfig);
3406
+ normalizedConfig.IAP = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.IAP, config?.IAP);
3398
3407
 
3399
3408
  return normalizedConfig;
3400
3409
  };
@@ -3405,9 +3414,16 @@ const mergeNextgenConfigWithoutReplacingExisting = (defaultConfig, oldConfig, ex
3405
3414
  };
3406
3415
 
3407
3416
  const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenConfig, oldConfig) => {
3408
- const mergedConfig = mergeNextgenConfigWithoutReplacingExisting(templateConfig, oldConfig, existingNextgenConfig);
3417
+ const mergedConfig = ensureAdmobNextgenConfigDefaults(mergeNextgenConfigWithoutReplacingExisting(templateConfig, oldConfig, existingNextgenConfig));
3418
+
3419
+ // Optional purchase settings belong to the app, never the downloaded template.
3420
+ const appIapConfig = mergeObjects(oldConfig?.IAP?.configuration || {}, existingNextgenConfig?.IAP?.configuration);
3421
+ for (const [key, defaultValue] of Object.entries(ADMOB_NEXTGEN_DEFAULTS.IAP.configuration)) {
3422
+ mergedConfig.IAP.configuration[key] = mergeObjects(defaultValue, appIapConfig[key]);
3423
+ }
3409
3424
 
3410
- const templateVersion = templateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
3425
+ const templateVersion = compareVersionStrings(templateConfig.VERSION || '0', ADMOB_NEXTGEN_DEFAULTS.VERSION) > 0
3426
+ ? templateConfig.VERSION : ADMOB_NEXTGEN_DEFAULTS.VERSION;
3411
3427
  mergedConfig.VERSION = compareVersionStrings(existingNextgenConfig?.VERSION || '0', templateVersion) > 0
3412
3428
  ? existingNextgenConfig.VERSION : templateVersion;
3413
3429
 
@@ -739,6 +739,16 @@ if (storeIdArg) {
739
739
  storeIds = ["3"]; // Only MiStore
740
740
  } */
741
741
 
742
+ // APK Extractor and App Uninstaller must never produce Amazon artifacts.
743
+ if (['19', '158'].includes(String(_appUniqueId)) && storeIds.includes('7')) {
744
+ console.warn(`⛔ Amazon build blocked for app ${_appUniqueId} (${_appName}): APK extractor and app uninstaller apps are not supported for Amazon distribution.`);
745
+ storeIds = storeIds.filter(id => id !== '7');
746
+ if (storeIds.length === 0) {
747
+ console.error('❌ No eligible stores remain. No AAB/APK files were generated.');
748
+ process.exit(1);
749
+ }
750
+ }
751
+
742
752
  // Store the original minSdkVersion globally
743
753
  let originalMinSdkVersion;
744
754
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "4.11.19",
3
+ "version": "4.11.21",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",