@anmol0493/fullstack-app 1.0.0 → 1.0.2

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/README.md CHANGED
@@ -20,5 +20,5 @@ This is a **full-stack template** designed to help developers quickly bootstrap
20
20
 
21
21
  ### Installation
22
22
  - ```bash
23
- npx @anmol040903/fullstack-app my-project
23
+ npx @anmol0493/fullstack-app my-project
24
24
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anmol0493/fullstack-app",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "A full-stack template with Vite React frontend and Express/NestJS backend options.",
5
5
  "main": "index.js",
6
6
  "type": "module",
package/scripts/setup.js CHANGED
@@ -16,19 +16,26 @@ const __dirname = dirname(__filename);
16
16
  const projectName = process.argv[2];
17
17
 
18
18
  if (!projectName) {
19
- console.error('Please provide a project name:');
20
- console.error(' npx @anmol040903/fullstack-app <project-name>');
19
+ console.error('Please provide a project name');
21
20
  process.exit(1);
22
21
  }
23
22
 
24
23
  // Define paths
25
24
  const templateDir = path.join(__dirname, '..'); // Root directory of your template
26
- const targetDir = path.resolve(process.cwd(), projectName);
25
+ let targetDir;
27
26
 
28
- // Ensure the target directory doesn't already exist
29
- if (fs.existsSync(targetDir)) {
30
- console.error(`Directory "${projectName}" already exists.`);
31
- process.exit(1);
27
+ if (projectName === '.') {
28
+ // Use the current working directory if "." is provided
29
+ targetDir = process.cwd();
30
+ } else {
31
+ // Otherwise, create a new directory with the given project name
32
+ targetDir = path.resolve(process.cwd(), projectName);
33
+
34
+ // Ensure the target directory doesn't already exist
35
+ if (fs.existsSync(targetDir)) {
36
+ console.error(`Directory "${projectName}" already exists.`);
37
+ process.exit(1);
38
+ }
32
39
  }
33
40
 
34
41
  (async () => {
@@ -58,12 +65,12 @@ if (fs.existsSync(targetDir)) {
58
65
  fs.mkdirSync(backendTargetDir, { recursive: true });
59
66
  fs.cpSync(backendSourceDir, backendTargetDir, { recursive: true });
60
67
 
61
- // Step 3: Install dependencies for frontend and backend
62
- console.log('Installing dependencies...');
63
- process.chdir(targetDir); // Navigate to the new project directory
68
+ // // Step 3: Install dependencies for frontend and backend
69
+ // console.log('Installing dependencies...');
70
+ // process.chdir(targetDir); // Navigate to the new project directory
64
71
 
65
- await execa('npm', ['install'], { cwd: path.join(targetDir, 'frontend'), stdio: 'inherit' });
66
- await execa('npm', ['install'], { cwd: backendTargetDir, stdio: 'inherit' });
72
+ // await execa('npm', ['install'], { cwd: path.join(targetDir, 'frontend'), stdio: 'inherit' });
73
+ // await execa('npm', ['install'], { cwd: backendTargetDir, stdio: 'inherit' });
67
74
 
68
75
  console.log(`Project ${projectName} created successfully!`);
69
76
  } catch (error) {