11const { spawn, execSync } = require ( 'child_process' ) ;
2- const fs = require ( 'fs' ) ;
32
43let release = process . argv . includes ( '--release' ) ;
54build ( ) . catch ( ( err ) => {
@@ -31,8 +30,6 @@ async function build() {
3130 yarn . on ( 'error' , reject ) ;
3231 yarn . on ( 'close' , resolve ) ;
3332 } ) ;
34-
35- buildFlowTypes ( ) ;
3633}
3734
3835// This forces Clang/LLVM to be used as a C compiler instead of GCC.
@@ -47,16 +44,3 @@ function setupMacBuild() {
4744 process . env . CFLAGS = `-isysroot ${ sysRoot } -isystem ${ sysRoot } ` ;
4845 process . env . MACOSX_DEPLOYMENT_TARGET = '10.9' ;
4946}
50-
51- function buildFlowTypes ( ) {
52- let index = fs . readFileSync ( __dirname + '/node/index.d.ts' , 'utf8' ) ;
53- index = '// @flow\n' + index ;
54- index = index . replace ( / e x p o r t i n t e r f a c e ( .* ?) \{ ( (?: .| \n ) * ?) \} / g, 'export type $1 = {|$2|};' ) ;
55- index = index . replace ( / e x p o r t d e c l a r e f u n c t i o n / g, 'declare export function' ) ;
56-
57- let targets = fs . readFileSync ( __dirname + '/node/targets.d.ts' , 'utf8' ) ;
58- targets = targets . replace ( / e x p o r t i n t e r f a c e ( .* ?) \{ ( (?: .| \n ) * ?) \} / g, 'export type $1 = {|$2|};' ) ;
59- index = index . replace ( "import type {Targets} from './targets';" , targets ) ;
60-
61- fs . writeFileSync ( __dirname + '/node/index.js.flow' , index ) ;
62- }
0 commit comments