codeplay-common 3.2.14 โ 3.2.16
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,12 +635,17 @@ 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
638
|
|
|
640
|
-
|
|
639
|
+
|
|
640
|
+
const STATUSBAR_FILE = path.resolve(__dirname, '../src/js/common-configuration.js');
|
|
641
641
|
const STATUSBAR_REGEX = /^(?!\s*\/\/).*Capacitor\.Plugins\.StatusBar\.setStyle/m;
|
|
642
642
|
|
|
643
643
|
|
|
644
|
+
const ONESIGNAL_OLD_FILES = [
|
|
645
|
+
path.resolve(__dirname, '../src/js/onesignal-settings.js')
|
|
646
|
+
];
|
|
647
|
+
const ONESIGNAL_VERSION_REGEX = /^onesignal-\d+(\.\d+)*\.js$/;
|
|
648
|
+
|
|
644
649
|
function scanDirectory(dir) {
|
|
645
650
|
|
|
646
651
|
/*
|
|
@@ -656,11 +661,43 @@ function scanDirectory(dir) {
|
|
|
656
661
|
if (stat.isFile()) {
|
|
657
662
|
|
|
658
663
|
|
|
664
|
+
|
|
665
|
+
const baseName = path.basename(dir);
|
|
666
|
+
|
|
667
|
+
const JS_ROOT = path.resolve(__dirname, '../src/js');
|
|
668
|
+
const ONESIGNAL_DIR = path.join(JS_ROOT, 'onesignal');
|
|
669
|
+
|
|
670
|
+
// ๐จ Block old OneSignal file locations (ONLY in src/js root)
|
|
671
|
+
if (path.dirname(dir) === JS_ROOT) {
|
|
672
|
+
|
|
673
|
+
// โ onesignal-settings.js
|
|
674
|
+
if (ONESIGNAL_OLD_FILES.includes(dir)) {
|
|
675
|
+
console.error(`\nโ ERROR: onesignal-settings.js should not be in src/js/`);
|
|
676
|
+
console.error(`๐ Move it to: src/js/onesignal/`);
|
|
677
|
+
console.error(`๐ File: ${dir}\n`);
|
|
678
|
+
process.exit(1);
|
|
679
|
+
}
|
|
680
|
+
|
|
681
|
+
// โ onesignal-x.x.js
|
|
682
|
+
if (ONESIGNAL_VERSION_REGEX.test(baseName)) {
|
|
683
|
+
console.error(`\nโ ERROR: ${baseName} should not be in src/js/`);
|
|
684
|
+
console.error(`๐ Move it to: src/js/onesignal/`);
|
|
685
|
+
console.error(`๐ File: ${dir}\n`);
|
|
686
|
+
process.exit(1);
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
|
|
659
690
|
// ๐จ Special check ONLY for common-configuration.js
|
|
660
691
|
if (dir === STATUSBAR_FILE) {
|
|
661
|
-
|
|
692
|
+
let content = fs.readFileSync(dir, 'utf8');
|
|
693
|
+
|
|
694
|
+
// ๐งน Remove ALL comments (single-line + multi-line)
|
|
695
|
+
const contentWithoutComments = content
|
|
696
|
+
.replace(/\/\/.*$/gm, '') // remove // comments
|
|
697
|
+
.replace(/\/\*[\s\S]*?\*\//g, ''); // remove /* */ comments
|
|
662
698
|
|
|
663
|
-
|
|
699
|
+
// โ
Now check only real code
|
|
700
|
+
if (contentWithoutComments.includes('Capacitor.Plugins.StatusBar.setStyle')) {
|
|
664
701
|
console.error(`\nโ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
|
|
665
702
|
console.error(`๐ซ iOS status bar is controlled via other methods. Remove this line.`);
|
|
666
703
|
console.error(`๐ File: ${dir}\n`);
|
|
@@ -669,7 +706,7 @@ function scanDirectory(dir) {
|
|
|
669
706
|
}
|
|
670
707
|
|
|
671
708
|
// ๐ฅ Skip files in SKIP_FILES array
|
|
672
|
-
|
|
709
|
+
|
|
673
710
|
if (SKIP_FILES.includes(baseName)) {
|
|
674
711
|
// Just skip silently
|
|
675
712
|
return;
|
|
@@ -25,15 +25,53 @@ Note: This changes are added with my old(current) code. Might we need to integra
|
|
|
25
25
|
2) Statusbar color set in app startup is checked and through erro
|
|
26
26
|
|
|
27
27
|
const STATUSBAR_FILE = path.resolve(__dirname, '../src/js/common-configuration.js');
|
|
28
|
-
|
|
29
|
-
// Match StatusBar.setStyle (ignore comments)
|
|
30
28
|
const STATUSBAR_REGEX = /^(?!\s*\/\/).*Capacitor\.Plugins\.StatusBar\.setStyle/m;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
const ONESIGNAL_OLD_FILES = [
|
|
32
|
+
path.resolve(__dirname, '../src/js/onesignal-settings.js')
|
|
33
|
+
];
|
|
34
|
+
const ONESIGNAL_VERSION_REGEX = /^onesignal-\d+(\.\d+)*\.js$/;
|
|
35
|
+
|
|
31
36
|
....
|
|
32
37
|
....
|
|
38
|
+
....
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
const JS_ROOT = path.resolve(__dirname, '../src/js');
|
|
42
|
+
const ONESIGNAL_DIR = path.join(JS_ROOT, 'onesignal');
|
|
43
|
+
|
|
44
|
+
// ๐จ Block old OneSignal file locations (ONLY in src/js root)
|
|
45
|
+
if (path.dirname(dir) === JS_ROOT) {
|
|
46
|
+
|
|
47
|
+
// โ onesignal-settings.js
|
|
48
|
+
if (ONESIGNAL_OLD_FILES.includes(dir)) {
|
|
49
|
+
console.error(`\nโ ERROR: onesignal-settings.js should not be in src/js/`);
|
|
50
|
+
console.error(`๐ Move it to: src/js/onesignal/`);
|
|
51
|
+
console.error(`๐ File: ${dir}\n`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// โ onesignal-x.x.js
|
|
56
|
+
if (ONESIGNAL_VERSION_REGEX.test(baseName)) {
|
|
57
|
+
console.error(`\nโ ERROR: ${baseName} should not be in src/js/`);
|
|
58
|
+
console.error(`๐ Move it to: src/js/onesignal/`);
|
|
59
|
+
console.error(`๐ File: ${dir}\n`);
|
|
60
|
+
process.exit(1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ๐จ Special check ONLY for common-configuration.js
|
|
33
65
|
if (dir === STATUSBAR_FILE) {
|
|
34
|
-
|
|
66
|
+
let content = fs.readFileSync(dir, 'utf8');
|
|
67
|
+
|
|
68
|
+
// ๐งน Remove ALL comments (single-line + multi-line)
|
|
69
|
+
const contentWithoutComments = content
|
|
70
|
+
.replace(/\/\/.*$/gm, '') // remove // comments
|
|
71
|
+
.replace(/\/\*[\s\S]*?\*\//g, ''); // remove /* */ comments
|
|
35
72
|
|
|
36
|
-
|
|
73
|
+
// โ
Now check only real code
|
|
74
|
+
if (contentWithoutComments.includes('Capacitor.Plugins.StatusBar.setStyle')) {
|
|
37
75
|
console.error(`\nโ ERROR: StatusBar.setStyle should NOT be used in common-configuration.js`);
|
|
38
76
|
console.error(`๐ซ iOS status bar is controlled via other methods. Remove this line.`);
|
|
39
77
|
console.error(`๐ File: ${dir}\n`);
|