dominus-cli 0.6.0 → 2.0.0
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/index.js +2714 -512
- package/dist/index.js.map +1 -1
- package/dist/mcp.js +3786 -294
- package/dist/mcp.js.map +1 -1
- package/package.json +1 -1
- package/plugin/Dominus.rbxm +0 -0
- package/plugin/src/Properties.lua +69 -9
package/package.json
CHANGED
package/plugin/Dominus.rbxm
CHANGED
|
Binary file
|
|
@@ -677,7 +677,7 @@ function Properties.bulkSet(spec)
|
|
|
677
677
|
modified = modified + 1
|
|
678
678
|
end
|
|
679
679
|
end
|
|
680
|
-
elseif spec.root and spec.properties then
|
|
680
|
+
elseif spec.root and (spec.properties or spec.addChildren) then
|
|
681
681
|
-- Filter mode: apply to all matching descendants
|
|
682
682
|
local root = Explorer.resolveInstance(spec.root)
|
|
683
683
|
if not root then
|
|
@@ -691,13 +691,73 @@ function Properties.bulkSet(spec)
|
|
|
691
691
|
if spec.className and inst.ClassName ~= spec.className then
|
|
692
692
|
return
|
|
693
693
|
end
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
694
|
+
if spec.properties then
|
|
695
|
+
for key, value in spec.properties do
|
|
696
|
+
local coerced = coerceValue(inst, key, value)
|
|
697
|
+
local ok, err = pcall(function()
|
|
698
|
+
inst[key] = coerced
|
|
699
|
+
end)
|
|
700
|
+
if not ok then
|
|
701
|
+
table.insert(errors, Explorer.getPath(inst) .. "." .. key .. ": " .. tostring(err))
|
|
702
|
+
end
|
|
703
|
+
end
|
|
704
|
+
end
|
|
705
|
+
-- addChildren: insert new child instances (e.g. UIStroke, UICorner)
|
|
706
|
+
if spec.addChildren and type(spec.addChildren) == "table" then
|
|
707
|
+
for _, childSpec in ipairs(spec.addChildren) do
|
|
708
|
+
local childClass = childSpec.ClassName or childSpec.className
|
|
709
|
+
if childClass then
|
|
710
|
+
-- Skip if child of this class already exists (idempotent)
|
|
711
|
+
local skipIfExists = childSpec.skipIfExists ~= false
|
|
712
|
+
if skipIfExists then
|
|
713
|
+
local existing = inst:FindFirstChildOfClass(childClass)
|
|
714
|
+
if existing then
|
|
715
|
+
continue
|
|
716
|
+
end
|
|
717
|
+
end
|
|
718
|
+
local ok2, child = pcall(Instance.new, childClass)
|
|
719
|
+
if ok2 and child then
|
|
720
|
+
if childSpec.Name or childSpec.name then
|
|
721
|
+
child.Name = childSpec.Name or childSpec.name
|
|
722
|
+
end
|
|
723
|
+
-- Set props on the new child
|
|
724
|
+
local props = childSpec.properties
|
|
725
|
+
or childSpec.Properties
|
|
726
|
+
or childSpec.props
|
|
727
|
+
or childSpec.Props
|
|
728
|
+
or {}
|
|
729
|
+
-- Also check flattened keys
|
|
730
|
+
for k, v in childSpec do
|
|
731
|
+
if
|
|
732
|
+
k ~= "ClassName"
|
|
733
|
+
and k ~= "className"
|
|
734
|
+
and k ~= "Name"
|
|
735
|
+
and k ~= "name"
|
|
736
|
+
and k ~= "properties"
|
|
737
|
+
and k ~= "Properties"
|
|
738
|
+
and k ~= "props"
|
|
739
|
+
and k ~= "Props"
|
|
740
|
+
and k ~= "skipIfExists"
|
|
741
|
+
and k ~= "Children"
|
|
742
|
+
and k ~= "children"
|
|
743
|
+
then
|
|
744
|
+
props[k] = v
|
|
745
|
+
end
|
|
746
|
+
end
|
|
747
|
+
for pk, pv in props do
|
|
748
|
+
local coerced = coerceValue(child, pk, pv)
|
|
749
|
+
pcall(function()
|
|
750
|
+
child[pk] = coerced
|
|
751
|
+
end)
|
|
752
|
+
end
|
|
753
|
+
child.Parent = inst
|
|
754
|
+
else
|
|
755
|
+
table.insert(
|
|
756
|
+
errors,
|
|
757
|
+
Explorer.getPath(inst) .. ": failed to create " .. tostring(childClass)
|
|
758
|
+
)
|
|
759
|
+
end
|
|
760
|
+
end
|
|
701
761
|
end
|
|
702
762
|
end
|
|
703
763
|
modified = modified + 1
|
|
@@ -712,7 +772,7 @@ function Properties.bulkSet(spec)
|
|
|
712
772
|
if recording then
|
|
713
773
|
ChangeHistoryService:FinishRecording(recording, Enum.FinishRecordingOperation.Cancel)
|
|
714
774
|
end
|
|
715
|
-
return { success = false, error = "Provide either 'targets' array or 'root' + 'properties'" }
|
|
775
|
+
return { success = false, error = "Provide either 'targets' array or 'root' + 'properties'/'addChildren'" }
|
|
716
776
|
end
|
|
717
777
|
|
|
718
778
|
if recording then
|