react-native-lingua 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/Lingua.podspec +43 -1
  2. package/package.json +13 -11
package/Lingua.podspec CHANGED
@@ -19,7 +19,49 @@ Pod::Spec.new do |s|
19
19
 
20
20
  # Build Rust library from source during pod install
21
21
  s.prepare_command = <<-CMD
22
- cd rust && make header && make ios
22
+ set -e
23
+
24
+ # Check if Rust is installed
25
+ if ! command -v cargo &> /dev/null; then
26
+ echo "[ERROR] Rust is not installed."
27
+ echo "Please install Rust: curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh"
28
+ exit 1
29
+ fi
30
+
31
+ # Check if iOS targets are installed
32
+ if ! rustup target list --installed | grep -q "aarch64-apple-ios"; then
33
+ echo "[ERROR] iOS Rust targets not installed."
34
+ echo "Please run: rustup target add aarch64-apple-ios aarch64-apple-ios-sim"
35
+ exit 1
36
+ fi
37
+
38
+ # Clean previous builds
39
+ rm -rf rust/generated/liblingua_native.xcframework
40
+ rm -rf ios/liblingua_native.xcframework
41
+
42
+ # Build the xcframework
43
+ cd rust
44
+ make header
45
+
46
+ # Build for iOS targets
47
+ echo "[INFO] Building Rust library for iOS..."
48
+ cargo build --release --target aarch64-apple-ios
49
+ cargo build --release --target aarch64-apple-ios-sim
50
+
51
+ # Create xcframework
52
+ mkdir -p generated/include
53
+ xcodebuild -create-xcframework \
54
+ -library target/aarch64-apple-ios/release/liblingua_native.a \
55
+ -headers generated/include \
56
+ -library target/aarch64-apple-ios-sim/release/liblingua_native.a \
57
+ -headers generated/include \
58
+ -output generated/liblingua_native.xcframework
59
+
60
+ # Copy to ios directory
61
+ cp -rf generated/liblingua_native.xcframework ../ios/
62
+ cp -f generated/include/liblingua.h ../cpp/
63
+
64
+ echo "[SUCCESS] Rust library built successfully"
23
65
  CMD
24
66
 
25
67
  install_modules_dependencies(s)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-lingua",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "A lingua-rs wrapper for React Native",
5
5
  "main": "./lib/module/index.js",
6
6
  "types": "./lib/typescript/src/index.d.ts",
@@ -39,6 +39,16 @@
39
39
  "README.md",
40
40
  "LICENSE"
41
41
  ],
42
+ "scripts": {
43
+ "example": "pnpm --filter react-native-lingua-example",
44
+ "test": "jest",
45
+ "typecheck": "tsc",
46
+ "lint": "eslint \"**/*.{js,ts,tsx}\"",
47
+ "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
48
+ "build:rust": "cd rust && make all",
49
+ "prepare": "bob build",
50
+ "release": "release-it --only-version"
51
+ },
42
52
  "workspaces": [
43
53
  "example"
44
54
  ],
@@ -87,6 +97,7 @@
87
97
  "react": "*",
88
98
  "react-native": "*"
89
99
  },
100
+ "packageManager": "pnpm@10.14.0",
90
101
  "jest": {
91
102
  "preset": "react-native",
92
103
  "modulePathIgnorePatterns": [
@@ -158,14 +169,5 @@
158
169
  },
159
170
  "dependencies": {
160
171
  "@babel/runtime": "^7.28.4"
161
- },
162
- "scripts": {
163
- "example": "pnpm --filter react-native-lingua-example",
164
- "test": "jest",
165
- "typecheck": "tsc",
166
- "lint": "eslint \"**/*.{js,ts,tsx}\"",
167
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
168
- "build:rust": "cd rust && make all",
169
- "release": "release-it --only-version"
170
172
  }
171
- }
173
+ }