@rbxts/app-forge 0.7.2-alpha.9 → 0.7.2-prototype.2

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.
Files changed (54) hide show
  1. package/README.md +86 -372
  2. package/out/{vide/decorator.d.ts → appRegistry.d.ts} +1 -1
  3. package/out/{vide/decorator.luau → appRegistry.luau} +1 -1
  4. package/out/{vide/context.d.ts → context.d.ts} +1 -1
  5. package/out/global.d.ts +1 -1
  6. package/out/{vide/hooks → hooks}/useAppContext.d.ts +1 -1
  7. package/out/{vide/hooks → hooks}/useAppContext.luau +1 -1
  8. package/out/{vide/hooks → hooks}/useEventListener.luau +1 -1
  9. package/out/{vide/hooks → hooks}/usePx.luau +2 -2
  10. package/out/index.d.ts +5 -11
  11. package/out/init.luau +6 -14
  12. package/out/{vide/index.d.ts → mount.d.ts} +8 -8
  13. package/out/{vide/init.luau → mount.luau} +57 -109
  14. package/out/renderManager.d.ts +7 -0
  15. package/out/renderManager.luau +36 -0
  16. package/out/{vide/classes/rules → ruleEngine}/exclusiveGroup.d.ts +1 -1
  17. package/out/{vide/classes/rules → ruleEngine}/exclusiveGroup.luau +1 -1
  18. package/out/ruleEngine/index.d.ts +7 -0
  19. package/out/{vide/classes/rules → ruleEngine}/init.luau +14 -12
  20. package/out/{react/rules → ruleEngine}/parent.d.ts +1 -1
  21. package/out/{vide/classes/rules → ruleEngine}/parent.luau +1 -1
  22. package/out/{vide/types.d.ts → types.d.ts} +13 -13
  23. package/package.json +4 -10
  24. package/out/react/container.d.ts +0 -10
  25. package/out/react/container.luau +0 -60
  26. package/out/react/context.d.ts +0 -7
  27. package/out/react/context.luau +0 -12
  28. package/out/react/decorator.d.ts +0 -14
  29. package/out/react/decorator.luau +0 -51
  30. package/out/react/helpers.d.ts +0 -6
  31. package/out/react/helpers.luau +0 -74
  32. package/out/react/hooks/useAppContext.d.ts +0 -5
  33. package/out/react/hooks/useAppContext.luau +0 -16
  34. package/out/react/hooks/usePx.d.ts +0 -15
  35. package/out/react/hooks/usePx.luau +0 -117
  36. package/out/react/index.d.ts +0 -44
  37. package/out/react/init.luau +0 -123
  38. package/out/react/rules/index.d.ts +0 -6
  39. package/out/react/rules/init.luau +0 -27
  40. package/out/react/rules/parent.luau +0 -42
  41. package/out/react/types.d.ts +0 -44
  42. package/out/vide/classes/renders.d.ts +0 -25
  43. package/out/vide/classes/renders.luau +0 -255
  44. package/out/vide/classes/rules/index.d.ts +0 -7
  45. package/out/vide/classes/rules/parent.d.ts +0 -2
  46. package/out/vide/debug/index.d.ts +0 -3
  47. package/out/vide/debug/init.luau +0 -8
  48. /package/out/{vide/context.luau → context.luau} +0 -0
  49. /package/out/{vide/debug/debugger.d.ts → debugger.d.ts} +0 -0
  50. /package/out/{vide/debug/debugger.luau → debugger.luau} +0 -0
  51. /package/out/{vide/hooks → hooks}/useEventListener.d.ts +0 -0
  52. /package/out/{vide/hooks → hooks}/usePx.d.ts +0 -0
  53. /package/out/{vide/debug/logger.d.ts → logger.d.ts} +0 -0
  54. /package/out/{vide/debug/logger.luau → logger.luau} +0 -0
