Add Metro config for monorepo module resolution

Metro couldn't resolve hoisted packages (@maplibre, @gorhom, etc.)
because it only looked in apps/mobile/node_modules. Configure
watchFolders and nodeModulesPaths to include the monorepo root.

Also revert MapLibre fallback — direct import is correct, the issue
was Metro resolution, not a missing native module.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ullrich Schäfer 2026-04-15 07:39:04 +02:00
parent 58bff065ff
commit 2a94af5655
No known key found for this signature in database
GPG key ID: A32FF691A0F752D9
2 changed files with 19 additions and 10 deletions

View file

@ -1,18 +1,9 @@
import { useRef, useCallback } from "react";
import { StyleSheet, View, Text } from "react-native";
import MapLibreGL from "@maplibre/maplibre-react-native";
import type { Waypoint } from "@trails-cool/types";
import type { RouteSegment } from "./use-route-editor";
import type MapLibreRN from "@maplibre/maplibre-react-native";
let MapLibreGL: typeof MapLibreRN | null = null;
try {
// eslint-disable-next-line @typescript-eslint/no-require-imports
MapLibreGL = require("@maplibre/maplibre-react-native").default;
} catch {
// Native module not available — will show fallback UI
}
const OSM_STYLE = {
version: 8 as const,
sources: {