TouchDevelop is a touch-friendly app creation environment for iPad, iPhone, Android, Windows, Mac, Linux. Our mobile-friendly editor makes coding fun, even on your phone or tablet!
Перейти к файлу
Peli de Halleux c0797dd54d updated message 2018-05-17 15:14:27 -07:00
.vscode
ast Minor converter changes 2016-04-13 16:23:37 -07:00
browser removing webappbooster support 2015-12-10 17:53:29 -08:00
editor updated message 2018-05-17 15:14:27 -07:00
embedded display save button for compile dialog. fix for bbc/microbit-extras#2824 2016-02-08 13:59:23 -08:00
fonts
generated Getting latest CrowdIn strings 2016-06-15 13:52:08 -07:00
images replace script list BBC logo 2016-12-19 10:19:27 -08:00
intellitrain
json Fix line endings 2015-02-04 13:41:44 -08:00
lib Adding more loc hooks for a few more strings 2016-06-01 17:49:57 -07:00
libcordova more cordova fix 2015-07-16 07:11:45 -07:00
libnode
libraries merging changes 2016-04-04 10:59:32 -07:00
locales Getting latest CrowdIn strings 2016-06-15 13:52:08 -07:00
microbit
node-webkit
noderunner remove c++ compilation from test suite 2016-06-15 13:58:21 -07:00
officemix
rt updated footer links 2017-08-12 23:23:09 -07:00
runner Fixing "TouchDevelop" text and adding loc hooks 2015-12-11 12:56:32 -08:00
shell
storage Adding loc hooks, fixing "Touch Develop" references in strings 2016-05-26 17:34:44 -07:00
tools Merge branch 'bbcmicrobit' 2016-08-09 11:45:54 -07:00
typings
webapp
www Retirement Banner (#505) 2018-05-09 14:09:33 -07:00
.ackrc
.gitattributes
.gitignore
.travis.yml
CONTRIBUTING.md
Jakefile
LICENSE
Makefile
README.md
package-lock.json
package.json
tsd.json
vs.sln
vsrefs.ts

README.md

Touch Develop is a touch-friendly, cross-platform, mobile-first app creation environment developed by Microsoft Research. Build Status

Dependency Status devDependency Status

Writing and saving Touch Develop scripts

This repo contains the source code of the Touch Develop editor. If you are intending to write Touch Develop scripts, you want to go to the web app at touchdevelop.com:

You can save a Touch Develop script from the web app by clicking the Save button on the script's home page. This will create a JSON file that you can save. You can later drag-and-drop that file into the web app (running locally or via the web site) to load the script again.

Other pages of interest:

What's in this repo?

The repo is mostly written in TypeScript with tiny pieces of HTML gluing.

This repo contains the source code for:

  • the browser client
  • the compiler
  • the editor
  • the runtime
  • the node.js client

The cloud backend for Touch Develop is available in TouchDevelop-backend repo. It was originally written in Touch Develop itself (see script tdlite if you're interested) and was later converted to TypeScript. It is currently used for the BBC micro:bit as well as https://www.touchdevelop.com.

Contributing

There are many ways to contribute to Touch Develop.

If you're not a developer but still would like to help, we've got more tasks for you!

Setup

In order to build Touch Develop, ensure that you have Git and Node.js installed.

  • clone a copy of the repo:
git clone https://github.com/Microsoft/TouchDevelop.git
  • change to the Touch Develop directory:
cd TouchDevelop
  • install dependencies:
npm install jake -g
npm install tsd@next -g
tsd reinstall
npm install

Building

There's different ways to build and run Touch Develop:

  • just build:
jake

You can generate source maps by defining the env variable TD_SOURCE_MAPS

export TD_SOURCE_MAPS=1 # optional, will slow down your build
  • build and run locally:
jake local
  • run the test suite
jake test
  • cleaning
jake clean

Arduino compilation on Windows

These steps install the tools for Windows (+ extras to handle the Arduino compilation scenarios)

  • install Chocolatey
  • install nodejs, Visual Studio Code
choco install -y nodejs git visualstudiocode arduino python2 pip

Editing

You can use your favorite editor to edit the TypeScript file. Here are a couple tips:

  • Visual Studio Code, cross platform editor for TypeScript. Simply open the folder in Code.
  • Atom: there are a number of packages that will give you TypeScript coloring

Documentation

All the docs are available online at https://www.touchdevelop.com/docs.

The docs are authored as Touch Develop scripts in Touch Develop itself. You can fork them and send pull requests from Touch Develop itself to update them.

More handy commands

Our catch-all tool is build/client.js, which is compiled from tools/client.ts. Some of the common invocations of client.js are exposed as Jake targets.

# assumes TD_UPLOAD_KEY and TD_UPLOAD_USER are set, uploads a new test build
jake upload

Find out about other commands directly:

node build/client.js

The client.js is built by default.

The various directories in the tree

  • ast: contains the lexer, parser, type-checker and ast definitions for the Touch Develop language
  • browser: feature-detection
  • editor: the Touch Develop user interface that drives the website: hub, script list, editor itself
  • generated: files needed for the build that are re-generated manually once in a while
  • intellitrain:
  • json:
  • lib: the libraries exposed to Touch Develop scripts, written in TypeScript
  • libcordova: Apache Cordova specific implementations
  • libnode: Node.JS specific implementations
  • libwinRT: (deprecated) WinRT specific implementations
  • mc: Minecraft bindings
  • noderunner: runs in the cloud, and parses Touch Develop scripts / compiles them by responding to requests on /api.
  • node-webkit: configuration files for the node-webkit app creation
  • officemix: office mix app host
  • rt: various run-time support libraries for the Touch Develop application: in-browser storage, cloud connection, promises, DOM utilities...
  • runner: the run-time system for generated Touch Develop apps; that is, once a Touch Develop script is packaged as an app (webapp, cordova app, etc.), runner.js is the runtime system and the stub is in webapp
  • shell: shell app used by Azure and node-webkit; basically a way to serve files locally
  • storage: code for syncing your locally-stored scripts and the cloud storage, in the Touch Develop application
  • tools: internal tools that are part of the build (pre-processing)
  • webapp: the stub file that is used to generate the HTML5 Web App when exporting a script
  • www: the base files that make up the Touch Develop website (html and css)

Structure of the generated website / app

When packaged, as the website or as an app, the directory structure is flat. That is, the CSS and HTML files from www/ as well as the generated .js files from build/ all end up in the same directory. That way, index.html can refer to main.js without worrying.

When running locally (via jake local), the local node server knows where to find the right files to give the illusion that all files are in the /editor/local/ directory of the web server.

LICENSE

The MIT License (MIT)

Copyright (c) 2016 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

3rd Party Notices

Code of Conduct

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.