-
Notifications
You must be signed in to change notification settings - Fork 3
/
readme.js
75 lines (64 loc) · 1.64 KB
/
readme.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
const {includeIf} = require('./utils');
function getReadmeContents(answers, framework) {
return `# My Project
Describe your project here.
## Requirements
- [Node](https://nodejs.org)
- [Yarn 1.x](https://classic.yarnpkg.com/lang/en/)
${includeIf(
answers.framework === 'rn',
`- [Ruby](https://www.ruby-lang.org/)
- [Cocoapods](https://cocoapods.org/)
- [Android Studio](https://developer.android.com/studio) and/or [Xcode](https://developer.apple.com/xcode/)
`
)}${includeIf(
answers.framework === 'expo',
`
Optional:
- To run on Android Emulator, [Android Studio](https://developer.android.com/studio)
- To run on iOS Simulator, [Xcode](https://developer.apple.com/xcode/)
`
)}
## Installation
- Clone the repo
- Run \`yarn install\`
${includeIf(
answers.framework === 'rn',
`- Run \`cd ios && pod install\`
`
)}
Dependencies are locked with \`yarn.lock\`; please use \`yarn\` rather than \`npm\` for installing.
${includeIf(
!framework.omitRunScript,
`
## Running
${
answers.framework === 'rn'
? `- In one terminal, run \`yarn start\`
- In another terminal, run \`yarn android\` or \`yarn ios\``
: `- Run \`yarn ${framework.devServerScript ?? 'start'}\``
}
`
)}${includeIf(
framework.alwaysIncludeUnitTesting || answers.unitTesting,
`
## Unit Tests
- Run \`yarn test\`
`
)}${includeIf(
answers.cypress,
`
## E2E Tests
- Run the app
- In another terminal, run \`yarn cypress\`
`
)}${includeIf(
answers.detox,
`
## E2E Tests
- Run \`detox build -c ios.sim.debug\` (only needs to be run once per native code changes)
- Run \`detox test -c ios.sim.debug\`
`
)}`;
}
module.exports = {getReadmeContents};