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';
7
7
import fork from './lib/utilities/fork' ;
8
8
import TypecheckWorker from './lib/typechecking/worker' ;
9
9
import TypecheckMiddleware from './lib/typechecking/middleware' ;
10
+ import { Application } from 'express' ;
10
11
11
12
export default addon ( {
12
13
name : 'ember-cli-typescript' ,
@@ -37,9 +38,11 @@ export default addon({
37
38
} ,
38
39
39
40
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 ) ;
43
46
} ,
44
47
45
48
async postBuild ( ) {
@@ -145,6 +148,12 @@ export default addon({
145
148
}
146
149
} ,
147
150
151
+ _addTypecheckMiddleware ( app : Application ) {
152
+ let workerPromise = this . _getTypecheckWorker ( ) ;
153
+ let middleware = new TypecheckMiddleware ( this . project , workerPromise ) ;
154
+ middleware . register ( app ) ;
155
+ } ,
156
+
148
157
_typecheckWorker : undefined as Promise < Remote < TypecheckWorker > > | undefined ,
149
158
150
159
_getTypecheckWorker ( ) {
Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ declare module 'ember-cli/lib/models/addon' {
36
36
shouldIncludeChildAddon ( addon : Addon ) : boolean ;
37
37
isDevelopingAddon ( ) : boolean ;
38
38
serverMiddleware ( options : { app : Application } ) : void | Promise < void > ;
39
+ testemMiddleware ( app : Application ) : void ;
39
40
setupPreprocessorRegistry ( type : 'self' | 'parent' , registry : unknown ) : void ;
40
41
}
41
42
}
You can’t perform that action at this time.
0 commit comments