npms-exam-kit 3.0.6 → 3.0.7
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 +17 -23
- package/package.json +1 -1
package/bin/exam-kit.js
CHANGED
|
@@ -507,19 +507,18 @@ async function main(){
|
|
|
507
507
|
]}]);
|
|
508
508
|
|
|
509
509
|
const targetDir=join(process.cwd());
|
|
510
|
+
const sourceName=project==='SIMS'?'SIMS-master':'CRPMS-main';
|
|
511
|
+
const installDir=join(targetDir,sourceName);
|
|
510
512
|
|
|
511
|
-
// Check if project already
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
if(existsSync(join(targetDir,'frontend-project')))exist.push('frontend-project');
|
|
515
|
-
if(exist.length>0){
|
|
516
|
-
log(chalk.yellow(` Warning: ${exist.join(', ')} already exists here.`));
|
|
513
|
+
// Check if project folder already exists
|
|
514
|
+
if(existsSync(installDir)){
|
|
515
|
+
log(chalk.yellow(` Warning: ${sourceName} already exists here.`));
|
|
517
516
|
const {overwrite}=await inquirer.prompt([{type:'confirm',name:'overwrite',message:'Overwrite?',default:false}]);
|
|
518
517
|
if(!overwrite){log(chalk.yellow(' Cancelled.'));process.exit(0);}
|
|
519
|
-
|
|
518
|
+
rmSync(installDir,{recursive:true,force:true});
|
|
520
519
|
}
|
|
521
520
|
|
|
522
|
-
const srcDir=join(PROJECTS_DIR,
|
|
521
|
+
const srcDir=join(PROJECTS_DIR,sourceName);
|
|
523
522
|
if(!existsSync(srcDir)){
|
|
524
523
|
log(chalk.red(` Error: source not found at: ${srcDir}`));
|
|
525
524
|
log(chalk.dim(` Package root: ${ROOT}`));
|
|
@@ -529,22 +528,17 @@ async function main(){
|
|
|
529
528
|
}
|
|
530
529
|
|
|
531
530
|
// ── INSTALL ──
|
|
532
|
-
log(chalk.bold(`\n Installing ${project} → ${
|
|
531
|
+
log(chalk.bold(`\n Installing ${project} → ${installDir} ...`));
|
|
533
532
|
|
|
534
533
|
try{
|
|
535
|
-
// Copy
|
|
536
|
-
|
|
537
|
-
for(const entry of entries){
|
|
538
|
-
if(entry==='node_modules')continue;
|
|
539
|
-
const s=join(srcDir,entry),d=join(targetDir,entry);
|
|
540
|
-
if(statSync(s).isDirectory())cpSync(s,d,{recursive:true,force:true});
|
|
541
|
-
else copyFileSync(s,d);
|
|
542
|
-
}
|
|
534
|
+
// Copy entire project folder
|
|
535
|
+
cpSync(srcDir,installDir,{recursive:true,force:true});
|
|
543
536
|
log(chalk.green(' ✓ Project files installed'));
|
|
544
|
-
|
|
537
|
+
log(chalk.dim(` ${sourceName}/`));
|
|
538
|
+
for(const f of readdirSync(installDir)){log(chalk.dim(` ${f}`));}
|
|
545
539
|
log('');
|
|
546
540
|
|
|
547
|
-
const beDir=join(
|
|
541
|
+
const beDir=join(installDir,'backend-project'),feDir=join(installDir,'frontend-project');
|
|
548
542
|
|
|
549
543
|
// Install backend dependencies
|
|
550
544
|
if(existsSync(beDir)&&existsSync(join(beDir,'package.json'))){
|
|
@@ -570,22 +564,22 @@ async function main(){
|
|
|
570
564
|
|
|
571
565
|
// ── AUTO-ASSESS ──
|
|
572
566
|
log(chalk.bold(' Running auto-assessment...\n'));
|
|
573
|
-
const checks=buildChecklist(
|
|
567
|
+
const checks=buildChecklist(installDir,project);
|
|
574
568
|
const results=checks.map(c=>{let s;try{const r=c.auto();s=r===true||r==='PASS'?'PASS':(r==='MANUAL'?'MANUAL':'FAIL');}catch{s='MANUAL';}return{...c,status:s,guide:c.guide||''};});
|
|
575
569
|
showResults(results);
|
|
576
|
-
const rd=join(
|
|
570
|
+
const rd=join(installDir,'checklist_report');mkdirSync(rd,{recursive:true});
|
|
577
571
|
writeFileSync(join(rd,`assessment_${project}_${Date.now()}.json`),JSON.stringify({project,date:new Date().toISOString(),results},null,2));
|
|
578
572
|
log(chalk.dim(` Report: ${join(rd)}\n`));
|
|
579
573
|
|
|
580
574
|
// ── MERMAID DIAGRAMS ──
|
|
581
|
-
const diagPath=join(
|
|
575
|
+
const diagPath=join(installDir,`${project}_ERD_DFD.html`);
|
|
582
576
|
initMermaidFile(diagPath,project);
|
|
583
577
|
log(chalk.green(` ✓ Real ERD & DFD diagrams saved to:`));
|
|
584
578
|
log(` ${chalk.bold(diagPath)}`);
|
|
585
579
|
log(chalk.dim(' Open the .html file in a browser to see actual diagrams\n'));
|
|
586
580
|
|
|
587
581
|
// ── NEXT STEPS ──
|
|
588
|
-
showNextSteps(project,
|
|
582
|
+
showNextSteps(project, installDir);
|
|
589
583
|
|
|
590
584
|
log(chalk.bold.green('\n ✓ All done! Follow the steps above to run your project.\n'));
|
|
591
585
|
|