codeplay-common 4.1.5 → 4.1.7

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/.gitattributes CHANGED
@@ -1,2 +1,2 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2025 Merbin Joe
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Merbin Joe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,78 +1,84 @@
1
- # codeplay-common
2
- Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
3
-
4
-
5
- Easy add splashscreen and set animation
6
- Admob id automatically from capacitor.config.json file
7
- Make three build file for different store as per our requirement
8
- Based on store install various IAP plugins
9
- Make it to ionic project
10
-
11
- Donate to get full code including many common functions
12
- https://ko-fi.com/codeplay
13
-
14
-
15
- Version 4.1.5
16
- While isTesting is true it is not validated from our new configuration admob file, now it is solved
17
-
18
- Version 4.1.4
19
- hardcoded version is removed for the admob-emi-nextgen
20
-
21
-
22
- Version 4.1.3
23
- "consentDebug": false automatically adds if not
24
-
25
- Version 4.1.2
26
- Speedup
27
-
28
- Version 4.1.1
29
- Auto admob integration updated
30
-
31
-
32
- version 4.0.9
33
- packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
34
-
35
-
36
- version 4.0.8
37
- safearea plugin is checked and removed automatically
38
- Automatically added following in capacitor.config.json file
39
- "SystemBars": {
40
- "insetsHandling": "css"
41
- }
42
- patchFile() method is removed
43
-
44
-
45
-
46
-
47
- Version 4.0.6
48
- IAP related some automatic variable creation and validation
49
- Fetch from vite.config.json file
50
- 'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
51
- 'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
52
- 'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
53
- 'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
54
-
55
-
56
- Version 4.0.5
57
- In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
58
-
59
-
60
- Version 4.0.4
61
- patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
62
-
63
- Version 4.0.3
64
- Old admob check performs through plugin location, but not it is validated from capacitor.config.json
65
-
66
-
67
- Version: 4.0.2
68
- After check & install/download the latest version, the re-check is cancelled now
69
-
70
- Version: 4.0.1
71
- Base profile script added
72
-
73
-
74
- "version": "",
75
- Version : 4.0.0 (Previous version 3.2.19)
76
- 1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
77
- 2) Removed "modify-plugin-xml.js"
1
+ # codeplay-common
2
+ Everything automatted in Capacitor apps, easy to maintain many apps in capacitor. It will reduce your 40% of work, with common file code.
3
+
4
+
5
+ Easy add splashscreen and set animation
6
+ Admob id automatically from capacitor.config.json file
7
+ Make three build file for different store as per our requirement
8
+ Based on store install various IAP plugins
9
+ Make it to ionic project
10
+
11
+ Donate to get full code including many common functions
12
+ https://ko-fi.com/codeplay
13
+
14
+
15
+ Version 4.1.7
16
+ admob configuration automatically added.
17
+
18
+ Version 4.1.6
19
+ "setup-baseline-profile.js" modification, duplicate validation error fixed
20
+
21
+ Version 4.1.5
22
+ While isTesting is true it is not validated from our new configuration admob file, now it is solved
23
+
24
+ Version 4.1.4
25
+ hardcoded version is removed for the admob-emi-nextgen
26
+
27
+
28
+ Version 4.1.3
29
+ "consentDebug": false automatically adds if not
30
+
31
+ Version 4.1.2
32
+ Speedup
33
+
34
+ Version 4.1.1
35
+ Auto admob integration updated
36
+
37
+
38
+ version 4.0.9
39
+ packageJson.scripts["ionic:serve"] = "cross-env NODE_ENV=development vite"; this line updated in "sync-files.js"
40
+
41
+
42
+ version 4.0.8
43
+ safearea plugin is checked and removed automatically
44
+ Automatically added following in capacitor.config.json file
45
+ "SystemBars": {
46
+ "insetsHandling": "css"
47
+ }
48
+ patchFile() method is removed
49
+
50
+
51
+
52
+
53
+ Version 4.0.6
54
+ IAP related some automatic variable creation and validation
55
+ Fetch from vite.config.json file
56
+ 'import.meta.env.VITE_APP_UNIQUE_ID': JSON.stringify(APP_UNIQUE_ID),
57
+ 'import.meta.env.VITE_ANDROID_ANALYTICS_ENABLED': JSON.stringify(ANDROID_ANALYTICS_ENABLED),
58
+ 'import.meta.env.VITE_IOS_ANALYTICS_ENABLED': JSON.stringify(IOS_ANALYTICS_ENABLED),
59
+ 'import.meta.env.VITE_IAP_DESIGN': JSON.stringify(IAP_DESIGN),
60
+
61
+
62
+ Version 4.0.5
63
+ In "files\buildCodeplay\packageidBaseModification-1.4.js" SCHEDULE_EXACT_ALARM permission added for the app unique id 2 (resume generator app)
64
+
65
+
66
+ Version 4.0.4
67
+ patchFile(); method is disabled, Due to "@capacitor/android:8.4.2" this update. I think it is realted to safearea issue fixed in this latest version, file in "SystemBars.java"
68
+
69
+ Version 4.0.3
70
+ Old admob check performs through plugin location, but not it is validated from capacitor.config.json
71
+
72
+
73
+ Version: 4.0.2
74
+ After check & install/download the latest version, the re-check is cancelled now
75
+
76
+ Version: 4.0.1
77
+ Base profile script added
78
+
79
+
80
+ "version": "",
81
+ Version : 4.0.0 (Previous version 3.2.19)
82
+ 1) In here we are completly remove the admob-emi and use "capacitor-admob-nextgen"
83
+ 2) Removed "modify-plugin-xml.js"
78
84
  3)
