create-fullstack-boilerplate 2.1.2 → 2.1.4

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/index.js CHANGED
@@ -58,19 +58,19 @@
58
58
  await copyProject(templateDir, targetDir);
59
59
  await setupMainDB(targetDir, answers.dbDialect);
60
60
  console.log("➡️ Installing backend dependencies...");
61
- await runInstall(path.join(targetDir, "backend"));
61
+ await runInstall(path.join(targetDir, "Backend"));
62
62
 
63
63
  console.log("➡️ Installing frontend dependencies...");
64
- await runInstall(path.join(targetDir, "frontend"));
64
+ await runInstall(path.join(targetDir, "Frontend"));
65
65
 
66
66
  console.log("➡️ Installing Your Db Dialect: ", answers.dbDialect)
67
- await installDBDriver(path.join(targetDir, "backend"), answers.dbDialect);
67
+ await installDBDriver(path.join(targetDir, "Backend"), answers.dbDialect);
68
68
 
69
69
 
70
70
  if (answers.addExtraDB) {
71
71
  const extraDB = await extraDBPrompts();
72
72
  console.log(`\n🔍 Testing connection for ${extraDB.dbKey}...`);
73
- await installDBDriver(path.join(targetDir, "backend"), extraDB.dialect);
73
+ await installDBDriver(path.join(targetDir, "Backend"), extraDB.dialect);
74
74
  const ok = await testDBConnection(targetDir, extraDB);
75
75
 
76
76
  if (ok) {
package/lib/addDB.js CHANGED
@@ -11,7 +11,7 @@ module.exports = async function addDB() {
11
11
  console.log(`\n➕ Add New Database to Existing Project\n`);
12
12
 
13
13
  const targetDir = process.cwd();
14
- const backendDir = path.join(targetDir, "backend");
14
+ const backendDir = path.join(targetDir, "Backend");
15
15
  const dbDir = path.join(backendDir, "DB");
16
16
  const modelsDir = path.join(backendDir, "Models");
17
17
 
package/lib/addRoute.js CHANGED
@@ -9,7 +9,7 @@ module.exports = async function addRoute() {
9
9
  console.log(`\n➕ Add New Route to Backend\n`);
10
10
 
11
11
  const targetDir = process.cwd();
12
- const backendDir = path.join(targetDir, "backend");
12
+ const backendDir = path.join(targetDir, "Backend");
13
13
  const routesDir = path.join(backendDir, "routes");
14
14
  const servicesDir = path.join(backendDir, "services");
15
15
 
@@ -3,47 +3,32 @@ const fs = require("fs-extra");
3
3
  const path = require("path");
4
4
 
5
5
  module.exports = async function copyProject(src, dest) {
6
- // Normalize paths to handle Windows paths with spaces
7
- const normalizedSrc = path.normalize(src);
8
- const normalizedDest = path.normalize(dest);
9
-
10
6
  // Check if destination already exists
11
- if (await fs.pathExists(normalizedDest)) {
12
- throw new Error(`Directory '${path.basename(normalizedDest)}' already exists. Please choose a different project name.`);
7
+ if (await fs.pathExists(dest)) {
8
+ throw new Error(`Directory '${path.basename(dest)}' already exists. Please choose a different project name.`);
13
9
  }
14
10
 
15
11
  // Check if source template exists
16
- if (!await fs.pathExists(normalizedSrc)) {
17
- throw new Error(`Template directory not found at: ${normalizedSrc}`);
12
+ if (!await fs.pathExists(src)) {
13
+ throw new Error(`Template directory not found at: ${src}`);
18
14
  }
19
15
 
20
16
  log("Creating project directory...");
21
17
 
22
18
  try {
23
- // Ensure destination directory exists first
24
- await fs.ensureDir(normalizedDest);
25
-
26
- // Copy with error handling
27
- await fs.copy(normalizedSrc, normalizedDest, {
28
- overwrite: false,
29
- errorOnExist: false,
30
- filter: (item) => {
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) => {
31
22
  // Filter out node_modules
32
- return !item.includes("node_modules");
23
+ return !srcPath.includes("node_modules");
33
24
  }
34
25
  });
35
26
 
36
- // Verify the copy was successful by checking if backend exists
37
- const backendPath = path.join(normalizedDest, "backend");
38
- if (!await fs.pathExists(backendPath)) {
39
- throw new Error(`Copy verification failed: backend folder not found at ${backendPath}`);
40
- }
41
-
42
27
  console.log("✅ Files copied successfully.");
43
28
  } catch (err) {
44
29
  // Clean up on failure
45
30
  try {
46
- await fs.remove(normalizedDest);
31
+ await fs.remove(dest);
47
32
  } catch (cleanupErr) {
48
33
  // Ignore cleanup errors
49
34
  }
@@ -5,7 +5,7 @@ const fs = require("fs-extra"); // no assert needed
5
5
 
6
6
 
7
7
  module.exports = async function setupExtraDB(targetDir, dbConfig) {
8
- const backendDir = path.join(targetDir, "backend");
8
+ const backendDir = path.join(targetDir, "Backend");
9
9
  const modelsDir = path.join(backendDir, "Models");
10
10
  const dbDir = path.join(backendDir, "DB");
11
11
 
@@ -3,7 +3,7 @@ const path = require("path");
3
3
 
4
4
  module.exports = async function setupMainDB(targetDir, dialect) {
5
5
  log("Configuring main DB in backend...");
6
- const backendDir = path.join(targetDir, "backend");
6
+ const backendDir = path.join(targetDir, "Backend");
7
7
  await replaceInFiles(backendDir, {
8
8
  "__DB_DIALECT__": dialect
9
9
  });
@@ -36,7 +36,7 @@ const path = require("path");
36
36
  const { assertDependency } = require("./utils");
37
37
 
38
38
  async function testDBConnection(targetDir, dbConfig) {
39
- const backendDir = path.join(targetDir, "backend");
39
+ const backendDir = path.join(targetDir, "Backend");
40
40
 
41
41
  let driver;
42
42
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-fullstack-boilerplate",
3
- "version": "2.1.2",
3
+ "version": "2.1.4",
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": {