-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updating develop with the new json5 dependencies
- Loading branch information
Randi Williams
committed
Sep 9, 2021
1 parent
208c540
commit c354423
Showing
3 changed files
with
4 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,7 @@ It is structured as a monorepo, where the Scratch components you'll typically wa | |
|
||
## ⚡ Quick Setup️ | ||
|
||
Requirements | ||
1. Your java version should be 8 or higher. Check `java -version`. | ||
2. Install node.js https://nodejs.org/en/ (tested with Linux version 6.13.4 and Mac) | ||
Requirements, your java version should be 8 or higher. Check `java -version`. | ||
|
||
```shell script | ||
git clone [email protected]:mitmedialab/prg-extension-boilerplate.git | ||
|
@@ -62,20 +60,6 @@ sh: webpack: command not found | |
|
||
**Solution**: This may mean you have a half-installed node_modules version of webpack. Try starting fresh! | ||
|
||
## Adding a new Scratch Extension | ||
|
||
The most common modification to Scratch that you will be doing is adding a new category of blocks, also called an extension, to the toolbox. To complete this work, you will primarily be working in [packages/scratch-vm](packages/scratch-vm). | ||
1. Enter `packages/scratch-vm` and navigate to `packages/scratch-vm/src/extensions`. This folder contains all of the extensions that currently exist in your toolbox. | ||
2. Make a new folder for the extension that you want to create. For example, make a folder called `scratch3_test`. Then enter that folder. | ||
3. In `scratch3_test`, create a new file, `index.js`. | ||
4. To populate the `index.js` file that you created, look at [this annonated Scratch extension example](https://github.com/LLK/scratch-vm/blob/develop/docs/extensions.md#annotated-example). This example can be copied directly as a starting point. Another starting point to consider would be copying the `index.js` of another extension in the `packages/scratch-vm/extensions` folder that has most of the functionality that you are looking for. | ||
5. Once your index.js is settled, add the name of the extension to `scratch-vm/src/extension-support/extension-manager.js`. Look at the other extensions added there as a template for how you should add your new extension. | ||
6. Now you will have to navigate to `packages/scratch-gui`. Add the extension name and url of your new extension to `scratch-gui/src/lib/libraries/extensions/index.jsx`. | ||
7. [Optional] If you want the extension to automatically be loaded whenever you load the page, add it as a CORE_EXTENSION in `scratch-vm/src/virtual-machine.js`. | ||
|
||
More information about creating a new Scratch extension [can be found here](https://github.com/LLK/scratch-vm/blob/develop/docs/extensions.md). | ||
|
||
|
||
## 💡 How this was made: | ||
|
||
### Sub-packages | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters