-
-
Notifications
You must be signed in to change notification settings - Fork 181
Getting Started
These are the instructions for setting up the TurboWarp development environment on your own computer.
If you just want to use TurboWarp, visit https://turbowarp.github.io/. You don't need to follow these instructions.
Eventually this process will be a bit more streamlined, but not yet.
Make a folder for TurboWarp -- there's going to be a lot of repositories. It will be quite big (over 1GB) so make sure you have enough space and aren't on a metered connection. It may take a while to download.
Clone all the repositories:
# if you intend to modify the code and submit a PR, make a fork in GitHub and clone that repository instead
git clone https://github.com/TurboWarp/scratch-gui
git clone https://github.com/TurboWarp/scratch-vm
git clone https://github.com/TurboWarp/scratch-render
Setup the repositories
cd scratch-vm
# `ci` is faster than `install` and will save you from the headache of having merge conflicts in package-lock.json
npm ci
npm link
cd ..
cd scratch-render
# scratch-render doesn't have a package-lock.json for some reason, so just use `install`
npm install
npm link
cd ..
cd scratch-gui
# `ci` is faster than `install` and will save you from the headache of having merge conflicts in package-lock.json
npm ci
npm link scratch-vm
npm link scratch-render
You will likely see lots of warnings about deprecated dependencies and security vulnerabilities. This is normal. We let upstream handle all dependency management, so talk to upstream about it if this concerns you.
Running the development server
# in the `scratch-gui` folder
npm start
Once it starts (it will take a while), visit http://localhost:8601. You can make changes in the code in any of the repositories and they should be automatically recompiled.
Building an optimized production version
When deploying TurboWarp to a website, you should enable production mode. This will result in faster execution and a greatly reduced file size.
# in the `scratch-gui` folder
# mac, linux
NODE_ENV=production npm run build
# windows command prompt (untested)
set NODE_ENV=production
npm run build
# windows powershell (untested)
$env:NODE_ENV="production"
npm run build
The build output is in the build
folder.