@uniformdev/transformer 1.1.53 → 1.1.55

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/cli/index.js CHANGED
@@ -710,32 +710,12 @@ var CompositionConverterService = class {
710
710
  this.logger.debug(`Generated reference content type "${targetType}" with ${contentType.fields.length} field(s): ${contentType.fields.map((f) => f.id).join(", ")}`);
711
711
  }
712
712
  if (isBlockType) {
713
- let blockId = targetType;
714
- let needsRename = false;
715
- if (isRefType) {
716
- needsRename = true;
717
- }
718
- if (!needsRename) {
719
- const existingPath = this.fileSystem.joinPath(contentTypesDirFull, `${targetType}.json`);
720
- if (await this.fileSystem.fileExists(existingPath)) {
721
- try {
722
- const existing = await this.fileSystem.readFile(existingPath);
723
- if (existing?.type !== "block") {
724
- needsRename = true;
725
- }
726
- } catch {
727
- }
728
- }
729
- }
730
- if (needsRename) {
731
- blockId = `${targetType}Block`;
732
- this.logger.info(`Content type "${targetType}" already exists as non-block, using "${blockId}" for block`);
733
- }
713
+ const blockId = `${targetType}Block`;
734
714
  blockTypeIdMap.set(targetType, blockId);
735
715
  const blockContentType = this.generateContentType(component);
736
716
  blockContentType.type = "block";
737
717
  blockContentType.id = blockId;
738
- blockContentType.name = needsRename ? `${blockContentType.name} Block` : blockContentType.name;
718
+ blockContentType.name = `${blockContentType.name} Block`;
739
719
  targetContentTypeMap.set(blockId, blockContentType);
740
720
  this.logger.debug(`Generated block content type "${blockId}" with ${blockContentType.fields.length} field(s): ${blockContentType.fields.map((f) => f.id).join(", ")}`);
741
721
  }
@@ -750,7 +730,7 @@ var CompositionConverterService = class {
750
730
  this.logger.info(`Component type not found: ${targetType}`);
751
731
  missingTargetTypes.push(targetType);
752
732
  if (isBlockType) {
753
- blockTypeIdMap.set(targetType, targetType);
733
+ blockTypeIdMap.set(targetType, `${targetType}Block`);
754
734
  }
755
735
  continue;
756
736
  }
@@ -801,34 +781,19 @@ var CompositionConverterService = class {
801
781
  this.logger.debug(`Generated slot reference content type "${targetType}" with ${contentType.fields.length} field(s)`);
802
782
  }
803
783
  if (isSlotBlockType && !blockTypeIdMap.has(targetType)) {
804
- let blockId = targetType;
805
- let needsRename = isSlotRefType;
806
- if (!needsRename) {
807
- const existingPath = this.fileSystem.joinPath(contentTypesDirFull, `${targetType}.json`);
808
- if (await this.fileSystem.fileExists(existingPath)) {
809
- try {
810
- const existing = await this.fileSystem.readFile(existingPath);
811
- if (existing?.type !== "block") needsRename = true;
812
- } catch {
813
- }
814
- }
815
- }
816
- if (needsRename) {
817
- blockId = `${targetType}Block`;
818
- this.logger.info(`Content type "${targetType}" already exists as non-block, using "${blockId}" for block`);
819
- }
784
+ const blockId = `${targetType}Block`;
820
785
  blockTypeIdMap.set(targetType, blockId);
821
786
  const blockContentType = this.generateContentType(component);
822
787
  blockContentType.type = "block";
823
788
  blockContentType.id = blockId;
824
- blockContentType.name = needsRename ? `${blockContentType.name} Block` : blockContentType.name;
789
+ blockContentType.name = `${blockContentType.name} Block`;
825
790
  targetContentTypeMap.set(blockId, blockContentType);
826
791
  this.logger.debug(`Generated slot block content type "${blockId}" with ${blockContentType.fields.length} field(s)`);
827
792
  }
828
793
  } catch (error) {
829
794
  if (error instanceof ComponentNotFoundError) {
830
795
  this.logger.info(`Component type not found: ${targetType}`);
831
- if (isSlotBlockType && !blockTypeIdMap.has(targetType)) blockTypeIdMap.set(targetType, targetType);
796
+ if (isSlotBlockType && !blockTypeIdMap.has(targetType)) blockTypeIdMap.set(targetType, `${targetType}Block`);
832
797
  continue;
833
798
  }
834
799
  throw error;
@@ -3997,7 +3962,7 @@ var ComponentAdderService = class {
3997
3962
  const newInstance = this.createComponentInstance(newComponentType, parsedParams);
3998
3963
  const compositionsResult = await this.addComponentToDirectory(
3999
3964
  fullCompositionsDir,
4000
- parentTypes,
3965
+ resolvedParentTypes,
4001
3966
  slot,
4002
3967
  newInstance,
4003
3968
  whatIf,
@@ -4006,7 +3971,7 @@ var ComponentAdderService = class {
4006
3971
  );
4007
3972
  const compositionPatternsResult = await this.addComponentToDirectory(
4008
3973
  fullCompositionPatternsDir,
4009
- parentTypes,
3974
+ resolvedParentTypes,
4010
3975
  slot,
4011
3976
  newInstance,
4012
3977
  whatIf,
@@ -4015,7 +3980,7 @@ var ComponentAdderService = class {
4015
3980
  );
4016
3981
  const componentPatternsResult = await this.addComponentToDirectory(
4017
3982
  fullComponentPatternsDir,
4018
- parentTypes,
3983
+ resolvedParentTypes,
4019
3984
  slot,
4020
3985
  newInstance,
4021
3986
  whatIf,
@@ -4133,7 +4098,7 @@ var ComponentAdderService = class {
4133
4098
  };
4134
4099
  const compositionsResult = await this.addComponentToDirectory(
4135
4100
  fullCompositionsDir,
4136
- parentTypes,
4101
+ resolvedParentTypes,
4137
4102
  slot,
4138
4103
  newInstance,
4139
4104
  whatIf,
@@ -4143,7 +4108,7 @@ var ComponentAdderService = class {
4143
4108
  );
4144
4109
  const compositionPatternsResult = await this.addComponentToDirectory(
4145
4110
  fullCompositionPatternsDir,
4146
- parentTypes,
4111
+ resolvedParentTypes,
4147
4112
  slot,
4148
4113
  newInstance,
4149
4114
  whatIf,
@@ -4153,7 +4118,7 @@ var ComponentAdderService = class {
4153
4118
  );
4154
4119
  const componentPatternsResult = await this.addComponentToDirectory(
4155
4120
  fullComponentPatternsDir,
4156
- parentTypes,
4121
+ resolvedParentTypes,
4157
4122
  slot,
4158
4123
  newInstance,
4159
4124
  whatIf,
@@ -7887,7 +7852,7 @@ function createClearSlotCommand() {
7887
7852
  // package.json
7888
7853
  var package_default = {
7889
7854
  name: "@uniformdev/transformer",
7890
- version: "1.1.53",
7855
+ version: "1.1.55",
7891
7856
  description: "CLI tool for transforming Uniform.dev serialization files offline",
7892
7857
  type: "module",
7893
7858
  bin: {