From f66564f5df67b3e0198afe6c957246e892bb5e28 Mon Sep 17 00:00:00 2001 From: Kevin Le Seigle Date: Wed, 5 Jun 2024 20:03:40 +0200 Subject: [PATCH] fix: hashgraph-sdk with new metro resolver to use NativeClient --- .changeset/ten-spoons-itch.md | 5 +++++ apps/ledger-live-mobile/jest.config.js | 1 + package.json | 5 +++-- patches/@hashgraph__sdk@2.14.2.patch | 12 ++++++++++++ pnpm-lock.yaml | 8 ++++++-- 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 .changeset/ten-spoons-itch.md create mode 100644 patches/@hashgraph__sdk@2.14.2.patch diff --git a/.changeset/ten-spoons-itch.md b/.changeset/ten-spoons-itch.md new file mode 100644 index 00000000000..6c72e18905d --- /dev/null +++ b/.changeset/ten-spoons-itch.md @@ -0,0 +1,5 @@ +--- +"live-mobile": minor +--- + +Patch hashgraph-sdk to support Metro resolver exports diff --git a/apps/ledger-live-mobile/jest.config.js b/apps/ledger-live-mobile/jest.config.js index 5157b495f8e..7a4b0be089e 100644 --- a/apps/ledger-live-mobile/jest.config.js +++ b/apps/ledger-live-mobile/jest.config.js @@ -11,6 +11,7 @@ const transformIncludePatterns = [ "react-native-modal", "react-native-animatable", "@sentry/react-native", + "@hashgraph/sdk", "react-native-startup-time", "@segment/analytics-react-native", "uuid", diff --git a/package.json b/package.json index 07f42d1f4e4..7352d86197f 100644 --- a/package.json +++ b/package.json @@ -165,8 +165,8 @@ "eslint-config-prettier": "^9.0.0", "eslint-plugin-json": "^3.1.0", "eslint-plugin-prettier": "^5.0.1", - "prettier": "^3.0.3", "nyc": "^15.1.0", + "prettier": "^3.0.3", "rimraf": "^4.4.1", "turbo": "1.10.1", "typescript": "^5.4.3", @@ -192,7 +192,8 @@ "asyncstorage-down@4.2.0": "patches/asyncstorage-down@4.2.0.patch", "detox@20.20.2": "patches/detox@20.20.2.patch", "usb@2.9.0": "patches/usb@2.9.0.patch", - "react-native-video@5.2.1": "patches/react-native-video@5.2.1.patch" + "react-native-video@5.2.1": "patches/react-native-video@5.2.1.patch", + "@hashgraph/sdk@2.14.2": "patches/@hashgraph__sdk@2.14.2.patch" }, "packageExtensions": { "eslint-config-next@*": { diff --git a/patches/@hashgraph__sdk@2.14.2.patch b/patches/@hashgraph__sdk@2.14.2.patch new file mode 100644 index 00000000000..ae1b74b074c --- /dev/null +++ b/patches/@hashgraph__sdk@2.14.2.patch @@ -0,0 +1,12 @@ +diff --git a/package.json b/package.json +index af44c5f5b98e37b06817c31523b6d0c080a8bf89..9f565924451a0502cec7979424aa631f7838f74d 100644 +--- a/package.json ++++ b/package.json +@@ -22,6 +22,7 @@ + "./package.json": "./package.json", + ".": { + "import": "./src/index.js", ++ "react-native": "./src/native.js", + "require": "./lib/index.cjs" + } + }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 26dbfd0f323..d329deefe82 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,6 +17,9 @@ overrides: packageExtensionsChecksum: 8b44dc959ddf462fc160cbda4fe2b3bd patchedDependencies: + '@hashgraph/sdk@2.14.2': + hash: ftpe7kgiykw2quxzn7vgiqumd4 + path: patches/@hashgraph__sdk@2.14.2.patch asyncstorage-down@4.2.0: hash: 2npkndps6fxdasqj3xzcrnnfbe path: patches/asyncstorage-down@4.2.0.patch @@ -2832,7 +2835,7 @@ importers: version: 1.2.0 '@hashgraph/sdk': specifier: 2.14.2 - version: 2.14.2(react-native@0.73.6)(react@18.2.0) + version: 2.14.2(patch_hash=ftpe7kgiykw2quxzn7vgiqumd4)(react-native@0.73.6)(react@18.2.0) '@keplr-wallet/cosmos': specifier: ^0.9.16 version: 0.9.16 @@ -13698,7 +13701,7 @@ packages: protobufjs: 6.11.4 dev: false - /@hashgraph/sdk@2.14.2(react-native@0.73.6)(react@18.2.0): + /@hashgraph/sdk@2.14.2(patch_hash=ftpe7kgiykw2quxzn7vgiqumd4)(react-native@0.73.6)(react@18.2.0): resolution: {integrity: sha512-58CGz+NZvuI7VxpmvFXo7IJc60kWRGIdQeYy1b5Y2j3aO5nwElX8IJGpscB+ZiFepwkHC6gvW3dX9tRV2lWGaQ==} engines: {node: '>=10.17.0'} peerDependencies: @@ -13720,6 +13723,7 @@ packages: - react - react-native dev: false + patched: true /@headlessui/react@1.7.18(react-dom@18.2.0)(react@18.2.0): resolution: {integrity: sha512-4i5DOrzwN4qSgNsL4Si61VMkUcWbcSKueUV7sFhpHzQcSShdlHENE5+QBntMSRvHt8NyoFO2AGG8si9lq+w4zQ==}