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: README.md
+13-5Lines changed: 13 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -5,12 +5,9 @@
5
5
This tool is used to generate `dom.generated.d.ts` and `webworker.generated.d.ts` for TypeScript, and `domWeb.js` and `domWindows.js` for Visual Studio JavaScript language service. The input file is the XML spec file generated by the Microsoft Edge browser.
6
6
7
7
## Build Instruction
8
-
To build the tool, simply clone the repo, and run `build.cmd` in command line or powershell. If it runs successfully, the output files will be generated under the `generated` folder.
8
+
To build the tool, simply clone the repo, and run `build.cmd`(Windows) or `build.sh` (OS X/Unix) in command line. If it runs successfully, the output files will be generated under the `generated` folder.
9
9
10
-
## Code Structure
11
-
-`Shared.fs`: handles the parsing from XML spec file, and stores the common data structures for later use;
12
-
-`TS.fs`: handles the emitting of the `lib.d.ts` file;
13
-
-`JS.fs`: handles the emitting of the `domWeb.js` and `domWindows.js`
10
+
Note: for OS X/ Unix users, [Mono 4.2](http://www.mono-project.com/download/alpha/) is required.
14
11
15
12
## Contribution Guide
16
13
The `dom.generated.d.ts` and `webworker.generated.d.ts` files in the TypeScript repo are used as baselines.
@@ -21,6 +18,17 @@ For common changes, it is sufficient to change the json files.
21
18
There are three json files that are used to alter the file generation: `addedTypes.json`, `overridingTypes.json` and `removedTypes.json`.
22
19
The format of each file can be inferred from their existing content.
23
20
21
+
The common steps to send a pull request are:
22
+
0. Open or refer to an issue in the [TypeScript repo](https://github.com/Microsoft/TypeScript).
23
+
1. Add missing elements to `inputfiles/addedTypes.json`, overriding elements to `inputfiles/overridingTypes.json`, or elements to remove to `inputfiles/removedTypes.json`.
24
+
2. Run the script locally to obtain new `dom.generated.d.ts` and `webworker.generated.d.ts`.
25
+
3. Update the files in the `baselines` folder using the newly generated files.
26
+
27
+
## Code Structure
28
+
-`Shared.fs`: handles the parsing from XML spec file, and stores the common data structures for later use;
29
+
-`TS.fs`: handles the emitting of the `lib.d.ts` file;
30
+
-`JS.fs`: handles the emitting of the `domWeb.js` and `domWindows.js`
31
+
24
32
## Input Files:
25
33
-`browser.webidl.xml`: the XML spec file generated by Microsoft Edge (due to the different updating schedules between Edge and TypeScript, this may **not** be the most up-to-date version of the spec.);
26
34
-`webworker.webidl.xml`: contains additional types for webworker.
0 commit comments