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.

[Feature Request] use different projects for configuring storybook

See original GitHub issue

Prerequisites

Please answer the following questions for yourself before submitting an issue. YOU MAY DELETE THE PREREQUISITES SECTION.

  • I am running the latest version
  • I checked the documentation (nx.dev) and found no answer
  • I checked to make sure that this issue has not already been filed
  • I’m reporting the issue to the correct repository (not related to React, Angular or any dependency)

Expected Behavior

In my monorepo setup I have multiple angular projects all using the same UI library but with different theming that is realized by importing scss partials. When running storybook for the UI library I would like an easy was to switch between themes. Not necessarily during runtime some config option would suffice. Right now I get the following output in the console: info => Using angular project 'some-project-name' for configuring Storybook. So I guess it would be enough to have an option for saying which project storybook should use.

Or maybe there is already a way to do this and I couldn’t find it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Mubramajcommented, Jan 31, 2021

Starting at version 6.1.0 of storybook was introduced an env variable named STORYBOOK_ANGULAR_PROJECT .

In the main.js config of any .storybook folder you can set this env variable with the angular project you need, just like this:

process.env.STORYBOOK_ANGULAR_PROJECT = 'your-project-name';

Here is the link to the pull request that introduced this feature:

https://github.com/storybookjs/storybook/pull/12565

1reaction
rhutchisoncommented, Mar 26, 2020

This is an issue with @storybook/angular not nx.

https://github.com/storybookjs/storybook/blob/next/app/angular/src/server/angular-cli_config.ts#L73

My hack (add to anuglar.json)

    "storybook": {
      "projectType": "application",
      "root": "",
      "architect": {
        "build": {
          "options": {
            "tsConfig": "tsconfig.json"
          }
        }
      }
    }
Read more comments on GitHub >

github_iconTop Results From Across the Web

Configure Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
Storybook Composition
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
Publish Storybook
Storybook is a frontend workshop for building UI components and pages in isolation. Thousands of teams use it for UI development, testing, and...
Read more >
Docs Addon | Storybook: Frontend workshop for UI development
The addon-docs preset has a few configuration options that can be used to configure its babel/webpack loading behavior. Here's an example of how...
Read more >
Distribute UI across an organization - Storybook Tutorials
Adding the refs key to .storybook/main.js , allows us to compose multiple Storybooks into one. This is helpful when working with big projects...
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