@icarusmx/creta 0.5.1 → 0.5.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.
package/bin/creta.js CHANGED
@@ -115,18 +115,28 @@ async function copyTemplate(src, dest, projectName, studentName, level) {
115
115
  fs.mkdirSync(destPath, { recursive: true })
116
116
  await copyTemplate(srcPath, destPath, projectName, studentName, level)
117
117
  } else {
118
- let content = fs.readFileSync(srcPath, 'utf8')
118
+ // Check if this is a binary file
119
+ const binaryExtensions = ['.png', '.jpg', '.jpeg', '.gif', '.svg', '.ico', '.woff', '.woff2', '.ttf', '.eot']
120
+ const ext = path.extname(srcPath).toLowerCase()
119
121
 
120
- // Apply level-specific modifications first
121
- if (level > 0) {
122
- content = applyLevelModifications(content, item, level)
122
+ if (binaryExtensions.includes(ext)) {
123
+ // Copy binary files directly without text processing
124
+ fs.copyFileSync(srcPath, destPath)
125
+ } else {
126
+ // Process text files with placeholders
127
+ let content = fs.readFileSync(srcPath, 'utf8')
128
+
129
+ // Apply level-specific modifications first
130
+ if (level > 0) {
131
+ content = applyLevelModifications(content, item, level)
132
+ }
133
+
134
+ // Then replace placeholders
135
+ content = content.replace(/\{\{PROJECT_NAME\}\}/g, projectName)
136
+ content = content.replace(/\{\{STUDENT_NAME\}\}/g, studentName)
137
+
138
+ fs.writeFileSync(destPath, content)
123
139
  }
124
-
125
- // Then replace placeholders
126
- content = content.replace(/\{\{PROJECT_NAME\}\}/g, projectName)
127
- content = content.replace(/\{\{STUDENT_NAME\}\}/g, studentName)
128
-
129
- fs.writeFileSync(destPath, content)
130
140
  }
131
141
  }
132
142
  }
@@ -152,7 +162,7 @@ function applyLayoutModifications(content, level) {
152
162
  <div class="max-w-7xl mx-auto px-4">
153
163
  <div class="flex justify-between items-center py-3">
154
164
  <div class="flex items-center space-x-3">
155
- <img src="/logo.svg" alt="Logo" class="w-8 h-8">
165
+ <img src="/logo.png" alt="Logo" class="w-8 h-8">
156
166
  <span class="text-xl font-bold text-gray-900">{{STUDENT_NAME}}</span>
157
167
  </div>
158
168
  <div class="hidden md:flex space-x-6">
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icarusmx/creta",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "Salgamos de este laberinto.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -49,7 +49,7 @@
49
49
  <div class="max-w-7xl mx-auto px-4">
50
50
  <div class="flex justify-between items-center py-3">
51
51
  <div class="flex items-center space-x-3">
52
- <img src="/logo.svg" alt="Logo" class="w-8 h-8">
52
+ <img src="/logo.png" alt="Logo" class="w-8 h-8">
53
53
  <span class="text-xl font-bold text-gray-900">{{STUDENT_NAME}}</span>
54
54
  </div>
55
55
  <div class="hidden md:flex space-x-6">
@@ -1,4 +0,0 @@
1
- <svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg">
2
- <circle cx="16" cy="16" r="14" fill="#3b82f6" stroke="#1e40af" stroke-width="2"/>
3
- <text x="16" y="22" text-anchor="middle" fill="white" font-family="Arial, sans-serif" font-size="18" font-weight="bold">C</text>
4
- </svg>