npms-exam-kit 3.0.2 → 3.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/bin/exam-kit.js +16 -12
  2. package/package.json +1 -1
package/bin/exam-kit.js CHANGED
@@ -531,11 +531,15 @@ async function main(){
531
531
 
532
532
  // ── INSTALL ──
533
533
  log(chalk.bold(`\n Installing ${project} → ${targetDir} ...`));
534
- const spinChars=['⠋','⠙','⠹','⠸','⠼','⠴','⠦','⠧','⠇','⠏'];
535
- let si=0;
536
- const spin=setInterval(()=>{process.stdout.write(`\r ${chalk.cyan(spinChars[si++%spinChars.length])} Installing...`);},80);
534
+
535
+ // DEBUG: show source paths
536
+ log(chalk.dim(` Script: ${import.meta.url}`));
537
+ log(chalk.dim(` Projects dir: ${PROJECTS_DIR}`));
538
+ log(chalk.dim(` Source: ${srcDir}`));
539
+ log(chalk.dim(` Source contents: ${inDir(srcDir).join(', ')}`));
537
540
 
538
541
  try{
542
+ // Copy files first (instant — no spinner needed)
539
543
  const entries=readdirSync(srcDir);
540
544
  for(const entry of entries){
541
545
  if(entry==='node_modules')continue;
@@ -543,26 +547,27 @@ async function main(){
543
547
  if(statSync(s).isDirectory())fs.copySync(s,d,{filter:f=>!f.includes('node_modules')});
544
548
  else copyFileSync(s,d);
545
549
  }
550
+ log(chalk.green(' ✓ Project files installed'));
551
+ for(const f of readdirSync(targetDir).filter(f=>f!=='node_modules'&&f!=='package-lock.json'&&f!=='checklist_report')){log(chalk.dim(` ${f}`));}
552
+ log('');
546
553
 
547
554
  const beDir=join(targetDir,'backend-project'),feDir=join(targetDir,'frontend-project');
548
555
 
556
+ // Install backend dependencies
549
557
  if(existsSync(beDir)&&existsSync(join(beDir,'package.json'))){
550
558
  process.chdir(beDir);
551
- log(chalk.cyan('\n Installing Backend dependencies...'));
552
- try{await execAsync('npm install',{timeout:120000,windowsHide:true});log(chalk.green(' ✓ Backend dependencies installed'));}catch(e){log(chalk.yellow(` ⚠ Backend: ${e.message}`));}
559
+ log(chalk.cyan(' Installing Backend dependencies...'));
560
+ try{await execAsync('npm install',{timeout:180000,windowsHide:true});log(chalk.green(' ✓ Backend dependencies installed\n'));}catch(e){log(chalk.yellow(` ⚠ Backend: ${e.message}\n`));}
553
561
  }
562
+
563
+ // Install frontend dependencies
554
564
  if(existsSync(feDir)&&existsSync(join(feDir,'package.json'))){
555
565
  process.chdir(feDir);
556
566
  log(chalk.cyan(' Installing Frontend dependencies...'));
557
- try{await execAsync('npm install',{timeout:120000,windowsHide:true});log(chalk.green(' ✓ Frontend dependencies installed'));}catch(e){log(chalk.yellow(` ⚠ Frontend: ${e.message}`));}
567
+ try{await execAsync('npm install',{timeout:180000,windowsHide:true});log(chalk.green(' ✓ Frontend dependencies installed\n'));}catch(e){log(chalk.yellow(` ⚠ Frontend: ${e.message}\n`));}
558
568
  }
559
569
 
560
570
  process.chdir(targetDir);
561
- clearInterval(spin);
562
- process.stdout.write('\r \r');
563
- log(chalk.green(' ✓ Project files installed\n'));
564
- log(chalk.dim(` Files created:`));
565
- for(const f of readdirSync(targetDir).filter(f=>f!=='node_modules'&&f!=='package-lock.json')){log(chalk.dim(` ${f}`));}
566
571
 
567
572
  // Create .env
568
573
  if(existsSync(join(beDir,'.env.example'))&&!existsSync(join(beDir,'.env'))){
@@ -592,7 +597,6 @@ async function main(){
592
597
  log(chalk.bold.green('\n ✓ All done! Follow the steps above to run your project.\n'));
593
598
 
594
599
  }catch(err){
595
- clearInterval(spin);
596
600
  log(chalk.red(`\n ✗ Error: ${err.message}`));
597
601
  process.exit(1);
598
602
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npms-exam-kit",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "NESA National Practical Exam Projects Installer - SIMS & CRPMS",
5
5
  "bin": {
6
6
  "npms-exam-kit": "bin/exam-kit.js"