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 ignored --projectRoot/watchFolders arguments #21165

Closed
wants to merge 1 commit into from

Conversation

oblador
Copy link
Contributor

@oblador oblador commented Sep 18, 2018

Due to @Kureev's cleanup in c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the --projectRoot and --watchFolders arguments used by storybook to change the bundle entrypoint.

This PR simply fixes the regression by assigning these values from argv instead of reading config defaults.

Related: the undocumented REACT_NATIVE_APP_ROOT env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one.

Test Plan:

I created a new folder called newroot with a different index.js, started metro with react-native start --projectRoot newroot and got new content.

Release Notes:

[CLI] [BUGFIX] [local-cli/server/runServer.js] - Fix --projectRoot/watchFolders arguments ignored

@facebook-github-bot facebook-github-bot 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 Sep 18, 2018
Copy link

@analysis-bot analysis-bot left a comment

Choose a reason for hiding this comment

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

eslint found some issues. You may run yarn prettier or npm run prettier to fix these.

@@ -58,6 +58,8 @@ async function runServer(args: Args, config: ConfigT) {
config.server.port = args.port;
config.reporter = reporter;
config.resetCache = args.resetCache;
config.projectRoot = args.projectRoot;
config.watchFolders = args.watchFolders;

Choose a reason for hiding this comment

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

Cannot assign args.watchFolders to config.watchFolders because read-only array type [1] is incompatible with array type [2].

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Sep 18, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

hramos is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

@oblador merged commit 9fca769 into facebook:master.


Once this commit is added to a release, you will see the corresponding version tag below the description at 9fca769. If the commit has a single master tag, it is not yet part of a release.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 19, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 19, 2018
kelset pushed a commit that referenced this pull request Sep 21, 2018
Summary:
Due to Kureev's cleanup in c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint.

This PR simply fixes the regression by assigning these values from argv instead of reading config defaults.

Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one.
Pull Request resolved: #21165

Differential Revision: D9929642

Pulled By: hramos

fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
grabbou pushed a commit to react-native-community/cli that referenced this pull request Sep 26, 2018
Summary:
Due to Kureev's cleanup in facebook/react-native@c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint.

This PR simply fixes the regression by assigning these values from argv instead of reading config defaults.

Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one.
Pull Request resolved: facebook/react-native#21165

Differential Revision: D9929642

Pulled By: hramos

fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Summary:
Due to Kureev's cleanup in facebook@c4a66a8 some arguments are no longer properly passed to metro, but just the default values. This broke the `--projectRoot` and `--watchFolders` arguments used by storybook to change the bundle entrypoint.

This PR simply fixes the regression by assigning these values from argv instead of reading config defaults.

Related: the undocumented `REACT_NATIVE_APP_ROOT` env var is broken, not sure for how long, but I can fix it as a part of this PR or make a new one.
Pull Request resolved: facebook#21165

Differential Revision: D9929642

Pulled By: hramos

fbshipit-source-id: 00485a0429bd4301de03e5cb455e928878c4ba8f
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants