# rbxts-transformer-path

> A transformer designed for roblox-ts that allows to convert from filesystem project paths to pure Roblox tree structure (rojo required)

Latest version **1.2.2** (published 2021-08-19) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install rbxts-transformer-path
pnpm add rbxts-transformer-path
yarn add rbxts-transformer-path
bun add rbxts-transformer-path
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2021-08-19 |
| First published | 2021-07-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 185.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | memothelemo |
| Maintainers | memothelemo |

## Links

- npm: https://www.npmjs.com/package/rbxts-transformer-path
- Repository: https://github.com/memothelemo/rbxts-transformer-fs
- Homepage: https://github.com/memothelemo/rbxts-transformer-fs#readme
- Issues: https://github.com/memothelemo/rbxts-transformer-fs/issues
- npm.io page: https://npm.io/package/rbxts-transformer-path

## Dependencies (5)

- [ajv](https://npm.io/package/ajv.md) ^8.6.2
- [kleur](https://npm.io/package/kleur.md) ^4.1.4
- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [@types/fs-extra](https://npm.io/package/@types/fs-extra.md) ^9.0.12
- [ts-expose-internals](https://npm.io/package/ts-expose-internals.md) ^4.3.2

## Recent versions

- 1.2.2 (latest) — 2021-08-19
- 1.1.3-8 (next) — 2021-08-04
- 1.0.2-5 (@next) — 2021-07-25
- 1.2.1 — 2021-08-04
- 1.2.0 — 2021-08-04
- 1.1.3-7 — 2021-08-04
- 1.1.3-6 — 2021-08-04
- 1.1.3-5 — 2021-08-04
- 1.1.3-4 — 2021-08-04
- 1.1.3-3 — 2021-08-04
- 1.1.3-2 — 2021-08-04
- 1.1.3-1 — 2021-08-04
- 1.1.3 — 2021-08-02
- 1.1.2-1 — 2021-08-02
- 1.1.2 — 2021-08-02
- … 14 more at https://npm.io/package/rbxts-transformer-path/versions

## README

# rbxts-transformer-path

A transformer designed for roblox-ts that allows to convert from filesystem project paths to pure Roblox tree structure (rojo required)

```ts
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:

```bash
npm i rbxts-transformer-path
```

2. Head over to the `tsconfig.json` on your recent project and put the following under compilerOptions:

```json
"plugins": [
	{ "transform": "rbxts-transformer-path" }
]
```

## Credits

Credits for the code to:

- roblox-ts (for [Rojo project stuff](https://github.com/roblox-ts/roblox-ts/blob/master/src/Shared/classes/RojoResolver.ts) it's kinda complicated to make it one, well I did but it's not working)
- [@flamework/transformer](https://github.com/rbxts-flamework/transformer)

---
_Source: https://npm.io/package/rbxts-transformer-path · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
