Skip to content

Commit 19e3c49

Browse files
Fix Mock exports for external consumers (#8215)
* Move `Mock` directory into `src` and update imports accordingly * Remove unused `Mock` file and update related dependencies in `jest.config.js` * Update package.json to add `react-native` and `source` mappings for `./Mock` * Reorder and update export mappings in package.json for consistency --------- Co-authored-by: mark.dev <50657916+markdevocht@users.noreply.github.com>
1 parent d5ec486 commit 19e3c49

32 files changed

Lines changed: 31 additions & 35 deletions

Mock.ts

Lines changed: 0 additions & 1 deletion
This file was deleted.

jest.config.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ module.exports = {
88
},
99
roots: [
1010
'<rootDir>/src/',
11-
'<rootDir>/Mock/',
1211
'<rootDir>/playground/src/',
1312
'<rootDir>/integration/',
1413
'<rootDir>/scripts/',
@@ -21,7 +20,7 @@ module.exports = {
2120
'^react-native$': '<rootDir>/node_modules/react-native',
2221
'^react-native-gesture-handler$': '<rootDir>/node_modules/react-native-gesture-handler',
2322
'^react-native-webview$': '<rootDir>/__mocks__/react-native-webview.js',
24-
'react-native-navigation/Mock': '<rootDir>/Mock/index',
23+
'react-native-navigation/Mock': '<rootDir>/src/Mock/index',
2524
'react-native-navigation': '<rootDir>/src',
2625
'^src$': '<rootDir>/src',
2726
'\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$':

package.json

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,20 @@
2020
"rnn-link": "./autolink/postlink/run.js"
2121
},
2222
"main": "./lib/module/index.js",
23-
"types": "./lib/typescript/src/index.d.ts",
23+
"types": "./lib/typescript/index.d.ts",
2424
"react-native": "./src/index.ts",
2525
"exports": {
2626
".": {
27-
"react-native": "./src/index.ts",
27+
"types": "./lib/typescript/index.d.ts",
28+
"default": "./lib/module/index.js",
2829
"source": "./src/index.ts",
29-
"types": "./lib/typescript/src/index.d.ts",
30-
"default": "./lib/module/index.js"
30+
"react-native": "./src/index.ts"
31+
},
32+
"./Mock": {
33+
"types": "./lib/typescript/Mock/index.d.ts",
34+
"default": "./lib/module/Mock/index.js",
35+
"source": "./src/Mock/index.ts",
36+
"react-native": "./src/Mock/index.ts"
3137
},
3238
"./package.json": "./package.json"
3339
},
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import { View, Text, TouchableOpacity, Image, ImageURISource } from 'react-native';
3-
import { Navigation, ImageResource } from 'src';
3+
import { Navigation, ImageResource } from 'react-native-navigation';
44
import { ComponentProps } from '../ComponentProps';
55
import { VISIBLE_SCREEN_TEST_ID } from '../constants';
66
import { LayoutStore } from '../Stores/LayoutStore';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React, { Component } from 'react';
22
import { Button, TouchableOpacity } from 'react-native';
3-
import { Navigation, OptionsTopBarButton } from 'src';
3+
import { Navigation, OptionsTopBarButton } from 'react-native-navigation';
44
import { events } from '../Stores/EventsStore';
55

66
interface ButtonProps {

0 commit comments

Comments
 (0)