1.2.2 • Published 3 years ago
rbxts-transformer-path v1.2.2
rbxts-transformer-path
A transformer designed for roblox-ts that allows to convert from filesystem project paths to pure Roblox tree structure (rojo required)
import { $path } from "rbxts-transformer-path";
const scripts = $path<Folder>("src/server/scripts");
function getDescendantsWhichIsA<T extends keyof Instances>(
parent: Instance,
className: T
) {
return parent
.GetDescendants()
.filter((object): object is Instances[T] => object.IsA(className));
}
getDescendantsWhichIsA(scripts, "ModuleScript").forEach((script) =>
require(script)
);
Warning
Client-side paths are not tested yet but planned in the next versionIt is designed for games, not pluginsIt is unhelpful to errors and debuggingIt defaults todefault.project.json
- It is a bit unstable.
- It is slow because of function generator (I don't know how to optimize this)
Installation
- Run this command below:
npm i rbxts-transformer-path
- Head over to the
tsconfig.json
on your recent project and put the following under compilerOptions:
"plugins": [
{ "transform": "rbxts-transformer-path" }
]
Credits
Credits for the code to:
- roblox-ts (for Rojo project stuff it's kinda complicated to make it one, well I did but it's not working)
- @flamework/transformer
1.2.2
3 years ago
1.2.0
3 years ago
1.1.3-8
3 years ago
1.1.3-7
3 years ago
1.1.3-6
3 years ago
1.1.3-5
3 years ago
1.1.3-4
3 years ago
1.2.1
3 years ago
1.1.3-3
3 years ago
1.1.3-2
3 years ago
1.1.3-1
3 years ago
1.1.3
3 years ago
1.1.2
3 years ago
1.1.2-1
3 years ago
1.1.1
3 years ago
1.1.0-4
3 years ago
1.1.0-3
3 years ago
1.1.0-2
3 years ago
1.1.0-1
3 years ago
1.1.0
3 years ago
1.0.3-2
3 years ago
1.0.2-3
3 years ago
1.0.2-5
3 years ago
1.0.2-4
3 years ago
1.0.2-2
3 years ago
1.0.2-1
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago