diff --git a/common/changes/@rushstack/heft-storybook-plugin/main_2026-03-04-03-22.json b/common/changes/@rushstack/heft-storybook-plugin/main_2026-03-04-03-22.json new file mode 100644 index 00000000000..6c787fbb10c --- /dev/null +++ b/common/changes/@rushstack/heft-storybook-plugin/main_2026-03-04-03-22.json @@ -0,0 +1,10 @@ +{ + "changes": [ + { + "packageName": "@rushstack/heft-storybook-plugin", + "comment": "Add `quiet` option to control whether --quiet is passed to the Storybook CLI, and add `--no-open` flag to suppress automatic browser launch in serve mode", + "type": "minor" + } + ], + "packageName": "@rushstack/heft-storybook-plugin" +} \ No newline at end of file diff --git a/heft-plugins/heft-storybook-plugin/heft-plugin.json b/heft-plugins/heft-storybook-plugin/heft-plugin.json index 107eca91df2..11627a4fa45 100644 --- a/heft-plugins/heft-storybook-plugin/heft-plugin.json +++ b/heft-plugins/heft-storybook-plugin/heft-plugin.json @@ -23,6 +23,11 @@ "longName": "--docs", "description": "Execute storybook in docs mode.", "parameterKind": "flag" + }, + { + "longName": "--no-open", + "description": "Pass --no-open to the storybook CLI so it does not automatically open a browser window in serve mode.", + "parameterKind": "flag" } ] } diff --git a/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts b/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts index 020568192f0..89dfd3779fc 100644 --- a/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts +++ b/heft-plugins/heft-storybook-plugin/src/StorybookPlugin.ts @@ -164,6 +164,13 @@ export interface IStorybookPluginOptions { * which disables Storybook's telemetry data collection. */ disableTelemetry?: boolean; + + /** + * Specifies whether to run storybook in quiet mode (--quiet). + * + * @defaultValue `true` + */ + quiet?: boolean; } interface IRunStorybookOptions extends IPrepareStorybookOptions { @@ -183,6 +190,7 @@ interface IPrepareStorybookOptions extends IStorybookPluginOptions { isServeMode: boolean; isTestMode: boolean; isDocsMode: boolean; + isNoOpenMode: boolean; } const DEFAULT_STORYBOOK_VERSION: StorybookCliVersion = StorybookCliVersion.STORYBOOK7; @@ -220,6 +228,7 @@ const DEFAULT_STORYBOOK_CLI_CONFIG: Record { @@ -237,6 +246,8 @@ export default class StorybookPlugin implements IHeftTaskPlugin { - const { logger, resolvedModulePath, verbose, isServeMode, isTestMode, isDocsMode } = runStorybookOptions; + const { logger, resolvedModulePath, verbose, isServeMode, isTestMode, isDocsMode, isNoOpenMode } = + runStorybookOptions; let { workingDirectory, outputFolder } = runStorybookOptions; logger.terminal.writeLine('Running Storybook compilation'); logger.terminal.writeVerboseLine(`Loading Storybook module "${resolvedModulePath}"`); @@ -493,7 +506,7 @@ export default class StorybookPlugin implements IHeftTaskPlugin