Skip to content

Commit a413c5c

Browse files
DNR500cursoragent
andcommitted
docs: document code-classroom fork and upstream sync
Document code-classroom-base on MIT release tags, code-classroom integration, compare link for RPF-only diffs, editor-ui as primary consumer, GitHub Packages publishing, local dev, and refreshing the base branch from MIT releases. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 160e0f8 commit a413c5c

1 file changed

Lines changed: 61 additions & 0 deletions

File tree

README.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,67 @@ Scratch project by pressing "Create" on that website or by visiting <https://scr
66
This is a source code repository for the packages that make up the Scratch editor and a few additional support
77
packages. Use this if you'd like to learn about how the Scratch editor works or to contribute to its development.
88

9+
## Raspberry Pi Foundation fork (`code-classroom`)
10+
11+
This repository is a public fork of [scratchfoundation/scratch-editor](https://github.com/scratchfoundation/scratch-editor), maintained for Code Classroom and related products. Modified source is published under AGPL-3.0; published npm packages should correspond to a specific commit on this repository.
12+
13+
**Primary consumer:** this build is maintained for use with [editor-ui](https://github.com/RaspberryPiFoundation/editor-ui), which depends on `@RaspberryPiFoundation/scratch-gui` published from this repository.
14+
15+
### Upstream anchor and integration branch
16+
17+
| | |
18+
|---|---|
19+
| **Upstream anchor branch** | [`code-classroom-base`](https://github.com/RaspberryPiFoundation/scratch-editor/tree/code-classroom-base) — points at a [scratchfoundation/scratch-editor](https://github.com/scratchfoundation/scratch-editor) **release tag** only (no RPF packaging) |
20+
| **Upstream release** | [`v13.7.3`](https://github.com/scratchfoundation/scratch-editor/releases/tag/v13.7.3) (current tag on `code-classroom-base`) |
21+
| **Integration branch** | [`code-classroom`](https://github.com/RaspberryPiFoundation/scratch-editor/tree/code-classroom) — long-lived branch; RPF packaging, CI, and feature work merge here via PR |
22+
| **RPF changes (diff)** | [Compare `code-classroom` to `code-classroom-base`](https://github.com/RaspberryPiFoundation/scratch-editor/compare/code-classroom-base...code-classroom) — packaging, CI, and fork-only code |
23+
| **Published package** | [`@RaspberryPiFoundation/scratch-gui`](https://github.com/RaspberryPiFoundation/scratch-editor/pkgs/npm/scratch-gui) on GitHub Packages |
24+
25+
`code-classroom` is based on the latest upstream **release tag** on `code-classroom-base`, plus RPF-specific packaging and CI.
26+
27+
### Keeping `code-classroom` up to date with MIT
28+
29+
We track [scratchfoundation/scratch-editor](https://github.com/scratchfoundation/scratch-editor) **release tags** (not `develop`). Pick the latest release from [GitHub Releases](https://github.com/scratchfoundation/scratch-editor/releases) when refreshing the fork.
30+
31+
**`code-classroom-base`** holds the pure upstream snapshot. **`code-classroom`** holds RPF changes on top — see the [branch comparison](https://github.com/RaspberryPiFoundation/scratch-editor/compare/code-classroom-base...code-classroom) (or locally: `git diff code-classroom-base..code-classroom`). To adopt a newer MIT release, update `code-classroom-base` to the new tag, then integrate that bump into `code-classroom` via PR.
32+
33+
#### Refresh `code-classroom-base` to a newer release tag
34+
35+
Use the tag from [scratchfoundation/scratch-editor releases](https://github.com/scratchfoundation/scratch-editor/releases) (example: `v13.7.4-svg`):
36+
37+
```bash
38+
git fetch mit --tags
39+
git checkout code-classroom-base
40+
git reset --hard v13.7.4-svg
41+
git push origin code-classroom-base --force-with-lease
42+
```
43+
44+
### Local development
45+
46+
Use the Node version in [`.nvmrc`](.nvmrc). Install dependencies from the **repository root**:
47+
48+
```bash
49+
nvm install
50+
nvm use
51+
NODE_ENV=development npm ci
52+
npm run build
53+
```
54+
55+
Root [`.npmrc`](.npmrc) routes the `@RaspberryPiFoundation` scope to GitHub Packages. This requires a Github access token with `read:packages` and `repo`.
56+
57+
```bash
58+
cd packages/scratch-gui
59+
npm run test:lint
60+
npm run test:unit
61+
npm start # http://localhost:8601/
62+
```
63+
64+
### CI and publishing
65+
66+
- **Pull requests:** CI runs build and tests; **no** package is published to GitHub Packages.
67+
- **Push to `code-classroom`:** CI builds and publishes `@RaspberryPiFoundation/scratch-gui` with a version such as `13.7.3-code-classroom.YYYYMMDDHHMMSS`. Pin an explicit version in consumers (e.g. editor-ui); do not rely on floating `latest` in production.
68+
- Publishing is configured in [`.github/workflows/ci.yml`](.github/workflows/ci.yml) (inline publish step on the `code-classroom` branch only). Upstream’s npmjs release workflow (`.github/workflows/publish.yml`) is disabled on this fork.
69+
970
## What's in this repository?
1071

1172
The `packages` directory in this repository contains:

0 commit comments

Comments
 (0)