Scratch Blocks is a library for building creative computing interfaces.
  • JavaScript 62.8%
  • TypeScript 35%
  • Python 2.2%
Find a file
Christopher Willis-Ford 945fdf96c4
Some checks failed
build-scratch-blocks / lint (push) Has been cancelled
build-scratch-blocks / build-and-test (push) Has been cancelled
Merge pull request #3574 from scratchfoundation/ci/add-pr-trigger
ci: run build and test on pull requests
2026-04-28 14:21:32 -07:00
.github ci: run build and test on pull requests 2026-04-28 14:17:11 -07:00
.husky chore: add husky hook for commitlint 2024-10-18 13:48:00 -07:00
.tx Sync transtions with Transifex 2018-08-10 09:02:57 -04:00
i18n chore(deps): update eslint-config-scratch to v14.0.0 2026-03-06 15:35:54 -08:00
media fix: enable and style workspace comments (#82) 2024-06-12 09:27:41 -07:00
msg style: use prettier config from eslint-config-scratch 2026-03-05 16:35:03 -08:00
src style: fix lint errors reported after update 2026-04-28 10:10:27 -07:00
tests style: fix lint errors reported after update 2026-04-28 10:10:27 -07:00
.editorconfig Restore editor config 2016-05-03 17:55:53 -04:00
.gitignore build: don't separate build from dist 2026-04-13 14:27:01 -07:00
.npmignore fix(deps): use Blockly 12 beta instead of RC 2024-12-10 09:45:15 -08:00
.npmrc Setting up npm registry for this repo. (#520) 2016-08-19 03:58:43 -07:00
.nvmrc chore(deps): update node.js to v24 2026-03-06 16:10:44 +00:00
AGENTS.md docs: add an item for updating docs, including AGENTS.md 2026-03-31 10:33:54 -07:00
commitlint.config.js chore(deps): update eslint-config-scratch to v14.0.0 2026-03-06 15:35:54 -08:00
eslint.config.mjs style: remove now-unnecessary lint rule overrides 2026-04-01 12:45:32 -07:00
LICENSE Rename COPYING to LICENSE. Re GH-304 2016-05-03 17:07:19 -04:00
package-lock.json chore(deps): update dependency @commitlint/cli to v20.5.2 2026-04-28 17:30:21 +00:00
package.json chore(deps): update dependency @commitlint/cli to v20.5.2 2026-04-28 17:30:21 +00:00
prettier.config.mjs style: use prettier config from eslint-config-scratch 2026-03-05 16:35:03 -08:00
README.md test: replace jsunit tests with vitest 2026-03-20 19:06:52 -07:00
release.config.js style: use prettier config from eslint-config-scratch 2026-03-05 16:35:03 -08:00
renovate.json5 style: use prettier config from eslint-config-scratch 2026-03-05 16:35:03 -08:00
TRADEMARK docs: update docs for scratch-blocks@^2 2026-03-04 15:12:16 -08:00
tsconfig.build.json build: configure tsconfig separately for lint vs build 2026-03-20 19:16:40 -07:00
tsconfig.json build: configure tsconfig separately for lint vs build 2026-03-20 19:16:40 -07:00
vitest.config.ts test: replace jsunit tests with vitest 2026-03-20 19:06:52 -07:00
webpack.config.js build: don't separate build from dist 2026-04-13 14:27:01 -07:00

scratch-blocks

Scratch Blocks is a library for building creative computing interfaces.

An image of Scratch Blocks running on a tablet

Version 2.0

The Scratch and Blockly teams are excited to announce the release of Scratch Blocks 2.0! This release is no longer a fork of Blockly, but rather depends on Blockly as a library. We've also updated from version (mumble mumble) of Blockly to version 12, which includes many, many bug fixes and improvements.

There will likely be a few bumps in the road as we work toward a user-facing release of this work, but we're excited to share the code and look forward to your feedback! If you see any problems, please check the issues and if you don't see it there, please consider filing an issue with as much detail as possible. Thank you!

Introduction

Scratch Blocks builds on the Blockly library from Google and the Raspberry Pi Foundation, to provide a design specification and codebase for building creative computing interfaces. Together with the Scratch Virtual Machine (VM) this codebase allows for the rapid design and development of visual programming interfaces. Like Blockly, Scratch Blocks is written in TypeScript and bundled with webpack. Unlike Blockly, Scratch Blocks does not use code generators, but rather leverages the Scratch Virtual Machine to create highly dynamic, interactive programming environments.

Documentation

The "getting started" guide including FAQ and design documentation can be found in the wiki.

Donate

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!

Development

npm ci
npm run build

Testing

Unit tests run in jsdom and need no additional setup:

npm run test:unit

Browser tests run in Chromium via Playwright. Install the browser once after npm ci:

npx playwright install chromium
npm run test:browser

To run all tests:

npm test

To debug a failing browser test with a visible browser window:

npm run test:browser -- --browser.headless=false

or, to also pause on startup and open devtools:

PWDEBUG=1 npm run test:browser

Committing

This project uses semantic release to ensure version bumps follow semver so that projects depending on it don't break unexpectedly.

In order to automatically determine version updates, semantic release expects commit messages to follow the conventional-changelog specification.

You can use the commitizen CLI to make commits formatted in this way:

npm install -g commitizen@latest cz-conventional-changelog@latest

Now you're ready to make commits using git cz.