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 43e2ce3fb7 added td badges 2015-02-11 20:26:36 -08:00
ast using <style> tags instead of <link> when importing css 2015-02-11 16:43:58 -08:00
browser Start converting a subset of the tree to --noImplicitAny. 2015-02-10 14:00:22 -08:00
editor move split button in top button row (and hide in phone mode) 2015-02-11 17:26:21 -08:00
generated run update-docs 2015-02-10 17:33:24 -08:00
images New initial commit. Yay again! 😹 2015-02-04 08:07:58 -08:00
intellitrain Fix line endings 2015-02-04 13:41:44 -08:00
json Fix line endings 2015-02-04 13:41:44 -08:00
lib using <style> tags instead of <link> when importing css 2015-02-11 16:43:58 -08:00
libcordova Cleanup part 2: tsc outputs go into [build/]. 2015-02-04 17:53:03 -08:00
libnode Cleanup part 2: tsc outputs go into [build/]. 2015-02-04 17:53:03 -08:00
libwab removed icon use, fixed localization 2015-02-10 02:26:06 -08:00
libwinRT Cleanup part 2: tsc outputs go into [build/]. 2015-02-04 17:53:03 -08:00
mc Cleanup part 2: tsc outputs go into [build/]. 2015-02-04 17:53:03 -08:00
node-webkit nw: adding 'fake-websocket' dependency 2015-02-06 06:34:33 -08:00
noderunner don't render description when rendering doc topics 2015-02-11 15:00:38 -08:00
officemix Housekeeping (officemix goes into its own subdirectory). 2015-02-05 13:35:03 -08:00
rt move split button in top button row (and hide in phone mode) 2015-02-11 17:26:21 -08:00
runner Cleanup part 2: tsc outputs go into [build/]. 2015-02-04 17:53:03 -08:00
shell add content type for TS files 2015-02-09 15:13:06 -08:00
storage using <style> tags instead of <link> when importing css 2015-02-11 16:43:58 -08:00
tools allow arguments to client buildtest 2015-02-10 17:27:30 -08:00
webapp Massive cleanup to the directory structure. 2015-02-05 14:29:38 -08:00
www move split button in top button row (and hide in phone mode) 2015-02-11 17:26:21 -08:00
.ackrc Move touchdevelop.tgz to build/ 2015-02-05 09:38:28 -08:00
.gitattributes dummy visual studio solution to edit typescript in VS 2015-02-11 09:33:19 -08:00
.gitignore dummy visual studio solution to edit typescript in VS 2015-02-11 09:33:19 -08:00
.travis.yml cache typescript definition files in travis-ci 2015-02-10 10:46:10 -08:00
.tsdrc Re-instate TSD as part of the build. 2015-02-10 10:39:45 -08:00
CONTRIBUTING.md beefing up the docs 2015-02-04 08:52:32 -08:00
Jakefile build/api.js depends on lib/ 2015-02-11 16:15:44 -08:00
LICENSE New initial commit. Yay again! 😹 2015-02-04 08:07:58 -08:00
Makefile remove old stuff from the Makefile 2015-02-10 16:33:38 -08:00
README.md added td badges 2015-02-11 20:26:36 -08:00
package.json New feature: generate proper, concatenated, merged source maps. 2015-02-09 17:30:29 -08:00
tsd.json Start moving to [tsd]. More troubles ahead... 2015-02-04 08:12:08 -08:00
vs.sln more files in vs solution 2015-02-11 17:26:30 -08:00
vsrefs.ts don't render description when rendering doc topics 2015-02-11 15:00:38 -08:00

README.md

TouchDevelop

TouchDevelop is a touch-friendly app creation environment for iPad, iPhone, Android, Windows, Mac, Linux developed with <3 at Microsoft Research. Our mobile-friendly editor makes coding fun, even on your phone or tablet!

Build Status App Status Beta Status Could Status

This repo contains the source code of the TouchDevelop editor. If you are intending to write TouchDevelop scripts, you probably want to go to touchdevelop.com:

If you want to always run the latest build,

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

However, you will not find the cloud backend code here. Indeed, https://www.touchdevelop.com takes care of storing and managing the scripts.

Contributing

There are many ways to contribute to TouchDevelop.

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

Building

In order to build TouchDevelop, 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 TouchDevelop directory:

cd TouchDevelop

Install dependencies:

npm install jake -g
npm install tsd@next -g
tsd reinstall
npm install

Build:

export TD_SOURCE_MAPS=1 # optional, will slow down your build
jake

Running

After building, you can run TouchDevelop from a local node server by running:

jake local

The local instance can be accessed at http://localhost:4242/editor/local/.

Tests

jake test

Cleaning

jake clean

Editing

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

  • Visual Studio 2013+: open the vs.sln, then open the vsrefs.ts file to open the repo as a virtual folder.
  • 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 TouchDevelop scripts in TouchDevelop itself. You can fork them and send pull requests from TouchDevelop itself to update them. You can update the local cache of documents by running this command:

jake update-docs

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 TouchDevelop language
  • browser: feature-detection
  • editor: the TouchDevelop 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 TouchDevelop scripts, written in TypeScript
  • libcordova: Apache Cordova specific implementations
  • libnode: Node.JS specific implementations
  • libwab: WebAppBooster implementations, used by the Windows Phone client
  • libwinRT: (deprecated) WinRT specific implementations
  • mc: Minecraft bindings
  • noderunner: runs in the cloud, and parses TouchDevelop 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 TouchDevelop application: in-browser storage, cloud connection, promises, DOM utilities...
  • runner: the run-time system for generated TouchDevelop apps; that is, once a TouchDevelop 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 TouchDevelop 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 TouchDevelop 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) 2015 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.