File tree 6 files changed +201
-0
lines changed
6 files changed +201
-0
lines changed Original file line number Diff line number Diff line change
1
+ # http://editorconfig.org
2
+ root = true
3
+
4
+ [* ]
5
+ indent_style = space
6
+ indent_size = 2
7
+ end_of_line = lf
8
+ charset = utf-8
9
+ trim_trailing_whitespace = true
10
+ insert_final_newline = true
11
+
12
+ [* .md ]
13
+ trim_trailing_whitespace = false
Original file line number Diff line number Diff line change
1
+ # ################
2
+ # # Misc
3
+ # ################
4
+ ** /.DS_Store
5
+ nbproject
6
+ manifest.mf
7
+ build.xml
8
+ node_modules
9
+ npm-debug.log
10
+ * .js
11
+ * .map
12
+ * .d.ts
13
+ ! manual_typings /globals.d.ts
14
+ ! ts-helpers.d.ts
15
+ ! playground /ng-metadata.legacy.d.ts
16
+ typings
17
+ test /__uglifyTest.js
18
+
19
+ # ################
20
+ # # JetBrains
21
+ # ################
22
+ .idea
23
+ .project
24
+ .settings
25
+ .idea /*
26
+ * .iml
27
+
28
+ # ###########
29
+ # # Windows
30
+ # ###########
31
+
32
+ # Windows image file caches
33
+ Thumbs.db
34
+
35
+ # Folder config file
36
+ Desktop.ini
37
+
38
+ # ###########
39
+ # # Mac
40
+ # ###########
41
+
42
+ # Mac crap
43
+ .DS_Store
Original file line number Diff line number Diff line change
1
+ # ################
2
+ # # Misc
3
+ # ################
4
+ ** /.DS_Store
5
+ nbproject
6
+ manifest.mf
7
+ build.xml
8
+ node_modules /*
9
+ npm-debug.log
10
+
11
+ # ignore all typescript
12
+ * .ts
13
+ # allow only ambient type definitions
14
+ ! * .d.ts
15
+ .travis.yml
16
+ .editorconfig
17
+ .npmignore
18
+ .npmrc
19
+
20
+ # ignore folders
21
+ test
22
+ scripts
23
+ assets
24
+ playground
25
+
26
+ # ################
27
+ # # VSCode
28
+ # ################
29
+ .vscode
30
+
31
+ # ################
32
+ # # JetBrains
33
+ # ################
34
+ .idea
35
+ .project
36
+ .settings
37
+ .idea /*
38
+ * .iml
39
+
40
+ # ###########
41
+ # # Windows
42
+ # ###########
43
+
44
+ # Windows image file caches
45
+ Thumbs.db
46
+
47
+ # Folder config file
48
+ Desktop.ini
49
+
50
+ # ###########
51
+ # # Mac
52
+ # ###########
53
+
54
+ # Mac crap
55
+ .DS_Store
Original file line number Diff line number Diff line change
1
+ # TS-helpers
2
+
3
+ Typescript helpers for compiling typescript while specifying ` --noEmitHelpers ` within your ` tsconfig.json ` .
4
+ > Cross platform ( Node/Browser/WebWorker )
5
+
6
+ ## Why?
7
+
8
+ If you are using one of following ES2015/ES.next features with Typescript:
9
+ - inheritance via ` class Foo extends Moo{} `
10
+ - ` async/await `
11
+ - decorators via ` experimentalDecorators `
12
+ - metadata reflection via ` emitDecoratorMetadata `
13
+
14
+ Typescript will generate helper code in every one file.
15
+ This can be a problem when dealing with code coverage or payload size of you library/app
16
+
17
+ To mitigate this problem Typescript starting from version ** 1.8** allow us to specify ` noEmitHelpers: true ` which wont generate these helpers.
18
+
19
+ And that's where this little utility comes into play, it defines those helpers just once for whole app.
20
+
21
+ ## Installation
22
+
23
+ ` npm install --save-dev ts-helpers `
24
+
25
+ then load it from your app root file:
26
+
27
+ ``` typescript
28
+ // main.ts
29
+ import ' ts-helpers' ;
30
+ ```
31
+
32
+ and set tsconfig ` noEmitHelpers ` like following example:
33
+ ``` json
34
+ {
35
+ "compilerOptions" : {
36
+ "module" : " commonjs" ,
37
+ "target" : " es5" ,
38
+ "noImplicitAny" : false ,
39
+ "sourceMap" : true ,
40
+ "experimentalDecorators" : true ,
41
+ "emitDecoratorMetadata" : true ,
42
+ "moduleResolution" : " node" ,
43
+ "pretty" : true ,
44
+ "noEmitHelpers" : true ,
45
+ },
46
+ "exclude" : [
47
+ " node_modules"
48
+ ]
49
+ }
50
+ ```
51
+
52
+
53
+ That's it! enjoy ;)
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " ts-helpers" ,
3
+ "version" : " 1.0.0" ,
4
+ "description" : " Typescript helpers for compiling typescript while specifying `--noEmitHelpers` within your `tsconfig.json`. Cross platform ( Node/Browser/WebWorker )" ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "test" : " echo \" Error: no test specified\" && exit 1"
8
+ },
9
+ "bugs" : {
10
+ "url" : " https://github.com/ngParty/ts-helpers/issues"
11
+ },
12
+ "homepage" : " https://github.com/ngParty/ts-helpers#readme" ,
13
+ "repository" : {
14
+ "type" : " git" ,
15
+ "url" : " git+https://github.com/ngParty/ts-helpers.git"
16
+ },
17
+ "keywords" : [
18
+ " typescript" ,
19
+ " emit-helpers" ,
20
+ " payload"
21
+ ],
22
+ "author" :
" Martin Hochel <[email protected] >" ,
23
+ "license" : " MIT" ,
24
+ "devDependencies" : {
25
+ "typescript" : " 1.8.10"
26
+ }
27
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "compilerOptions" : {
3
+ "target" : " es5" ,
4
+ "noImplicitAny" : false ,
5
+ "sourceMap" : false
6
+ },
7
+ "exclude" : [
8
+ " node_modules"
9
+ ]
10
+ }
You can’t perform that action at this time.
0 commit comments