1.2.2 • Published 3 years ago

rbxts-transformer-path v1.2.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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 version
  • It is designed for games, not plugins
  • It is unhelpful to errors and debugging
  • It defaults to default.project.json
  • It is a bit unstable.
  • It is slow because of function generator (I don't know how to optimize this)

Installation

  1. Run this command below:
npm i rbxts-transformer-path
  1. 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:

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