File tree Expand file tree Collapse file tree 3 files changed +30
-8
lines changed
packages/create-react-native-library
native-common-example/example Expand file tree Collapse file tree 3 files changed +30
-8
lines changed Original file line number Diff line number Diff line change @@ -65,17 +65,22 @@ export default async function generateExampleApp({
65
65
const directory = path . join ( dest , 'example' ) ;
66
66
const args =
67
67
type === 'native'
68
- ? // `npx react-native init < projectName> --directory example --skip-install `
68
+ ? // `npx --package react-native-test-app@latest init --name ${ projectName}Example --destination example --version ${reactNativeVersion} `
69
69
[
70
- 'react-native@latest' ,
70
+ '--package' ,
71
+ `react-native-test-app@latest` ,
71
72
'init' ,
73
+ '--name' ,
72
74
`${ projectName } Example` ,
73
- '--directory' ,
75
+ `--destination` ,
74
76
directory ,
75
- '--version' ,
76
- reactNativeVersion ,
77
- '--skip-install' ,
78
- '--npm' ,
77
+ ...( reactNativeVersion !== 'latest'
78
+ ? [ '--version' , reactNativeVersion ]
79
+ : [ ] ) ,
80
+ '--platform' ,
81
+ 'ios' ,
82
+ '--platform' ,
83
+ 'android' ,
79
84
]
80
85
: // `npx create-expo-app example --no-install --template blank`
81
86
[
@@ -87,7 +92,6 @@ export default async function generateExampleApp({
87
92
] ;
88
93
89
94
await spawn ( 'npx' , args , {
90
- cwd : dest ,
91
95
env : { ...process . env , npm_config_yes : 'true' } ,
92
96
} ) ;
93
97
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
2
const pak = require ( '../package.json' ) ;
3
+ const { configureProjects } = require ( 'react-native-test-app' ) ;
3
4
4
5
module . exports = {
6
+ project : configureProjects ( {
7
+ android : {
8
+ sourceDir : 'android' ,
9
+ } ,
10
+ ios : {
11
+ sourceDir : 'ios' ,
12
+ } ,
13
+ } ) ,
5
14
dependencies : {
6
15
[ pak . name ] : {
7
16
root : path . join ( __dirname , '..' ) ,
Original file line number Diff line number Diff line change 1
1
const path = require ( 'path' ) ;
2
2
const pak = require ( '../package.json' ) ;
3
+ const { configureProjects } = require ( 'react-native-test-app' ) ;
3
4
4
5
module . exports = {
6
+ project : configureProjects ( {
7
+ android : {
8
+ sourceDir : 'android' ,
9
+ } ,
10
+ ios : {
11
+ sourceDir : 'ios' ,
12
+ } ,
13
+ } ) ,
5
14
dependencies : {
6
15
[ pak . name ] : {
7
16
root : path . join ( __dirname , '..' ) ,
You can’t perform that action at this time.
0 commit comments