There should be a setting that makes ModuleScripts that are descendants of a Script with a RunContext of Client or LocalScript unable to be required by the server. Vice versa for ModuleScripts that are descendants of a Script with a RunContext of Legacy/Server.
This can probably be easily implemented with a :FindFirstAncestorWhichIsA() check.
This would probably be most useful to people who are using module loaders and/or want to have two ModuleScripts with the same name.
most of the work is done through an .Init function (or something equivalent) in the module itself, meaning most of the coding takes place in the module and not the script
Yeah the script relative ModuleAncestor works for modulescripts too, why wouldnt it
Yeah script.Parent is a valid ModuleAncestor entry
Yea i can do that
I feel like this is just bad practice, ig i can add computed values for ancestors tho (like --?module-ancestors {game.ServerScriptService[@self.Name]}) so u can use stuff with a specific name
Idk bro there isnât really a good way to distinguish client modules other than tags since you can design your game in any way, maybe you have your client modules all fragmented or everywhere for example
Iâll add a ModuleAncestorsExcluded setting to go along with ModuleExcludeTag aswell as a ModuleIncludeTag, also I just thought of a genius idea, what if scripts can only import modules with a ModuleIncludeTag if the script also has that tag?
E.g letâs say I wanna require ModuleA from ScriptA, ModuleA has a ModuleIncludeTag of âFooâ, but ScriptA doesnât so it isnât autocompleted, but if you add the ModuleIncludeTag to ScriptA now it can import it
The ModuleIncludeTag would fix this, simply add a Client tag to your requiring script and your module and itâll include it
I should probably make ModuleIncludeTag a list like ModuleAncestors is, so you can have multiple tags, each tag essentially being a âgroupâ of modules which can autoimport eachother
Added the ModuleIncludeTag setting which is Server, Client by default, if you tag 2 LuaSourceContainers with one of the tags, they are able to autoimport eachother (if the other is a ModuleScript)
How would I know what folder to use? Maybe the closest one to the module, maybe the one above that, maybe the first one with the tag (this would be really slow if you have alot of tags, i have to traverse the ancestor tree for each one), i dunno it just seems way too specific
If I applied ModuleIncludeAncestorTag to a singular folder, would I only be able to require things in that folder? Or would I also be able to ALSO require everything that doesnât have the ModuleIncludeTag tag at all, aka global modules?
ModuleIncludeSearchMode would determine if ModuleIncludeAncestorTag only searched the children of objects that have the tag or descendants of objects that have the tag. I donât think it should be the same as ModuleSearchMode considering people may want to check the descendants of instances in a service.
You would be able to require everything inside of it
You know I could probably add another value for ModuleSearchMode like useIncludeTag which uses the ModuleIncludeTags setting but only inside the ancestor