codeplay-common 3.1.9 → 3.2.1

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.
@@ -465,6 +465,88 @@ else {
465
465
 
466
466
 
467
467
 
468
+ //editor-x.x import old style check and stop execution START
469
+
470
+
471
+
472
+
473
+
474
+
475
+
476
+
477
+ const ROOT_DIR = path.join(__dirname, "..", "src");
478
+
479
+ // Match: editor/editor-2.3, editor/editor-2.3.1, etc.
480
+ const FORBIDDEN_REGEX = /editor\/editor-\d+(\.\d+)+/;
481
+
482
+ let hasError = false;
483
+
484
+ const ERROR_MESSAGE = `const ERROR_MESSAGE = ❌ Invalid import detected!
485
+
486
+ You are using a direct version-based path like: editor/editor-x.x/editor.js
487
+
488
+ 🚫 This is NOT allowed.
489
+
490
+ 👉 Please use the proper alias or updated import method.
491
+ Example: import { ... } from '@editor'
492
+
493
+ ⚠️ Do not use version-based paths in imports.
494
+ 👉 Please add this manually in vite.config.js:
495
+
496
+ alias: {
497
+ '@editor': path.resolve(__dirname, './src/js/editor/editor-x.x')
498
+ }`
499
+
500
+ function scanDir(dir) {
501
+ const files = fs.readdirSync(dir);
502
+
503
+ for (const file of files) {
504
+ const fullPath = path.join(dir, file);
505
+ const stat = fs.statSync(fullPath);
506
+
507
+ if (stat.isDirectory()) {
508
+ scanDir(fullPath);
509
+ } else if (file.endsWith(".js") || file.endsWith(".ts") || file.endsWith(".f7")) {
510
+ const content = fs.readFileSync(fullPath, "utf-8");
511
+
512
+ const lines = content.split("\n");
513
+
514
+ lines.forEach((line, index) => {
515
+ if (FORBIDDEN_REGEX.test(line)) {
516
+ console.error(
517
+ `❌ Forbidden import found:\nFile: ${fullPath}\nLine: ${index + 1}\nCode: ${line.trim()}\n`,
518
+ ERROR_MESSAGE
519
+ );
520
+ hasError = true;
521
+ }
522
+ });
523
+ }
524
+ }
525
+ }
526
+
527
+ // Run scan
528
+ scanDir(ROOT_DIR);
529
+
530
+ // Throw error (exit process)
531
+ if (hasError) {
532
+ console.error("🚫 Build failed due to forbidden editor imports.");
533
+ process.exit(1);
534
+ } else {
535
+ console.log("✅ No forbidden imports found.");
536
+ }
537
+
538
+
539
+
540
+
541
+
542
+
543
+ //editor-x.x import old style check and stop execution START
544
+
545
+
546
+
547
+
548
+
549
+
468
550
 
469
551
 
470
552
 
@@ -2176,6 +2258,9 @@ const ERROR_MSG = `
2176
2258
  ❌ Capacitor SystemBars.java structure changed!
2177
2259
 
2178
2260
  Plugin: @capacitor/android
2261
+ Path : node_modules\@capacitor\android\capacitor\src\main\java\com\getcapacitor\plugin\SystemBars.java
2262
+
2263
+ Check version of "@capacitor/android": in package.json
2179
2264
 
2180
2265
  👉 Expected code block not found.
2181
2266
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "3.1.9",
3
+ "version": "3.2.1",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",