File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ import { addon } from './lib/utilities/ember-cli-entities';
77import fork from './lib/utilities/fork' ;
88import TypecheckWorker from './lib/typechecking/worker' ;
99import TypecheckMiddleware from './lib/typechecking/middleware' ;
10+ import { Application } from 'express' ;
1011
1112export default addon ( {
1213 name : 'ember-cli-typescript' ,
@@ -37,9 +38,11 @@ export default addon({
3738 } ,
3839
3940 serverMiddleware ( { app } ) {
40- let workerPromise = this . _getTypecheckWorker ( ) ;
41- let middleware = new TypecheckMiddleware ( this . project , workerPromise ) ;
42- middleware . register ( app ) ;
41+ this . _addTypecheckMiddleware ( app ) ;
42+ } ,
43+
44+ testemMiddleware ( app ) {
45+ this . _addTypecheckMiddleware ( app ) ;
4346 } ,
4447
4548 async postBuild ( ) {
@@ -145,6 +148,12 @@ export default addon({
145148 }
146149 } ,
147150
151+ _addTypecheckMiddleware ( app : Application ) {
152+ let workerPromise = this . _getTypecheckWorker ( ) ;
153+ let middleware = new TypecheckMiddleware ( this . project , workerPromise ) ;
154+ middleware . register ( app ) ;
155+ } ,
156+
148157 _typecheckWorker : undefined as Promise < Remote < TypecheckWorker > > | undefined ,
149158
150159 _getTypecheckWorker ( ) {
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ declare module 'ember-cli/lib/models/addon' {
3636 shouldIncludeChildAddon ( addon : Addon ) : boolean ;
3737 isDevelopingAddon ( ) : boolean ;
3838 serverMiddleware ( options : { app : Application } ) : void | Promise < void > ;
39+ testemMiddleware ( app : Application ) : void ;
3940 setupPreprocessorRegistry ( type : 'self' | 'parent' , registry : unknown ) : void ;
4041 }
4142}
You can’t perform that action at this time.
0 commit comments