@@ -1,255 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- -- Packages
4
- local _vide = TS.import(script, TS.getModule(script, "@rbxts", "vide").src)
5
- local apply = _vide.apply
6
- local create = _vide.create
7
- -- Types
8
- -- Components
9
- local AppRegistry = TS.import(script, script.Parent.Parent, "decorator").AppRegistry
10
- -- Hooks
11
- local usePx = TS.import(script, script.Parent.Parent, "hooks", "usePx").usePx
12
- -- Classes
13
- local Rules = TS.import(script, script.Parent, "rules").default
14
- local Renders
15
- do
16
- local super = Rules
17
- Renders = setmetatable({}, {
18
- __tostring = function()
19
- return "Renders"
20
- end,
21
- __index = super,
22
- })
23
- Renders.__index = Renders
24
- function Renders.new(...)
25
- local self = setmetatable({}, Renders)
26
- return self:constructor(...) or self
27
- end
28
- function Renders:constructor()
29
- super.constructor(self)
30
- self.anchored = {}
31
- end
32
- function Renders:renderMount(props)
33
- local _binding = props
34
- local config = _binding.config
35
- local render = _binding.render
36
- local forge = _binding.forge
37
- if not forge.__px then
38
- local _debug = forge.debug
39
- local _result = config
40
- if _result ~= nil then
41
- _result = _result.px
42
- end
43
- _debug:logTag("px", "global", "Initializing px scaling", _result)
44
- local _result_1 = config
45
- if _result_1 ~= nil then
46
- _result_1 = _result_1.px.target
47
- end
48
- local _result_2 = config
49
- if _result_2 ~= nil then
50
- _result_2 = _result_2.px.resolution
51
- end
52
- local _result_3 = config
53
- if _result_3 ~= nil then
54
- _result_3 = _result_3.px.minScale
55
- end
56
- usePx(_result_1, _result_2, _result_3)
57
- forge.__px = true
58
- else
59
- forge.debug:logTag("px", "global", "Skipped duplicate px initialization")
60
- end
61
- if render then
62
- local _condition = render.name
63
- if _condition ~= "" and _condition then
64
- _condition = render.group
65
- end
66
- if _condition ~= "" and _condition then
67
- forge.debug:logTag("render", "global", "Rendering group by name", render)
68
- return forge:renderGroupByName(props)
69
- end
70
- local _value = render.names and render.group
71
- if _value ~= "" and _value then
72
- forge.debug:logTag("render", "global", "Rendering group by names", render)
73
- return forge:renderGroupByNames(props)
74
- end
75
- local _value_1 = render.name
76
- if _value_1 ~= "" and _value_1 then
77
- forge.debug:logTag("render", render.name, "Rendering single app")
78
- return forge:renderApp(props)
79
- end
80
- if render.names then
81
- forge.debug:logTag("render", "global", "Rendering multiple apps", render.names)
82
- return forge:renderApps(props)
83
- end
84
- local _value_2 = render.group
85
- if _value_2 ~= "" and _value_2 then
86
- forge.debug:logTag("render", "global", "Rendering group", render.group)
87
- return forge:renderGroup(props)
88
- end
89
- end
90
- forge.debug:logTag("render", "global", "Rendering all apps")
91
- return self:renderAll(props)
92
- end
93
- function Renders:renderNames(props, names, forge)
94
- if #names == 0 then
95
- error("No app names provided to render", 2)
96
- end
97
- -- ▼ ReadonlyArray.map ▼
98
- local _newValue = table.create(#names)
99
- local _callback = function(name)
100
- local _forge = forge
101
- local _object = table.clone(props)
102
- setmetatable(_object, nil)
103
- _object.render = {
104
- name = name,
105
- }
106
- return _forge:renderApp(_object)
107
- end
108
- for _k, _v in names do
109
- _newValue[_k] = _callback(_v, _k - 1, names)
110
- end
111
- -- ▲ ReadonlyArray.map ▲
112
- return _newValue
113
- end
114
- function Renders:collectByGroup(groups, filter)
115
- local result = {}
116
- -- ▼ ReadonlyMap.forEach ▼
117
- local _callback = function(app, name)
118
- local appGroup = app.renderGroup
119
- if not (appGroup ~= "" and appGroup) then
120
- return nil
121
- end
122
- if not (table.find(groups, appGroup) ~= nil) then
123
- return nil
124
- end
125
- if filter and not filter(name) then
126
- return nil
127
- end
128
- local _name = name
129
- table.insert(result, _name)
130
- end
131
- for _k, _v in AppRegistry do
132
- _callback(_v, _k, AppRegistry)
133
- end
134
- -- ▲ ReadonlyMap.forEach ▲
135
- return result
136
- end
137
- function Renders:normalizeGroups(group)
138
- local _group = group
139
- local _result
140
- if type(_group) == "table" then
141
- local _array = {}
142
- local _length = #_array
143
- table.move(group, 1, #group, _length + 1, _array)
144
- _result = _array
145
- else
146
- _result = { group }
147
- end
148
- return _result
149
- end
150
- function Renders:renderApp(props)
151
- local _name = props.render
152
- if _name ~= nil then
153
- _name = _name.name
154
- end
155
- local name = _name
156
- if not (name ~= "" and name) then
157
- error("renderApp requires an app name", 2)
158
- end
159
- local appClass = AppRegistry[name]
160
- if not appClass then
161
- error(`App "{name}" not registered`, 2)
162
- end
163
- self.debug:time("render", name)
164
- if not (self.loaded[name] ~= nil) then
165
- local render = appClass.constructor.new(props, name):render()
166
- apply(render)({
167
- Name = "Render",
168
- })
169
- local container = create("Frame")({
170
- Name = name,
171
- BackgroundTransparency = 1,
172
- AnchorPoint = Vector2.new(0.5, 0.5),
173
- Position = UDim2.fromScale(0.5, 0.5),
174
- Size = UDim2.fromScale(1, 1),
175
- [0] = render,
176
- })
177
- local _loaded = self.loaded
178
- local _arg1 = {
179
- container = container,
180
- render = render,
181
- }
182
- _loaded[name] = _arg1
183
- else
184
- self.debug:logTag("render", name, "Reusing existing render instance")
185
- end
186
- self:renderRules(name, props)
187
- self.debug:timeEnd("render", name)
188
- return self.loaded[name].container
189
- end
190
- function Renders:renderApps(props)
191
- local _names = props.render
192
- if _names ~= nil then
193
- _names = _names.names
194
- end
195
- local names = _names
196
- if not names then
197
- error("renderApps requires app names", 2)
198
- end
199
- return self:renderNames(props, names, self)
200
- end
201
- function Renders:renderGroup(props)
202
- local _group = props.render
203
- if _group ~= nil then
204
- _group = _group.group
205
- end
206
- local group = _group
207
- if not (group ~= "" and group) then
208
- error("renderGroup requires a group", 2)
209
- end
210
- local groups = self:normalizeGroups(group)
211
- return self:renderNames(props, self:collectByGroup(groups), self)
212
- end
213
- function Renders:renderGroupByName(props)
214
- local _binding = props.render or {}
215
- local group = _binding.group
216
- local name = _binding.name
217
- if not (group ~= "" and group) or not (name ~= "" and name) then
218
- error("Invalid renderGroupByName call", 2)
219
- end
220
- local groups = self:normalizeGroups(group)
221
- return self:renderNames(props, self:collectByGroup(groups, function(n)
222
- return n == name
223
- end), self)
224
- end
225
- function Renders:renderGroupByNames(props)
226
- local _binding = props.render or {}
227
- local group = _binding.group
228
- local names = _binding.names
229
- if not (group ~= "" and group) or not names then
230
- error("Invalid renderGroupByNames call", 2)
231
- end
232
- local groups = self:normalizeGroups(group)
233
- return self:renderNames(props, self:collectByGroup(groups, function(n)
234
- local _n = n
235
- return table.find(names, _n) ~= nil
236
- end), self)
237
- end
238
- function Renders:renderAll(props)
239
- local names = {}
240
- -- ▼ ReadonlyMap.forEach ▼
241
- local _callback = function(_, name)
242
- local _name = name
243
- table.insert(names, _name)
244
- return #names
245
- end
246
- for _k, _v in AppRegistry do
247
- _callback(_v, _k, AppRegistry)
248
- end
249
- -- ▲ ReadonlyMap.forEach ▲
250
- return self:renderNames(props, names, self)
251
- end
252
- end
253
- return {
254
- default = Renders,
255
- }
@@ -1,7 +0,0 @@
1
- import type Types from "../../types";
2
- import type AppForge from "../..";
3
- export default class Rules {
4
- protected processing: Set<string>;
5
- protected renderRules(this: AppForge, name: AppNames, props: Types.Props.Main): void;
6
- protected checkRules(this: AppForge, name: AppNames): void;
7
- }
@@ -1,2 +0,0 @@
1
- import type AppForge from "../..";
2
- export default function ParentRule(entry: AppNames, forge: AppForge): void;
@@ -1,3 +0,0 @@
1
- import Debugger from "./debugger";
2
- import Logger from "./logger";
3
- export { Debugger, Logger };
@@ -1,8 +0,0 @@
1
- -- Compiled with roblox-ts v3.0.0
2
- local TS = _G[script]
3
- local Debugger = TS.import(script, script, "debugger").default
4
- local Logger = TS.import(script, script, "logger").default
5
- return {
6
- Debugger = Debugger,
7
- Logger = Logger,
8
- }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes