@@ -13,24 +13,18 @@ var diff = require('gulp-diff');
1313
1414var tsVersions = {
1515 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' ,
2017} ;
2118
2219function findTSDefinition ( location ) {
2320 return path . join ( path . dirname ( require . resolve ( location ) ) , 'typescript.d.ts' ) ;
2421}
2522
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 ( ) ;
3428
3529var paths = {
3630 scripts : [ 'lib/**.ts' ] ,
@@ -64,45 +58,28 @@ gulp.task('scripts', ['clean'], function() {
6458} ) ;
6559
6660// 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 ( ) {
8762 return gulp . src ( paths . scripts . concat ( [
8863 '!definitions/typescript.d.ts' ,
89- findTSDefinition ( tsVersions . release17 )
90- ] ) ) . pipe ( ts ( tsOptions ) ) ;
64+ findTSDefinition ( tsVersions . dev )
65+ ] ) ) . pipe ( createProject ( ) ( ) ) ;
9166} ) ;
92- gulp . task ( 'typecheck-dev' , function ( ) {
67+
68+ gulp . task ( 'typecheck-2.3' , function ( ) {
9369 return gulp . src ( paths . scripts . concat ( [
9470 '!definitions/typescript.d.ts' ,
95- findTSDefinition ( tsVersions . dev )
96- ] ) ) . pipe ( ts ( tsOptions ) ) ;
71+ findTSDefinition ( tsVersions . release23 )
72+ ] ) ) . pipe ( createProject ( ) ( ) ) ;
9773} ) ;
9874
99- gulp . task ( 'typecheck' , [ /* 'typecheck-1.4 ', 'typecheck-1.5', 'typecheck-1.6', */ 'typecheck-dev '] ) ;
75+ gulp . task ( 'typecheck' , [ 'typecheck-dev ' , 'typecheck-2.3 ' ] ) ;
10076
10177// Tests
10278
10379// We run every test on multiple typescript versions:
10480var libs = [
105- [ '2.0' , undefined ] ,
81+ [ '2.4' , undefined ] ,
82+ [ '2.3' , require ( tsVersions . release23 ) ] ,
10683 [ 'dev' , require ( tsVersions . dev ) ]
10784] ;
10885
0 commit comments