Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Setup article #123

Merged
merged 10 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions docs/setup-guide.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,24 @@ If you're using PowerShell for the first time, you may get an error about "runni

In this guide, we will introduce how to create a roblox-ts game.

Make sure you have an up-to-date version of Node.js installed and your current working directory is the one where you intend to create a project. Run the following command in your command line:
Make sure you have an up-to-date version of Node.js installed and your current working directory is an empty folder that you intend to create your project in. Run the following command in your command line:

```bash npm2yarn
```bash title="Terminal"
npm init roblox-ts
```

The tool will guide you through some questions to set up your project:
1. `Project directory` - What is the name of the folder you want to put your project in? This folder shouldn't exist yet, the tool will create it for you!
1. `Project directory` - Since you're already in the directory you want to create a project in, just enter a period (`.`) to select your current directory and press `Enter`.
2. `Select template` - What type of roblox-ts project is this? roblox-ts can be used to build plugins and packages too, but in this case we want to make a game, so press `Enter` once.
3. `Configure Git` - Do you want to use [Git](https://git-scm.com/) for version control? Press `Y` or `N` to make your choise.
4. `Configure ESLint` - Do you want to use [ESLint](https://eslint.org/) to check your code for correctness?
5. `Configure Prettier` - Do you want to use [Prettier](https://prettier.io/) to format your code?
6. `Configure VSCode Project Settings` - Do you want the tool to create a `.vscode` folder with settings optimized for roblox-ts development? If you're using VSCode to write code, you should use this.
7. `Multiple package managers detected. Select package manager:` - Which package manager do you want to use with this project? roblox-ts works best with `npm` and support for alternative package managers is not gauranteed. (If you don't have other package managers installed, this step won't appear!)
LouieK22 marked this conversation as resolved.
Show resolved Hide resolved

LouieK22 marked this conversation as resolved.
Show resolved Hide resolved
:::tip
To use ESLint and Prettier within VSCode, you can install their VSCode extensions which directly integrate their features into VSCode.
Many of the tools used here can be directly integrated into VSCode with extensions. We highly reccommend the roblox-ts extension to improve your editing experience. The roblox-ts extension not only provides extra diagnostic information, but also lets you build your code with one click.
LouieK22 marked this conversation as resolved.
Show resolved Hide resolved
- [roblox-ts VSCode extension](https://marketplace.visualstudio.com/items?itemName=Roblox-TS.vscode-roblox-ts)
- [ESLint VSCode extension](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- [Prettier VSCode extension](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
LouieK22 marked this conversation as resolved.
Show resolved Hide resolved
:::
Expand All @@ -49,13 +51,13 @@ code project-name

## Running Your Code

roblox-ts has a feature called "watch mode" where it will continuously build your code as you write it. You can start watch mode with:
roblox-ts has a feature called "watch mode" where it will continuously build your code as you write it. You can start watch mode from the [VSCode extension](https://marketplace.visualstudio.com/items?itemName=Roblox-TS.vscode-roblox-ts) or via the command line:

```bash npm2yarn
```bash title="Terminal"
npm run watch
```

Once roblox-ts is running, you need to start Rojo to start syncing your code into Roblox studio you can do this from the VSCode extension or via the command line:
Once roblox-ts is running, you need to start Rojo to start syncing your code into Roblox studio you can do this from the [VSCode extension](https://marketplace.visualstudio.com/items?itemName=evaera.vscode-rojo) or via the command line:

```bash title="Terminal"
rojo serve
Expand Down
1 change: 1 addition & 0 deletions docs/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Options:
--usePolling use polling for watch mode [boolean] [default: false]
--verbose enable verbose logs [boolean] [default: false]
--noInclude do not copy include files [boolean] [default: false]
--logStringChanges logs changes to legacy string argument offsets [boolean] [default: false]
--logTruthyChanges logs changes to truthiness evaluation from Lua truthiness rules [boolean] [default: false]
--writeOnlyChanged [boolean] [default: false]
--type override project type [choices: "game", "model", "package"]
Expand Down
1 change: 0 additions & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const config: Config = {
docs: {
sidebarPath: "./sidebars.ts",
editUrl: "https://github.com/roblox-ts/roblox-ts.com/blob/master/",
remarkPlugins: [[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }]],
},
theme: {
customCss: "./src/css/custom.css",
Expand Down
27 changes: 0 additions & 27 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
"dependencies": {
"@docusaurus/core": "3.1.1",
"@docusaurus/preset-classic": "3.1.1",
"@docusaurus/remark-plugin-npm2yarn": "^3.1.1",
"@mdx-js/react": "^3.0.0",
"@monaco-editor/react": "^4.6.0",
"@types/path-browserify": "^1.0.2",
Expand Down
Loading