Skip to content

Commit 0b5d71f

Browse files
committed
merge develop
2 parents b162687 + 27c18f2 commit 0b5d71f

File tree

136 files changed

+30336
-2019
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+30336
-2019
lines changed

.github/workflows/node.js.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ jobs:
99
runs-on: ubuntu-latest
1010

1111
steps:
12-
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
12+
- uses: actions/checkout@v4
1313
with:
1414
persist-credentials: false
1515
- name: Install Node.js
16-
uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af
16+
uses: actions/setup-node@v4
1717
with:
18-
node-version: 20
18+
node-version: 22
1919
cache: npm
2020
- run: npm ci
2121
- run: npm run build

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ npm-*
2626

2727
# for act
2828
.secrets
29+
.env
30+
.env.*

.vscode/settings.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"files.watcherExclude": {
3+
"**/.git/objects/**": true,
4+
"**/.git/subtree-cache/**": true,
5+
"**/.hg/store/**": true,
6+
"**/.dart_tool": true,
7+
"**/.git/**": true,
8+
"**/node_modules/**": true,
9+
"**/.vscode/**": true
10+
}
11+
}

LICENSING_CLARIFICATION.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Licensing Clarification for TurboWarp Fork
2+
3+
## Plain-English Explanation
4+
5+
* **Open-Source Frontend (GPLv3):** The modified TurboWarp code in this repository is fully open source under **GNU GPL version 3**. We provide the complete source and license text here, so we are in full compliance with GPLv3. All changes to the TurboWarp frontend are also released under GPLv3.
6+
7+
* **Separate Proprietary Backend:** Our system also has a proprietary backend API (for saving/loading projects) and a proprietary main frontend (on another domain). **These are not included or distributed in this repository.** They remain private and closed-source.
8+
9+
* **Normal Web Communication:** The TurboWarp frontend (served from `blockcompiler.codetorch.net`) runs in the browser and talks to our backend over regular HTTP/REST calls. This is just like any two separate programs talking over the network. According to the Free Software Foundation’s GPL FAQ, communication via sockets/HTTP is a **normal arms‑length interface** between independent programs. In other words, embedding the GPL frontend in an iframe and calling the backend API does **not** fuse them into one combined program.
10+
11+
* **No “GPL Infection” Across Network:** Because the frontend and backend only communicate over the network, the backend remains independent. The GPL’s copyleft only “infects” derived works that are distributed together as one program. Since our backend is neither combined into the GPL code nor distributed with it, the GPL does not require the backend’s source to be disclosed.
12+
13+
* **No Distribution of Backend Code:** Crucially, we never distribute the proprietary backend code (nor the proprietary frontend code). The GPL’s requirements kick in only when you “convey” or distribute the software. Running the software on our servers and letting users interact with it does **not** count as distributing it under GPLv3. The GPL FAQ explicitly says a company can run a modified GPL program on a website **without** releasing its source, because it was never actually conveyed to users.
14+
15+
* **Bottom Line for Developers:** In simple terms, **we comply fully with GPLv3 for the TurboWarp frontend**, and we clarify that the closed-source backend/main frontend are entirely separate. Calling our API from the GPL frontend does not impose GPL obligations on the backend. This setup (open GPL frontend + closed proprietary backend) is a common approach: it allows everyone to use and improve the open client code while keeping the private server code proprietary.
16+
17+
## Formal Legal Notice
18+
19+
1. **GPLv3 Frontend Compliance:** The TurboWarp-derived code in this repository is licensed under the **GNU General Public License version 3 (GPLv3)**. All source code for the modified frontend is made available here under GPLv3, in accordance with Section 6 of the GPLv3. This ensures full compliance with the license terms for any distributed or modified copies of the frontend.
20+
21+
2. **Separate Proprietary Components:** The proprietary backend API and the proprietary main frontend (hosted on a separate domain) are independent programs. They communicate with the GPL-licensed frontend solely via standard web protocols (HTTP/REST). As the Free Software Foundation’s GPL FAQ explains, communication by sockets or HTTP “is normally used between two separate programs”. Therefore, these proprietary components are **not combined** into the GPL-covered work, but merely **aggregated** with it in an arms‑length fashion.
22+
23+
3. **No Derivative Work or GPL Extension:** Because the frontend and backend remain separate programs, the proprietary backend and frontend code are **not derivative works** of the GPL code. Consequently, the GPLv3 copyleft obligations do not extend to those proprietary components. This is consistent with GPL guidance that distributing GPL software alongside proprietary software with only network-level communication does **not** force the proprietary code to become GPL.
24+
25+
4. **Non-Distribution of Backend Code:** The proprietary backend code is **never distributed** in binary or source form to users of this project. Under GPLv3, obligations to provide source apply only to conveyed copies. As noted in the GPL FAQ, running or serving a GPL program on a server (“making it available over a network”) does not count as distribution of the program itself. Thus, since the backend is only accessed remotely and not conveyed, GPLv3 imposes no requirement to disclose its source. (Had a network distribution trigger been desired, an Affero GPL would be required; see FSF explanation.)
26+
27+
5. **Conclusion:** In summary, all code in this repository remains under GPLv3 and fully complies with that license. The proprietary backend and proprietary main frontend are independent and closed-source, and their interaction with the GPL frontend via HTTP/iframe does not violate GPLv3. This structure is legally permissible under GPLv3 as interpreted by the FSF. Users are free to use, modify, and redistribute the TurboWarp frontend code under GPLv3, and the proprietary components remain exempt from GPL source-disclosure obligations because they are not derived from or distributed with the GPL-covered code.
28+
29+
**Sources:** This notice is based on the GNU GPLv3 license text and the FSF’s GNU GPL FAQ guidance, including clarifications that networked communication (sockets/HTTP) between GPL and non-GPL software generally does not create a single combined work, and that running a modified GPL program on a server without distributing it does not require publishing its source. These principles ensure that our use of the proprietary API and frontend does not extend GPL obligations beyond the open TurboWarp code.

README.md

Lines changed: 22 additions & 293 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
11
## CodeTorch Block Compiler
22

3-
Modified version of TurboWarp (a modified version of Scratch) for use in the `CodeTorch Block Compiler Parent` project. ([CodeTorch Block Compiler Parent](https://github.com/CodeTorchNET/Block-Compiler-Parent))
3+
This repository contains a modified version of **TurboWarp** (itself a modified version of Scratch) adapted for the CodeTorch project.
44

5-
For setup instructions, follow [these steps](https://github.com/CodeTorchNET/Block-Compiler-Parent?tab=readme-ov-file#step-4-install-the-compiler) to install the compiler. If you'd like to set up the entire project, refer to the complete [installation guide](https://github.com/CodeTorchNET/Block-Compiler-Parent?tab=readme-ov-file#installation-guide).
5+
### Licensing
66

7-
<br>
8-
<br>
9-
<br>
10-
<br>
11-
<br>
12-
<br>
13-
<br>
14-
<br>
15-
<br>
16-
<br>
17-
<br>
18-
<br>
19-
<br>
20-
<br>
21-
<br>
22-
<br>
23-
<br>
24-
<br>
25-
<br>
7+
* **GPLv3 Code**
8+
All code modifications to TurboWarp/Scratch are licensed under the GNU General Public License version 3 (GPLv3), per the original license terms.
9+
10+
* **Proprietary Assets**
11+
The SVG files located at:
12+
13+
- `src/lib/default-project/frame1.svg`
14+
- `src/lib/default-project/frame2.svg`
15+
16+
are **not** covered by AGPL. They are proprietary to CodeTorch and licensed only for use within the CodeTorch ecosystem. Redistribution or modification outside CodeTorch is prohibited without express written consent.
2617

2718
---
2819

29-
scratch-gui modified for use in [TurboWarp](https://turbowarp.org/)
20+
# Why is the rest of CodeTorch closed-source?
21+
22+
For a detailed explanation of our licensing approach and how we comply with open-source requirements, please see [LICENSING_CLARIFICATION.md](./LICENSING_CLARIFICATION.md).
23+
24+
---
25+
26+
27+
<br>
28+
<br>
3029

30+
README from original turbowarp repository:
3131
## Setup
3232

3333
See https://docs.turbowarp.org/development/getting-started to setup the complete TurboWarp environment.
@@ -54,274 +54,3 @@ Redistribution and use in source and binary forms, with or without modification,
5454
5555
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
5656
```
57-
58-
src/lib/default-project/dango.svg is based on [Twemoji](https://twemoji.twitter.com/) and is licensed under CC BY 4.0 https://creativecommons.org/licenses/by/4.0/
59-
60-
<!--
61-
62-
# scratch-gui
63-
#### Scratch GUI is a set of React components that comprise the interface for creating and running Scratch 3.0 projects
64-
65-
## Installation
66-
This requires you to have Git and Node.js installed.
67-
68-
In your own node environment/application:
69-
```bash
70-
npm install https://github.com/LLK/scratch-gui.git
71-
```
72-
If you want to edit/play yourself:
73-
```bash
74-
git clone https://github.com/LLK/scratch-gui.git
75-
cd scratch-gui
76-
npm install
77-
```
78-
79-
**You may want to add `--depth=1` to the `git clone` command because there are some [large files in the git repository history](https://github.com/LLK/scratch-gui/issues/5140).**
80-
81-
## Getting started
82-
Running the project requires Node.js to be installed.
83-
84-
## Running
85-
Open a Command Prompt or Terminal in the repository and run:
86-
```bash
87-
npm start
88-
```
89-
Then go to [http://localhost:8601/](http://localhost:8601/) - the playground outputs the default GUI component
90-
91-
## Developing alongside other Scratch repositories
92-
93-
### Getting another repo to point to this code
94-
95-
96-
If you wish to develop `scratch-gui` alongside other scratch repositories that depend on it, you may wish
97-
to have the other repositories use your local `scratch-gui` build instead of fetching the current production
98-
version of the scratch-gui that is found by default using `npm install`.
99-
100-
Here's how to link your local `scratch-gui` code to another project's `node_modules/scratch-gui`.
101-
102-
#### Configuration
103-
104-
1. In your local `scratch-gui` repository's top level:
105-
1. Make sure you have run `npm install`
106-
2. Build the `dist` directory by running `BUILD_MODE=dist npm run build`
107-
3. Establish a link to this repository by running `npm link`
108-
109-
2. From the top level of each repository (such as `scratch-www`) that depends on `scratch-gui`:
110-
1. Make sure you have run `npm install`
111-
2. Run `npm link scratch-gui`
112-
3. Build or run the repository
113-
114-
#### Using `npm run watch`
115-
116-
Instead of `BUILD_MODE=dist npm run build`, you can use `BUILD_MODE=dist npm run watch` instead. This will watch for changes to your `scratch-gui` code, and automatically rebuild when there are changes. Sometimes this has been unreliable; if you are having problems, try going back to `BUILD_MODE=dist npm run build` until you resolve them.
117-
118-
#### Oh no! It didn't work!
119-
120-
If you can't get linking to work right, try:
121-
* Follow the recipe above step by step and don't change the order. It is especially important to run `npm install` _before_ `npm link` as installing after the linking will reset the linking.
122-
* Make sure the repositories are siblings on your machine's file tree, like `.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-gui/` and `.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-www/`.
123-
* Consistent node.js version: If you have multiple Terminal tabs or windows open for the different Scratch repositories, make sure to use the same node version in all of them.
124-
* If nothing else works, unlink the repositories by running `npm unlink` in both, and start over.
125-
126-
## Testing
127-
### Documentation
128-
129-
You may want to review the documentation for [Jest](https://facebook.github.io/jest/docs/en/api.html) and [Enzyme](http://airbnb.io/enzyme/docs/api/) as you write your tests.
130-
131-
See [jest cli docs](https://facebook.github.io/jest/docs/en/cli.html#content) for more options.
132-
133-
### Running tests
134-
135-
*NOTE: If you're a Windows user, please run these scripts in Windows `cmd.exe` instead of Git Bash/MINGW64.*
136-
137-
Before running any tests, make sure you have run `npm install` from this (scratch-gui) repository's top level.
138-
139-
#### Main testing command
140-
141-
To run linter, unit tests, build, and integration tests, all at once:
142-
```bash
143-
npm test
144-
```
145-
146-
#### Running unit tests
147-
148-
To run unit tests in isolation:
149-
```bash
150-
npm run test:unit
151-
```
152-
153-
To run unit tests in watch mode (watches for code changes and continuously runs tests):
154-
```bash
155-
npm run test:unit -- --watch
156-
```
157-
158-
You can run a single file of integration tests (in this example, the `button` tests):
159-
160-
```bash
161-
$(npm bin)/jest --runInBand test/unit/components/button.test.jsx
162-
```
163-
164-
#### Running integration tests
165-
166-
Integration tests use a headless browser to manipulate the actual HTML and javascript that the repo
167-
produces. You will not see this activity (though you can hear it when sounds are played!).
168-
169-
Note that integration tests require you to first create a build that can be loaded in a browser:
170-
171-
```bash
172-
npm run build
173-
```
174-
175-
Then, you can run all integration tests:
176-
177-
```bash
178-
npm run test:integration
179-
```
180-
181-
Or, you can run a single file of integration tests (in this example, the `backpack` tests):
182-
183-
```bash
184-
$(npm bin)/jest --runInBand test/integration/backpack.test.js
185-
```
186-
187-
If you want to watch the browser as it runs the test, rather than running headless, use:
188-
189-
```bash
190-
USE_HEADLESS=no $(npm bin)/jest --runInBand test/integration/backpack.test.js
191-
```
192-
193-
_Note: If you are seeing failed tests related to `chromedriver` being incompatible with your version of Chrome, you may need to update `chromedriver` with:_
194-
195-
```bash
196-
npm install chromedriver@{version}
197-
```
198-
199-
## Troubleshooting
200-
201-
### Ignoring optional dependencies
202-
203-
When running `npm install`, you can get warnings about optional dependencies:
204-
205-
```
206-
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
207-
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.7
208-
```
209-
210-
You can suppress them by adding the `no-optional` switch:
211-
212-
```
213-
npm install --no-optional
214-
```
215-
216-
Further reading: [Stack Overflow](https://stackoverflow.com/questions/36725181/not-compatible-with-your-operating-system-or-architecture-fsevents1-0-11)
217-
218-
### Resolving dependencies
219-
220-
When installing for the first time, you can get warnings that need to be resolved:
221-
222-
```
223-
npm WARN eslint-config-scratch@5.0.0 requires a peer of babel-eslint@^8.0.1 but none was installed.
224-
npm WARN eslint-config-scratch@5.0.0 requires a peer of eslint@^4.0 but none was installed.
225-
npm WARN scratch-paint@0.2.0-prerelease.20190318170811 requires a peer of react-intl-redux@^0.7 but none was installed.
226-
npm WARN scratch-paint@0.2.0-prerelease.20190318170811 requires a peer of react-responsive@^4 but none was installed.
227-
```
228-
229-
You can check which versions are available:
230-
231-
```
232-
npm view react-intl-redux@0.* version
233-
```
234-
235-
You will need to install the required version:
236-
237-
```
238-
npm install --no-optional --save-dev react-intl-redux@^0.7
239-
```
240-
241-
The dependency itself might have more missing dependencies, which will show up like this:
242-
243-
```
244-
user@machine:~/sources/scratch/scratch-gui (491-translatable-library-objects)$ npm install --no-optional --save-dev react-intl-redux@^0.7
245-
scratch-gui@0.1.0 /media/cuideigin/Linux/sources/scratch/scratch-gui
246-
├── react-intl-redux@0.7.0
247-
└── UNMET PEER DEPENDENCY react-responsive@5.0.0
248-
```
249-
250-
You will need to install those as well:
251-
252-
```
253-
npm install --no-optional --save-dev react-responsive@^5.0.0
254-
```
255-
256-
Further reading: [Stack Overflow](https://stackoverflow.com/questions/46602286/npm-requires-a-peer-of-but-all-peers-are-in-package-json-and-node-modules)
257-
258-
## Troubleshooting
259-
260-
If you run into npm install errors, try these steps:
261-
1. run `npm cache clean --force`
262-
2. Delete the node_modules directory
263-
3. Delete package-lock.json
264-
4. run `npm install` again
265-
266-
## Publishing to GitHub Pages
267-
You can publish the GUI to github.io so that others on the Internet can view it.
268-
[Read the wiki for a step-by-step guide.](https://github.com/LLK/scratch-gui/wiki/Publishing-to-GitHub-Pages)
269-
270-
## Understanding the project state machine
271-
272-
Since so much code throughout scratch-gui depends on the state of the project, which goes through many different phases of loading, displaying and saving, we created a "finite state machine" to make it clear which state it is in at any moment. This is contained in the file src/reducers/project-state.js .
273-
274-
It can be hard to understand the code in src/reducers/project-state.js . There are several types of data and functions used, which relate to each other:
275-
276-
### Loading states
277-
278-
These include state constant strings like:
279-
280-
* `NOT_LOADED` (the default state),
281-
* `ERROR`,
282-
* `FETCHING_WITH_ID`,
283-
* `LOADING_VM_WITH_ID`,
284-
* `REMIXING`,
285-
* `SHOWING_WITH_ID`,
286-
* `SHOWING_WITHOUT_ID`,
287-
* etc.
288-
289-
### Transitions
290-
291-
These are names for the action which causes a state change. Some examples are:
292-
293-
* `START_FETCHING_NEW`,
294-
* `DONE_FETCHING_WITH_ID`,
295-
* `DONE_LOADING_VM_WITH_ID`,
296-
* `SET_PROJECT_ID`,
297-
* `START_AUTO_UPDATING`,
298-
299-
### How transitions relate to loading states
300-
301-
Like this diagram of the project state machine shows, various transition actions can move us from one loading state to another:
302-
303-
![Project state diagram](docs/project_state_diagram.svg)
304-
305-
_Note: for clarity, the diagram above excludes states and transitions relating to error handling._
306-
307-
#### Example
308-
309-
Here's an example of how states transition.
310-
311-
Suppose a user clicks on a project, and the page starts to load with URL https://scratch.mit.edu/projects/123456 .
312-
313-
Here's what will happen in the project state machine:
314-
315-
![Project state example](docs/project_state_example.png)
316-
317-
1. When the app first mounts, the project state is `NOT_LOADED`.
318-
2. The `SET_PROJECT_ID` redux action is dispatched (from src/lib/project-fetcher-hoc.jsx), with `projectId` set to `123456`. This transitions the state from `NOT_LOADED` to `FETCHING_WITH_ID`.
319-
3. The `FETCHING_WITH_ID` state. In src/lib/project-fetcher-hoc.jsx, the `projectId` value `123456` is used to request the data for that project from the server.
320-
4. When the server responds with the data, src/lib/project-fetcher-hoc.jsx dispatches the `DONE_FETCHING_WITH_ID` action, with `projectData` set. This transitions the state from `FETCHING_WITH_ID` to `LOADING_VM_WITH_ID`.
321-
5. The `LOADING_VM_WITH_ID` state. In src/lib/vm-manager-hoc.jsx, we load the `projectData` into Scratch's virtual machine ("the vm").
322-
6. When loading is done, src/lib/vm-manager-hoc.jsx dispatches the `DONE_LOADING_VM_WITH_ID` action. This transitions the state from `LOADING_VM_WITH_ID` to `SHOWING_WITH_ID`
323-
7. The `SHOWING_WITH_ID` state. Now the project appears normally and is playable and editable.
324-
325-
## Donate
326-
We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a [donation](https://www.scratchfoundation.org/donate) to support our continued engineering, design, community, and resource development efforts. Donations of any size are appreciated. Thank you!
327-
-->

0 commit comments

Comments
 (0)