diff --git a/.gitignore b/.gitignore index 33ed8e6d..b14fd39c 100644 --- a/.gitignore +++ b/.gitignore @@ -26,6 +26,10 @@ package-lock.json /ios /android +/iostv +/iosmobile +/androidmobile +/androidtv modules/player/android diff --git a/bun.lockb b/bun.lockb index ec0c8c95..249e5d5f 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index 419a1afd..16a86c4a 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "web": "expo start --web", "prebuild": "expo prebuild --clean", "prebuild-tv": "EXPO_TV=1 expo prebuild --clean", + "prebuild-tv-new": "EXPO_TV=1 node ./scripts/symlink-native-dirs.js; EXPO_TV=1 expo prebuild --clean", "test": "jest --watchAll", "lint": "expo lint", "postinstall": "patch-package" @@ -74,7 +75,7 @@ "nativewind": "^2.0.11", "react": "18.2.0", "react-dom": "18.2.0", - "react-native": "npm:react-native-tvos@0.74.5-0", + "react-native": "npm:react-native-tvos@0.76.5-0", "react-native-awesome-slider": "^2.5.6", "react-native-bottom-tabs": "0.7.1", "react-native-circular-progress": "^1.4.1", @@ -100,7 +101,7 @@ "react-native-uitextview": "^1.4.0", "react-native-url-polyfill": "^2.0.0", "react-native-uuid": "^2.0.2", - "react-native-video": "^6.7.0", + "react-native-video": "^6.9.0", "react-native-volume-manager": "^1.10.0", "react-native-web": "~0.19.13", "react-native-webview": "13.8.6", @@ -112,6 +113,7 @@ "zod": "^3.23.8" }, "devDependencies": { + "@react-native-community/cli": "15.1.3", "@react-native-tvos/config-tv": "^0.1.1", "@babel/core": "^7.26.0", "@types/jest": "^29.5.14", diff --git a/scripts/symlink-native-dirs.js b/scripts/symlink-native-dirs.js new file mode 100644 index 00000000..d7819611 --- /dev/null +++ b/scripts/symlink-native-dirs.js @@ -0,0 +1,62 @@ +#!/usr/bin/env node + +const fs = require("fs"); +const path = require("path"); +const process = require("process"); +const { execSync } = require("child_process"); + +const root = process.cwd(); +// const tvosPath = path.join(root, 'iostv'); +// const iosPath = path.join(root, 'iosmobile'); +// const androidPath = path.join(root, 'androidmobile'); +// const androidTVPath = path.join(root, 'androidtv'); +// const device = process.argv[2]; +// const platform = process.argv[2]; +const isTV = process.env.EXPO_TV || false; + +const paths = new Map([ + ["tvos", path.join(root, "iostv")], + ["ios", path.join(root, "iosmobile")], + ["android", path.join(root, "androidmobile")], + ["androidtv", path.join(root, "androidtv")], +]); + +// const platformPath = paths.get(platform); + +if (isTV) { + stdout = execSync( + `mkdir -p ${paths.get("tvos")}; ln -nsf ${paths.get("tvos")} ios` + ); + console.log(stdout.toString()); + stdout = execSync( + `mkdir -p ${paths.get("androidtv")}; ln -nsf ${paths.get( + "androidtv" + )} android` + ); + console.log(stdout.toString()); +} else { + stdout = execSync( + `mkdir -p ${paths.get("ios")}; ln -nsf ${paths.get("ios")} ios` + ); + console.log(stdout.toString()); + stdout = execSync( + `mkdir -p ${paths.get("android")}; ln -nsf ${paths.get("android")} android` + ); + console.log(stdout.toString()); +} + +// target = ""; +// switch (platform) { +// case "tvos": +// target = "ios"; +// break; +// case "ios": +// target = "ios"; +// break; +// case "android": +// target = "android"; +// break; +// case "androidtv": +// target = "android"; +// break; +// }