@uniformdev/transformer 1.1.5 → 1.1.7
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 +19 -7
- package/dist/cli/index.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -6
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -352,6 +352,16 @@ var ComponentService = class {
|
|
|
352
352
|
component.slots = component.slots.filter((s) => !this.compareIds(s.id, slotId, strict));
|
|
353
353
|
return component;
|
|
354
354
|
}
|
|
355
|
+
generateGroupId(name) {
|
|
356
|
+
const words = name.replace(/[^a-zA-Z0-9]+/g, " ").trim().split(/\s+/).filter((w) => w.length > 0);
|
|
357
|
+
if (words.length === 0) {
|
|
358
|
+
return "group_";
|
|
359
|
+
}
|
|
360
|
+
const camel = words.map(
|
|
361
|
+
(w, i) => i === 0 ? w.toLowerCase() : w.charAt(0).toUpperCase() + w.slice(1).toLowerCase()
|
|
362
|
+
).join("");
|
|
363
|
+
return `group_${camel}`;
|
|
364
|
+
}
|
|
355
365
|
};
|
|
356
366
|
|
|
357
367
|
// src/core/services/composition.service.ts
|
|
@@ -556,7 +566,8 @@ var PropertyPropagatorService = class {
|
|
|
556
566
|
findOptions
|
|
557
567
|
);
|
|
558
568
|
if (notFound.length > 0) {
|
|
559
|
-
|
|
569
|
+
this.logger.warn(`Property "${notFound.join(", ")}" not found on component "${sourceType}"`);
|
|
570
|
+
continue;
|
|
560
571
|
}
|
|
561
572
|
for (const param of sourceParams) {
|
|
562
573
|
const exists = resolvedParams.some(
|
|
@@ -589,17 +600,18 @@ var PropertyPropagatorService = class {
|
|
|
589
600
|
}
|
|
590
601
|
let modifiedComponent = { ...targetComponent };
|
|
591
602
|
let componentModified = false;
|
|
603
|
+
const groupId = this.componentService.generateGroupId(targetGroup);
|
|
592
604
|
const existingGroup = this.componentService.findParameter(
|
|
593
605
|
modifiedComponent,
|
|
594
|
-
|
|
606
|
+
groupId,
|
|
595
607
|
findOptions
|
|
596
608
|
);
|
|
597
609
|
if (!existingGroup) {
|
|
598
610
|
this.logger.action(whatIf, "CREATE", `Group "${targetGroup}" on ${targetComponentType}`);
|
|
599
611
|
modifiedComponent = this.componentService.ensureGroupExists(
|
|
600
612
|
modifiedComponent,
|
|
613
|
+
groupId,
|
|
601
614
|
targetGroup,
|
|
602
|
-
void 0,
|
|
603
615
|
findOptions
|
|
604
616
|
);
|
|
605
617
|
componentModified = true;
|
|
@@ -623,7 +635,7 @@ var PropertyPropagatorService = class {
|
|
|
623
635
|
);
|
|
624
636
|
modifiedComponent = this.componentService.addParameterToGroup(
|
|
625
637
|
modifiedComponent,
|
|
626
|
-
|
|
638
|
+
groupId,
|
|
627
639
|
param.id,
|
|
628
640
|
findOptions
|
|
629
641
|
);
|
|
@@ -632,7 +644,7 @@ var PropertyPropagatorService = class {
|
|
|
632
644
|
this.logger.info(`Parameter "${param.id}" already exists on ${targetComponentType}`);
|
|
633
645
|
const group = this.componentService.findParameter(
|
|
634
646
|
modifiedComponent,
|
|
635
|
-
|
|
647
|
+
groupId,
|
|
636
648
|
findOptions
|
|
637
649
|
);
|
|
638
650
|
if (group && this.componentService.isGroupParameter(group)) {
|
|
@@ -642,7 +654,7 @@ var PropertyPropagatorService = class {
|
|
|
642
654
|
if (!isInGroup) {
|
|
643
655
|
modifiedComponent = this.componentService.addParameterToGroup(
|
|
644
656
|
modifiedComponent,
|
|
645
|
-
|
|
657
|
+
groupId,
|
|
646
658
|
param.id,
|
|
647
659
|
findOptions
|
|
648
660
|
);
|
|
@@ -3363,7 +3375,7 @@ function createPropagateRootComponentSlotCommand() {
|
|
|
3363
3375
|
// package.json
|
|
3364
3376
|
var package_default = {
|
|
3365
3377
|
name: "@uniformdev/transformer",
|
|
3366
|
-
version: "1.1.
|
|
3378
|
+
version: "1.1.7",
|
|
3367
3379
|
description: "CLI tool for transforming Uniform.dev serialization files offline",
|
|
3368
3380
|
type: "module",
|
|
3369
3381
|
bin: {
|