1 |
|
2 | # TypeScript
|
3 |
|
4 | [![Build Status](https://travis-ci.org/microsoft/TypeScript.svg?branch=master)](https://travis-ci.org/microsoft/TypeScript)
|
5 | [![Devops Build Status](https://dev.azure.com/typescript/TypeScript/_apis/build/status/Typescript/node10)](https://dev.azure.com/typescript/TypeScript/_build?definitionId=7)
|
6 | [![npm version](https://badge.fury.io/js/typescript.svg)](https://www.npmjs.com/package/typescript)
|
7 | [![Downloads](https://img.shields.io/npm/dm/typescript.svg)](https://www.npmjs.com/package/typescript)
|
8 |
|
9 | [TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).
|
10 |
|
11 | Find others who are using TypeScript at [our community page](https://www.typescriptlang.org/community/).
|
12 |
|
13 | ## Installing
|
14 |
|
15 | For the latest stable version:
|
16 |
|
17 | ```bash
|
18 | npm install -g typescript
|
19 | ```
|
20 |
|
21 | For our nightly builds:
|
22 |
|
23 | ```bash
|
24 | npm install -g typescript@next
|
25 | ```
|
26 |
|
27 | ## Contribute
|
28 |
|
29 | There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
|
30 | * [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
|
31 | * Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
|
32 | * Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
|
33 | * Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
|
34 | * Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
|
35 | * [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/master/CONTRIBUTING.md).
|
36 | * Read the language specification ([docx](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.docx?raw=true),
|
37 | [pdf](https://github.com/microsoft/TypeScript/blob/master/doc/TypeScript%20Language%20Specification.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)).
|
38 |
|
39 | This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
|
40 | the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
|
41 | with any additional questions or comments.
|
42 |
|
43 | ## Documentation
|
44 |
|
45 | * [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
|
46 | * [Programming handbook](https://www.typescriptlang.org/docs/handbook/basic-types.html)
|
47 | * [Language specification](https://github.com/microsoft/TypeScript/blob/master/doc/spec.md)
|
48 | * [Homepage](https://www.typescriptlang.org/)
|
49 |
|
50 | ## Building
|
51 |
|
52 | In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed.
|
53 |
|
54 | Clone a copy of the repo:
|
55 |
|
56 | ```bash
|
57 | git clone https://github.com/microsoft/TypeScript.git
|
58 | ```
|
59 |
|
60 | Change to the TypeScript directory:
|
61 |
|
62 | ```bash
|
63 | cd TypeScript
|
64 | ```
|
65 |
|
66 | Install [Gulp](https://gulpjs.com/) tools and dev dependencies:
|
67 |
|
68 | ```bash
|
69 | npm install -g gulp
|
70 | npm ci
|
71 | ```
|
72 |
|
73 | Use one of the following to build and test:
|
74 |
|
75 | ```
|
76 | gulp local # Build the compiler into built/local.
|
77 | gulp clean # Delete the built compiler.
|
78 | gulp LKG # Replace the last known good with the built one.
|
79 | # Bootstrapping step to be executed when the built compiler reaches a stable state.
|
80 | gulp tests # Build the test infrastructure using the built compiler.
|
81 | gulp runtests # Run tests using the built compiler and test infrastructure.
|
82 | # Some low-value tests are skipped when not on a CI machine - you can use the
|
83 | # --skipPercent=0 command to override this behavior and run all tests locally.
|
84 | # You can override the specific suite runner used or specify a test for this command.
|
85 | # Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
|
86 | # Valid runners include conformance, compiler, fourslash, project, user, and docker
|
87 | # The user and docker runners are extended test suite runners - the user runner
|
88 | # works on disk in the tests/cases/user directory, while the docker runner works in containers.
|
89 | # You'll need to have the docker executable in your system path for the docker runner to work.
|
90 | gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
|
91 | # core count by default. Use --workers=<number> to adjust this.
|
92 | gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
|
93 | gulp lint # Runs eslint on the TypeScript source.
|
94 | gulp help # List the above commands.
|
95 | ```
|
96 |
|
97 |
|
98 | ## Usage
|
99 |
|
100 | ```bash
|
101 | node built/local/tsc.js hello.ts
|
102 | ```
|
103 |
|
104 |
|
105 | ## Roadmap
|
106 |
|
107 | For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).
|