You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+51-11
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,21 @@
1
1
## Contributing bug fixes
2
+
2
3
TypeScript is currently accepting contributions in the form of bug fixes. A bug must have an issue tracking it in the issue tracker that has been approved ("Milestone == Community") by the TypeScript team. Your pull request should include a link to the bug that you are fixing. If you've submitted a PR for a bug, please post a comment in the bug to avoid duplication of effort.
3
4
4
5
## Contributing features
6
+
5
7
Features (things that add new or improved functionality to TypeScript) may be accepted, but will need to first be approved (marked as "Milestone == Community" by a TypeScript coordinator with the message "Approved") in the suggestion issue. Features with language design impact, or that are adequately satisfied with external tools, will not be accepted.
6
8
7
9
Design changes will not be accepted at this time. If you have a design change proposal, please log a suggestion issue.
8
10
9
11
## Legal
12
+
10
13
You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright.
11
14
12
15
Please submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit https://cla.microsoft.com to sign digitally. Alternatively, download the agreement ([Microsoft Contribution License Agreement.docx](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=822190) or [Microsoft Contribution License Agreement.pdf](https://www.codeplex.com/Download?ProjectName=typescript&DownloadId=921298)), sign, scan, and email it back to <[email protected]>. Be sure to include your github user name along with the agreement. Once we have received the signed CLA, we'll review the request.
13
16
14
17
## Housekeeping
18
+
15
19
Your pull request should:
16
20
17
21
* Include a description of what your change intends to do
@@ -28,8 +32,24 @@ Your pull request should:
28
32
* Follow the code conventions descriped in [Coding guidelines](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines)
29
33
* To avoid line ending issues, set `autocrlf = input` and `whitespace = cr-at-eol` in your git configuration
30
34
35
+
## Contributing `lib.d.ts` fixes
36
+
37
+
The library sources are in: [src/lib](https://github.com/Microsoft/TypeScript/tree/master/src/lib)
38
+
39
+
Library files in `built/local/` are updated by running
40
+
```Shell
41
+
jake
42
+
```
43
+
44
+
The files in `lib/` are used to bootstrap compilation and usually do not need to be updated.
45
+
46
+
#### `src/lib/dom.generated.d.ts` and `src/lib/webworker.generated.d.ts`
47
+
48
+
These two files represent the DOM typings and are auto-generated. To make any modifications to them, please submit a PR to https://github.com/Microsoft/TSJS-lib-generator
49
+
31
50
## Running the Tests
32
-
To run all tests, invoke the runtests target using jake:
51
+
52
+
To run all tests, invoke the `runtests` target using jake:
33
53
34
54
```Shell
35
55
jake runtests
@@ -47,23 +67,42 @@ e.g. to run all compiler baseline tests:
47
67
jake runtests tests=compiler
48
68
```
49
69
50
-
or to run specifc test: `tests\cases\compiler\2dArrays.ts`
70
+
or to run a specific test: `tests\cases\compiler\2dArrays.ts`
51
71
52
72
```Shell
53
73
jake runtests tests=2dArrays
54
74
```
55
75
76
+
## Debugging the tests
77
+
78
+
To debug the tests, invoke the `runtests-browser` task from jake.
79
+
You will probably only want to debug one test at a time:
80
+
81
+
```Shell
82
+
jake runtests-browser tests=2dArrays
83
+
```
84
+
85
+
You can specify which browser to use for debugging. Currently Chrome and IE are supported:
You can debug with VS Code or Node instead with `jake runtests debug=true`:
92
+
93
+
```Shell
94
+
jake runtests tests=2dArrays debug=true
95
+
```
96
+
56
97
## Adding a Test
57
-
To add a new testcase, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making.
58
98
59
-
These files support metadata tags in the format `// @metaDataName: value`. The supported names and values are:
99
+
To add a new test case, simply place a `.ts` file in `tests\cases\compiler` containing code that exemplifies the bugfix or change you are making.
60
100
61
-
*`comments`, `sourcemap`, `noimplicitany`, `declaration`: true or false (corresponds to the compiler command-line options of the same name)
62
-
*`target`: ES3 or ES5 (same as compiler)
63
-
*`out`, outDir: path (same as compiler)
64
-
*`module`: local, commonjs, or amd (local corresponds to not passing any compiler --module flag)
65
-
*`fileName`: path
66
-
* These tags delimit sections of a file to be used as separate compilation units. They are useful for tests relating to modules. See below for examples.
101
+
These files support metadata tags in the format `// @metaDataName: value`.
102
+
The supported names and values are the same as those supported in the compiler itself, with the addition of the `fileName` flag.
103
+
`fileName` tags delimit sections of a file to be used as separate compilation units.
104
+
They are useful for tests relating to modules.
105
+
See below for examples.
67
106
68
107
**Note** that if you have a test corresponding to a specific spec compliance item, you can place it in `tests\cases\conformance` in an appropriately-named subfolder.
69
108
**Note** that filenames here must be distinct from all other compiler testcase names, so you may have to work a bit to find a unique name if it's something common.
@@ -86,6 +125,7 @@ var x = g();
86
125
One can also write a project test, but it is slightly more involved.
87
126
88
127
## Managing the Baselines
128
+
89
129
Compiler testcases generate baselines that track the emitted `.js`, the errors produced by the compiler, and the type of each expression in the file. Additionally, some testcases opt in to baselining the source map output.
90
130
91
131
When a change in the baselines is detected, the test will fail. To inspect changes vs the expected baselines, use
@@ -102,4 +142,4 @@ jake baseline-accept
102
142
103
143
to establish the new baselines as the desired behavior. This will change the files in `tests\baselines\reference`, which should be included as part of your commit. It's important to carefully validate changes in the baselines.
104
144
105
-
**Note** that baseline-accept should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run.
145
+
**Note** that `baseline-accept` should only be run after a full test run! Accepting baselines after running a subset of tests will delete baseline files for the tests that didn't run.
0 commit comments