update to smartconfig

This commit is contained in:
2026-03-24 16:10:51 +00:00
parent eda67395fe
commit d0d922e53b
41 changed files with 425 additions and 2091 deletions

View File

@@ -17,15 +17,15 @@ export class CopyFormatter extends BaseFormatter {
async analyze(): Promise<IPlannedChange[]> {
const changes: IPlannedChange[] = [];
// Get copy configuration from npmextra.json
const npmextraConfig = new plugins.npmextra.Smartconfig();
const copyConfig = npmextraConfig.dataFor<{ patterns: ICopyPattern[] }>(
// Get copy configuration from .smartconfig.json
const smartconfigInstance = new plugins.smartconfig.Smartconfig();
const copyConfig = smartconfigInstance.dataFor<{ patterns: ICopyPattern[] }>(
'gitzone.format.copy',
{ patterns: [] },
);
if (!copyConfig.patterns || copyConfig.patterns.length === 0) {
logVerbose('No copy patterns configured in npmextra.json');
logVerbose('No copy patterns configured in .smartconfig.json');
return changes;
}
@@ -103,10 +103,6 @@ export class CopyFormatter extends BaseFormatter {
async applyChange(change: IPlannedChange): Promise<void> {
if (!change.content) return;
// Ensure destination directory exists
const destDir = plugins.path.dirname(change.path);
await plugins.smartfs.directory(destDir).recursive().create();
if (change.type === 'create') {
await this.createFile(change.path, change.content);
} else {