1
- module . exports = function ( grunt ) {
2
- grunt . initConfig ( {
3
- pkg : grunt . file . readJSON ( 'package.json' ) ,
4
- opt : {
5
- client : {
6
- "tsMain" : "lib" ,
7
- "tsTest" : "test" ,
8
-
9
- "jsMainOut" : "lib" ,
10
- "jsTestOut" : "test"
11
- }
12
- } ,
1
+ "use strict" ;
13
2
14
- exec : {
15
- tsc : "tsc -p ./" ,
16
- tsfmt : "tsfmt -r"
17
- } ,
18
- tsconfig : {
19
- main : {
20
- }
21
- } ,
22
- tslint : {
23
- options : {
24
- configuration : grunt . file . readJSON ( "tslint.json" )
25
- } ,
26
- files : {
27
- src : [
28
- '<%= opt.client.tsMain %>/**/*.ts' ,
29
- '<%= opt.client.tsTest %>/**/*.ts' ,
30
- '!<%= opt.client.tsMain %>/**/*.d.ts'
31
- ]
32
- }
33
- } ,
34
- typedoc : {
35
- main : {
36
- options : {
37
- module : "commonjs" ,
38
- out : './docs' ,
39
- name : '<%= pkg.name %>' ,
40
- target : "es5" ,
41
- experimentalDecorators : ""
42
- } ,
43
- src : [
44
- "./**/*.ts" ,
45
- "./**/*.tsx" ,
46
- "!./**/*.d.ts" ,
47
- "!./lib/cli.ts" ,
48
- "./typings/**/*.d.ts" ,
49
- "!./test/**/*.ts" ,
50
- "!./example/**/*.ts" ,
51
- "!./pages/**/*.ts" ,
52
- "!./node_modules/**/*" ,
53
- "./node_modules/typescript/lib/lib.es6.d.ts"
54
- ]
55
- }
56
- } ,
57
- clean : {
58
- clientScript : {
59
- src : [
60
- // client
61
- '<%= opt.client.jsMainOut %>/*.js' ,
62
- '<%= opt.client.jsMainOut %>/*.d.ts' ,
63
- '<%= opt.client.jsMainOut %>/*.js.map' ,
64
- // client test
65
- '<%= opt.client.jsTestOut %>/*.js' ,
66
- '<%= opt.client.jsTestOut %>/*.js.map' ,
67
- '<%= opt.client.jsTestOut %>/*.d.ts'
68
- ]
69
- }
70
- } ,
71
- mochaTest : {
72
- test : {
73
- options : {
74
- reporter : 'spec' ,
75
- timeout : 60000 ,
76
- require : [
77
- function ( ) {
78
- require ( 'espower-loader' ) ( {
79
- cwd : process . cwd ( ) + '/' + grunt . config . get ( "opt.client.jsTestOut" ) ,
80
- pattern : '**/*.js'
81
- } ) ;
82
- }
83
- ]
84
- } ,
85
- src : [
86
- '<%= opt.client.jsTestOut %>/**/*Spec.js'
87
- ]
88
- }
89
- } ,
3
+ module . exports = function ( grunt ) {
4
+ grunt . initConfig ( {
5
+ pkg : grunt . file . readJSON ( 'package.json' ) ,
90
6
conventionalChangelog : {
91
7
options : {
92
8
changelogOpts : {
@@ -110,15 +26,7 @@ module.exports = function (grunt) {
110
26
src : "CHANGELOG.md"
111
27
}
112
28
}
113
- } ) ;
114
-
115
- grunt . registerTask (
116
- 'default' ,
117
- [ 'clean:clientScript' , 'exec:tsfmt' , 'exec:tsc' , 'tslint' ] ) ;
118
-
119
- grunt . registerTask (
120
- 'test' ,
121
- [ 'default' , 'mochaTest' ] ) ;
29
+ } ) ;
122
30
123
- require ( 'load-grunt-tasks' ) ( grunt ) ;
31
+ require ( 'load-grunt-tasks' ) ( grunt ) ;
124
32
} ;
0 commit comments