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

Ensure Angular docsMode flag has effect #20711

Merged
merged 1 commit into from
Jan 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions code/frameworks/angular/src/builders/build-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-ha
export type StorybookBuilderOptions = JsonObject & {
browserTarget?: string | null;
tsConfig?: string;
docsMode: boolean;
docs: boolean;
compodoc: boolean;
compodocArgs: string[];
styles?: StyleElement[];
Expand Down Expand Up @@ -59,7 +59,7 @@ function commandBuilder(
stylePreprocessorOptions,
styles,
configDir,
docsMode,
docs,
loglevel,
outputDir,
quiet,
Expand All @@ -70,7 +70,7 @@ function commandBuilder(
const standaloneOptions: StandaloneBuildOptions = {
packageJson: readUpSync({ cwd: __dirname }).packageJson,
configDir,
docsMode,
...(docs ? { docs } : {}),
loglevel,
outputDir,
quiet,
Expand Down
18 changes: 13 additions & 5 deletions code/frameworks/angular/src/builders/build-storybook/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"description": "Suppress verbose build output.",
"default": false
},
"docsMode": {
"docs": {
"type": "boolean",
"description": "Starts Storybook in documentation mode. Learn more about it : https://storybook.js.org/docs/react/writing-docs/build-documentation#preview-storybooks-documentation.",
"default": false
Expand All @@ -47,13 +47,19 @@
"compodocArgs": {
"type": "array",
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
"default": ["-e", "json"],
"default": [
"-e",
"json"
],
"items": {
"type": "string"
}
},
"webpackStatsJson": {
"type": ["boolean", "string"],
"type": [
"boolean",
"string"
],
"description": "Write Webpack Stats JSON to disk",
"default": false
},
Expand Down Expand Up @@ -104,7 +110,9 @@
}
},
"additionalProperties": false,
"required": ["input"]
"required": [
"input"
]
},
{
"type": "string",
Expand All @@ -113,4 +121,4 @@
]
}
}
}
}
6 changes: 3 additions & 3 deletions code/frameworks/angular/src/builders/start-storybook/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { buildStandaloneErrorHandler } from '../utils/build-standalone-errors-ha
export type StorybookBuilderOptions = JsonObject & {
browserTarget?: string | null;
tsConfig?: string;
docsMode: boolean;
docs: boolean;
compodoc: boolean;
compodocArgs: string[];
styles?: StyleElement[];
Expand Down Expand Up @@ -68,7 +68,7 @@ function commandBuilder(
styles,
ci,
configDir,
docsMode,
docs,
host,
https,
port,
Expand All @@ -84,7 +84,7 @@ function commandBuilder(
packageJson: readUpSync({ cwd: __dirname }).packageJson,
ci,
configDir,
docsMode,
...(docs ? { docs } : {}),
host,
https,
port,
Expand Down
13 changes: 9 additions & 4 deletions code/frameworks/angular/src/builders/start-storybook/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
"description": "Suppress verbose build output.",
"default": false
},
"docsMode": {
"docs": {
"type": "boolean",
"description": "Starts Storybook in documentation mode. Learn more about it : https://storybook.js.org/docs/react/writing-docs/build-documentation#preview-storybooks-documentation.",
"default": false
Expand All @@ -74,7 +74,10 @@
"compodocArgs": {
"type": "array",
"description": "Compodoc options : https://compodoc.app/guides/options.html. Options `-p` with tsconfig path and `-d` with workspace root is always given.",
"default": ["-e", "json"],
"default": [
"-e",
"json"
],
"items": {
"type": "string"
}
Expand Down Expand Up @@ -126,7 +129,9 @@
}
},
"additionalProperties": false,
"required": ["input"]
"required": [
"input"
]
},
{
"type": "string",
Expand All @@ -135,4 +140,4 @@
]
}
}
}
}
1 change: 0 additions & 1 deletion code/lib/cli/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export const build = async (cliOptions: any) => {
configDir: cliOptions.configDir || './.storybook',
outputDir: cliOptions.outputDir || './storybook-static',
ignorePreview: !!cliOptions.previewUrl && !cliOptions.forceBuildPreview,
docsMode: !!cliOptions.docs,
configType: 'PRODUCTION',
cache,
packageJson: readUpSync({ cwd: __dirname }).packageJson,
Expand Down
1 change: 0 additions & 1 deletion code/lib/cli/src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ export const dev = async (cliOptions: any) => {
configDir: cliOptions.configDir || './.storybook',
configType: 'DEVELOPMENT',
ignorePreview: !!cliOptions.previewUrl && !cliOptions.forceBuildPreview,
docsMode: !!cliOptions.docs,
cache,
packageJson: readUpSync({ cwd: __dirname }).packageJson,
};
Expand Down
2 changes: 1 addition & 1 deletion docs/get-started/installation-problems/angular.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
| `"smokeTest"` | Exit Storybook after successful start. <br/> `"smokeTest": true` |
| `"ci"` | Starts Storybook in CI mode (skips interactive prompts and will not open browser window). <br/> `"ci": true` |
| `"quiet"` | Filters Storybook verbose build output. <br/> `"quiet": true` |
| `"docsMode"` | Starts Storybook in [documentation mode](../writing-docs/build-documentation.md#preview-storybooks-documentation). <br/> `"docsMode": true` |
| `"docs"` | Starts Storybook in [documentation mode](../writing-docs/build-documentation.md#preview-storybooks-documentation). <br/> `"docs": true` |
| `"styles"` | Provide the location of the [application's styles](../configure/styling-and-css.md#importing-css-files) to be used with Storybook. <br/> `"styles": ["src/styles.css", "src/styles.scss"]` <br/> |
| `"stylePreprocessorOptions"` | Provides further customization for style preprocessors resolved to the workspace root. <br/> `"stylePreprocessorOptions": { "includePaths": ["src/styles"] }` |

Expand Down