From 7dcc463d5a9fbe6e224d595ea5de3f3146715b2f Mon Sep 17 00:00:00 2001 From: steveluscher Date: Thu, 21 Apr 2022 14:32:04 -0700 Subject: [PATCH] chore: yarn type:gen now works on all platforms without hacks --- web3.js/scripts/typegen.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/web3.js/scripts/typegen.sh b/web3.js/scripts/typegen.sh index 6a8c18c700..1a3f1d6b6c 100755 --- a/web3.js/scripts/typegen.sh +++ b/web3.js/scripts/typegen.sh @@ -7,16 +7,13 @@ npx tsc -p tsconfig.d.json -d npx rollup -c rollup.config.types.js # Replace export with closing brace for module declaration -sed -i.bak '$s/export {.*};/}/' lib/index.d.ts +sed -i='' '$s/export {.*};/}/' lib/index.d.ts # Replace declare's with export's -sed -i.bak 's/declare/export/g' lib/index.d.ts +sed -i='' 's/declare/export/g' lib/index.d.ts # Prepend declare module line -sed -i.bak '2s;^;declare module "@solana/web3.js" {\n;' lib/index.d.ts - -# Remove backup file from `sed` above -rm lib/index.d.ts.bak +sed -i='' '2s;^;declare module "@solana/web3.js" {\n;' lib/index.d.ts # Run prettier npx prettier --write lib/index.d.ts