@comfanion/workflow 4.36.3 → 4.36.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.
- package/bin/cli.js +3 -51
- package/package.json +1 -1
- package/src/build-info.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -572,58 +572,10 @@ program
|
|
|
572
572
|
await fs.move(tempVectors, path.join(targetDir, 'vectors'), { overwrite: true });
|
|
573
573
|
}
|
|
574
574
|
|
|
575
|
-
// Restore user's config.yaml
|
|
575
|
+
// Restore user's config.yaml completely - only add missing sections
|
|
576
576
|
spinner.text = 'Restoring config.yaml...';
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
// Extract user's custom exclude patterns before merge
|
|
580
|
-
const userExcludeMatch = configBackup.match(/exclude:\s*\n((?:\s+-\s+.+\n?)+)/);
|
|
581
|
-
const userExcludes = userExcludeMatch
|
|
582
|
-
? userExcludeMatch[1].match(/-\s+(.+)/g)?.map(m => m.replace(/^-\s+/, '').trim()) || []
|
|
583
|
-
: [];
|
|
584
|
-
|
|
585
|
-
// Add vectorizer section if missing
|
|
586
|
-
if (!mergedConfig.includes('vectorizer:')) {
|
|
587
|
-
const newConfigPath = path.join(targetDir, 'config.yaml');
|
|
588
|
-
const newConfig = await fs.readFile(newConfigPath, 'utf8');
|
|
589
|
-
const vectorizerMatch = newConfig.match(/(# =+\n# VECTORIZER[\s\S]*?)(?=# =+\n# [A-Z])/);
|
|
590
|
-
if (vectorizerMatch) {
|
|
591
|
-
// Insert before LSP section or at end
|
|
592
|
-
const insertPoint = mergedConfig.indexOf('# =============================================================================\n# LSP');
|
|
593
|
-
if (insertPoint > 0) {
|
|
594
|
-
mergedConfig = mergedConfig.slice(0, insertPoint) + vectorizerMatch[1] + mergedConfig.slice(insertPoint);
|
|
595
|
-
} else {
|
|
596
|
-
mergedConfig += '\n' + vectorizerMatch[1];
|
|
597
|
-
}
|
|
598
|
-
console.log(chalk.green(' ✅ Added new vectorizer configuration section'));
|
|
599
|
-
}
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
// Merge user's custom excludes into vectorizer section
|
|
603
|
-
if (userExcludes.length > 0) {
|
|
604
|
-
const newConfigPath = path.join(targetDir, 'config.yaml');
|
|
605
|
-
const newConfig = await fs.readFile(newConfigPath, 'utf8');
|
|
606
|
-
const defaultExcludeMatch = newConfig.match(/exclude:\s*\n((?:\s+-\s+.+\n?)+)/);
|
|
607
|
-
const defaultExcludes = defaultExcludeMatch
|
|
608
|
-
? defaultExcludeMatch[1].match(/-\s+(.+)/g)?.map(m => m.replace(/^-\s+/, '').trim()) || []
|
|
609
|
-
: [];
|
|
610
|
-
|
|
611
|
-
// Find excludes that user added (not in defaults)
|
|
612
|
-
const customExcludes = userExcludes.filter(e => !defaultExcludes.includes(e));
|
|
613
|
-
|
|
614
|
-
if (customExcludes.length > 0) {
|
|
615
|
-
// Add custom excludes to the merged config
|
|
616
|
-
const excludeInsertPoint = mergedConfig.match(/exclude:\s*\n((?:\s+-\s+.+\n?)+)/);
|
|
617
|
-
if (excludeInsertPoint) {
|
|
618
|
-
const insertAfter = excludeInsertPoint.index + excludeInsertPoint[0].length;
|
|
619
|
-
const customLines = customExcludes.map(e => ` - ${e}`).join('\n') + '\n';
|
|
620
|
-
mergedConfig = mergedConfig.slice(0, insertAfter) + customLines + mergedConfig.slice(insertAfter);
|
|
621
|
-
console.log(chalk.green(` ✅ Preserved ${customExcludes.length} custom exclude patterns`));
|
|
622
|
-
}
|
|
623
|
-
}
|
|
624
|
-
}
|
|
625
|
-
|
|
626
|
-
await fs.writeFile(configPath, mergedConfig);
|
|
577
|
+
await fs.writeFile(configPath, configBackup);
|
|
578
|
+
console.log(chalk.green(' ✅ config.yaml preserved'));
|
|
627
579
|
|
|
628
580
|
// Install plugin dependencies
|
|
629
581
|
spinner.text = 'Installing plugin dependencies...';
|
package/package.json
CHANGED