-
-
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.org/. You don't need to follow these instructions.
Make sure you have these installed:
You might have to restart your terminal or computer for them to be fully installed.
Also note that Scratch, and by consequence TurboWarp, are very large and may take a lot of time, disk space, and bandwidth (gigabytes, plural).
TurboWarp is organized in the same way as Scratch. We fork a few of them to add our changes. Of note to TurboWarp:
- TurboWarp/scratch-gui: the interface for the Scratch player and the TurboWarp website
- TurboWarp/scratch-vm: the compiler
- TurboWarp/scratch-render: Scratch's renderer with some relatively minimal changes
The process of getting each individual repo is essentially the same as Scratch, see: https://github.com/LLK/scratch-gui/wiki/Getting-Started
The GUI is the minimum to TurboWarp built.
# 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
cd scratch-gui
npm install
npm start
scratch-gui will load TurboWarp's forks of scratch-vm and scratch-render from GitHub automatically. However, you must obtain these separately if you wish to modify them.
You do not need to do this if you are only interesting in scratch-gui.
# 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-vm
git clone https://github.com/TurboWarp/scratch-render
cd scratch-vm
npm install
npm link
cd ..
cd scratch-render
npm install
npm link
cd ..
cd scratch-gui
npm link scratch-vm scratch-render
This will setup the repositories and link them so that scratch-gui will use your local versions instead of scratch-vm and scratch-render instead of the ones on GitHub.
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
$env:NODE_ENV="production"
npm run build
By default TurboWarp generates links like https://turbowarp.org/editor.html#123 However, by setting ROOT=/
and ROUTING_STYLE=wildcard
(in the same way that you set NODE_ENV=production
), you can get routes like https://turbowarp.org/123/editor instead. Note that this requires a server that will setup the proper aliases. The webpack development server in scratch-gui is setup for this. For production you'd want something more like https://github.com/TurboWarp/turbowarp.org
The build output is in the build
folder.