-
Notifications
You must be signed in to change notification settings - Fork 25k
Add --config option to CLI to allow passing a path to an rn-cli.config.js
#7883
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
Conversation
|
By analyzing the blame information on this pull request, we identified @janicduplessis and @martinbigio to be potential reviewers. |
|
@skevy updated the pull request. |
1 similar comment
|
@skevy updated the pull request. |
62ac4ae to
86d952c
Compare
|
@skevy updated the pull request. |
86d952c to
fa4ff07
Compare
|
@skevy updated the pull request. |
fa4ff07 to
6adc8c1
Compare
|
@skevy updated the pull request. |
|
I'm sorry I suck so much at programming @ide. |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to Phabricator to review. |
|
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
|
cc @martinbigio could you tell us what the error for this commit is? The OSS unit tests pass so it's hard to see what's wrong. |
|
It's probably because there is a merge conflit at the moment. |
6adc8c1 to
f97fcf9
Compare
|
Yep you're right @janicduplessis. Thanks. |
|
@skevy updated the pull request. |
|
@facebook-github-bot shipit |
|
Thanks for importing. If you are an FB employee go to Phabricator to review. |
|
I tried to merge this pull request into the Facebook internal repo but some checks failed. To unblock yourself please check the following: Does this pull request pass all open source tests on GitHub? If not please fix those. Does the code still apply cleanly on top of GitHub master? If not can please rebase. In all other cases this means some internal test failed, for example a part of a fb app won't work with this pull request. I've added the Import Failed label to this pull request so it is easy for someone at fb to find the pull request and check what failed. If you don't see anyone comment in a few days feel free to comment mentioning one of the core contributors to the project so they get a notification. |
|
@frantic could you help us find the stack trace that made the import fail? |
|
Seems like it failed for unknown reason. Will rebase and try re-landing Yours truly, |
| */ | ||
| const Config = { | ||
| get(cwd, defaultConfig) { | ||
| if (cachedConfig) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we are no longer doing caching? What's the possible side effects of this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In OSS at least, there's only one caller:
$ git grep 'Config.get('
local-cli/cliEntry.js: command[0](args, Config.get(__dirname, defaultConfig)).done();
And since cliEntry.js runs just once, I don't think caching mattered. Also the cache doesn't create any cache key based on cwd + defaultConfig, so if you called Cache.get with different arguments you might get the wrong cached value.
fb57cc7 to
5f3aa3c
Compare
|
@skevy updated the pull request. |
|
So it seems like this passes now. w00t @facebook-github-bot shipit |
|
I will not rubber stamp and land your change for you @skevy! I can import it for you and you can get your change reviewed by someone though :) |
|
I added a package.json change (added minimist), someone at FB will have to merge this diff. |
|
cc @bestander |
|
@ide, I don't see the change in package.json. |
|
I had to use minimist on purpose because rn-cli.config.js is used to set up the other CLI options when configuring Commander. I'll double check package.json and update this diff if needed. |
5f3aa3c to
8096ea6
Compare
|
@skevy updated the pull request. |
|
Added minimist to package.json. It actually is not a new dependency because another old dependency ( |
|
@facebook-github-bot import |
|
Thanks for importing.If you are an FB employee go to Phabricator to review internal test results. |
|
Thanks @bestander! |
…nfig.js` Summary: Currently we just try to resolve a rn-cli.config.js file by walking up the tree from node_modules/react-native. In non-standard uses of RN, when your copy of RN may not live within node_modules, it's impossible to use rn-cli.config.js. This PR adds a "config" flag to the cli that let's you pass in a path to rn-cli.config.js. cc ide Closes facebook#7883 Differential Revision: D3382823 Pulled By: bestander fbshipit-source-id: b946f3bb355050fc2fe99273d0e99e441dbed111
…nfig.js` Summary: Currently we just try to resolve a rn-cli.config.js file by walking up the tree from node_modules/react-native. In non-standard uses of RN, when your copy of RN may not live within node_modules, it's impossible to use rn-cli.config.js. This PR adds a "config" flag to the cli that let's you pass in a path to rn-cli.config.js. cc ide Closes facebook/react-native#7883 Differential Revision: D3382823 Pulled By: bestander fbshipit-source-id: b946f3bb355050fc2fe99273d0e99e441dbed111
Currently we just try to resolve a rn-cli.config.js file by walking up the tree from node_modules/react-native. In non-standard uses of RN, when your copy of RN may not live within node_modules, it's impossible to use rn-cli.config.js. This PR adds a "config" flag to the cli that let's you pass in a path to rn-cli.config.js.
cc @ide