From 0332c802fac97a0478083b5bc711958cb83fd1f1 Mon Sep 17 00:00:00 2001 From: ieow Date: Thu, 26 Sep 2024 18:17:23 +0800 Subject: [PATCH] fix: enable build and sign --- .../ios/Podfile.lock | 2 +- .../metro.config.js | 32 ++++++++++++++++-- .../metro.config.ts | 33 ------------------- .../package-lock.json | 21 ++++++++++++ .../mpc-core-kit-rn-expo-auth0/package.json | 3 +- 5 files changed, 54 insertions(+), 37 deletions(-) delete mode 100644 mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.ts diff --git a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/ios/Podfile.lock b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/ios/Podfile.lock index 4949342b..5be9265d 100644 --- a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/ios/Podfile.lock +++ b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/ios/Podfile.lock @@ -1539,7 +1539,7 @@ SPEC CHECKSUMS: ReactCommon: f7da14a8827b72704169a48c929bcde802698361 SimpleKeychain: f8707c8e97b38c6a6e687b17732afc9bcef06439 SocketRocket: abac6f5de4d4d62d24e11868d7a2f427e0ef940d - Yoga: 2246eea72aaf1b816a68a35e6e4b74563653ae09 + Yoga: 950bbfd7e6f04790fdb51149ed51df41f329fcc8 PODFILE CHECKSUM: 1aa16d00e266ed46c845784a38e2efdd1b7a55b9 diff --git a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.js b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.js index d628aa22..43c41177 100644 --- a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.js +++ b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.js @@ -1,3 +1,31 @@ -require('ts-node/register'); -module.exports = require('./metro.config.ts'); +require("ts-node/register"); +// Learn more https://docs.expo.io/guides/customizing-metro +const { getDefaultConfig } = require("expo/metro-config"); +/** @type {import('expo/metro-config').MetroConfig} */ +const config = getDefaultConfig(__dirname); + +config.transformer.babelTransformerPath = require.resolve("react-native-react-bridge/lib/plugin"); +config.resolver.extraNodeModules = { + ...config.resolver.extraNodeModules, + + assert: require.resolve("empty-module"), // assert can be polyfilled here if needed + http: require.resolve("empty-module"), // stream-http can be polyfilled here if needed + https: require.resolve("empty-module"), // https-browserify can be polyfilled here if needed + os: require.resolve("empty-module"), // os-browserify can be polyfilled here if needed + url: require.resolve("empty-module"), // url can be polyfilled here if needed + zlib: require.resolve("empty-module"), // browserify-zlib can be polyfilled here if needed + path: require.resolve("empty-module"), + crypto: require.resolve("empty-module"), + buffer: require.resolve("@craftzdog/react-native-buffer"), +}; + +// config.resolveRequest = (context, moduleName, platform) => { +// if (moduleName === "crypto") { +// // when importing crypto, resolve to react-native-quick-crypto +// return context.resolveRequest(context, "react-native-quick-crypto", platform); +// } +// // otherwise chain to the standard Metro resolver. +// return context.resolveRequest(context, moduleName, platform); +// } +module.exports = config; diff --git a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.ts b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.ts deleted file mode 100644 index 2f12d0de..00000000 --- a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/metro.config.ts +++ /dev/null @@ -1,33 +0,0 @@ -// Learn more https://docs.expo.io/guides/customizing-metro -const { getDefaultConfig } = require('expo/metro-config'); - -/** @type {import('expo/metro-config').MetroConfig} */ -const config = getDefaultConfig(__dirname); - -config.transformer.babelTransformerPath = require.resolve( - "react-native-react-bridge/lib/plugin" -); -config.resolver.extraNodeModules = { - ...config.resolver.extraNodeModules, - - assert: require.resolve('empty-module'), // assert can be polyfilled here if needed - http: require.resolve('empty-module'), // stream-http can be polyfilled here if needed - https: require.resolve('empty-module'), // https-browserify can be polyfilled here if needed - os: require.resolve('empty-module'), // os-browserify can be polyfilled here if needed - url: require.resolve('empty-module'), // url can be polyfilled here if needed - zlib: require.resolve('empty-module'), // browserify-zlib can be polyfilled here if needed - path: require.resolve('empty-module'), - crypto: require.resolve('empty-module'), - buffer: require.resolve('@craftzdog/react-native-buffer'), - -} - -// config.resolveRequest = (context, moduleName, platform) => { -// if (moduleName === "crypto") { -// // when importing crypto, resolve to react-native-quick-crypto -// return context.resolveRequest(context, "react-native-quick-crypto", platform); -// } -// // otherwise chain to the standard Metro resolver. -// return context.resolveRequest(context, moduleName, platform); -// } -module.exports = config; \ No newline at end of file diff --git a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package-lock.json b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package-lock.json index 47506aa5..b37b66ad 100644 --- a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package-lock.json +++ b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package-lock.json @@ -22,6 +22,7 @@ "expo-secure-store": "^13.0.2", "expo-status-bar": "~1.12.1", "react": "18.2.0", + "react-dom": "18.2.0", "react-native": "0.74.5", "react-native-auth0": "^3.2.1", "react-native-quick-crypto": "^0.7.5", @@ -18228,6 +18229,26 @@ } } }, + "node_modules/react-dom": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.2.0.tgz", + "integrity": "sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==", + "dependencies": { + "loose-envify": "^1.1.0", + "scheduler": "^0.23.0" + }, + "peerDependencies": { + "react": "^18.2.0" + } + }, + "node_modules/react-dom/node_modules/scheduler": { + "version": "0.23.2", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.23.2.tgz", + "integrity": "sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ==", + "dependencies": { + "loose-envify": "^1.1.0" + } + }, "node_modules/react-is": { "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", diff --git a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package.json b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package.json index 7918f718..8d10bc6d 100644 --- a/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package.json +++ b/mpc-core-kit-react-native/mpc-core-kit-rn-expo-auth0/package.json @@ -27,7 +27,8 @@ "react-native-auth0": "^3.2.1", "react-native-quick-crypto": "^0.7.5", "react-native-webview": "13.8.6", - "react-native-react-bridge": "^0.12.1" + "react-native-react-bridge": "^0.12.1", + "react-dom": "18.2.0" }, "devDependencies": { "@types/react-native": "^0.72.8",