-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add better error handling to prevent crashes when creating sharedPreferences #1267
Changes from all commits
83dfc0c
82fa18f
f4d795e
0154e73
2662e0f
a863042
8e0f5af
9ccf1b2
6a7a097
877342b
9d64994
9f3a830
d8ad959
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,48 @@ | ||
const path = require("path"); | ||
const { getDefaultConfig } = require("@react-native/metro-config"); | ||
const { getConfig } = require("react-native-builder-bob/metro-config"); | ||
const pkg = require("../package.json"); | ||
|
||
const root = path.resolve(__dirname, ".."); | ||
const rnSignerRoot = path.resolve(__dirname, ".."); | ||
const projectRoot = __dirname; | ||
// handles the hoisted modules | ||
const repoRoot = path.resolve(__dirname, "../../.."); | ||
|
||
const config = getDefaultConfig(projectRoot); | ||
|
||
const monorepoPackages = { | ||
"@account-kit/signer": path.resolve(repoRoot, "account-kit/signer"), | ||
"@aa-sdk/core": path.resolve(repoRoot, "aa-sdk/core"), | ||
"@account-kit/logging": path.resolve(repoRoot, "account-kit/logging"), | ||
}; | ||
|
||
config.watchFolders = [ | ||
projectRoot, | ||
rnSignerRoot, | ||
...Object.values(monorepoPackages), | ||
]; | ||
|
||
// Let Metro know where to resolve packages and in what order | ||
config.resolver.nodeModulesPaths = [ | ||
path.resolve(projectRoot, "node_modules"), | ||
path.resolve(rnSignerRoot, "node_modules"), | ||
path.resolve(repoRoot, "node_modules"), | ||
]; | ||
|
||
// Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths` | ||
config.resolver.disableHierarchicalLookup = true; | ||
|
||
config.resolver.extraNodeModules = { | ||
...config.resolver.extraNodeModules, | ||
...require("node-libs-react-native"), | ||
...monorepoPackages, | ||
crypto: require.resolve("crypto-browserify"), | ||
stream: require.resolve("stream-browserify"), | ||
}; | ||
|
||
/** | ||
* Metro configuration | ||
* https://facebook.github.io/metro/docs/configuration | ||
* | ||
*/ | ||
module.exports = { | ||
...getConfig(getDefaultConfig(__dirname), { | ||
root, | ||
pkg, | ||
project: __dirname, | ||
}), | ||
watchFolders: [root, repoRoot], | ||
}; | ||
module.exports = config; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main bulk of changes in this PR are autoGenerated. This file contains the main crux of the work on here. 🙏🏾