@icarusmx/creta 0.5.0 → 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.
@@ -4,7 +4,8 @@
4
4
  "Read(//private/tmp/**)",
5
5
  "Bash(node:*)",
6
6
  "WebFetch(domain:github.com)",
7
- "Bash(npm install)"
7
+ "Bash(npm install)",
8
+ "Bash(npm run dev:*)"
8
9
  ],
9
10
  "deny": [],
10
11
  "ask": []
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icarusmx/creta",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Salgamos de este laberinto.",
5
5
  "type": "module",
6
6
  "bin": {