How to Create a MakeCode Package for Micro:Bit

Pages
Contributors: Englandsaurus
Favorited Favorite 2

Thing's You'll Need

First, let's set up our build environment, we'll start by downloading and installing Node.js.

You'll also need a GitHub account. Now go ahead and open any old command prompt and navigate to to where you store your GitHub files (I create a GitHub folder on my C:\ drive so for me this is C:\GitHub). Then go ahead and run the following commands. This installs a few npm packages to use.

language:bash
npm install
npm install jake
npm install typings

We'll then clone the PXT directory into our GitHub folder and run these npm packages we just installed. At the end, back out to the GitHub folder once more. This is accomplished with the following commands.

language:bash
git clone https://github.com/microsoft/pxt
cd pxt
git checkout
npm install
typings install
jake
cd..

We'll then clone in the Micro:Bit target, and install pxt there.

language:bash
git clone https://github.com/Microsoft/pxt-microbit
cd pxt-microbit
npm install -g pxt
npm install
cd..

This should be everything we need to build our project, now let's clone in an existing SparkFun MakeCode package and get started editing it.

language:bash
git clone https://github.com/sparkfun/pxt-gator-light