codeplay-common 3.2.13 โ†’ 3.2.15

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.
@@ -635,6 +635,11 @@ const SKIP_FILES = [
635
635
  ,'index.browser.js'
636
636
  ];
637
637
 
638
+ const STATUSBAR_FILE = path.resolve(__dirname, '../src/js/common-configuration.js');
639
+
640
+ // Match StatusBar.setStyle (ignore comments)
641
+ const STATUSBAR_REGEX = /^(?!\s*\/\/).*Capacitor\.Plugins\.StatusBar\.setStyle/m;
642
+
638
643
 
639
644
  function scanDirectory(dir) {
640
645
 
@@ -650,6 +655,25 @@ function scanDirectory(dir) {
650
655
 
651
656
  if (stat.isFile()) {
652
657
 
658
+
659
+ // ๐Ÿšจ Special check ONLY for common-configuration.js
660
+ if (dir === STATUSBAR_FILE) {
661
+ let content = fs.readFileSync(dir, 'utf8');
662
+
663
+ // ๐Ÿงน Remove ALL comments (single-line + multi-line)
664
+ const contentWithoutComments = content
665
+ .replace(/\/\/.*$/gm, '') // remove // comments
666
+ .replace(/\/\*[\s\S]*?\*\//g, ''); // remove /* */ comments
667
+
668
+ // โœ… Now check only real code
669
+ if (contentWithoutComments.includes('Capacitor.Plugins.StatusBar.setStyle')) {
670
+ console.error(`\nโŒ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
671
+ console.error(`๐Ÿšซ iOS status bar is controlled via other methods. Remove this line.`);
672
+ console.error(`๐Ÿ“„ File: ${dir}\n`);
673
+ process.exit(1);
674
+ }
675
+ }
676
+
653
677
  // ๐Ÿ”ฅ Skip files in SKIP_FILES array
654
678
  const baseName = path.basename(dir);
655
679
  if (SKIP_FILES.includes(baseName)) {
@@ -0,0 +1,49 @@
1
+ Note: This changes are added with my old(current) code. Might we need to integrate this features into our new optimized code.
2
+
3
+ 1) If no import(saveToGalleryAndSaveAnyFile) found it through error issue is fixed
4
+ // iOS Checks
5
+ /* if (isMac && !iosImportFound) {
6
+ console.warn(`โš ๏ธ WARNING: You're on macOS but no iOS version (saveToGalleryAndSaveAnyFile-x.x-ios.js) found.`);
7
+ process.exit(1);
8
+ } else if (isMac && iosImportFound) {
9
+ console.log('โœ… iOS version detected for macOS build.');
10
+ } else if (!iosImportFound) {
11
+ console.log('โœ… No iOS-specific imports detected for non-macOS.');
12
+ } */
13
+
14
+ // โœ… Only care if iOS import is found in NON-mac systems
15
+ if (iosImportFound && !isMac) {
16
+ console.error(`\nโŒ ERROR: iOS-specific file is imported in non-macOS environment.`);
17
+ process.exit(1);
18
+ } else if (iosImportFound && isMac) {
19
+ console.log('โœ… iOS import detected (valid for macOS build).');
20
+ } else {
21
+ console.log('โœ… No iOS-specific imports found (this is totally fine).');
22
+ }
23
+
24
+
25
+ 2) Statusbar color set in app startup is checked and through erro
26
+
27
+ const STATUSBAR_FILE = path.resolve(__dirname, '../src/js/common-configuration.js');
28
+
29
+ // Match StatusBar.setStyle (ignore comments)
30
+ const STATUSBAR_REGEX = /^(?!\s*\/\/).*Capacitor\.Plugins\.StatusBar\.setStyle/m;
31
+ ....
32
+ ....
33
+ // ๐Ÿšจ Special check ONLY for common-configuration.js
34
+ if (dir === STATUSBAR_FILE) {
35
+ let content = fs.readFileSync(dir, 'utf8');
36
+
37
+ // ๐Ÿงน Remove ALL comments (single-line + multi-line)
38
+ const contentWithoutComments = content
39
+ .replace(/\/\/.*$/gm, '') // remove // comments
40
+ .replace(/\/\*[\s\S]*?\*\//g, ''); // remove /* */ comments
41
+
42
+ // โœ… Now check only real code
43
+ if (contentWithoutComments.includes('Capacitor.Plugins.StatusBar.setStyle')) {
44
+ console.error(`\nโŒ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
45
+ console.error(`๐Ÿšซ iOS status bar is controlled via other methods. Remove this line.`);
46
+ console.error(`๐Ÿ“„ File: ${dir}\n`);
47
+ process.exit(1);
48
+ }
49
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "3.2.13",
3
+ "version": "3.2.15",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",