Skip to content

Commit

Permalink
feat!: use react-native-test-app in default example/ app
Browse files Browse the repository at this point in the history
  • Loading branch information
szymonrybczak committed Jun 27, 2024
1 parent 71f3874 commit c61bb71
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,22 @@ export default async function generateExampleApp({
const directory = path.join(dest, 'example');
const args =
type === 'native'
? // `npx react-native init <projectName> --directory example --skip-install`
? // `npx --package react-native-test-app@latest init --name ${projectName}Example --destination example --version ${reactNativeVersion}`
[
'react-native@latest',
'--package',
`react-native-test-app@latest`,
'init',
'--name',
`${projectName}Example`,
'--directory',
`--destination`,
directory,
'--version',
reactNativeVersion,
'--skip-install',
'--npm',
...(reactNativeVersion !== 'latest'
? ['--version', reactNativeVersion]
: []),
'--platform',
'ios',
'--platform',
'android',
]
: // `npx create-expo-app example --no-install --template blank`
[
Expand All @@ -87,7 +92,6 @@ export default async function generateExampleApp({
];

await spawn('npx', args, {
cwd: dest,
env: { ...process.env, npm_config_yes: 'true' },
});

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const path = require('path');
const pak = require('../package.json');
const { configureProjects } = require('react-native-test-app');

module.exports = {
project: configureProjects({
android: {
sourceDir: 'android',
},
ios: {
sourceDir: 'ios',
},
}),
dependencies: {
[pak.name]: {
root: path.join(__dirname, '..'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
const path = require('path');
const pak = require('../package.json');
const { configureProjects } = require('react-native-test-app');

module.exports = {
project: configureProjects({
android: {
sourceDir: 'android',
},
ios: {
sourceDir: 'ios',
},
}),
dependencies: {
[pak.name]: {
root: path.join(__dirname, '..'),
Expand Down

0 comments on commit c61bb71

Please sign in to comment.