-
-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(expo) : Update to Expo 50 (#795)
* chore: update to Expo 50 * fix: revert change in settings.json * chore(expo): update expo to latest stable * update more stuff, remove expo tsconfig * add transistive deps to auth-proxy * fix drizzle transistive dep * fix transistive deps for ui pacakge * downgrade auth * chore(expo): fix styles for expo app and enable dark/light mode * fix(expo): Remove unused import * fix(expo): Remove theme useEffect as it is not needed * split tw * fix import * nitpick glob --------- Co-authored-by: juliusmarminge <[email protected]>
- Loading branch information
1 parent
cf650c4
commit 7eeef16
Showing
26 changed files
with
1,362 additions
and
1,781 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,11 @@ | ||
/** @type {import("@babel/core").ConfigFunction} */ | ||
module.exports = function (api) { | ||
api.cache.forever(); | ||
|
||
api.cache(true); | ||
return { | ||
presets: [ | ||
["babel-preset-expo", { jsxImportSource: "nativewind" }], | ||
"nativewind/babel", | ||
], | ||
plugins: [ | ||
require.resolve("expo-router/babel"), | ||
require.resolve("react-native-reanimated/plugin"), | ||
], | ||
plugins: ["react-native-reanimated/plugin"], | ||
}; | ||
}; |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,55 @@ | ||
// Learn more: https://docs.expo.dev/guides/monorepos/ | ||
const { getDefaultConfig } = require("@expo/metro-config"); | ||
const { getDefaultConfig } = require("expo/metro-config"); | ||
const { FileStore } = require("metro-cache"); | ||
const { withNativeWind } = require("nativewind/metro"); | ||
|
||
const path = require("path"); | ||
|
||
const projectRoot = __dirname; | ||
const workspaceRoot = path.resolve(projectRoot, "../.."); | ||
module.exports = withTurborepoManagedCache( | ||
withMonorepoPaths( | ||
withNativeWind(getDefaultConfig(__dirname), { | ||
input: "./src/styles.css", | ||
configPath: "./tailwind.config.ts", | ||
}), | ||
), | ||
); | ||
|
||
// Create the default Metro config | ||
const config = getDefaultConfig(projectRoot, { isCSSEnabled: true }); | ||
/** | ||
* Add the monorepo paths to the Metro config. | ||
* This allows Metro to resolve modules from the monorepo. | ||
* | ||
* @see https://docs.expo.dev/guides/monorepos/#modify-the-metro-config | ||
* @param {import('expo/metro-config').MetroConfig} config | ||
* @returns {import('expo/metro-config').MetroConfig} | ||
*/ | ||
function withMonorepoPaths(config) { | ||
const projectRoot = __dirname; | ||
const workspaceRoot = path.resolve(projectRoot, "../.."); | ||
|
||
if (config.resolver) { | ||
// 1. Watch all files within the monorepo | ||
// #1 - Watch all files in the monorepo | ||
config.watchFolders = [workspaceRoot]; | ||
// 2. Let Metro know where to resolve packages and in what order | ||
|
||
// #2 - Resolve modules within the project's `node_modules` first, then all monorepo modules | ||
config.resolver.nodeModulesPaths = [ | ||
path.resolve(projectRoot, "node_modules"), | ||
path.resolve(workspaceRoot, "node_modules"), | ||
]; | ||
// 3. Force Metro to resolve (sub)dependencies only from the `nodeModulesPaths` | ||
config.resolver.disableHierarchicalLookup = true; | ||
|
||
return config; | ||
} | ||
|
||
// @ts-expect-error - FIXME: type is mismatching? | ||
module.exports = withNativeWind(config, { | ||
input: "./src/styles.css", | ||
configPath: "./tailwind.config.ts", | ||
}); | ||
/** | ||
* Move the Metro cache to the `node_modules/.cache/metro` folder. | ||
* This repository configured Turborepo to use this cache location as well. | ||
* If you have any environment variables, you can configure Turborepo to invalidate it when needed. | ||
* | ||
* @see https://turbo.build/repo/docs/reference/configuration#env | ||
* @param {import('expo/metro-config').MetroConfig} config | ||
* @returns {import('expo/metro-config').MetroConfig} | ||
*/ | ||
function withTurborepoManagedCache(config) { | ||
config.cacheStores = [ | ||
new FileStore({ root: path.join(__dirname, "node_modules/.cache/metro") }), | ||
]; | ||
return config; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.