[heft-storybook-plugin] Add --port flag to set the Storybook dev server port in serve mode#5819
Open
UberMouse wants to merge 1 commit into
Open
[heft-storybook-plugin] Add --port flag to set the Storybook dev server port in serve mode#5819UberMouse wants to merge 1 commit into
UberMouse wants to merge 1 commit into
Conversation
…ver port in serve mode Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
When Heft launches Storybook in serve mode (
--storybookwithheft start/watch), there was previously no way to control which port the Storybook dev server binds to from the Heft command line — you were limited to Storybook's default port. This PR adds a--portparameter to thestorybookparameter scope that is passed straight through to the Storybook CLI's own--portoption, so the dev server can be bound to a specific port.This is helpful in environments that pre-allocate a port before launching the dev server (for example, a build/orchestration daemon that needs to know the port up front so it can poll for readiness).
Details
The change mirrors the existing
--no-openflag:heft-plugin.jsondeclares a new--portstring parameter (argumentName: "PORT").StorybookPlugin.tsreads it viataskSession.parameters.getStringParameter('--port'), threads it through the prepare/run options, and — only when in serve mode and a value is provided — pushes--port <value>onto the Storybook CLI args.Notes:
--no-openand with where a dev-server port is meaningful; it has no effect on static builds.How it was tested
rushx buildinheft-storybook-pluginpasses (TypeScript compile + ESLint).@rushstack/heft-storybook-pluginin a downstream monorepo, where Heft invokes Storybook in serve mode with--portand the dev server binds to the requested port.Impacted documentation
None. Only the
heft-plugin.jsonparameter declaration changed; the options JSON schema (storybook.schema.json) and the website docs are unaffected.