Skip to content

Commit 96ed1eb

Browse files
author
Chris Brody
authored
log more example app info in the end (#259)
with some symbols from log-symbols based on logs from this interactive CLI tool: - https://github.com/brodybits/react-native-module-init
1 parent 5829e05 commit 96ed1eb

File tree

3 files changed

+26
-6
lines changed

3 files changed

+26
-6
lines changed

lib/cli-command.js

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
11
const emoji = require('node-emoji');
22

3+
const logSymbols = require('log-symbols');
4+
35
const normalizedOptions = require('./normalized-options');
46

57
const createLibraryModule = require('./lib');
68

79
const postCreateInstructions = ({
810
moduleName,
11+
platforms,
912
generateExample,
1013
exampleName
1114
}) => `
1215
====================================================
1316
YOU'RE ALL SET!
1417
` + (generateExample
1518
? `
16-
To build and run iOS example project, do:
17-
----
18-
cd ${moduleName}/${exampleName}
19-
yarn
20-
react-native run-ios
21-
----
19+
${emoji.get('bulb')} check out the example app in ${moduleName}/${exampleName}
20+
${emoji.get('bulb')} recommended: run Metro Bundler in a new shell
21+
${logSymbols.info} (cd ${moduleName}/${exampleName} && yarn start)
22+
${emoji.get('bulb')} enter the following commands to run the example app:
23+
${logSymbols.info} cd ${moduleName}/${exampleName}
24+
${platforms.split(',').map(platform =>
25+
`${logSymbols.info} react-native run-${platform}`
26+
).join(`
27+
`)}
28+
${logSymbols.warning} first steps in case of a clean checkout
29+
${logSymbols.info} run Yarn in ${moduleName}/${exampleName}/ios
30+
${logSymbols.info} (cd ${moduleName}/${exampleName} && yarn)
31+
${logSymbols.info} do \`pod install\` for iOS in ${moduleName}/${exampleName}/ios
32+
${logSymbols.info} cd ${moduleName}/${exampleName}
33+
${logSymbols.info} (cd ios && pod install)
2234
`
2335
: `
2436
${emoji.get('bulb')} next time consider using \`--generate-example\` to add a generated example!

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"execa": "^3.3.0",
4545
"fs-extra": "^8.1.0",
4646
"jsonfile": "^6.0.0",
47+
"log-symbols": "^3.0.0",
4748
"node-emoji": "^1.10.0",
4849
"param-case": "^2.1.1",
4950
"pascal-case": "^2.0.1",

yarn.lock

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3148,6 +3148,13 @@ lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15:
31483148
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.15.tgz#b447f6670a0455bbfeedd11392eff330ea097548"
31493149
integrity sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==
31503150

3151+
log-symbols@^3.0.0:
3152+
version "3.0.0"
3153+
resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-3.0.0.tgz#f3a08516a5dea893336a7dee14d18a1cfdab77c4"
3154+
integrity sha512-dSkNGuI7iG3mfvDzUuYZyvk5dD9ocYCYzNU6CYDE6+Xqd+gwme6Z00NS3dUh8mq/73HaEtT7m6W+yUPtU6BZnQ==
3155+
dependencies:
3156+
chalk "^2.4.2"
3157+
31513158
log4js@~6.1.0:
31523159
version "6.1.2"
31533160
resolved "https://registry.yarnpkg.com/log4js/-/log4js-6.1.2.tgz#04688e1f4b8080c127b7dccb0db1c759cbb25dc4"

0 commit comments

Comments
 (0)