Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: manually copy API files in build/api folder #22

Merged
merged 1 commit into from
Oct 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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