Skip to content

Commit

Permalink
fix: manually copy API files in build/api folder (#22)
Browse files Browse the repository at this point in the history
Signed-off-by: D4ryl00 <[email protected]>
  • Loading branch information
D4ryl00 authored Oct 24, 2024
1 parent 7ecb4b3 commit 01865ac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@ __tests__
# Excluding yarn.lock causes the local build to fail.
# This is because the build is done on the host machine.
!yarn.lock

# Go compilation needs .tool-versions
!.tool-versions
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"clean": "expo-module clean",
"lint": "expo-module lint",
"test": "expo-module test",
"prepare": "expo-module prepare",
"prepare": "expo-module prepare && sh prepare.sh",
"prepublishOnly": "expo-module prepublishOnly",
"expo-module": "expo-module",
"open:ios": "open -a \"Xcode\" example/ios",
Expand Down
14 changes: 14 additions & 0 deletions prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/sh

#If the folder exists, copy API files
if [ -d "./build" ]; then

cp ./src/api/protocoltypes.pb.js ./build/api/
cp ./src/api/protocoltypes.pb.d.ts ./build/api/
cp ./src/api/rpcmanager.pb.d.ts ./build/api/
cp ./src/api/rpcmanager.pb.js ./build/api/

#Else prints an error
else
echo "Error: build folder not found, please do \`yarn install\` first"
fi

0 comments on commit 01865ac

Please sign in to comment.