create-fullstack-boilerplate 2.1.5 → 2.1.7

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.
Files changed (2) hide show
  1. package/lib/copyProject.js +8 -29
  2. package/package.json +1 -1
@@ -1,33 +1,12 @@
1
- const { log } = require("./utils");
2
- // const fs = require("fs-extra"); // remove this line
3
- const cpy = require("cpy"); // add this
4
1
  const path = require("path");
5
- const fs = require("fs-extra"); // still needed for pathExists/remove
2
+ const fs = require("fs-extra");
6
3
 
7
4
  module.exports = async function copyProject(src, dest) {
8
- if (await fs.pathExists(dest)) {
9
- throw new Error(`Directory '${path.basename(dest)}' already exists. Please choose a different project name.`);
10
- }
5
+ await fs.copy(path.resolve(src), path.resolve(dest), {
6
+ overwrite: false,
7
+ errorOnExist: true,
8
+ filter: (srcPath) => !srcPath.includes("node_modules")
9
+ });
10
+ console.log("✅ Files copied successfully.");
11
+ }
11
12
 
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
- // Use cpy instead of fs.copy
20
- await cpy("**/*", dest, {
21
- cwd: src,
22
- parents: true,
23
- filter: (srcPath) => !srcPath.includes("node_modules")
24
- });
25
-
26
- console.log("✅ Files copied successfully.");
27
- } catch (err) {
28
- try {
29
- await fs.remove(dest);
30
- } catch (_) { }
31
- throw new Error(`Failed to copy project files: ${err.message}`);
32
- }
33
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fullstack-boilerplate",
3
- "version": "2.1.5",
3
+ "version": "2.1.7",
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": {