Skip to content

Commit

Permalink
Update Example app to use RN 0.61 (#401)
Browse files Browse the repository at this point in the history
  • Loading branch information
kmagiera authored and osdnk committed Sep 25, 2019
1 parent cf4682a commit 79dda54
Show file tree
Hide file tree
Showing 6 changed files with 2,986 additions and 2,933 deletions.
8 changes: 8 additions & 0 deletions Example/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,19 @@ module.exports = api => {
return {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'@babel/plugin-transform-modules-commonjs',
[
'module-resolver',
{
alias: {
'react-native-reanimated': '../src/Animated',
react: './node_modules/react',
'react-native': './node_modules/react-native',
'@babel': './node_modules/@babel',
fbjs: './node_modules/fbjs',
'hoist-non-react-statics': './node_modules/hoist-non-react-statics',
invariant: './node_modules/invariant',
'prop-types': './node_modules/prop-types',
},
},
],
Expand Down
25 changes: 21 additions & 4 deletions Example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,38 @@
const blacklist = require('metro-config/src/defaults/blacklist');
const path = require('path');
const cwd = path.resolve(__dirname);

const glob = require('glob-to-regexp');

function getBlacklist() {
const nodeModuleDirs = [
glob(`${process.platform === 'win32' ? path.resolve(__dirname, '..').replace(/\\/g, '/') : path.resolve(__dirname, '..')}/node_modules/*`),
glob(`${process.platform === 'win32' ? path.resolve(__dirname).replace(/\\/g, '/') : path.resolve(__dirname)}/node_modules/metro/node_modules/fbjs/*`),
glob(`${path.resolve(__dirname, '..')}/node_modules/*`),
glob(`${path.resolve(__dirname, '..')}/e2e/*`),
glob(`${path.resolve(__dirname)}/node_modules/*/node_modules/fbjs/*`),
glob(
`${path.resolve(
__dirname
)}/node_modules/*/node_modules/hoist-non-react-statics/*`
),
glob(
`${path.resolve(
__dirname
)}/node_modules/react-native/node_modules/@babel/*`
),
];
return blacklist(nodeModuleDirs);
}

module.exports = {
resolver: {
blacklistRE: getBlacklist(),
providesModuleNodeModules: ['react-native', 'react', 'fbjs'],
},
watchFolders: [path.resolve(__dirname, '..')],
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
18 changes: 11 additions & 7 deletions Example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,27 @@
"lint": "eslint ."
},
"dependencies": {
"react": "16.8.6",
"react-native": "0.60.5",
"react": "16.9.0",
"react-native": "0.61.1",
"react-native-gesture-handler": "1.4.1",
"react-navigation": "2.17.0"
},
"devDependencies": {
"@babel/core": "^7.5.5",
"@babel/runtime": "^7.5.5",
"@babel/core": "^7.6.2",
"@babel/runtime": "^7.6.2",
"@react-native-community/eslint-config": "^0.0.5",
"babel-jest": "^24.8.0",
"babel-jest": "^24.9.0",
"babel-plugin-module-resolver": "^3.2.0",
"eslint": "^6.4.0",
"glob-to-regexp": "^0.4.0",
"jest": "^24.8.0",
"jest": "^24.9.0",
"metro-react-native-babel-preset": "^0.56.0",
"react-test-renderer": "16.8.6"
"react-test-renderer": "16.9.0"
},
"jest": {
"preset": "react-native"
},
"resolutions": {
"@babel/runtime": "7.6.0"
}
}
Loading

0 comments on commit 79dda54

Please sign in to comment.