From 1df86e04cb401703b7cf3e1c2c62fb8c1c241f5b Mon Sep 17 00:00:00 2001 From: Mihal Malostanidis Date: Sun, 3 Dec 2017 17:07:23 +0200 Subject: [PATCH 1/2] Update README.md --- README.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index eecbeb7d6..5b75a0c64 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ AppVeyor Status: [![Build status](https://ci.appveyor.com/api/projects/status/8oj3j7u6nvag1xvu/branch/master?svg=true)](https://ci.appveyor.com/project/zhengbli/tsjs-lib-generator/branch/master) Travis CI Status: [![Build Status](https://travis-ci.org/Microsoft/TSJS-lib-generator.svg?branch=master)](https://travis-ci.org/Microsoft/TSJS-lib-generator) -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. +This tool is used to generate `dom.generated.d.ts`, `webworker.generated.d.ts` an`dom.es6.generated.d.ts` for TypeScript. The input file is the XML spec file generated by the Microsoft Edge browser. ## Build Instructions @@ -15,7 +15,7 @@ Note: for OS X and Unix users, [Mono 4.2 or higher](http://www.mono-project.com/ ## Contribution Guidelines -The `dom.generated.d.ts` and `webworker.generated.d.ts` files in the TypeScript repo are used as baselines. +The `dom.generated.d.ts`, `webworker.generated.d.ts` an`dom.es6.generated.d.ts` files from the TypeScript repo are used as baselines. For each pull request, we will run the script and compare the generated files with the baseline files. In order to make the tests pass, please update the baseline as well in any pull requests. @@ -50,9 +50,8 @@ A "Living Standard" ([example](https://xhr.spec.whatwg.org/)) should be added he ## Code Structure -- `Shared.fs`: handles the parsing from XML spec file, and stores the common data structures for later use. -- `TS.fs`: handles the emitting of the `lib.d.ts` file. -- `JS.fs`: handles the emitting of the `domWeb.js` and `domWindows.js`. +- `Build.fsx`: Runs `TS.fsx` for all targets, then does a snapshot test by comparing the `generated/` and `baseline/` contents. +- `TS.fsx`: handles the emitting of the `.d.ts` files. ## Input Files @@ -63,5 +62,4 @@ A "Living Standard" ([example](https://xhr.spec.whatwg.org/)) should be added he - `overridingTypes.json`: types that are defined in the spec file but has a better or more up-to-date definitions in the json files. - `removedTypes.json`: types that are defined in the spec file but should be removed. - `comments.json`: comment strings to be embedded in the generated .js files. -- `jsTemplate.js`: the initial templates for `domWeb.js` and `domWindows.js`, which contains the necessary helper functions. - `sample.json`: sample json file used to tell F# json type provider that structure of the json files. The content of it is not used anywhere. From d164509983e2fa9ce044685a34ceefa0bd8d6659 Mon Sep 17 00:00:00 2001 From: Mihal Malostanidis Date: Tue, 12 Dec 2017 02:36:36 +0200 Subject: [PATCH 2/2] Update README.md --- README.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5b75a0c64..288cb43c1 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ AppVeyor Status: [![Build status](https://ci.appveyor.com/api/projects/status/8oj3j7u6nvag1xvu/branch/master?svg=true)](https://ci.appveyor.com/project/zhengbli/tsjs-lib-generator/branch/master) Travis CI Status: [![Build Status](https://travis-ci.org/Microsoft/TSJS-lib-generator.svg?branch=master)](https://travis-ci.org/Microsoft/TSJS-lib-generator) -This tool is used to generate `dom.generated.d.ts`, `webworker.generated.d.ts` an`dom.es6.generated.d.ts` for TypeScript. +This tool is used to generate `dom.generated.d.ts`, `webworker.generated.d.ts` and `dom.es6.generated.d.ts` for TypeScript. The input file is the XML spec file generated by the Microsoft Edge browser. ## Build Instructions @@ -15,12 +15,15 @@ Note: for OS X and Unix users, [Mono 4.2 or higher](http://www.mono-project.com/ ## Contribution Guidelines -The `dom.generated.d.ts`, `webworker.generated.d.ts` an`dom.es6.generated.d.ts` files from the TypeScript repo are used as baselines. +The `dom.generated.d.ts`, `webworker.generated.d.ts` and `dom.es6.generated.d.ts` files from the TypeScript repo are used as baselines. For each pull request, we will run the script and compare the generated files with the baseline files. In order to make the tests pass, please update the baseline as well in any pull requests. For common changes, it is sufficient to change the json files. -There are three json files that are used to alter the file generation: `addedTypes.json`, `overridingTypes.json`, and `removedTypes.json`. +There are three json files that are typically used to alter the type generation: `addedTypes.json`, `overridingTypes.json`, and `removedTypes.json`. +`comments.json` can used to add comments to the types. +Finally, `knownWorkerEnums` and `knownWorkerInterfaces` determine which types are available in a WebWorker environment. + The format of each file can be inferred from their existing content. The common steps to send a pull request are: @@ -62,4 +65,4 @@ A "Living Standard" ([example](https://xhr.spec.whatwg.org/)) should be added he - `overridingTypes.json`: types that are defined in the spec file but has a better or more up-to-date definitions in the json files. - `removedTypes.json`: types that are defined in the spec file but should be removed. - `comments.json`: comment strings to be embedded in the generated .js files. -- `sample.json`: sample json file used to tell F# json type provider that structure of the json files. The content of it is not used anywhere. +- `sample.json`: sample json file used to tell F# json type provider that structure of the json files. The content of it is not used anywhere. **Do not edit this file**.