This is a monorepo for the Blink debugger for Scratch.
If you find Blink useful and use it in your research, please cite:
Strijbol, N., De Proft, R., Goethals, K., Mesuere, B., Dawyndt, P., & Scholliers, C. (2024). Blink: An educational software debugger for Scratch. SoftwareX, vol. 25, p. 101617. https://doi.org/10.1016/j.softx.2023.101617
Start playing with Blink integrated in the Scratch IDE at https://scratch.ugent.be/blink/.
The Scratch project consists of a bunch of different subprojects, each with their own repository. Blink needs one additional package and a fork of two Scratch packages:
Below are installation instructions, assuming you use this repository.
- Have an environment with Node, npm and Bash.
- Clone this repository.
- Run the installation script:
./install.sh
If you want to run the installation manually (e.g. Windows), run each command from the installation script.
The installation instructions above will build the GUI once. However, if you change things, you'll need to rebuild everything.
- If you work on Itch, you'll need to run
npm run build
inside theitch
folder. Alternatively, you can runnpm run watch
to automatically rebuild Itch on changes. - If you work on the VM, you'll need to run
npm run build
inside thescratch-vm
folder. Alternatively, you can runnpm run watch
to automatically rebuild the Scratch VM on changes. - To see or work on the GUI, run
npm run start
inside thescratch-gui
folder.
In the site/public
folder, you'll find two sample projects that can be used to experiment with the debugger.
- Install VS Code
- Install Chrome or Chromium
- In VS Code, install the "Debugger for Chrome" extension (search for
msjsdiag.debugger-for-chrome
)
- Pick "Open Folder..." under the "File" menu.
- Select your
blink
repository.
Further setup steps will involve editing the launch configuration for your workspace:
- Open the "Run" panel in the VS Code UI (looks like a bug and a triangle)
- Depending on the state of your workspace, one of two options will appear:
- If you see "create a launch.json file" then select that and, in the drop-down menu, select "Chrome"
- Otherwise, click the "Open launch.json" button near the top (looks like a gear)
launch.json
should now look something like this:
{
"version": "0.2.0", // do not edit this version number
"configurations": [ // this section may be empty or may have an entry with type "chrome"
]
}
and to enable debugging of Blink, it needs to look like this:
{
"version": "0.2.0",
"configurations": [
{
"type": "chrome",
"request": "launch",
"name": "Launch blink in Chrome ",
"sourceMapPathOverrides": {
"webpack://GUI/./*": "${workspaceFolder}/scratch-gui/*",
"webpack://GUI/./node_modules/scratch-vm/*": "${workspaceFolder}/scratch-vm/*",
"webpack://itch-core/*": "${workspaceFolder}/itch/packages/core/*"
},
"sourceMaps": true,
"url": "http://localhost:8601",
"webRoot": "/:",
}
]
}