@@ -2739,16 +2739,43 @@ const ADMOB_NEXTGEN_DEFAULTS = {
2739
2739
  VERSION: "1.6",
2740
2740
  ios: { nativeid: "" },
2741
2741
  android: { nativeid: "" },
2742
- config: {
2743
- bannerStartupDelayMs: "",
2744
- interstitialStartupDelayMs: "",
2745
- appOpenLoadOnColdStart: "",
2746
- appOpenStartupDelayMs: "",
2747
- useAndroidPreloadAds: true,
2748
- useAndroidBannerPreloadAds: false,
2749
- preloadBufferSize: 1,
2750
- consentDebug: false
2751
- },
2742
+ config: {
2743
+ bannerStartupDelayMs: "",
2744
+ interstitialStartupDelayMs: "",
2745
+ appOpenLoadOnColdStart: "",
2746
+ appOpenStartupDelayMs: "",
2747
+ useAndroidPreloadAds: true,
2748
+ useAndroidBannerPreloadAds: false,
2749
+ preloadBufferSize: 1,
2750
+ isKidsApp: false,
2751
+ isTesting: false,
2752
+ consentDebug: false,
2753
+ isConsoleLogEnabled: false,
2754
+ bannerEnabled: true,
2755
+ interstitialEnabled: true,
2756
+ appOpenEnabled: true,
2757
+ rewardVideoEnabled: false,
2758
+ rewardInterstitialEnabled: false,
2759
+ collapsibleEnabled: "",
2760
+ isLandScape: "",
2761
+ isOverlappingEnable: "",
2762
+ bannerTypeAndroid: "",
2763
+ bannerTypeiOS: "",
2764
+ bannerTopSpaceColor: "",
2765
+ interstitialLoadScreenTextColor: "",
2766
+ interstitialLoadScreenBackgroundColor: "",
2767
+ beforeBannerSpace: "",
2768
+ whenShow: "",
2769
+ minimumClick: "",
2770
+ interstitialTimeOut: "",
2771
+ interstitialFirstTimeOut: "",
2772
+ appOpenAdsTimeOut: "",
2773
+ maxRetryCount: "",
2774
+ retrySecondsAr: "",
2775
+ appOpenPerSession: "",
2776
+ interstitialPerSession: "",
2777
+ appOpenFirstTimeOut: ""
2778
+ },
2752
2779
  testid: {
2753
2780
  nativeid: "",
2754
2781
  nativeid_android: "ca-app-pub-3940256099942544/2247696110",
@@ -2828,12 +2855,22 @@ const mergeObjects = (template, source) => {
2828
2855
  return output;
2829
2856
  };
2830
2857
 
2831
- const hasObjectKeys = (value) => {
2832
- return value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0;
2833
- };
2834
-
2835
- const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenConfig, oldConfig) => {
2836
- const mergedConfig = mergeObjects(templateConfig, mergeObjects(existingNextgenConfig, oldConfig));
2858
+ const hasObjectKeys = (value) => {
2859
+ return value && typeof value === "object" && !Array.isArray(value) && Object.keys(value).length > 0;
2860
+ };
2861
+
2862
+ const ensureAdmobNextgenConfigDefaults = (config) => {
2863
+ const normalizedConfig = { ...config };
2864
+ const runtimeConfig = hasObjectKeys(config?.config) ? config.config : {};
2865
+
2866
+ normalizedConfig.config = mergeObjects(ADMOB_NEXTGEN_DEFAULTS.config, runtimeConfig);
2867
+ delete normalizedConfig.config.overlappingHeight;
2868
+
2869
+ return normalizedConfig;
2870
+ };
2871
+
2872
+ const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenConfig, oldConfig) => {
2873
+ const mergedConfig = mergeObjects(templateConfig, mergeObjects(existingNextgenConfig, oldConfig));
2837
2874
 
2838
2875
  if (hasObjectKeys(oldConfig)) {
2839
2876
  if (hasObjectKeys(oldConfig.ios)) {
@@ -2857,12 +2894,12 @@ const buildNextgenAdmobConfigFromOldConfig = (templateConfig, existingNextgenCon
2857
2894
  const existingRuntimeConfig = existingNextgenConfig.config || {};
2858
2895
  mergedConfig.config = mergeObjects(templateRuntimeConfig, mergeObjects(existingRuntimeConfig, oldConfig.config));
2859
2896
  }
2860
- }
2861
-
2862
- mergedConfig.VERSION = templateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
2863
-
2864
- return mergedConfig;
2865
- };
2897
+ }
2898
+
2899
+ mergedConfig.VERSION = templateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
2900
+
2901
+ return ensureAdmobNextgenConfigDefaults(mergedConfig);
2902
+ };
2866
2903
 
