diff --git a/metro.config.js b/metro.config.js index d11ddf8..944ec02 100644 --- a/metro.config.js +++ b/metro.config.js @@ -1,52 +1,3 @@ -const path = require('path'); const { getDefaultConfig } = require('expo/metro-config'); -const projectRoot = __dirname; -const packageRoot = path.resolve(projectRoot, '..', 'mobile-ink'); -const appNodeModules = path.resolve(projectRoot, 'node_modules'); - -const peerDependencyAliases = [ - '@shopify/react-native-skia', - 'react', - 'react-native', - 'react-native-gesture-handler', - 'react-native-reanimated', - 'react-native-worklets', -]; - -const escapedPackageRoot = packageRoot.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); -const blockedRootPeerDependencies = peerDependencyAliases.map( - (packageName) => - new RegExp( - `${escapedPackageRoot}/node_modules/${packageName.replace( - '/', - '\\/', - )}(/.*)?$`, - ), -); - -const config = getDefaultConfig(projectRoot); -const existingBlockList = config.resolver?.blockList - ? Array.isArray(config.resolver.blockList) - ? config.resolver.blockList - : [config.resolver.blockList] - : []; - -config.watchFolders = [...(config.watchFolders || []), packageRoot]; -config.resolver = { - ...config.resolver, - blockList: [...existingBlockList, ...blockedRootPeerDependencies], - extraNodeModules: { - ...(config.resolver?.extraNodeModules || {}), - '@mathnotes/mobile-ink': packageRoot, - ...Object.fromEntries( - peerDependencyAliases.map((packageName) => [ - packageName, - path.resolve(appNodeModules, packageName), - ]), - ), - }, - nodeModulesPaths: [appNodeModules], -}; - -module.exports = config; +module.exports = getDefaultConfig(__dirname); diff --git a/tsconfig.json b/tsconfig.json index 64adbb7..d008812 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,12 +6,6 @@ "paths": { "@/*": [ "src/*" - ], - "@mathnotes/mobile-ink": [ - "../mobile-ink/src/index.ts" - ], - "@mathnotes/mobile-ink/*": [ - "../mobile-ink/src/*" ] } },