Skip to content

Commit 236208b

Browse files
committed
fix: reconfigures the whole project to resolve the resolution error while installed from npm
1 parent 411b370 commit 236208b

8 files changed

Lines changed: 281 additions & 12 deletions

File tree

example/app/(tabs)/_layout.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Ionicons } from "@expo/vector-icons";
22
import { Tabs } from "expo-router";
33
import React from "react";
4-
// import { ExpandBarTab } from "react-native-floating-tab";
54

65
import { Colors } from "@/constants/Colors";
76
import { useColorScheme } from "@/hooks/useColorScheme";
@@ -17,11 +16,11 @@ export default function TabLayout() {
1716
}}
1817
initialRouteName="index"
1918
backBehavior="history"
20-
// tabBar={props => <ExpandBarTab {...props} />}
2119
// tabBar={props => <RollingBallTab {...props} />}
2220
// tabBar={props => <SharpCurvyTab {...props} />}
2321
// tabBar={props => <SlideBarTab {...props} />}
2422
// tabBar={props => <ElevatedTab {...props} />}
23+
// tabBar={props => <ExpandBarTab {...props} />}
2524
>
2625
<Tabs.Screen
2726
name="calendar"

example/app/_layout.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useEffect } from "react";
66
import "react-native-reanimated";
77

88
import { useColorScheme } from "@/hooks/useColorScheme";
9+
import { GestureHandlerRootView } from "react-native-gesture-handler";
910

1011
// Prevent the splash screen from auto-hiding before asset loading is complete.
1112
SplashScreen.preventAutoHideAsync();

example/babel.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ module.exports = function (api) {
22
api.cache(true);
33
return {
44
presets: ["babel-preset-expo"],
5+
plugins: ["react-native-reanimated/plugin"],
56
};
67
};

example/metro.config.js

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Learn more https://docs.expo.io/guides/customizing-metro
2+
const { getDefaultConfig } = require("expo/metro-config");
3+
4+
/** @type {import('expo/metro-config').MetroConfig} */
5+
// const config = getDefaultConfig(__dirname);
6+
7+
// module.exports = config;
8+
9+
module.exports = (async () => {
10+
let defaultConfig = await getDefaultConfig(__dirname);
11+
12+
const { transformer, resolver } = defaultConfig;
13+
14+
defaultConfig.transformer = {
15+
...transformer,
16+
babelTransformerPath: require.resolve("react-native-svg-transformer"),
17+
};
18+
19+
defaultConfig.resolver = {
20+
...resolver,
21+
assetExts: resolver.assetExts.filter(ext => ext !== "svg"),
22+
sourceExts: [...resolver.sourceExts, "svg"],
23+
};
24+
25+
defaultConfig.resolver.resolverMainFields.unshift("sbmodern");
26+
return defaultConfig;
27+
})();

example/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
},
1717
"dependencies": {
1818
"@expo/vector-icons": "^14.0.2",
19+
"@react-navigation/bottom-tabs": "^6.6.1",
1920
"@react-navigation/native": "^6.0.2",
2021
"expo": "~51.0.28",
2122
"expo-constants": "~16.0.2",
@@ -43,6 +44,8 @@
4344
"@types/react-test-renderer": "^18.0.7",
4445
"jest": "^29.2.1",
4546
"jest-expo": "~51.0.3",
47+
"metro": "^0.80.12",
48+
"react-native-svg-transformer": "^1.5.0",
4649
"react-test-renderer": "18.2.0",
4750
"typescript": "~5.3.3"
4851
},

example/yarn.lock

Lines changed: 240 additions & 7 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
"main": "build/index.js",
66
"types": "build/index.d.ts",
77
"files": [
8-
"build",
9-
"src"
8+
"build/**/*",
9+
"src/**/*"
1010
],
11+
"type": "module",
1112
"scripts": {
1213
"build": "expo-module build",
1314
"lint": "expo-module lint -- --fix",
@@ -19,6 +20,9 @@
1920
"eslintConfig": {
2021
"extends": "universe/native"
2122
},
23+
"publishConfig": {
24+
"registry": "https://registry.npmjs.org/"
25+
},
2226
"keywords": [
2327
"react-native",
2428
"expo",
@@ -65,6 +69,7 @@
6569
},
6670
"peerDependencies": {
6771
"@react-navigation/native": "*",
72+
"@react-navigation/bottom-tabs": "*",
6873
"expo": "*",
6974
"react": "*",
7075
"react-native": "*",

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"jsx": "react-native"
1313
},
1414

15-
"include": ["./src"],
15+
"include": ["./src/**/*"],
1616
"exclude": ["**/__mocks__/*", "**/__tests__/*"]
1717
}

0 commit comments

Comments
 (0)