Skip to content

Commit 80075ca

Browse files
committed
refactor: rm module resolver
1 parent ce2ee49 commit 80075ca

19 files changed

+25
-44
lines changed

babel.config.js

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,6 @@
11
module.exports = {
22
presets: ['module:metro-react-native-babel-preset'],
33
plugins: [
4-
[
5-
'module-resolver',
6-
{
7-
root: './',
8-
extensions: ['.tsx', '.ts', '.js', '.json'],
9-
alias: {
10-
'@/utils': './src/utils',
11-
},
12-
},
13-
],
144
'react-native-reanimated/plugin',
155
'inline-dotenv',
166
'@babel/plugin-syntax-dynamic-import',

exampleExpo/babel.config.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,9 @@
1-
const path = require('path');
2-
const pak = require('../package.json');
3-
41
module.exports = function (api) {
52
api.cache(true);
63

74
return {
85
presets: ['babel-preset-expo'],
96
plugins: [
10-
[
11-
'module-resolver',
12-
{
13-
extensions: ['.tsx', '.ts', '.js', '.json'],
14-
alias: {
15-
[pak.name]: path.join(__dirname, '..', pak.main),
16-
},
17-
},
18-
],
197
'react-native-reanimated/plugin',
208
'inline-dotenv',
219
'@babel/plugin-syntax-dynamic-import',

exampleExpo/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@
4747
"@types/react": "~17.0.21",
4848
"@types/react-native-snap-carousel": "^3.8.5",
4949
"babel-plugin-inline-dotenv": "^1.6.0",
50-
"babel-plugin-module-resolver": "^4.1.0",
5150
"babel-plugin-react-native-web": "^0.17.5",
5251
"babel-preset-expo": "9.0.2",
5352
"expo-cli": "^5.4.10",

exampleExpo/src/blur-parallax/parallax.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Extrapolate, interpolate } from 'react-native-reanimated';
2-
import type { ComputedDirectionTypes } from 'src/types';
2+
import type { IComputedDirectionTypes } from 'react-native-reanimated-carousel';
33

44
type TBaseConfig = {
55
size: number;
@@ -24,7 +24,7 @@ export interface ILayoutConfig {
2424
parallaxAdjacentItemScale?: number;
2525
}
2626

27-
export type TParallaxModeProps = ComputedDirectionTypes<{
27+
export type TParallaxModeProps = IComputedDirectionTypes<{
2828
/**
2929
* Carousel Animated transitions.
3030
*/

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "3.0.3",
44
"description": "Simple carousel component.fully implemented using Reanimated 2.Infinitely scrolling, very smooth.",
55
"main": "lib/commonjs/index",
6+
"react-native": "src/index.tsx",
67
"types": "lib/typescript/index.d.ts",
78
"source": "src/index",
89
"files": [

src/hooks/useCarouselController.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ import type {
1111
TCarouselProps,
1212
WithTimingAnimation,
1313
} from '../types';
14-
import { dealWithAnimation } from '@/utils/dealWithAnimation';
15-
import { convertToSharedIndex } from '@/utils/computedWithAutoFillData';
16-
import { round } from '@/utils/log';
14+
import { dealWithAnimation } from '../utils/dealWithAnimation';
15+
import { convertToSharedIndex } from '../utils/computedWithAutoFillData';
16+
import { round } from '../utils/log';
1717

1818
interface IOpts {
1919
loop: boolean;

src/hooks/useInitProps.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { computedFillDataWithAutoFillData } from '@/utils/computedWithAutoFillData';
1+
import { computedFillDataWithAutoFillData } from '../utils/computedWithAutoFillData';
22
import React from 'react';
33
import type { TCarouselProps } from '../types';
44

src/hooks/useLayoutConfig.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import type { TAnimationStyle } from 'src/layouts/BaseLayout';
2+
import type { TAnimationStyle } from '../layouts/BaseLayout';
33
import { Layouts } from '../layouts';
44
import type { TInitializeCarouselProps } from './useInitProps';
55

src/hooks/useOnProgressChange.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import Animated, {
22
runOnJS,
33
useAnimatedReaction,
44
} from 'react-native-reanimated';
5-
import { computedOffsetXValueWithAutoFillData } from '@/utils/computedWithAutoFillData';
5+
import { computedOffsetXValueWithAutoFillData } from '../utils/computedWithAutoFillData';
66
import type { TCarouselProps } from '../types';
77

88
export function useOnProgressChange(

src/hooks/usePropsErrorBoundary.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import type { TCarouselProps } from 'src/types';
2+
import type { TCarouselProps } from '../types';
33

44
export function usePropsErrorBoundary(props: TCarouselProps) {
55
React.useEffect(() => {

0 commit comments

Comments
 (0)