question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to create documentation.json for each project configured with storybook?

See original GitHub issue

nx g @nrwl/angular:storybook-configuration <project-name> does not create documentation.json for that specific lib / app. How to create documentation.json for each project which are configured with storybook? Can we have some kind of executor/task or so to generate it? something like: nx run project-name:generate-doc and also can it be even part of storybook runner task?

For Angular we have to do something like the below: but for multiple libs/apps how we can do this?

{
  ...
  "scripts": {
    "docs:json": "compodoc -p ./tsconfig.json -e json -d .",
    "storybook": "npm run docs:json && start-storybook -p 6006 -s src/assets",
    ...
  },
}

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
its-ratikantcommented, Jun 24, 2022

This way it works!!

"storybook-all": {
      "executor": "nx:run-commands",
      "options": {
        "commands": [
          "nx run ui-components:generate-docs-json",
          "nx run ui-components:storybook"
        ],
        "parallel": false
      }
1reaction
mandarinicommented, Jun 24, 2022

Hi there @its-ratikant !

So, I see you’re using Angular with Storybook and Nx. In that case, you can use the Storybook official documentation for how to create docs.

If you’re using React with Storybook and Nx, I dare say the process would be quite similar, here’s the Storybook documentation.

There is no executor on the Nx side at the moment to generate docs for all projects that have a Storybook configuration at once, since, I believe this could fall easily into traps - or assumptions as to how each project is configured.

However, if you do want to generate docs massively, for more than one project at the time, you can configure the storybook/build-storybook targets of your projects (in each project’s project.json) to use compodoc and generate docs. Then, you can use the run-many command, and generate the docs for all the projects you provide!

Take a look here as well. You can create your custom target and combine the storybook command into one!

Let me know if that’s helpful, or if you need any more info!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Preview and build docs - Storybook
Storybook allows you to generate a preview of the final documentation when you use the --docs flag. We recommend including it in your...
Read more >
Configure Storybook
Configure story loading ... By default, Storybook will load stories from your project based on a glob (pattern matching string) in .storybook/main.js that...
Read more >
Document for stakeholders - Storybook Tutorials - JS.ORG
Write stories, generate docs. With the Storybook Docs addon, we can generate rich documentation from existing stories to reduce maintenance time and get...
Read more >
DocsPage - Storybook - JS.ORG
It aggregates your stories, text descriptions, docgen comments, args tables, and code examples into a single page for each component. The best practice...
Read more >
JSON Schema Addon | Storybook: Frontend workshop for UI ...
1. Explore associated JSON Schema documentation, in a nicely organized fashion in the JSON Schema Explorer · 2. Configure components through Controls, copy...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found