diff --git a/README.md b/README.md index 7cac8c97..92873a9b 100644 --- a/README.md +++ b/README.md @@ -19,20 +19,14 @@ The local server lets you to run the editor and serve the documentation from you The following commands perform a one-time setup after synching the repo on your machine. -* See requirements for [pxt](https://github.com/Microsoft/pxt) -* [clone this repo](https://help.github.com/articles/cloning-a-repository/) to your computer and go in the project folder -``` -git clone https://github.com/microsoft/pxt-microbit -cd pxt-microbit -``` +* install node.js 8.9.4 or higher * install the PXT command line (add ``sudo`` for Mac/Linux shells). ``` npm install -g pxt ``` -* install the dependencies +* install the microbit target ``` -npm install - +pxt target microbit ``` ### Running @@ -41,39 +35,63 @@ Run this command to open a local web server (add ``sudo`` for Mac/Linux shells) ``` pxt serve ``` + 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. -If you need modify the `.cpp` files, turn on yotta compilation with the ``-yt`` flag (add ``sudo`` for Mac/Linux shells): +The server assumes you have yotta installed. You can skip that requirement by adding ``--cloud``. + ``` -pxt serve -yt +pxt serve --cloud ``` -## Updates +### Updates To update your PXT version and make sure you're running the latest tools, run (add ``sudo`` for Mac/Linux shells): ``` pxt update ``` -More instructions are at https://github.com/Microsoft/pxt#running-a-target-from-localhost +More instructions are at https://github.com/Microsoft/pxt#running-a-target-from-localhost -## Testing +## Developer setup -The build also automatically runs the following checks: +If you need to make source changes to ``pxt`` and ``pxt-microbit``, follow these instructions: -* make sure the built-in packages compile -* `pxt run` in `libs/lang-test*` - this will run the test in command line runner; - there is a number of asserts in both of these -* `pxt testdir` in `tests` - this makes sure all the files compile and generates .hex files -* run the TD->TS converter on a number of test scripts from `microbit.co.uk` and make sure the results compile +* 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 +``` -To test something on the device: - -* do a `pxt deploy` in `libs/lang-test*` - they should show `1` or `2` on the screen (and not unhappy face) -* run `pxt testdir` in `tests` and deploy some of the hex files from `tests/built` - -The `lang-test0` source comes from the `pxt-core` package. It's also tested with `pxt run` there. +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