Skip to content

Commit

Permalink
add another workaround to example metro.config.js
Browse files Browse the repository at this point in the history
for an issue with symlinks encountered
starting with metro@0.55 / React Native 0.61
(not needed for React Native 0.60 / metro@0.54)

add and update descriptive comments in example metro.config.js
  • Loading branch information
brodycj committed Apr 7, 2020
1 parent 6ea762f commit 9e1b6e8
Show file tree
Hide file tree
Showing 9 changed files with 208 additions and 55 deletions.
31 changes: 24 additions & 7 deletions templates/example.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,18 +116,35 @@ module.exports = [{
})();
`
}, {
// metro.config.js workaround needed in case of `exampleFileLinkage: false`:
// metro.config.js workarounds needed in case of `exampleFileLinkage: false`:
name: ({ exampleName, exampleFileLinkage }) =>
exampleFileLinkage ? undefined : `${exampleName}/metro.config.js`,
content: ({ moduleName, exampleName }) => `// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,31 @@ content:
content:
--------
// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -791,14 +791,31 @@ content:
content:
--------
// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -401,14 +401,31 @@ sdk.dir=/Users/{username}/Library/Android/sdk
content:
--------
// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,31 @@ content:
content:
--------
// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -787,14 +787,31 @@ content:
content:
--------
// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,31 @@ RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnu
Object {
"outputFileName": "react-native-alice-bobbi/example/metro.config.js",
"theContent": "// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,31 @@ RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnu
Object {
"outputFileName": "react-native-alice-bobbi/example/metro.config.js",
"theContent": "// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,14 +847,31 @@ RCT_EXPORT_METHOD(sampleMethod:(NSString *)stringArgument numberParameter:(nonnu
Object {
"outputFileName": "react-native-alice-bobbi/example/metro.config.js",
"theContent": "// metro.config.js
// with workaround solution to the issue with symlinks
// (see <https://github.com/facebook/metro/issues/1>)
//
// with multiple workarounds for this issue with symlinks:
// https://github.com/facebook/metro/issues/1
//
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointers to multiple workaround solutions here:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
//
// see also this discussion:
// https://github.com/brodybits/create-react-native-module/issues/232
const path = require('path')
module.exports = {
// quick workaround solution to the issue with symlinks,
// with thanks to @johnryan (<https://github.com/johnryan>)
// for the pointer in this comment:
// https://github.com/facebook/metro/issues/1#issuecomment-541642857
// workaround for an issue with symlinks encountered starting with
// metro@0.55 / React Native 0.61
// (not needed with React Native 0.60 / metro@0.54)
resolver: {
extraNodeModules: new Proxy(
{},
{ get: (_, name) => path.resolve('.', 'node_modules', name) }
)
},
// quick workaround for another issue with symlinks
watchFolders: ['.', '..']
}
",
Expand Down

0 comments on commit 9e1b6e8

Please sign in to comment.