@trentrand/react-native-app-clip 0.6.2-beta.4 → 0.6.2-beta.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trentrand/react-native-app-clip",
3
- "version": "0.6.2-beta.4",
3
+ "version": "0.6.2-beta.6",
4
4
  "description": "Config plugin to add an App Clip to a React Native iOS app",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -38,7 +38,7 @@ function addBuildPhases(xcodeProject, { targetUuid, groupName, productFile, enab
38
38
  if (enableCompression) {
39
39
  xcodeProject.addBuildPhase([], "PBXShellScriptBuildPhase", "Compress JS Bundle", targetUuid, {
40
40
  shellPath: "/bin/sh",
41
- shellScript: 'if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then\n source "$PODS_ROOT/../.xcode.env"\nfi\nif [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then\n source "$PODS_ROOT/../.xcode.env.local"\nfi\n\nif [[ "$CONFIGURATION" != "Release" ]]; then\n exit 0\nfi\n\nBUNDLE="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/main.jsbundle"\n\nif [ -f "$BUNDLE" ]; then\n "$NODE_BINARY" -e "const fs=require(\'fs\');const zlib=require(\'zlib\');fs.createReadStream(\'${BUNDLE}\').pipe(zlib.createDeflate({level:9})).pipe(fs.createWriteStream(\'${BUNDLE}.zlib\')).on(\'finish\', ()=>fs.unlinkSync(\'${BUNDLE}\'))"\nfi\n',
41
+ shellScript: 'if [[ -f "$PODS_ROOT/../.xcode.env" ]]; then\n source "$PODS_ROOT/../.xcode.env"\nfi\nif [[ -f "$PODS_ROOT/../.xcode.env.local" ]]; then\n source "$PODS_ROOT/../.xcode.env.local"\nfi\n\nif [[ "$CONFIGURATION" != "Release" ]]; then\n exit 0\nfi\n\nBUNDLE="${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/main.jsbundle"\n\nif [ -f "$BUNDLE" ]; then\n "$NODE_BINARY" -e "const fs=require(\'fs\');const zlib=require(\'zlib\');const data=fs.readFileSync(\'${BUNDLE}\');const compressed=zlib.deflateSync(data);fs.writeFileSync(\'${BUNDLE}.zlib\', compressed);fs.unlinkSync(\'${BUNDLE}\');"\nfi\n',
42
42
  }, buildPath);
43
43
  }
44
44
  }
@@ -48,8 +48,11 @@ function modifyAppDelegate(appDelegatePath) {
48
48
  let compressedData = try Data(contentsOf: compressedURL)
49
49
 
50
50
  // Decompress using NSData decompression (available iOS 13+)
51
- guard let decompressedData = try? (compressedData as NSData).decompressed(using: .zlib) as Data else {
52
- print("❌ Failed to decompress bundle")
51
+ let decompressedData: Data
52
+ do {
53
+ decompressedData = try (compressedData as NSData).decompressed(using: .zlib) as Data
54
+ } catch {
55
+ print("❌ Decompression failed: \(error)")
53
56
  return nil
54
57
  }
55
58