@uniformdev/transformer 1.1.53 → 1.1.54
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 +7 -42
- package/dist/cli/index.js.map +1 -1
- package/dist/index.js +6 -41
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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;
|
|
@@ -7887,7 +7852,7 @@ function createClearSlotCommand() {
|
|
|
7887
7852
|
// package.json
|
|
7888
7853
|
var package_default = {
|
|
7889
7854
|
name: "@uniformdev/transformer",
|
|
7890
|
-
version: "1.1.
|
|
7855
|
+
version: "1.1.54",
|
|
7891
7856
|
description: "CLI tool for transforming Uniform.dev serialization files offline",
|
|
7892
7857
|
type: "module",
|
|
7893
7858
|
bin: {
|