File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env node
2
2
'use strict'
3
3
4
+ const childProcess = require ( 'child_process' )
4
5
const fs = require ( 'fs' )
5
6
const path = require ( 'path' )
6
7
const tslint = require ( 'tslint' )
@@ -35,6 +36,20 @@ if (inFile) {
35
36
apiPromise = fetchDocs ( )
36
37
}
37
38
39
+ const typeCheck = ( ) => {
40
+ const tscExec = path . resolve ( require . resolve ( 'typescript' ) , '../../bin/tsc' )
41
+ const tscChild = childProcess . spawn ( tscExec , [ '--project' , 'tsconfig.json' ] , {
42
+ cwd : path . resolve ( __dirname , 'test-smoke/electron' )
43
+ } )
44
+ tscChild . stdout . on ( 'data' , d => console . log ( d . toString ( ) ) )
45
+ tscChild . stderr . on ( 'data' , d => console . error ( d . toString ( ) ) )
46
+ tscChild . on ( 'exit' , ( tscStatus ) => {
47
+ if ( tscStatus !== 0 ) {
48
+ process . exit ( tscStatus )
49
+ }
50
+ } )
51
+ }
52
+
38
53
apiPromise . then ( API => {
39
54
return JSON . parse ( JSON . stringify ( API ) )
40
55
} ) . then ( API => {
@@ -48,7 +63,9 @@ apiPromise.then(API => {
48
63
49
64
if ( result . failureCount === 0 ) {
50
65
fs . writeFileSync ( outFile , output )
51
- process . exit ( 0 )
66
+ fs . writeFileSync ( path . resolve ( __dirname , 'test-smoke/electron/index.d.ts' ) , output )
67
+
68
+ typeCheck ( )
52
69
} else {
53
70
console . error ( 'Failed to lint electron.d.ts' )
54
71
console . error ( result )
You can’t perform that action at this time.
0 commit comments