@quenty/tie 4.19.0 → 4.20.0-canary.367.6360546.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/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [4.20.0-canary.367.6360546.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/tie@4.19.0...@quenty/tie@4.20.0-canary.367.6360546.0) (2023-06-05)
7
+
8
+
9
+ ### Features
10
+
11
+ * Tie interfaces can export checked ValueObjects as Attributes ([6360546](https://github.com/Quenty/NevermoreEngine/commit/63605466f3f27342982556ac1866caafd0202c94))
12
+
13
+
14
+
15
+
16
+
6
17
  # [4.19.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/tie@4.18.0...@quenty/tie@4.19.0) (2023-05-26)
7
18
 
8
19
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quenty/tie",
3
- "version": "4.19.0",
3
+ "version": "4.20.0-canary.367.6360546.0",
4
4
  "description": "Tie allows interfaces to be defined between Lua OOP and Roblox objects.",
5
5
  "keywords": [
6
6
  "Roblox",
@@ -28,26 +28,26 @@
28
28
  "Quenty"
29
29
  ],
30
30
  "dependencies": {
31
- "@quenty/attributeutils": "^8.15.0",
32
- "@quenty/baseobject": "^6.2.1",
33
- "@quenty/brio": "^8.13.0",
34
- "@quenty/instanceutils": "^7.14.0",
35
- "@quenty/loader": "^6.2.1",
36
- "@quenty/maid": "^2.5.0",
37
- "@quenty/rx": "^7.11.0",
38
- "@quenty/statestack": "^8.14.0",
39
- "@quenty/string": "^3.1.0",
40
- "@quenty/symbol": "^2.2.0",
41
- "@quenty/table": "^3.2.0",
42
- "@quenty/valuebaseutils": "^7.14.0",
43
- "@quenty/valueobject": "^7.14.0"
31
+ "@quenty/attributeutils": "8.15.0",
32
+ "@quenty/baseobject": "6.2.1",
33
+ "@quenty/brio": "8.13.0",
34
+ "@quenty/instanceutils": "7.14.0",
35
+ "@quenty/loader": "6.2.1",
36
+ "@quenty/maid": "2.5.0",
37
+ "@quenty/rx": "7.11.0",
38
+ "@quenty/statestack": "8.15.0-canary.367.6360546.0",
39
+ "@quenty/string": "3.1.0",
40
+ "@quenty/symbol": "2.2.0",
41
+ "@quenty/table": "3.2.0",
42
+ "@quenty/valuebaseutils": "7.14.0",
43
+ "@quenty/valueobject": "7.15.0-canary.367.6360546.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@quenty/promise": "^6.5.0",
47
- "@quenty/signal": "^2.4.0"
46
+ "@quenty/promise": "6.5.0",
47
+ "@quenty/signal": "2.4.0"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "11058e90e51ea83d3dad6ae9abe59cc19c36b94b"
52
+ "gitHead": "63605466f3f27342982556ac1866caafd0202c94"
53
53
  }
@@ -11,6 +11,7 @@ local ValueBaseUtils = require("ValueBaseUtils")
11
11
  local TiePropertyImplementationUtils = require("TiePropertyImplementationUtils")
12
12
  local AttributeUtils = require("AttributeUtils")
13
13
  local AttributeValue = require("AttributeValue")
14
+ local ValueObject = require("ValueObject")
14
15
 
15
16
  local TiePropertyImplementation = setmetatable({}, BaseObject)
16
17
  TiePropertyImplementation.ClassName = "TiePropertyImplementation"
@@ -55,13 +56,28 @@ function TiePropertyImplementation:SetImplementation(implementation)
55
56
  end
56
57
 
57
58
  function TiePropertyImplementation:_updateImplementation(maid, implementation)
59
+ if ValueObject.isValueObject(implementation) then
60
+ local checkType = implementation:GetCheckType()
61
+
62
+ if checkType and AttributeUtils.isValidAttributeType(checkType) and checkType ~= "nil" then
63
+ self:_removeClassIfNeeded()
64
+
65
+ local attributeValue = AttributeValue.new(self._folder, self._memberDefinition:GetMemberName())
66
+ self:_syncMember(maid, attributeValue, implementation)
67
+ return
68
+ end
69
+ end
70
+
58
71
  if type(implementation) == "table" and implementation.Changed then
59
72
  local copy = self:_changeToClassIfNeeded("BindableFunction", implementation)
60
73
  copy.OnInvoke = function()
61
74
  return TieUtils.encode(implementation)
62
75
  end
63
76
  copy.Parent = self._folder
64
- elseif typeof(implementation) == "Instance" and implementation:IsA("ValueBase") then
77
+ return
78
+ end
79
+
80
+ if typeof(implementation) == "Instance" and implementation:IsA("ValueBase") then
65
81
  local resultingType = ValueBaseUtils.getValueBaseType(implementation.ClassName)
66
82
  if resultingType and AttributeUtils.isValidAttributeType(resultingType) and resultingType ~= "nil" then
67
83
  self:_removeClassIfNeeded()
@@ -73,22 +89,23 @@ function TiePropertyImplementation:_updateImplementation(maid, implementation)
73
89
  self:_syncMember(maid, copy, implementation)
74
90
  copy.Parent = self._folder
75
91
  end
76
- else
77
- if AttributeUtils.isValidAttributeType(typeof(implementation)) and implementation ~= nil then
78
- self:_removeClassIfNeeded()
79
- self._folder:SetAttribute(self._memberDefinition:GetMemberName(), implementation)
80
- return
81
- end
92
+ return
93
+ end
82
94
 
83
- local className = ValueBaseUtils.getClassNameFromType(typeof(implementation))
84
- if not className then
85
- error(("[TiePropertyImplementation] - Bad implementation value type %q, cannot set"):format(typeof(implementation)))
86
- end
95
+ if AttributeUtils.isValidAttributeType(typeof(implementation)) and implementation ~= nil then
96
+ self:_removeClassIfNeeded()
97
+ self._folder:SetAttribute(self._memberDefinition:GetMemberName(), implementation)
98
+ return
99
+ end
87
100
 
88
- local copy = self:_changeToClassIfNeeded(className, implementation)
89
- copy.Value = implementation
90
- copy.Parent = self._folder
101
+ local className = ValueBaseUtils.getClassNameFromType(typeof(implementation))
102
+ if not className then
103
+ error(("[TiePropertyImplementation] - Bad implementation value type %q, cannot set"):format(typeof(implementation)))
91
104
  end
105
+
106
+ local copy = self:_changeToClassIfNeeded(className, implementation)
107
+ copy.Value = implementation
108
+ copy.Parent = self._folder
92
109
  end
93
110
 
94
111
  function TiePropertyImplementation:_changeToClassIfNeeded(className)