@quenty/loader 3.1.1 → 3.2.0-canary.241.a4e8214.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 +19 -0
- package/LICENSE.md +1 -1
- package/README.md +5 -3
- package/package.json +2 -2
- package/src/BounceTemplate.lua +6 -3
- package/src/BounceTemplateUtils.lua +39 -38
- package/src/GroupInfoUtils.lua +5 -3
- package/src/LegacyLoader.lua +6 -2
- package/src/Loader.lua +6 -2
- package/src/LoaderUtils.lua +4 -3
- package/src/PackageInfoUtils.lua +6 -4
- package/src/Queue.lua +30 -3
- package/src/ScriptInfoUtils.lua +4 -3
- package/src/StaticLegacyLoader.lua +4 -3
- package/src/Utils.lua +81 -80
- package/src/init.lua +56 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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
|
+
# [3.2.0-canary.241.a4e8214.0](https://github.com/Quenty/NevermoreEngine/compare/@quenty/loader@3.1.2...@quenty/loader@3.2.0-canary.241.a4e8214.0) (2022-01-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* Better error messages ([4a49909](https://github.com/Quenty/NevermoreEngine/commit/4a49909e607ca21d751da510f57ee0629808f11d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [3.1.2](https://github.com/Quenty/NevermoreEngine/compare/@quenty/loader@3.1.1...@quenty/loader@3.1.2) (2021-12-30)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @quenty/loader
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [3.1.1](https://github.com/Quenty/NevermoreEngine/compare/@quenty/loader@3.1.0...@quenty/loader@3.1.1) (2021-10-30)
|
|
7
26
|
|
|
8
27
|
|
package/LICENSE.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# Nevermore Loader
|
|
2
2
|
<div align="center">
|
|
3
|
-
<a href="http://quenty.github.io/
|
|
4
|
-
<img src="https://
|
|
3
|
+
<a href="http://quenty.github.io/NevermoreEngine/">
|
|
4
|
+
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/docs.yml/badge.svg" alt="Documentation status" />
|
|
5
5
|
</a>
|
|
6
6
|
<a href="https://discord.gg/mhtGUS8">
|
|
7
|
-
<img src="https://img.shields.io/
|
|
7
|
+
<img src="https://img.shields.io/discord/385151591524597761?color=5865F2&label=discord&logo=discord&logoColor=white" alt="Discord" />
|
|
8
8
|
</a>
|
|
9
9
|
<a href="https://github.com/Quenty/NevermoreEngine/actions">
|
|
10
10
|
<img src="https://github.com/Quenty/NevermoreEngine/actions/workflows/build.yml/badge.svg" alt="Build and release status" />
|
|
@@ -18,6 +18,8 @@ A simple module loader for Roblox
|
|
|
18
18
|
npm install @quenty/loader --save
|
|
19
19
|
```
|
|
20
20
|
|
|
21
|
+
<div align="center"><a href="https://quenty.github.io/NevermoreEngine/api/loader">View docs →</a></div>
|
|
22
|
+
|
|
21
23
|
## Installation with NPM
|
|
22
24
|
|
|
23
25
|
Install via NPM like this:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quenty/loader",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0-canary.241.a4e8214.0",
|
|
4
4
|
"description": "A simple module loader for Roblox",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Roblox",
|
|
@@ -26,5 +26,5 @@
|
|
|
26
26
|
"publishConfig": {
|
|
27
27
|
"access": "public"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "a4e821471f35998d63f38a4f4a578e07b4e79035"
|
|
30
30
|
}
|
package/src/BounceTemplate.lua
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Bounces the current named script to the expected version of this module
|
|
3
|
+
|
|
4
|
+
@private
|
|
5
|
+
@class BounceTemplate
|
|
6
|
+
]=]
|
|
4
7
|
|
|
5
8
|
local function waitForValue(objectValue)
|
|
6
9
|
local value = objectValue.Value
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
@class BounceTemplateUtils
|
|
3
|
+
@private
|
|
4
|
+
]=]
|
|
4
5
|
|
|
5
6
|
local BounceTemplate = script.Parent.BounceTemplate
|
|
6
7
|
|
|
@@ -9,57 +10,57 @@ local CREATE_ONLY_LINK = false
|
|
|
9
10
|
local BounceTemplateUtils = {}
|
|
10
11
|
|
|
11
12
|
function BounceTemplateUtils.isBounceTemplate(instance)
|
|
12
|
-
|
|
13
|
+
return instance:GetAttribute("IsBounceTemplate", true) == true
|
|
13
14
|
end
|
|
14
15
|
|
|
15
16
|
function BounceTemplateUtils.getTarget(instance)
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
if not BounceTemplateUtils.isBounceTemplate(instance) then
|
|
18
|
+
return nil
|
|
19
|
+
end
|
|
19
20
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
if instance:IsA("ObjectValue") then
|
|
22
|
+
return instance.Value
|
|
23
|
+
else
|
|
24
|
+
local found = instance:FindFirstChild("BounceTarget")
|
|
25
|
+
if found then
|
|
26
|
+
return found.Value
|
|
27
|
+
else
|
|
28
|
+
warn("[BounceTemplateUtils.getTarget] - Bounce template without BounceTarget")
|
|
29
|
+
return nil
|
|
30
|
+
end
|
|
31
|
+
end
|
|
31
32
|
end
|
|
32
33
|
|
|
33
34
|
function BounceTemplateUtils.create(target, linkName)
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
assert(typeof(target) == "Instance", "Bad target")
|
|
36
|
+
assert(type(linkName) == "string", "Bad linkName")
|
|
36
37
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
if CREATE_ONLY_LINK then
|
|
39
|
+
return BounceTemplateUtils.createLink(target, linkName)
|
|
40
|
+
end
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
local copy = BounceTemplate:Clone()
|
|
43
|
+
copy:SetAttribute("IsBounceTemplate", true)
|
|
44
|
+
copy.Name = linkName
|
|
44
45
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
local objectValue = Instance.new("ObjectValue")
|
|
47
|
+
objectValue.Name = "BounceTarget"
|
|
48
|
+
objectValue.Value = target
|
|
49
|
+
objectValue.Parent = copy
|
|
49
50
|
|
|
50
|
-
|
|
51
|
+
return copy
|
|
51
52
|
end
|
|
52
53
|
|
|
53
54
|
function BounceTemplateUtils.createLink(target, linkName)
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
assert(typeof(target) == "Instance", "Bad target")
|
|
56
|
+
assert(type(linkName) == "string", "Bad linkName")
|
|
56
57
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
local objectValue = Instance.new("ObjectValue")
|
|
59
|
+
objectValue.Name = linkName
|
|
60
|
+
objectValue.Value = target
|
|
61
|
+
objectValue:SetAttribute("IsBounceTemplate", true)
|
|
61
62
|
|
|
62
|
-
|
|
63
|
+
return objectValue
|
|
63
64
|
end
|
|
64
65
|
|
|
65
66
|
return BounceTemplateUtils
|
package/src/GroupInfoUtils.lua
CHANGED
package/src/LegacyLoader.lua
CHANGED
package/src/Loader.lua
CHANGED
package/src/LoaderUtils.lua
CHANGED
package/src/PackageInfoUtils.lua
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Utility methods to build a virtual graph of the existing package information set
|
|
3
|
+
@private
|
|
4
|
+
@class PackageInfoUtils
|
|
5
|
+
]=]
|
|
4
6
|
|
|
5
7
|
local Utils = require(script.Parent.Utils)
|
|
6
8
|
local ScriptInfoUtils = require(script.Parent.ScriptInfoUtils)
|
|
@@ -183,7 +185,7 @@ function PackageInfoUtils.tryLoadPackageFromInstance(packageInfoList, packageInf
|
|
|
183
185
|
if value and (value:IsA("Folder") or value:IsA("ModuleScript")) then
|
|
184
186
|
table.insert(packageInfoList, PackageInfoUtils.getOrCreatePackageInfo(value, packageInfoMap, scope))
|
|
185
187
|
else
|
|
186
|
-
|
|
188
|
+
error(("Invalid %q ObjectValue in package linking to nothing cannot be resolved into package dependency\n\t-> %s")
|
|
187
189
|
:format(instance.Name, instance:GetFullName()))
|
|
188
190
|
end
|
|
189
191
|
end
|
package/src/Queue.lua
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Private queue class for loading system.
|
|
3
|
+
|
|
4
|
+
@private
|
|
5
|
+
@class Queue
|
|
6
|
+
]=]
|
|
4
7
|
|
|
5
8
|
local Queue = {}
|
|
6
9
|
Queue.ClassName = "Queue"
|
|
7
10
|
Queue.__index = Queue
|
|
8
11
|
|
|
12
|
+
--[=[
|
|
13
|
+
Constructs a new queue
|
|
14
|
+
@return Queue<T>
|
|
15
|
+
]=]
|
|
9
16
|
function Queue.new()
|
|
10
17
|
return setmetatable({
|
|
11
18
|
_first = 0;
|
|
@@ -13,16 +20,28 @@ function Queue.new()
|
|
|
13
20
|
}, Queue)
|
|
14
21
|
end
|
|
15
22
|
|
|
23
|
+
--[=[
|
|
24
|
+
Pushes an entry to the left of the queue
|
|
25
|
+
@param value T
|
|
26
|
+
]=]
|
|
16
27
|
function Queue:PushLeft(value)
|
|
17
28
|
self._first = self._first - 1
|
|
18
29
|
self[self._first] = value
|
|
19
30
|
end
|
|
20
31
|
|
|
32
|
+
--[=[
|
|
33
|
+
Pushes an entry to the right of the queue
|
|
34
|
+
@param value T
|
|
35
|
+
]=]
|
|
21
36
|
function Queue:PushRight(value)
|
|
22
37
|
self._last = self._last + 1
|
|
23
38
|
self[self._last] = value
|
|
24
39
|
end
|
|
25
40
|
|
|
41
|
+
--[=[
|
|
42
|
+
Pops an entry from the left of the queue
|
|
43
|
+
@return T
|
|
44
|
+
]=]
|
|
26
45
|
function Queue:PopLeft()
|
|
27
46
|
if self._first > self._last then
|
|
28
47
|
error("Queue is empty")
|
|
@@ -35,6 +54,10 @@ function Queue:PopLeft()
|
|
|
35
54
|
return value
|
|
36
55
|
end
|
|
37
56
|
|
|
57
|
+
--[=[
|
|
58
|
+
Pops an entry from the right of the queue
|
|
59
|
+
@return T
|
|
60
|
+
]=]
|
|
38
61
|
function Queue:PopRight()
|
|
39
62
|
if self._first > self._last then
|
|
40
63
|
error("Queue is empty")
|
|
@@ -47,6 +70,10 @@ function Queue:PopRight()
|
|
|
47
70
|
return value
|
|
48
71
|
end
|
|
49
72
|
|
|
73
|
+
--[=[
|
|
74
|
+
Returns true if the queue is empty
|
|
75
|
+
@return boolean
|
|
76
|
+
]=]
|
|
50
77
|
function Queue:IsEmpty()
|
|
51
78
|
return self._first > self._last
|
|
52
79
|
end
|
package/src/ScriptInfoUtils.lua
CHANGED
package/src/Utils.lua
CHANGED
|
@@ -1,112 +1,113 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
@private
|
|
3
|
+
@class Utils
|
|
4
|
+
]=]
|
|
4
5
|
|
|
5
6
|
local Utils = {}
|
|
6
7
|
|
|
7
8
|
local function errorOnIndex(_, index)
|
|
8
|
-
|
|
9
|
+
error(("Bad index %q"):format(tostring(index)), 2)
|
|
9
10
|
end
|
|
10
11
|
|
|
11
12
|
local READ_ONLY_METATABLE = {
|
|
12
|
-
|
|
13
|
-
|
|
13
|
+
__index = errorOnIndex;
|
|
14
|
+
__newindex = errorOnIndex;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
function Utils.readonly(_table)
|
|
17
|
-
|
|
18
|
+
return setmetatable(_table, READ_ONLY_METATABLE)
|
|
18
19
|
end
|
|
19
20
|
|
|
20
21
|
function Utils.copyTable(target)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
local new = {}
|
|
23
|
+
for key, value in pairs(target) do
|
|
24
|
+
new[key] = value
|
|
25
|
+
end
|
|
26
|
+
return new
|
|
26
27
|
end
|
|
27
28
|
|
|
28
29
|
function Utils.count(_table)
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
local count = 0
|
|
31
|
+
for _, _ in pairs(_table) do
|
|
32
|
+
count = count + 1
|
|
33
|
+
end
|
|
34
|
+
return count
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
function Utils.getOrCreateValue(parent, instanceType, name, defaultValue)
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
38
|
+
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
|
|
39
|
+
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
|
|
40
|
+
assert(type(name) == "string", "Bad argument 'name'")
|
|
41
|
+
|
|
42
|
+
local foundChild = parent:FindFirstChild(name)
|
|
43
|
+
if foundChild then
|
|
44
|
+
if not foundChild:IsA(instanceType) then
|
|
45
|
+
warn(("[Utils.getOrCreateValue] - Value of type %q of name %q is of type %q in %s instead")
|
|
46
|
+
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
return foundChild
|
|
50
|
+
else
|
|
51
|
+
local newChild = Instance.new(instanceType)
|
|
52
|
+
newChild.Name = name
|
|
53
|
+
newChild.Value = defaultValue
|
|
54
|
+
newChild.Parent = parent
|
|
55
|
+
|
|
56
|
+
return newChild
|
|
57
|
+
end
|
|
57
58
|
end
|
|
58
59
|
|
|
59
60
|
function Utils.getValue(parent, instanceType, name, default)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
61
|
+
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
|
|
62
|
+
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
|
|
63
|
+
assert(type(name) == "string", "Bad argument 'name'")
|
|
64
|
+
|
|
65
|
+
local foundChild = parent:FindFirstChild(name)
|
|
66
|
+
if foundChild then
|
|
67
|
+
if foundChild:IsA(instanceType) then
|
|
68
|
+
return foundChild.Value
|
|
69
|
+
else
|
|
70
|
+
warn(("[Utils.getValue] - Value of type %q of name %q is of type %q in %s instead")
|
|
71
|
+
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
|
|
72
|
+
return nil
|
|
73
|
+
end
|
|
74
|
+
else
|
|
75
|
+
return default
|
|
76
|
+
end
|
|
76
77
|
end
|
|
77
78
|
|
|
78
79
|
function Utils.setValue(parent, instanceType, name, value)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
80
|
+
assert(typeof(parent) == "Instance", "Bad argument 'parent'")
|
|
81
|
+
assert(type(instanceType) == "string", "Bad argument 'instanceType'")
|
|
82
|
+
assert(type(name) == "string", "Bad argument 'name'")
|
|
83
|
+
|
|
84
|
+
local foundChild = parent:FindFirstChild(name)
|
|
85
|
+
if foundChild then
|
|
86
|
+
if not foundChild:IsA(instanceType) then
|
|
87
|
+
warn(("[Utils.setValue] - Value of type %q of name %q is of type %q in %s instead")
|
|
88
|
+
:format(instanceType, name, foundChild.ClassName, foundChild:GetFullName()))
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
foundChild.Value = value
|
|
92
|
+
else
|
|
93
|
+
local newChild = Instance.new(instanceType)
|
|
94
|
+
newChild.Name = name
|
|
95
|
+
newChild.Value = value
|
|
96
|
+
newChild.Parent = parent
|
|
97
|
+
end
|
|
97
98
|
end
|
|
98
99
|
|
|
99
100
|
|
|
100
101
|
function Utils.getOrCreateFolder(parent, folderName)
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
102
|
+
local found = parent:FindFirstChild(folderName)
|
|
103
|
+
if found then
|
|
104
|
+
return found
|
|
105
|
+
else
|
|
106
|
+
local folder = Instance.new("Folder")
|
|
107
|
+
folder.Name = folderName
|
|
108
|
+
folder.Parent = parent
|
|
109
|
+
return folder
|
|
110
|
+
end
|
|
110
111
|
end
|
|
111
112
|
|
|
112
113
|
|
package/src/init.lua
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
--[=[
|
|
2
|
+
Loads Nevermore and handles loading!
|
|
3
|
+
|
|
4
|
+
This is a centralized loader that handles the following scenarios:
|
|
5
|
+
|
|
6
|
+
* Specific layouts for npm node_modules
|
|
7
|
+
* Layouts for node_modules being symlinked
|
|
8
|
+
* Multiple versions of modules being used in conjunction with each other
|
|
9
|
+
* Relative path requires
|
|
10
|
+
* Require by name
|
|
11
|
+
* Replication to client and server
|
|
12
|
+
|
|
13
|
+
@class Loader
|
|
14
|
+
]=]
|
|
3
15
|
|
|
4
16
|
local ReplicatedStorage = game:GetService("ReplicatedStorage")
|
|
5
17
|
local ServerScriptService = game:GetService("ServerScriptService")
|
|
@@ -34,6 +46,27 @@ else
|
|
|
34
46
|
}
|
|
35
47
|
end
|
|
36
48
|
|
|
49
|
+
--[=[
|
|
50
|
+
Bootstraps the game by replicating packages to server, client, and
|
|
51
|
+
shared.
|
|
52
|
+
|
|
53
|
+
```lua
|
|
54
|
+
local ServerScriptService = game:GetService("ServerScriptService")
|
|
55
|
+
|
|
56
|
+
local loader = ServerScriptService:FindFirstChild("LoaderUtils", true).Parent
|
|
57
|
+
local packages = require(loader).bootstrapGame(ServerScriptService.ik)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
:::info
|
|
61
|
+
The game must be running to do this bootstrapping operation.
|
|
62
|
+
:::
|
|
63
|
+
|
|
64
|
+
@server
|
|
65
|
+
@function bootstrapGame
|
|
66
|
+
@param packageFolder Instance
|
|
67
|
+
@return Folder -- serverFolder
|
|
68
|
+
@within Loader
|
|
69
|
+
]=]
|
|
37
70
|
local function bootstrapGame(packageFolder)
|
|
38
71
|
assert(RunService:IsRunning(), "Game must be running")
|
|
39
72
|
|
|
@@ -48,6 +81,27 @@ local function bootstrapGame(packageFolder)
|
|
|
48
81
|
return serverFolder
|
|
49
82
|
end
|
|
50
83
|
|
|
84
|
+
--[=[
|
|
85
|
+
A type that can be loaded into a module
|
|
86
|
+
@type ModuleReference ModuleScript | number | string
|
|
87
|
+
@within Loader
|
|
88
|
+
]=]
|
|
89
|
+
|
|
90
|
+
--[=[
|
|
91
|
+
Returns a function that can be used to load modules relative
|
|
92
|
+
to the script specified.
|
|
93
|
+
|
|
94
|
+
```lua
|
|
95
|
+
local require = require(script.Parent.loader).load(script)
|
|
96
|
+
|
|
97
|
+
local maid = require("Maid")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
@function load
|
|
101
|
+
@param script Script -- The script to load dependencies for.
|
|
102
|
+
@return (moduleReference: ModuleReference) -> any
|
|
103
|
+
@within Loader
|
|
104
|
+
]=]
|
|
51
105
|
local function handleLoad(moduleScript)
|
|
52
106
|
assert(typeof(moduleScript) == "Instance", "Bad moduleScript")
|
|
53
107
|
|