|
1 | 1 | # Tsickle - TypeScript to Closure Annotator [](https://travis-ci.org/angular/tsickle)
|
2 | 2 |
|
3 |
| -Tsickle processes TypeScript and adds [Closure Compiler](https://github.com/google/closure-compiler/) |
4 |
| --compatible JSDoc annotations. This allows using TypeScript to transpile your sources, and then |
5 |
| -Closure Compiler to bundle and optimize them, while taking advantage of type information in Closure |
6 |
| -Compiler. |
| 3 | +Tsickle processes TypeScript and adds [Closure Compiler]-compatible JSDoc |
| 4 | +annotations. This allows using TypeScript to transpile your sources, and then |
| 5 | +Closure Compiler to bundle and optimize them, while taking advantage of type |
| 6 | +information in Closure Compiler. |
| 7 | + |
| 8 | +[Closure Compiler]: https://github.com/google/closure-compiler/ |
7 | 9 |
|
8 | 10 | ## Installation
|
9 | 11 |
|
10 |
| -- execute `npm i` to install the dependencies, |
| 12 | +- Execute `npm i` to install the dependencies. |
| 13 | + |
| 14 | +## Usage |
| 15 | + |
| 16 | +### Project Setup |
| 17 | + |
| 18 | +Tsickle works by wrapping `tsc`. To use it, you must set up your project such |
| 19 | +that it builds correctly when you run `tsc` from the command line, by |
| 20 | +configuring the settings in `tsconfig.json`. |
| 21 | + |
| 22 | +If you have complicated tsc command lines and flags in a build file (like a |
| 23 | +gulpfile etc.) Tsickle won't know about it. Another reason it's nice to put |
| 24 | +everything in `tsconfig.json` is so your editor inherits all these settings as |
| 25 | +well. |
11 | 26 |
|
12 |
| -## Gulp tasks |
| 27 | +### Invocation |
13 | 28 |
|
14 |
| -- `gulp watch` executes the unit tests in watch mode (use `gulp test.unit` for a single run), |
| 29 | +Run `tsickle --help` for the full syntax, but basically you specify the minified |
| 30 | +output bundle path and the input TypeScript project. |
| 31 | + |
| 32 | +## Development |
| 33 | + |
| 34 | +### Gulp tasks |
| 35 | + |
| 36 | +- `gulp watch` executes the unit tests in watch mode (use `gulp test.unit` for a |
| 37 | + single run), |
15 | 38 | - `gulp test.e2e` executes the e2e tests,
|
16 |
| -- `gulp test.check-format` checks the source code formatting using `clang-format`, |
| 39 | +- `gulp test.check-format` checks the source code formatting using |
| 40 | + `clang-format`, |
17 | 41 | - `gulp test` runs unit tests, e2e tests and checks the source code formatting.
|
| 42 | + |
| 43 | +Export the environment variable `UPDATE_GOLDENS=1` to have the test suite |
| 44 | +rewrite the golden files when you run it. |
0 commit comments