Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…tive-module into rename-some-options
  • Loading branch information
brodybits committed Mar 16, 2021
2 parents 920cde1 + 0d32c48 commit 75ff2e9
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 33 deletions.
46 changes: 24 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,31 +61,33 @@ Package required to be installed globally if the recommended example app is gene

- [`yarn`](https://www.npmjs.com/package/yarn)

```
```console
$ npm install -g yarn
```

To install this package:

```
```console
$ npm install -g create-react-native-module
```

## Command-line usage

Navigate into an empty directory to execute the command.
```

```console
$ create-react-native-module MyFancyLibrary
```

This will create the folder `MyFancyLibrary` in which the library will be created in.

Now install dependencies by running this command in the newly created library.
```

```console
$ npm install
```

```
```console
Usage: create-react-native-module [options] <name>

Options:
Expand Down Expand Up @@ -156,15 +158,15 @@ createLibraryModule({

__Create the module with no view:__

```
```console
create-react-native-module --prefix CB --native-package-id io.mylibrary --generate-example AliceHelper
```

The module would be generated in the `react-native-alice-helper` subdirectory, and the example test app would be in `react-native-alice-helper/example`.

Then go into the example app subdirectory:

```
```console
cd react-native-alice-helper/example
```

Expand All @@ -178,45 +180,45 @@ _Within the example test app subdirectory:_

It is *recommended* to start the Metro Bundler manually (within `react-native-alice-helper/example`), which would run in the foreground:

```
```console
yarn start
```

Otherwise, React Native will open its own window to run the Metro Bundler.

To run on Android, do the following command (within `react-native-alice-helper/example`):

```
npx react-native run-android
```console
yarn android
```

(or `yarn android` on React Native starting with 0.61)
for React Native `0.60`: `npx react-native run-android`

This assumes that the `ANDROID_HOME` environmental variable is set properly. Here is a sample command that does not make such an assumption on a mac:

```
```console
ANDROID_HOME=~/Library/Android/sdk npx react-native run-android
```

For iOS:

Extra installation step needed _in case of clean checkout only_:

```
```console
cd ios && pod install && cd ..
```

Then to run on iOS:

```
npx react-native run-ios
```console
yarn ios
```

(or `yarn ios` on React Native starting with 0.61)
for React Native `0.60`: `npx react-native run-ios`

or do the following command to open the iOS project in Xcode:

```
```console
open ios/example.xcodeproj
```

Expand All @@ -231,15 +233,15 @@ The example app shows the following indications:

__Create the module with an extremely simple view:__

```
```console
create-react-native-module --prefix CB --native-package-id io.mylibrary --view --generate-example CarolWidget
```

The module would be generated in the `react-native-carol-widget` subdirectory, and the example test app would be in `react-native-carol-widget/example`.

Then go into the example app subdirectory:

```
```console
cd react-native-carol-widget/example
```

Expand All @@ -253,16 +255,16 @@ _Within the example test app subdirectory:_

It is *recommended* to start the Metro Bundler manually as described above (within `react-native-carol-widget/example`):

```
```console
yarn start
```

To run on Android: do `npx react-native run-android` as described for the other example above.
To run on Android: do `yarn android` or `npx react-native run-android` as described for the other example above.

To run on iOS (as described above):

- _in case of clean checkout **only**_: do `pod install` in `ios` subdirectory
- do `npx react-native run-ios` or `open ios/example.xcodeproj`
- do `yarn ios`, `npx react-native run-ios`, or `open ios/example.xcodeproj`

__Expected result:__

Expand Down
2 changes: 1 addition & 1 deletion lib/cli-command.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ ${logSymbols.info} (cd ${packageName}/${exampleName} && yarn start)
${emoji.get('bulb')} enter the following commands to run the example app:
${logSymbols.info} cd ${packageName}/${exampleName}
${platforms.split(',').map(platform =>
`${logSymbols.info} react-native run-${platform}`
`${logSymbols.info} yarn ${platform} # for React Native 0.60: npx react-native run-${platform}`
).join(`
`)}
${logSymbols.warning} IMPORTANT NOTICES
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"@stryker-mutator/javascript-mutator": "^3.3.1",
"@stryker-mutator/jest-runner": "^3.3.1",
"cross-env": "^7.0.3",
"eslint": "^7.21.0",
"eslint": "^7.22.0",
"eslint-config-standard": "^14.1.1",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-node": "^11.1.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1203,8 +1203,8 @@ YOU'RE ALL SET!
ℹ (cd react-native-test-package/undefined && yarn start)
💡 enter the following commands to run the example app:
cd react-native-test-package/undefined
react-native run-android
react-native run-ios
yarn android # for React Native 0.60: npx react-native run-android
yarn ios # for React Native 0.60: npx react-native run-ios
IMPORTANT NOTICES
After clean checkout, these first steps are needed:
run Yarn in react-native-test-package/undefined/ios
Expand Down
21 changes: 14 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2862,10 +2862,10 @@ eslint-visitor-keys@^2.0.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.0.0.tgz#21fdc8fbcd9c795cc0321f0563702095751511a8"
integrity sha512-QudtT6av5WXels9WjIM7qz1XD1cWGvX4gGXvp/zBn9nXG02D0utdU3Em2m/QjTnrsk6bBjmCygl3rmj118msQQ==

eslint@^7.21.0:
version "7.21.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.21.0.tgz#4ecd5b8c5b44f5dedc9b8a110b01bbfeb15d1c83"
integrity sha512-W2aJbXpMNofUp0ztQaF40fveSsJBjlSCSWpy//gzfTvwC+USs/nceBrKmlJOiM8r1bLwP2EuYkCqArn/6QTIgg==
eslint@^7.22.0:
version "7.22.0"
resolved "https://registry.yarnpkg.com/eslint/-/eslint-7.22.0.tgz#07ecc61052fec63661a2cab6bd507127c07adc6f"
integrity sha512-3VawOtjSJUQiiqac8MQc+w457iGLfuNGLFn8JmF051tTKbh5/x/0vlcEj8OgDCaw7Ysa2Jn8paGshV7x2abKXg==
dependencies:
"@babel/code-frame" "7.12.11"
"@eslint/eslintrc" "^0.4.0"
Expand All @@ -2884,15 +2884,15 @@ eslint@^7.21.0:
file-entry-cache "^6.0.1"
functional-red-black-tree "^1.0.1"
glob-parent "^5.0.0"
globals "^12.1.0"
globals "^13.6.0"
ignore "^4.0.6"
import-fresh "^3.0.0"
imurmurhash "^0.1.4"
is-glob "^4.0.0"
js-yaml "^3.13.1"
json-stable-stringify-without-jsonify "^1.0.1"
levn "^0.4.1"
lodash "^4.17.20"
lodash "^4.17.21"
minimatch "^3.0.4"
natural-compare "^1.4.0"
optionator "^0.9.1"
Expand Down Expand Up @@ -3436,6 +3436,13 @@ globals@^12.1.0:
dependencies:
type-fest "^0.8.1"

globals@^13.6.0:
version "13.6.0"
resolved "https://registry.yarnpkg.com/globals/-/globals-13.6.0.tgz#d77138e53738567bb96a3916ff6f6b487af20ef7"
integrity sha512-YFKCX0SiPg7l5oKYCJ2zZGxcXprVXHcSnVuvzrT3oSENQonVLqM5pf9fN5dLGZGyCjhw8TN8Btwe/jKnZ0pjvQ==
dependencies:
type-fest "^0.20.2"

got@^9.6.0:
version "9.6.0"
resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
Expand Down Expand Up @@ -4836,7 +4843,7 @@ lodash@^4.17.13, lodash@^4.17.15, lodash@^4.17.19, lodash@^4.17.20:
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==

lodash@^4.17.14, lodash@^4.3.0:
lodash@^4.17.14, lodash@^4.17.21, lodash@^4.3.0:
version "4.17.21"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
Expand Down

0 comments on commit 75ff2e9

Please sign in to comment.