-
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1155 from flexn-io/feat/withRnvRNConfig
added withRnvRNConfig, added missing files to template
- Loading branch information
Showing
17 changed files
with
154 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const withRNVBabel = (cnf: any) => { | ||
const plugins = cnf?.plugins || []; | ||
|
||
return { | ||
retainLines: true, | ||
presets: ['module:metro-react-native-babel-preset'], | ||
...cnf, | ||
plugins: [ | ||
[ | ||
require.resolve('babel-plugin-module-resolver'), | ||
{ | ||
root: [process.env.RNV_MONO_ROOT || '.'], | ||
}, | ||
], | ||
...plugins, | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const withRNVBabel = (cnf: any) => { | ||
const plugins = cnf?.plugins || []; | ||
|
||
return { | ||
retainLines: true, | ||
presets: ['module:babel-preset-expo'], | ||
...cnf, | ||
plugins: [ | ||
[ | ||
require.resolve('babel-plugin-module-resolver'), | ||
{ | ||
root: [process.env.RNV_MONO_ROOT || '.'], | ||
}, | ||
], | ||
...plugins, | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
export const withRNVBabel = (cnf: any) => { | ||
const plugins = cnf?.plugins || []; | ||
|
||
return { | ||
retainLines: true, | ||
presets: ['module:metro-react-native-babel-preset'], | ||
...cnf, | ||
plugins: [ | ||
[ | ||
require.resolve('babel-plugin-module-resolver'), | ||
{ | ||
root: [process.env.RNV_MONO_ROOT || '.'], | ||
}, | ||
], | ||
...plugins, | ||
], | ||
}; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import merge from 'deepmerge'; | ||
|
||
const getApplicationId = () => { | ||
const appId = process.env.RNV_APP_ID; | ||
return appId; | ||
}; | ||
|
||
const getAppFolderRelative = () => { | ||
const pth = process.env.RNV_APP_BUILD_DIR; | ||
if (pth) { | ||
return pth; | ||
} else { | ||
const cwd = process.cwd(); | ||
if (cwd.includes('platformBuilds/')) { | ||
const dir = process.cwd().split('platformBuilds/')[1]; | ||
|
||
return `platformBuilds/${dir}`; | ||
} else { | ||
return undefined; | ||
} | ||
} | ||
}; | ||
|
||
const getReactNativePathRelative = () => { | ||
const rnPath = process.env.RNV_REACT_NATIVE_PATH; | ||
return rnPath; | ||
}; | ||
|
||
const getProjectRoot = () => { | ||
//env: PROJECT_ROOT | ||
const rnPath = process.env.RNV_PROJECT_ROOT; | ||
return rnPath; | ||
}; | ||
|
||
export const withRNVRNConfig = (config: any) => { | ||
const cnfRnv = { | ||
root: getProjectRoot(), | ||
//Required to support 2 react native instances | ||
reactNativePath: getReactNativePathRelative(), | ||
dependencies: { | ||
// Required for Expo CLI to be used with platforms (such as Apple TV) that are not supported in Expo SDK | ||
expo: { | ||
platforms: { | ||
android: null, | ||
ios: null, | ||
macos: null, | ||
}, | ||
}, | ||
}, | ||
project: { | ||
ios: { | ||
sourceDir: getAppFolderRelative(), | ||
}, | ||
android: { | ||
appName: 'app', | ||
sourceDir: getAppFolderRelative(), | ||
packageName: getApplicationId(), | ||
}, | ||
}, | ||
}; | ||
|
||
const cnf = merge(cnfRnv, config); | ||
return cnf; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from './common'; | ||
export * from './androidRunner'; | ||
export * from './iosRunner'; | ||
export * from './adapters'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,6 +89,7 @@ PLATFORMS | |
ruby | ||
|
||
DEPENDENCIES | ||
activesupport (~> 7.0, <= 7.0.8) | ||
cocoapods (~> 1.12) | ||
|
||
RUBY VERSION | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.