codeplay-common 3.1.6 â 3.1.8
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 +2 -2
- package/LICENSE +21 -21
- package/README.md +11 -11
- package/files/buildCodeplay/add-splash-screen-1.6.js +254 -254
- package/files/buildCodeplay/codeplayBeforeBuild-6.0.js +115 -24
- package/files/buildCodeplay/versions.json +14 -9
- package/files/finalrelease +924 -924
- package/files/iap-install-2.js +145 -145
- package/files/ionic.config.json +6 -6
- package/package.json +16 -16
- package/scripts/sync-files.js +86 -86
- package/scripts/uninstall.js +77 -77
|
@@ -325,46 +325,137 @@ checkAppUniqueId();
|
|
|
325
325
|
//const path = require("path");
|
|
326
326
|
//const { execSync } = require("child_process");
|
|
327
327
|
|
|
328
|
-
const
|
|
329
|
-
|
|
330
|
-
// Step 1: Find highest versioned folder like `editor-1.6`
|
|
331
|
-
const editorDirs = fs.readdirSync(baseDir)
|
|
332
|
-
.filter(name => /^editor-\d+\.\d+$/.test(name))
|
|
333
|
-
.sort((a, b) => {
|
|
334
|
-
const getVersion = str => str.match(/(\d+)\.(\d+)/).slice(1).map(Number);
|
|
335
|
-
const [aMajor, aMinor] = getVersion(a);
|
|
336
|
-
const [bMajor, bMinor] = getVersion(b);
|
|
337
|
-
return bMajor - aMajor || bMinor - aMinor;
|
|
338
|
-
});
|
|
328
|
+
const jsDir = path.join(__dirname, "..", "src", "js");
|
|
339
329
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
330
|
+
// đ Detect OLD structure
|
|
331
|
+
const oldEditorDirs = fs.readdirSync(jsDir)
|
|
332
|
+
.filter(name => /^editor-\d+\.\d+$/.test(name));
|
|
333
|
+
|
|
334
|
+
// đ New structure path (optional, not mandatory)
|
|
335
|
+
const newEditorBaseDir = path.join(jsDir, "editor");
|
|
336
|
+
|
|
337
|
+
// ======================================================
|
|
338
|
+
// â CASE 1: OLD STRUCTURE FOUND â STOP
|
|
339
|
+
// ======================================================
|
|
340
|
+
if (oldEditorDirs.length > 0) {
|
|
341
|
+
|
|
342
|
+
console.error(`
|
|
343
|
+
â OLD EDITOR STRUCTURE DETECTED
|
|
344
|
+
|
|
345
|
+
You are using outdated folder structure:
|
|
346
|
+
src/js/editor-x.x/
|
|
347
|
+
|
|
348
|
+
đ¨ This is no longer supported.
|
|
349
|
+
|
|
350
|
+
đĻ Found folders:
|
|
351
|
+
${oldEditorDirs.map(d => " - " + d).join("\n")}
|
|
352
|
+
|
|
353
|
+
đ Please move them manually:
|
|
354
|
+
|
|
355
|
+
src/js/editor-1.6
|
|
356
|
+
âŦ
|
|
357
|
+
src/js/editor/editor-1.6
|
|
358
|
+
|
|
359
|
+
â ī¸ Also ensure:
|
|
360
|
+
src/js/editor/configuration.json exists
|
|
361
|
+
|
|
362
|
+
â Build stopped.
|
|
363
|
+
`);
|
|
364
|
+
|
|
365
|
+
process.exit(1);
|
|
345
366
|
}
|
|
346
|
-
|
|
347
|
-
|
|
367
|
+
|
|
368
|
+
// ======================================================
|
|
369
|
+
// â
CASE 2: NEW STRUCTURE EXISTS â VALIDATE
|
|
370
|
+
// ======================================================
|
|
371
|
+
if (fs.existsSync(newEditorBaseDir)) {
|
|
372
|
+
|
|
373
|
+
// đ Find editor-x.x inside new folder
|
|
374
|
+
const editorDirs = fs.readdirSync(newEditorBaseDir)
|
|
375
|
+
.filter(name => /^editor-\d+\.\d+$/.test(name));
|
|
376
|
+
|
|
377
|
+
// đ If editor folder exists but no versions â skip safely
|
|
378
|
+
if (editorDirs.length === 0) {
|
|
379
|
+
console.log("âšī¸ No editor-x.x folders found inside src/js/editor/");
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// ======================================================
|
|
384
|
+
// â
Validate configuration.json (NEW RULE)
|
|
385
|
+
// ======================================================
|
|
386
|
+
|
|
387
|
+
const editorConfigPath = path.join(newEditorBaseDir, "configuration.json");
|
|
388
|
+
|
|
389
|
+
// â Missing config
|
|
390
|
+
if (!fs.existsSync(editorConfigPath)) {
|
|
391
|
+
console.error(`
|
|
392
|
+
â MISSING EDITOR CONFIGURATION FILE
|
|
393
|
+
|
|
394
|
+
Required:
|
|
395
|
+
src/js/editor/configuration.json
|
|
396
|
+
|
|
397
|
+
â Build stopped.
|
|
398
|
+
`);
|
|
399
|
+
process.exit(1);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
// â Check wrong placement
|
|
403
|
+
const invalidConfigs = [];
|
|
404
|
+
|
|
405
|
+
editorDirs.forEach(dir => {
|
|
406
|
+
const wrongPath = path.join(newEditorBaseDir, dir, "configuration.json");
|
|
407
|
+
if (fs.existsSync(wrongPath)) {
|
|
408
|
+
invalidConfigs.push(`src/js/editor/${dir}/configuration.json`);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
|
|
412
|
+
if (invalidConfigs.length > 0) {
|
|
413
|
+
console.error(`
|
|
414
|
+
â INVALID CONFIGURATION LOCATION
|
|
415
|
+
|
|
416
|
+
đĢ configuration.json must NOT be inside version folders.
|
|
417
|
+
|
|
418
|
+
Found:
|
|
419
|
+
${invalidConfigs.map(p => " - " + p).join("\n")}
|
|
420
|
+
|
|
421
|
+
â
Correct:
|
|
422
|
+
src/js/editor/configuration.json
|
|
423
|
+
|
|
424
|
+
â Build stopped.
|
|
425
|
+
`);
|
|
426
|
+
process.exit(1);
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
console.log("â
Editor structure validated.");
|
|
430
|
+
|
|
431
|
+
// ======================================================
|
|
432
|
+
// đ Continue execution (run.js)
|
|
433
|
+
// ======================================================
|
|
348
434
|
|
|
349
435
|
const latestEditorDir = editorDirs.sort((a, b) => {
|
|
350
|
-
const
|
|
351
|
-
const
|
|
352
|
-
return
|
|
436
|
+
const vA = parseFloat(a.split('-')[1]);
|
|
437
|
+
const vB = parseFloat(b.split('-')[1]);
|
|
438
|
+
return vB - vA;
|
|
353
439
|
})[0];
|
|
354
440
|
|
|
355
|
-
|
|
356
|
-
const runJsPath = path.join(baseDir, latestEditorDir, "run.js");
|
|
441
|
+
const runJsPath = path.join(newEditorBaseDir, latestEditorDir, "run.js");
|
|
357
442
|
|
|
358
443
|
if (!fs.existsSync(runJsPath)) {
|
|
359
444
|
console.error(`â run.js not found in ${latestEditorDir}`);
|
|
360
445
|
process.exit(1);
|
|
361
446
|
}
|
|
362
447
|
|
|
363
|
-
// Step 2: Execute the run.js file
|
|
364
448
|
console.log(`đ Executing ${runJsPath}...`);
|
|
365
449
|
execSync(`node "${runJsPath}"`, { stdio: "inherit" });
|
|
366
450
|
}
|
|
367
451
|
|
|
452
|
+
// ======================================================
|
|
453
|
+
// â
CASE 3: NOTHING EXISTS â DO NOTHING
|
|
454
|
+
// ======================================================
|
|
455
|
+
else {
|
|
456
|
+
console.log("âšī¸ Editor not used in this project. Skipping...");
|
|
457
|
+
}
|
|
458
|
+
|
|
368
459
|
//@Codemirror check and install/uninstall the packages END
|
|
369
460
|
|
|
370
461
|
|
|
@@ -1,21 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"plugins":[
|
|
3
|
-
{"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.
|
|
4
|
-
{"name":"common-js","pattern":"common-(\\d+\\.\\d+)(?:-beta-(\\d+))?\\.js$","minVersion":"6.
|
|
3
|
+
{"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.1","baseDir":"js","mandatoryUpdate":true},
|
|
4
|
+
{"name":"common-js","pattern":"common-(\\d+\\.\\d+)(?:-beta-(\\d+))?\\.js$","minVersion":"6.2","baseDir":"js","mandatoryUpdate":true},
|
|
5
5
|
{"name":"localization_settings","pattern":"localization_settings-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
|
|
6
6
|
{"name":"localization","pattern":"localization-(\\d+\\.\\d+)\\.js$","minVersion":"1.5","baseDir":"js","mandatoryUpdate":true},
|
|
7
|
-
{"name":"admob-emi","pattern":"Ads[\\\\/]admob-emi-(\\d+\\.\\d+)\\.js$","minVersion":"
|
|
7
|
+
{"name":"admob-emi","pattern":"Ads[\\\\/]admob-emi-(\\d+\\.\\d+)\\.js$","minVersion":"4.1","baseDir":"js","mandatoryUpdate":true},
|
|
8
8
|
{"name":"video-player","pattern":"video-player-(\\d+\\.\\d+)\\.js$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true},
|
|
9
9
|
{"name":"image-cropper","pattern":"image-cropper-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
{"name":"beautify","pattern":"beautify-(\\d+\\.\\d+)\\.js$","minVersion":"1.1","baseDir":"js","mandatoryUpdate":true},
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
{"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"2.0","baseDir":"js/editor","mandatoryUpdate":true,"isFolder":true},
|
|
15
|
+
|
|
11
16
|
{"name":"ffmpeg","pattern":"ffmpeg-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
|
|
12
|
-
{"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.
|
|
13
|
-
{"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.
|
|
14
|
-
{"name":"IAP","pattern":"IAP-(\\d+\\.\\d+)$","minVersion":"
|
|
15
|
-
{"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.
|
|
17
|
+
{"name":"theme","pattern":"theme-(\\d+\\.\\d+)$","minVersion":"3.5","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
|
|
18
|
+
{"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
|
|
19
|
+
{"name":"IAP","pattern":"IAP-(\\d+\\.\\d+)$","minVersion":"3.0","baseDir":"js/Ads","mandatoryUpdate":true,"isFolder":true},
|
|
20
|
+
{"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.8","baseDir":"assets/css","mandatoryUpdate":true},
|
|
16
21
|
{"name":"localNotification_AppSettings","pattern":"localNotification_AppSettings-(\\d+\\.\\d+)\\.js$","minVersion":"1.0","baseDir":"js","mandatoryUpdate":true},
|
|
17
22
|
{"name":"localNotification","pattern":"localNotification-(\\d+\\.\\d+)\\.js$","minVersion":"2.2","baseDir":"js","mandatoryUpdate":true},
|
|
18
|
-
{"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.
|
|
23
|
+
{"name":"onesignal","pattern":"onesignal-(\\d+\\.\\d+)\\.js$","minVersion":"2.4","baseDir":"js","mandatoryUpdate":true},
|
|
19
24
|
{"name":"saveToGalleryAndSaveAnyFile","pattern":"saveToGalleryAndSaveAnyFile-(\\d+\\.\\d+)(-ios)?\\.js$","minVersion":"3.1","baseDir":"js","mandatoryUpdate":true}
|
|
20
25
|
]
|
|
21
26
|
}
|