create-huenei-template 0.2.9 ā 0.2.10
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/dist/core/file-operations.js +35 -3
- package/dist/index.js +5 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "path";
|
|
2
|
-
import { mkdir, cp, rm, access } from "fs/promises";
|
|
2
|
+
import { mkdir, cp, rm, access, readdir, stat } from "fs/promises";
|
|
3
3
|
import { constants } from "fs";
|
|
4
4
|
export async function ensureDirectory(dirPath) {
|
|
5
5
|
await mkdir(dirPath, { recursive: true });
|
|
@@ -26,7 +26,7 @@ export async function directoryExists(dirPath) {
|
|
|
26
26
|
}
|
|
27
27
|
export async function copyToExistingDir(source, dest) {
|
|
28
28
|
await ensureDirectory(dest);
|
|
29
|
-
await
|
|
29
|
+
await robustCopyDir(source, dest);
|
|
30
30
|
}
|
|
31
31
|
export async function mergeSubdirectories(source, dest, subdirs) {
|
|
32
32
|
for (const subdir of subdirs) {
|
|
@@ -34,7 +34,39 @@ export async function mergeSubdirectories(source, dest, subdirs) {
|
|
|
34
34
|
const destPath = path.join(dest, subdir);
|
|
35
35
|
if (await directoryExists(srcPath)) {
|
|
36
36
|
await ensureDirectory(destPath);
|
|
37
|
-
await
|
|
37
|
+
await robustCopyDir(srcPath, destPath);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
async function isDirectory(filePath) {
|
|
42
|
+
try {
|
|
43
|
+
const s = await stat(filePath);
|
|
44
|
+
return s.isDirectory();
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
async function robustCopyDir(source, dest) {
|
|
51
|
+
const entries = await readdir(source, { withFileTypes: true });
|
|
52
|
+
for (const entry of entries) {
|
|
53
|
+
const srcEntry = path.join(source, entry.name);
|
|
54
|
+
const destEntry = path.join(dest, entry.name);
|
|
55
|
+
if (await directoryExists(destEntry)) {
|
|
56
|
+
const destIsDir = await isDirectory(destEntry);
|
|
57
|
+
if (entry.isDirectory() && !destIsDir) {
|
|
58
|
+
await rm(destEntry, { force: true });
|
|
59
|
+
}
|
|
60
|
+
else if (!entry.isDirectory() && destIsDir) {
|
|
61
|
+
await rm(destEntry, { recursive: true, force: true });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
if (entry.isDirectory()) {
|
|
65
|
+
await ensureDirectory(destEntry);
|
|
66
|
+
await robustCopyDir(srcEntry, destEntry);
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
await cp(srcEntry, destEntry, { force: true });
|
|
38
70
|
}
|
|
39
71
|
}
|
|
40
72
|
}
|
package/dist/index.js
CHANGED
|
@@ -63,6 +63,11 @@ function displayCursorSuccessMessage(scope, targetPath) {
|
|
|
63
63
|
console.log(` Installed in: ${targetPath}`);
|
|
64
64
|
console.log(` Merged: ${CURSOR_MERGE_SUBDIRS.join(", ")}`);
|
|
65
65
|
}
|
|
66
|
+
console.log("\nNext steps:");
|
|
67
|
+
console.log(" 1. Open a new conversation in Cursor");
|
|
68
|
+
console.log(" 2. Run the command /configurar-cursor in Plan mode");
|
|
69
|
+
console.log(" 3. Review the plan, evaluate its viability, and execute it");
|
|
70
|
+
console.log(" 4. Verify the generated files inside .cursor/ at your project root");
|
|
66
71
|
console.log("\n⨠Thanks for using create-huenei-template");
|
|
67
72
|
console.log("š Happy coding!\n");
|
|
68
73
|
}
|