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
+51-3Lines changed: 51 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,66 @@ Enable typescript preprocessing on Ember 2.x apps.
5
5
6
6
## Installation
7
7
8
-
In addition to ember-cli-typescript, [typescript](https://github.com/Microsoft/TypeScript) and [@type/ember](https://www.npmjs.com/package/@types/ember) are required. You can install all of these at once with:
8
+
In addition to ember-cli-typescript, the following files are required:
9
+
10
+
-[typescript](https://github.com/Microsoft/TypeScript) version 2.0.0 or better
ember install "ember-cli-typescript@emberwatch/ember-cli-typescript"
12
18
```
13
19
14
-
All 3 dependencies will be added to your package.json, and you're ready to roll!
20
+
All dependencies will be added to your package.json, and you're ready to roll!
21
+
22
+
## Configuration file
23
+
24
+
25
+
### Problem ###
26
+
27
+
The configuration file is used by both Ember
28
+
CLI/[broccoli](http://broccolijs.com/) and [VS
29
+
Code](http://code.visualstudio.com/)/`tsc` command line compiler.
30
+
31
+
Broccoli controls the inputs and the output folder of the various build steps
32
+
that make the Ember build pipeline. Its expectation are impacted by Typescript
33
+
configuration properties like "include", "exclude", "outFile", "outDir".
34
+
35
+
We want to allow you to change unrelated properties in the tsconfig file.
36
+
37
+
### Solution ###
38
+
39
+
This addon takes the following approach to allow this dual use:
40
+
41
+
- is starts with the following [blueprint](https://github.com/emberwatch/ember-cli-typescript/blob/master/blueprints/ember-cli-typescript/files/tsconfig.json)
42
+
43
+
- the generated tsconfig file does not set "outDir" and sets "noEmit" to true.
44
+
This allows you to run vscode and tsc without creating `.js` files throughout
45
+
your codebase.
46
+
47
+
- before calling broccoli the addon removes "outDir" and sets "noEmit" and "includes"
48
+
49
+
50
+
Please let us know if this does not satisfy your use cases by opening issues on this repo.
51
+
52
+
### Customization ###
53
+
54
+
You can customize this file further for your use case. For example to see the
55
+
output of the compilation in a separate folder you are welcome to set and
56
+
outDir and set noEmit to false. Then VS Code and tsc will generate files here
57
+
while the broccoli pipeline will use its own temp folder.
15
58
16
59
17
60
## Incremental adoption
18
61
19
-
Rename the files you want to check from `.js` to `.ts`.
62
+
If you porting an existing app to typescript you can install this addon and
63
+
migrate your files incrementally by changing their extensions from `.js` to
64
+
`.ts`. A good approach is to start at your leaf files and then work your way
65
+
up. As typescript starts to find errors make sure to celebrate your (small)
66
+
wins with your team, specially if some people are not convinced yet. We would also
0 commit comments