create-next-rkk 1.0.3 → 1.0.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.
Files changed (2) hide show
  1. package/dist/index.js +10 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -84,6 +84,7 @@ program
84
84
  },
85
85
  ]);
86
86
  const targetDir = projectName || answers.projectName;
87
+ const projectPath = path.join(process.cwd(), targetDir);
87
88
  // Step 1: Create Next.js app
88
89
  const spinner = (0, ora_1.default)('Creating Next.js application...').start();
89
90
  try {
@@ -101,26 +102,26 @@ program
101
102
  '--no-git'
102
103
  ].join(' ');
103
104
  (0, child_process_1.execSync)(createNextAppCmd, {
104
- stdio: 'pipe',
105
- encoding: 'utf-8'
105
+ stdio: 'inherit',
106
+ cwd: process.cwd()
106
107
  });
107
108
  spinner.succeed('Next.js application created!');
109
+ // Verify directory exists
110
+ if (!fs.existsSync(projectPath)) {
111
+ throw new Error(`Project directory ${targetDir} was not created`);
112
+ }
108
113
  // Step 2: Install rkk-next
109
114
  if (answers.installDeps) {
110
115
  spinner.start('Installing rkk-next...');
111
- process.chdir(targetDir);
112
116
  (0, child_process_1.execSync)('npm install rkk-next', {
113
- stdio: 'pipe',
114
- encoding: 'utf-8'
117
+ stdio: 'inherit',
118
+ cwd: projectPath
115
119
  });
116
120
  spinner.succeed('rkk-next installed!');
117
121
  }
118
- else {
119
- process.chdir(targetDir);
120
- }
121
122
  // Step 3: Setup template files
122
123
  spinner.start('Setting up rkk-next configuration...');
123
- setupTemplateFiles(targetDir, answers.router, answers.typescript);
124
+ setupTemplateFiles(projectPath, answers.router, answers.typescript);
124
125
  spinner.succeed('Configuration complete!');
125
126
  // Success message
126
127
  console.log(chalk_1.default.green.bold('\n✨ Success! Created ' + targetDir));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-next-rkk",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "description": "CLI tool to create Next.js apps with rkk-next pre-configured",
5
5
  "author": "Rohit Kumar Kundu",
6
6
  "license": "MIT",