npms-exam-kit 3.0.2 → 3.0.3
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/bin/exam-kit.js +10 -12
- package/package.json +1 -1
package/bin/exam-kit.js
CHANGED
|
@@ -531,11 +531,9 @@ 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);
|
|
537
534
|
|
|
538
535
|
try{
|
|
536
|
+
// Copy files first (instant — no spinner needed)
|
|
539
537
|
const entries=readdirSync(srcDir);
|
|
540
538
|
for(const entry of entries){
|
|
541
539
|
if(entry==='node_modules')continue;
|
|
@@ -543,26 +541,27 @@ async function main(){
|
|
|
543
541
|
if(statSync(s).isDirectory())fs.copySync(s,d,{filter:f=>!f.includes('node_modules')});
|
|
544
542
|
else copyFileSync(s,d);
|
|
545
543
|
}
|
|
544
|
+
log(chalk.green(' ✓ Project files installed'));
|
|
545
|
+
for(const f of readdirSync(targetDir).filter(f=>f!=='node_modules'&&f!=='package-lock.json'&&f!=='checklist_report')){log(chalk.dim(` ${f}`));}
|
|
546
|
+
log('');
|
|
546
547
|
|
|
547
548
|
const beDir=join(targetDir,'backend-project'),feDir=join(targetDir,'frontend-project');
|
|
548
549
|
|
|
550
|
+
// Install backend dependencies
|
|
549
551
|
if(existsSync(beDir)&&existsSync(join(beDir,'package.json'))){
|
|
550
552
|
process.chdir(beDir);
|
|
551
|
-
log(chalk.cyan('
|
|
552
|
-
try{await execAsync('npm install',{timeout:
|
|
553
|
+
log(chalk.cyan(' Installing Backend dependencies...'));
|
|
554
|
+
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
555
|
}
|
|
556
|
+
|
|
557
|
+
// Install frontend dependencies
|
|
554
558
|
if(existsSync(feDir)&&existsSync(join(feDir,'package.json'))){
|
|
555
559
|
process.chdir(feDir);
|
|
556
560
|
log(chalk.cyan(' Installing Frontend dependencies...'));
|
|
557
|
-
try{await execAsync('npm install',{timeout:
|
|
561
|
+
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
562
|
}
|
|
559
563
|
|
|
560
564
|
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
565
|
|
|
567
566
|
// Create .env
|
|
568
567
|
if(existsSync(join(beDir,'.env.example'))&&!existsSync(join(beDir,'.env'))){
|
|
@@ -592,7 +591,6 @@ async function main(){
|
|
|
592
591
|
log(chalk.bold.green('\n ✓ All done! Follow the steps above to run your project.\n'));
|
|
593
592
|
|
|
594
593
|
}catch(err){
|
|
595
|
-
clearInterval(spin);
|
|
596
594
|
log(chalk.red(`\n ✗ Error: ${err.message}`));
|
|
597
595
|
process.exit(1);
|
|
598
596
|
}
|