e30e75b5d4
Changesets / Create Version PR (push) Has been cancelled
Deploy Shadcn Registry / Deploy Production (push) Has been cancelled
Template Metrics / LOC + Bundle Size (push) Has been cancelled
Code Quality / Oxlint + Oxfmt (push) Has been cancelled
Code Quality / Template Sync (push) Has been cancelled
Code Quality / Build Changed Packages (push) Has been cancelled
Code Quality / Test Changed Packages (push) Has been cancelled
Deploy Expo Example / Deploy Production (push) Has been cancelled
Deploy Ink Example / Deploy Production (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-stream, 3.12) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.10) (push) Has been cancelled
Python Tests / pytest (assistant-ui-sync-server-api, 3.12) (push) Has been cancelled
44 lines
1.2 KiB
JavaScript
44 lines
1.2 KiB
JavaScript
const { getDefaultConfig } = require("expo/metro-config");
|
|
const { withAui } = require("@assistant-ui/metro");
|
|
const path = require("node:path");
|
|
|
|
const projectRoot = __dirname;
|
|
const monorepoRoot = path.resolve(projectRoot, "../..");
|
|
|
|
const config = getDefaultConfig(projectRoot);
|
|
|
|
// Watch all files within the monorepo
|
|
config.watchFolders = [monorepoRoot];
|
|
|
|
// Enable symlinks support for pnpm
|
|
config.resolver.unstable_enableSymlinks = true;
|
|
|
|
// Let Metro know where to resolve packages
|
|
config.resolver.nodeModulesPaths = [
|
|
path.resolve(projectRoot, "node_modules"),
|
|
path.resolve(monorepoRoot, "node_modules"),
|
|
];
|
|
|
|
// Force resolving shared dependencies from the app's node_modules
|
|
config.resolver.resolveRequest = (context, moduleName, platform) => {
|
|
if (
|
|
moduleName === "react" ||
|
|
moduleName === "react-native" ||
|
|
moduleName.startsWith("react/") ||
|
|
moduleName.startsWith("react-native/")
|
|
) {
|
|
return context.resolveRequest(
|
|
{
|
|
...context,
|
|
originModulePath: path.resolve(projectRoot, "package.json"),
|
|
},
|
|
moduleName,
|
|
platform,
|
|
);
|
|
}
|
|
|
|
return context.resolveRequest(context, moduleName, platform);
|
|
};
|
|
|
|
module.exports = withAui(config);
|