To test the Tutorial Tool locally:
- Ensure your pxt repo is up to date and has been built recently.
- In a command shell, in the
pxtrepo, cd into thetutorialtoolfolder and start the Tutorial Tool dev server:npm run start. This will not open a browser window. - In another command shell, in the target repo (e.g.
pxt-arcadeorpxt-microbit), start the pxt dev server:pxt serve --rebundle --noauth. This will open the editor webapp in a browser.- Note the
--noauthparameter. 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 /tt endpoint will be routed to the Tutorial Tool dev server.
Debug and step through Tutorial Tool code using the browser dev tools (F12 to open).
- In the pxt repo, run
gulpto ensure production Tutorial 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_TOKENwith 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 "--tutorialtool". This should take you to your Tutorial tool build in staging.
Follow the "Test in staging environment" instructions, but get your auth token from https://makecode.com/oauth/gettoken.