-
-
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.
added withRnvRNConfig, added missing files to template
- Loading branch information
1 parent
8d2b938
commit 68b1b06
Showing
19 changed files
with
345 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
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
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
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
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
64 changes: 64 additions & 0 deletions
64
packages/engine-rn-windows/src/adapters/rnConfigAdapter.ts
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
Oops, something went wrong.