From fba5d270eb0f7d5f161e995df64d96b00dc05521 Mon Sep 17 00:00:00 2001 From: Andrew Mulholland Date: Wed, 28 Feb 2018 00:02:58 +0000 Subject: [PATCH] Update README.md (#680) * Update README.md Update the readme.md file to include current docs for local development. * Fix README.md Yotta typo --- README.md | 99 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index 5717b1cd..f19b4567 100644 --- a/README.md +++ b/README.md @@ -15,34 +15,74 @@ Please add an issue if you discover an (unreported) bug. The local server lets you to run the editor and serve the documentation from your own computer. -### Setup +### Setup +This section explains how to setup your development environment for pxt-microbit, whether that be to run a copy locally or to make source changes. +Note that pxt-microbit can not be run without its main depandancy, [pxt](https://github.com/Microsoft/pxt). Below explains how to setup both. The following commands perform a one-time setup after synching the repo on your machine. +* Note for any editing of the .cpp files, Yotta must be installed. Do do so, follow the instructions on [their site](http://docs.yottabuild.org/). +* Install node.js 8.9.4 or higher. +* Install requirements for [pxt](https://github.com/Microsoft/pxt). Note the v0 branch must be used for pxt-microbit (add ``sudo`` for Mac/Linux shells). +``` +npm install -g jake +npm install -g typings +``` -* install node.js 8.9.4 or higher +* [Clone the pxt repository](https://help.github.com/articles/cloning-a-repository/) and set it to the v0 branch. +``` +git clone https://github.com/microsoft/pxt +cd pxt +git checkout v0 +``` + +* Install the pxt dependencies. +``` +npm install +typings install +jake +cd ../ +``` + +* [Clone this repo](https://help.github.com/articles/cloning-a-repository/) to your computer. +``` +git clone https://github.com/microsoft/pxt-microbit +cd pxt-microbit +``` * install the PXT command line (add ``sudo`` for Mac/Linux shells). ``` npm install -g pxt ``` -* install the microbit target +* install the dependencies ``` -pxt target microbit +npm install + ``` +* Link pxt-microbit back to base pxt repo. +``` +npm link ../pxt +``` +Note the above command assumes the folder structure of +``` + makecode + | + ----------------- + | | + pxt pxt-microbit + ``` + ### Running -Run this command to open a local web server (add ``sudo`` for Mac/Linux shells) +Run this command from inside pxt-microbit to open a local web server (add ``sudo`` for Mac/Linux shells) ``` -pxt serve +pxt serve --cloud ``` - If the local server opens in the wrong browser, make sure to copy the URL containing the local token. Otherwise, the editor will not be able to load the projects. -The server assumes you have yotta installed. You can skip that requirement by adding ``--cloud``. - +If you need modify the `.cpp` files (and have installed yotta), enable yotta compilation by removing the ```--cloud``` flag (add ``sudo`` for Mac/Linux shells): ``` -pxt serve --cloud +pxt serve ``` ### Updates @@ -54,45 +94,6 @@ pxt update More instructions are at https://github.com/Microsoft/pxt#running-a-target-from-localhost -## Developer setup - -If you need to make source changes to ``pxt`` and ``pxt-microbit``, follow these instructions: - -* clone https://github.com/Microsoft/pxt -``` -git clone https://github.com/Microsoft/pxt -``` -* checkout the ``v0`` branch in pxt -``` -cd pxt -git checkout v0 -``` -* ``npm install`` and run ``jake`` -``` -npm install -jake -``` -* clone https://github.com/Microsoft/pxt-microbit -``` -cd .. -git clone https://github.com/Microsoft/pxt-microbit -``` -* ``npm install`` and link to the ``pxt`` folder -``` -cd pxt-microbit -npm install -npm link ../pxt -``` - -Both of those repoes are now ready to go. To start your local server, run -``` -pxt serve -``` -or, without yotta tools, -``` -pxt serve --cloud -``` - ## Repos The pxt-microbit target depends on several other repos. The main ones are: