fix: post process generated flow definition
This commit is contained in:
committed by
Justin Starry
parent
dfbca76a76
commit
02c0664487
16
web3.js/scripts/flowgen.sh
Executable file
16
web3.js/scripts/flowgen.sh
Executable file
@ -0,0 +1,16 @@
|
||||
set -ex
|
||||
|
||||
# Generate flowdef
|
||||
npx flowgen lib/types/index.d.ts -o module.flow.js
|
||||
|
||||
# Remove trailing export
|
||||
sed -i '/declare export {/{:a;N;/}/!ba};//g' module.flow.js
|
||||
|
||||
# Change all declarations to exports
|
||||
sed -i 's/declare/declare export/g' module.flow.js
|
||||
|
||||
# Prepend declare module line
|
||||
sed -i '7s;^;declare module "@solana/web3.js" {\n;' module.flow.js
|
||||
|
||||
# Append closing brace for module declaration
|
||||
echo '}' >> module.flow.js
|
Reference in New Issue
Block a user