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

fix: reporter config option #371

Merged
merged 2 commits into from
May 7, 2019

Conversation

fson
Copy link
Contributor

@fson fson commented May 6, 2019

This PR backports the fix from #370 to the 1.x branch. I cherry picked 809aef9 to 1.x.

Summary:

The loadConfig function in metro-config reads the reporter option
from the second argument (defaultConfigOverrides) instead of the
first argument (argv), so we need to pass it in that object to
make the customLogReporterPath CLI option work.

Test Plan:

  1. Created a file reporter.js with the following contents:
class JsonReporter {
  update(event) {
    console.log(JSON.stringify(event));
  }
}

module.exports = JsonReporter;
  1. Ran this command and inspected that the output was JSON:
node ~/Projects/react-native-cli/packages/cli/build/index.js start --customLogReporterPath ~/Projects/react-native-cli/reporter.js

fson added 2 commits May 7, 2019 00:19
The `loadConfig` function in `metro-config` reads the `reporter` option
from the second argument (`defaultConfigOverrides`) instead of the
first argument (`argv`), so we need to pass it in that object to
make the `customLogReporterPath` CLI option work.
@thymikee thymikee changed the title fix: reporter option (backport to 1.x) fix: reporter config option May 7, 2019
@thymikee thymikee merged commit 731b7d2 into react-native-community:1.x May 7, 2019
@fson fson deleted the fix-reporter-option-1.x branch May 7, 2019 07:54
@thymikee
Copy link
Member

thymikee commented May 7, 2019

Thanks! Released 1.9.3 with this patch

thymikee added a commit that referenced this pull request May 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants