@@ -13,24 +13,18 @@ var diff = require('gulp-diff');
13
13
14
14
var tsVersions = {
15
15
dev : './typescript/dev' ,
16
- release14 : './typescript/1-4' ,
17
- release15 : './typescript/1-5' ,
18
- release16 : './typescript/1-6' ,
19
- release17 : './typescript/1-7'
16
+ release23 : './typescript/2.3' ,
20
17
} ;
21
18
22
19
function findTSDefinition ( location ) {
23
20
return path . join ( path . dirname ( require . resolve ( location ) ) , 'typescript.d.ts' ) ;
24
21
}
25
22
26
- var tsOptions = {
27
- target : 'es5' ,
28
- module : 'commonjs' ,
29
- declaration : true ,
30
- preserveConstEnums : true ,
31
- typescript : require ( './typescript/dev' )
32
- } ;
33
- var tsProject = ts . createProject ( tsOptions ) ;
23
+ function createProject ( ) {
24
+ return ts . createProject ( 'lib/tsconfig.json' , { } ) ;
25
+ }
26
+
27
+ var tsProject = createProject ( ) ;
34
28
35
29
var paths = {
36
30
scripts : [ 'lib/**.ts' ] ,
@@ -64,45 +58,28 @@ gulp.task('scripts', ['clean'], function() {
64
58
} ) ;
65
59
66
60
// Type checking against multiple versions of TypeScript
67
- // Checking against the current release of TypeScript on NPM can be done using `gulp scripts`.
68
- gulp . task ( 'typecheck-1.4' , function ( ) {
69
- return gulp . src ( paths . scripts . concat ( [
70
- '!definitions/typescript.d.ts' ,
71
- findTSDefinition ( tsVersions . release14 )
72
- ] ) ) . pipe ( ts ( tsOptions ) ) ;
73
- } ) ;
74
- gulp . task ( 'typecheck-1.5' , function ( ) {
75
- return gulp . src ( paths . scripts . concat ( [
76
- '!definitions/typescript.d.ts' ,
77
- findTSDefinition ( tsVersions . release15 )
78
- ] ) ) . pipe ( ts ( tsOptions ) ) ;
79
- } ) ;
80
- gulp . task ( 'typecheck-1.6' , function ( ) {
81
- return gulp . src ( paths . scripts . concat ( [
82
- '!definitions/typescript.d.ts' ,
83
- findTSDefinition ( tsVersions . release16 )
84
- ] ) ) . pipe ( ts ( tsOptions ) ) ;
85
- } ) ;
86
- gulp . task ( 'typecheck-1.7' , function ( ) {
61
+ gulp . task ( 'typecheck-dev' , function ( ) {
87
62
return gulp . src ( paths . scripts . concat ( [
88
63
'!definitions/typescript.d.ts' ,
89
- findTSDefinition ( tsVersions . release17 )
90
- ] ) ) . pipe ( ts ( tsOptions ) ) ;
64
+ findTSDefinition ( tsVersions . dev )
65
+ ] ) ) . pipe ( createProject ( ) ( ) ) ;
91
66
} ) ;
92
- gulp . task ( 'typecheck-dev' , function ( ) {
67
+
68
+ gulp . task ( 'typecheck-2.3' , function ( ) {
93
69
return gulp . src ( paths . scripts . concat ( [
94
70
'!definitions/typescript.d.ts' ,
95
- findTSDefinition ( tsVersions . dev )
96
- ] ) ) . pipe ( ts ( tsOptions ) ) ;
71
+ findTSDefinition ( tsVersions . release23 )
72
+ ] ) ) . pipe ( createProject ( ) ( ) ) ;
97
73
} ) ;
98
74
99
- gulp . task ( 'typecheck' , [ /* 'typecheck-1.4 ', 'typecheck-1.5', 'typecheck-1.6', */ 'typecheck-dev '] ) ;
75
+ gulp . task ( 'typecheck' , [ 'typecheck-dev ' , 'typecheck-2.3 ' ] ) ;
100
76
101
77
// Tests
102
78
103
79
// We run every test on multiple typescript versions:
104
80
var libs = [
105
- [ '2.0' , undefined ] ,
81
+ [ '2.4' , undefined ] ,
82
+ [ '2.3' , require ( tsVersions . release23 ) ] ,
106
83
[ 'dev' , require ( tsVersions . dev ) ]
107
84
] ;
108
85
0 commit comments