From 7a0946534fcf357c91dc8d908f89857918069b9d Mon Sep 17 00:00:00 2001 From: D4ryl00 Date: Wed, 23 Oct 2024 18:54:24 +0200 Subject: [PATCH] fix: manually copy API files in build/api folder Signed-off-by: D4ryl00 --- .npmignore | 3 +++ package.json | 2 +- prepare.sh | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100755 prepare.sh 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