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

CLI: Ensure --host option changes the network host #13521

Merged
merged 1 commit into from
Dec 27, 2020

Conversation

ryanml
Copy link
Member

@ryanml ryanml commented Dec 27, 2020

Issue: #12865

What I did

  • Made it so that the host passed via cl args modifies the network host, not localhost
  • Added a new test file dev-server.test.ts

How to test

The test plan is defined in the issue

@@ -356,6 +356,13 @@ const startPreview = async ({
return { previewStats, previewTotalTime: process.hrtime(startTime) };
};

export function getServerAddresses(port: number, host: string, proto: string) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Moving this logic to its own function is useful for unit tests

@@ -414,7 +420,7 @@ export async function storybookDevServer(options: any) {
]);

// TODO #13083 Remove this when compiling the preview is fast enough
if (!options.ci) openInBrowser(address);
if (!options.ci) openInBrowser(networkAddress);
Copy link
Member Author

Choose a reason for hiding this comment

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

@yannbf - I think it's the case now that we'll want the browser to open to networkAddress, given that's what the user is configuring with the --host option

@shilman shilman added bug cli patch:yes Bugfix & documentation PR that need to be picked to main branch labels Dec 27, 2020
@shilman shilman added this to the 6.1.x milestone Dec 27, 2020
Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

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

💯

@shilman shilman changed the title Ensuring --host option changes the network host CLI: Ensure --host option changes the network host Dec 27, 2020
@shilman shilman merged commit 0533949 into storybookjs:next Dec 27, 2020
@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jan 12, 2021
shilman added a commit that referenced this pull request Jan 12, 2021
CLI: Ensure --host option changes the network host
PenguinOfWar added a commit to PenguinOfWar/storybook that referenced this pull request Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cli patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants