@icarusmx/creta 1.0.20 → 1.0.22

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/bin/creta.js CHANGED
@@ -768,7 +768,21 @@ async function startEnunciadosSelectorInteractive() {
768
768
  }
769
769
 
770
770
  console.log("Los enunciados fundamentales son un conjunto de afirmaciones que tienen el propósito de ejercitar el pensamiento orientado a objetos de los estudiantes de Creta. Escogimos estos enunciados porque creemos que exhaustan los conceptos mínimos necesarios para entender el paradigma de la programación orientada a objetos.")
771
- console.log("")
771
+
772
+ // Wait for user to press Enter before showing the list
773
+ const rl = createInterface({
774
+ input: process.stdin,
775
+ output: process.stdout
776
+ })
777
+
778
+ await new Promise((resolve) => {
779
+ rl.question("\nPresiona Enter para comenzar...", () => {
780
+ rl.close()
781
+ resolve()
782
+ })
783
+ })
784
+
785
+ console.log("\n\n")
772
786
  console.log("Elige qué enunciado te gustaría explorar:")
773
787
  console.log("")
774
788
 
@@ -989,7 +1003,10 @@ async function startEnunciadosSelectorFallback() {
989
1003
 
990
1004
  try {
991
1005
  console.log("Los enunciados fundamentales son un conjunto de afirmaciones que tienen el propósito de ejercitar el pensamiento orientado a objetos de los estudiantes de Creta. Escogimos estos enunciados porque creemos que exhaustan los conceptos mínimos necesarios para entender el paradigma de la programación orientada a objetos.")
992
- console.log("")
1006
+
1007
+ await askQuestion("\nPresiona Enter para comenzar...")
1008
+
1009
+ console.log("\n\n")
993
1010
  console.log("Elige qué enunciado te gustaría explorar:")
994
1011
  console.log("")
995
1012
 
@@ -115,7 +115,7 @@ export class Lesson1SystemDecomposition {
115
115
  }
116
116
  }`
117
117
 
118
- this.printCodeWithOutline("📄 Clase Book", bookCode)
118
+ this.printCodeWithColors("📄 Clase Book", bookCode)
119
119
 
120
120
  await this.waitForEnter("\nPresiona Enter para ver User...")
121
121
 
@@ -141,7 +141,7 @@ export class Lesson1SystemDecomposition {
141
141
  }
142
142
  }`
143
143
 
144
- this.printCodeWithOutline("📄 Clase User", userCode)
144
+ this.printCodeWithColors("📄 Clase User", userCode)
145
145
 
146
146
  await this.waitForEnter("\nPresiona Enter para ver Loan...")
147
147
 
@@ -171,7 +171,7 @@ export class Lesson1SystemDecomposition {
171
171
  }
172
172
  }`
173
173
 
174
- this.printCodeWithOutline("📄 Clase Loan", loanCode)
174
+ this.printCodeWithColors("📄 Clase Loan", loanCode)
175
175
 
176
176
  await this.waitForEnter("\nPresiona Enter para ver Library...")
177
177
 
@@ -284,22 +284,16 @@ export class Lesson1SystemDecomposition {
284
284
  .replace(/\/\/.*$/gm, `${colors.comment}$&${colors.reset}`)
285
285
  }
286
286
 
287
- printCodeWithOutline(title, code) {
288
- const border = '┌' + '─'.repeat(60) + '┐'
289
- const bottomBorder = '└' + '─'.repeat(60) + '┘'
290
- const titleLine = `│ ${title}${' '.repeat(60 - title.length - 1)}│`
291
-
292
- console.log(`\n${border}`)
293
- console.log(titleLine)
294
- console.log('├' + '─'.repeat(60) + '┤')
287
+ printCodeWithColors(title, code) {
288
+ console.log(`\n${title}`)
289
+ console.log("━".repeat(50))
295
290
 
296
291
  code.split('\n').forEach(line => {
297
292
  const formattedLine = this.formatCode(line)
298
- const padding = ' '.repeat(Math.max(0, 58 - line.length))
299
- console.log(`│ ${formattedLine}${padding}│`)
293
+ console.log(formattedLine)
300
294
  })
301
295
 
302
- console.log(bottomBorder)
296
+ console.log("━".repeat(50))
303
297
  }
304
298
 
305
299
  async waitForEnter(message) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icarusmx/creta",
3
- "version": "1.0.20",
3
+ "version": "1.0.22",
4
4
  "description": "Salgamos de este laberinto.",
5
5
  "type": "module",
6
6
  "bin": {