A roblox-ts template for fully managed rojo projects.
- Table of Contents
- Features
- Prerequisites
- Installation
- Development Workflow
- Available Scripts
- Project Structure
- Deployment and Build
- Contributing
- License
- Support
- TypeScript Support with roblox-ts: Write robust, type-safe code using TypeScript.
- Seamless Rojo Integration: Enjoy real-time synchronization with Roblox Studio via Rojo.
- Development and Production Modes: Use hot-reloading during development and optimized builds for production.
- Linting and Formatting: Maintain code quality with ESLint and Prettier.
- CI/CD Ready: Integrates smoothly with GitHub Actions and other CI tools.
- Automation Scripts: A variety of npm scripts to automate building, syncing, deploying, and more.
Before you begin, ensure you have the following software installed:
-
Node.js: Version 16 or later.
-
pnpm: A globally installed package manager.
npm install -g pnpm
-
Roblox Studio: The latest version.
-
Rojo: Installed globally.
-
Git: Version control system.
-
Clone the Repository:
git clone https://github.com/eiei114/rbxts-template.git cd rbxts-template
-
Install Dependencies:
pnpm install
-
Set Up Git Hooks:
Configure Husky to enable pre-commit hooks.
pnpm run prepare
This template provides several scripts to support an efficient development process.
-
Start the Development Server:
This command compiles your TypeScript code and syncs changes with Roblox Studio via Rojo.
pnpm run dev:start
-
Watch for Changes:
Automatically recompile when source files change.
pnpm run dev:watch
-
Open the Project in Roblox Studio:
Launch the project directly in Roblox Studio.
pnpm run dev:open
Below is a list of the primary npm scripts included in this template:
-
Development Scripts:
dev:start
: Start the development server.dev:build
: Build the project in development mode.dev:compile
: Compile TypeScript files.dev:watch
: Watch for source code changes and recompile automatically.
-
Production Scripts:
prod:build
: Clean build directories and execute a production build (includes DarkLua processing).prod:sync
: Sync the project with Roblox Studio using Rojo.
-
Rojo Related:
rojo:build
: Build the Rojo project and output a.rbxl
file.
-
Linting and Formatting:
lint
: Check code quality with ESLint.lint:fix
: Automatically fix linting issues.textlint
: Check text files for lint issues.textlint:fix
: Automatically fix text linting issues.
-
Other Scripts:
assets:upload
: Upload external assets.clean
: Remove build folders (out/
anddist/
).commit
: Validate commit messages using commitlint.mantle:deploy:dev
/mantle:deploy:prod
: Deploy using Mantle.
A typical project structure looks like this:
rbxts-template/
├── src/ # Source TypeScript files.
├── out/ # Compiled output (automatically generated).
├── dist/ # Production build output.
├── build.project.json # Rojo project configuration file.
├── package.json # Project settings and scripts.
└── README.md # This documentation.
-
Development Sync:
Use Rojo to reflect your changes in real time within Roblox Studio.
pnpm run dev:sync
-
Production Sync:
After building for production, sync your project with Roblox Studio.
pnpm run prod:sync
-
Development Build:
Compile and build the project for development.
pnpm run dev:build
-
Production Build:
Clean the build folders and generate an optimized production build, including processing with DarkLua.
pnpm run prod:build
-
Rojo Build:
Generate a
.rbxl
file (Roblox Studio file) using Rojo.pnpm run rojo:build
-
Upload Assets:
If needed, upload external assets.
pnpm run assets:upload
Contributions are welcome! To contribute, please follow these steps:
- Fork the repository.
- Create a new branch: e.g.,
feature/new-feature
orbugfix/issue-description
. - Commit your changes: Follow the Conventional Commits standard for commit messages.
- Push your branch and create a Pull Request.
Please adhere to the project's coding guidelines and include tests where applicable.
This project is licensed under the ISC License. See the LICENSE file for details.
If you have any questions or need to report issues, please use the GitHub Issues section.
Happy coding!
Let's make Roblox development efficient and fun!