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

Angular: Fix handling of docsMode option in angular builder #20608

Merged
merged 5 commits into from
Jan 16, 2023

Conversation

ndelangen
Copy link
Member

Original PR: #18384

What I did

The docsMode option when using the angular builder had no effect when I tried to build a project using Storybook v6.5.6.
The schema for the builder documents the option with the name docsMode (matching other documentation), however the implementation tries to forward a property with the name docs and ignores the other one.

As the builder also uses the property name docsMode, no further mapping between the two names other than a simple renaming is done in this PR.
Note that the relevant schema part seems to be last updated in #15194, however the implementation was not updated back then.

@ndelangen ndelangen self-assigned this Jan 13, 2023
@ndelangen
Copy link
Member Author

@ssams would love a review on this. 🙏

@ndelangen ndelangen added bug angular patch:yes Bugfix & documentation PR that need to be picked to main branch addon: docs labels Jan 13, 2023
@ndelangen
Copy link
Member Author

@shilman I'll merge this if it goes green, since you approved the original PR

@ssams
Copy link
Contributor

ssams commented Jan 16, 2023

@ssams would love a review on this.

looks good to me

@ndelangen ndelangen changed the title git remote add ssams [email protected]:ssams/storybook.git git fetch ssams angular-builder-fix-docs-mode git switch --track ssams/angular-builder-fix-docs-mode Angular: Fix handling of docsMode option in angular builder Jan 16, 2023
@ndelangen ndelangen merged commit 08a3207 into next Jan 16, 2023
@ndelangen ndelangen deleted the angular-builder-fix-docs-mode branch January 16, 2023 17:11
@tmeasday
Copy link
Member

tmeasday commented Jan 23, 2023

The CLI flag is called --docs-- this documentation was wrong.

@ssams
Copy link
Contributor

ssams commented Jan 23, 2023

The CLI flag is called --docs-- this documentation was wrong.

well, the CLI flag may be called like this, but the Angular builder option certainly is not, Angular wouldn't event allow to run the build when validating the angular.json if using the other name in the current state:

"docsMode": {
"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
},

I've been also using this patch locally applied to the stable v6 versions for months now, so it for sure works with these (e.g. also with currently latest https://github.com/storybookjs/storybook/releases/tag/v6.5.15). When I created the original PR it also fixed everything as intended for the upcoming v7, if it really doesn't anymore then something more in the Storybook builder internals must have changed.

@shilman shilman added the patch:done Patch/release PRs already cherry-picked to main/release branch label Jan 26, 2023
shilman pushed a commit that referenced this pull request Jan 26, 2023
git remote add ssams [email protected]:ssams/storybook.git git fetch ssams angular-builder-fix-docs-mode git switch --track ssams/angular-builder-fix-docs-mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
addon: docs angular bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants