-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Ensure Angular docsMode flag has effect #20711
Conversation
/cc @ndelangen |
@tmeasday, @JReinhold You have more knowledge about this. What does the error mean? |
Hmm it means that there is no Story Indexer that can handle |
This PR changes 2 lines, in passing along a single argument to reenable docs generation for Angular. It literally just renames a single key in an object (in 2 separate files) - I could not imagine it possibly impacting Story indexing in any way. |
Hey @valentinpalkovic, @JReinhold |
c5e9f0b
to
dd2651a
Compare
Y'all have this backwards I suspect. The CLI option is I think what this is doing is setting |
interesting, when I created the original PR it certainly worked with the latest v7/next at that time (the patch from the linked PR for sure works with current v6 releases, as I'm using that locally). Something must have changed internally since then?
There's also another
I'd assume it worked so far as it directly set the latter one and it got forwarded / kept included in the config option until reaching the actual builder, could be that types have been improved or gotten stricter in the meantime and it's only now filtered out somewhere in the call chain. Also at the end of the Angular builder
storybook/code/lib/core-server/src/build-static.ts Lines 37 to 41 in 8073d04
|
dd2651a
to
76a74ad
Compare
This was a good hint! I know for certain that we need to set the I have updated the PR to only set |
3feab68
to
13fb012
Compare
Some fighting with the linter later, and it all seems to run through green. 🎉
|
Ok, my apologies there was more going on here than I realised. So this is pretty confusing. There is:
Then there is:
(The above is angular, but there's also a core-server version of that) Additionally, there is:
I guess my suspicion about the indexer was wrong then? It seems an awful coincidence. Or could it be that |
Actually no! They don't do the same thing. I am unsure if |
@tmeasday So can this get merged, or do you want to investigate deeper? |
@alexandertrefz I think the reason for that (needing to set The second argument to That preset property is then read by:
I can't see any other places that either |
@tmeasday So what should be the course of action? Should we attempt to change the |
OK, I tracked it down. The problem is the essentials addon drops the docs addon if
So what's happening is that when we set This simulates what SB proper does where the CLI option is left unset if you don't pass Setting However, this is all a big mess. @shilman we should discuss this. |
Ok, discussed with @shilman. It's pretty weird that we create that mess of So the TLDR is .. it's super confusing, but the main thing is we do not ever want to set So we can merge this PR as is or drop the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexandertrefz great work, could you apply the changes @tmeasday is asking about? then it's good to merge!
afd093c
to
e5e7f5b
Compare
I have added the requested changes and renamed the |
698417d
to
4f3d12a
Compare
4f3d12a
to
b814eca
Compare
@ndelangen Just needs approval for the final workflows now and then it can get merged! |
Invited you to the org @alexandertrefz, will merge as soon as CI is green. Awesome work, thank you for contributing! |
Thank you for working through this with us! |
What I did
Fix what #20608 was setting out to do: Fixing docs generation for Angular.
#20608 fixed the issue that the angular builders accept a
docsMode
flag, but were internally attempting to read a flag calleddocs
to pass that along torunInstance
, thereby always readingundefined
and passing it along.#20608 fixed this successfully, but introduced a new bug: It now passes along the
docsMode
flag, reading the value correctly, butrunInstance
doesn't accept this flag, it looks for a flag calleddocs
.It accepts a type called
StandaloneOptions
, which is a combination ofCLIOptions
and some other types,CLIOptions
has the optional propertydocs
as can be verified here: https://github.com/storybookjs/storybook/blob/next/code/lib/types/src/modules/core-common.ts#L159I now simply read the
docsMode
flag but pass this along asdocs
. This fixes the generation successfully.