@@ -245,9 +245,8 @@ function injectTsConfig(filesGlob, tsconfigPath){
245245gulp.task('inject:tsconfig', () => {
246246 return injectTsConfig ( [
247247 `${ clientPath } /**/!(*.spec|*.mock).ts` ,
248- `!${ clientPath } /bower_components/**/*` ,
249- `${ clientPath } /typings/**/*.d.ts` ,
250- `!${ clientPath } /test_typings/**/*.d.ts`
248+ `!${ clientPath } /bower_components/**/*` ,
249+ `typings/main.d.ts`
251250 ] ,
252251 './tsconfig.client.json' ) ;
253252} );
@@ -256,8 +255,7 @@ gulp.task('inject:tsconfigTest', () => {
256255 return injectTsConfig ( [
257256 `${ clientPath } /**/+(*.spec|*.mock).ts` ,
258257 `!${ clientPath } /bower_components/**/*` ,
259- `!${ clientPath } /typings/**/*.d.ts` ,
260- `${ clientPath } /test_typings/**/*.d.ts`
258+ `typings/main.d.ts`
261259 ] ,
262260 './tsconfig.client.test.json' ) ;
263261} );< % } % >
@@ -298,25 +296,17 @@ gulp.task('inject:<%= styleExt %>', () => {
298296} ) ; < % } % > < % if ( filters . ts ) { % >
299297
300298// Install DefinitelyTyped TypeScript definition files
301- gulp . task ( 'tsd' , cb => {
302- plugins . tsd ( {
303- command : 'reinstall' ,
304- config : './tsd.json'
305- } , cb ) ;
306- } ) ;
307-
308- gulp . task ( 'tsd:test' , cb => {
309- plugins . tsd ( {
310- command : 'reinstall' ,
311- config : './tsd_test.json'
312- } , cb ) ;
299+ gulp . task ( 'typings' , ( ) => {
300+ return gulp . src ( "./typings.json" )
301+ . pipe ( plugins . typings ( ) ) ;
313302} ) ; < % } % >
314303
315304gulp . task ( 'styles' , ( ) => {
316305 < % _ if ( ! filters . css ) { _ % >
317306 return gulp . src ( paths . client . mainStyle )
318307 < % _ } else { _ % >
319- return gulp . src ( paths . client . styles ) < % } % >
308+ return gulp . src ( paths . client . styles )
309+ < % _ } _ % >
320310 . pipe ( styles ( ) )
321311 . pipe ( gulp . dest ( '.tmp/app' ) ) ;
322312} ) ; < % if ( filters . ts ) { % >
@@ -326,20 +316,18 @@ gulp.task('copy:constant', ['constant'], () => {
326316 . pipe ( gulp . dest ( '.tmp/app' ) ) ;
327317} )
328318
329- gulp . task ( 'transpile:client' , [ 'tsd' , 'copy:constant' ] , ( ) => {
330- let tsProject = plugins . typescript . createProject ( './tsconfig.client.json' ) ;
331- return tsProject . src ( )
319+ gulp . task ( 'transpile:client' , [ 'typings' , 'copy:constant' ] , ( ) => {
320+ return gulp . src ( [ 'client/{app,components}/**/!(*.spec|*.mock).ts' , 'typings/main.d.ts' ] )
332321 . pipe ( plugins . sourcemaps . init ( ) )
333- . pipe ( plugins . typescript ( tsProject ) ) . js
322+ . pipe ( plugins . typescript ( ) ) . js
334323 . pipe ( plugins . sourcemaps . write ( '.' ) )
335324 . pipe ( gulp . dest ( '.tmp' ) ) ;
336325} ) ;
337326
338- gulp . task ( 'transpile:client:test' , [ 'tsd:test' ] , ( ) => {
339- let tsTestProject = plugins . typescript . createProject ( './tsconfig.client.test.json' ) ;
340- return tsTestProject . src ( )
327+ gulp . task ( 'transpile:client:test' , [ 'typings' ] , ( ) => {
328+ return gulp . src ( [ 'client/{app,components}/**/+(*.spec|*.mock).ts' , 'typings/main.d.ts' ] )
341329 . pipe ( plugins . sourcemaps . init ( ) )
342- . pipe ( plugins . typescript ( tsTestProject ) ) . js
330+ . pipe ( plugins . typescript ( ) ) . js
343331 . pipe ( plugins . sourcemaps . write ( '.' ) )
344332 . pipe ( gulp . dest ( '.tmp/test' ) ) ;
345333} ) ; < % } % > < % if ( filters . babel ) { % >
@@ -448,7 +436,7 @@ gulp.task('watch', () => {
448436 . pipe ( gulp . dest ( '.tmp' ) )
449437 . pipe ( plugins . livereload ( ) ) ; < % } % > < % if ( filters . ts ) { % >
450438
451- gulp . watch ( paths . client . scripts , [ 'inject:tsconfig' , ' lint:scripts:client', 'transpile:client' ] ) ; < % } % >
439+ gulp . watch ( paths . client . scripts , [ 'lint:scripts:client' , 'transpile:client' ] ) ; < % } % >
452440
453441 plugins . watch ( _ . union ( paths . server . scripts , testFiles ) )
454442 . pipe ( plugins . plumber ( ) )
@@ -459,7 +447,7 @@ gulp.task('watch', () => {
459447} ) ;
460448
461449gulp . task ( 'serve' , cb => {
462- runSequence ( [ 'clean:tmp' , 'constant' , 'env:all' < % if ( filters . ts ) { % > , 'tsd ' < % } % > ] ,
450+ runSequence ( [ 'clean:tmp' , 'constant' , 'env:all' < % if ( filters . ts ) { % > , 'typings ' < % } % > ] ,
463451 [ 'lint:scripts' , 'inject' < % if ( filters . jade ) { % > , 'jade' < % } % > ] ,
464452 [ 'wiredep:client' ] ,
465453 [ 'transpile:client' , 'styles' ] ,
@@ -478,7 +466,7 @@ gulp.task('serve:dist', cb => {
478466} ) ;
479467
480468gulp . task ( 'serve:debug' , cb => {
481- runSequence ( [ 'clean:tmp' , 'constant' < % if ( filters . ts ) { % > , 'tsd ' < % } % > ] ,
469+ runSequence ( [ 'clean:tmp' , 'constant' < % if ( filters . ts ) { % > , 'typings ' < % } % > ] ,
482470 [ 'lint:scripts' , 'inject' < % if ( filters . jade ) { % > , 'jade' < % } % > ] ,
483471 [ 'wiredep:client' ] ,
484472 [ 'transpile:client' , 'styles' ] ,
@@ -568,7 +556,7 @@ gulp.task('build', cb => {
568556 'jade' , < % } % >
569557 'inject',
570558 'wiredep:client',< % if ( filters . ts ) { % >
571- 'tsd ',< % } % >
559+ 'typings ',< % } % >
572560 [
573561 'build:images',
574562 'copy:extras',
0 commit comments