juxscript 1.0.27 → 1.0.28
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/cli.js +36 -15
- package/lib/components/docs-data.json +1 -1
- package/package.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -247,22 +247,43 @@ async function buildProject(isServe = false) {
|
|
|
247
247
|
console.log('+ Created jux/index.jux');
|
|
248
248
|
}
|
|
249
249
|
|
|
250
|
-
// Copy
|
|
251
|
-
const
|
|
252
|
-
const
|
|
253
|
-
|
|
254
|
-
if (fs.existsSync(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
const
|
|
262
|
-
|
|
263
|
-
|
|
250
|
+
// Copy entire presets folder to jux/presets/
|
|
251
|
+
const presetsSrc = path.join(PATHS.packageRoot, 'presets');
|
|
252
|
+
const presetsDest = path.join(juxDir, 'presets');
|
|
253
|
+
|
|
254
|
+
if (fs.existsSync(presetsSrc)) {
|
|
255
|
+
let copiedCount = 0;
|
|
256
|
+
|
|
257
|
+
function copyRecursive(src, dest) {
|
|
258
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
|
259
|
+
|
|
260
|
+
for (const entry of entries) {
|
|
261
|
+
const srcPath = path.join(src, entry.name);
|
|
262
|
+
const destPath = path.join(dest, entry.name);
|
|
263
|
+
|
|
264
|
+
// Skip hey.jux since we already copied it to index.jux
|
|
265
|
+
if (entry.isFile() && entry.name === 'hey.jux') {
|
|
266
|
+
continue;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
if (entry.isDirectory()) {
|
|
270
|
+
fs.mkdirSync(destPath, { recursive: true });
|
|
271
|
+
copyRecursive(srcPath, destPath);
|
|
272
|
+
} else if (entry.isFile()) {
|
|
273
|
+
fs.copyFileSync(srcPath, destPath);
|
|
274
|
+
const relativePath = path.relative(presetsSrc, srcPath);
|
|
275
|
+
console.log(`+ Copied preset: presets/${relativePath}`);
|
|
276
|
+
copiedCount++;
|
|
277
|
+
}
|
|
264
278
|
}
|
|
265
|
-
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
fs.mkdirSync(presetsDest, { recursive: true });
|
|
282
|
+
copyRecursive(presetsSrc, presetsDest);
|
|
283
|
+
|
|
284
|
+
if (copiedCount > 0) {
|
|
285
|
+
console.log(`+ Copied ${copiedCount} preset file(s) to jux/presets/`);
|
|
286
|
+
}
|
|
266
287
|
}
|
|
267
288
|
|
|
268
289
|
// Create package.json if it doesn't exist
|