Skip to content

Commit 7e7ca0e

Browse files
committed
Merge pull request #16 from Microsoft/updateReadMe
Update README.md
2 parents 4228537 + 9d9dc7c commit 7e7ca0e

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

README.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,9 @@
55
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.
66

77
## 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.
99

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.
1411

1512
## Contribution Guide
1613
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.
2118
There are three json files that are used to alter the file generation: `addedTypes.json`, `overridingTypes.json` and `removedTypes.json`.
2219
The format of each file can be inferred from their existing content.
2320

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+
2432
## Input Files:
2533
- `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.);
2634
- `webworker.webidl.xml`: contains additional types for webworker.

0 commit comments

Comments
 (0)