@icarusmx/creta 1.5.4 → 1.5.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.
- package/bin/creta.js +44 -3
- package/lib/aws-guide-viewer.js +179 -0
- package/lib/builders/MenuBuilder.js +23 -4
- package/lib/executors/ExercisesExecutor.js +8 -0
- package/lib/exercises/array-object-manipulation.md +1281 -0
- package/lib/exercises/aws-billing-detective.md +588 -0
- package/lib/exercises/git-stash-workflow.md +426 -0
- package/lib/exercises/iterm2-pane-navigation.md +504 -0
- package/lib/exercises/railway-deployment.md +1185 -0
- package/lib/papers/bitcoin/bitcoin.md +92 -0
- package/lib/papers/mapreduce/mapreduce.md +476 -0
- package/lib/papers/spark/spark.md +49 -0
- package/lib/vim-setup-tutorial.js +367 -0
- package/package.json +5 -1
- package/ascii-logo.txt +0 -8
- package/codex-refactor.txt +0 -13
- package/docs/diagrams/README.md +0 -131
- package/docs/diagrams/architecture-overview.mmd +0 -71
- package/docs/diagrams/architecture.svg +0 -1
- package/docs/diagrams/ecosystem-integration.mmd +0 -49
- package/docs/diagrams/evolution-phases.mmd +0 -49
- package/docs/diagrams/output.svg +0 -1
- package/docs/diagrams/phase2-command-help-flow.mmd +0 -51
- package/docs/diagrams/user-journey.mmd +0 -78
- package/ejemplo.sh +0 -3
- package/refactor.txt +0 -581
- package/templates/sveltekit-portfolio/package.json +0 -20
- package/templates/sveltekit-portfolio/src/app.css +0 -51
- package/templates/sveltekit-portfolio/src/app.html +0 -12
- package/templates/sveltekit-portfolio/src/routes/+layout.svelte +0 -108
- package/templates/sveltekit-portfolio/src/routes/+page.svelte +0 -79
- package/templates/sveltekit-portfolio/static/favicon.png +0 -0
- package/templates/sveltekit-portfolio/svelte.config.js +0 -10
- package/templates/sveltekit-portfolio/vite.config.js +0 -10
- package/test/enunciados.test.js +0 -72
- package/test/sintaxis-menu.test.js +0 -45
- package/wea-fome-qlia.sh +0 -92
|
@@ -0,0 +1,367 @@
|
|
|
1
|
+
import { createInterface } from 'readline'
|
|
2
|
+
import { execSync } from 'child_process'
|
|
3
|
+
import chalk from 'chalk'
|
|
4
|
+
|
|
5
|
+
export class VimSetupTutorial {
|
|
6
|
+
constructor() {
|
|
7
|
+
this.rl = null
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async start() {
|
|
11
|
+
this.rl = createInterface({
|
|
12
|
+
input: process.stdin,
|
|
13
|
+
output: process.stdout
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
try {
|
|
17
|
+
await this.showWelcome()
|
|
18
|
+
await this.checkPrerequisites()
|
|
19
|
+
await this.showFeatures()
|
|
20
|
+
await this.showInstallationOptions()
|
|
21
|
+
await this.showEssentialKeybindings()
|
|
22
|
+
await this.showFirstWorkflow()
|
|
23
|
+
await this.showHelpResources()
|
|
24
|
+
await this.completion()
|
|
25
|
+
} catch (error) {
|
|
26
|
+
console.error('\n❌ Error en el tutorial:', error.message)
|
|
27
|
+
} finally {
|
|
28
|
+
this.rl.close()
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async showWelcome() {
|
|
33
|
+
console.clear()
|
|
34
|
+
console.log(chalk.cyan('\n🏛️ Creta Vim - Configuración Oficial de Neovim'))
|
|
35
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
36
|
+
console.log('\nCreta Vim es una distribución de LazyVim optimizada para')
|
|
37
|
+
console.log('el stack de Icarus, con tema personalizado, plugins esenciales')
|
|
38
|
+
console.log('y documentación en español.')
|
|
39
|
+
console.log('\n' + chalk.italic('"Salgamos de este laberinto" 🏛️'))
|
|
40
|
+
|
|
41
|
+
await this.pressEnter('\nPresiona Enter para comenzar...')
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
async checkPrerequisites() {
|
|
45
|
+
console.clear()
|
|
46
|
+
console.log(chalk.cyan('\n📋 Verificando Requisitos'))
|
|
47
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
48
|
+
console.log('\nCreta Vim requiere las siguientes herramientas:\n')
|
|
49
|
+
|
|
50
|
+
const checks = []
|
|
51
|
+
|
|
52
|
+
// Check Neovim
|
|
53
|
+
try {
|
|
54
|
+
const nvimVersion = execSync('nvim --version 2>/dev/null | head -n1', { encoding: 'utf8' }).trim()
|
|
55
|
+
checks.push({
|
|
56
|
+
name: 'Neovim',
|
|
57
|
+
status: 'ok',
|
|
58
|
+
version: nvimVersion.replace('NVIM v', ''),
|
|
59
|
+
required: '>= 0.10.0'
|
|
60
|
+
})
|
|
61
|
+
} catch (error) {
|
|
62
|
+
checks.push({
|
|
63
|
+
name: 'Neovim',
|
|
64
|
+
status: 'missing',
|
|
65
|
+
required: '>= 0.10.0',
|
|
66
|
+
install: 'macOS: brew install neovim | Linux: https://github.com/neovim/neovim/releases'
|
|
67
|
+
})
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
// Check Git
|
|
71
|
+
try {
|
|
72
|
+
const gitVersion = execSync('git --version 2>/dev/null', { encoding: 'utf8' }).trim()
|
|
73
|
+
checks.push({
|
|
74
|
+
name: 'Git',
|
|
75
|
+
status: 'ok',
|
|
76
|
+
version: gitVersion.replace('git version ', ''),
|
|
77
|
+
required: '>= 2.19.0'
|
|
78
|
+
})
|
|
79
|
+
} catch (error) {
|
|
80
|
+
checks.push({
|
|
81
|
+
name: 'Git',
|
|
82
|
+
status: 'missing',
|
|
83
|
+
required: '>= 2.19.0',
|
|
84
|
+
install: 'https://git-scm.com/downloads'
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
// Check Node.js
|
|
89
|
+
try {
|
|
90
|
+
const nodeVersion = execSync('node --version 2>/dev/null', { encoding: 'utf8' }).trim()
|
|
91
|
+
checks.push({
|
|
92
|
+
name: 'Node.js',
|
|
93
|
+
status: 'ok',
|
|
94
|
+
version: nodeVersion,
|
|
95
|
+
required: '>= 18.0.0'
|
|
96
|
+
})
|
|
97
|
+
} catch (error) {
|
|
98
|
+
checks.push({
|
|
99
|
+
name: 'Node.js',
|
|
100
|
+
status: 'warning',
|
|
101
|
+
required: '>= 18.0.0',
|
|
102
|
+
note: 'Necesario para LSP servers (autocompletado, errores, etc.)',
|
|
103
|
+
install: 'https://nodejs.org'
|
|
104
|
+
})
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// Check Nerd Font (optional but recommended)
|
|
108
|
+
checks.push({
|
|
109
|
+
name: 'Nerd Font',
|
|
110
|
+
status: 'recommended',
|
|
111
|
+
note: 'Necesario para iconos en la interfaz',
|
|
112
|
+
install: 'https://www.nerdfonts.com/font-downloads (recomendado: JetBrains Mono)'
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
// Display results
|
|
116
|
+
checks.forEach(check => {
|
|
117
|
+
if (check.status === 'ok') {
|
|
118
|
+
console.log(chalk.green('✓') + ` ${check.name}: ${check.version}`)
|
|
119
|
+
} else if (check.status === 'missing') {
|
|
120
|
+
console.log(chalk.red('✗') + ` ${check.name}: No instalado`)
|
|
121
|
+
console.log(chalk.gray(` Requerido: ${check.required}`))
|
|
122
|
+
console.log(chalk.gray(` Instalar: ${check.install}`))
|
|
123
|
+
} else if (check.status === 'warning') {
|
|
124
|
+
console.log(chalk.yellow('⚠') + ` ${check.name}: No instalado (opcional pero recomendado)`)
|
|
125
|
+
console.log(chalk.gray(` ${check.note}`))
|
|
126
|
+
console.log(chalk.gray(` Instalar: ${check.install}`))
|
|
127
|
+
} else if (check.status === 'recommended') {
|
|
128
|
+
console.log(chalk.yellow('💡') + ` ${check.name}: Recomendado`)
|
|
129
|
+
console.log(chalk.gray(` ${check.note}`))
|
|
130
|
+
console.log(chalk.gray(` Instalar: ${check.install}`))
|
|
131
|
+
}
|
|
132
|
+
console.log()
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
const missingRequired = checks.filter(c => c.status === 'missing')
|
|
136
|
+
if (missingRequired.length > 0) {
|
|
137
|
+
console.log(chalk.red('\n⚠️ Instala las herramientas requeridas antes de continuar.'))
|
|
138
|
+
console.log(chalk.gray(' Una vez instaladas, vuelve a ejecutar: creta'))
|
|
139
|
+
process.exit(1)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
await this.pressEnter('Presiona Enter para continuar...')
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async showFeatures() {
|
|
146
|
+
console.clear()
|
|
147
|
+
console.log(chalk.cyan('\n✨ Características de Creta Vim'))
|
|
148
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
149
|
+
|
|
150
|
+
console.log('\n' + chalk.bold('🎨 Estética Icarus'))
|
|
151
|
+
console.log(' • Tema: Kanagawa Wave (modo transparente)')
|
|
152
|
+
console.log(' • Welcome screen personalizada de Creta')
|
|
153
|
+
console.log(' • Iconos con Nerd Fonts')
|
|
154
|
+
|
|
155
|
+
console.log('\n' + chalk.bold('🚀 Optimizado para el Stack de Icarus'))
|
|
156
|
+
console.log(' • SvelteKit 5: Syntax highlighting, LSP, snippets')
|
|
157
|
+
console.log(' • Tailwind CSS 4: Autocompletado, preview de colores')
|
|
158
|
+
console.log(' • JavaScript/Node.js: ESLint, Prettier, debugging')
|
|
159
|
+
|
|
160
|
+
console.log('\n' + chalk.bold('📦 Plugins Pre-configurados'))
|
|
161
|
+
console.log(' • Telescope: Búsqueda rápida de archivos')
|
|
162
|
+
console.log(' • Neotree: Explorador de archivos')
|
|
163
|
+
console.log(' • Gitsigns: Indicadores de Git')
|
|
164
|
+
console.log(' • Markdown: Renderizado inline + preview')
|
|
165
|
+
console.log(' • LSP: TypeScript, Svelte, Tailwind, Lua')
|
|
166
|
+
|
|
167
|
+
console.log('\n' + chalk.bold('📚 Documentación en Español'))
|
|
168
|
+
console.log(' • Cheatsheet de keybindings')
|
|
169
|
+
console.log(' • Tutoriales integrados')
|
|
170
|
+
console.log(' • Mensajes de ayuda traducidos')
|
|
171
|
+
|
|
172
|
+
await this.pressEnter('\nPresiona Enter para ver opciones de instalación...')
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
async showInstallationOptions() {
|
|
176
|
+
console.clear()
|
|
177
|
+
console.log(chalk.cyan('\n🚀 Opciones de Instalación'))
|
|
178
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
179
|
+
|
|
180
|
+
console.log('\n' + chalk.bold('Opción 1: Instalación Limpia') + chalk.gray(' (Recomendado para nuevos estudiantes)'))
|
|
181
|
+
console.log('\n' + chalk.gray('# Respaldar configuración actual (si existe)'))
|
|
182
|
+
console.log(chalk.yellow('mv ~/.config/nvim ~/.config/nvim.backup'))
|
|
183
|
+
console.log(chalk.yellow('mv ~/.local/share/nvim ~/.local/share/nvim.backup'))
|
|
184
|
+
console.log('\n' + chalk.gray('# Clonar Creta Vim'))
|
|
185
|
+
console.log(chalk.yellow('git clone https://github.com/icarusmx/creta-vim.git ~/.config/nvim'))
|
|
186
|
+
console.log('\n' + chalk.gray('# Abrir Neovim (instalará plugins automáticamente)'))
|
|
187
|
+
console.log(chalk.yellow('nvim'))
|
|
188
|
+
|
|
189
|
+
console.log('\n' + chalk.bold('Primera vez:'))
|
|
190
|
+
console.log(' • Lazy.nvim instalará todos los plugins (~2 minutos)')
|
|
191
|
+
console.log(' • Mason instalará LSP servers automáticamente')
|
|
192
|
+
console.log(' • Presiona `q` cuando termine')
|
|
193
|
+
console.log(' • Reinicia Nvim: `:q` y vuelve a abrir `nvim`')
|
|
194
|
+
|
|
195
|
+
console.log('\n' + chalk.gray('─'.repeat(60)))
|
|
196
|
+
|
|
197
|
+
console.log('\n' + chalk.bold('Opción 2: Probar sin Afectar tu Configuración'))
|
|
198
|
+
console.log('\n' + chalk.gray('# Clonar en directorio temporal'))
|
|
199
|
+
console.log(chalk.yellow('git clone https://github.com/icarusmx/creta-vim.git ~/creta-vim-test'))
|
|
200
|
+
console.log('\n' + chalk.gray('# Abrir con configuración aislada'))
|
|
201
|
+
console.log(chalk.yellow('NVIM_APPNAME=creta-vim-test nvim'))
|
|
202
|
+
console.log('\n' + chalk.gray('Esto no toca tu configuración actual de Nvim.'))
|
|
203
|
+
|
|
204
|
+
await this.pressEnter('\nPresiona Enter para ver keybindings esenciales...')
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
async showEssentialKeybindings() {
|
|
208
|
+
console.clear()
|
|
209
|
+
console.log(chalk.cyan('\n⌨️ Keybindings Esenciales'))
|
|
210
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
211
|
+
|
|
212
|
+
console.log('\n' + chalk.bold('General'))
|
|
213
|
+
const generalBindings = [
|
|
214
|
+
['<leader>', 'Space (tecla líder)'],
|
|
215
|
+
['<leader><leader>', 'Buscar archivos (Telescope)'],
|
|
216
|
+
['<leader>e', 'Toggle explorador de archivos'],
|
|
217
|
+
['<leader>ff', 'Buscar archivos por nombre'],
|
|
218
|
+
['<leader>fg', 'Buscar texto en proyecto (grep)'],
|
|
219
|
+
]
|
|
220
|
+
this.displayTable(generalBindings)
|
|
221
|
+
|
|
222
|
+
console.log('\n' + chalk.bold('Navegación'))
|
|
223
|
+
const navBindings = [
|
|
224
|
+
['Ctrl+h/j/k/l', 'Navegar entre ventanas'],
|
|
225
|
+
['<leader>sv', 'Split vertical'],
|
|
226
|
+
['<leader>sh', 'Split horizontal'],
|
|
227
|
+
['gd', 'Ir a definición'],
|
|
228
|
+
['gr', 'Ver referencias'],
|
|
229
|
+
['K', 'Mostrar documentación (hover)'],
|
|
230
|
+
]
|
|
231
|
+
this.displayTable(navBindings)
|
|
232
|
+
|
|
233
|
+
console.log('\n' + chalk.bold('Edición'))
|
|
234
|
+
const editBindings = [
|
|
235
|
+
['gcc', 'Comentar/descomentar línea'],
|
|
236
|
+
['gc (visual)', 'Comentar selección'],
|
|
237
|
+
['<leader>ca', 'Code actions (refactors)'],
|
|
238
|
+
['<leader>rn', 'Renombrar símbolo'],
|
|
239
|
+
]
|
|
240
|
+
this.displayTable(editBindings)
|
|
241
|
+
|
|
242
|
+
console.log('\n' + chalk.bold('Git'))
|
|
243
|
+
const gitBindings = [
|
|
244
|
+
['<leader>gg', 'Abrir Lazygit'],
|
|
245
|
+
[']h', 'Siguiente cambio (hunk)'],
|
|
246
|
+
['[h', 'Anterior cambio (hunk)'],
|
|
247
|
+
['<leader>gp', 'Preview cambio'],
|
|
248
|
+
]
|
|
249
|
+
this.displayTable(gitBindings)
|
|
250
|
+
|
|
251
|
+
await this.pressEnter('\nPresiona Enter para ver tu primer flujo de trabajo...')
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
async showFirstWorkflow() {
|
|
255
|
+
console.clear()
|
|
256
|
+
console.log(chalk.cyan('\n🎓 Tu Primer Flujo de Trabajo'))
|
|
257
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
258
|
+
|
|
259
|
+
console.log('\n' + chalk.bold('1. Familiarízate con los modos:'))
|
|
260
|
+
console.log(' • ' + chalk.yellow('Normal') + ' - Navegación (ESC para volver aquí)')
|
|
261
|
+
console.log(' • ' + chalk.yellow('Insert') + ' - Edición (i, a, o para entrar)')
|
|
262
|
+
console.log(' • ' + chalk.yellow('Visual') + ' - Selección (v para entrar)')
|
|
263
|
+
console.log(' • ' + chalk.yellow('Command') + ' - Comandos (: para entrar)')
|
|
264
|
+
|
|
265
|
+
console.log('\n' + chalk.bold('2. Practica navegación básica:'))
|
|
266
|
+
console.log(' • ' + chalk.yellow('h j k l') + ' → ← ↓ ↑')
|
|
267
|
+
console.log(' • ' + chalk.yellow('w b') + ' → Siguiente/anterior palabra')
|
|
268
|
+
console.log(' • ' + chalk.yellow('gg G') + ' → Inicio/fin de archivo')
|
|
269
|
+
console.log(' • ' + chalk.yellow('Ctrl+d/u') + ' → Media página abajo/arriba')
|
|
270
|
+
|
|
271
|
+
console.log('\n' + chalk.bold('3. Flujo completo de edición:'))
|
|
272
|
+
const workflow = [
|
|
273
|
+
['1.', 'nvim', 'Abrir Nvim'],
|
|
274
|
+
['2.', 'Space Space', 'Buscar archivo'],
|
|
275
|
+
['3.', 'Type filename', 'Escribir nombre'],
|
|
276
|
+
['4.', 'Enter', 'Abrir archivo'],
|
|
277
|
+
['5.', 'i', 'Entrar a modo Insert'],
|
|
278
|
+
['6.', '(editar código)', ''],
|
|
279
|
+
['7.', 'Esc', 'Volver a Normal'],
|
|
280
|
+
['8.', ':w', 'Guardar'],
|
|
281
|
+
['9.', 'Space e', 'Ver archivos'],
|
|
282
|
+
['10.', ':q', 'Salir'],
|
|
283
|
+
]
|
|
284
|
+
|
|
285
|
+
console.log()
|
|
286
|
+
workflow.forEach(([step, command, description]) => {
|
|
287
|
+
const stepStr = chalk.gray(step.padEnd(4))
|
|
288
|
+
const cmdStr = chalk.yellow(command.padEnd(20))
|
|
289
|
+
const descStr = description
|
|
290
|
+
console.log(` ${stepStr}${cmdStr}${descStr}`)
|
|
291
|
+
})
|
|
292
|
+
|
|
293
|
+
await this.pressEnter('\nPresiona Enter para ver recursos de ayuda...')
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
async showHelpResources() {
|
|
297
|
+
console.clear()
|
|
298
|
+
console.log(chalk.cyan('\n🆘 Recursos de Ayuda'))
|
|
299
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
300
|
+
|
|
301
|
+
console.log('\n' + chalk.bold('Dentro de Nvim:'))
|
|
302
|
+
console.log(' ' + chalk.yellow(':help creta') + ' - Ayuda de Creta Vim')
|
|
303
|
+
console.log(' ' + chalk.yellow(':Lazy') + ' - Ver/actualizar plugins')
|
|
304
|
+
console.log(' ' + chalk.yellow(':Mason') + ' - Ver/instalar LSP servers')
|
|
305
|
+
console.log(' ' + chalk.yellow(':checkhealth') + ' - Diagnosticar problemas')
|
|
306
|
+
console.log(' ' + chalk.yellow(':LspInfo') + ' - Ver LSP servers activos')
|
|
307
|
+
|
|
308
|
+
console.log('\n' + chalk.bold('Tutoriales integrados:'))
|
|
309
|
+
console.log(' ' + chalk.yellow(':Tutor') + ' - Tutorial oficial de Vim (español)')
|
|
310
|
+
console.log(' ' + chalk.yellow(':CretaBasics') + ' - Básicos de Creta Vim')
|
|
311
|
+
console.log(' ' + chalk.yellow(':CretaGit') + ' - Flujo de Git con Lazygit')
|
|
312
|
+
console.log(' ' + chalk.yellow(':CretaSvelte') + ' - Editar SvelteKit como pro')
|
|
313
|
+
|
|
314
|
+
console.log('\n' + chalk.bold('Problemas Comunes:'))
|
|
315
|
+
|
|
316
|
+
console.log('\n ' + chalk.red('LSP no funciona:'))
|
|
317
|
+
console.log(' ' + chalk.yellow(':Mason'))
|
|
318
|
+
console.log(' ' + chalk.gray('Buscar e instalar: vtsls, svelte-language-server, tailwindcss-language-server'))
|
|
319
|
+
|
|
320
|
+
console.log('\n ' + chalk.red('Iconos no se ven bien:'))
|
|
321
|
+
console.log(' ' + chalk.gray('Instala una Nerd Font: https://www.nerdfonts.com'))
|
|
322
|
+
console.log(' ' + chalk.gray('Configura tu terminal para usarla'))
|
|
323
|
+
|
|
324
|
+
console.log('\n ' + chalk.red('Plugins no cargan:'))
|
|
325
|
+
console.log(' ' + chalk.yellow(':Lazy sync') + ' ' + chalk.gray('- Sincronizar plugins'))
|
|
326
|
+
console.log(' ' + chalk.yellow(':Lazy clean') + ' ' + chalk.gray('- Limpiar plugins no usados'))
|
|
327
|
+
|
|
328
|
+
await this.pressEnter('\nPresiona Enter para finalizar...')
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
async completion() {
|
|
332
|
+
console.clear()
|
|
333
|
+
console.log(chalk.cyan('\n🎉 ¡Listo para comenzar!'))
|
|
334
|
+
console.log(chalk.gray('═'.repeat(60)))
|
|
335
|
+
|
|
336
|
+
console.log('\n' + chalk.bold('Próximos pasos:'))
|
|
337
|
+
console.log(' 1. Elige una opción de instalación (arriba)')
|
|
338
|
+
console.log(' 2. Sigue los comandos de instalación')
|
|
339
|
+
console.log(' 3. Abre Neovim: ' + chalk.yellow('nvim'))
|
|
340
|
+
console.log(' 4. Espera a que Mason instale LSP servers (~1 min)')
|
|
341
|
+
console.log(' 5. Reinicia Neovim')
|
|
342
|
+
console.log(' 6. ¡Comienza a programar!')
|
|
343
|
+
|
|
344
|
+
console.log('\n' + chalk.bold('Enlaces útiles:'))
|
|
345
|
+
console.log(' • README completo: https://github.com/icarusmx/creta-vim')
|
|
346
|
+
console.log(' • Creta CLI: ' + chalk.yellow('creta') + ' (este programa)')
|
|
347
|
+
console.log(' • Comunidad Icarus: https://icarus.mx')
|
|
348
|
+
|
|
349
|
+
console.log('\n' + chalk.gray('Hecho con <3 por icarus.mx') + ' - Salgamos de este laberinto 🏛️')
|
|
350
|
+
console.log()
|
|
351
|
+
}
|
|
352
|
+
|
|
353
|
+
displayTable(rows) {
|
|
354
|
+
const maxKeyLength = Math.max(...rows.map(([key]) => key.length))
|
|
355
|
+
rows.forEach(([key, value]) => {
|
|
356
|
+
console.log(' ' + chalk.yellow(key.padEnd(maxKeyLength + 2)) + value)
|
|
357
|
+
})
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
async pressEnter(message = '\nPresiona Enter para continuar...') {
|
|
361
|
+
return new Promise((resolve) => {
|
|
362
|
+
this.rl.question(chalk.gray(message), () => {
|
|
363
|
+
resolve()
|
|
364
|
+
})
|
|
365
|
+
})
|
|
366
|
+
}
|
|
367
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icarusmx/creta",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.7",
|
|
4
4
|
"description": "Salgamos de este laberinto.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"creta": "./bin/creta.js"
|
|
8
8
|
},
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"lib/"
|
|
12
|
+
],
|
|
9
13
|
"keywords": [
|
|
10
14
|
"cli",
|
|
11
15
|
"icarus",
|
package/ascii-logo.txt
DELETED
package/codex-refactor.txt
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
# creta cli refactor - progress log
|
|
2
|
-
|
|
3
|
-
## 2025-02-14
|
|
4
|
-
- restored `bin/creta.js` to the original working version so the CLI behaved correctly again.
|
|
5
|
-
- extracted reusable data for the welcome banner, help text, and enunciados into `lib/data/messages.js` and `lib/data/enunciados.js`.
|
|
6
|
-
- added initial utilities (`lib/utils/input.js`, `lib/utils/output.js`, `lib/utils/file-utils.js`) plus `lib/templates/LevelModifier.js` to reuse template logic.
|
|
7
|
-
|
|
8
|
-
## 2025-02-15
|
|
9
|
-
- introduced Discord-style builders (`lib/builders/MenuBuilder.js`, `lib/builders/ProjectBuilder.js`).
|
|
10
|
-
- defined menu configurations in `lib/data/menus.js` and template paths in `lib/constants/paths.js`.
|
|
11
|
-
- created executors for enunciados, sintaxis, proyectos, and portafolio to encapsulate orchestration logic.
|
|
12
|
-
- added `lib/cli/index.js` as the central command router and reduced `bin/creta.js` to a minimal entry point (<20 lines).
|
|
13
|
-
- verified primary commands (`help`, `portafolio-*`, invalid command handling) after restructuring.
|
package/docs/diagrams/README.md
DELETED
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
# Creta Diagrams
|
|
2
|
-
|
|
3
|
-
Visual documentation for the Creta CLI evolution and architecture.
|
|
4
|
-
|
|
5
|
-
## Diagrams
|
|
6
|
-
|
|
7
|
-
### 1. Evolution Phases (`evolution-phases.mmd`)
|
|
8
|
-
**What it shows:** The three phases of Creta's evolution and how features stack as users grow.
|
|
9
|
-
|
|
10
|
-
- Phase 1 (Aprendiz): Interactive learning, curriculum, portfolio generation
|
|
11
|
-
- Phase 2 (Desarrollador): Command help system, quick references
|
|
12
|
-
- Phase 3 (Constructor): Authentication, ticket management, team workflow
|
|
13
|
-
|
|
14
|
-
**Key insight:** Users never lose access to previous phase features - they accumulate capabilities.
|
|
15
|
-
|
|
16
|
-
---
|
|
17
|
-
|
|
18
|
-
### 2. Architecture Overview (`architecture-overview.mmd`)
|
|
19
|
-
**What it shows:** Technical architecture across all three phases.
|
|
20
|
-
|
|
21
|
-
**Phase 1 (Current - v1.4.16):**
|
|
22
|
-
- Builders, Executors, Data, Sandbox, Utils structure
|
|
23
|
-
- Interactive practice system components
|
|
24
|
-
- Lesson management architecture
|
|
25
|
-
|
|
26
|
-
**Phase 2 (In Development - v1.5.0):**
|
|
27
|
-
- Command routing logic
|
|
28
|
-
- Help system integration
|
|
29
|
-
- CommandHelpFormatter structure
|
|
30
|
-
|
|
31
|
-
**Phase 3 (Vision - v2.0.0+):**
|
|
32
|
-
- Authentication layer
|
|
33
|
-
- API client for team workspace
|
|
34
|
-
- Workflow management system
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
### 3. User Journey (`user-journey.mmd`)
|
|
39
|
-
**What it shows:** Complete user flow from student to professional developer.
|
|
40
|
-
|
|
41
|
-
**Journey stages:**
|
|
42
|
-
1. Join Discord → Install Node → Run Creta
|
|
43
|
-
2. Interactive practice → Complete lessons → Get hashes
|
|
44
|
-
3. Redeem hashes → Watch videos → Learn more
|
|
45
|
-
4. Build portfolio → Share → Graduate
|
|
46
|
-
5. Use command help as junior dev
|
|
47
|
-
6. Join professional team → Authenticated workflow
|
|
48
|
-
|
|
49
|
-
**Loops:**
|
|
50
|
-
- Learning loop: Discord ↔ CLI ↔ YouTube
|
|
51
|
-
- Development loop: Code → Need help → `creta ls` → Continue
|
|
52
|
-
- Professional loop: Check requirements → Work → Submit → Repeat
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
### 4. Phase 2 Command Help Flow (`phase2-command-help-flow.mmd`)
|
|
57
|
-
**What it shows:** Detailed sequence diagram for the command help system (v1.5.0).
|
|
58
|
-
|
|
59
|
-
**Flow:**
|
|
60
|
-
1. User types `creta ls`
|
|
61
|
-
2. Router detects command help request
|
|
62
|
-
3. Load help content from data store
|
|
63
|
-
4. Format with chalk (colors, spacing, structure)
|
|
64
|
-
5. Display to user
|
|
65
|
-
|
|
66
|
-
**Handles:**
|
|
67
|
-
- Regular commands: `creta ls`
|
|
68
|
-
- Git subcommands: `creta git status`
|
|
69
|
-
- Unknown commands: Fall back to main menu
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
### 5. Ecosystem Integration (`ecosystem-integration.mmd`)
|
|
74
|
-
**What it shows:** How Creta integrates with the broader Icarus ecosystem.
|
|
75
|
-
|
|
76
|
-
**Components:**
|
|
77
|
-
- **Discord:** Community hub, hash redemption
|
|
78
|
-
- **YouTube:** Hidden educational videos
|
|
79
|
-
- **Scythe:** Token rewards (ERC-20)
|
|
80
|
-
- **Constructor Network:** Professional community
|
|
81
|
-
|
|
82
|
-
**Flows:**
|
|
83
|
-
- Learning loop (Discord → CLI → YouTube)
|
|
84
|
-
- Economic layer (Milestones → Tokens → Governance)
|
|
85
|
-
- Graduation path (NFT certificates → Professional network)
|
|
86
|
-
- Phase evolution (Aprendiz → Desarrollador → Constructor)
|
|
87
|
-
|
|
88
|
-
---
|
|
89
|
-
|
|
90
|
-
## How to View
|
|
91
|
-
|
|
92
|
-
### Online Viewers:
|
|
93
|
-
1. **Mermaid Live Editor:** https://mermaid.live/
|
|
94
|
-
- Copy/paste diagram content
|
|
95
|
-
- Export as PNG/SVG
|
|
96
|
-
|
|
97
|
-
2. **GitHub/GitLab:**
|
|
98
|
-
- These platforms render `.mmd` files automatically
|
|
99
|
-
- Just view the file in the repo
|
|
100
|
-
|
|
101
|
-
3. **VS Code:**
|
|
102
|
-
- Install "Markdown Preview Mermaid Support" extension
|
|
103
|
-
- Open `.mmd` file and use preview
|
|
104
|
-
|
|
105
|
-
### CLI Tool:
|
|
106
|
-
```bash
|
|
107
|
-
# Install mermaid-cli
|
|
108
|
-
npm install -g @mermaid-js/mermaid-cli
|
|
109
|
-
|
|
110
|
-
# Generate PNG
|
|
111
|
-
mmdc -i evolution-phases.mmd -o evolution-phases.png
|
|
112
|
-
|
|
113
|
-
# Generate SVG
|
|
114
|
-
mmdc -i architecture-overview.mmd -o architecture-overview.svg
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
## Usage in Documentation
|
|
120
|
-
|
|
121
|
-
These diagrams can be embedded in:
|
|
122
|
-
- README.md (link to rendered versions)
|
|
123
|
-
- ROADMAP.md (show evolution timeline)
|
|
124
|
-
- CLAUDE.md (help AI understand architecture)
|
|
125
|
-
- Presentations (export as images)
|
|
126
|
-
- GitHub wiki/docs
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
**Created:** 2025-10-15
|
|
131
|
-
**Maintained by:** Icarus Dev Team
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
graph TB
|
|
2
|
-
subgraph "Phase 1 - LIVE v1.4.16"
|
|
3
|
-
CLI[bin/creta.js]
|
|
4
|
-
CLI --> MainCLI[lib/cli/index.js]
|
|
5
|
-
|
|
6
|
-
MainCLI --> Builders[lib/builders/]
|
|
7
|
-
Builders --> MenuBuilder[MenuBuilder.js]
|
|
8
|
-
Builders --> LessonBuilder[LessonBuilder.js]
|
|
9
|
-
|
|
10
|
-
MainCLI --> Executors[lib/executors/]
|
|
11
|
-
Executors --> SintaxisExec[SintaxisExecutor.js]
|
|
12
|
-
Executors --> EnunciadosExec[EnunciadosExecutor.js]
|
|
13
|
-
Executors --> ProyectosExec[ProyectosExecutor.js]
|
|
14
|
-
|
|
15
|
-
MainCLI --> Data[lib/data/]
|
|
16
|
-
Data --> Lessons[lessons/]
|
|
17
|
-
Lessons --> Enunciados[enunciados/ - 7 lessons]
|
|
18
|
-
Lessons --> Sintaxis[sintaxis/ - 4 lessons]
|
|
19
|
-
Data --> Menus[menus.js]
|
|
20
|
-
|
|
21
|
-
MainCLI --> Sandbox[lib/sandbox/]
|
|
22
|
-
Sandbox --> SandboxMgr[SandboxManager.js]
|
|
23
|
-
Sandbox --> CmdValidator[CommandValidator.js]
|
|
24
|
-
Sandbox --> CmdExecutor[CommandExecutor.js]
|
|
25
|
-
|
|
26
|
-
MainCLI --> Utils[lib/utils/]
|
|
27
|
-
Utils --> UserState[UserState.js]
|
|
28
|
-
Utils --> Greeting[greeting.js]
|
|
29
|
-
end
|
|
30
|
-
|
|
31
|
-
subgraph "Phase 2 - IN DEV v1.5.0"
|
|
32
|
-
CLI2[bin/creta.js]
|
|
33
|
-
CLI2 --> Router{Command Router}
|
|
34
|
-
Router -->|help request| HelpSystem[Help System]
|
|
35
|
-
Router -->|menu/project| MainCLI2[Existing CLI Logic]
|
|
36
|
-
|
|
37
|
-
HelpSystem --> CmdHelp[lib/data/command-help/]
|
|
38
|
-
CmdHelp --> BasicCmds[basic-commands/]
|
|
39
|
-
BasicCmds --> LS[ls.js]
|
|
40
|
-
BasicCmds --> CD[cd.js]
|
|
41
|
-
BasicCmds --> MKDIR[mkdir.js]
|
|
42
|
-
|
|
43
|
-
CmdHelp --> GitCmds[git/]
|
|
44
|
-
GitCmds --> Status[status.js]
|
|
45
|
-
GitCmds --> Add[add.js]
|
|
46
|
-
GitCmds --> Commit[commit.js]
|
|
47
|
-
|
|
48
|
-
HelpSystem --> Formatter[lib/formatters/]
|
|
49
|
-
Formatter --> HelpFormatter[CommandHelpFormatter.js]
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
subgraph "Phase 3 - VISION v2.0.0+"
|
|
53
|
-
CLI3[bin/creta.js]
|
|
54
|
-
CLI3 --> Router3{Authenticated Router}
|
|
55
|
-
Router3 --> AuthSystem[lib/auth/]
|
|
56
|
-
AuthSystem --> Login[login.js]
|
|
57
|
-
AuthSystem --> JWT[JWT Storage]
|
|
58
|
-
|
|
59
|
-
Router3 --> API[lib/api/]
|
|
60
|
-
API --> TeamAPI[Team Workspace API]
|
|
61
|
-
API --> TicketAPI[Ticket API]
|
|
62
|
-
|
|
63
|
-
Router3 --> WorkflowSys[lib/workflow/]
|
|
64
|
-
WorkflowSys --> Requirements[Requirements Manager]
|
|
65
|
-
WorkflowSys --> Status[Status Tracker]
|
|
66
|
-
WorkflowSys --> Submit[Submission Handler]
|
|
67
|
-
end
|
|
68
|
-
|
|
69
|
-
style CLI fill:#4ade80,stroke:#22c55e,color:#000
|
|
70
|
-
style CLI2 fill:#fbbf24,stroke:#f59e0b,color:#000
|
|
71
|
-
style CLI3 fill:#60a5fa,stroke:#3b82f6,color:#000
|