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

[Bug]: Descriptions from JSDocs not rendered for Angular stories in 7.0.0-beta.60 #21387

Closed
freon27 opened this issue Mar 3, 2023 · 14 comments · Fixed by #21629 or #25098
Closed

[Bug]: Descriptions from JSDocs not rendered for Angular stories in 7.0.0-beta.60 #21387

freon27 opened this issue Mar 3, 2023 · 14 comments · Fixed by #21629 or #25098

Comments

@freon27
Copy link

freon27 commented Mar 3, 2023

Describe the bug

I have a Storybook set up for an Angular library which is using autodocs. I have updated to CSF3.

If I put JSDocs above my exported functions, they do not appear in the Doc page, either for the main description or on the individual stories.

e.g. following the docs, I had the following, but the description is not rendered.

/**
 * It should be possible to write a description here
 */
export const ExtensionCaseSensitive = {
  render: (args: FileDropzoneComponent) => ({
    props: args,
  }),
...

To Reproduce

https://github.com/freon27/storybook-issue-repro/

The doc page for Header should show the JSDocs (as far as I understand it).

System

No response

Additional context

No response

@shilman
Copy link
Member

shilman commented Mar 17, 2023

Good golly!! I just released https://github.com/storybookjs/storybook/releases/tag/v7.0.0-rc.4 containing PR #21629 that references this issue. Upgrade today to the @next NPM tag to try it out!

npx sb@next upgrade --prerelease

@JReinhold
Copy link
Contributor

The original fix was reverted by #22048, because testing proved that it wasn't necessary anymore. However that is not the case apparently, as this issue is back.

@shilman
Copy link
Member

shilman commented Jun 12, 2023

@valentinpalkovic @vanessayuenn FYI I have verified that the reproduction still exists in the latest version of Storybook (7.0.20 as of this comment). I had to delete the package-lock.json in the repro since it references some private npm server or something. I suspect that this is only an Angular problem since I've used the comment => description behavior in React for something else today and it's working fine (at least in Vite, did not test Webpack).

@mjaysona
Copy link

Can confirm this issue still exists using Angular 14.3 and Storybook 7.0.21.

@richard-ncs
Copy link

I can confirm that this is still an issue on Storybook 7.1.0 and Angular 16. It does not recognise JSDoc on any Angular components nor does it recognise the JSDoc on the Storybook meta and stories either.

@IgorPropisnov
Copy link

I can confirm that this is still an issue on Storybook 7.1.0 and Angular 16. It does not recognise JSDoc on any Angular components nor does it recognise the JSDoc on the Storybook meta and stories either.

I have the same behavior, have you already found a solution for it?

@richard-ncs
Copy link

No. The only thing I've been doing for now is adding parameter descriptions where necessary. I feel that if its not fixed soon I may have to move to building custom MDX pages for each set of stories

@ktschmincke
Copy link

I am still experiencing this issue with Angular 16 and Storybook 7.6.4

@Ruslan207
Copy link

same with angular 16.1.2 and storybook 7.6.6

@ktschmincke
Copy link

I fixed my issue. Once I properly configured compodoc with my project the autodocs started working: https://storybook.js.org/docs/essentials/controls#controls-are-not-automatically-generated-for-my-component

@bastiW
Copy link

bastiW commented Jan 16, 2024

@valentinpalkovic
Thanks for fixing the bug in 7.6.4!

It works when I have the components & storybook within the same repository. When I use a NPM Angular Monorepro (no learna or NX) it does not show the docs.

The project structure looks like this:

package.json

  "workspaces": [
    "projects/my-library",
    "projects/my-storybook"
  ],

Do I need to configure / install something inside the my-library folder, so that projects/my-storybook can use the documentation?

@valentinpalkovic
Copy link
Contributor

valentinpalkovic commented Jan 16, 2024

@bastiW
The issue is that compodoc only processes components inside the current working directory (process.cwd). There is no option currently available to configure the src folder for compodoc.

If you want to tackle this issue, you would have to change this line:https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/src/builders/utils/run-compodoc.ts#L34

Maybe we can enhance the current logic around compodocArgs.
The default for the compodocArgs options is currently ["-e", "json"]. We could say that the last item in the list defines the src folder (the default could be: ["-e", "json", "."]. In your particular case, it would be the workspace root. Then, we would remove the line. If you want to tackle this issue, you would have to change this line:https://github.com/storybookjs/storybook/blob/next/code/frameworks/angular/src/builders/utils/run-compodoc.ts#L34
and the final finalCompodocArgs must have to include the src folder as well.

Would you like to tackle this? I could support you if there are any questions.

@markb WDYT? Any concerns?

@bastiW
Copy link

bastiW commented Jan 16, 2024

I will give it try.

@bastiW
Copy link

bastiW commented Jan 17, 2024

@valentinpalkovic
Having some issues to start the angular sandbox.

Could you please help?
https://discord.com/channels/486522875931656193/839297503446695956/1197203506663260211

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment