scratch-gui 3.6.5 → 3.6.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci-cd.yml +32 -41
- package/.github/workflows/commitlint.yml +2 -2
- package/.github/workflows/daily-tx-pull.yml +2 -2
- package/CHANGELOG.md +17 -0
- package/README.md +61 -30
- package/dist/scratch-gui.js +1 -1
- package/pack/{scratch-gui-3.6.5.tgz → scratch-gui-3.6.7.tgz} +0 -0
- package/package.json +57 -58
|
@@ -13,7 +13,6 @@ permissions:
|
|
|
13
13
|
issues: write # comment on released issues
|
|
14
14
|
pull-requests: write # comment on released pull requests
|
|
15
15
|
|
|
16
|
-
|
|
17
16
|
jobs:
|
|
18
17
|
setup:
|
|
19
18
|
runs-on: ubuntu-latest
|
|
@@ -22,8 +21,8 @@ jobs:
|
|
|
22
21
|
JEST_JUNIT_OUTPUT_DIR: test-results
|
|
23
22
|
NODE_OPTIONS: --max-old-space-size=4000
|
|
24
23
|
steps:
|
|
25
|
-
- uses: actions/checkout@v4
|
|
26
|
-
- uses: actions/setup-node@v3
|
|
24
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
25
|
+
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
|
|
27
26
|
with:
|
|
28
27
|
cache: "npm"
|
|
29
28
|
node-version-file: ".nvmrc"
|
|
@@ -41,27 +40,27 @@ jobs:
|
|
|
41
40
|
run: |
|
|
42
41
|
npm run test:lint -- --quiet --output-file test-results/eslint/results.xml --format junit
|
|
43
42
|
- name: Store Lint Results
|
|
44
|
-
uses: actions/upload-artifact@v3
|
|
43
|
+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
|
|
45
44
|
with:
|
|
46
45
|
name: lint-output
|
|
47
46
|
path: ./test-results/*
|
|
48
47
|
- name: Cache node_modules
|
|
49
48
|
id: cache-nodemodules
|
|
50
|
-
uses: actions/cache@v3
|
|
49
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
51
50
|
with:
|
|
52
51
|
path:
|
|
53
52
|
node_modules
|
|
54
53
|
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
|
55
54
|
- name: Cache src/generated
|
|
56
55
|
id: cache-generated
|
|
57
|
-
uses: actions/cache@v3
|
|
56
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
58
57
|
with:
|
|
59
58
|
path:
|
|
60
59
|
src/generated
|
|
61
60
|
key: ${{ runner.os }}-generated-${{ hashFiles('package-lock.json') }}
|
|
62
61
|
- name: Cache static/microbit
|
|
63
62
|
id: cache-static
|
|
64
|
-
uses: actions/cache@v3
|
|
63
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
65
64
|
with:
|
|
66
65
|
path:
|
|
67
66
|
static/microbit
|
|
@@ -73,9 +72,9 @@ jobs:
|
|
|
73
72
|
JEST_JUNIT_OUTPUT_NAME: unit-results.xml
|
|
74
73
|
JEST_JUNIT_OUTPUT_DIR: test-results/unit
|
|
75
74
|
steps:
|
|
76
|
-
- uses: actions/checkout@v4
|
|
75
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
77
76
|
- name: Cache NPM dependencies
|
|
78
|
-
uses: actions/cache@v3
|
|
77
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
79
78
|
with:
|
|
80
79
|
path:
|
|
81
80
|
node_modules
|
|
@@ -83,7 +82,7 @@ jobs:
|
|
|
83
82
|
- name: Run Unit Tests
|
|
84
83
|
run: npm run test:unit -- --reporters="default" --reporters="jest-junit" --coverage --coverageReporters=text --coverageReporters=lcov --maxWorkers="2"
|
|
85
84
|
- name: Store Unit Test Results
|
|
86
|
-
uses: actions/upload-artifact@v3
|
|
85
|
+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
|
|
87
86
|
with:
|
|
88
87
|
name: unit-test-output
|
|
89
88
|
path: ./test-results/*
|
|
@@ -91,28 +90,27 @@ jobs:
|
|
|
91
90
|
needs: [setup, test-unit]
|
|
92
91
|
env:
|
|
93
92
|
NODE_OPTIONS: --max-old-space-size=4000
|
|
94
|
-
DETECT_CHROMEDRIVER_VERSION: "true"
|
|
95
93
|
runs-on: ubuntu-latest
|
|
96
94
|
steps:
|
|
97
|
-
- uses: actions/checkout@v4
|
|
98
|
-
- uses: actions/setup-node@v3
|
|
95
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
96
|
+
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
|
|
99
97
|
with:
|
|
100
98
|
cache: "npm"
|
|
101
99
|
node-version-file: ".nvmrc"
|
|
102
100
|
- name: Retrieve node_modules
|
|
103
|
-
uses: actions/cache@v3
|
|
101
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
104
102
|
with:
|
|
105
103
|
path:
|
|
106
104
|
node_modules
|
|
107
105
|
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
|
108
106
|
- name: Retrieve src/generated
|
|
109
|
-
uses: actions/cache@v3
|
|
107
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
110
108
|
with:
|
|
111
109
|
path:
|
|
112
110
|
src/generated
|
|
113
111
|
key: ${{ runner.os }}-generated-${{ hashFiles('package-lock.json') }}
|
|
114
112
|
- name: Retireve static/microbit
|
|
115
|
-
uses: actions/cache@v3
|
|
113
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
116
114
|
with:
|
|
117
115
|
path:
|
|
118
116
|
static/microbit
|
|
@@ -122,24 +120,24 @@ jobs:
|
|
|
122
120
|
NODE_ENV: production
|
|
123
121
|
run: npm run build
|
|
124
122
|
- name: Cache Build Directory
|
|
125
|
-
uses: actions/cache@v3
|
|
123
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
126
124
|
with:
|
|
127
125
|
path:
|
|
128
126
|
./build
|
|
129
127
|
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
|
|
130
128
|
- name: Cache Dist Directory
|
|
131
|
-
uses: actions/cache@v3
|
|
129
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
132
130
|
with:
|
|
133
131
|
path:
|
|
134
132
|
./dist
|
|
135
133
|
key: ${{ runner.os }}-dist-${{ hashFiles('package-lock.json') }}
|
|
136
134
|
- name: Store Build Output
|
|
137
|
-
uses: actions/upload-artifact@v3
|
|
135
|
+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
|
|
138
136
|
with:
|
|
139
137
|
name: build-output
|
|
140
138
|
path: ./build
|
|
141
139
|
- name: Store Dist Output
|
|
142
|
-
uses: actions/upload-artifact@v3
|
|
140
|
+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
|
|
143
141
|
with:
|
|
144
142
|
name: dist-output
|
|
145
143
|
path: ./dist
|
|
@@ -150,34 +148,27 @@ jobs:
|
|
|
150
148
|
JEST_JUNIT_OUTPUT_NAME: results.txt
|
|
151
149
|
JEST_JUNIT_OUTPUT_DIR: test-results/integration
|
|
152
150
|
steps:
|
|
153
|
-
- uses: actions/checkout@v4
|
|
154
|
-
- name: Install Chrome Dependencies
|
|
155
|
-
run: |
|
|
156
|
-
sudo apt-get update
|
|
157
|
-
sudo apt-get install -y libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 libgdk-pixbuf2.0-0 libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2
|
|
151
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
158
152
|
- name: Retrieve npm dependencies
|
|
159
|
-
uses: actions/cache@v3
|
|
153
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
160
154
|
with:
|
|
161
155
|
path:
|
|
162
156
|
node_modules
|
|
163
157
|
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
|
164
158
|
- name: Retrieve Build
|
|
165
|
-
uses: actions/cache@v3
|
|
159
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
166
160
|
with:
|
|
167
161
|
path:
|
|
168
162
|
./build
|
|
169
163
|
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
|
|
170
|
-
- uses: browser-actions/setup-chrome@v1
|
|
171
|
-
with:
|
|
172
|
-
chrome-version: stable
|
|
173
|
-
id: setup-chrome
|
|
174
164
|
- run: |
|
|
175
|
-
|
|
176
|
-
|
|
165
|
+
for F in chrome chromium chromedriver; do
|
|
166
|
+
which $F && $F --version || echo Not found: $F
|
|
167
|
+
done
|
|
177
168
|
- name: Run Integration Tests
|
|
178
169
|
run: npm run test:integration -- --reporters="default" --reporters="jest-junit"
|
|
179
170
|
- name: Store Integration Test Results
|
|
180
|
-
uses: actions/upload-artifact@v3
|
|
171
|
+
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3
|
|
181
172
|
with:
|
|
182
173
|
name: integration-test-output
|
|
183
174
|
path: ./test-results/*
|
|
@@ -186,15 +177,15 @@ jobs:
|
|
|
186
177
|
if: (github.ref == 'refs/heads/master') || (github.ref == 'refs/heads/develop') || (github.ref == 'refs/heads/beta') || startsWith(github.ref, 'refs/heads/hotfix')
|
|
187
178
|
runs-on: ubuntu-latest
|
|
188
179
|
steps:
|
|
189
|
-
- uses: actions/checkout@v4
|
|
180
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
190
181
|
- name: Retrieve npm dependencies
|
|
191
|
-
uses: actions/cache@v3
|
|
182
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
192
183
|
with:
|
|
193
184
|
path:
|
|
194
185
|
node_modules
|
|
195
186
|
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
|
196
187
|
- name: Retrieve Dist Directory
|
|
197
|
-
uses: actions/cache@v3
|
|
188
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
198
189
|
with:
|
|
199
190
|
path:
|
|
200
191
|
./dist
|
|
@@ -213,21 +204,21 @@ jobs:
|
|
|
213
204
|
if: (!(startsWith(github.ref, 'refs/heads/dependabot/') || startsWith(github.ref, 'refs/heads/renovate/')))
|
|
214
205
|
runs-on: ubuntu-latest
|
|
215
206
|
steps:
|
|
216
|
-
- uses: actions/checkout@v4
|
|
207
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
217
208
|
- name: Retrieve npm dependencies
|
|
218
|
-
uses: actions/cache@v3
|
|
209
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
219
210
|
with:
|
|
220
211
|
path:
|
|
221
212
|
node_modules
|
|
222
213
|
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
|
|
223
214
|
- name: Retrieve Build Directory
|
|
224
|
-
uses: actions/cache@v3
|
|
215
|
+
uses: actions/cache@e12d46a63a90f2fae62d114769bbf2a179198b5c # v3
|
|
225
216
|
with:
|
|
226
217
|
path:
|
|
227
218
|
./build
|
|
228
219
|
key: ${{ runner.os }}-build-${{ hashFiles('package-lock.json') }}
|
|
229
220
|
- name: Deploy playground to GitHub Pages
|
|
230
|
-
uses: peaceiris/actions-gh-pages@v3
|
|
221
|
+
uses: peaceiris/actions-gh-pages@373f7f263a76c20808c831209c920827a82a2847 # v3
|
|
231
222
|
with:
|
|
232
223
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
233
224
|
publish_dir: ./build
|
|
@@ -8,5 +8,5 @@ jobs:
|
|
|
8
8
|
commitlint:
|
|
9
9
|
runs-on: ubuntu-latest
|
|
10
10
|
steps:
|
|
11
|
-
- uses: actions/checkout@v4
|
|
12
|
-
- uses: wagoid/commitlint-github-action@v5
|
|
11
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
12
|
+
- uses: wagoid/commitlint-github-action@5ce82f5d814d4010519d15f0552aec4f17a1e1fe # v5
|
|
@@ -12,10 +12,10 @@ jobs:
|
|
|
12
12
|
daily-tx-pull:
|
|
13
13
|
runs-on: ubuntu-latest
|
|
14
14
|
steps:
|
|
15
|
-
- uses: actions/checkout@v4
|
|
15
|
+
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
|
|
16
16
|
with:
|
|
17
17
|
ref: 'develop'
|
|
18
|
-
- uses: actions/setup-node@v3
|
|
18
|
+
- uses: actions/setup-node@1a4442cacd436585916779262731d5b162bc6ec7 # v3
|
|
19
19
|
with:
|
|
20
20
|
cache: 'npm'
|
|
21
21
|
node-version-file: '.nvmrc'
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See
|
|
4
4
|
[Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.6.7](https://github.com/LLK/scratch-gui/compare/v3.6.6...v3.6.7) (2024-02-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** don't use NPM chromedriver package ([9dd81cb](https://github.com/LLK/scratch-gui/commit/9dd81cb3946410943860ee6f2c82d78f21c64993))
|
|
12
|
+
* **deps:** unpin non-dev dependencies ([f94b201](https://github.com/LLK/scratch-gui/commit/f94b20158ca9de96e36c3719dff0dd212b37273c))
|
|
13
|
+
* **deps:** update dependency scratch-blocks to v1.1.6 ([a5f81a8](https://github.com/LLK/scratch-gui/commit/a5f81a884569a45b2968db03ba5db7e1eb0a803d))
|
|
14
|
+
|
|
15
|
+
## [3.6.6](https://github.com/LLK/scratch-gui/compare/v3.6.5...v3.6.6) (2024-01-29)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **deps:** update dependency scratch-paint to v2.2.2 ([bad999e](https://github.com/LLK/scratch-gui/commit/bad999e82d9b0545e8f1f781735cc4a72013a94a))
|
|
21
|
+
* **deps:** update dependency scratch-vm to v2.3.4 ([6d3b950](https://github.com/LLK/scratch-gui/commit/6d3b950b0089985f74b3f3bc2e061910f3f29ad7))
|
|
22
|
+
|
|
6
23
|
## [3.6.5](https://github.com/LLK/scratch-gui/compare/v3.6.4...v3.6.5) (2024-01-29)
|
|
7
24
|
|
|
8
25
|
|
package/README.md
CHANGED
|
@@ -1,30 +1,40 @@
|
|
|
1
1
|
# scratch-gui
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
Scratch GUI is a set of React components that comprise the interface for creating and running Scratch 3.0 projects
|
|
3
4
|
|
|
4
5
|
## Installation
|
|
6
|
+
|
|
5
7
|
This requires you to have Git and Node.js installed.
|
|
6
8
|
|
|
7
9
|
In your own node environment/application:
|
|
10
|
+
|
|
8
11
|
```bash
|
|
9
12
|
npm install https://github.com/LLK/scratch-gui.git
|
|
10
13
|
```
|
|
14
|
+
|
|
11
15
|
If you want to edit/play yourself:
|
|
16
|
+
|
|
12
17
|
```bash
|
|
13
18
|
git clone https://github.com/LLK/scratch-gui.git
|
|
14
19
|
cd scratch-gui
|
|
15
20
|
npm install
|
|
16
21
|
```
|
|
17
22
|
|
|
18
|
-
**You may want to add `--depth=1` to the `git clone` command because there are some [large files in the git repository
|
|
23
|
+
**You may want to add `--depth=1` to the `git clone` command because there are some [large files in the git repository
|
|
24
|
+
history](https://github.com/LLK/scratch-gui/issues/5140).**
|
|
19
25
|
|
|
20
26
|
## Getting started
|
|
27
|
+
|
|
21
28
|
Running the project requires Node.js to be installed.
|
|
22
29
|
|
|
23
30
|
## Running
|
|
31
|
+
|
|
24
32
|
Open a Command Prompt or Terminal in the repository and run:
|
|
33
|
+
|
|
25
34
|
```bash
|
|
26
35
|
npm start
|
|
27
36
|
```
|
|
37
|
+
|
|
28
38
|
Then go to [http://localhost:8601/](http://localhost:8601/) - the playground outputs the default GUI component
|
|
29
39
|
|
|
30
40
|
## Developing alongside other Scratch repositories
|
|
@@ -52,20 +62,28 @@ Here's how to link your local `scratch-gui` code to another project's `node_modu
|
|
|
52
62
|
|
|
53
63
|
#### Using `npm run watch`
|
|
54
64
|
|
|
55
|
-
Instead of `BUILD_MODE=dist npm run build`, you can use `BUILD_MODE=dist npm run watch` instead. This will watch for
|
|
65
|
+
Instead of `BUILD_MODE=dist npm run build`, you can use `BUILD_MODE=dist npm run watch` instead. This will watch for
|
|
66
|
+
changes to your `scratch-gui` code, and automatically rebuild when there are changes. Sometimes this has been
|
|
67
|
+
unreliable; if you are having problems, try going back to `BUILD_MODE=dist npm run build` until you resolve them.
|
|
56
68
|
|
|
57
69
|
#### Oh no! It didn't work!
|
|
58
70
|
|
|
59
71
|
If you can't get linking to work right, try:
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
|
|
72
|
+
|
|
73
|
+
* Follow the recipe above step by step and don't change the order. It is especially important to run `npm install`
|
|
74
|
+
_before_ `npm link` as installing after the linking will reset the linking.
|
|
75
|
+
* Make sure the repositories are siblings on your machine's file tree, like
|
|
76
|
+
`.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-gui/` and `.../.../MY_SCRATCH_DEV_DIRECTORY/scratch-www/`.
|
|
77
|
+
* Consistent node.js version: If you have multiple Terminal tabs or windows open for the different Scratch
|
|
78
|
+
repositories, make sure to use the same node version in all of them.
|
|
63
79
|
* If nothing else works, unlink the repositories by running `npm unlink` in both, and start over.
|
|
64
80
|
|
|
65
81
|
## Testing
|
|
82
|
+
|
|
66
83
|
### Documentation
|
|
67
84
|
|
|
68
|
-
You may want to review the documentation for [Jest](https://facebook.github.io/jest/docs/en/api.html) and
|
|
85
|
+
You may want to review the documentation for [Jest](https://facebook.github.io/jest/docs/en/api.html) and
|
|
86
|
+
[Enzyme](http://airbnb.io/enzyme/docs/api/) as you write your tests.
|
|
69
87
|
|
|
70
88
|
See [jest cli docs](https://facebook.github.io/jest/docs/en/cli.html#content) for more options.
|
|
71
89
|
|
|
@@ -78,6 +96,7 @@ Before running any tests, make sure you have run `npm install` from this (scratc
|
|
|
78
96
|
#### Main testing command
|
|
79
97
|
|
|
80
98
|
To run linter, unit tests, build, and integration tests, all at once:
|
|
99
|
+
|
|
81
100
|
```bash
|
|
82
101
|
npm test
|
|
83
102
|
```
|
|
@@ -85,11 +104,13 @@ npm test
|
|
|
85
104
|
#### Running unit tests
|
|
86
105
|
|
|
87
106
|
To run unit tests in isolation:
|
|
107
|
+
|
|
88
108
|
```bash
|
|
89
109
|
npm run test:unit
|
|
90
110
|
```
|
|
91
111
|
|
|
92
112
|
To run unit tests in watch mode (watches for code changes and continuously runs tests):
|
|
113
|
+
|
|
93
114
|
```bash
|
|
94
115
|
npm run test:unit -- --watch
|
|
95
116
|
```
|
|
@@ -105,6 +126,8 @@ $(npm bin)/jest --runInBand test/unit/components/button.test.jsx
|
|
|
105
126
|
Integration tests use a headless browser to manipulate the actual HTML and javascript that the repo
|
|
106
127
|
produces. You will not see this activity (though you can hear it when sounds are played!).
|
|
107
128
|
|
|
129
|
+
To run the integration tests, you'll first need to install Chrome, Chromium, or a variant, along with Chromedriver.
|
|
130
|
+
|
|
108
131
|
Note that integration tests require you to first create a build that can be loaded in a browser:
|
|
109
132
|
|
|
110
133
|
```bash
|
|
@@ -129,26 +152,20 @@ If you want to watch the browser as it runs the test, rather than running headle
|
|
|
129
152
|
USE_HEADLESS=no $(npm bin)/jest --runInBand test/integration/backpack.test.js
|
|
130
153
|
```
|
|
131
154
|
|
|
132
|
-
_Note: If you are seeing failed tests related to `chromedriver` being incompatible with your version of Chrome, you may need to update `chromedriver` with:_
|
|
133
|
-
|
|
134
|
-
```bash
|
|
135
|
-
npm install chromedriver@{version}
|
|
136
|
-
```
|
|
137
|
-
|
|
138
155
|
## Troubleshooting
|
|
139
156
|
|
|
140
157
|
### Ignoring optional dependencies
|
|
141
158
|
|
|
142
159
|
When running `npm install`, you can get warnings about optional dependencies:
|
|
143
160
|
|
|
144
|
-
```
|
|
161
|
+
```text
|
|
145
162
|
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
|
|
146
163
|
npm WARN notsup Not compatible with your operating system or architecture: fsevents@1.2.7
|
|
147
164
|
```
|
|
148
165
|
|
|
149
166
|
You can suppress them by adding the `no-optional` switch:
|
|
150
167
|
|
|
151
|
-
```
|
|
168
|
+
```bash
|
|
152
169
|
npm install --no-optional
|
|
153
170
|
```
|
|
154
171
|
|
|
@@ -158,7 +175,7 @@ Further reading: [Stack Overflow](https://stackoverflow.com/questions/36725181/n
|
|
|
158
175
|
|
|
159
176
|
When installing for the first time, you can get warnings that need to be resolved:
|
|
160
177
|
|
|
161
|
-
```
|
|
178
|
+
```text
|
|
162
179
|
npm WARN eslint-config-scratch@5.0.0 requires a peer of babel-eslint@^8.0.1 but none was installed.
|
|
163
180
|
npm WARN eslint-config-scratch@5.0.0 requires a peer of eslint@^4.0 but none was installed.
|
|
164
181
|
npm WARN scratch-paint@0.2.0-prerelease.20190318170811 requires a peer of react-intl-redux@^0.7 but none was installed.
|
|
@@ -167,19 +184,19 @@ npm WARN scratch-paint@0.2.0-prerelease.20190318170811 requires a peer of react-
|
|
|
167
184
|
|
|
168
185
|
You can check which versions are available:
|
|
169
186
|
|
|
170
|
-
```
|
|
187
|
+
```bash
|
|
171
188
|
npm view react-intl-redux@0.* version
|
|
172
189
|
```
|
|
173
190
|
|
|
174
191
|
You will need to install the required version:
|
|
175
192
|
|
|
176
|
-
```
|
|
193
|
+
```bash
|
|
177
194
|
npm install --no-optional --save-dev react-intl-redux@^0.7
|
|
178
195
|
```
|
|
179
196
|
|
|
180
197
|
The dependency itself might have more missing dependencies, which will show up like this:
|
|
181
198
|
|
|
182
|
-
```
|
|
199
|
+
```bash
|
|
183
200
|
user@machine:~/sources/scratch/scratch-gui (491-translatable-library-objects)$ npm install --no-optional --save-dev react-intl-redux@^0.7
|
|
184
201
|
scratch-gui@0.1.0 /media/cuideigin/Linux/sources/scratch/scratch-gui
|
|
185
202
|
├── react-intl-redux@0.7.0
|
|
@@ -188,7 +205,7 @@ scratch-gui@0.1.0 /media/cuideigin/Linux/sources/scratch/scratch-gui
|
|
|
188
205
|
|
|
189
206
|
You will need to install those as well:
|
|
190
207
|
|
|
191
|
-
```
|
|
208
|
+
```bash
|
|
192
209
|
npm install --no-optional --save-dev react-responsive@^5.0.0
|
|
193
210
|
```
|
|
194
211
|
|
|
@@ -197,20 +214,25 @@ Further reading: [Stack Overflow](https://stackoverflow.com/questions/46602286/n
|
|
|
197
214
|
## Troubleshooting
|
|
198
215
|
|
|
199
216
|
If you run into npm install errors, try these steps:
|
|
217
|
+
|
|
200
218
|
1. run `npm cache clean --force`
|
|
201
219
|
2. Delete the node_modules directory
|
|
202
220
|
3. Delete package-lock.json
|
|
203
221
|
4. run `npm install` again
|
|
204
222
|
|
|
205
223
|
## Publishing to GitHub Pages
|
|
224
|
+
|
|
206
225
|
You can publish the GUI to github.io so that others on the Internet can view it.
|
|
207
226
|
[Read the wiki for a step-by-step guide.](https://github.com/LLK/scratch-gui/wiki/Publishing-to-GitHub-Pages)
|
|
208
227
|
|
|
209
228
|
## Understanding the project state machine
|
|
210
229
|
|
|
211
|
-
Since so much code throughout scratch-gui depends on the state of the project, which goes through many different
|
|
230
|
+
Since so much code throughout scratch-gui depends on the state of the project, which goes through many different
|
|
231
|
+
phases of loading, displaying and saving, we created a "finite state machine" to make it clear which state it is in at
|
|
232
|
+
any moment. This is contained in the file src/reducers/project-state.js .
|
|
212
233
|
|
|
213
|
-
It can be hard to understand the code in src/reducers/project-state.js . There are several types of data and functions
|
|
234
|
+
It can be hard to understand the code in src/reducers/project-state.js . There are several types of data and functions
|
|
235
|
+
used, which relate to each other:
|
|
214
236
|
|
|
215
237
|
### Loading states
|
|
216
238
|
|
|
@@ -237,7 +259,8 @@ These are names for the action which causes a state change. Some examples are:
|
|
|
237
259
|
|
|
238
260
|
### How transitions relate to loading states
|
|
239
261
|
|
|
240
|
-
Like this diagram of the project state machine shows, various transition actions can move us from one loading state to
|
|
262
|
+
Like this diagram of the project state machine shows, various transition actions can move us from one loading state to
|
|
263
|
+
another:
|
|
241
264
|
|
|
242
265
|

|
|
243
266
|
|
|
@@ -247,19 +270,27 @@ _Note: for clarity, the diagram above excludes states and transitions relating t
|
|
|
247
270
|
|
|
248
271
|
Here's an example of how states transition.
|
|
249
272
|
|
|
250
|
-
Suppose a user clicks on a project, and the page starts to load with URL https://scratch.mit.edu/projects/123456
|
|
273
|
+
Suppose a user clicks on a project, and the page starts to load with URL `https://scratch.mit.edu/projects/123456`.
|
|
251
274
|
|
|
252
275
|
Here's what will happen in the project state machine:
|
|
253
276
|
|
|
254
277
|

|
|
255
278
|
|
|
256
279
|
1. When the app first mounts, the project state is `NOT_LOADED`.
|
|
257
|
-
2. The `SET_PROJECT_ID` redux action is dispatched (from src/lib/project-fetcher-hoc.jsx), with `projectId` set to
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
280
|
+
2. The `SET_PROJECT_ID` redux action is dispatched (from src/lib/project-fetcher-hoc.jsx), with `projectId` set to
|
|
281
|
+
`123456`. This transitions the state from `NOT_LOADED` to `FETCHING_WITH_ID`.
|
|
282
|
+
3. The `FETCHING_WITH_ID` state. In src/lib/project-fetcher-hoc.jsx, the `projectId` value `123456` is used to request
|
|
283
|
+
the data for that project from the server.
|
|
284
|
+
4. When the server responds with the data, src/lib/project-fetcher-hoc.jsx dispatches the `DONE_FETCHING_WITH_ID`
|
|
285
|
+
action, with `projectData` set. This transitions the state from `FETCHING_WITH_ID` to `LOADING_VM_WITH_ID`.
|
|
286
|
+
5. The `LOADING_VM_WITH_ID` state. In src/lib/vm-manager-hoc.jsx, we load the `projectData` into Scratch's virtual
|
|
287
|
+
machine ("the vm").
|
|
288
|
+
6. When loading is done, src/lib/vm-manager-hoc.jsx dispatches the `DONE_LOADING_VM_WITH_ID` action. This transitions
|
|
289
|
+
the state from `LOADING_VM_WITH_ID` to `SHOWING_WITH_ID`.
|
|
262
290
|
7. The `SHOWING_WITH_ID` state. Now the project appears normally and is playable and editable.
|
|
263
291
|
|
|
264
292
|
## Donate
|
|
265
|
-
|
|
293
|
+
|
|
294
|
+
We provide [Scratch](https://scratch.mit.edu) free of charge, and want to keep it that way! Please consider making a
|
|
295
|
+
[donation](https://www.scratchfoundation.org/donate) to support our continued engineering, design, community, and
|
|
296
|
+
resource development efforts. Donations of any size are appreciated. Thank you!
|
package/dist/scratch-gui.js
CHANGED
|
@@ -195512,7 +195512,7 @@ module.exports = __webpack_amd_options__;
|
|
|
195512
195512
|
/* 855 */
|
|
195513
195513
|
/***/ (function(module) {
|
|
195514
195514
|
|
|
195515
|
-
module.exports = JSON.parse("{\"name\":\"scratch-vm\",\"version\":\"2.3.
|
|
195515
|
+
module.exports = JSON.parse("{\"name\":\"scratch-vm\",\"version\":\"2.3.4\",\"description\":\"Virtual Machine for Scratch 3.0\",\"author\":\"Massachusetts Institute of Technology\",\"license\":\"BSD-3-Clause\",\"homepage\":\"https://github.com/scratchfoundation/scratch-vm#readme\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/scratchfoundation/scratch-vm.git\",\"sha\":\"3581c52cfc84ece92898bccba56b34f525811ed2\"},\"main\":\"./dist/node/scratch-vm.js\",\"browser\":\"./src/index.js\",\"scripts\":{\"build\":\"npm run docs && webpack --progress --colors --bail\",\"coverage\":\"tap ./test/{unit,integration}/*.js --coverage --coverage-report=lcov\",\"docs\":\"jsdoc -c .jsdoc.json\",\"i18n:src\":\"mkdirp translations/core && format-message extract --out-file translations/core/en.json src/extensions/**/index.js\",\"i18n:push\":\"tx-push-src scratch-editor extensions translations/core/en.json\",\"lint\":\"eslint . && format-message lint src/**/*.js\",\"prepare\":\"husky install\",\"prepublish\":\"in-publish && npm run build || not-in-publish\",\"start\":\"webpack-dev-server\",\"tap\":\"tap ./test/{unit,integration}/*.js\",\"tap:unit\":\"tap ./test/unit/*.js\",\"tap:integration\":\"tap ./test/integration/*.js\",\"test\":\"npm run lint && npm run tap\",\"watch\":\"webpack --progress --colors --watch\",\"version\":\"json -f package.json -I -e \\\"this.repository.sha = '$(git log -n1 --pretty=format:%H)'\\\"\"},\"config\":{\"commitizen\":{\"path\":\"cz-conventional-changelog\"}},\"tap\":{\"branches\":60,\"functions\":70,\"lines\":70,\"statements\":70},\"dependencies\":{\"@vernier/godirect\":\"1.5.0\",\"arraybuffer-loader\":\"^1.0.6\",\"atob\":\"2.1.2\",\"btoa\":\"1.2.1\",\"canvas-toBlob\":\"1.0.0\",\"decode-html\":\"2.0.0\",\"diff-match-patch\":\"1.0.4\",\"format-message\":\"6.2.1\",\"htmlparser2\":\"3.10.0\",\"immutable\":\"3.8.1\",\"jszip\":\"^3.1.5\",\"minilog\":\"3.1.0\",\"scratch-parser\":\"5.1.1\",\"scratch-sb1-converter\":\"0.2.7\",\"scratch-translate-extension-languages\":\"1.0.0\",\"text-encoding\":\"0.7.0\",\"uuid\":\"8.3.2\",\"worker-loader\":\"^1.1.1\"},\"peerDependencies\":{\"scratch-svg-renderer\":\"^0.2.0-prerelease\"},\"devDependencies\":{\"@babel/core\":\"7.13.10\",\"@babel/eslint-parser\":\"7.23.3\",\"@babel/preset-env\":\"7.14.8\",\"@commitlint/cli\":\"17.0.2\",\"@commitlint/config-conventional\":\"17.0.2\",\"adm-zip\":\"0.4.11\",\"babel-loader\":\"8.2.2\",\"callsite\":\"1.0.0\",\"copy-webpack-plugin\":\"4.5.4\",\"docdash\":\"1.2.0\",\"eslint\":\"8.56.0\",\"eslint-config-scratch\":\"9.0.3\",\"expose-loader\":\"0.7.5\",\"file-loader\":\"2.0.0\",\"format-message-cli\":\"6.2.0\",\"husky\":\"8.0.1\",\"in-publish\":\"2.0.1\",\"js-md5\":\"0.7.3\",\"jsdoc\":\"3.6.6\",\"json\":\"^9.0.4\",\"lodash.defaultsdeep\":\"4.6.1\",\"pngjs\":\"3.3.3\",\"scratch-audio\":\"1.0.0\",\"scratch-blocks\":\"1.1.2\",\"scratch-l10n\":\"3.18.3\",\"scratch-render\":\"1.0.0\",\"scratch-render-fonts\":\"1.0.0-prerelease.20231017225105\",\"scratch-semantic-release-config\":\"1.0.8\",\"scratch-storage\":\"2.3.1\",\"scratch-svg-renderer\":\"0.2.0-prerelease.20210727023023\",\"script-loader\":\"0.7.2\",\"semantic-release\":\"19.0.5\",\"stats.js\":\"0.17.0\",\"tap\":\"16.2.0\",\"tiny-worker\":\"2.3.0\",\"uglifyjs-webpack-plugin\":\"1.2.7\",\"webpack\":\"4.46.0\",\"webpack-cli\":\"3.1.0\",\"webpack-dev-server\":\"3.11.2\"}}");
|
|
195516
195516
|
|
|
195517
195517
|
/***/ }),
|
|
195518
195518
|
/* 856 */
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scratch-gui",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.7",
|
|
4
4
|
"description": "Graphical User Interface for creating and running Scratch 3.0 projects",
|
|
5
5
|
"author": "Massachusetts Institute of Technology",
|
|
6
6
|
"license": "BSD-3-Clause",
|
|
@@ -32,72 +32,72 @@
|
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@microbit/microbit-universal-hex": "0.2.2",
|
|
35
|
+
"@microbit/microbit-universal-hex": "^0.2.2",
|
|
36
36
|
"arraybuffer-loader": "^1.0.6",
|
|
37
37
|
"autoprefixer": "^9.0.1",
|
|
38
|
-
"balance-text": "3.3.1",
|
|
39
|
-
"base64-loader": "1.0.0",
|
|
40
|
-
"bowser": "1.9.4",
|
|
38
|
+
"balance-text": "^3.3.1",
|
|
39
|
+
"base64-loader": "^1.0.0",
|
|
40
|
+
"bowser": "^1.9.4",
|
|
41
41
|
"cat-blocks": "npm:scratch-blocks@0.1.0-prerelease.20220318143026",
|
|
42
|
-
"classnames": "2.2.6",
|
|
43
|
-
"computed-style-to-inline-style": "3.0.0",
|
|
44
|
-
"cookie": "0.5.0",
|
|
45
|
-
"copy-webpack-plugin": "6.4.1",
|
|
46
|
-
"core-js": "2.5.7",
|
|
42
|
+
"classnames": "^2.2.6",
|
|
43
|
+
"computed-style-to-inline-style": "^3.0.0",
|
|
44
|
+
"cookie": "^0.5.0",
|
|
45
|
+
"copy-webpack-plugin": "^6.4.1",
|
|
46
|
+
"core-js": "^2.5.7",
|
|
47
47
|
"css-loader": "^1.0.0",
|
|
48
|
-
"dapjs": "2.3.0",
|
|
49
|
-
"es6-object-assign": "1.1.0",
|
|
50
|
-
"get-float-time-domain-data": "0.1.0",
|
|
51
|
-
"get-user-media-promise": "1.1.4",
|
|
52
|
-
"immutable": "3.8.2",
|
|
53
|
-
"intl": "1.2.5",
|
|
54
|
-
"js-base64": "2.4.9",
|
|
55
|
-
"keymirror": "0.1.1",
|
|
56
|
-
"lodash.bindall": "4.4.0",
|
|
57
|
-
"lodash.debounce": "4.0.8",
|
|
58
|
-
"lodash.defaultsdeep": "4.6.1",
|
|
59
|
-
"lodash.omit": "4.5.0",
|
|
60
|
-
"lodash.throttle": "4.0.1",
|
|
61
|
-
"minilog": "3.1.0",
|
|
62
|
-
"omggif": "1.0.9",
|
|
63
|
-
"papaparse": "5.3.0",
|
|
48
|
+
"dapjs": "^2.3.0",
|
|
49
|
+
"es6-object-assign": "^1.1.0",
|
|
50
|
+
"get-float-time-domain-data": "^0.1.0",
|
|
51
|
+
"get-user-media-promise": "^1.1.4",
|
|
52
|
+
"immutable": "^3.8.2",
|
|
53
|
+
"intl": "^1.2.5",
|
|
54
|
+
"js-base64": "^2.4.9",
|
|
55
|
+
"keymirror": "^0.1.1",
|
|
56
|
+
"lodash.bindall": "^4.4.0",
|
|
57
|
+
"lodash.debounce": "^4.0.8",
|
|
58
|
+
"lodash.defaultsdeep": "^4.6.1",
|
|
59
|
+
"lodash.omit": "^4.5.0",
|
|
60
|
+
"lodash.throttle": "^4.0.1",
|
|
61
|
+
"minilog": "^3.1.0",
|
|
62
|
+
"omggif": "^1.0.9",
|
|
63
|
+
"papaparse": "^5.3.0",
|
|
64
64
|
"postcss-import": "^12.0.0",
|
|
65
65
|
"postcss-loader": "^3.0.0",
|
|
66
66
|
"postcss-simple-vars": "^5.0.1",
|
|
67
67
|
"prop-types": "^15.5.10",
|
|
68
68
|
"query-string": "^5.1.1",
|
|
69
69
|
"raw-loader": "^0.5.1",
|
|
70
|
-
"react": "16.
|
|
71
|
-
"react-contextmenu": "2.9.4",
|
|
72
|
-
"react-dom": "16.
|
|
73
|
-
"react-draggable": "3.0.5",
|
|
74
|
-
"react-ga": "2.5.3",
|
|
75
|
-
"react-intl": "2.9.0",
|
|
76
|
-
"react-modal": "3.9.1",
|
|
77
|
-
"react-popover": "0.5.10",
|
|
78
|
-
"react-redux": "5.0.7",
|
|
79
|
-
"react-responsive": "5.0.0",
|
|
80
|
-
"react-style-proptype": "3.2.2",
|
|
81
|
-
"react-tabs": "2.3.0",
|
|
82
|
-
"react-tooltip": "3.8.0",
|
|
83
|
-
"react-virtualized": "9.20.1",
|
|
84
|
-
"redux": "3.7.2",
|
|
85
|
-
"redux-throttle": "0.1.1",
|
|
86
|
-
"scratch-audio": "1.0.0",
|
|
87
|
-
"scratch-blocks": "1.1.
|
|
88
|
-
"scratch-l10n": "3.18.3",
|
|
89
|
-
"scratch-paint": "2.2.
|
|
90
|
-
"scratch-render": "1.0.0",
|
|
91
|
-
"scratch-render-fonts": "1.0.0-prerelease.20231017225105",
|
|
92
|
-
"scratch-storage": "2.3.1",
|
|
93
|
-
"scratch-svg-renderer": "0.2.0",
|
|
94
|
-
"scratch-vm": "2.3.
|
|
95
|
-
"startaudiocontext": "1.2.1",
|
|
70
|
+
"react": "^16.0.0",
|
|
71
|
+
"react-contextmenu": "^2.9.4",
|
|
72
|
+
"react-dom": "^16.0.0",
|
|
73
|
+
"react-draggable": "^3.0.5",
|
|
74
|
+
"react-ga": "^2.5.3",
|
|
75
|
+
"react-intl": "^2.9.0",
|
|
76
|
+
"react-modal": "^3.9.1",
|
|
77
|
+
"react-popover": "^0.5.10",
|
|
78
|
+
"react-redux": "^5.0.7",
|
|
79
|
+
"react-responsive": "^5.0.0",
|
|
80
|
+
"react-style-proptype": "^3.2.2",
|
|
81
|
+
"react-tabs": "^2.3.0",
|
|
82
|
+
"react-tooltip": "^3.8.0",
|
|
83
|
+
"react-virtualized": "^9.20.1",
|
|
84
|
+
"redux": "^3.7.2",
|
|
85
|
+
"redux-throttle": "^0.1.1",
|
|
86
|
+
"scratch-audio": "^1.0.0",
|
|
87
|
+
"scratch-blocks": "^1.1.6",
|
|
88
|
+
"scratch-l10n": "^3.18.3",
|
|
89
|
+
"scratch-paint": "^2.2.2",
|
|
90
|
+
"scratch-render": "^1.0.0",
|
|
91
|
+
"scratch-render-fonts": "^1.0.0-prerelease.20231017225105",
|
|
92
|
+
"scratch-storage": "^2.3.1",
|
|
93
|
+
"scratch-svg-renderer": "^0.2.0",
|
|
94
|
+
"scratch-vm": "^2.3.4",
|
|
95
|
+
"startaudiocontext": "^1.2.1",
|
|
96
96
|
"style-loader": "^0.23.0",
|
|
97
|
-
"text-encoding": "0.7.0",
|
|
98
|
-
"to-style": "1.3.3",
|
|
99
|
-
"wav-encoder": "1.3.0",
|
|
100
|
-
"xhr": "2.5.0"
|
|
97
|
+
"text-encoding": "^0.7.0",
|
|
98
|
+
"to-style": "^1.3.3",
|
|
99
|
+
"wav-encoder": "^1.3.0",
|
|
100
|
+
"xhr": "^2.5.0"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"react": "^16.0.0",
|
|
@@ -106,6 +106,7 @@
|
|
|
106
106
|
"devDependencies": {
|
|
107
107
|
"@babel/cli": "7.14.8",
|
|
108
108
|
"@babel/core": "7.14.8",
|
|
109
|
+
"@babel/eslint-parser": "7.23.10",
|
|
109
110
|
"@babel/plugin-proposal-object-rest-spread": "7.14.7",
|
|
110
111
|
"@babel/plugin-syntax-dynamic-import": "7.2.0",
|
|
111
112
|
"@babel/plugin-transform-async-to-generator": "7.14.5",
|
|
@@ -114,9 +115,7 @@
|
|
|
114
115
|
"@commitlint/cli": "17.8.1",
|
|
115
116
|
"@commitlint/config-conventional": "17.8.1",
|
|
116
117
|
"babel-core": "7.0.0-bridge.0",
|
|
117
|
-
"@babel/eslint-parser": "7.23.9",
|
|
118
118
|
"babel-loader": "8.3.0",
|
|
119
|
-
"chromedriver": "117.0.3",
|
|
120
119
|
"enzyme": "3.10.0",
|
|
121
120
|
"enzyme-adapter-react-16": "1.15.7",
|
|
122
121
|
"eslint": "8.56.0",
|