To test the Teacher Tool locally:
- Ensure your pxt repo is up to date and has been built recently.
- In a command shell, in the
pxt
repo, cd into theteachertool
folder and start the Teacher Tool dev server:npm run start
. This will not open a browser window. - In another command shell, in the target repo (e.g.
pxt-arcade
orpxt-microbit
), start the pxt dev server:pxt serve --rebundle --noauth
. This will open the editor webapp in a browser.- Note the
--noauth
parameter. It is important to include this option when running on localhost in order to download certain required startup files from the localhost pxt server.
- Note the
Requests to the /eval
endpoint will be routed to the Teacher Tool dev server.
Debug and step through Teacher Tool code using the browser dev tools (F12 to open).
- In the pxt repo, run
gulp
to ensure production teacher tool is built. - In a browser, go to
https://staging.pxt.io/oauth/gettoken
. This should return a url with an auth token embedded. Copy the entire url value to your clipboard.- It should look something like
https://staging.pxt.io/?access_token=X.XXXXXXXX
- If you get access denied, contact your manager to help you.
- It should look something like
- In a command shell, set environment variable
PXT_ACCESS_TOKEN
with the copied value. - In the same shell, in the pxt-arcade repo, run
pxt uploadtrg --rebundle
. This should return a url to your private build.- It should look something like
https://arcade.staging.pxt.io/app/XXXXXX-XXXXX
- It should look something like
- Paste in a browser and append "/teachertool". This should take you to your teacher tool build in staging.
Follow the "Test in staging environment" instructions, but get your auth token from https://makecode.com/oauth/gettoken
.