@icarusmx/creta 0.2.2 → 0.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.
Files changed (3) hide show
  1. package/CLAUDE.md +101 -8
  2. package/bin/creta.js +8 -2
  3. package/package.json +1 -1
package/CLAUDE.md CHANGED
@@ -4,22 +4,115 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
 
5
5
  ## Project Overview
6
6
 
7
- This is "@icarusmx/creta" - a minimal CLI tool for the Icarus software school. The project is currently in early development (v0.0.2) with basic structure in place.
7
+ This is "@icarusmx/creta" - a CLI tool for the Icarus software school that helps reconnect with former students by providing them with guided challenges to build personal portfolios. The tool generates SvelteKit 5 + Tailwind CSS 4 boilerplates with instructional comments in Spanish.
8
+
9
+ ## Purpose and Mission
10
+
11
+ Creta is a Spanish-speaking software school focused on learn-by-building approach. This CLI tool serves as a reconnection mechanism with former students, encouraging them to complete their education by building personal websites. The tool provides progressive difficulty levels where students can skip ahead or get solutions for different components.
8
12
 
9
13
  ## Architecture
10
14
 
11
- - **Entry point**: `bin/creta.js` - Simple Node.js CLI executable that outputs a welcome message
12
- - **Package**: Published as `@icarusmx/creta` on npm with public access
13
- - **Language**: JavaScript (no TypeScript)
15
+ - **Entry point**: `bin/creta.js` - Interactive Node.js CLI that collects student names and generates projects
16
+ - **Package**: Published as `@icarusmx/creta` on npm with public access (current version: 0.2.2)
17
+ - **Language**: JavaScript ES modules (no TypeScript)
18
+ - **Templates**: SvelteKit 5 + Tailwind CSS 4 portfolio boilerplate in `/templates/sveltekit-portfolio/`
14
19
 
15
- ## Development Commands
20
+ ## Available Commands
21
+
22
+ - `creta portafolio` - Full challenge with instructional comments (level 0)
23
+ - `creta portafolio-1` - Navbar completed (level 1)
24
+ - `creta portafolio-2` - Navbar + hero completed (level 2)
25
+ - `creta portafolio-3` - Complete solution (level 3)
26
+
27
+ ## Technology Stack
28
+
29
+ ### Frontend Template
30
+ - **SvelteKit 5**: Using new syntax with `{@render children?.()}` instead of `<slot />`
31
+ - **Tailwind CSS 4**: Using `@tailwindcss/vite` plugin (no config files needed)
32
+ - **Vite**: Build tool and dev server
33
+
34
+ ### Template Structure
35
+ ```
36
+ templates/sveltekit-portfolio/
37
+ ├── package.json # SvelteKit 5 + Tailwind 4 dependencies
38
+ ├── vite.config.js # Vite config with Tailwind plugin
39
+ ├── svelte.config.js # SvelteKit configuration
40
+ ├── src/
41
+ │ ├── app.html # HTML template
42
+ │ ├── app.css # Tailwind directives
43
+ │ └── routes/
44
+ │ ├── +layout.svelte # Layout with navbar/footer challenges
45
+ │ └── +page.svelte # Hero section challenge
46
+ └── static/
47
+ └── favicon.png
48
+ ```
49
+
50
+ ## Key Features
51
+
52
+ ### Interactive Project Generation
53
+ - Prompts for student name using readline interface
54
+ - Generates project directory named `{name}-portafolio`
55
+ - Replaces `{{STUDENT_NAME}}` and `{{PROJECT_NAME}}` placeholders
56
+ - Copies template files with level-specific modifications
16
57
 
17
- This is a minimal CLI project without build tools, testing frameworks, or linting configured yet. The main executable can be tested directly:
58
+ ### Progressive Difficulty System
59
+ The `applyLevelModifications()` function provides solutions based on level:
60
+ - **Level 1+**: Complete navbar with navigation links
61
+ - **Level 2+**: Complete hero section with student's name
62
+ - **Level 3+**: Complete footer with copyright and Creta attribution
63
+
64
+ ### Spanish Instructional Design
65
+ - All comments and instructions in Spanish
66
+ - Detailed Tailwind CSS patterns and tips
67
+ - Encouraging messages for returning students
68
+ - HTML structure examples in code blocks (using `[placeholders]` to avoid parsing issues)
69
+
70
+ ## Development Commands
18
71
 