2867
2904
  const syncAdmobNextgenPackage = () => {
2868
2905
  if (!fs.existsSync(packageJsonPath)) {
@@ -2958,14 +2995,16 @@ const ensureAdmobNextgenFiles = async () => {
2958
2995
  }
2959
2996
  }
2960
2997
 
2961
- let templateConfig = ADMOB_NEXTGEN_DEFAULTS;
2962
-
2963
- if (await downloadOptionalCodeplayFile(ADMOB_NEXTGEN_CONFIG, tempTemplatePath)) {
2964
- templateConfig = JSON.parse(fs.readFileSync(tempTemplatePath, "utf8"));
2965
- fs.unlinkSync(tempTemplatePath);
2966
- } else if (fs.existsSync(nextgenConfigPath)) {
2967
- templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, JSON.parse(fs.readFileSync(nextgenConfigPath, "utf8")));
2968
- }
2998
+ let templateConfig = ADMOB_NEXTGEN_DEFAULTS;
2999
+
3000
+ if (await downloadOptionalCodeplayFile(ADMOB_NEXTGEN_CONFIG, tempTemplatePath)) {
3001
+ const downloadedTemplateConfig = JSON.parse(fs.readFileSync(tempTemplatePath, "utf8"));
3002
+ templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, downloadedTemplateConfig);
3003
+ templateConfig.VERSION = downloadedTemplateConfig.VERSION || ADMOB_NEXTGEN_DEFAULTS.VERSION;
3004
+ fs.unlinkSync(tempTemplatePath);
3005
+ } else if (fs.existsSync(nextgenConfigPath)) {
3006
+ templateConfig = mergeObjects(ADMOB_NEXTGEN_DEFAULTS, JSON.parse(fs.readFileSync(nextgenConfigPath, "utf8")));
3007
+ }
2969
3008
 
2970
3009
  const oldConfig = fs.existsSync(oldConfigPath)
2971
3010
  ? JSON.parse(fs.readFileSync(oldConfigPath, "utf8"))
@@ -1,27 +1,27 @@
1
- {
2
- "plugins":[
3
- {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
1
+ {
2
+ "plugins":[
3
+ {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
4
4
  {"name":"common-js","pattern":"common-(\\d+\\.\\d+)(?:-beta-(\\d+))?\\.js$","minVersion":"6.7","baseDir":"js","mandatoryUpdate":true},
5
-
5
+
6
6
  {"name":"admob-emi-nextgen","pattern":"Ads[\\\\/]admob-emi-nextgen-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
7
- {"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
8
- {"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
9
- {"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
10
-
11
-
12
- {"name":"localization","pattern":"localization-(\\d+\\.\\d+)$","minVersion":"1.8","baseDir":"js/localization","mandatoryUpdate":true,"isFolder":true},
13
- {"name": "localization_settings","pattern": "localization_settings-(\\d+\\.\\d+)\\.js$","minVersion": "1.1","required": true,"baseDir": "js/localization","mandatoryUpdate": true},
14
-
15
-
16
- {"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"2.0","baseDir":"js/editor","mandatoryUpdate":true,"isFolder":true},
17
- {"name":"ffmpeg","pattern":"ffmpeg-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
18
- {"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.5","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
19
- {"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
7
+ {"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
8
+ {"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
9
+ {"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
10
+
11
+
12
+ {"name":"localization","pattern":"localization-(\\d+\\.\\d+)$","minVersion":"1.8","baseDir":"js/localization","mandatoryUpdate":true,"isFolder":true},
13
+ {"name": "localization_settings","pattern": "localization_settings-(\\d+\\.\\d+)\\.js$","minVersion": "1.1","required": true,"baseDir": "js/localization","mandatoryUpdate": true},
14
+
15
+
16
+ {"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"2.0","baseDir":"js/editor","mandatoryUpdate":true,"isFolder":true},
17
+ {"name":"ffmpeg","pattern":"ffmpeg-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
18
+ {"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.5","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
19
+ {"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
20
20
  {"name":"IAP","pattern":"IAP-(\\d+\\.\\d+)$","minVersion":"3.6","baseDir":"js/Ads","mandatoryUpdate":true,"isFolder":true},
21
- {"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.8","baseDir":"assets/css","mandatoryUpdate":true},
22
- {"name":"localNotification_AppSettings","pattern":"localNotification_AppSettings-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
23
- {"name":"localNotification","pattern":"localNotification-(\\d+\\.\\d+)\\.js$","minVersion":"2.2","baseDir":"js","mandatoryUpdate":true},
24
- {"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
25
- {"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
26
- ]
21
+ {"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.8","baseDir":"assets/css","mandatoryUpdate":true},
22
+ {"name":"localNotification_AppSettings","pattern":"localNotification_AppSettings-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
23
+ {"name":"localNotification","pattern":"localNotification-(\\d+\\.\\d+)\\.js$","minVersion":"2.2","baseDir":"js","mandatoryUpdate":true},
24
+ {"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
25
+ {"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
26
+ ]
27
27
  }