Skip to content

Commit

Permalink
fix(deps): after installing deps, replace Blockly v11 with v12 RC
Browse files Browse the repository at this point in the history
  • Loading branch information
cwillisf committed Oct 18, 2024
1 parent 768d025 commit 677ff6f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Temporary until Blockly v12 release
/blockly-rc/

# OSX
.DS_Store

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"scripts": {
"build": "webpack --mode production",
"prepare": "husky || true",
"prepublish": "./temp-use-blockly-v12-rc.sh",
"start": "webpack serve --open --mode development",
"test": "echo \"Error: no test specified\" && exit 1",
"test:lint": "eslint ."
Expand Down
26 changes: 26 additions & 0 deletions temp-use-blockly-v12-rc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# vim: set tw=118 ts=2 sw=2 expandtab

# This script is intended to be run from the root of the scratch-blocks repo.
# This will check out the Blockly v12 Release Candidate branch,
# build it, and link it into node_modules/

# TODO: Remove this script once Blockly v12 is available from https://www.npmjs.com/package/blockly

# WARNING: This uses `npm link`, which causes system-wide changes!

set -e -x

if [ ! -d "blockly-rc" ]; then
git clone --branch rc/v12.0.0 git@github.com:google/blockly.git blockly-rc
else
git -C blockly-rc checkout rc/v12.0.0
git -C blockly-rc pull
fi
npm -C blockly-rc ci
npm -C blockly-rc run package

# --legacy-peer-deps can be removed once the Blockly plugins used by scratch-blocks support Blockly v12
# --prefer-offline speeds this up by roughly 2x on my computer (!!)
# --prefer-offline should be OK since we're probably running immediately after a non-offline `npm i` or `npm ci`
npm link --prefer-offline --legacy-peer-deps blockly-rc/dist/
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"exclude": [
"./blockly-rc/"
],
"compilerOptions": {
"outDir": "./dist/",
"noImplicitAny": true,
Expand Down

0 comments on commit 677ff6f

Please # to comment.