19
72
  ```bash
73
+ # Test CLI locally
20
74
  node bin/creta.js
75
+
76
+ # Test specific commands
77
+ node bin/creta.js portafolio
78
+ node bin/creta.js portafolio-1
79
+
80
+ # Publish to npm (increment version first)
81
+ npm publish
21
82
  ```
22
83
 
23
- ## Current State
84
+ ## Current State (v0.2.2)
85
+
86
+ The CLI is fully functional with:
87
+ - ✅ Interactive name collection
88
+ - ✅ SvelteKit 5 + Tailwind 4 template generation
89
+ - ✅ Progressive difficulty levels (0-3)
90
+ - ✅ Spanish instructional comments
91
+ - ✅ Proper Svelte 5 syntax (`{@render children?.()}`)
92
+ - ✅ HTML parsing issue fixes
93
+ - ✅ Encouraging welcome message for returning students
94
+
95
+ ## Recent Fixes and Updates
96
+
97
+ ### Version History
98
+ - **0.2.2**: Fixed Svelte 5 syntax and updated welcome message
99
+ - **0.2.1**: Fixed HTML comment parsing errors in Svelte templates
100
+ - **0.2.0**: Updated to Tailwind 4, changed command to "portafolio", new greeting
101
+ - **0.1.1**: Fixed template path resolution for global installs
102
+ - **0.1.0**: Initial working version with template generation
103
+ - **0.0.2**: Basic CLI structure
104
+
105
+ ### Known Issues Resolved
106
+ - ✅ HTML comments in code examples causing Svelte parsing errors (fixed by using `[placeholders]`)
107
+ - ✅ Svelte 5 syntax compatibility (`<slot />` → `{@render children?.()}`)
108
+ - ✅ Tailwind 4 migration (removed config files, updated to Vite plugin)
109
+ - ✅ Template path resolution for global npm installs
110
+
111
+ ## Message and Tone
112
+
113
+ The CLI uses encouraging Spanish messages:
114
+ - Welcome: "¡Bienvenido de vuelta! 🏛️"
115
+ - Mission: "Retomemos desde donde nos quedamos: hagamos tu portafolio."
116
+ - Hero message: "Gracias por seguir aquí. Abre el proyecto usando `code .` y sigue las instrucciones. Si tienes dudas, apóyate en el equipo"
24
117
 
25
- The CLI currently only displays "Bienvenido a Crea" - this appears to be a foundational setup awaiting feature development.
118
+ This reflects Creta's supportive approach to bringing students back to complete their learning journey.
package/bin/creta.js CHANGED
@@ -4,6 +4,7 @@ import { createInterface } from 'readline'
4
4
  import { execSync } from 'child_process'
5
5
  import fs from 'fs'
6
6
  import path from 'path'
7
+ import { fileURLToPath } from 'url'
7
8
 
8
9
  const args = process.argv.slice(2)
9
10
  const command = args[0]
@@ -64,13 +65,18 @@ async function createPortfolioProject(level) {
64
65
  }
65
66
 
66
67
  async function createProjectFiles(projectName, studentName, level) {
67
- const __dirname = path.dirname(new URL(import.meta.url).pathname)
68
+ const __filename = fileURLToPath(import.meta.url)
69
+ const __dirname = path.dirname(__filename)
68
70
  const templatePath = path.join(__dirname, '../templates/sveltekit-portfolio')
69
71
  const targetPath = path.join(process.cwd(), projectName)
70
72
 
71
73
  // Check if template exists
72
74
  if (!fs.existsSync(templatePath)) {
73
- throw new Error('Template no encontrado. Asegúrate de ejecutar desde el directorio correcto.')
75
+ console.error(`Debug info:`)
76
+ console.error(` - CLI location: ${__filename}`)
77
+ console.error(` - Template path: ${templatePath}`)
78
+ console.error(` - Template exists: ${fs.existsSync(templatePath)}`)
79
+ throw new Error('Template no encontrado. Es posible que necesites reinstalar el paquete: npm uninstall -g @icarusmx/creta && npm install -g @icarusmx/creta')
74
80
  }
75
81
 
76
82
  // Create target directory
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icarusmx/creta",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "Salgamos de este laberinto.",
5
5
  "type": "module",
6
6
  "bin": {