diff --git a/README.md b/README.md index e723f25..3f764e4 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,66 @@ Flamework + ECS = Flamecs 🔥 - Built-in Scheduler (soon) - Component Metadata (soon) +## Installation + +This package is an extension of Flamework and it must be installed and configured. If Flamework is already installed, you can install `@rbxts/flamecs` and skip these steps. + +### Install Flamework packages + +You can install all the necessary packages using the following command. + +```bash +npm install -D rbxts-transformer-flamework@latest +npm install @flamework/core + +# Install flamecs, if it isn't already +npm install @rbxts/flamecs +``` + +### Configure the transformer + +The Flamework transformer must be configured in your `tsconfig.json`. The `plugins` field shoukd be placed inside of the `compilerOptions` object. + +```json +{ + "compilerOptions": { + // Add `node_modules/@flamework` into your `typeRoots` field. + "typeRoots": ["node_modules/@rbxts", "node_modules/@flamework"], + + // Copy the following fields + "experimentalDecorators": true, + "plugins": [ + { + "transform": "rbxts-transformer-flamework", + }, + ] + } +} +``` + +### Configure your Rojo project + +Flamework uses a custom npm org and must be configured in your `default.project.json`. + +You should find the entry for `node_modules` and modify it to include `@flamework`. It should look something like this: + +```json +"node_modules": { + "@rbxts": { + "$path": "node_modules/@rbxts" + }, + "@flamework": { + "$path": "node_modules/@flamework" + } +} +``` + +### Recompile + +You may need to delete the `out` folder and recompile for Flamework's transformer to begin working. Afterwards, you are ready to use flamecs. + +## Demo + ```ts const positionEntity = spawn<[Vector3]>([new Vector3(10, 20, 30)]); print(has(positionEntity));