diff --git a/.npmignore b/.npmignore index 53f45b6..560884b 100644 --- a/.npmignore +++ b/.npmignore @@ -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 diff --git a/package.json b/package.json index 051324d..d9cb8a9 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/prepare.sh b/prepare.sh new file mode 100755 index 0000000..6a3c933 --- /dev/null +++ b/prepare.sh @@ -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