Skip to content

Commit 78979fb

Browse files
committed
feat: upgrade to react nvigation 7
1 parent dc81d13 commit 78979fb

File tree

16 files changed

+7701
-10226
lines changed

16 files changed

+7701
-10226
lines changed

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18
1+
v22.18.0

.yarn/releases/yarn-4.0.1.cjs

Lines changed: 0 additions & 893 deletions
This file was deleted.

.yarn/releases/yarn-4.9.2.cjs

Lines changed: 942 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
nmHoistingLimits: workspaces
2+
13
nodeLinker: node-modules
2-
nmHoistingLimits: 'workspaces'
34

4-
yarnPath: .yarn/releases/yarn-4.0.1.cjs
5+
yarnPath: .yarn/releases/yarn-4.9.2.cjs

babel.config.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
overrides: [
3+
{
4+
exclude: /\/node_modules\//,
5+
presets: ['module:react-native-builder-bob/babel-preset'],
6+
},
7+
{
8+
include: /\/node_modules\//,
9+
presets: ['module:@react-native/babel-preset'],
10+
},
11+
],
312
};

eslint.config.mjs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { defineConfig, globalIgnores } from 'eslint/config';
2+
import { jest, react, recommended } from 'eslint-config-satya164';
3+
import sort from 'eslint-plugin-simple-import-sort';
4+
5+
export default defineConfig([
6+
recommended,
7+
react,
8+
jest,
9+
10+
globalIgnores([
11+
'**/node_modules/',
12+
'**/coverage/',
13+
'**/dist/',
14+
'**/lib/',
15+
'**/.expo/',
16+
'**/.yarn/',
17+
'**/.vscode/',
18+
]),
19+
20+
{
21+
plugins: {
22+
'simple-import-sort': sort,
23+
},
24+
},
25+
]);

example/app.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
{
2-
"name": "react-navigation-native-modal-example",
3-
"displayName": "React Navigation Native Modal Example",
42
"expo": {
53
"name": "react-navigation-native-modal-example",
64
"slug": "react-navigation-native-modal-example",
75
"description": "Example app for react-navigation-native-modal",
8-
"privacy": "public",
96
"version": "1.0.0",
107
"platforms": [
118
"ios",

example/babel.config.js

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
11
const path = require('path');
2-
const pak = require('../package.json');
2+
const { getConfig } = require('react-native-builder-bob/babel-config');
3+
const pkg = require('../package.json');
34

4-
module.exports = function (api) {
5-
api.cache(true);
5+
const root = path.resolve(__dirname, '..');
66

7-
return {
7+
module.exports = getConfig(
8+
{
89
presets: ['babel-preset-expo'],
9-
plugins: [
10-
[
11-
'module-resolver',
12-
{
13-
alias: {
14-
// For development, we want to alias the library to the source
15-
[pak.name]: path.join(__dirname, '..', pak.source),
16-
},
17-
},
18-
],
19-
],
20-
};
21-
};
10+
},
11+
{ root, pkg }
12+
);

example/metro.config.js

Lines changed: 6 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,20 @@
11
const path = require('path');
2-
const escape = require('escape-string-regexp');
32
const { getDefaultConfig } = require('@expo/metro-config');
4-
const exclusionList = require('metro-config/src/defaults/exclusionList');
5-
const pak = require('../package.json');
3+
const { withMetroConfig } = require('react-native-monorepo-config');
64

75
const root = path.resolve(__dirname, '..');
8-
const modules = Object.keys({ ...pak.peerDependencies });
9-
10-
const defaultConfig = getDefaultConfig(__dirname);
116

127
/**
138
* Metro configuration
149
* https://facebook.github.io/metro/docs/configuration
1510
*
1611
* @type {import('metro-config').MetroConfig}
1712
*/
18-
const config = {
19-
...defaultConfig,
20-
21-
projectRoot: __dirname,
22-
watchFolders: [root],
23-
24-
// We need to make sure that only one version is loaded for peerDependencies
25-
// So we block them at the root, and alias them to the versions in example's node_modules
26-
resolver: {
27-
...defaultConfig.resolver,
28-
29-
blacklistRE: exclusionList(
30-
modules.map(
31-
(m) =>
32-
new RegExp(`^${escape(path.join(root, 'node_modules', m))}\\/.*$`)
33-
)
34-
),
13+
const config = withMetroConfig(getDefaultConfig(__dirname), {
14+
root,
15+
dirname: __dirname,
16+
});
3517

36-
extraNodeModules: modules.reduce((acc, name) => {
37-
acc[name] = path.join(__dirname, 'node_modules', name);
38-
return acc;
39-
}, {}),
40-
},
41-
};
18+
config.resolver.unstable_enablePackageExports = true;
4219

4320
module.exports = config;

example/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,18 @@
1111
"test": "jest"
1212
},
1313
"dependencies": {
14-
"@react-navigation/native": "^6.1.9",
15-
"expo": "^49.0.16",
16-
"react": "18.2.0",
17-
"react-native": "0.72.6"
14+
"@react-navigation/native": "^7.1.17",
15+
"expo": "^53.0.20",
16+
"react": "19.0.0",
17+
"react-native": "0.79.5",
18+
"react-navigation-native-modal": "workspace:^"
1819
},
1920
"devDependencies": {
20-
"@babel/core": "^7.23.2",
21-
"@babel/runtime": "^7.23.2",
22-
"@expo/metro-config": "^0.10.7",
23-
"babel-plugin-module-resolver": "^5.0.0",
24-
"babel-preset-expo": "^9.8.0",
25-
"escape-string-regexp": "^4.0.0",
26-
"metro-config": "^0.80.0"
21+
"@babel/core": "^7.28.0",
22+
"@babel/runtime": "^7.28.2",
23+
"@expo/metro-config": "^0.20.17",
24+
"babel-preset-expo": "~13.0.0",
25+
"react-native-builder-bob": "^0.40.13",
26+
"react-native-monorepo-config": "^0.1.9"
2727
}
2828
}

0 commit comments

Comments
 (0)