codeplay-common 3.1.6 → 3.1.7

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.
@@ -325,10 +325,131 @@ checkAppUniqueId();
325
325
  //const path = require("path");
326
326
  //const { execSync } = require("child_process");
327
327
 
328
- const baseDir = path.join(__dirname, "..", "src", "js");
328
+ const jsDir = path.join(__dirname, "..", "src", "js");
329
329
 
330
- // Step 1: Find highest versioned folder like `editor-1.6`
331
- const editorDirs = fs.readdirSync(baseDir)
330
+ // OLD structure check
331
+ const oldEditorDirs = fs.readdirSync(jsDir)
332
+ .filter(name => /^editor-\d+\.\d+$/.test(name));
333
+
334
+ // ✅ NEW structure path
335
+ const newEditorBaseDir = path.join(jsDir, "editor");
336
+
337
+ if (oldEditorDirs.length > 0) {
338
+
339
+ console.error(`
340
+ ❌ OLD EDITOR STRUCTURE DETECTED
341
+
342
+ You are using outdated folder structure:
343
+ src/js/editor-x.x/
344
+
345
+ 🚨 This structure is no longer supported.
346
+
347
+ ✅ NEW STRUCTURE REQUIRED:
348
+ src/js/editor/editor-x.x/
349
+
350
+ 📦 Your existing folders:
351
+ ${oldEditorDirs.map(d => " - " + d).join("\n")}
352
+
353
+ 👉 Please move them manually like this:
354
+
355
+ src/js/editor-1.6
356
+ ⬇ MOVE TO
357
+ src/js/editor/editor-1.6
358
+
359
+ ⚠️ After moving, re-run the build.
360
+
361
+ ❌ Build stopped to prevent runtime errors.
362
+ `);
363
+
364
+ process.exit(1);
365
+ }
366
+
367
+ // ✅ Ensure new structure exists
368
+ if (!fs.existsSync(newEditorBaseDir)) {
369
+
370
+ console.error(`
371
+ ❌ MISSING EDITOR DIRECTORY
372
+
373
+ Expected path:
374
+ src/js/editor/
375
+
376
+ But it was not found.
377
+
378
+ 👉 Please create the folder and move editor-x.x inside it.
379
+
380
+ Example:
381
+ src/js/editor/editor-1.6/
382
+ `);
383
+
384
+ process.exit(1);
385
+ }
386
+
387
+
388
+
389
+ // ======================================================
390
+ // Validate editor configuration structure
391
+ // ======================================================
392
+
393
+ const editorConfigPath = path.join(newEditorBaseDir, "configuration.json");
394
+
395
+ // ❌ Check if configuration.json exists in correct place
396
+ if (!fs.existsSync(editorConfigPath)) {
397
+ console.error(`
398
+ ❌ MISSING EDITOR CONFIGURATION FILE
399
+
400
+ Required file not found:
401
+ src/js/editor/configuration.json
402
+
403
+ 👉 This file is mandatory in new editor structure.
404
+
405
+ 📦 Please ensure:
406
+ src/js/editor/configuration.json exists
407
+
408
+ ❌ Build stopped.
409
+ `);
410
+ process.exit(1);
411
+ }
412
+
413
+ // ❌ Check for OLD structure mistake inside version folders
414
+ const invalidConfigLocations = [];
415
+
416
+ const editorSubDirs = fs.readdirSync(newEditorBaseDir)
417
+ .filter(name => /^editor-\d+\.\d+$/.test(name));
418
+
419
+ editorSubDirs.forEach(dir => {
420
+ const wrongPath = path.join(newEditorBaseDir, dir, "configuration.json");
421
+
422
+ if (fs.existsSync(wrongPath)) {
423
+ invalidConfigLocations.push(`src/js/editor/${dir}/configuration.json`);
424
+ }
425
+ });
426
+
427
+ if (invalidConfigLocations.length > 0) {
428
+ console.error(`
429
+ ❌ INVALID EDITOR CONFIGURATION STRUCTURE DETECTED
430
+
431
+ 🚫 configuration.json must NOT be inside version folders.
432
+
433
+ Found invalid files:
434
+ ${invalidConfigLocations.map(p => " - " + p).join("\n")}
435
+
436
+ ✅ Correct structure:
437
+ src/js/editor/configuration.json
438
+
439
+ 👉 Please MOVE or DELETE the above files.
440
+
441
+ ❌ Build stopped.
442
+ `);
443
+ process.exit(1);
444
+ }
445
+
446
+ console.log("✅ Editor configuration structure validated.");
447
+
448
+
449
+
450
+
451
+ // ✅ Now use new structure
452
+ const editorDirs = fs.readdirSync(newEditorBaseDir)
332
453
  .filter(name => /^editor-\d+\.\d+$/.test(name))
