Skip to content

Conversation

@skevy
Copy link
Contributor

@skevy skevy commented Jun 1, 2016

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

@ghost
Copy link

ghost commented Jun 1, 2016

By analyzing the blame information on this pull request, we identified @janicduplessis and @martinbigio to be potential reviewers.

@ghost ghost added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jun 1, 2016
@ghost
Copy link

ghost commented Jun 1, 2016

@skevy updated the pull request.

1 similar comment
@ghost
Copy link

ghost commented Jun 1, 2016

@skevy updated the pull request.

@skevy skevy force-pushed the config-flag-for-cli branch from 62ac4ae to 86d952c Compare June 1, 2016 23:42
@ghost
Copy link

ghost commented Jun 1, 2016

@skevy updated the pull request.

@skevy skevy force-pushed the config-flag-for-cli branch from 86d952c to fa4ff07 Compare June 2, 2016 00:20
@ghost
Copy link

ghost commented Jun 2, 2016

@skevy updated the pull request.

@skevy skevy force-pushed the config-flag-for-cli branch from fa4ff07 to 6adc8c1 Compare June 2, 2016 22:18
@ghost
Copy link

ghost commented Jun 2, 2016

@skevy updated the pull request.

@skevy
Copy link
Contributor Author

skevy commented Jun 2, 2016

I'm sorry I suck so much at programming @ide.

@ide
Copy link
Contributor

ide commented Jun 2, 2016

@facebook-github-bot shipit

@ghost ghost added GH Review: accepted Import Started This pull request has been imported. This does not imply the PR has been approved. and removed GH Review: review-needed labels Jun 2, 2016
@ghost
Copy link

ghost commented Jun 2, 2016

Thanks for importing. If you are an FB employee go to Phabricator to review.

@ghost
Copy link

ghost commented Jun 3, 2016

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.

@ghost ghost added Import Failed and removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Jun 3, 2016
@ide
Copy link
Contributor

ide commented Jun 3, 2016

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.

@janicduplessis
Copy link
Contributor

It's probably because there is a merge conflit at the moment.

@skevy skevy force-pushed the config-flag-for-cli branch from 6adc8c1 to f97fcf9 Compare June 3, 2016 20:58
@skevy
Copy link
Contributor Author

skevy commented Jun 3, 2016

Yep you're right @janicduplessis. Thanks.

@ghost
Copy link

ghost commented Jun 3, 2016

@skevy updated the pull request.

@ide
Copy link
Contributor

ide commented Jun 3, 2016

@facebook-github-bot shipit

@ghost ghost added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Jun 3, 2016
@ghost
Copy link

ghost commented Jun 3, 2016

Thanks for importing. If you are an FB employee go to Phabricator to review.

@ghost
Copy link

ghost commented Jun 4, 2016

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.

@ghost ghost removed the Import Started This pull request has been imported. This does not imply the PR has been approved. label Jun 4, 2016
@ide
Copy link
Contributor

ide commented Jul 1, 2016

@frantic could you help us find the stack trace that made the import fail?

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 12, 2016
@frantic
Copy link
Contributor

frantic commented Jul 15, 2016

Seems like it failed for unknown reason. Will rebase and try re-landing

Yours truly,
🐢

*/
const Config = {
get(cwd, defaultConfig) {
if (cachedConfig) {
Copy link
Contributor

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?

Copy link
Contributor

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.

@ide ide force-pushed the config-flag-for-cli branch from f97fcf9 to fb57cc7 Compare July 16, 2016 05:56
@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 16, 2016
@ide ide force-pushed the config-flag-for-cli branch from fb57cc7 to 5f3aa3c Compare August 9, 2016 08:07
@facebook-github-bot
Copy link
Contributor

@skevy updated the pull request.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2016
@skevy
Copy link
Contributor Author

skevy commented Aug 9, 2016

So it seems like this passes now. w00t

@facebook-github-bot shipit

@ghost
Copy link

ghost commented Aug 9, 2016

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 :)

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2016
@ide
Copy link
Contributor

ide commented Aug 10, 2016

I added a package.json change (added minimist), someone at FB will have to merge this diff.

@satya164
Copy link
Contributor

cc @bestander

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 10, 2016
@bestander
Copy link
Contributor

@ide, I don't see the change in package.json.
We switched to using commander in RN now, could you switch to that?
I'll merge it afterwards.
Sorry for the delay

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 10, 2016
@ide
Copy link
Contributor

ide commented Aug 10, 2016

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.

@ide ide force-pushed the config-flag-for-cli branch from 5f3aa3c to 8096ea6 Compare August 10, 2016 16:33
@facebook-github-bot
Copy link
Contributor

@skevy updated the pull request.

@ide
Copy link
Contributor

ide commented Aug 10, 2016

Added minimist to package.json. It actually is not a new dependency because another old dependency (optimist probably) already depends on minimist, but better to explicitly add minimist to package.json.

@bestander
Copy link
Contributor

@facebook-github-bot import

@ghost
Copy link

ghost commented Aug 10, 2016

Thanks for importing.If you are an FB employee go to Phabricator to review internal test results.

@ghost ghost added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 10, 2016
@ghost ghost closed this in 757ab0b Aug 12, 2016
@ide
Copy link
Contributor

ide commented Aug 12, 2016

Thanks @bestander!

mpretty-cyro pushed a commit to HomePass/react-native that referenced this pull request Aug 25, 2016
…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
grabbou pushed a commit to react-native-community/cli that referenced this pull request Sep 26, 2018
…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
@ide ide deleted the config-flag-for-cli branch April 25, 2020 08:31
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants