Skip to content

Extract out CLI #22337

New issue

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

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

Already on GitHub? # to your account

Closed
wants to merge 3 commits into from
Closed
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
13 changes: 1 addition & 12 deletions local-cli/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,7 @@
* @format
*/

'use strict';

// gracefulify() has to be called before anything else runs
require('graceful-fs').gracefulify(require('fs'));

// This file must be able to run in node 0.12 without babel so we can show that
// it is not supported. This is why the rest of the cli code is in `cliEntry.js`.
require('./server/checkNodeVersion')();

require('../setupBabel')();

var cliEntry = require('./cliEntry');
var cliEntry = require('react-native-local-cli');

if (require.main === module) {
cliEntry.run();
Expand Down
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@
"build-ios-e2e": "detox build -c ios.sim.release",
"test-ios-e2e": "detox test -c ios.sim.release --cleanup"
},
"bin": {
Copy link
Member

Choose a reason for hiding this comment

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

Why don't we want this anymore? It seems like it is there to catch people from making mistakes. Is that mistake not possible anymore? Or we just think it isn't a big deal anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have kept this behaviour, but made react-native-local-cli to have "bin" property instead. So just declaring in a different npm module (since React Native itself doesn't have an executable anymore)

"react-native": "local-cli/wrong-react-native.js"
},
"peerDependencies": {
"react": "16.6.1"
},
Expand Down Expand Up @@ -193,6 +190,7 @@
"prop-types": "^15.5.8",
"react-clone-referenced-element": "^1.0.1",
"react-devtools-core": "^3.4.2",
"react-native-local-cli": "1.0.0-alpha.4",
"regenerator-runtime": "^0.11.0",
"rimraf": "^2.5.4",
"semver": "^5.0.3",
Expand Down
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6906,4 +6906,4 @@ yargs@^9.0.0:
string-width "^2.0.0"
which-module "^2.0.0"
y18n "^3.2.1"
yargs-parser "^7.0.0"
yargs-parser "^7.0.0"