@uniformdev/transformer 1.1.18 → 1.1.19

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/dist/index.js CHANGED
@@ -664,9 +664,26 @@ var CompositionConverterService = class {
664
664
  for (const inst of instances) {
665
665
  const existingId = this.findExistingEntryBySourceItem(inst, sourceItemMap);
666
666
  if (existingId) {
667
- this.logger.info(
668
- `Reusing existing entry ${existingId} for ${flattenType} (sourceItem match)`
667
+ const existingEntryPath = this.fileSystem.joinPath(
668
+ entriesDirFull,
669
+ `${existingId}.json`
669
670
  );
671
+ this.logger.action(
672
+ whatIf,
673
+ "UPDATE",
674
+ `${entriesDir}/${existingId}.json (${flattenType}, merged fields from "${this.truncate(compositionName, 50)}")`
675
+ );
676
+ if (!whatIf) {
677
+ const existingEntry = await this.fileSystem.readFile(existingEntryPath);
678
+ if (existingEntry?.entry) {
679
+ const instanceFields = inst.instance.parameters ?? {};
680
+ existingEntry.entry.fields = {
681
+ ...existingEntry.entry.fields,
682
+ ...instanceFields
683
+ };
684
+ await this.fileSystem.writeFile(existingEntryPath, existingEntry);
685
+ }
686
+ }
670
687
  entriesReused++;
671
688
  continue;
672
689
  }