@uniformdev/transformer 1.1.6 → 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 +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
|
@@ -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
|
|
@@ -590,17 +600,18 @@ var PropertyPropagatorService = class {
|
|
|
590
600
|
}
|
|
591
601
|
let modifiedComponent = { ...targetComponent };
|
|
592
602
|
let componentModified = false;
|
|
603
|
+
const groupId = this.componentService.generateGroupId(targetGroup);
|
|
593
604
|
const existingGroup = this.componentService.findParameter(
|
|
594
605
|
modifiedComponent,
|
|
595
|
-
|
|
606
|
+
groupId,
|
|
596
607
|
findOptions
|
|
597
608
|
);
|
|
598
609
|
if (!existingGroup) {
|
|
599
610
|
this.logger.action(whatIf, "CREATE", `Group "${targetGroup}" on ${targetComponentType}`);
|
|
600
611
|
modifiedComponent = this.componentService.ensureGroupExists(
|
|
601
612
|
modifiedComponent,
|
|
613
|
+
groupId,
|
|
602
614
|
targetGroup,
|
|
603
|
-
void 0,
|
|
604
615
|
findOptions
|
|
605
616
|
);
|
|
606
617
|
componentModified = true;
|
|
@@ -624,7 +635,7 @@ var PropertyPropagatorService = class {
|
|
|
624
635
|
);
|
|
625
636
|
modifiedComponent = this.componentService.addParameterToGroup(
|
|
626
637
|
modifiedComponent,
|
|
627
|
-
|
|
638
|
+
groupId,
|
|
628
639
|
param.id,
|
|
629
640
|
findOptions
|
|
630
641
|
);
|
|
@@ -633,7 +644,7 @@ var PropertyPropagatorService = class {
|
|
|
633
644
|
this.logger.info(`Parameter "${param.id}" already exists on ${targetComponentType}`);
|
|
634
645
|
const group = this.componentService.findParameter(
|
|
635
646
|
modifiedComponent,
|
|
636
|
-
|
|
647
|
+
groupId,
|
|
637
648
|
findOptions
|
|
638
649
|
);
|
|
639
650
|
if (group && this.componentService.isGroupParameter(group)) {
|
|
@@ -643,7 +654,7 @@ var PropertyPropagatorService = class {
|
|
|
643
654
|
if (!isInGroup) {
|
|
644
655
|
modifiedComponent = this.componentService.addParameterToGroup(
|
|
645
656
|
modifiedComponent,
|
|
646
|
-
|
|
657
|
+
groupId,
|
|
647
658
|
param.id,
|
|
648
659
|
findOptions
|
|
649
660
|
);
|
|
@@ -3364,7 +3375,7 @@ function createPropagateRootComponentSlotCommand() {
|
|
|
3364
3375
|
// package.json
|
|
3365
3376
|
var package_default = {
|
|
3366
3377
|
name: "@uniformdev/transformer",
|
|
3367
|
-
version: "1.1.
|
|
3378
|
+
version: "1.1.7",
|
|
3368
3379
|
description: "CLI tool for transforming Uniform.dev serialization files offline",
|
|
3369
3380
|
type: "module",
|
|
3370
3381
|
bin: {
|