feat(storybook): add docsMode support (#2551)

This commit is contained in:
Maxi Gimenez 2020-02-25 21:17:48 +01:00 committed by GitHub
parent cbd5d4c426
commit cd2597066b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 33 additions and 2 deletions

View File

@ -6,6 +6,14 @@ Builder properties can be configured in angular.json when defining the builder,
## Properties ## Properties
### docsMode
Default: `false`
Type: `boolean`
Build a documentation-only site using addon-docs.
### outputPath ### outputPath
Type: `string` Type: `string`

View File

@ -7,6 +7,14 @@ Read more about how to use builders and the CLI here: https://nx.dev/react/guide
## Properties ## Properties
### docsMode
Default: `false`
Type: `boolean`
Build a documentation-only site using addon-docs.
### outputPath ### outputPath
Type: `string` Type: `string`

View File

@ -7,6 +7,14 @@ Read more about how to use builders and the CLI here: https://nx.dev/web/guides/
## Properties ## Properties
### docsMode
Default: `false`
Type: `boolean`
Build a documentation-only site using addon-docs.
### outputPath ### outputPath
Type: `string` Type: `string`

View File

@ -27,6 +27,8 @@ export interface StorybookBuilderOptions extends JsonObject {
uiFramework: string; uiFramework: string;
config: StorybookConfig; config: StorybookConfig;
quiet?: boolean; quiet?: boolean;
outputPath?: string;
docsMode?: boolean;
} }
try { try {
@ -85,8 +87,8 @@ async function storybookOptionMapper(
configDir: storybookConfig, configDir: storybookConfig,
...frameworkOptions, ...frameworkOptions,
frameworkPresets: [...(frameworkOptions.frameworkPresets || [])], frameworkPresets: [...(frameworkOptions.frameworkPresets || [])],
watch: false,
watch: false docsMode: builderOptions.docsMode
}; };
optionsWithFramework.config; optionsWithFramework.config;
return optionsWithFramework; return optionsWithFramework;

View File

@ -47,6 +47,11 @@
} }
] ]
}, },
"docsMode": {
"type": "boolean",
"description": "Build a documentation-only site using addon-docs.",
"default": false
},
"quiet": { "quiet": {
"type": "boolean", "type": "boolean",
"description": "Suppress verbose build output.", "description": "Suppress verbose build output.",