create-fullstack-boilerplate 2.1.4 → 2.1.6
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/lib/copyProject.js +6 -35
- package/package.json +2 -1
package/lib/copyProject.js
CHANGED
|
@@ -1,37 +1,8 @@
|
|
|
1
|
-
const { log } = require("./utils");
|
|
2
|
-
const fs = require("fs-extra");
|
|
3
1
|
const path = require("path");
|
|
2
|
+
const fs = require("fs-extra");
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
// Check if source template exists
|
|
12
|
-
if (!await fs.pathExists(src)) {
|
|
13
|
-
throw new Error(`Template directory not found at: ${src}`);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
log("Creating project directory...");
|
|
17
|
-
|
|
18
|
-
try {
|
|
19
|
-
// Copy entire template directory (Backend and Frontend folders will be copied with their exact names)
|
|
20
|
-
await fs.copy(src, dest, {
|
|
21
|
-
filter: (srcPath) => {
|
|
22
|
-
// Filter out node_modules
|
|
23
|
-
return !srcPath.includes("node_modules");
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
console.log("✅ Files copied successfully.");
|
|
28
|
-
} catch (err) {
|
|
29
|
-
// Clean up on failure
|
|
30
|
-
try {
|
|
31
|
-
await fs.remove(dest);
|
|
32
|
-
} catch (cleanupErr) {
|
|
33
|
-
// Ignore cleanup errors
|
|
34
|
-
}
|
|
35
|
-
throw new Error(`Failed to copy project files: ${err.message}`);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
4
|
+
await fs.copy(path.resolve(src), path.resolve(dest), {
|
|
5
|
+
overwrite: false,
|
|
6
|
+
errorOnExist: true,
|
|
7
|
+
filter: (srcPath) => !srcPath.includes("node_modules")
|
|
8
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-fullstack-boilerplate",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"description": "A Full Stack Application Comprised of React for Frontend, Express & Sequelize with Node js for Backend to help developers get started on real implementation instead of spending time setting up projects.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"app"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"cpy": "^12.1.0",
|
|
35
36
|
"execa": "^5.1.1",
|
|
36
37
|
"fs-extra": "^11.3.2",
|
|
37
38
|
"inquirer": "^8.2.7"
|