From 676e6971b708f4605102eb460005cba72a63674c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Uraz=20Akg=C3=BCltan?= Date: Thu, 31 Oct 2024 11:27:17 +0100 Subject: [PATCH] Revert "Merge pull request #871 from mendix/fix/MOO-1526/remote-js-debugging-not-working" This reverts commit 13adbc291cc375f1c51a9c8fbfd2bcf8c8cdf804, reversing changes made to f8d2b5cdd6ee9968cf12b19482f777286a90a2f5. --- CHANGELOG.md | 3 - ios/Podfile | 10 +- package-lock.json | 269 +++++++++++++++++- package.json | 2 + ...act-native-firebase+messaging+17.3.0.patch | 0 patches/apply-patches.js | 47 +-- 6 files changed, 273 insertions(+), 58 deletions(-) rename {intermediary-patches => patches}/@react-native-firebase+messaging+17.3.0.patch (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87536cf27..63c1ff883 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] -- We have resolved an issue where remote JavaScript debugging failed in a custom-built Mendix Native Developer App, leading to crashes when enabling “Remote JS Debugging.” The problem was caused by Firebase services not being initialized properly during the build process. We have ensured that Firebase dependencies are now only included when explicitly required by the application - ## [9.0.3] - 2024-10-02 - We upgraded android SDK version to 35 @@ -16,7 +14,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [9.0.1] - 2024-09-03 - We have upgraded `react-native-video` to 6.4.5 - - We have fixed OTA updates compatibility issues on iOS 18. ## [9.0.0] - 2024-07-12 diff --git a/ios/Podfile b/ios/Podfile index 7da506869..a25ddc102 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -60,15 +60,13 @@ def common_pods # Third party dependencies of dependencies pod 'IQKeyboardManager' - # The pods listed in this section are essential for the application to function correctly. - # These pods are added by Native Builder UI (NBUI) and should not be modified under any circumstances. - # Do not make any changes to the pods in this section. - # REQUIRED PODS START - # Required MendixNative dependency pod 'SSZipArchive' - # REQUIRED PODS END + # Required for Push notifications + pod 'Firebase', :modular_headers => true + pod 'FirebaseCore', :modular_headers => true + pod 'GoogleUtilities', :modular_headers => true end target 'nativeTemplate' do diff --git a/package-lock.json b/package-lock.json index 73c2aa31e..5c40419f9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,6 +17,8 @@ "@react-native-community/masked-view": "0.1.10", "@react-native-community/netinfo": "^11.3.2", "@react-native-community/push-notification-ios": "1.10.1", + "@react-native-firebase/app": "17.3.0", + "@react-native-firebase/messaging": "17.3.0", "@react-native-picker/picker": "2.4.8", "@react-navigation/native": "6.1.6", "react-native": "0.73.8", @@ -1337,6 +1339,78 @@ "node": ">=0.8.0" } }, + "node_modules/@expo/config-plugins": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@expo/config-plugins/-/config-plugins-5.0.4.tgz", + "integrity": "sha512-vzUcVpqOMs3h+hyRdhGwk+eGIOhXa5xYdd92yO17RMNHav3v/+ekMbs7XA2c3lepMO8Yd4/5hqmRw9ZTL6jGzg==", + "dependencies": { + "@expo/config-types": "^47.0.0", + "@expo/json-file": "8.2.36", + "@expo/plist": "0.0.18", + "@expo/sdk-runtime-versions": "^1.0.0", + "@react-native/normalize-color": "^2.0.0", + "chalk": "^4.1.2", + "debug": "^4.3.1", + "find-up": "~5.0.0", + "getenv": "^1.0.0", + "glob": "7.1.6", + "resolve-from": "^5.0.0", + "semver": "^7.3.5", + "slash": "^3.0.0", + "xcode": "^3.0.1", + "xml2js": "0.4.23" + } + }, + "node_modules/@expo/config-plugins/node_modules/uuid": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-7.0.3.tgz", + "integrity": "sha512-DPSke0pXhTZgoF/d+WSt2QaKMCFSfx7QegxEWT+JOuHF5aWrKEn0G+ztjuJg/gG8/ItK+rbPCD/yNv8yyih6Cg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@expo/config-plugins/node_modules/xcode": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/xcode/-/xcode-3.0.1.tgz", + "integrity": "sha512-kCz5k7J7XbJtjABOvkc5lJmkiDh8VhjVCGNiqdKCscmVpdVUpEAyXv1xmCLkQJ5dsHqx3IPO4XW+NTDhU/fatA==", + "dependencies": { + "simple-plist": "^1.1.0", + "uuid": "^7.0.3" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@expo/config-types": { + "version": "47.0.0", + "resolved": "https://registry.npmjs.org/@expo/config-types/-/config-types-47.0.0.tgz", + "integrity": "sha512-r0pWfuhkv7KIcXMUiNACJmJKKwlTBGMw9VZHNdppS8/0Nve8HZMTkNRFQzTHW1uH3pBj8jEXpyw/2vSWDHex9g==" + }, + "node_modules/@expo/json-file": { + "version": "8.2.36", + "resolved": "https://registry.npmjs.org/@expo/json-file/-/json-file-8.2.36.tgz", + "integrity": "sha512-tOZfTiIFA5KmMpdW9KF7bc6CFiGjb0xnbieJhTGlHrLL+ps2G0OkqmuZ3pFEXBOMnJYUVpnSy++52LFxvpa5ZQ==", + "dependencies": { + "@babel/code-frame": "~7.10.4", + "json5": "^1.0.1", + "write-file-atomic": "^2.3.0" + } + }, + "node_modules/@expo/plist": { + "version": "0.0.18", + "resolved": "https://registry.npmjs.org/@expo/plist/-/plist-0.0.18.tgz", + "integrity": "sha512-+48gRqUiz65R21CZ/IXa7RNBXgAI/uPSdvJqoN9x1hfL44DNbUoWHgHiEXTx7XelcATpDwNTz6sHLfy0iNqf+w==", + "dependencies": { + "@xmldom/xmldom": "~0.7.0", + "base64-js": "^1.2.3", + "xmlbuilder": "^14.0.0" + } + }, + "node_modules/@expo/sdk-runtime-versions": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@expo/sdk-runtime-versions/-/sdk-runtime-versions-1.0.0.tgz", + "integrity": "sha512-Doz2bfiPndXYFPMRwPyGa1k5QaKDVpY806UJj570epIiMzWaYyCtobasyfC++qfIXVb5Ocy7r3tP9d62hAQ7IQ==" + }, "node_modules/@hapi/hoek": { "version": "9.3.0", "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", @@ -1888,6 +1962,28 @@ "react-native": ">=0.58.4" } }, + "node_modules/@react-native-firebase/app": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@react-native-firebase/app/-/app-17.3.0.tgz", + "integrity": "sha512-anQ4ITkoLgyAgRc8mX6Le2kc6nSNQEs4IWSYehxQU2hTNePqQdCq6XI2KgSo2sSgU3ZoS5YAEJgDFOBNB1U/lA==", + "dependencies": { + "@expo/config-plugins": "^5.0.4", + "opencollective-postinstall": "^2.0.1", + "superstruct": "^0.6.2" + }, + "peerDependencies": { + "react": "*", + "react-native": "*" + } + }, + "node_modules/@react-native-firebase/messaging": { + "version": "17.3.0", + "resolved": "https://registry.npmjs.org/@react-native-firebase/messaging/-/messaging-17.3.0.tgz", + "integrity": "sha512-A1NNrU5KrztJLym5p+VNIbU3pLOSHW9DpJdXyIBR/n/5nZBLL/zLsMoDs8dvfaeyBPiWuvVQbloOKfd5mTvmOw==", + "peerDependencies": { + "@react-native-firebase/app": "17.3.0" + } + }, "node_modules/@react-native-picker/picker": { "version": "2.4.8", "resolved": "https://registry.npmjs.org/@react-native-picker/picker/-/picker-2.4.8.tgz", @@ -2110,6 +2206,11 @@ "node": ">=18" } }, + "node_modules/@react-native/normalize-color": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@react-native/normalize-color/-/normalize-color-2.1.0.tgz", + "integrity": "sha512-Z1jQI2NpdFJCVgpY+8Dq/Bt3d+YUi1928Q+/CZm/oh66fzM0RUl54vvuXlPJKybH4pdCZey1eDTPaLHkMPNgWA==" + }, "node_modules/@react-native/normalize-colors": { "version": "0.73.2", "resolved": "https://registry.npmjs.org/@react-native/normalize-colors/-/normalize-colors-0.73.2.tgz", @@ -2266,6 +2367,14 @@ "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-21.0.3.tgz", "integrity": "sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==" }, + "node_modules/@xmldom/xmldom": { + "version": "0.7.13", + "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.7.13.tgz", + "integrity": "sha512-lm2GW5PkosIzccsaZIz7tp8cPADSIlIHWDFTR1N0SzfinhhYgeIQjFMz4rYzanCScr3DqQLeomUDArp6MWKm+g==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/@yarnpkg/lockfile": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@yarnpkg/lockfile/-/lockfile-1.1.0.tgz", @@ -2527,7 +2636,6 @@ "version": "1.6.52", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.52.tgz", "integrity": "sha512-QxD8cf2eVqJOOz63z6JIN9BzvVs/dlySa5HGSBH5xtR8dPteIRQnBxxKqkNTiT6jbDTF6jAfrd4oMcND9RGbQg==", - "dev": true, "engines": { "node": ">=0.6" } @@ -2557,7 +2665,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", "integrity": "sha512-sXaHZicyEEmY86WyueLTQesbeoH/mquvarJaQNbjuOQO+7gbFcDEWqKmcWA4cOTLzFlfgvkiVxolk1k5bBIpmg==", - "dev": true, "dependencies": { "stream-buffers": "2.2.x" } @@ -2566,7 +2673,6 @@ "version": "0.3.1", "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.3.1.tgz", "integrity": "sha512-PyJxiNtA5T2PlLIeBot4lbp7rj4OadzjnMZD/G5zuBNt8ei/yCU7+wW0h2bag9vr8c+/WuRWmSxbqAl9hL1rBA==", - "dev": true, "dependencies": { "big-integer": "1.6.x" }, @@ -4033,6 +4139,25 @@ "integrity": "sha512-GRnmB5gPyJpAhTQdSZTSp9uaPSvl09KoYcMQtsB9rQoOmzs9dH6ffeccH+Z+cv6P68Hu5bC6JjRh4Ah/mHSNRw==", "dev": true }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha512-7EwmXrOjyL+ChxMhmG5lnW9MPt1aIeZEwKhQzoBUdTV0N3zuwWDZYVJatDvZ2OyzPUvdIAZDsCetk3coyMfcnQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/for-own": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/for-own/-/for-own-1.0.0.tgz", + "integrity": "sha512-0OABksIGrxKK8K4kynWkQ7y1zounQxP+CWnyclVwj81KW3vlLlGUx57DKGcP/LH216GzqnstnPocF16Nxs0Ycg==", + "dependencies": { + "for-in": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/fresh": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", @@ -4133,6 +4258,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/getenv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/getenv/-/getenv-1.0.0.tgz", + "integrity": "sha512-7yetJWqbS9sbn0vIfliPsFgoXMKn/YMF+Wuiog97x+urnSRRRZ7xB+uVkwGKzRgq9CDFfMQnE9ruL5DHv9c6Xg==", + "engines": { + "node": ">=6" + } + }, "node_modules/glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -4462,6 +4595,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha512-5BMULNob1vgFX6EjQw5izWDxrecWK9AM72rugNr0TFldMOi0fj6Jk+zeKIt0xGj4cEfQIJth4w3OKWOJ4f+AFw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", @@ -4856,6 +4997,17 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dependencies": { + "minimist": "^1.2.0" + }, + "bin": { + "json5": "lib/cli.js" + } + }, "node_modules/jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -5578,6 +5730,26 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/mixin-object": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/mixin-object/-/mixin-object-2.0.1.tgz", + "integrity": "sha512-ALGF1Jt9ouehcaXaHhn6t1yGWRqGaHkPFndtFVHfZXOvkIZ/yoGaSi0AHVTafb3ZBGg4dr/bDwnaEKqCXzchMA==", + "dependencies": { + "for-in": "^0.1.3", + "is-extendable": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/mixin-object/node_modules/for-in": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-0.1.8.tgz", + "integrity": "sha512-F0to7vbBSHP8E3l6dCjxNOLuSFAACIxFy3UehTUlG7svlXi37HHsDkyVcHo0Pq8QwrE+pXvWSVX3ZT1T9wAZ9g==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/mkdirp": { "version": "0.5.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", @@ -5898,6 +6070,14 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "bin": { + "opencollective-postinstall": "index.js" + } + }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -6264,7 +6444,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/plist/-/plist-3.1.0.tgz", "integrity": "sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==", - "dev": true, "dependencies": { "@xmldom/xmldom": "^0.8.8", "base64-js": "^1.5.1", @@ -6278,7 +6457,6 @@ "version": "0.8.10", "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.10.tgz", "integrity": "sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==", - "dev": true, "engines": { "node": ">=10.0.0" } @@ -6287,7 +6465,6 @@ "version": "15.1.1", "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-15.1.1.tgz", "integrity": "sha512-yMqGBqtXyeN1e3TGYvgNgDVZ3j84W4cwkOXQswghol6APgZWaff9lnbvN7MHYJOiXsvGPXtjTYJEiC9J2wv9Eg==", - "dev": true, "engines": { "node": ">=8.0" } @@ -6969,7 +7146,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", - "dev": true, "engines": { "node": ">=8" } @@ -7045,6 +7221,11 @@ "truncate-utf8-bytes": "^1.0.0" } }, + "node_modules/sax": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.4.1.tgz", + "integrity": "sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==" + }, "node_modules/scheduler": { "version": "0.24.0-canary-efb381bbf-20230505", "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.24.0-canary-efb381bbf-20230505.tgz", @@ -7240,7 +7421,6 @@ "version": "1.3.1", "resolved": "https://registry.npmjs.org/simple-plist/-/simple-plist-1.3.1.tgz", "integrity": "sha512-iMSw5i0XseMnrhtIzRb7XpQEXepa9xhWxGUojHBL43SIpQuDQkh3Wpy67ZbDzZVr6EKxvwVChnVpdl8hEVLDiw==", - "dev": true, "dependencies": { "bplist-creator": "0.1.0", "bplist-parser": "0.3.1", @@ -7414,7 +7594,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/stream-buffers/-/stream-buffers-2.2.0.tgz", "integrity": "sha512-uyQK/mx5QjHun80FLJTfaWE7JtwfRMKBLkMne6udYOmvH0CawotVa7TfgYHzAnpphn4+TweIx1QKMnRIbipmUg==", - "dev": true, "engines": { "node": ">= 0.10.0" } @@ -7504,6 +7683,50 @@ "resolved": "https://registry.npmjs.org/sudo-prompt/-/sudo-prompt-9.2.1.tgz", "integrity": "sha512-Mu7R0g4ig9TUuGSxJavny5Rv0egCEtpZRNMrZaYS1vxkiIxGiGUwoezU3LazIQ+KE04hTrTfNPgxU5gzi7F5Pw==" }, + "node_modules/superstruct": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.6.2.tgz", + "integrity": "sha512-lvA97MFAJng3rfjcafT/zGTSWm6Tbpk++DP6It4Qg7oNaeM+2tdJMuVgGje21/bIpBEs6iQql1PJH6dKTjl4Ig==", + "dependencies": { + "clone-deep": "^2.0.1", + "kind-of": "^6.0.1" + } + }, + "node_modules/superstruct/node_modules/clone-deep": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/clone-deep/-/clone-deep-2.0.2.tgz", + "integrity": "sha512-SZegPTKjCgpQH63E+eN6mVEEPdQBOUzjyJm5Pora4lrwWRFS8I0QAxV/KD6vV/i0WuijHZWQC1fMsPEdxfdVCQ==", + "dependencies": { + "for-own": "^1.0.0", + "is-plain-object": "^2.0.4", + "kind-of": "^6.0.0", + "shallow-clone": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/superstruct/node_modules/shallow-clone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shallow-clone/-/shallow-clone-1.0.0.tgz", + "integrity": "sha512-oeXreoKR/SyNJtRJMAKPDSvd28OqEwG4eR/xc856cRGBII7gX9lvAqDxusPm0846z/w/hWYjI1NpKwJ00NHzRA==", + "dependencies": { + "is-extendable": "^0.1.1", + "kind-of": "^5.0.0", + "mixin-object": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/superstruct/node_modules/shallow-clone/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -8098,6 +8321,34 @@ "node": ">= 10" } }, + "node_modules/xml2js": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", + "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "dependencies": { + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/xml2js/node_modules/xmlbuilder": { + "version": "11.0.1", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", + "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/xmlbuilder": { + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-14.0.0.tgz", + "integrity": "sha512-ts+B2rSe4fIckR6iquDjsKbQFK2NlUk6iG5nf14mDEyldgoc2nEKZ3jZWMPTxGQwVgToSjt6VGIho1H8/fNFTg==", + "engines": { + "node": ">=8.0" + } + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/package.json b/package.json index 321be2a02..f3e91115b 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,8 @@ "@react-native-community/masked-view": "0.1.10", "@react-native-community/netinfo": "^11.3.2", "@react-native-community/push-notification-ios": "1.10.1", + "@react-native-firebase/app": "17.3.0", + "@react-native-firebase/messaging": "17.3.0", "@react-native-picker/picker": "2.4.8", "@react-navigation/native": "6.1.6", "react-native": "0.73.8", diff --git a/intermediary-patches/@react-native-firebase+messaging+17.3.0.patch b/patches/@react-native-firebase+messaging+17.3.0.patch similarity index 100% rename from intermediary-patches/@react-native-firebase+messaging+17.3.0.patch rename to patches/@react-native-firebase+messaging+17.3.0.patch diff --git a/patches/apply-patches.js b/patches/apply-patches.js index 51d36a9ef..b7eea6ead 100755 --- a/patches/apply-patches.js +++ b/patches/apply-patches.js @@ -1,18 +1,14 @@ const { execSync } = require('child_process'); -const { copyFileSync, unlinkSync } = require('fs'); +const { copyFileSync } = require('fs'); const { join } = require("path"); const rootDir = process.cwd(); -const patchOperations = [ - { - dependency: "react-native-geocoder", - patchFile: "react-native-geocoder+0.5.0.patch" - }, - { - dependency: "@react-native-firebase/app", - patchFile: "@react-native-firebase+messaging+17.3.0.patch" - } -]; +// We check if geocoder lib is added via widget/js action and then apply patch if necessary +if (hasDependency("react-native-geocoder")){ + copyFileSync(join(rootDir, "intermediary-patches/react-native-geocoder+0.5.0.patch"), join(rootDir, "patches/react-native-geocoder+0.5.0.patch")) +} +// We execute patch-package normally after copy or not the patch(es) +execSync("npx patch-package", {cwd: rootDir, stdio: "inherit"}); function hasDependency(name) { try { @@ -22,32 +18,3 @@ function hasDependency(name) { return false; } } - -function applyPatch(patchFile) { - const sourcePath = join(rootDir, "intermediary-patches", patchFile); - const destPath = join(rootDir, "patches", patchFile); - copyFileSync(sourcePath, destPath); - console.log(`Applied patch: ${patchFile}`); -} - -function removePatch(patchFile) { - const patchFilePath = join(rootDir, "patches", patchFile); - try { - unlinkSync(patchFilePath); - console.log(`Deleted patch file: ${patchFile}`); - } catch (err) { - if (err.code !== 'ENOENT') { - console.error(`Error deleting patch file ${patchFile}: ${err.message}`); - } - } -} - -patchOperations.forEach(({ dependency, patchFile }) => { - if (hasDependency(dependency)) { - applyPatch(patchFile); - } else { - removePatch(patchFile); - } -}); - -execSync("npx patch-package", { cwd: rootDir, stdio: "inherit" });