Skip to content

Commit 7f54d33

Browse files
committed
fix: properly prepack shared code so it is included in the sdk
1 parent e952c46 commit 7f54d33

File tree

4 files changed

+73
-4
lines changed

4 files changed

+73
-4
lines changed

package/expo-package/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@
7171
"expo-audio": "~0.4.6"
7272
},
7373
"scripts": {
74-
"prepack": " cp ../../README.md .",
75-
"postpack": "rm README.md"
74+
"prepack": "bash ../scripts/sync-shimmer-native.sh expo-package && cp ../../README.md .",
75+
"postpack": "rm README.md && bash ../scripts/clean-shimmer-native-copies.sh expo-package"
7676
},
7777
"codegenConfig": {
7878
"name": "StreamChatExpoSpec",

package/native-package/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@
7878
}
7979
},
8080
"scripts": {
81-
"prepack": " cp ../../README.md .",
82-
"postpack": "rm README.md"
81+
"prepack": "bash ../scripts/sync-shimmer-native.sh native-package && cp ../../README.md .",
82+
"postpack": "rm README.md && bash ../scripts/clean-shimmer-native-copies.sh native-package"
8383
},
8484
"devDependencies": {
8585
"react-native": "^0.79.3"
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
TARGET="${1:-all}"
6+
7+
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
8+
9+
clean_package() {
10+
local package_name="$1"
11+
local dir="$ROOT_DIR/$package_name/android/src/main/java/com/streamchatreactnative"
12+
rm -f "$dir/StreamShimmerFrameLayout.kt" "$dir/StreamShimmerViewManager.kt"
13+
}
14+
15+
case "$TARGET" in
16+
native-package)
17+
clean_package "native-package"
18+
;;
19+
expo-package)
20+
clean_package "expo-package"
21+
;;
22+
all)
23+
clean_package "native-package"
24+
clean_package "expo-package"
25+
;;
26+
*)
27+
echo "Unknown target: $TARGET"
28+
echo "Expected one of: native-package, expo-package, all"
29+
exit 1
30+
;;
31+
esac
32+
33+
echo "Cleaned generated shimmer native copies for target: $TARGET"
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/usr/bin/env bash
2+
3+
set -euo pipefail
4+
5+
TARGET="${1:-all}"
6+
7+
ROOT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
8+
SRC_DIR="$ROOT_DIR/shared-native/android/src/main/java/com/streamchatreactnative"
9+
10+
copy_to_package() {
11+
local package_name="$1"
12+
local dst_dir="$ROOT_DIR/$package_name/android/src/main/java/com/streamchatreactnative"
13+
mkdir -p "$dst_dir"
14+
cp "$SRC_DIR/StreamShimmerFrameLayout.kt" "$dst_dir/StreamShimmerFrameLayout.kt"
15+
cp "$SRC_DIR/StreamShimmerViewManager.kt" "$dst_dir/StreamShimmerViewManager.kt"
16+
}
17+
18+
case "$TARGET" in
19+
native-package)
20+
copy_to_package "native-package"
21+
;;
22+
expo-package)
23+
copy_to_package "expo-package"
24+
;;
25+
all)
26+
copy_to_package "native-package"
27+
copy_to_package "expo-package"
28+
;;
29+
*)
30+
echo "Unknown target: $TARGET"
31+
echo "Expected one of: native-package, expo-package, all"
32+
exit 1
33+
;;
34+
esac
35+
36+
echo "Synchronized shimmer native files for target: $TARGET"

0 commit comments

Comments
 (0)