Skip to content

Commit 46292bd

Browse files
authored
chore: properly remove module-resolver (#4947)
1 parent f5b5d75 commit 46292bd

20 files changed

Lines changed: 1017 additions & 153 deletions

example/babel.config.js

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,8 @@
1-
const path = require('path');
2-
3-
const pak = require('../package.json');
4-
51
module.exports = function (api) {
62
api.cache(true);
73

84
return {
95
presets: ['babel-preset-expo'],
10-
plugins: [
11-
[
12-
'module-resolver',
13-
{
14-
extensions: ['.tsx', '.ts', '.js', '.json'],
15-
alias: {
16-
[`${pak.name}/package.json`]: path.join(
17-
__dirname,
18-
'..',
19-
'package.json'
20-
),
21-
// For development, we want to alias the library to the source
22-
[pak.name]: path.join(__dirname, '..', 'src'),
23-
},
24-
},
25-
],
26-
['@babel/plugin-proposal-export-namespace-from'],
27-
['react-native-reanimated/plugin'],
28-
],
6+
plugins: [['@babel/plugin-proposal-export-namespace-from']],
297
};
308
};

example/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
"devDependencies": {
3939
"@babel/core": "^7.29.0",
4040
"babel-preset-expo": "~56.0.0",
41+
"react-native-builder-bob": "^0.41.0",
4142
"react-native-monorepo-config": "^0.3.4"
4243
},
4344
"engines": {

example/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"extends": "../tsconfig",
3-
}
3+
}

package.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@
22
"name": "react-native-paper",
33
"version": "5.15.1",
44
"description": "Material design for React Native",
5-
"main": "lib/commonjs/index.js",
6-
"module": "lib/module/index.js",
7-
"react-native": "src/index.tsx",
5+
"main": "lib/module/index.js",
86
"source": "src/index.tsx",
9-
"types": "lib/typescript/index.d.ts",
7+
"types": "lib/typescript/src/index.d.ts",
108
"files": [
119
"src",
1210
"lib",
@@ -96,7 +94,7 @@
9694
"react": "19.2.3",
9795
"react-dom": "19.2.3",
9896
"react-native": "0.85.3",
99-
"react-native-builder-bob": "^0.21.3",
97+
"react-native-builder-bob": "^0.41.0",
10098
"react-native-reanimated": "4.3.1",
10199
"react-native-safe-area-context": "5.7.0",
102100
"react-native-worklets": "0.8.3",
@@ -159,7 +157,6 @@
159157
"source": "src",
160158
"output": "lib",
161159
"targets": [
162-
"commonjs",
163160
"module",
164161
[
165162
"typescript",

scripts/generate-mappings.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ast = parser.parse(source, {
1818
],
1919
});
2020

21-
const index = packageJson.module;
21+
const index = packageJson.main;
2222
const relative = (value /* : string */) =>
2323
path.relative(root, path.resolve(path.dirname(index), value));
2424

src/components/Appbar/AppbarAction.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import * as React from 'react';
22
import type { Animated, StyleProp, View, ViewStyle } from 'react-native';
33

4-
import type { ThemeProp } from 'src/types';
5-
64
import { useInternalTheme } from '../../core/theming';
7-
import type { Theme } from '../../types';
5+
import type { Theme, ThemeProp } from '../../types';
86
import { forwardRef } from '../../utils/forwardRef';
97
import type { IconSource } from '../Icon';
108
import IconButton from '../IconButton/IconButton';

src/components/Card/CardActions.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import * as React from 'react';
22
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
33

4-
import type { ThemeProp } from 'src/types';
5-
64
import { CardActionChildProps } from './utils';
75
import { useInternalTheme } from '../../core/theming';
6+
import type { ThemeProp } from '../../types';
87

98
export type Props = React.ComponentPropsWithRef<typeof View> & {
109
/**

src/components/DataTable/DataTablePagination.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import * as React from 'react';
22
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
33

4-
import type { ThemeProp } from 'src/types';
5-
64
import { useLocale } from '../../core/locale';
75
import { useInternalTheme } from '../../core/theming';
6+
import type { ThemeProp } from '../../types';
87
import Button from '../Button/Button';
98
import IconButton from '../IconButton/IconButton';
109
import MaterialCommunityIcon from '../MaterialCommunityIcon';

src/components/Dialog/DialogActions.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import * as React from 'react';
22
import { StyleProp, StyleSheet, View, ViewStyle } from 'react-native';
33

4-
import type { ThemeProp } from 'src/types';
5-
64
import { DialogActionChildProps } from './utils';
75
import { useInternalTheme } from '../../core/theming';
6+
import type { ThemeProp } from '../../types';
87

98
export type Props = React.ComponentPropsWithRef<typeof View> & {
109
/**

src/components/Dialog/DialogIcon.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import * as React from 'react';
22
import { StyleSheet, View } from 'react-native';
33

4-
import type { ThemeProp } from 'src/types';
5-
64
import { useInternalTheme } from '../../core/theming';
5+
import type { ThemeProp } from '../../types';
76
import type { Theme } from '../../types';
87
import Icon, { IconSource } from '../Icon';
98

0 commit comments

Comments
 (0)