codeplay-common 3.2.14 โ†’ 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.
@@ -658,9 +658,15 @@ function scanDirectory(dir) {
658
658
 
659
659
  // ๐Ÿšจ Special check ONLY for common-configuration.js
660
660
  if (dir === STATUSBAR_FILE) {
661
- const content = fs.readFileSync(dir, 'utf8');
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
662
667
 
663
- if (STATUSBAR_REGEX.test(content)) {
668
+ // โœ… Now check only real code
669
+ if (contentWithoutComments.includes('Capacitor.Plugins.StatusBar.setStyle')) {
664
670
  console.error(`\nโŒ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
665
671
  console.error(`๐Ÿšซ iOS status bar is controlled via other methods. Remove this line.`);
666
672
  console.error(`๐Ÿ“„ File: ${dir}\n`);
@@ -30,10 +30,17 @@ Note: This changes are added with my old(current) code. Might we need to integra
30
30
  const STATUSBAR_REGEX = /^(?!\s*\/\/).*Capacitor\.Plugins\.StatusBar\.setStyle/m;
31
31
  ....
32
32
  ....
33
+ // ๐Ÿšจ Special check ONLY for common-configuration.js
33
34
  if (dir === STATUSBAR_FILE) {
34
- const content = fs.readFileSync(dir, 'utf8');
35
+ let content = fs.readFileSync(dir, 'utf8');
35
36
 
36
- if (STATUSBAR_REGEX.test(content)) {
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')) {
37
44
  console.error(`\nโŒ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
38
45
  console.error(`๐Ÿšซ iOS status bar is controlled via other methods. Remove this line.`);
39
46
  console.error(`๐Ÿ“„ File: ${dir}\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "3.2.14",
3
+ "version": "3.2.15",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",