juxscript 1.0.26 → 1.0.27
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/machinery/compiler.js +19 -10
- package/package.json +1 -1
package/machinery/compiler.js
CHANGED
|
@@ -173,7 +173,7 @@ export async function transpileProjectTypeScript(srcDir, destDir) {
|
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
/**
|
|
176
|
-
* Copy presets folder from lib to dist
|
|
176
|
+
* Copy presets folder from lib to dist (maintaining directory structure)
|
|
177
177
|
*
|
|
178
178
|
* @param {string} packageRoot - Source package root directory
|
|
179
179
|
* @param {string} distDir - Destination directory
|
|
@@ -195,21 +195,30 @@ export async function copyPresetsToOutput(packageRoot, distDir) {
|
|
|
195
195
|
|
|
196
196
|
fs.mkdirSync(presetsDest, { recursive: true });
|
|
197
197
|
|
|
198
|
-
//
|
|
199
|
-
const files = fs.readdirSync(presetsSrc);
|
|
198
|
+
// Recursively copy entire presets directory structure
|
|
200
199
|
let copiedCount = 0;
|
|
201
200
|
|
|
202
|
-
|
|
203
|
-
const
|
|
204
|
-
const destPath = path.join(presetsDest, file);
|
|
201
|
+
function copyRecursive(src, dest) {
|
|
202
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
205
203
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
204
|
+
for (const entry of entries) {
|
|
205
|
+
const srcPath = path.join(src, entry.name);
|
|
206
|
+
const destPath = path.join(dest, entry.name);
|
|
207
|
+
|
|
208
|
+
if (entry.isDirectory()) {
|
|
209
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
210
|
+
copyRecursive(srcPath, destPath);
|
|
211
|
+
} else if (entry.isFile()) {
|
|
212
|
+
fs.copyFileSync(srcPath, destPath);
|
|
213
|
+
const relativePath = path.relative(presetsSrc, srcPath);
|
|
214
|
+
console.log(` ✓ ${relativePath}`);
|
|
215
|
+
copiedCount++;
|
|
216
|
+
}
|
|
210
217
|
}
|
|
211
218
|
}
|
|
212
219
|
|
|
220
|
+
copyRecursive(presetsSrc, presetsDest);
|
|
221
|
+
|
|
213
222
|
console.log(`✅ Copied ${copiedCount} preset file(s)\n`);
|
|
214
223
|
}
|
|
215
224
|
|