@uniformdev/transformer 1.1.13 → 1.1.15
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 +17 -6
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +16 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -3699,11 +3699,12 @@ var CompositionConverterService = class {
|
|
|
3699
3699
|
if (flattenComponentIds.length > 0) {
|
|
3700
3700
|
this.transformContentReferences(entry);
|
|
3701
3701
|
}
|
|
3702
|
-
const
|
|
3702
|
+
const entryId = entry.entry._id;
|
|
3703
|
+
const entryFilePath = this.fileSystem.joinPath(entriesDirFull, `${entryId}.json`);
|
|
3703
3704
|
this.logger.action(
|
|
3704
3705
|
whatIf,
|
|
3705
3706
|
"WRITE",
|
|
3706
|
-
`${entriesDir}/${
|
|
3707
|
+
`${entriesDir}/${entryId}.json (${compositionType}, "${this.truncate(compositionName, 50)}")`
|
|
3707
3708
|
);
|
|
3708
3709
|
if (!whatIf) {
|
|
3709
3710
|
await this.fileSystem.writeFile(entryFilePath, entry);
|
|
@@ -3835,10 +3836,12 @@ var CompositionConverterService = class {
|
|
|
3835
3836
|
extraWrapperProps[key] = value;
|
|
3836
3837
|
}
|
|
3837
3838
|
}
|
|
3839
|
+
const entryId = computeGuidHash(`entry${comp._id}`);
|
|
3840
|
+
const entryName = this.truncateName(comp._name ?? comp._id, 60);
|
|
3838
3841
|
return {
|
|
3839
3842
|
entry: {
|
|
3840
|
-
_id:
|
|
3841
|
-
_name:
|
|
3843
|
+
_id: entryId,
|
|
3844
|
+
_name: entryName,
|
|
3842
3845
|
type: comp.type,
|
|
3843
3846
|
fields: { ...comp.parameters ?? {} },
|
|
3844
3847
|
...extraRootProps
|
|
@@ -3847,10 +3850,14 @@ var CompositionConverterService = class {
|
|
|
3847
3850
|
};
|
|
3848
3851
|
}
|
|
3849
3852
|
generateEntryFromFlattenedInstance(inst) {
|
|
3853
|
+
const entryName = this.truncateName(
|
|
3854
|
+
`${inst.componentType} (from ${inst.compositionName})`,
|
|
3855
|
+
60
|
|
3856
|
+
);
|
|
3850
3857
|
return {
|
|
3851
3858
|
entry: {
|
|
3852
3859
|
_id: inst.determinisiticId,
|
|
3853
|
-
_name:
|
|
3860
|
+
_name: entryName,
|
|
3854
3861
|
type: inst.componentType,
|
|
3855
3862
|
fields: { ...inst.instance.parameters ?? {} }
|
|
3856
3863
|
}
|
|
@@ -3932,6 +3939,10 @@ var CompositionConverterService = class {
|
|
|
3932
3939
|
if (str.length <= maxLength) return str;
|
|
3933
3940
|
return str.substring(0, maxLength - 3) + "...";
|
|
3934
3941
|
}
|
|
3942
|
+
truncateName(name, maxLength) {
|
|
3943
|
+
if (name.length <= maxLength) return name;
|
|
3944
|
+
return name.substring(0, maxLength);
|
|
3945
|
+
}
|
|
3935
3946
|
};
|
|
3936
3947
|
function computeGuidHash(guidOrSeed) {
|
|
3937
3948
|
let uuidStr;
|
|
@@ -4591,7 +4602,7 @@ function createRemoveFieldCommand() {
|
|
|
4591
4602
|
// package.json
|
|
4592
4603
|
var package_default = {
|
|
4593
4604
|
name: "@uniformdev/transformer",
|
|
4594
|
-
version: "1.1.
|
|
4605
|
+
version: "1.1.15",
|
|
4595
4606
|
description: "CLI tool for transforming Uniform.dev serialization files offline",
|
|
4596
4607
|
type: "module",
|
|
4597
4608
|
bin: {
|