@icarusmx/creta 0.7.0 → 0.7.2

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.
Files changed (2) hide show
  1. package/bin/creta.js +21 -4
  2. package/package.json +1 -1
package/bin/creta.js CHANGED
@@ -579,12 +579,29 @@ function showHelp() {
579
579
  }
580
580
 
581
581
  async function startEnunciadosSelector() {
582
- // Check if we have a proper TTY for interactive mode
583
- if (!process.stdin.isTTY || !process.stdin.setRawMode) {
584
- // Fallback to numbered selection
585
- return await startEnunciadosSelectorFallback()
582
+ // Debug TTY detection
583
+ const hasSetRawMode = typeof process.stdin.setRawMode === 'function'
584
+ const isOutputTTY = process.stdout.isTTY
585
+ const isInputTTY = process.stdin.isTTY
586
+
587
+ // DEBUG: Show detection values for troubleshooting
588
+ console.log(`DEBUG: hasSetRawMode=${hasSetRawMode}, isOutputTTY=${isOutputTTY}, isInputTTY=${isInputTTY}`)
589
+
590
+ // Try interactive mode unless explicitly disabled
591
+ if (hasSetRawMode && !process.env.CRETA_NO_INTERACTIVE) {
592
+ try {
593
+ return await startEnunciadosSelectorInteractive()
594
+ } catch (error) {
595
+ // If interactive mode fails, fall back to numbered selection
596
+ console.log('\nCambiando a modo de selección numérica...\n')
597
+ }
586
598
  }
587
599
 
600
+ // Fallback to numbered selection
601
+ return await startEnunciadosSelectorFallback()
602
+ }
603
+
604
+ async function startEnunciadosSelectorInteractive() {
588
605
  console.log("\n🧠 Los 6 Enunciados Fundamentales de Programación Orientada a Objetos")
589
606
  console.log("=" .repeat(70))
590
607
  console.log("¿Cuál de estos enunciados te genera más 'ruido' (curiosidad/confusión)?")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icarusmx/creta",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Salgamos de este laberinto.",
5
5
  "type": "module",
6
6
  "bin": {