This is the development repository for Smalruby 3, a Ruby-based visual programming environment forked from Scratch 3.0.
If you'd like to use Scratch, please visit the Scratch website. You can build your own Scratch project by pressing "Create" on that website or by visiting https://scratch.mit.edu/projects/editor/.
This is a source code repository for the packages that make up the Smalruby editor and a few additional support packages. Use this if you'd like to learn about how the Smalruby editor works or to contribute to its development.
The packages directory in this repository contains:
scratch-gui: Smalruby 3 GUI. The React-based web interface, customized for Smalruby (e.g., Ruby mode, custom extensions). Forked fromscratch-gui.scratch-vm: Smalruby 3 VM. The virtual machine that runs projects, with Opal integration for Ruby execution. Forked fromscratch-vm.scratch-renderdraws backdrops, sprites, and clones on the stage.scratch-svg-rendererprocesses SVG (vector) images for use with projects.
Please add to this list as more packages are migrated to the monorepo.
Each package has its own README.md file with more information about that package.
To install dependencies for all packages in the monorepo:
npm installNote: We strictly recommend using the Docker environment for development to ensure consistency. Please refer to the root README for Docker instructions.
To build all packages:
npm run buildTo build in development mode (faster, with source maps):
npm run build:devTo start the GUI development server (typically on http://localhost:8601):
npm startTo run all tests (lint, unit, integration):
npm testTo run unit tests only:
npm run test:unitTo run integration tests only:
npm run test:integrationSmalruby 3 integrates Opal to convert Ruby code into JavaScript that runs within the Scratch VM. The scratch-vm package handles this execution logic, while scratch-gui provides the Ruby code editor (using Ace Editor) and UI toggles.
Smalruby 3 supports loading and saving projects directly to Google Drive. For setup instructions, please see Google Drive Setup Guide.
We're migrating the Smalruby editor packages into this monorepo, following the upstream Scratch Editor structure. This allows us to manage all packages in one place.
We're migrating packages in stages.
Smalruby is based on Scratch from the Scratch Foundation. Scratch would not be what it is today without help from the global community of Scratchers and open-source contributors. Thank you for your contributions and support. Scratch on!
We provide Scratch free of charge, and want to keep it that way! Please consider making a donation to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!