Skip to content

Commit

Permalink
Updating develop with the new json5 dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Randi Williams committed Sep 9, 2021
1 parent 208c540 commit c354423
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
1 change: 1 addition & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jobs:
node-version: ${{ matrix.node-version }}
- name: npm install, build, and test
run: |
npm install json5
npx lerna link --force-local
npx lerna exec -- npm install
npx lerna link --force-local
Expand Down
18 changes: 1 addition & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions packages/scratch-blocks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"browser": "./shim/vertical.js",
"scripts": {
"deploy": "rimraf gh-pages/closure-library/scripts/ci/CloseAdobeDialog.exe && gh-pages -t -d gh-pages -m \"Build for $(git log --pretty=format:%H -n1)\"",
"prepublish": "python build.py && webpack",
"prepublish": "python2 build.py && webpack",
"test:unit": "node tests/jsunit/test_runner.js",
"test:lint": "eslint .",
"test:messages": "npm run translate && node i18n/test_scratch_msgs.js",
Expand All @@ -39,7 +39,7 @@
"google-closure-compiler": "20180402.0.0",
"google-closure-library": "20180204.0.0",
"graceful-fs": "4.1.11",
"json": "9.0.4",
"json": "10.0.0",
"rimraf": "2.6.2",
"scratch-l10n": "^3.7.20191219145348",
"selenium-webdriver": "^4.0.0-alpha.1",
Expand Down

0 comments on commit c354423

Please sign in to comment.