Skip to content

Commit

Permalink
Merge pull request #24388 from storybookjs/yann/add-missing-angular-o…
Browse files Browse the repository at this point in the history
…ptions

Angular: Add CLI options (debugWebpack, webpackStatsJson, and more)
  • Loading branch information
yannbf authored Oct 5, 2023
2 parents 9619860 + 5184a7a commit 80951d3
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions code/frameworks/angular/src/builders/build-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export type StorybookBuilderOptions = JsonObject & {
| 'webpackStatsJson'
| 'disableTelemetry'
| 'debugWebpack'
| 'previewUrl'
>;

export type StorybookBuilderOutput = JsonObject & BuilderOutput & { [key: string]: any };
Expand Down Expand Up @@ -90,6 +91,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
debugWebpack,
disableTelemetry,
assets,
previewUrl,
} = options;

const standaloneOptions: StandaloneBuildOptions = {
Expand All @@ -111,6 +113,7 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (
tsConfig,
webpackStatsJson,
debugWebpack,
previewUrl,
};

return standaloneOptions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@
"description": "Write Webpack Stats JSON to disk",
"default": false
},
"previewUrl": {
"type": "string",
"description": "Disables the default storybook preview and lets you use your own"
},
"styles": {
"type": "array",
"description": "Global styles to be included in the build.",
Expand Down
9 changes: 9 additions & 0 deletions code/frameworks/angular/src/builders/start-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ export type StorybookBuilderOptions = JsonObject & {
| 'open'
| 'docs'
| 'debugWebpack'
| 'webpackStatsJson'
| 'loglevel'
| 'previewUrl'
>;

export type StorybookBuilderOutput = JsonObject & BuilderOutput & {};
Expand Down Expand Up @@ -105,6 +108,9 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
initialPath,
open,
debugWebpack,
loglevel,
webpackStatsJson,
previewUrl,
} = options;

const standaloneOptions: StandaloneOptions = {
Expand Down Expand Up @@ -133,6 +139,9 @@ const commandBuilder: BuilderHandlerFn<StorybookBuilderOptions> = (options, cont
initialPath,
open,
debugWebpack,
loglevel,
webpackStatsJson,
previewUrl,
};

return standaloneOptions;
Expand Down
14 changes: 14 additions & 0 deletions code/frameworks/angular/src/builders/start-storybook/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,20 @@
"initialPath": {
"type": "string",
"description": "URL path to be appended when visiting Storybook for the first time"
},
"webpackStatsJson": {
"type": "string",
"description": "Write Webpack Stats JSON to disk",
"default": false
},
"previewUrl": {
"type": "string",
"description": "Disables the default storybook preview and lets you use your own"
},
"loglevel": {
"type": "string",
"description": "Controls level of logging during build. Can be one of: [silly, verbose, info (default), warn, error, silent].",
"pattern": "(silly|verbose|info|warn|silent)"
}
},
"additionalProperties": false,
Expand Down

0 comments on commit 80951d3

Please sign in to comment.