22const util = require ( 'util' ) ;
33const https = require ( 'https' ) ;
44const exec = util . promisify ( require ( 'child_process' ) . exec ) ;
5- const { promises : fs } = require ( 'fs' ) ;
6- const { join, sep } = require ( 'path' ) ;
5+ const { promises : fs , mkdirSync } = require ( 'fs' ) ;
6+ const { join, sep, dirname } = require ( 'path' ) ;
77const { platform } = require ( 'os' ) ;
88const appPath = join ( __dirname , '..' ) ;
99
@@ -41,7 +41,7 @@ const protoSources = async () => {
4141 lnd : `lightningnetwork/lnd/${ lndVersion [ 1 ] } /lnrpc/rpc.proto` ,
4242 loop : `lightninglabs/loop/${ loopVersion [ 1 ] } /looprpc/client.proto` ,
4343 trader : `lightninglabs/pool/${ poolVersion [ 1 ] } /poolrpc/trader.proto` ,
44- auctioneer : `lightninglabs/pool/${ poolVersion [ 1 ] } /poolrpc /auctioneer.proto` ,
44+ 'auctioneerrpc/ auctioneer' : `lightninglabs/pool/${ poolVersion [ 1 ] } /auctioneerrpc /auctioneer.proto` ,
4545 } ;
4646} ;
4747
@@ -50,7 +50,7 @@ const filePatches = {
5050 lnd : 'lnrpc: {}' ,
5151 loop : 'looprpc: {}' ,
5252 trader : 'poolrpc: {}' ,
53- auctioneer : 'poolrpc: {}' ,
53+ 'auctioneerrpc/ auctioneer' : 'poolrpc: {}' ,
5454 'google/api/annotations' : 'google: { api: {} }' ,
5555 'google/api/http' : 'google: { api: {} }' ,
5656} ;
@@ -63,6 +63,7 @@ const download = async () => {
6363 for ( [ name , urlPath ] of Object . entries ( await protoSources ( ) ) ) {
6464 const url = `https://raw.githubusercontent.com/${ urlPath } ` ;
6565 const filePath = join ( appPath , '..' , 'proto' , `${ name } .proto` ) ;
66+ mkdirSync ( dirname ( filePath ) , { recursive : true } ) ;
6667 console . log ( `${ url } ` ) ;
6768 console . log ( ` -> ${ filePath } ` ) ;
6869 const content = await new Promise ( ( resolve , reject ) => {
@@ -92,6 +93,7 @@ const generate = async () => {
9293 ) ;
9394 const protocCmd = [
9495 'protoc' ,
96+ `-I../proto` ,
9597 `--plugin=protoc-gen-ts=${ protocGen } ` ,
9698 '--proto_path=../proto' ,
9799 '--js_out=import_style=commonjs,binary:./src/types/generated' ,
0 commit comments