Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: followup after #104 #105

Merged
merged 6 commits into from
Jan 21, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ All work on React Native CLI happens directly on GitHub. Contributors send pull

Repository is splitted into two packages:

* `local-cli` - Historically, it was included in `react-native` package. Contains all the commands code.
* `cli` - Historically, it was included in `react-native` package. Contains all the commands code.
* `global-cli` - Historically, it was a `react-native-cli` package and the only reason this package existed was to initialize an empty project.

## Testing your changes

You can test your changes by calling `cli.js` directly from the cloned repository. You need to make sure the version of React Native matches the one present in devDependencies of the CLI. Otherwise, you may get unexpected errors.

```sh
node /path/to/cloned/project/packages/local-cli/cli.js
node /path/to/cloned/project/packages/cli/index.js
```

## Typechecking, linting and testing
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"build": "rm -rf build; babel src --out-dir build --ignore '**/__tests__/**','**/__mocks__/**','**/__fixtures__/**'"
},
"jest": {
"displayName": "local",
"displayName": "cli",
"testPathIgnorePatterns": [
"/node_modules/",
"/templates/"
Expand Down
6 changes: 4 additions & 2 deletions packages/cli/src/eject/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ function eject() {
path.resolve(
'node_modules',
'react-native',
'local-cli',
'@react-native-community',
'cli',
'templates',
'HelloWorld',
'ios'
Expand All @@ -91,7 +92,8 @@ function eject() {
path.resolve(
'node_modules',
'react-native',
'local-cli',
'@react-native-community',
'cli',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like we don't have a correct test for this scenario

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True. I don't even know when this command is being called.

'templates',
'HelloWorld',
'android'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const walk = require('../util/walk');
* Util for creating a new React Native project.
* Copy the project from a template and use the correct project name in
* all files.
* @param srcPath e.g. '/Users/martin/AwesomeApp/node_modules/react-native/local-cli/templates/HelloWorld'
* @param srcPath e.g. '/Users/martin/AwesomeApp/node_modules/react-native/template'
* @param destPath e.g. '/Users/martin/AwesomeApp'
* @param newProjectName e.g. 'AwesomeApp'
* @param options e.g. {
Expand Down
2 changes: 1 addition & 1 deletion packages/global-cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// The only job of react-native-cli is to init the repository and then
// forward all the commands to the local version of react-native.
//
// If you need to add a new command, please add it to local-cli/.
// If you need to add a new command, please add it to @react-native-community/cli.
//
// The only reason to modify this file is to add more warnings and
// troubleshooting information for the `react-native init` command.
Expand Down
2 changes: 1 addition & 1 deletion packages/global-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@
"semver": "^5.0.3"
},
"jest": {
"displayName": "global"
"displayName": "global-cli"
}
}