Scratchサーバーを手元で立ち上げる
https://gyazo.com/1b23f640e591db0ac6638e417d87e094
立ち上げる時の詳細な手順は/BSD/Scratch at FreeBSDを参照してください。
ターゲットは #FreeBSD ですが、他の環境でもほとんど同じ手順で動くはずです。
公式のScratch3サーバのみを立ち上げる
詳細は、大人のためのScratch Scratch を改造しようの2. Scratch 3を自分のパソコンで動かしてみようを参照
事前に必要な準備(具体的な方法は省略)
gitコマンドのインストール
Node.jsの環境構築(リンクを参照)
追加拡張機能の無いScratch3サーバーを準備する
code:shell
$ git clone --depth 1 https://github.com/LLK/scratch-gui
$ cd scratch-gui
$ npm install
サーバーを起動する(scratch-guiディレクトリで実行)
code:shell
$ npm start
Microbit More拡張機能を追加する
scratch-guiディレクトリで作業する
code:shell
# Microbit More
## 本当は、mbit-more-v2は、checkout@v2した方が良い?
$ git clone --depth 1 https://github.com/microbit-more/mbit-more-v2
$ ln -s mbit-more-v2 microbitMore
$ sh ./microbitMore/install-stretch3.sh
AkaDako拡張機能を追加する
scratch-guiディレクトリで作業する
code:shell
# AkaDako
$ git clone --depth 1 https://github.com/tfabworks/xcx-g2s
$ sh ./xcx-g2s/scripts/stretch3-install.sh
他のPCからMicrobit MoreやAkaDakoなどの拡張機能を使うために
基本的に、カメラやマイクを使う機能や、 #WebUSB #WebBluetooth などを使う拡張機能は、localhostではない外部からはhttp経由ではなくhttps経由でしか使えない
だから、httpsが使えるように設定する必要がある
nginxやapacheで(自己署名証明書 aka オレオレ証明書を使って)SSLを使う設定にして、proxyでScratchサーバにつなぐ設定をする
補足情報
実際に、https://stretch3.github.io/ にstretch3を作る手順は、以下を参照。
https://github.com/stretch3/stretch3.github.io/blob/source/.github/workflows/deploy.yml
さらに、GitHub Actions で独自 Scratch を動かすも参考になる。
git cloneする時に--depth 1をつけているのは、大量のソース更新ログを取ってこないため。
#FreeBSD で動かす方法は、/BSD/Scratch at FreeBSDを参照。
#Scratch
#MicrobitMore #AkaDako