codeplay-common 2.1.15 → 2.1.17
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.
|
@@ -28,13 +28,17 @@ const requiredPlugins = [
|
|
|
28
28
|
{ pattern: /video-player-(\d+\.\d+)\.js$/, minVersion: '1.5', required: true, baseDir: 'js' },
|
|
29
29
|
{ pattern: /image-cropper-(\d+\.\d+)\.js$/, minVersion: '1.1', required: true, baseDir: 'js' },
|
|
30
30
|
|
|
31
|
-
{ pattern: /common-(\d+\.\d+)\.less$/, minVersion: '1.
|
|
31
|
+
{ pattern: /common-(\d+\.\d+)\.less$/, minVersion: '1.5', required: true, baseDir: 'assets/css' },
|
|
32
32
|
|
|
33
33
|
|
|
34
34
|
// New folders
|
|
35
35
|
{ pattern: /editor-(\d+\.\d+)$/, minVersion: '1.8', isFolder: true, required: true, baseDir: 'js' },
|
|
36
36
|
{ pattern: /ffmpeg-(\d+\.\d+)$/, minVersion: '1.3', isFolder: true, required: true, baseDir: 'js' },
|
|
37
|
-
{ pattern: /theme-(\d+\.\d+)$/, minVersion: '1.6', isFolder: true , required: true, baseDir: 'js' }
|
|
37
|
+
{ pattern: /theme-(\d+\.\d+)$/, minVersion: '1.6', isFolder: true , required: true, baseDir: 'js' },
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
{ pattern: /certificatejs-(\d+\.\d+)$/, minVersion: '1.4', isFolder: true , required: true, baseDir: 'certificate' }
|
|
41
|
+
|
|
38
42
|
];
|
|
39
43
|
|
|
40
44
|
|
|
@@ -951,99 +955,94 @@ function getSearchRoot(plugin) {
|
|
|
951
955
|
}
|
|
952
956
|
|
|
953
957
|
function checkPlugins() {
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
958
|
+
return new Promise((resolve, reject) => {
|
|
959
|
+
const files = walkSync(srcDir);
|
|
960
|
+
|
|
961
|
+
for (const plugin of requiredPlugins) {
|
|
962
|
+
const searchRoot = getSearchRoot(plugin);
|
|
963
|
+
|
|
964
|
+
if (plugin.isFolder) {
|
|
965
|
+
if (!fs.existsSync(searchRoot)) continue;
|
|
966
|
+
|
|
967
|
+
const subDirs = fs.readdirSync(searchRoot)
|
|
968
|
+
.map(name => path.join(searchRoot, name))
|
|
969
|
+
.filter(p => fs.statSync(p).isDirectory());
|
|
970
|
+
|
|
971
|
+
for (const dir of subDirs) {
|
|
972
|
+
const relativePath = path.relative(searchRoot, dir).replace(/\\/g, '/');
|
|
973
|
+
const match = plugin.pattern.exec(relativePath);
|
|
974
|
+
|
|
975
|
+
if (match) {
|
|
976
|
+
const currentVersion = match[1];
|
|
977
|
+
if (compareVersions(currentVersion, plugin.minVersion) < 0) {
|
|
978
|
+
outdatedPlugins.push({
|
|
979
|
+
name: relativePath,
|
|
980
|
+
currentVersion,
|
|
981
|
+
requiredVersion: plugin.minVersion
|
|
982
|
+
});
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
continue;
|
|
987
|
+
}
|
|
968
988
|
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
.replace(/\\/g, '/');
|
|
989
|
+
const matchedFile = files.find(file =>
|
|
990
|
+
file.startsWith(searchRoot) && plugin.pattern.test(file)
|
|
991
|
+
);
|
|
973
992
|
|
|
974
|
-
|
|
993
|
+
if (matchedFile) {
|
|
994
|
+
const match = plugin.pattern.exec(matchedFile);
|
|
975
995
|
if (match) {
|
|
976
996
|
const currentVersion = match[1];
|
|
977
|
-
|
|
997
|
+
const isBeta = !!match[2];
|
|
998
|
+
|
|
999
|
+
const cmp = plugin.pattern.source.includes('beta')
|
|
1000
|
+
? compareWithBeta(currentVersion, plugin.minVersion, isBeta)
|
|
1001
|
+
: compareVersions(currentVersion, plugin.minVersion);
|
|
1002
|
+
|
|
1003
|
+
if (cmp < 0) {
|
|
978
1004
|
outdatedPlugins.push({
|
|
979
|
-
name:
|
|
980
|
-
currentVersion,
|
|
1005
|
+
name: path.relative(srcDir, matchedFile),
|
|
1006
|
+
currentVersion: isBeta ? `${currentVersion}-beta` : currentVersion,
|
|
981
1007
|
requiredVersion: plugin.minVersion
|
|
982
1008
|
});
|
|
983
1009
|
}
|
|
984
1010
|
}
|
|
985
1011
|
}
|
|
986
|
-
continue;
|
|
987
1012
|
}
|
|
988
1013
|
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
if (matchedFile) {
|
|
995
|
-
const match = plugin.pattern.exec(matchedFile);
|
|
996
|
-
if (match) {
|
|
997
|
-
const currentVersion = match[1];
|
|
998
|
-
const isBeta = !!match[2]; // <-- only common has this
|
|
999
|
-
|
|
1000
|
-
const cmp = plugin.pattern.source.includes('beta')
|
|
1001
|
-
? compareWithBeta(currentVersion, plugin.minVersion, isBeta)
|
|
1002
|
-
: compareVersions(currentVersion, plugin.minVersion);
|
|
1003
|
-
|
|
1004
|
-
if (cmp < 0) {
|
|
1005
|
-
outdatedPlugins.push({
|
|
1006
|
-
name: path.relative(srcDir, matchedFile),
|
|
1007
|
-
currentVersion: isBeta
|
|
1008
|
-
? `${currentVersion}-beta`
|
|
1009
|
-
: currentVersion,
|
|
1010
|
-
requiredVersion: plugin.minVersion
|
|
1011
|
-
});
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1014
|
+
if (outdatedPlugins.length > 0) {
|
|
1015
|
+
console.log('\n❗ The following plugins are outdated:');
|
|
1016
|
+
outdatedPlugins.forEach(p => {
|
|
1017
|
+
console.log(` ❌ - ${p.name} (Current: ${p.currentVersion}, Required: ${p.requiredVersion})`);
|
|
1018
|
+
});
|
|
1015
1019
|
|
|
1016
|
-
|
|
1020
|
+
const rl = readline.createInterface({
|
|
1021
|
+
input: process.stdin,
|
|
1022
|
+
output: process.stdout
|
|
1023
|
+
});
|
|
1017
1024
|
|
|
1025
|
+
rl.question('\nAre you sure you want to continue without updating these plugins? (y/n): ', answer => {
|
|
1026
|
+
rl.close();
|
|
1018
1027
|
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1028
|
+
if (answer.toLowerCase() !== 'y') {
|
|
1029
|
+
console.log('\n❌ Build cancelled due to outdated plugins.');
|
|
1030
|
+
process.exit(1);
|
|
1031
|
+
} else {
|
|
1032
|
+
console.log('\n✅ Continuing build...');
|
|
1033
|
+
resolve();
|
|
1034
|
+
}
|
|
1035
|
+
});
|
|
1036
|
+
} else {
|
|
1037
|
+
console.log('✅ All plugin versions are up to date.');
|
|
1038
|
+
resolve();
|
|
1039
|
+
}
|
|
1040
|
+
});
|
|
1041
|
+
}
|
|
1024
1042
|
|
|
1025
|
-
const rl = readline.createInterface({
|
|
1026
|
-
input: process.stdin,
|
|
1027
|
-
output: process.stdout
|
|
1028
|
-
});
|
|
1029
1043
|
|
|
1030
|
-
rl.question('\nAre you sure you want to continue without updating these plugins? (y/n): ', answer => {
|
|
1031
|
-
if (answer.toLowerCase() !== 'y') {
|
|
1032
|
-
console.log('\n❌ Build cancelled due to outdated plugins.');
|
|
1033
|
-
process.exit(1);
|
|
1034
|
-
} else {
|
|
1035
|
-
console.log('\n✅ Continuing build...');
|
|
1036
|
-
rl.close();
|
|
1037
|
-
}
|
|
1038
|
-
});
|
|
1039
|
-
} else {
|
|
1040
|
-
console.log('✅ All plugin versions are up to date.');
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
1044
|
|
|
1044
1045
|
|
|
1045
|
-
// Run the validation
|
|
1046
|
-
checkPlugins();
|
|
1047
1046
|
|
|
1048
1047
|
|
|
1049
1048
|
|
|
@@ -1128,7 +1127,7 @@ const checkAndupdateDropInViteConfig = () => {
|
|
|
1128
1127
|
console.log("✅ vite.config.(m)js Updated successfully.");
|
|
1129
1128
|
};
|
|
1130
1129
|
|
|
1131
|
-
|
|
1130
|
+
|
|
1132
1131
|
|
|
1133
1132
|
|
|
1134
1133
|
|
|
@@ -1245,9 +1244,14 @@ if (compareVersion(admobConfigInJson.VERSION, admobConfigMinVersion) < 0) {
|
|
|
1245
1244
|
}
|
|
1246
1245
|
|
|
1247
1246
|
|
|
1248
|
-
checkAdmobConfigurationProperty()
|
|
1249
1247
|
|
|
1250
1248
|
|
|
1249
|
+
// Run the validation
|
|
1250
|
+
(async () => {
|
|
1251
|
+
await checkPlugins();
|
|
1252
|
+
checkAndupdateDropInViteConfig();
|
|
1253
|
+
checkAdmobConfigurationProperty()
|
|
1254
|
+
})();
|
|
1251
1255
|
|
|
1252
1256
|
|
|
1253
1257
|
/*
|