Skip to content

Commit

Permalink
chore: [SIW-768] Change nodeify with nodelibs (#5343)
Browse files Browse the repository at this point in the history
## Short description
This PR replaces `rn-nodeify` with `@pagopa-react-native-nodelibs`. 
This change is experimental and aims at eliminating `rn-nodeify` which
is not manteined anymore.
More info on how `nodelibs` replaces `node` dependencies with
`react-native` compatibile versions can be found on [its
repository](https://github.com/pagopa/react-native-nodelibs).

Associated
[ticket](https://pagopa.atlassian.net/jira/software/projects/SIW/boards/222?selectedIssue=SIW-768&text=768).
  • Loading branch information
grausof committed Dec 15, 2023
1 parent 190d531 commit 727e5c9
Show file tree
Hide file tree
Showing 5 changed files with 331 additions and 123 deletions.
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/**
* Main app entrypoint
*/
// Shim file generated by rn-nodeify
import "./shim";
import "@pagopa/react-native-nodelibs/globals";
import "react-native-get-random-values";
import {
AlertStatic as Alert,
Expand Down
6 changes: 3 additions & 3 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,7 @@ PODS:
- React
- react-native-flipper (0.154.0):
- React-Core
- react-native-get-random-values (1.7.0):
- react-native-get-random-values (1.10.0):
- React-Core
- react-native-image-picker (4.10.3):
- React-Core
Expand Down Expand Up @@ -977,7 +977,7 @@ SPEC CHECKSUMS:
react-native-document-picker: 2b8f18667caee73a96708a82b284a4f40b30a156
react-native-fingerprint-scanner: ac6656f18c8e45a7459302b84da41a44ad96dbbe
react-native-flipper: 97d537d855e0e7f6ac26a065e01bf1aecc8ba41c
react-native-get-random-values: 237bffb1c7e05fb142092681531810a29ba53015
react-native-get-random-values: 384787fd76976f5aec9465aff6fa9e9129af1e74
react-native-image-picker: 60f4246eb5bb7187fc15638a8c1f13abd3820695
react-native-mixpanel: d644efe1ca33d2646d5cba29e24a13ebc9b37209
react-native-pdf: a6a5a3f0bdf340eb2eed6c96034424d2cc3f84b0
Expand Down Expand Up @@ -1042,4 +1042,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 0d78c2a7f58353c7eed2163b7e3b3747b00ff101

COCOAPODS: 1.12.1
COCOAPODS: 1.14.2
6 changes: 5 additions & 1 deletion metro.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const { getDefaultConfig } = require("metro-config");

// eslint-disable-next-line functional/immutable-data
module.exports = (async () => {
const {
resolver: { sourceExts, assetExts }
Expand All @@ -15,7 +16,10 @@ module.exports = (async () => {
},
resolver: {
assetExts: assetExts.filter(ext => ext !== "svg"),
sourceExts: [...withE2ESourceExts, "svg"]
sourceExts: [...withE2ESourceExts, "svg"],
extraNodeModules: {
...require("@pagopa/react-native-nodelibs")
}
}
};
})();
15 changes: 3 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"start-release-cycle": "yarn pre-cycle && standard-version --message \"release(IT Wallet): {{currentTag}}\" -t \"\" --prerelease rc --release-as minor --no-verify && yarn push-hint",
"start-breaking-cycle": "yarn pre-cycle && standard-version --message \"release(IT Wallet): {{currentTag}}\" -t \"\" --prerelease rc --release-as major --no-verify && yarn push-hint",
"attach": "react-native attach",
"postinstall": "patch-package && rn-nodeify --install path,buffer && chmod +x ./bin/add-ios-source-maps.sh && ./bin/add-ios-source-maps.sh && chmod +x ./bin/add-ios-env-config.sh && ./bin/add-ios-env-config.sh",
"postinstall": "patch-package && chmod +x ./bin/add-ios-source-maps.sh && ./bin/add-ios-source-maps.sh && chmod +x ./bin/add-ios-env-config.sh && ./bin/add-ios-env-config.sh",
"test:ci": "jest --ci --maxWorkers=2 --silent",
"test:dev": "jest --detectOpenHandles --coverage=false",
"test:tz": "yarn test:tz-eu-rome && yarn test:tz-us-ny && yarn test:tz-us-yt && yarn test:tz-au-syd && yarn test:tz-eu-rome-comp",
Expand Down Expand Up @@ -120,6 +120,7 @@
"@pagopa/io-react-native-login-utils": "^0.2.0",
"@pagopa/io-react-native-wallet": "^0.10.2",
"@pagopa/react-native-cie": "1.2.0",
"@pagopa/react-native-nodelibs": "^0.1.0",
"@pagopa/ts-commons": "^10.15.0",
"@react-native-async-storage/async-storage": "^1.17.10",
"@react-native-camera-roll/camera-roll": "5.6.1",
Expand All @@ -138,7 +139,6 @@
"@xstate/react": "^3.0.1",
"abort-controller": "^1.0.2",
"async-mutex": "^0.1.3",
"buffer": "^4.9.1",
"color": "^3.0.0",
"date-fns": "^1.29.0",
"deprecated-react-native-prop-types": "^2.3.0",
Expand Down Expand Up @@ -177,6 +177,7 @@
"react-native-flipper": "^0.154.0",
"react-native-fs": "^2.18.0",
"react-native-gesture-handler": "^2.12.0",
"react-native-get-random-values": "^1.10.0",
"react-native-haptic-feedback": "^2.0.2",
"react-native-i18n": "^2.0.15",
"react-native-image-pan-zoom": "^2.1.11",
Expand Down Expand Up @@ -310,12 +311,10 @@
"postinstall-postinstall": "^1.0.0",
"prettier": "2.8.8",
"react-native-bundle-visualizer": "^2.2.1",
"react-native-get-random-values": "^1.7.0",
"react-native-svg-transformer": "^0.14.3",
"react-test-renderer": "18.0.0",
"redux-mock-store": "^1.5.4",
"redux-saga-test-plan": "4.0.3",
"rn-nodeify": "^10.0.1",
"standard-version": "^8.0.2",
"ts-node": "^7.0.1",
"typescript": "^4.9.5"
Expand All @@ -325,14 +324,6 @@
"@types/react": "16.7.18",
"@types/prop-types": "15.5.5"
},
"react-native": {
"path": "path-browserify",
"crypto": "react-native-crypto"
},
"browser": {
"path": "path-browserify",
"crypto": "react-native-crypto"
},
"repository": {
"type": "git",
"url": "git+https://github.com/pagopa/io-app.git"
Expand Down
Loading

0 comments on commit 727e5c9

Please sign in to comment.