333
454
  .sort((a, b) => {
334
455
  const getVersion = str => str.match(/(\d+)\.(\d+)/).slice(1).map(Number);
@@ -338,29 +459,18 @@ const editorDirs = fs.readdirSync(baseDir)
338
459
  });
339
460
 
340
461
  if (editorDirs.length === 0) {
341
-
342
- console.log("@Codemirror used editor(s) are not found")
343
- //console.error("❌ No editor-x.x folders found in src/js.");
344
- //process.exit(1);
345
- }
346
- else
347
- {
462
+ console.log("@Codemirror editor(s) not found inside src/js/editor/");
463
+ } else {
348
464
 
349
- const latestEditorDir = editorDirs.sort((a, b) => {
350
- const versionA = parseFloat(a.split('-')[1]);
351
- const versionB = parseFloat(b.split('-')[1]);
352
- return versionB - versionA;
353
- })[0];
465
+ const latestEditorDir = editorDirs[0];
354
466
 
355
- //const latestEditorDir = editorDirs[editorDirs.length - 1];
356
- const runJsPath = path.join(baseDir, latestEditorDir, "run.js");
467
+ const runJsPath = path.join(newEditorBaseDir, latestEditorDir, "run.js");
357
468
 
358
469
  if (!fs.existsSync(runJsPath)) {
359
470
  console.error(`❌ run.js not found in ${latestEditorDir}`);
360
471
  process.exit(1);
361
472
  }
362
473
 
363
- // Step 2: Execute the run.js file
364
474
  console.log(`🚀 Executing ${runJsPath}...`);
365
475
  execSync(`node "${runJsPath}"`, { stdio: "inherit" });
366
476
  }
@@ -1,21 +1,26 @@
1
1
  {
2
2
  "plugins":[
3
- {"name":"backbutton","pattern":"backbutton-(\\d+\\.\\d+)\\.js$","minVersion":"2.0","baseDir":"js","mandatoryUpdate":true},
4
- {"name":"common-js","pattern":"common-(\\d+\\.\\d+)(?:-beta-(\\d+))?\\.js$","minVersion":"6.0","baseDir":"js","mandatoryUpdate":true},
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":"3.7","baseDir":"js","mandatoryUpdate":true},
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
- {"name":"editor","pattern":"editor-(\\d+\\.\\d+)$","minVersion":"1.9","baseDir":"js","mandatoryUpdate":true,"isFolder":true},
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.3","baseDir":"theme","destDir":"theme","mandatoryUpdate":true,"isFolder":true},
13
- {"name":"certificatejs","pattern":"certificatejs-(\\d+\\.\\d+)$","minVersion":"1.6","baseDir":"certificate","destDir":"certificate","mandatoryUpdate":true,"isFolder":true},
14
- {"name":"IAP","pattern":"IAP-(\\d+\\.\\d+)$","minVersion":"2.8","baseDir":"js/Ads","mandatoryUpdate":true,"isFolder":true},
15
- {"name":"common-less","pattern":"common-(\\d+\\.\\d+)\\.less$","minVersion":"1.7","baseDir":"assets/css","mandatoryUpdate":true},
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.3","baseDir":"js","mandatoryUpdate":true},
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
  }