codeplay-common 4.2.2 → 4.2.3

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/README.md CHANGED
@@ -12,6 +12,9 @@ Donate to get full code including many common functions
12
12
  https://ko-fi.com/codeplay
13
13
 
14
14
 
15
+ Version 4.2.3
16
+ Added build warning confirmation when android.ORIENTATION is not "auto" or android.RESIZEABLE_ACTIVITY is not true.
17
+
15
18
  Version 4.2.2
16
19
  Added "bannerDisabledPages" property and its default value
17
20
  The admob configuration default value priority is updated
@@ -425,9 +425,71 @@ const checkAppUniqueId=()=>{
425
425
 
426
426
 
427
427
  console.log(`✅ APP_UNIQUE_ID is valid: ${appUniqueId}`);
428
+ warnForNonAutoOrientationConfig(orientation, RESIZEABLE_ACTIVITY);
428
429
 
429
430
  }
430
431
 
432
+ function readBuildConfirmationInput(question) {
433
+ process.stdout.write(question);
434
+
435
+ const buffer = Buffer.alloc(1024);
436
+ let answer = "";
437
+
438
+ while (!answer.includes("\n")) {
439
+ const bytesRead = fs.readSync(0, buffer, 0, buffer.length, null);
440
+
441
+ if (bytesRead === 0) {
442
+ return null;
443
+ }
444
+
445
+ answer += buffer.toString("utf8", 0, bytesRead);
446
+ }
447
+
448
+ return answer.trim().toLowerCase();
449
+ }
450
+
451
+ function warnForNonAutoOrientationConfig(orientation, RESIZEABLE_ACTIVITY) {
452
+ if (orientation === "auto" && RESIZEABLE_ACTIVITY === true) {
453
+ return;
454
+ }
455
+
456
+ console.warn(`
457
+ ⚠️ WARNING: Android orientation/resizable settings are not set to the recommended values.
458
+
459
+ Current:
460
+ android.ORIENTATION: ${orientation}
461
+ android.RESIZEABLE_ACTIVITY: ${RESIZEABLE_ACTIVITY}
462
+
463
+ Recommended:
464
+ android.ORIENTATION: auto
465
+ android.RESIZEABLE_ACTIVITY: true
466
+
467
+ Press Enter, y, or yes to continue.
468
+ Press n, no, or not to stop the build.
469
+ `);
470
+
471
+ while (true) {
472
+ const answer = readBuildConfirmationInput("Continue build? (Y/n): ");
473
+
474
+ if (answer === "" || answer === "y" || answer === "yes") {
475
+ console.log("✅ Continuing build...");
476
+ return;
477
+ }
478
+
479
+ if (answer === null) {
480
+ console.log("❌ Build cancelled because no user input was received.");
481
+ process.exit(1);
482
+ }
483
+
484
+ if (answer === "n" || answer === "no" || answer === "not") {
485
+ console.log("❌ Build cancelled due to orientation/resizable settings.");
486
+ process.exit(1);
487
+ }
488
+
489
+ console.log("Please enter y, yes, n, no, not, or press Enter.");
490
+ }
491
+ }
492
+
431
493
  checkAppUniqueId();
432
494
 
433
495
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeplay-common",
3
- "version": "4.2.2",
3
+ "version": "4.2.3",
4
4
  "description": "Common build scripts and files",
5
5
  "scripts": {
6
6
  "postinstall": "node scripts/sync-files.js",
@@ -13,4 +13,3 @@
13
13
  "author": "Codeplay Technologies",
14
14
  "license": "MIT"
15
15
  }
16
-